Code

* don't strech buttons on lpe dialog when resizing the dialog
[inkscape.git] / src / ui / dialog / dialog-manager.cpp
index f8c07cf535c16e4bd99c7687a8ae86e02f93f31d..17215ac00a772f5e45be5d7111111a6218780a00 100644 (file)
@@ -147,6 +147,23 @@ DialogManager::~DialogManager() {
     //        Appears to cause a segfault if we do
 }
 
+
+DialogManager &DialogManager::getInstance()
+{
+    int dialogs_type = prefs_get_int_attribute_limited ("options.dialogtype", "value", DOCK, 0, 1);
+
+    /* Use singleton behavior for floating dialogs */
+    if (dialogs_type == FLOATING) {
+        static DialogManager *instance = 0;
+        
+        if (!instance)
+            instance = new DialogManager();
+        return *instance;
+    } 
+
+    return *new DialogManager();
+}
+
 /**
  * Registers a dialog factory function used to create the named dialog.
  */