[easytag/wip/application-window: 27/39] Remove the cancel button from the preferences



commit 2b8b2c92bb77aa826aec194132947a72bb7d320d
Author: David King <amigadave amigadave com>
Date:   Sat Jul 19 23:12:45 2014 +0100

    Remove the cancel button from the preferences
    
    As settings changes are applied instantly with GSettings, a cancel
    button is not useful.

 src/preferences_dialog.c |   31 +++++--------------------------
 1 files changed, 5 insertions(+), 26 deletions(-)
---
diff --git a/src/preferences_dialog.c b/src/preferences_dialog.c
index af7cc4b..d7d3739 100644
--- a/src/preferences_dialog.c
+++ b/src/preferences_dialog.c
@@ -304,10 +304,9 @@ create_preferences_dialog (EtPreferencesDialog *self)
     gtk_window_set_title (GTK_WINDOW (self), _("Preferences"));
     gtk_window_set_transient_for (GTK_WINDOW (self), GTK_WINDOW (MainWindow));
     gtk_window_set_destroy_with_parent (GTK_WINDOW (self), TRUE);
-    gtk_dialog_add_buttons (GTK_DIALOG (self), GTK_STOCK_CANCEL,
-                            GTK_RESPONSE_REJECT, GTK_STOCK_OK,
-                            GTK_RESPONSE_ACCEPT, NULL);
-    gtk_dialog_set_default_response (GTK_DIALOG (self), GTK_RESPONSE_ACCEPT);
+    gtk_dialog_add_buttons (GTK_DIALOG (self), GTK_STOCK_CLOSE,
+                            GTK_RESPONSE_CLOSE, NULL);
+    gtk_dialog_set_default_response (GTK_DIALOG (self), GTK_RESPONSE_CLOSE);
     g_signal_connect (self, "response",
                       G_CALLBACK (et_preferences_on_response), NULL);
     g_signal_connect (self, "delete-event",
@@ -1723,12 +1722,6 @@ Change_Id3_Settings_Toggled (GtkWidget *blah, EtPreferencesDialog *self)
     gtk_widget_set_sensitive (priv->FileWritingId3v1IconvOptionsIgnore, active);
 }
 
-/* Callback from et_preferences_dialog_on_response. */
-static void
-OptionsWindow_Quit (EtPreferencesDialog *self)
-{
-}
-
 /*
  * Check_Config: Check if config information are correct
  *
@@ -1882,16 +1875,7 @@ OptionsWindow_Save_Button (EtPreferencesDialog *self)
 {
     if (!Check_Config (self)) return;
 
-    OptionsWindow_Quit (self);
-    Statusbar_Message(_("Configuration saved"),TRUE);
-}
-
-/* Callback from et_preferences_dialog_on_response. */
-static void
-OptionsWindow_Cancel_Button (EtPreferencesDialog *self)
-{
-    OptionsWindow_Quit (self);
-    Statusbar_Message(_("Configuration unchanged"),TRUE);
+    gtk_widget_hide (GTK_WIDGET (self));
 }
 
 void
@@ -1923,15 +1907,10 @@ et_preferences_on_response (GtkDialog *dialog, gint response_id,
 {
     switch (response_id)
     {
-        case GTK_RESPONSE_ACCEPT:
+        case GTK_RESPONSE_CLOSE:
             OptionsWindow_Save_Button (ET_PREFERENCES_DIALOG (dialog));
             break;
         case GTK_RESPONSE_DELETE_EVENT:
-            OptionsWindow_Quit (ET_PREFERENCES_DIALOG (dialog));
-            break;
-        case GTK_RESPONSE_REJECT:
-            OptionsWindow_Cancel_Button (ET_PREFERENCES_DIALOG (dialog));
-            gtk_widget_hide (GTK_WIDGET (dialog));
             break;
         default:
             g_assert_not_reached ();


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]