src/actions/MainActions.cc

changeset 697
2766f7b037ad
parent 644
93dcd1a0e4bd
equal deleted inserted replaced
696:35d2c1979d79 697:2766f7b037ad
33 #include "../GLRenderer.h" 33 #include "../GLRenderer.h"
34 #include "../Dialogs.h" 34 #include "../Dialogs.h"
35 #include "../Primitives.h" 35 #include "../Primitives.h"
36 #include "../Widgets.h" 36 #include "../Widgets.h"
37 #include "../Colors.h" 37 #include "../Colors.h"
38 #include "../GLCompiler.h"
38 #include "ui_newpart.h" 39 #include "ui_newpart.h"
39 40
40 extern_cfg (Bool, gl_wireframe); 41 extern_cfg (Bool, gl_wireframe);
41 extern_cfg (Bool, gl_colorbfc); 42 extern_cfg (Bool, gl_colorbfc);
42 extern_cfg (String, ld_defaultname); 43 extern_cfg (String, ld_defaultname);
469 { 470 {
470 LDObject* obj = parseLine (line); 471 LDObject* obj = parseLine (line);
471 472
472 getCurrentDocument()->insertObj (idx, obj); 473 getCurrentDocument()->insertObj (idx, obj);
473 obj->select(); 474 obj->select();
474 R()->compileObject (obj);
475 idx++; 475 idx++;
476 } 476 }
477 477
478 refresh(); 478 refresh();
479 scrollToSelection(); 479 scrollToSelection();
845 // Remove the selection now 845 // Remove the selection now
846 for (LDObject* obj : selection()) 846 for (LDObject* obj : selection())
847 obj->destroy(); 847 obj->destroy();
848 848
849 // Compile all objects in the new subfile 849 // Compile all objects in the new subfile
850 for (LDObject* obj : doc->objects()) 850 R()->compiler()->compileDocument (doc);
851 R()->compileObject (obj);
852
853 g_loadedFiles << doc; 851 g_loadedFiles << doc;
854 852
855 // Add a reference to the new subfile to where the selection was 853 // Add a reference to the new subfile to where the selection was
856 LDSubfile* ref = new LDSubfile(); 854 LDSubfile* ref = new LDSubfile();
857 ref->setColor (maincolor); 855 ref->setColor (maincolor);

mercurial