[easytag] Revert "Use GtkBuilder action-widgets for template dialogs"
- From: David King <davidk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [easytag] Revert "Use GtkBuilder action-widgets for template dialogs"
- Date: Sat, 13 Jun 2015 21:37:49 +0000 (UTC)
commit 49b316aa6c8e91290f9188c88b22bacd630cdb6f
Author: David King <amigadave amigadave com>
Date: Sat Jun 13 22:34:17 2015 +0100
Revert "Use GtkBuilder action-widgets for template dialogs"
This reverts commit fb1758a471a9612b6a61e79a2dc975ddd8658625.
Unfortunately, action-widgets support in GtkBuilder was only added in
GTK+ 3.14, not 3.10 (which is the oldest version that EasyTAG supports).
https://mail.gnome.org/archives/easytag-list/2015-June/msg00004.html
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, 26 insertions(+), 71 deletions(-)
---
diff --git a/data/load_files_dialog.ui b/data/load_files_dialog.ui
index 47a5f60..f10f1aa 100644
--- a/data/load_files_dialog.ui
+++ b/data/load_files_dialog.ui
@@ -315,24 +315,6 @@
</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 497fa71..8731ad6 100644
--- a/data/playlist_dialog.ui
+++ b/data/playlist_dialog.ui
@@ -154,24 +154,5 @@
</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 c7bbdc0..8f0b68a 100644
--- a/data/preferences_dialog.ui
+++ b/data/preferences_dialog.ui
@@ -1534,16 +1534,5 @@
</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 d7a73a1..bfcb815 100644
--- a/data/scan_dialog.ui
+++ b/data/scan_dialog.ui
@@ -906,24 +906,5 @@ Use ‘/’ to make directories. If the first character is ‘/’, it is an abs
</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 7434134..a070d51 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_CLOSE:
+ case GTK_RESPONSE_CANCEL:
gtk_widget_hide (GTK_WIDGET (dialog));
break;
case GTK_RESPONSE_DELETE_EVENT:
@@ -994,6 +994,9 @@ 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 d2f270c..697b8ad 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_CLOSE:
+ case GTK_RESPONSE_CANCEL:
gtk_widget_hide (GTK_WIDGET (dialog));
break;
case GTK_RESPONSE_DELETE_EVENT:
@@ -650,10 +650,14 @@ 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_set_default_response (GTK_DIALOG (self), GTK_RESPONSE_OK);
+ gtk_dialog_add_buttons (dialog, _("_Cancel"), GTK_RESPONSE_CANCEL,
+ _("_Save"), GTK_RESPONSE_OK, NULL);
+ gtk_dialog_set_default_response (dialog, 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 df409d4..467f5af 100644
--- a/src/preferences_dialog.c
+++ b/src/preferences_dialog.c
@@ -275,6 +275,9 @@ 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 8bf8681..99c9afe 100644
--- a/src/scan_dialog.c
+++ b/src/scan_dialog.c
@@ -2307,10 +2307,22 @@ 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]