]> Shamusworld >> Repos - architektonas/blobdiff - src/widgets/qg_dialogfactory.cpp
Added more missing forms, fixed missing header files in MdiWindow
[architektonas] / src / widgets / qg_dialogfactory.cpp
index 632ce8dc174b21c78bfe7e92a1b79b77c58db9ea..1238d8e054e7dbb310fc2905ca6d04ecf63befeb 100644 (file)
@@ -33,8 +33,8 @@
        #include "ui/qg_circleoptions.h"
        #include "ui/qg_commandwidget.h"
        #include "ui/qg_coordinatewidget.h"
-#include "ui/qg_dimlinearoptions.h"
-#include "ui/qg_dimoptions.h"
+       #include "ui/qg_dimlinearoptions.h"
+       #include "ui/qg_dimoptions.h"
 #include "ui/qg_dlgarc.h"
        #include "ui/qg_dlgattributes.h"
 #include "ui/qg_dlgcircle.h"
@@ -73,9 +73,9 @@
 #include "ui/qg_roundoptions.h"
        #include "ui/qg_selectionwidget.h"
 #include "ui/qg_snapdistoptions.h"
-#include "ui/qg_splineoptions.h"
+       #include "ui/qg_splineoptions.h"
        #include "ui/qg_textoptions.h"
-#include "ui/qg_trimamountoptions.h"
+       #include "ui/qg_trimamountoptions.h"
 #endif
 #include "arcoptions.h"
 #include "arctangentialoptions.h"
@@ -85,6 +85,8 @@
 #include "circleoptions.h"
 #include "commandwidget.h"
 #include "coordinatewidget.h"
+#include "dimlinearoptions.h"
+#include "dimoptions.h"
 #include "dlgattributes.h"
 #include "dlgoptionsdrawing.h"
 #include "dlgoptionsgeneral.h"
@@ -95,7 +97,9 @@
 #include "mousewidget.h"
 #include "printpreviewoptions.h"
 #include "selectionwidget.h"
+#include "splineoptions.h"
 #include "textoptions.h"
+#include "trimamountoptions.h"
 
 #ifdef RS_PROF
 #include "qg_polylineoptions.h"
@@ -1080,26 +1084,6 @@ void QG_DialogFactory::requestLinePolygon2Options(RS_ActionInterface* action,
     }
 }
 
-/**
- * Shows a widget for spline options.
- */
-void QG_DialogFactory::requestSplineOptions(RS_ActionInterface* action,
-        bool on, bool update)
-{
-    static QG_SplineOptions* toolWidget = NULL;
-
-    if (optionWidget!=NULL) {
-        if (toolWidget!=NULL) {
-            delete toolWidget;
-            toolWidget = NULL;
-        }
-        if (on==true && toolWidget==NULL) {
-            toolWidget = new QG_SplineOptions(optionWidget);
-            toolWidget->setAction(action, update);
-        }
-    }
-}
-
 /**
  * Shows a widget for insert options.
  */
@@ -1140,48 +1124,6 @@ void QG_DialogFactory::requestImageOptions(RS_ActionInterface* action,
     }
 }
 
-/**
- * Shows a widget for dimension options.
- */
-void QG_DialogFactory::requestDimensionOptions(RS_ActionInterface* action,
-        bool on, bool update)
-{
-    //static QLabel* l = NULL;
-    static QG_DimOptions* toolWidget = NULL;
-
-    if (optionWidget!=NULL) {
-        if (toolWidget!=NULL) {
-            delete toolWidget;
-            toolWidget = NULL;
-        }
-        if (on==true && toolWidget==NULL) {
-            toolWidget = new QG_DimOptions(optionWidget);
-            toolWidget->setAction(action, update);
-        }
-    }
-}
-
-/**
- * Shows a widget for linear dimension options.
- */
-void QG_DialogFactory::requestDimLinearOptions(RS_ActionInterface* action,
-        bool on, bool update)
-{
-    //static QLabel* l = NULL;
-    static QG_DimLinearOptions* toolWidget = NULL;
-
-    if (optionWidget!=NULL) {
-        if (toolWidget!=NULL) {
-            delete toolWidget;
-            toolWidget = NULL;
-        }
-        if (on==true && toolWidget==NULL) {
-            toolWidget = new QG_DimLinearOptions(optionWidget);
-            toolWidget->setAction(action, update);
-        }
-    }
-}
-
 /**
  * Shows a widget for 'snap to a point with a given distance' options.
  */
@@ -1221,26 +1163,6 @@ void QG_DialogFactory::requestMoveRotateOptions(RS_ActionInterface* action,
     }
 }
 
-/**
- * Shows a widget for 'trim amount' options.
- */
-void QG_DialogFactory::requestTrimAmountOptions(RS_ActionInterface* action,
-        bool on, bool update)
-{
-    static QG_TrimAmountOptions* toolWidget = NULL;
-
-    if (optionWidget!=NULL) {
-        if (toolWidget!=NULL) {
-            delete toolWidget;
-            toolWidget = NULL;
-        }
-        if (on==true && toolWidget==NULL) {
-            toolWidget = new QG_TrimAmountOptions(optionWidget);
-            toolWidget->setAction(action, update);
-        }
-    }
-}
-
 /**
  * Shows a widget for rounding options.
  */
@@ -1380,8 +1302,23 @@ void QG_DialogFactory::requestCircleOptions(RS_ActionInterface * action, bool on
     }
 }
 
-void QG_DialogFactory::requestSplineOptions(RS_ActionInterface* action, bool on, bool update)
+/**
+ * Shows a widget for spline options.
+ */
+void QG_DialogFactory::requestSplineOptions(RS_ActionInterface * action, bool on, bool update)
 {
+       static SplineOptions * toolWidget = NULL;
+
+       if (optionWidget!=NULL) {
+               if (toolWidget!=NULL) {
+                       delete toolWidget;
+                       toolWidget = NULL;
+               }
+               if (on==true && toolWidget==NULL) {
+                       toolWidget = new SplineOptions(optionWidget);
+                       toolWidget->setAction(action, update);
+               }
+       }
 }
 
 /**
@@ -1415,12 +1352,46 @@ void QG_DialogFactory::requestImageOptions(RS_ActionInterface* action, bool on,
 {
 }
 
-void QG_DialogFactory::requestDimensionOptions(RS_ActionInterface* action, bool on, bool update)
+/**
+ * Shows a widget for dimension options.
+ */
+void QG_DialogFactory::requestDimensionOptions(RS_ActionInterface * action, bool on, bool update)
 {
+    static DimOptions * toolWidget = NULL;
+
+    if (optionWidget!=NULL) {
+        if (toolWidget!=NULL) {
+            delete toolWidget;
+            toolWidget = NULL;
+        }
+        if (on==true && toolWidget==NULL) {
+            toolWidget = new DimOptions(optionWidget);
+            toolWidget->setAction(action, update);
+        }
+    }
 }
 
-void QG_DialogFactory::requestDimLinearOptions(RS_ActionInterface* action, bool on, bool update)
+/**
+ * Shows a widget for linear dimension options.
+ */
+void QG_DialogFactory::requestDimLinearOptions(RS_ActionInterface * action, bool on, bool update)
 {
+       static DimLinearOptions * toolWidget = NULL;
+
+       if (!optionWidget)
+               return;
+
+       if (toolWidget)
+       {
+               delete toolWidget;
+               toolWidget = NULL;
+       }
+
+       if (on)
+       {
+               toolWidget = new DimLinearOptions(optionWidget);
+               toolWidget->setAction(action, update);
+       }
 }
 
 void QG_DialogFactory::requestSnapDistOptions(double& dist, bool on)
@@ -1431,8 +1402,27 @@ void QG_DialogFactory::requestMoveRotateOptions(RS_ActionInterface* action, bool
 {
 }
 
-void QG_DialogFactory::requestTrimAmountOptions(RS_ActionInterface* action, bool on, bool update)
+/**
+ * Shows a widget for 'trim amount' options.
+ */
+void QG_DialogFactory::requestTrimAmountOptions(RS_ActionInterface * action, bool on, bool update)
 {
+       static TrimAmountOptions * toolWidget = NULL;
+
+       if (!optionWidget)
+               return;
+
+       if (toolWidget)
+       {
+               delete toolWidget;
+               toolWidget = NULL;
+       }
+
+       if (on)
+       {
+               toolWidget = new TrimAmountOptions(optionWidget);
+               toolWidget->setAction(action, update);
+       }
 }
 
 /**