[easytag] Make the scan files button internal to the dialog
- From: David King <davidk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [easytag] Make the scan files button internal to the dialog
- Date: Sun, 28 Apr 2013 23:08:27 +0000 (UTC)
commit 58d1e68f78ce8efa1c348fef52b003bed62e2f89
Author: David King <amigadave amigadave com>
Date: Mon Apr 29 00:02:10 2013 +0100
Make the scan files button internal to the dialog
Set the sensitivity of the "scan files" button with
gtk_dialog_set_response_sensitive() and hide it from external users of
the dialog.
src/easytag.c | 20 +++++++++++++++-----
src/scan.c | 13 ++++++-------
src/scan.h | 1 -
3 files changed, 21 insertions(+), 13 deletions(-)
---
diff --git a/src/easytag.c b/src/easytag.c
index 8426acd..fc502d1 100644
--- a/src/easytag.c
+++ b/src/easytag.c
@@ -3929,8 +3929,11 @@ void Update_Command_Buttons_Sensivity (void)
g_object_set(uiaction, "sensitive", FALSE, NULL);
/* Scanner Window */
- if (SWScanButton)
- gtk_widget_set_sensitive(GTK_WIDGET(SWScanButton),FALSE);
+ if (ScannerWindow)
+ {
+ gtk_dialog_set_response_sensitive (GTK_DIALOG (ScannerWindow),
+ GTK_RESPONSE_APPLY, FALSE);
+ }
/* Menu commands */
ui_widget_set_sensitive(MENU_FILE, AM_OPEN_FILE_WITH, FALSE);
@@ -4005,7 +4008,11 @@ void Update_Command_Buttons_Sensivity (void)
g_object_set(uiaction, "sensitive", FALSE, NULL);
/* Scanner Window */
- if (SWScanButton) gtk_widget_set_sensitive(GTK_WIDGET(SWScanButton),TRUE);
+ if (ScannerWindow)
+ {
+ gtk_dialog_set_response_sensitive (GTK_DIALOG (ScannerWindow),
+ GTK_RESPONSE_APPLY, TRUE);
+ }
/* Commands into menu */
ui_widget_set_sensitive(MENU_FILE, AM_OPEN_FILE_WITH,TRUE);
@@ -4131,8 +4138,11 @@ static void
Disable_Command_Buttons (void)
{
/* Scanner Window */
- if (SWScanButton)
- gtk_widget_set_sensitive(SWScanButton,FALSE);
+ if (ScannerWindow)
+ {
+ gtk_dialog_set_response_sensitive (GTK_DIALOG (ScannerWindow),
+ GTK_RESPONSE_APPLY, FALSE);
+ }
/* "File" menu commands */
ui_widget_set_sensitive(MENU_FILE,AM_OPEN_FILE_WITH,FALSE);
diff --git a/src/scan.c b/src/scan.c
index fe0b7b4..ac1abca 100644
--- a/src/scan.c
+++ b/src/scan.c
@@ -287,7 +287,6 @@ void Init_ScannerWindow (void)
{
ScannerWindow = NULL;
ScannerOptionCombo= NULL;
- SWScanButton = NULL;
}
@@ -2300,6 +2299,7 @@ static gchar
******************/
void Open_ScannerWindow (gint scanner_type)
{
+ GtkWidget *scan_button;
GtkWidget *ScanVBox;
GtkWidget *HBox1, *HBox2, *HBox4, *VBox, *hbox, *vbox;
GtkWidget *Table;
@@ -2340,13 +2340,13 @@ void Open_ScannerWindow (gint scanner_type)
GTK_RESPONSE_CLOSE, NULL);
/* 'Scan selected files' button */
- SWScanButton = gtk_button_new_from_stock (GTK_STOCK_APPLY);
+ scan_button = gtk_button_new_from_stock (GTK_STOCK_APPLY);
/* TODO: Set related action to match AM_SCAN_FILES. */
- gtk_button_set_label (GTK_BUTTON (SWScanButton), _("Scan Files"));
- gtk_dialog_add_action_widget (GTK_DIALOG (ScannerWindow), SWScanButton,
+ gtk_button_set_label (GTK_BUTTON (scan_button), _("Scan Files"));
+ gtk_dialog_add_action_widget (GTK_DIALOG (ScannerWindow), scan_button,
GTK_RESPONSE_APPLY);
- gtk_widget_show (SWScanButton);
- gtk_widget_set_tooltip_text (SWScanButton, _("Scan selected files"));
+ gtk_widget_show (scan_button);
+ gtk_widget_set_tooltip_text (scan_button, _("Scan selected files"));
/* The response signal handles close, scan and the delete event. */
g_signal_connect (G_OBJECT (ScannerWindow), "response",
@@ -3079,7 +3079,6 @@ ScannerWindow_Quit (void)
gtk_list_store_clear(RenameFileListModel);
ScannerWindow = NULL;
ScannerOptionCombo= NULL;
- SWScanButton = NULL;
// To avoid crashs after tests
ScanTagMaskCombo = NULL;
diff --git a/src/scan.h b/src/scan.h
index d1cd119..c490812 100644
--- a/src/scan.h
+++ b/src/scan.h
@@ -29,7 +29,6 @@
* Declarations *
****************/
GtkWidget *ScannerWindow;
-GtkWidget *SWScanButton; // To enable/disable it in easytag.c
enum
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]