index dc9f4ac2a2ae6db58e933a0ead32028d6f926dec..b5992ab5cecfa7d762c8f35c1a609dfe444e5057 100644 (file)
-#define __DIALOG_EVENTS_C__
-
-/**
- * \brief Event handler for dialog windows
- *
- * Authors:
+/** @file
+ * @brief Event handler for dialog windows
+ */
+/* Authors:
* bulia byak <bulia@dr.com>
* Johan Engelen <j.b.c.engelen@ewi.utwente.nl>
*
#include <gtk/gtk.h>
#include "desktop.h"
#include "inkscape-private.h"
-#include "prefs-utils.h"
+#include "preferences.h"
#include "event-context.h"
#include "dialog-events.h"
#include <gtkmm/entry.h>
-/**
-* \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...
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;
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)