src/gui_actions.cpp

changeset 251
c4b96bc41298
parent 250
6e80f038e8df
child 252
3f9067022d74
equal deleted inserted replaced
250:6e80f038e8df 251:c4b96bc41298
308 if (!fp) { 308 if (!fp) {
309 critical (fmt ("Couldn't open %s\n%s", fname.chars(), strerror (errno))); 309 critical (fmt ("Couldn't open %s\n%s", fname.chars(), strerror (errno)));
310 return; 310 return;
311 } 311 }
312 312
313 std::vector<LDObject*> historyCopies; 313 vector<LDObject*> historyCopies;
314 std::vector<ulong> historyIndices; 314 vector<ulong> historyIndices;
315 std::vector<LDObject*> objs = loadFileContents (fp, null); 315 vector<LDObject*> objs = loadFileContents (fp, null);
316 316
317 g_win->sel ().clear (); 317 g_win->sel ().clear ();
318 318
319 for (LDObject* obj : objs) { 319 for (LDObject* obj : objs) {
320 historyCopies.push_back (obj->clone ()); 320 historyCopies.push_back (obj->clone ());
340 340
341 QDialog* const dlg = new QDialog; 341 QDialog* const dlg = new QDialog;
342 QVBoxLayout* const layout = new QVBoxLayout; 342 QVBoxLayout* const layout = new QVBoxLayout;
343 QTextEdit* const te_edit = new QTextEdit; 343 QTextEdit* const te_edit = new QTextEdit;
344 QDialogButtonBox* const bbx_buttons = new QDialogButtonBox (QDialogButtonBox::Ok | QDialogButtonBox::Cancel); 344 QDialogButtonBox* const bbx_buttons = new QDialogButtonBox (QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
345 std::vector<LDObject*> historyCopies; 345 vector<LDObject*> historyCopies;
346 std::vector<ulong> historyIndices; 346 vector<ulong> historyIndices;
347 347
348 layout->addWidget (te_edit); 348 layout->addWidget (te_edit);
349 layout->addWidget (bbx_buttons); 349 layout->addWidget (bbx_buttons);
350 dlg->setLayout (layout); 350 dlg->setLayout (layout);
351 dlg->setWindowTitle (APPNAME ": Insert Raw"); 351 dlg->setWindowTitle (APPNAME ": Insert Raw");
428 g_win->R ()->clearOverlay (); 428 g_win->R ()->clearOverlay ();
429 } 429 }
430 430
431 // ========================================================================================================================================= 431 // =========================================================================================================================================
432 MAKE_ACTION (modeSelect, "Select Mode", "mode-select", "Select objects from the camera view.", CTRL (1)) { 432 MAKE_ACTION (modeSelect, "Select Mode", "mode-select", "Select objects from the camera view.", CTRL (1)) {
433 g_win->R ()->setEditMode (GL::Select); 433 g_win->R ()->setEditMode (Select);
434 } 434 }
435 435
436 MAKE_ACTION (modeDraw, "Draw Mode", "mode-draw", "Draw objects into the camera view.", CTRL (2)) { 436 MAKE_ACTION (modeDraw, "Draw Mode", "mode-draw", "Draw objects into the camera view.", CTRL (2)) {
437 g_win->R ()->setEditMode (GL::Draw); 437 g_win->R ()->setEditMode (Draw);
438 } 438 }
439 439
440 // ========================================================================================================================================= 440 // =========================================================================================================================================
441 MAKE_ACTION (setDrawDepth, "Set Depth Value", "depth-value", "Set the depth coordinate of the current camera.", (0)) { 441 MAKE_ACTION (setDrawDepth, "Set Depth Value", "depth-value", "Set the depth coordinate of the current camera.", (0)) {
442 if (g_win->R ()->camera () == GL::Free) 442 if (g_win->R ()->camera () == GL::Free)

mercurial