[connections/refactor-properties-instanciation: 24/26] connection: Auto-save properties whenever they change




commit 60a572a91fa04266ba4e049f4892ce0b370b6600
Author: Felipe Borges <felipeborges gnome org>
Date:   Tue Dec 1 17:12:49 2020 +0100

    connection: Auto-save properties whenever they change
    
    I can't see a reason why not. :)

 src/connection.vala            | 2 ++
 src/vnc-properties-dialog.vala | 4 ----
 2 files changed, 2 insertions(+), 4 deletions(-)
---
diff --git a/src/connection.vala b/src/connection.vala
index 2e3a9c4..04f75b8 100644
--- a/src/connection.vala
+++ b/src/connection.vala
@@ -205,6 +205,8 @@ namespace Connections {
             thumbnailer = new Connections.Thumbnailer (this);
 
             show.connect (() => { thumbnailer.update_thumbnail (); });
+
+            notify.connect (save);
         }
 
         public abstract void connect_it ();
diff --git a/src/vnc-properties-dialog.vala b/src/vnc-properties-dialog.vala
index 415e8b1..abf6dcf 100644
--- a/src/vnc-properties-dialog.vala
+++ b/src/vnc-properties-dialog.vala
@@ -32,7 +32,6 @@ namespace Connections {
                 }
             };
             scaling.widget.bind_property ("active", connection, "scaling", BindingFlags.SYNC_CREATE);
-            connection.notify["scaling"].connect (() => { connection.save (); });
             add_property (scaling);
 
             var view_only = new Property () {
@@ -42,7 +41,6 @@ namespace Connections {
                 }
             };
             view_only.widget.bind_property ("active", vnc, "view_only", BindingFlags.SYNC_CREATE);
-            vnc.notify["view-only"].connect (() => { vnc.save (); });
             add_property (view_only);
 
             var local_pointer = new Property () {
@@ -52,7 +50,6 @@ namespace Connections {
                 }
             };
             local_pointer.widget.bind_property ("active", vnc, "show_local_pointer", 
BindingFlags.SYNC_CREATE);
-            vnc.notify["show-local-pointer"].connect (() => { vnc.save (); });
             add_property (local_pointer);
 
             var combo_widget = new Gtk.ComboBoxText ();
@@ -66,7 +63,6 @@ namespace Connections {
             combo_widget.notify["active-id"].connect (() => {
                 vnc.bandwidth = vnc.bandwidth.from_string (combo_widget.active_id);
             });
-            vnc.notify["bandwidth"].connect (() => { vnc.save (); });
             add_property (bandwidth);
         }
     }


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