From: John Darrington Date: Mon, 27 Mar 2017 17:30:28 +0000 (+0200) Subject: Edit|Options: Add fields to change behaviour of output window. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d544788058262e65e71591348d9976a7fd792c97;p=pspp Edit|Options: Add fields to change behaviour of output window. --- diff --git a/src/ui/gui/options-dialog.c b/src/ui/gui/options-dialog.c index 45f69f5226..e2c2894039 100644 --- a/src/ui/gui/options-dialog.c +++ b/src/ui/gui/options-dialog.c @@ -41,6 +41,10 @@ struct options_dialog GtkWidget *sort_names; GtkWidget *sort_labels; GtkWidget *sort_none; + + GtkWidget *maximize; + GtkWidget *alert; + GtkWidget *raise; }; GType @@ -83,9 +87,12 @@ options_dialog (PsppireDataWindow *de) fd.sort_names = get_widget_assert (fd.xml, "radiobutton-sort-by-name"); fd.sort_none = get_widget_assert (fd.xml, "radiobutton-unsorted"); + fd.maximize = get_widget_assert (fd.xml, "checkbutton-maximize"); + fd.alert = get_widget_assert (fd.xml, "checkbutton-alert"); + fd.raise = get_widget_assert (fd.xml, "checkbutton-raise"); + gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (de)); - fd.conf = psppire_conf_new (); if (psppire_conf_get_boolean (fd.conf, @@ -116,6 +123,26 @@ options_dialog (PsppireDataWindow *de) break; } + { + gboolean status; + if (psppire_conf_get_boolean (fd.conf, "OutputWindowAction", "maximize", + &status)) + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (fd.maximize), status); + } + + { + gboolean status = true; + psppire_conf_get_boolean (fd.conf, "OutputWindowAction", "alert", &status); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (fd.alert), status); + } + + { + gboolean status; + if (psppire_conf_get_boolean (fd.conf, "OutputWindowAction", "raise", + &status)) + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (fd.raise), status); + } + const int result = psppire_dialog_run (PSPPIRE_DIALOG (dialog)); if (result == GTK_RESPONSE_OK) @@ -143,6 +170,18 @@ options_dialog (PsppireDataWindow *de) "VariableLists", "sort-order", PSPP_TYPE_OPTIONS_VAR_ORDER, sort_order); + + psppire_conf_set_boolean (fd.conf, "OutputWindowAction", "maximize", + gtk_toggle_button_get_active + (GTK_TOGGLE_BUTTON (fd.maximize))); + + psppire_conf_set_boolean (fd.conf, "OutputWindowAction", "raise", + gtk_toggle_button_get_active + (GTK_TOGGLE_BUTTON (fd.raise))); + + psppire_conf_set_boolean (fd.conf, "OutputWindowAction", "alert", + gtk_toggle_button_get_active + (GTK_TOGGLE_BUTTON (fd.alert))); } g_object_unref (fd.xml); diff --git a/src/ui/gui/options.ui b/src/ui/gui/options.ui index a3f45d9e6f..75e827fcf3 100644 --- a/src/ui/gui/options.ui +++ b/src/ui/gui/options.ui @@ -151,7 +151,75 @@ - + + + True + False + 0 + in + + + True + False + vertical + spread + + + Ma_ximize + True + True + False + True + True + + + True + True + 0 + + + + + _Raise + True + True + False + True + True + + + True + True + 1 + + + + + Aler_t + True + True + False + True + True + + + True + True + 2 + + + + + + + True + False + Output Window Action + + + + + vertical diff --git a/src/ui/gui/psppire-output-window.c b/src/ui/gui/psppire-output-window.c index ba2dc8410d..bd5047a7bc 100644 --- a/src/ui/gui/psppire-output-window.c +++ b/src/ui/gui/psppire-output-window.c @@ -38,6 +38,7 @@ #include "ui/gui/help-menu.h" #include "ui/gui/builder-wrapper.h" #include "ui/gui/psppire-output-view.h" +#include "ui/gui/psppire-conf.h" #include "ui/gui/windows-menu.h" #include "gl/xalloc.h" @@ -164,7 +165,27 @@ psppire_output_submit (struct output_driver *this, gtk_widget_show_all (GTK_WIDGET (pod->window)); } - gtk_window_set_urgency_hint (GTK_WINDOW (pod->window), TRUE); + PsppireConf *conf = psppire_conf_new (); + { + gboolean status = true; + psppire_conf_get_boolean (conf, "OutputWindowAction", "alert", + &status); + gtk_window_set_urgency_hint (GTK_WINDOW (pod->window), status); + } + + { + gboolean status ; + if (psppire_conf_get_boolean (conf, "OutputWindowAction", "maximize", + &status) && status) + gtk_window_maximize (GTK_WINDOW (pod->window)); + } + + { + gboolean status ; + if (psppire_conf_get_boolean (conf, "OutputWindowAction", "raise", + &status) && status) + gtk_window_present (GTK_WINDOW (pod->window)); + } } static struct output_driver_class psppire_output_class =