summaryrefslogtreecommitdiffstats
path: root/src/ui/dialog/dialog.cpp
diff options
context:
space:
mode:
authorJohn Smith <john.smith7545@yahoo.com>2012-02-17 08:05:08 +0000
committerJohn Smith <removethis.john.q.public@bigmail.com>2012-02-17 08:05:08 +0000
commitafb80368d6bf4dc2a55b011c9a14fa4288d2fe84 (patch)
tree6ec54c830a6537271186388726542ca873ff7830 /src/ui/dialog/dialog.cpp
parentDocumentation of the Text and Font dialog (diff)
downloadinkscape-afb80368d6bf4dc2a55b011c9a14fa4288d2fe84.tar.gz
inkscape-afb80368d6bf4dc2a55b011c9a14fa4288d2fe84.zip
Fix for 171579 : Make inkscape remember dialogs window status
(bzr r10992)
Diffstat (limited to 'src/ui/dialog/dialog.cpp')
-rw-r--r--src/ui/dialog/dialog.cpp26
1 files changed, 23 insertions, 3 deletions
diff --git a/src/ui/dialog/dialog.cpp b/src/ui/dialog/dialog.cpp
index 43c9493b3..3e53dcb53 100644
--- a/src/ui/dialog/dialog.cpp
+++ b/src/ui/dialog/dialog.cpp
@@ -83,11 +83,12 @@ Dialog::Dialog(Behavior::BehaviorFactory behavior_factory, const char *prefs_pat
: _user_hidden(false),
_hiddenF12(false),
retransientize_suppress(false),
- //
_prefs_path(prefs_path),
_verb_num(verb_num),
_title(),
_apply_label(apply_label),
+ _desktop(NULL),
+ _is_active_desktop(true),
_behavior(0)
{
gchar title[500];
@@ -97,8 +98,8 @@ Dialog::Dialog(Behavior::BehaviorFactory behavior_factory, const char *prefs_pat
}
_title = title;
-
_behavior = behavior_factory(*this);
+ _desktop = SP_ACTIVE_DESKTOP;
g_signal_connect(G_OBJECT(INKSCAPE), "activate_desktop", G_CALLBACK(sp_retransientize), (void *)this);
g_signal_connect(G_OBJECT(INKSCAPE), "dialogs_hide", G_CALLBACK(hideCallback), (void *)this);
@@ -124,13 +125,14 @@ Dialog::~Dialog()
void Dialog::onDesktopActivated(SPDesktop *desktop)
{
+ _is_active_desktop = (desktop == _desktop);
_behavior->onDesktopActivated(desktop);
}
void Dialog::onShutdown()
{
save_geometry();
- _user_hidden = true;
+ //_user_hidden = true;
_behavior->onShutdown();
}
@@ -224,6 +226,24 @@ void Dialog::save_geometry()
}
+void
+Dialog::save_status(int visible, int state, int placement)
+{
+ // Only save dialog status for dialogs on the "last document"
+ SPDesktop *desktop = SP_ACTIVE_DESKTOP;
+ if (desktop != NULL || !_is_active_desktop ) {
+ return;
+ }
+
+ Inkscape::Preferences *prefs = Inkscape::Preferences::get();
+ if (prefs) {
+ prefs->setInt(_prefs_path + "/visible", visible);
+ prefs->setInt(_prefs_path + "/state", state);
+ prefs->setInt(_prefs_path + "/placement", placement);
+ }
+}
+
+
void Dialog::_handleResponse(int response_id)
{
switch (response_id) {