src/gui.cpp

changeset 402
ec95fc95e5f3
parent 399
13d24c6eb423
child 409
8da2563c645a
equal deleted inserted replaced
401:89a9235b47d3 402:ec95fc95e5f3
149 // First, clear any items in the recent files menu 149 // First, clear any items in the recent files menu
150 for (QAction* recent : m_recentFiles) 150 for (QAction* recent : m_recentFiles)
151 delete recent; 151 delete recent;
152 m_recentFiles.clear(); 152 m_recentFiles.clear();
153 153
154 vector<str> files = container_cast<QStringList, vector<str>> (io_recentfiles.value.split ("@")); 154 List<str> files = container_cast<QStringList, List<str>> (io_recentfiles.value.split ("@"));
155 for (str file : c_rev<str> (files)) { 155 for (str file : c_rev<str> (files)) {
156 QAction* recent = new QAction (getIcon ("open-recent"), file, this); 156 QAction* recent = new QAction (getIcon ("open-recent"), file, this);
157 157
158 connect (recent, SIGNAL (triggered()), this, SLOT (slot_recentFile())); 158 connect (recent, SIGNAL (triggered()), this, SLOT (slot_recentFile()));
159 ui->menuOpenRecent->addAction (recent); 159 ui->menuOpenRecent->addAction (recent);
162 } 162 }
163 163
164 // ============================================================================= 164 // =============================================================================
165 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 165 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
166 // ============================================================================= 166 // =============================================================================
167 vector<LDQuickColor> quickColorsFromConfig() { 167 List<LDQuickColor> quickColorsFromConfig() {
168 vector<LDQuickColor> colors; 168 List<LDQuickColor> colors;
169 169
170 for (str colorname : gui_colortoolbar.value.split (":")) { 170 for (str colorname : gui_colortoolbar.value.split (":")) {
171 if (colorname == "|") { 171 if (colorname == "|") {
172 colors << LDQuickColor ({null, null, true}); 172 colors << LDQuickColor ({null, null, true});
173 } else { 173 } else {
251 int ForgeWindow::deleteSelection() 251 int ForgeWindow::deleteSelection()
252 { 252 {
253 if( m_sel.size() == 0 ) 253 if( m_sel.size() == 0 )
254 return 0; 254 return 0;
255 255
256 vector<LDObject*> selCopy = m_sel; 256 List<LDObject*> selCopy = m_sel;
257 int num = 0; 257 int num = 0;
258 258
259 // Delete the objects that were being selected 259 // Delete the objects that were being selected
260 for (LDObject* obj : selCopy) { 260 for (LDObject* obj : selCopy) {
261 LDOpenFile::current()->forgetObject (obj); 261 LDOpenFile::current()->forgetObject (obj);
404 // called during GL picking, in which case the GL renderer takes care 404 // called during GL picking, in which case the GL renderer takes care
405 // of the selection. 405 // of the selection.
406 if (m_renderer->picking()) 406 if (m_renderer->picking())
407 return; 407 return;
408 408
409 vector<LDObject*> priorSelection = m_sel; 409 List<LDObject*> priorSelection = m_sel;
410 410
411 // Get the objects from the object list selection 411 // Get the objects from the object list selection
412 m_sel.clear(); 412 m_sel.clear();
413 const QList<QListWidgetItem*> items = ui->objectList->selectedItems(); 413 const QList<QListWidgetItem*> items = ui->objectList->selectedItems();
414 414
620 620
621 contextMenu->exec (pos); 621 contextMenu->exec (pos);
622 } 622 }
623 623
624 // ============================================================================= 624 // =============================================================================
625 void ForgeWindow::deleteObjVector (vector<LDObject*> objs) { 625 void ForgeWindow::deleteObjVector (List<LDObject*> objs) {
626 for (LDObject* obj : objs) { 626 for (LDObject* obj : objs) {
627 LDOpenFile::current()->forgetObject (obj); 627 LDOpenFile::current()->forgetObject (obj);
628 delete obj; 628 delete obj;
629 } 629 }
630 } 630 }
631 631
632 // ============================================================================= 632 // =============================================================================
633 void ForgeWindow::deleteByColor (const short colnum) { 633 void ForgeWindow::deleteByColor (const short colnum) {
634 vector<LDObject*> objs; 634 List<LDObject*> objs;
635 for (LDObject* obj : LDOpenFile::current()->objs()) { 635 for (LDObject* obj : LDOpenFile::current()->objs()) {
636 if (!obj->isColored() || obj->color() != colnum) 636 if (!obj->isColored() || obj->color() != colnum)
637 continue; 637 continue;
638 638
639 objs << obj; 639 objs << obj;

mercurial