src/gui_actions.cpp

changeset 226
3dd9e63698cd
parent 224
805bf9ef9529
child 227
e13cd69b16dd
equal deleted inserted replaced
225:a78179b182e1 226:3dd9e63698cd
38 38
39 // ============================================================================= 39 // =============================================================================
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
41 // ============================================================================= 41 // =============================================================================
42 MAKE_ACTION (newFile, "&New", "brick", "Create a new part model.", CTRL (N)) { 42 MAKE_ACTION (newFile, "&New", "brick", "Create a new part model.", CTRL (N)) {
43 if (safeToCloseAll () == false)
44 return;
45
43 NewPartDialog::StaticDialog (); 46 NewPartDialog::StaticDialog ();
44 } 47 }
45 48
46 // ============================================================================= 49 // =============================================================================
47 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 50 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
48 // ============================================================================= 51 // =============================================================================
49 MAKE_ACTION (open, "&Open", "file-open", "Load a part model from a file.", CTRL (O)) { 52 MAKE_ACTION (open, "&Open", "file-open", "Load a part model from a file.", CTRL (O)) {
53 if (safeToCloseAll () == false)
54 return;
55
50 str name = QFileDialog::getOpenFileName (g_win, "Open File", "", "LDraw files (*.dat *.ldr)"); 56 str name = QFileDialog::getOpenFileName (g_win, "Open File", "", "LDraw files (*.dat *.ldr)");
51 57
52 if (~name) 58 if (name.len () == 0)
53 openMainFile (name); 59 return;
60
61 closeAll ();
62 openMainFile (name);
54 } 63 }
55 64
56 // ============================================================================= 65 // =============================================================================
57 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 66 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
58 // ============================================================================= 67 // =============================================================================

mercurial