[network-manager-applet/dcbw/dcb: 3/4] editor: populate connection right before saving it



commit 4fa749126d2986dc01d3d0b54d7bedae50780325
Author: Dan Williams <dcbw redhat com>
Date:   Thu Oct 10 11:29:39 2013 -0500

    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.

 src/connection-editor/nm-connection-editor.c |    3 +++
 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 a433690..152cdee 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);
 }
 


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