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 // ============================================================================= |