[gnome-boxes/wip/props-ui-files] tmp



commit 4341b6b6f3bc1b35bbb6d0adb00ed58f48fd251c
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Fri Aug 26 01:03:08 2016 +0100

    tmp

 src/libvirt-machine-properties.vala |    1 +
 src/properties-page-widget.vala     |    4 ++++
 src/properties.vala                 |    9 ++++++++-
 3 files changed, 13 insertions(+), 1 deletions(-)
---
diff --git a/src/libvirt-machine-properties.vala b/src/libvirt-machine-properties.vala
index 5c3a28e..82addfa 100644
--- a/src/libvirt-machine-properties.vala
+++ b/src/libvirt-machine-properties.vala
@@ -372,6 +372,7 @@ private class Boxes.LibvirtMachineProperties: GLib.Object, Boxes.IPropertiesProv
 
         widget.add_property (null, grid);
         SourceFunc change_func = () => {
+            print ("%s trouble\n", machine.name);
             machine.disconnect (state_notify_id);
 
             return false;
diff --git a/src/properties-page-widget.vala b/src/properties-page-widget.vala
index a0ee738..0869f6c 100644
--- a/src/properties-page-widget.vala
+++ b/src/properties-page-widget.vala
@@ -68,6 +68,10 @@ private class Boxes.PropertiesPageWidget: Gtk.Box {
         show_all ();
     }
 
+    ~PropertiesPageWidget () {
+        print ("destroyed: %s\n", name);
+    }
+
     public bool flush_changes () {
         var reboot_required = this.reboot_required;
 
diff --git a/src/properties.vala b/src/properties.vala
index e43d3fb..6987fb2 100644
--- a/src/properties.vala
+++ b/src/properties.vala
@@ -40,8 +40,12 @@ private class Boxes.Properties: Gtk.Notebook, Boxes.UI {
             var label = new Gtk.Label (page.name);
             insert_page (page, label, i);
             set_data<PropertiesPageWidget> (@"boxes-property-$i", page);
+            page.show_all ();
 
-            page.refresh_properties.connect (() => {
+            ulong props_refresh_id = 0;
+            props_refresh_id = page.refresh_properties.connect (() => {
+                print ("refreshing properties\n");
+                page.disconnect (props_refresh_id);
                 var current_page = this.page;
                 this.populate.begin ((object, result) => {
                     this.populate.end (result);
@@ -80,6 +84,9 @@ private class Boxes.Properties: Gtk.Notebook, Boxes.UI {
                     reboot_required |= page.flush_changes ();
             }
 
+            foreach (var page in get_children ())
+                remove (page);
+
             var machine = window.current_item as Machine;
             if (reboot_required && (machine.is_on || machine.state == Machine.MachineState.SAVED)) {
                 var message = _("Changes require restart of '%s'.").printf (machine.name);


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