[gnome-boxes/wip/wizard-n-props-in-dialog2: 11/12] Drop PropertiesSidebar



commit dc7cda4ba9c1537e1cc9a3619daf72926002c84d
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Fri Nov 21 18:53:30 2014 +0000

    Drop PropertiesSidebar
    
    Drop the sidebar from properties. It looks weird now in the dialog and
    all the functionality it provides has already been replaced by previous
    patches to this.

 data/gnome-boxes.gresource.xml |    1 -
 data/ui/properties-dialog.ui   |   25 +----
 data/ui/properties-sidebar.ui  |  206 ----------------------------------------
 src/Makefile.am                |    1 -
 src/machine.vala               |   23 -----
 src/properties-dialog.vala     |    3 -
 src/properties-sidebar.vala    |   48 ---------
 src/properties.vala            |   29 ------
 src/snapshots-property.vala    |    2 -
 9 files changed, 3 insertions(+), 335 deletions(-)
---
diff --git a/data/gnome-boxes.gresource.xml b/data/gnome-boxes.gresource.xml
index 5ed720c..37a802f 100644
--- a/data/gnome-boxes.gresource.xml
+++ b/data/gnome-boxes.gresource.xml
@@ -13,7 +13,6 @@
     <file preprocess="xml-stripblanks">ui/editable-entry.ui</file>
     <file preprocess="xml-stripblanks">ui/mini-graph.ui</file>
     <file preprocess="xml-stripblanks">ui/notification.ui</file>
-    <file preprocess="xml-stripblanks">ui/properties-sidebar.ui</file>
     <file preprocess="xml-stripblanks">ui/properties-dialog.ui</file>
     <file preprocess="xml-stripblanks">ui/searchbar.ui</file>
     <file preprocess="xml-stripblanks">ui/selectionbar.ui</file>
diff --git a/data/ui/properties-dialog.ui b/data/ui/properties-dialog.ui
index 6d9a34d..49817f1 100644
--- a/data/ui/properties-dialog.ui
+++ b/data/ui/properties-dialog.ui
@@ -8,11 +8,7 @@
         |
         |-> vbox (internal child)
              |
-             |-> hbox = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 0);
-                  |
-                  |-> sidebar = new Boxes.PropertiesSidebar ();
-                  |
-                  |-> properties = new Boxes.Properties ();
+             |-> properties = new Boxes.Properties ();
   -->
 
   <template class="BoxesPropertiesDialog" parent="GtkDialog">
@@ -24,31 +20,16 @@
 
     <child internal-child="vbox">
       <object class="GtkBox">
-
         <child>
-          <object class="GtkBox" id="hbox">
+          <object class="BoxesProperties" id="properties">
             <property name="visible">True</property>
-            <property name="orientation">horizontal</property>
             <property name="halign">fill</property>
             <property name="valign">fill</property>
             <property name="hexpand">True</property>
             <property name="vexpand">True</property>
-            <property name="spacing">0</property>
-
-            <child>
-              <object class="BoxesPropertiesSidebar" id="sidebar">
-                <property name="visible">True</property>
-              </object>
-            </child>
-
-            <child>
-              <object class="BoxesProperties" id="properties">
-                <property name="visible">True</property>
-              </object>
-            </child>
-
           </object>
         </child>
+
       </object>
     </child>
   </template>
diff --git a/src/Makefile.am b/src/Makefile.am
index 37dd322..999ef25 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -124,7 +124,6 @@ gnome_boxes_SOURCES =                               \
        os-database.vala                        \
        properties.vala                         \
        properties-dialog.vala                  \
-       properties-sidebar.vala                 \
        remote-machine.vala                     \
        searchbar.vala                          \
        selectionbar.vala                       \
diff --git a/src/machine.vala b/src/machine.vala
index ae6ddc6..9a7050c 100644
--- a/src/machine.vala
+++ b/src/machine.vala
@@ -426,8 +426,6 @@ private abstract class Boxes.Machine: Boxes.CollectionItem, Boxes.IPropertiesPro
 
             orig_pixbuf = small_screenshot;
             pixbuf = draw_vm (small_screenshot, SCREENSHOT_WIDTH, SCREENSHOT_HEIGHT);
-            if (window.current_item == this)
-                window.props_dialog.sidebar.screenshot.set_from_pixbuf (pixbuf);
             if (save)
                 save_pixbuf_as_screenshot (small_screenshot);
 
@@ -569,27 +567,6 @@ private abstract class Boxes.Machine: Boxes.CollectionItem, Boxes.IPropertiesPro
             disconnect_display ();
 
             break;
-        case UIState.PROPERTIES:
-            Gdk.Pixbuf pixbuf = null;
-            if (previous_ui_state == UIState.WIZARD) {
-                var theme = Gtk.IconTheme.get_for_screen (window.get_screen ());
-                pixbuf = new Gdk.Pixbuf (Gdk.Colorspace.RGB, true, 8,
-                                         Machine.SCREENSHOT_WIDTH, Machine.SCREENSHOT_HEIGHT);
-                pixbuf.fill (0x00000000); // Transparent
-                try {
-                    var icon = theme.load_icon ("media-optical", Machine.SCREENSHOT_HEIGHT, 0);
-                    // Center icon in pixbuf
-                    icon.copy_area (0, 0, Machine.SCREENSHOT_HEIGHT, Machine.SCREENSHOT_HEIGHT, pixbuf,
-                                    (Machine.SCREENSHOT_WIDTH - Machine.SCREENSHOT_HEIGHT) / 2, 0);
-                } catch (GLib.Error err) {
-                    warning (err.message);
-                }
-            } else {
-                pixbuf = this.pixbuf;
-            }
-            window.props_dialog.sidebar.screenshot.set_from_pixbuf (pixbuf);
-
-            break;
         }
     }
 
diff --git a/src/properties-dialog.vala b/src/properties-dialog.vala
index 0183152..635979f 100644
--- a/src/properties-dialog.vala
+++ b/src/properties-dialog.vala
@@ -7,8 +7,6 @@ private class Boxes.PropertiesDialog: Gtk.Dialog, Boxes.UI {
     public UIState ui_state { get; protected set; }
 
     [GtkChild]
-    public PropertiesSidebar sidebar;
-    [GtkChild]
     public Properties properties;
 
     private unowned AppWindow app_window;
@@ -22,7 +20,6 @@ private class Boxes.PropertiesDialog: Gtk.Dialog, Boxes.UI {
     public PropertiesDialog (AppWindow app_window) {
         this.app_window = app_window;
 
-        sidebar.setup_ui (app_window);
         properties.setup_ui (app_window, this);
 
         set_transient_for (app_window);
diff --git a/src/properties.vala b/src/properties.vala
index 0d60531..ec1f0e9 100644
--- a/src/properties.vala
+++ b/src/properties.vala
@@ -17,7 +17,6 @@ private class Boxes.Properties: Gtk.Notebook, Boxes.UI {
     public UIState ui_state { get; protected set; }
 
     private AppWindow window;
-    private PropertiesSidebar sidebar;
 
     private ulong stats_id;
     private bool restore_fullscreen;
@@ -115,24 +114,13 @@ private class Boxes.Properties: Gtk.Notebook, Boxes.UI {
         notify["ui-state"].connect (ui_state_changed);
     }
 
-    private void list_append (Gtk.ListStore listmodel, string label, bool visible) {
-        Gtk.TreeIter iter;
-
-        listmodel.append (out iter);
-        listmodel.set (iter, 0, label);
-        listmodel.set (iter, 1, visible);
-    }
-
     private void populate () {
-        sidebar.listmodel.clear ();
         foreach (var page in get_children ())
             remove (page);
 
         var machine = window.current_item as Machine;
         var libvirt_machine = window.current_item as LibvirtMachine;
 
-        sidebar.shutdown_button.sensitive = libvirt_machine != null && libvirt_machine.is_running ();
-
         if (machine == null)
             return;
 
@@ -145,26 +133,18 @@ private class Boxes.Properties: Gtk.Notebook, Boxes.UI {
             page.refresh_properties.connect (() => {
                 var current_page = page;
                 this.populate ();
-                var path = new Gtk.TreePath.from_indices (current_page);
-                sidebar.selection.select_path (path);
                 page = current_page;
             });
-
-            list_append (sidebar.listmodel, page.name, !page.empty);
         }
 
         if (libvirt_machine != null)
             page = (previous_ui_state == UIState.WIZARD) ? PropertiesPage.SYSTEM : PropertiesPage.GENERAL;
         else
             page = PropertiesPage.GENERAL;
-
-        var path = new Gtk.TreePath.from_indices (page);
-        sidebar.selection.select_path (path);
     }
 
     public void setup_ui (AppWindow window, PropertiesDialog dialog) {
         this.window = window;
-        this.sidebar = dialog.sidebar;
 
         show_all ();
     }
@@ -179,15 +159,6 @@ private class Boxes.Properties: Gtk.Notebook, Boxes.UI {
             restore_fullscreen = (previous_ui_state == UIState.DISPLAY && window.fullscreened);
             window.fullscreened = false;
 
-            if (window.current_item is LibvirtMachine) {
-                var libvirt_machine = window.current_item as LibvirtMachine;
-                stats_id = libvirt_machine.stats_updated.connect (() => {
-                    sidebar.cpu_graph.points = libvirt_machine.cpu_stats;
-                    sidebar.net_graph.points = libvirt_machine.net_stats;
-                    sidebar.io_graph.points = libvirt_machine.io_stats;
-                });
-            }
-
             populate ();
         } else if (previous_ui_state == UIState.PROPERTIES) {
             var reboot_required = false;
diff --git a/src/snapshots-property.vala b/src/snapshots-property.vala
index a7351ab..b78d330 100644
--- a/src/snapshots-property.vala
+++ b/src/snapshots-property.vala
@@ -11,11 +11,9 @@ private class Boxes.SnapshotsProperty : Boxes.Property {
         set {
             if (value == null) {
                 snapshot_stack.visible_child = snapshot_box;
-                machine.window.props_dialog.sidebar.sensitive = true;
             } else {
                 activity_label.label = value;
                 snapshot_stack.visible_child = activity_box;
-                machine.window.props_dialog.sidebar.sensitive = false;
             }
         }
     }


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