#include "ui/qg_insertoptions.h"
#include "ui/qg_layerdialog.h"
#include "ui/qg_libraryinsertoptions.h"
-#include "ui/qg_lineangleoptions.h"
-#include "ui/qg_linebisectoroptions.h"
+ #include "ui/qg_lineangleoptions.h"
+ #include "ui/qg_linebisectoroptions.h"
#include "ui/qg_lineoptions.h"
-#include "ui/qg_lineparalleloptions.h"
-#include "ui/qg_lineparallelthroughoptions.h"
-#include "ui/qg_linepolygon2options.h"
-#include "ui/qg_linepolygonoptions.h"
-#include "ui/qg_linerelangleoptions.h"
+ #include "ui/qg_lineparalleloptions.h"
+ #include "ui/qg_lineparallelthroughoptions.h"
+ #include "ui/qg_linepolygon2options.h"
+ #include "ui/qg_linepolygonoptions.h"
+ #include "ui/qg_linerelangleoptions.h"
#include "ui/qg_mousewidget.h"
-#include "ui/qg_moverotateoptions.h"
+ #include "ui/qg_moverotateoptions.h"
#include "ui/qg_printpreviewoptions.h"
-#include "ui/qg_roundoptions.h"
+ #include "ui/qg_roundoptions.h"
#include "ui/qg_selectionwidget.h"
-#include "ui/qg_snapdistoptions.h"
+ #include "ui/qg_snapdistoptions.h"
#include "ui/qg_splineoptions.h"
#include "ui/qg_textoptions.h"
#include "ui/qg_trimamountoptions.h"
#include "dlgtext.h"
#include "imageoptions.h"
#include "layerdialog.h"
+#include "lineangleoptions.h"
+#include "linebisectoroptions.h"
#include "lineoptions.h"
+#include "lineparalleloptions.h"
+#include "lineparallelthroughoptions.h"
+#include "linepolygon2options.h"
+#include "linepolygonoptions.h"
+#include "linerelangleoptions.h"
#include "mousewidget.h"
+#include "moverotateoptions.h"
#include "printpreviewoptions.h"
+#include "roundoptions.h"
#include "selectionwidget.h"
+#include "snapdistoptions.h"
#include "splineoptions.h"
#include "textoptions.h"
#include "trimamountoptions.h"
void QG_DialogFactory::requestPolylineOptions(RS_ActionInterface * action, bool on, bool update)
{
#ifdef RS_PROF
- static QG_PolylineOptions * toolWidget = NULL;
+ static PolylineOptions * toolWidget = NULL;
if (optionWidget != NULL)
{
}
if (on && toolWidget == NULL)
{
- toolWidget = new QG_PolylineOptions(optionWidget);
+ toolWidget = new PolylineOptions(optionWidget);
toolWidget->setAction(action, update);
}
}
#if 0
/**
- * Shows a widget for options for the action: "draw line parallel"
- */
-void QG_DialogFactory::requestLineParallelOptions(RS_ActionInterface * action, bool on, bool update)
-{
- static QG_LineParallelOptions* toolWidget = NULL;
-
- if (optionWidget!=NULL) {
- if (toolWidget!=NULL) {
- delete toolWidget;
- toolWidget = NULL;
- }
- if (on==true && toolWidget==NULL) {
- toolWidget = new QG_LineParallelOptions(optionWidget);
- toolWidget->setAction(action, update);
- }
- }
-}
-
-/**
- * Shows a widget for options for the action: "draw line parallel through"
+ * Shows a widget for insert options.
*/
-void QG_DialogFactory::requestLineParallelThroughOptions(RS_ActionInterface* action,
- bool on, bool update)
+void QG_DialogFactory::requestInsertOptions(RS_ActionInterface* action,
+ bool on, bool update)
{
- static QG_LineParallelThroughOptions* toolWidget = NULL;
+ static QG_InsertOptions* toolWidget = NULL;
if (optionWidget!=NULL) {
if (toolWidget!=NULL) {
toolWidget = NULL;
}
if (on==true && toolWidget==NULL) {
- toolWidget = new QG_LineParallelThroughOptions(optionWidget);
+ toolWidget = new QG_InsertOptions(optionWidget);
toolWidget->setAction(action, update);
}
}
}
/**
- * Shows a widget for options for the action: "line angle"
+ * Shows a widget for image options.
*/
-void QG_DialogFactory::requestLineAngleOptions(RS_ActionInterface* action,
+void QG_DialogFactory::requestImageOptions(RS_ActionInterface* action,
bool on, bool update)
{
- static QG_LineAngleOptions* toolWidget = NULL;
+ static QG_ImageOptions* toolWidget = NULL;
if (optionWidget!=NULL) {
if (toolWidget!=NULL) {
toolWidget = NULL;
}
if (on==true && toolWidget==NULL) {
- toolWidget = new QG_LineAngleOptions(optionWidget);
+ toolWidget = new QG_ImageOptions(optionWidget);
toolWidget->setAction(action, update);
- //toolWidget->setData(&angle, &length, fixedAngle, update);
}
}
}
/**
- * Shows a widget for options for the action: "line relative angle"
+ * Shows a widget for library insert options.
*/
-void QG_DialogFactory::requestLineRelAngleOptions(RS_ActionInterface* action,
+void QG_DialogFactory::requestLibraryInsertOptions(RS_ActionInterface* action,
bool on, bool update)
{
- static QG_LineRelAngleOptions* toolWidget = NULL;
+ static QG_LibraryInsertOptions* toolWidget = NULL;
if (optionWidget!=NULL) {
if (toolWidget!=NULL) {
toolWidget = NULL;
}
if (on==true && toolWidget==NULL) {
- toolWidget = new QG_LineRelAngleOptions(optionWidget);
+ toolWidget = new QG_LibraryInsertOptions(optionWidget);
toolWidget->setAction(action, update);
- //toolWidget->setData(&angle, &length, fixedAngle, update);
}
}
}
-
+#else
/**
- * Shows a widget for options for the action: "line angle"
+ * Shows a widget for options for the action: "draw line parallel"
*/
-void QG_DialogFactory::requestLineBisectorOptions(RS_ActionInterface* action,
- bool on, bool update)
+void QG_DialogFactory::requestLineParallelOptions(RS_ActionInterface * action, bool on, bool update)
{
- static QG_LineBisectorOptions* toolWidget = NULL;
+ static LineParallelOptions * toolWidget = NULL;
- if (optionWidget!=NULL) {
- if (toolWidget!=NULL) {
+ if (optionWidget!=NULL)
+ {
+ if (toolWidget!=NULL)
+ {
delete toolWidget;
toolWidget = NULL;
}
- if (on==true && toolWidget==NULL) {
- toolWidget = new QG_LineBisectorOptions(optionWidget);
+ if (on==true && toolWidget==NULL)
+ {
+ toolWidget = new LineParallelOptions(optionWidget);
toolWidget->setAction(action, update);
}
}
}
/**
- * Shows a widget for options for the action: "draw polygon"
+ * Shows a widget for options for the action: "draw line parallel through"
*/
-void QG_DialogFactory::requestLinePolygonOptions(RS_ActionInterface* action,
- bool on, bool update)
+void QG_DialogFactory::requestLineParallelThroughOptions(RS_ActionInterface * action, bool on, bool update)
{
- static QG_LinePolygonOptions* toolWidget = NULL;
+ static LineParallelThroughOptions * toolWidget = NULL;
if (optionWidget!=NULL) {
if (toolWidget!=NULL) {
toolWidget = NULL;
}
if (on==true && toolWidget==NULL) {
- toolWidget = new QG_LinePolygonOptions(optionWidget);
+ toolWidget = new LineParallelThroughOptions(optionWidget);
toolWidget->setAction(action, update);
}
}
}
/**
- * Shows a widget for options for the action: "draw polygon2"
+ * Shows a widget for options for the action: "line angle"
*/
-void QG_DialogFactory::requestLinePolygon2Options(RS_ActionInterface* action,
- bool on, bool update)
+void QG_DialogFactory::requestLineAngleOptions(RS_ActionInterface * action, bool on, bool update)
{
- static QG_LinePolygon2Options* toolWidget = NULL;
+ static LineAngleOptions * toolWidget = NULL;
- if (optionWidget!=NULL) {
- if (toolWidget!=NULL) {
- delete toolWidget;
- toolWidget = NULL;
- }
- if (on==true && toolWidget==NULL) {
- toolWidget = new QG_LinePolygon2Options(optionWidget);
- toolWidget->setAction(action, update);
- }
- }
-}
+ if (!optionWidget)
+ return;
-/**
- * Shows a widget for insert options.
- */
-void QG_DialogFactory::requestInsertOptions(RS_ActionInterface* action,
- bool on, bool update)
-{
- static QG_InsertOptions* toolWidget = NULL;
+ if (toolWidget)
+ {
+ delete toolWidget;
+ toolWidget = NULL;
+ }
- if (optionWidget!=NULL) {
- if (toolWidget!=NULL) {
- delete toolWidget;
- toolWidget = NULL;
- }
- if (on==true && toolWidget==NULL) {
- toolWidget = new QG_InsertOptions(optionWidget);
- toolWidget->setAction(action, update);
- }
- }
+ if (on)
+ {
+ toolWidget = new LineAngleOptions(optionWidget);
+ toolWidget->setAction(action, update);
+ }
}
/**
- * Shows a widget for image options.
+ * Shows a widget for options for the action: "line relative angle"
*/
-void QG_DialogFactory::requestImageOptions(RS_ActionInterface* action,
- bool on, bool update)
+void QG_DialogFactory::requestLineRelAngleOptions(RS_ActionInterface * action, bool on, bool update)
{
- static QG_ImageOptions* toolWidget = NULL;
+ static LineRelAngleOptions * toolWidget = NULL;
- if (optionWidget!=NULL) {
- if (toolWidget!=NULL) {
- delete toolWidget;
- toolWidget = NULL;
- }
- if (on==true && toolWidget==NULL) {
- toolWidget = new QG_ImageOptions(optionWidget);
- toolWidget->setAction(action, update);
- }
- }
-}
+ if (!optionWidget)
+ return;
-/**
- * Shows a widget for 'snap to a point with a given distance' options.
- */
-void QG_DialogFactory::requestSnapDistOptions(double& dist, bool on)
-{
- static QG_SnapDistOptions* toolWidget = NULL;
+ if (toolWidget)
+ {
+ delete toolWidget;
+ toolWidget = NULL;
+ }
- if (optionWidget!=NULL) {
- if (toolWidget!=NULL) {
- delete toolWidget;
- toolWidget = NULL;
- }
- if (on==true && toolWidget==NULL) {
- toolWidget = new QG_SnapDistOptions(optionWidget);
- toolWidget->setDist(&dist);
- }
- }
+ if (on)
+ {
+ toolWidget = new LineRelAngleOptions(optionWidget);
+ toolWidget->setAction(action, update);
+ }
}
/**
- * Shows a widget for 'snap to a point with a given distance' options.
+ * Shows a widget for options for the action: "line angle"
*/
-void QG_DialogFactory::requestMoveRotateOptions(RS_ActionInterface* action,
- bool on, bool update)
+void QG_DialogFactory::requestLineBisectorOptions(RS_ActionInterface * action, bool on, bool update)
{
- static QG_MoveRotateOptions* toolWidget = NULL;
+ static LineBisectorOptions * toolWidget = NULL;
if (optionWidget!=NULL) {
if (toolWidget!=NULL) {
toolWidget = NULL;
}
if (on==true && toolWidget==NULL) {
- toolWidget = new QG_MoveRotateOptions(optionWidget);
+ toolWidget = new LineBisectorOptions(optionWidget);
toolWidget->setAction(action, update);
}
}
}
/**
- * Shows a widget for rounding options.
+ * Shows a widget for options for the action: "draw polygon"
*/
-void QG_DialogFactory::requestRoundOptions(RS_ActionInterface* action,
- bool on, bool update)
+void QG_DialogFactory::requestLinePolygonOptions(RS_ActionInterface * action, bool on, bool update)
{
- static QG_RoundOptions* toolWidget = NULL;
+ static LinePolygonOptions * toolWidget = NULL;
if (optionWidget!=NULL) {
if (toolWidget!=NULL) {
toolWidget = NULL;
}
if (on==true && toolWidget==NULL) {
- toolWidget = new QG_RoundOptions(optionWidget);
+ toolWidget = new LinePolygonOptions(optionWidget);
toolWidget->setAction(action, update);
}
}
}
/**
- * Shows a widget for library insert options.
+ * Shows a widget for options for the action: "draw polygon2"
*/
-void QG_DialogFactory::requestLibraryInsertOptions(RS_ActionInterface* action,
- bool on, bool update)
+void QG_DialogFactory::requestLinePolygon2Options(RS_ActionInterface * action, bool on, bool update)
{
- static QG_LibraryInsertOptions* toolWidget = NULL;
+ static LinePolygon2Options * toolWidget = NULL;
if (optionWidget!=NULL) {
if (toolWidget!=NULL) {
toolWidget = NULL;
}
if (on==true && toolWidget==NULL) {
- toolWidget = new QG_LibraryInsertOptions(optionWidget);
+ toolWidget = new LinePolygon2Options(optionWidget);
toolWidget->setAction(action, update);
}
}
}
-#else
-void QG_DialogFactory::requestLineParallelOptions(RS_ActionInterface * action, bool on, bool update)
-{
-}
-
-void QG_DialogFactory::requestLineParallelThroughOptions(RS_ActionInterface* action, bool on, bool update)
-{
-}
-
-void QG_DialogFactory::requestLineAngleOptions(RS_ActionInterface* action, bool on, bool update)
-{
-}
-
-void QG_DialogFactory::requestLineRelAngleOptions(RS_ActionInterface* action, bool on, bool update)
-{
-}
-
-void QG_DialogFactory::requestLineBisectorOptions(RS_ActionInterface* action, bool on, bool update)
-{
-}
-
-void QG_DialogFactory::requestLinePolygonOptions(RS_ActionInterface* action, bool on, bool update)
-{
-}
-
-void QG_DialogFactory::requestLinePolygon2Options(RS_ActionInterface* action, bool on, bool update)
-{
-}
/**
* Shows a widget for arc options.
}
}
-void QG_DialogFactory::requestSnapDistOptions(double& dist, bool on)
+/**
+ * Shows a widget for 'snap to a point with a given distance' options.
+ */
+void QG_DialogFactory::requestSnapDistOptions(double & dist, bool on)
{
+ static SnapDistOptions * toolWidget = NULL;
+
+ if (!optionWidget)
+ return;
+
+ if (toolWidget)
+ {
+ delete toolWidget;
+ toolWidget = NULL;
+ }
+
+ if (on)
+ {
+ toolWidget = new SnapDistOptions(optionWidget);
+ toolWidget->setDist(&dist);
+ }
}
-void QG_DialogFactory::requestMoveRotateOptions(RS_ActionInterface* action, bool on, bool update)
+/**
+ * Shows a widget for 'snap to a point with a given distance' options.
+ */
+void QG_DialogFactory::requestMoveRotateOptions(RS_ActionInterface * action, bool on, bool update)
{
+ static MoveRotateOptions * toolWidget = NULL;
+
+ if (!optionWidget)
+ return;
+
+ if (toolWidget)
+ {
+ delete toolWidget;
+ toolWidget = NULL;
+ }
+
+ if (on)
+ {
+ toolWidget = new MoveRotateOptions(optionWidget);
+ toolWidget->setAction(action, update);
+ }
}
/**
}
}
-void QG_DialogFactory::requestRoundOptions(RS_ActionInterface* action, bool on, bool update)
+/**
+ * Shows a widget for rounding options.
+ */
+void QG_DialogFactory::requestRoundOptions(RS_ActionInterface * action, bool on, bool update)
{
+ static RoundOptions * toolWidget = NULL;
+
+ if (!optionWidget)
+ return;
+
+ if (toolWidget)
+ {
+ delete toolWidget;
+ toolWidget = NULL;
+ }
+
+ if (on)
+ {
+ toolWidget = new RoundOptions(optionWidget);
+ toolWidget->setAction(action, update);
+ }
}
void QG_DialogFactory::requestLibraryInsertOptions(RS_ActionInterface* action, bool on, bool update)