53 // |
53 // |
54 // Performs the Set Contents dialog on the given LDObject. Object's contents |
54 // Performs the Set Contents dialog on the given LDObject. Object's contents |
55 // are exposed to the user and is reinterpreted if the user accepts the new |
55 // are exposed to the user and is reinterpreted if the user accepts the new |
56 // contents. |
56 // contents. |
57 // ============================================================================= |
57 // ============================================================================= |
58 void Dialog_SetContents::staticDialog (LDObject* obj, LDForgeWindow* parent) { |
58 void Dialog_SetContents::staticDialog (LDObject* obj, ForgeWindow* parent) { |
59 if (!obj) |
59 if (!obj) |
60 return; |
60 return; |
61 |
61 |
62 Dialog_SetContents dlg (obj, parent); |
62 Dialog_SetContents dlg (obj, parent); |
63 if (dlg.exec ()) { |
63 if (dlg.exec ()) { |
64 LDObject* oldobj = obj; |
64 LDObject* oldobj = obj; |
65 |
65 |
66 // Reinterpret it from the text of the input field |
66 // Reinterpret it from the text of the input field |
67 obj = ParseLine (dlg.qContents->text ().toStdString ().c_str ()); |
67 obj = parseLine (dlg.qContents->text ().toStdString ().c_str ()); |
68 |
68 |
69 // Remove the old object |
69 // Remove the old object |
70 delete oldobj; |
70 delete oldobj; |
71 |
71 |
72 // Replace all instances of the old object with the new object |
72 // Replace all instances of the old object with the new object |