[easytag/wip/for-2.3.7: 9/11] Use GtkBuilder action-widgets for template dialogs
- From: David King <davidk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [easytag/wip/for-2.3.7: 9/11] Use GtkBuilder action-widgets for template dialogs
- Date: Sun, 17 May 2015 10:11:03 +0000 (UTC)
commit fb1758a471a9612b6a61e79a2dc975ddd8658625
Author: David King <amigadave amigadave com>
Date: Wed May 13 23:18:26 2015 +0700
Use GtkBuilder action-widgets for template dialogs
data/load_files_dialog.ui | 20 +++++++++++++++++++-
data/playlist_dialog.ui | 19 +++++++++++++++++++
data/preferences_dialog.ui | 11 +++++++++++
data/scan_dialog.ui | 19 +++++++++++++++++++
src/load_files_dialog.c | 5 +----
src/playlist_dialog.c | 8 ++------
src/preferences_dialog.c | 3 ---
src/scan_dialog.c | 12 ------------
8 files changed, 71 insertions(+), 26 deletions(-)
---
diff --git a/data/load_files_dialog.ui b/data/load_files_dialog.ui
index f10f1aa..47a5f60 100644
--- a/data/load_files_dialog.ui
+++ b/data/load_files_dialog.ui
@@ -315,6 +315,24 @@
</child>
</object>
</child>
+ <child type="action">
+ <object class="GtkButton" id="close_button">
+ <property name="label" translatable="yes">_Close</property>
+ <property name="use-underline">True</property>
+ <property name="visible">True</property>
+ </object>
+ </child>
+ <child type="action">
+ <object class="GtkButton" id="apply_button">
+ <property name="can-default">True</property>
+ <property name="label" translatable="yes">_Apply</property>
+ <property name="use-underline">True</property>
+ <property name="visible">True</property>
+ </object>
+ </child>
+ <action-widgets>
+ <action-widget response="-7">close_button</action-widget>
+ <action-widget response="-10">apply_button</action-widget>
+ </action-widgets>
</template>
</interface>
-
diff --git a/data/playlist_dialog.ui b/data/playlist_dialog.ui
index 8731ad6..497fa71 100644
--- a/data/playlist_dialog.ui
+++ b/data/playlist_dialog.ui
@@ -154,5 +154,24 @@
</child>
</object>
</child>
+ <child type="action">
+ <object class="GtkButton" id="close_button">
+ <property name="label" translatable="yes">_Close</property>
+ <property name="use-underline">True</property>
+ <property name="visible">True</property>
+ </object>
+ </child>
+ <child type="action">
+ <object class="GtkButton" id="save_button">
+ <property name="can-default">True</property>
+ <property name="label" translatable="yes">_Save</property>
+ <property name="use-underline">True</property>
+ <property name="visible">True</property>
+ </object>
+ </child>
+ <action-widgets>
+ <action-widget response="-7">close_button</action-widget>
+ <action-widget response="-5">save_button</action-widget>
+ </action-widgets>
</template>
</interface>
diff --git a/data/preferences_dialog.ui b/data/preferences_dialog.ui
index 941a40a..71f5789 100644
--- a/data/preferences_dialog.ui
+++ b/data/preferences_dialog.ui
@@ -1534,5 +1534,16 @@
</child>
</object>
</child>
+ <child type="action">
+ <object class="GtkButton" id="close_button">
+ <property name="can-default">True</property>
+ <property name="label" translatable="yes">_Close</property>
+ <property name="use-underline">True</property>
+ <property name="visible">True</property>
+ </object>
+ </child>
+ <action-widgets>
+ <action-widget response="-7">close_button</action-widget>
+ </action-widgets>
</template>
</interface>
diff --git a/data/scan_dialog.ui b/data/scan_dialog.ui
index d35327b..425bf1a 100644
--- a/data/scan_dialog.ui
+++ b/data/scan_dialog.ui
@@ -906,5 +906,24 @@
</child>
</object>
</child>
+ <child type="action">
+ <object class="GtkButton" id="close_button">
+ <property name="label" translatable="yes">_Close</property>
+ <property name="use-underline">True</property>
+ <property name="visible">True</property>
+ </object>
+ </child>
+ <child type="action">
+ <object class="GtkButton" id="scan_button">
+ <property name="can-default">True</property>
+ <property name="label" translatable="yes">Scan Files</property>
+ <property name="tooltip-text" translatable="yes">Scan selected files</property>
+ <property name="visible">True</property>
+ </object>
+ </child>
+ <action-widgets>
+ <action-widget response="-7">close_button</action-widget>
+ <action-widget response="-10">scan_button</action-widget>
+ </action-widgets>
</template>
</interface>
diff --git a/src/load_files_dialog.c b/src/load_files_dialog.c
index a070d51..7434134 100644
--- a/src/load_files_dialog.c
+++ b/src/load_files_dialog.c
@@ -173,7 +173,7 @@ on_response (GtkDialog *dialog, gint response_id, gpointer user_data)
case GTK_RESPONSE_APPLY:
Load_Filename_Set_Filenames (ET_LOAD_FILES_DIALOG (dialog));
break;
- case GTK_RESPONSE_CANCEL:
+ case GTK_RESPONSE_CLOSE:
gtk_widget_hide (GTK_WIDGET (dialog));
break;
case GTK_RESPONSE_DELETE_EVENT:
@@ -994,9 +994,6 @@ create_load_files_dialog (EtLoadFilesDialog *self)
priv = et_load_files_dialog_get_instance_private (self);
- gtk_dialog_add_buttons (GTK_DIALOG (self), _("_Close"),
- GTK_RESPONSE_CANCEL, _("_Apply"),
- GTK_RESPONSE_APPLY, NULL);
gtk_dialog_set_default_response (GTK_DIALOG (self), GTK_RESPONSE_APPLY);
/* Initial value. */
diff --git a/src/playlist_dialog.c b/src/playlist_dialog.c
index 697b8ad..d2f270c 100644
--- a/src/playlist_dialog.c
+++ b/src/playlist_dialog.c
@@ -581,7 +581,7 @@ on_response (GtkDialog *dialog, gint response_id, gpointer user_data)
case GTK_RESPONSE_OK:
write_button_clicked (ET_PLAYLIST_DIALOG (dialog));
break;
- case GTK_RESPONSE_CANCEL:
+ case GTK_RESPONSE_CLOSE:
gtk_widget_hide (GTK_WIDGET (dialog));
break;
case GTK_RESPONSE_DELETE_EVENT:
@@ -650,14 +650,10 @@ static void
create_playlist_dialog (EtPlaylistDialog *self)
{
EtPlaylistDialogPrivate *priv;
- GtkDialog *dialog;
priv = et_playlist_dialog_get_instance_private (self);
- dialog = GTK_DIALOG (self);
- gtk_dialog_add_buttons (dialog, _("_Cancel"), GTK_RESPONSE_CANCEL,
- _("_Save"), GTK_RESPONSE_OK, NULL);
- gtk_dialog_set_default_response (dialog, GTK_RESPONSE_OK);
+ gtk_dialog_set_default_response (GTK_DIALOG (self), GTK_RESPONSE_OK);
/* Playlist name */
g_settings_bind (MainSettings, "playlist-filename-mask",
diff --git a/src/preferences_dialog.c b/src/preferences_dialog.c
index 467f5af..df409d4 100644
--- a/src/preferences_dialog.c
+++ b/src/preferences_dialog.c
@@ -275,9 +275,6 @@ create_preferences_dialog (EtPreferencesDialog *self)
priv = et_preferences_dialog_get_instance_private (self);
- /* The window */
- gtk_dialog_add_buttons (GTK_DIALOG (self), _("_Close"), GTK_RESPONSE_CLOSE,
- NULL);
gtk_dialog_set_default_response (GTK_DIALOG (self), GTK_RESPONSE_CLOSE);
/* Browser. */
diff --git a/src/scan_dialog.c b/src/scan_dialog.c
index 99c9afe..8bf8681 100644
--- a/src/scan_dialog.c
+++ b/src/scan_dialog.c
@@ -2307,22 +2307,10 @@ static void
create_scan_dialog (EtScanDialog *self)
{
EtScanDialogPrivate *priv;
- GtkWidget *scan_button;
priv = et_scan_dialog_get_instance_private (self);
- /* The window */
- gtk_dialog_add_buttons (GTK_DIALOG (self), _("_Close"),
- GTK_RESPONSE_CLOSE, NULL);
-
- /* 'Scan selected files' button */
- scan_button = gtk_button_new_with_label (_("Scan Files"));
- gtk_widget_set_can_default (scan_button, TRUE);
- gtk_dialog_add_action_widget (GTK_DIALOG (self), scan_button,
- GTK_RESPONSE_APPLY);
gtk_dialog_set_default_response (GTK_DIALOG (self), GTK_RESPONSE_APPLY);
- gtk_widget_show (scan_button);
- gtk_widget_set_tooltip_text (scan_button, _("Scan selected files"));
g_settings_bind_with_mapping (MainSettings, "scan-mode", priv->notebook,
"page", G_SETTINGS_BIND_DEFAULT,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]