[gnome-control-center] network: disable "Apply" in editor if connection hasn't changed



commit f85aed9516aa9f4c27007315461fe59f9a7aa46c
Author: Dan Winship <danw gnome org>
Date:   Mon Feb 4 17:36:23 2013 -0500

    network: disable "Apply" in editor if connection hasn't changed
    
    https://bugzilla.gnome.org/show_bug.cgi?id=692925

 .../connection-editor/net-connection-editor.c      |    4 +++-
 .../connection-editor/net-connection-editor.h      |    1 +
 2 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/panels/network/connection-editor/net-connection-editor.c b/panels/network/connection-editor/net-connection-editor.c
index b54e4d8..4f78bd9 100644
--- a/panels/network/connection-editor/net-connection-editor.c
+++ b/panels/network/connection-editor/net-connection-editor.c
@@ -356,7 +356,7 @@ validate (NetConnectionEditor *editor)
 
         update_sensitivity (editor);
 done:
-        gtk_widget_set_sensitive (GTK_WIDGET (gtk_builder_get_object (editor->builder, "details_apply_button")), valid);
+        gtk_widget_set_sensitive (GTK_WIDGET (gtk_builder_get_object (editor->builder, "details_apply_button")), valid && editor->is_changed);
 }
 
 static void
@@ -364,6 +364,8 @@ page_changed (CEPage *page, gpointer user_data)
 {
         NetConnectionEditor *editor= user_data;
 
+        if (editor_is_initialized (editor))
+                editor->is_changed = TRUE;
         validate (editor);
 }
 
diff --git a/panels/network/connection-editor/net-connection-editor.h b/panels/network/connection-editor/net-connection-editor.h
index 31dc486..ef883d4 100644
--- a/panels/network/connection-editor/net-connection-editor.h
+++ b/panels/network/connection-editor/net-connection-editor.h
@@ -53,6 +53,7 @@ struct _NetConnectionEditor
         NMConnection     *connection;
         NMConnection     *orig_connection;
         gboolean          is_new_connection;
+        gboolean          is_changed;
         NMAccessPoint    *ap;
 
         GtkBuilder       *builder;


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