X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=src%2Fdialogs%2Fdialog-events.cpp;h=b5992ab5cecfa7d762c8f35c1a609dfe444e5057;hb=98642e1599b79dd4207c88375e2a030f5f570a4b;hp=dc9f4ac2a2ae6db58e933a0ead32028d6f926dec;hpb=34b7a09e4015b0689b4e7e6385ab695ee40a7e75;p=inkscape.git diff --git a/src/dialogs/dialog-events.cpp b/src/dialogs/dialog-events.cpp index dc9f4ac2a..b5992ab5c 100644 --- a/src/dialogs/dialog-events.cpp +++ b/src/dialogs/dialog-events.cpp @@ -1,9 +1,7 @@ -#define __DIALOG_EVENTS_C__ - -/** - * \brief Event handler for dialog windows - * - * Authors: +/** @file + * @brief Event handler for dialog windows + */ +/* Authors: * bulia byak * Johan Engelen * @@ -21,7 +19,7 @@ #include #include "desktop.h" #include "inkscape-private.h" -#include "prefs-utils.h" +#include "preferences.h" #include "event-context.h" #include "dialog-events.h" @@ -30,18 +28,6 @@ #include -/** -* \brief This function is called to zero the transientize semaphore by a -* timeout. -*/ -gboolean -sp_allow_again (gpointer *wd) -{ - ((win_data *) wd)->stop = 0; - return FALSE; // so that it is only called once -} - - /** * \brief Remove focus from window to whoever it is transient for... @@ -172,16 +158,17 @@ sp_dialog_event_handler (GtkWindow *win, GdkEvent *event, gpointer data) void sp_transientize (GtkWidget *dialog) { + Inkscape::Preferences *prefs = Inkscape::Preferences::get(); #ifndef WIN32 // FIXME: Temporary Win32 special code to enable transient dialogs // _set_skip_taskbar_hint makes transient dialogs NON-transient! When dialogs // are made transient (_set_transient_for), they are already removed from // the taskbar in Win32. - if (prefs_get_int_attribute ( "options.dialogsskiptaskbar", "value", 0)) { + if (prefs->getBool( "/options/dialogsskiptaskbar/value")) { gtk_window_set_skip_taskbar_hint (GTK_WINDOW (dialog), TRUE); } #endif - gint transient_policy = prefs_get_int_attribute_limited ( "options.transientpolicy", "value", 1, 0, 2 ); + gint transient_policy = prefs->getIntLimited("/options/transientpolicy/value", 1, 0, 2); #ifdef WIN32 // Win32 special code to enable transient dialogs transient_policy = 2; @@ -207,33 +194,20 @@ void sp_transientize_callback ( Inkscape::Application * /*inkscape*/, SPDesktop *desktop, win_data *wd ) { - gint transient_policy = prefs_get_int_attribute_limited ( "options.transientpolicy", "value", 1, 0, 2); + Inkscape::Preferences *prefs = Inkscape::Preferences::get(); + gint transient_policy = prefs->getIntLimited( "/options/transientpolicy/value", 1, 0, 2); #ifdef WIN32 // Win32 special code to enable transient dialogs - transient_policy = 2; + transient_policy = 1; #endif if (!transient_policy) return; - if (wd->stop) { - /* - * if retransientizing of this dialog is still forbidden after - * previous call warning turned off because it was confusingly fired - * when loading many files from command line - */ - // g_warning("Retranzientize aborted! You're switching windows too fast!"); - return; - } - if (wd->win) { - wd->stop = 1; // disallow other attempts to retranzientize this dialog desktop->setWindowTransient (wd->win, transient_policy); } - - // we're done, allow next retransientizing not sooner than after 6 msec - gtk_timeout_add (6, (GtkFunction) sp_allow_again, (gpointer) wd); } void on_dialog_hide (GtkWidget *w)