[gnome-terminal] prefs: Make the preferences a GtkWindow
- From: Christian Persch <chpe src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-terminal] prefs: Make the preferences a GtkWindow
- Date: Sun, 10 May 2015 11:33:46 +0000 (UTC)
commit d7f0f1888104320d7aedc198099afc46ba770979
Author: Christian Persch <chpe gnome org>
Date: Sun May 10 13:32:30 2015 +0200
prefs: Make the preferences a GtkWindow
This fixes a warning whenever it's shown:
Gtk-Message: GtkDialog mapped without a transient parent. This is discouraged.
Also possibly fixes https://bugzilla.gnome.org/show_bug.cgi?id=748342 .
src/preferences.ui | 114 ++++++++++++++++++++++++++------------------------
src/terminal-app.c | 9 ++++
src/terminal-prefs.c | 22 ++++++----
3 files changed, 81 insertions(+), 64 deletions(-)
---
diff --git a/src/preferences.ui b/src/preferences.ui
index d12132b..bdb643d 100644
--- a/src/preferences.ui
+++ b/src/preferences.ui
@@ -18,67 +18,27 @@
</row>
</data>
</object>
- <object class="GtkDialog" id="preferences-dialog">
+ <object class="GtkWindow" id="preferences-dialog">
<property name="can_focus">False</property>
- <property name="border_width">5</property>
+ <property name="border_width">0</property>
<property name="title" translatable="yes">Preferences</property>
- <property name="role">gnome-terminal-accels</property>
+ <property name="role">gnome-terminal-preferences</property>
<property name="type_hint">normal</property>
- <child internal-child="vbox">
- <object class="GtkBox" id="dialog-vbox2">
+ <child>
+ <object class="GtkBox" id="dialogue-content-box">
<property name="visible">True</property>
<property name="can_focus">False</property>
+ <property name="margin_left">12</property>
+ <property name="margin_right">12</property>
+ <property name="margin_top">12</property>
+ <property name="margin_bottom">12</property>
<property name="orientation">vertical</property>
- <property name="spacing">2</property>
- <child internal-child="action_area">
- <object class="GtkButtonBox" id="dialog-action-area">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="layout_style">end</property>
- <child>
- <object class="GtkButton" id="close_button1">
- <property name="label">gtk-close</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="has_default">True</property>
- <property name="receives_default">False</property>
- <property name="use_stock">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkButton" id="button1">
- <property name="label">gtk-help</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="receives_default">False</property>
- <property name="use_stock">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="pack_type">end</property>
- <property name="position">0</property>
- </packing>
- </child>
+ <property name="spacing">12</property>
<child>
<object class="GtkNotebook" id="notebook1">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="border_width">5</property>
+ <property name="border_width">0</property>
<child>
<object class="GtkBox" id="general">
<property name="visible">True</property>
@@ -487,14 +447,58 @@
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButtonBox" id="dialogue-buttonbox">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="spacing">12</property>
+ <property name="layout_style">start</property>
+ <child>
+ <object class="GtkButton" id="help-button">
+ <property name="label">gtk-help</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_stock">True</property>
+ <property name="focus_on_click">False</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="pack_type">start</property>
+ <property name="position">0</property>
+ <property name="secondary">False</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="close-button">
+ <property name="label">gtk-close</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_stock">True</property>
+ <property name="focus_on_click">False</property>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="pack_type">end</property>
+ <property name="position">1</property>
+ <property name="secondary">True</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="pack_type">end</property>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
- <action-widgets>
- <action-widget response="-7">close_button1</action-widget>
- <action-widget response="-11">button1</action-widget>
- </action-widgets>
</object>
</interface>
diff --git a/src/terminal-app.c b/src/terminal-app.c
index 8af60f4..ff9609e 100644
--- a/src/terminal-app.c
+++ b/src/terminal-app.c
@@ -374,11 +374,20 @@ terminal_app_init (TerminalApp *app)
#if 1
{
+ /* Not interested in silly debug spew polluting the journal */
/* Legacy gtkuimanager menu accelerator */
/* Disallow in-place menu accel changes. Only needed on gtk 3.8,
* it's unused and ignored from 3.10 onward. */
TERMINAL_UTIL_OBJECT_TYPE_UNDEPRECATE_PROPERTY (GTK_TYPE_SETTINGS, "gtk-can-change-accels");
g_object_set (gtk_settings_get_default (), "gtk-can-change-accels", FALSE, NULL);
+
+ /* Our dialogues cause these */
+ TERMINAL_UTIL_OBJECT_TYPE_UNDEPRECATE_PROPERTY (GTK_TYPE_BUTTON, "use-stock");
+ TERMINAL_UTIL_OBJECT_TYPE_UNDEPRECATE_PROPERTY (GTK_TYPE_BUTTON, "xalign");
+ TERMINAL_UTIL_OBJECT_TYPE_UNDEPRECATE_PROPERTY (GTK_TYPE_WIDGET, "margin-left");
+ TERMINAL_UTIL_OBJECT_TYPE_UNDEPRECATE_PROPERTY (GTK_TYPE_WIDGET, "margin-right");
+ TERMINAL_UTIL_OBJECT_TYPE_UNDEPRECATE_PROPERTY (GTK_TYPE_SETTINGS, "gtk-button-images");
+ TERMINAL_UTIL_OBJECT_TYPE_UNDEPRECATE_PROPERTY (GTK_TYPE_TREE_VIEW, "rules-hint");
}
#endif
}
diff --git a/src/terminal-prefs.c b/src/terminal-prefs.c
index 97f6c33..b830ed1 100644
--- a/src/terminal-prefs.c
+++ b/src/terminal-prefs.c
@@ -57,16 +57,16 @@ typedef struct {
static GtkWidget *prefs_dialog = NULL;
static void
-prefs_dialog_response_cb (GtkWidget *editor,
- int response,
- PrefData *data)
+prefs_dialog_help_button_clicked_cb (GtkWidget *button,
+ PrefData *data)
{
- if (response == GTK_RESPONSE_HELP)
- {
- terminal_util_show_help ("pref", GTK_WINDOW (data->dialog));
- return;
- }
+ terminal_util_show_help ("pref", GTK_WINDOW (data->dialog));
+}
+static void
+prefs_dialog_close_button_clicked_cb (GtkWidget *button,
+ PrefData *data)
+{
gtk_widget_destroy (data->dialog);
}
@@ -564,6 +564,7 @@ terminal_prefs_show_preferences (GtkWindow *transient_parent,
GtkWidget *tree_view_container, *new_button, *edit_button, *clone_button, *remove_button;
GtkWidget *new_terminal_mode_combo;
GtkWidget *default_hbox, *default_label;
+ GtkWidget *close_button, *help_button;
GtkTreeSelection *selection;
GSettings *settings;
GtkCellRenderer *cell_renderer;
@@ -582,6 +583,8 @@ terminal_prefs_show_preferences (GtkWindow *transient_parent,
terminal_util_load_builder_resource ("/org/gnome/terminal/ui/preferences.ui",
"preferences-dialog",
"preferences-dialog", &dialog,
+ "close-button", &close_button,
+ "help-button", &help_button,
"default-show-menubar-checkbutton", &show_menubar_button,
"new-terminal-mode-combobox", &new_terminal_mode_combo,
"disable-mnemonics-checkbutton", &disable_mnemonics_button,
@@ -747,7 +750,8 @@ terminal_prefs_show_preferences (GtkWindow *transient_parent,
/* misc */
- g_signal_connect (dialog, "response", G_CALLBACK (prefs_dialog_response_cb), data);
+ g_signal_connect (close_button, "clicked", G_CALLBACK (prefs_dialog_close_button_clicked_cb), data);
+ g_signal_connect (help_button, "clicked", G_CALLBACK (prefs_dialog_help_button_clicked_cb), data);
g_signal_connect (dialog, "destroy", G_CALLBACK (prefs_dialog_destroy_cb), data);
gtk_window_set_default_size (GTK_WINDOW (dialog), -1, 350);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]