summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2013-10-10 11:29:39 -0500
committerDan Williams <dcbw@redhat.com>2014-02-19 20:00:24 -0600
commitec8380e60d0be9e226d5ce1638a8d2e597985b11 (patch)
tree6c0b466f894561320a6fa47fdc60554095a87fdd
parent649f8cdf0a905bbfa68316adcfd84250a9ae8901 (diff)
downloadnetwork-manager-applet-ec8380e60d0be9e226d5ce1638a8d2e597985b11.tar.gz
editor: populate connection right before saving it
Previously the only way the UI pages could update the connection's settings with the new values from the UI was whenever any widget changed, which required connecting all the widgets to the the ce_page_changed() handler to re-run the validate method, which populated the connection and validated it. Not all widgets need to be validated, especially if the have GtkAdjustments or are GtkToggleButtons, since these already enforce valid values. Re-validating the connection right before saving it allows these widgets to not be hooked up to ce_page_changed() every time they change, but still allows them to push their latest value to the connection/setting right before the changes are saved.
-rw-r--r--src/connection-editor/nm-connection-editor.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/connection-editor/nm-connection-editor.c b/src/connection-editor/nm-connection-editor.c
index a4336907..152cdee0 100644
--- a/src/connection-editor/nm-connection-editor.c
+++ b/src/connection-editor/nm-connection-editor.c
@@ -975,6 +975,9 @@ ok_button_clicked_cb (GtkWidget *widget, gpointer user_data)
if (self->busy)
return;
+ /* Validate one last time to ensure all pages update the connection */
+ connection_editor_validate (self);
+
ok_button_clicked_save_connection (self);
}