]> Shamusworld >> Repos - architektonas/blobdiff - src/base/actioninterface.cpp
In the middle of chasing down MDI not activating bug, renaming of Graphic to
[architektonas] / src / base / actioninterface.cpp
index 17d1da9f3ba958e95fdeeb77099f5936eb5bdf2a..00c5439c944c7fa544807a94d41c778e0dd4e4a5 100644 (file)
@@ -30,6 +30,8 @@ I think what's needed here is for the constructor to save the state of the snapp
 and to restore it in the destructor. This, of course, assumes that the actions are
 created and used in a certain order, perhaps that needs enforcement? Dunno, but worth
 a try as suspend() and resume() seem to fuck it up badly.
+#define _ASSUAN_DEPRECATED  __attribute__ ((__deprecated__))
+on MS it's: __declspec(deprecated)
 */
 
 /**
@@ -51,18 +53,27 @@ ActionInterface::ActionInterface(const char * name, EntityContainer & ec,
 {
        DEBUG->print("ActionInterface::ActionInterface: Setting up action: \"%s\"", name);
 
+// Is it? Doesn't seem like it. Whenever you change snap types, the preview disappears.
+// Not sure what's going on with that.
+//This doesn't work properly; not sure why that is...
+//Actually, it's working perfectly. Now we just need to propagate the fixes everywhere. :-/
+       // We'll use snapperVisibility for the save/restore functionality...
+       snapperVisibility = graphicView->SnapperVisible();
+
        this->name = name;
        status = 0;
        finished = false;
 
        // Graphic provides a pointer to the graphic if the entity container is a
-       // graphic (i.e. can also hold layers).
-       graphic = ec.getGraphic();
+       // drawing (i.e. can also hold layers).
+#warning "!!! Need to rename graphic to drawing !!!"
+       graphic = ec.GetDrawing();
 
        // Document pointer will be used for undo / redo
        document = ec.getDocument();
 
        // \o/ \o/ \o/ BY GRABTHAR'S HAMMER, IT HAS BEEN EXPUNGED!!! \o/ \o/ \o/
+
        // This is here until I can figure out a better way to contain all of this
        // circular referential nonsense that exists in this codebase. It will be
        // expunged, by Grabthar's Hammer!
@@ -75,7 +86,7 @@ ActionInterface::ActionInterface(const char * name, EntityContainer & ec,
        graphicView->preview.SetVisible();
 
        DEBUG->print("ActionInterface::ActionInterface: Setting up action: \"%s\": OK", name);
-printf("ActionInterface::ActionInterface() [%08X]\n", this);
+//printf("ActionInterface::ActionInterface() [%08X]\n", this);
 }
 
 /**
@@ -86,7 +97,10 @@ printf("ActionInterface::ActionInterface() [%08X]\n", this);
        // would be pure virtual now:
        // hideOptions();
 //JLH: Only it isn't pure virtual...
-printf("ActionInterface::~ActionInterface() [%08X]\n", this);
+//printf("ActionInterface::~ActionInterface() [%08X]\n", this);
+
+       // We'll use snapperVisibility for the save/restore functionality...
+       graphicView->SetSnapperVisible(snapperVisibility);
 }
 
 /**
@@ -316,6 +330,9 @@ void ActionInterface::finish()
        // hm.
 //     graphicView->snapper.SetVisible(false);
        graphicView->SetSnapperVisible(false);
+//Short circuit the destructor fuxoring with this:
+//snapperVisibility = false;
+//Only it causes other stuff to be fuxorred... Grr... Not sure how to fix this...
        graphicView->preview.SetVisible(false);
 //     graphicView->preview.clear();
        graphicView->redraw();  //hm.