network: disable "Apply" in editor if connection hasn't changed

https://bugzilla.gnome.org/show_bug.cgi?id=692925
This commit is contained in:
Dan Winship 2013-02-04 17:36:23 -05:00
parent ec704ab62f
commit f85aed9516
2 changed files with 4 additions and 1 deletions

View file

@ -356,7 +356,7 @@ validate (NetConnectionEditor *editor)
update_sensitivity (editor); update_sensitivity (editor);
done: 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 static void
@ -364,6 +364,8 @@ page_changed (CEPage *page, gpointer user_data)
{ {
NetConnectionEditor *editor= user_data; NetConnectionEditor *editor= user_data;
if (editor_is_initialized (editor))
editor->is_changed = TRUE;
validate (editor); validate (editor);
} }

View file

@ -53,6 +53,7 @@ struct _NetConnectionEditor
NMConnection *connection; NMConnection *connection;
NMConnection *orig_connection; NMConnection *orig_connection;
gboolean is_new_connection; gboolean is_new_connection;
gboolean is_changed;
NMAccessPoint *ap; NMAccessPoint *ap;
GtkBuilder *builder; GtkBuilder *builder;