Code

Spray Tool by the students at Ecole Centrale de Lyon, Lyon, France
[inkscape.git] / src / ui / dialog / dialog-manager.cpp
index 227814cd1f45952b99f47e5a3b0bc0851f04983c..7f853bedcdd17b75034ed3ea5026fa1d719205b8 100644 (file)
@@ -1,13 +1,13 @@
-/**
- * \brief Object for managing a set of dialogs, including their signals and
+/** @file
+ * @brief Object for managing a set of dialogs, including their signals and
  *        construction/caching/destruction of them.
- *
- * Authors:
+ */
+/* Authors:
  *   Bryce W. Harrington <bryce@bryceharrington.org>
  *   Jon Phillips <jon@rejon.org>
  *   Gustav Broberg <broberg@kth.se>
  *
- * Copyright (C) 2004--2007 Authors
+ * Copyright (C) 2004-2007 Authors
  *
  * Released under GNU GPL.  Read the file 'COPYING' for more information.
  */
 #include "ui/dialog/memory.h"
 #include "ui/dialog/messages.h"
 #include "ui/dialog/scriptdialog.h"
-#ifdef ENABLE_SVG_FONTS
-#include "ui/dialog/svg-fonts-dialog.h"
-#endif // ENABLE_SVG_FONTS
+#include "ui/dialog/tile.h"
 #include "ui/dialog/tracedialog.h"
 #include "ui/dialog/transformation.h"
 #include "ui/dialog/undo-history.h"
 #include "ui/dialog/panel-dialog.h"
-
-#include "dialogs/layers-panel.h"
-#include "dialogs/tiledialog.h"
-#include "dialogs/iconpreview.h"
-
+#include "ui/dialog/layers.h"
+#include "ui/dialog/icon-preview.h"
 #include "ui/dialog/floating-behavior.h"
 #include "ui/dialog/dock-behavior.h"
+#include "ui/dialog/spray-option.h"
+#include "preferences.h"
+
+#ifdef ENABLE_SVG_FONTS
+#include "ui/dialog/svg-fonts-dialog.h"
+#endif // ENABLE_SVG_FONTS
 
 namespace Inkscape {
 namespace UI {
@@ -84,10 +85,10 @@ DialogManager::DialogManager() {
     using namespace Behavior;
     using namespace Inkscape::UI::Dialogs; // temporary
 
-    int dialogs_type = prefs_get_int_attribute_limited ("options.dialogtype", "value", DOCK, 0, 1);
+    Inkscape::Preferences *prefs = Inkscape::Preferences::get();
+    int dialogs_type = prefs->getIntLimited("/options/dialogtype/value", DOCK, 0, 1);
 
     if (dialogs_type == FLOATING) {
-
         registerFactory("AlignAndDistribute",  &create<AlignAndDistribute,   FloatingBehavior>);
         registerFactory("DocumentMetadata",    &create<DocumentMetadata,     FloatingBehavior>);
         registerFactory("DocumentProperties",  &create<DocumentProperties,   FloatingBehavior>);
@@ -110,7 +111,8 @@ DialogManager::DialogManager() {
         registerFactory("Trace",               &create<TraceDialog,          FloatingBehavior>);
         registerFactory("Transformation",      &create<Transformation,       FloatingBehavior>);
         registerFactory("UndoHistory",         &create<UndoHistory,          FloatingBehavior>);
-        registerFactory("InputDevices",        &create<InputDialog,           FloatingBehavior>);
+        registerFactory("InputDevices",        &create<InputDialog,          FloatingBehavior>);
+        registerFactory("SprayOptionClass",    &create<SprayOptionClass,     FloatingBehavior>);
 
     } else {
 
@@ -137,6 +139,7 @@ DialogManager::DialogManager() {
         registerFactory("Transformation",      &create<Transformation,       DockBehavior>);
         registerFactory("UndoHistory",         &create<UndoHistory,          DockBehavior>);
         registerFactory("InputDevices",        &create<InputDialog,          DockBehavior>);
+        registerFactory("SprayOptionClass",    &create<SprayOptionClass,     DockBehavior>);
 
     }
 }
@@ -150,7 +153,8 @@ DialogManager::~DialogManager() {
 
 DialogManager &DialogManager::getInstance()
 {
-    int dialogs_type = prefs_get_int_attribute_limited ("options.dialogtype", "value", DOCK, 0, 1);
+    Inkscape::Preferences *prefs = Inkscape::Preferences::get();
+    int dialogs_type = prefs->getIntLimited("/options/dialogtype/value", DOCK, 0, 1);
 
     /* Use singleton behavior for floating dialogs */
     if (dialogs_type == FLOATING) {