[gnome-disk-utility/udisks2-port] Declare the GtkSwitch in the .ui file



commit bb98d5ac83cb06dd3d733931790faf53a03c00a5
Author: David Zeuthen <davidz redhat com>
Date:   Tue Mar 8 18:08:01 2011 -0500

    Declare the GtkSwitch in the .ui file
    
    Signed-off-by: David Zeuthen <davidz redhat com>

 data/ui/palimpsest.ui      |   26 ++++++++++++++++++++++++++
 src/palimpsest/gduwindow.c |   16 +---------------
 2 files changed, 27 insertions(+), 15 deletions(-)
---
diff --git a/data/ui/palimpsest.ui b/data/ui/palimpsest.ui
index bbbc8c7..8dca848 100644
--- a/data/ui/palimpsest.ui
+++ b/data/ui/palimpsest.ui
@@ -172,6 +172,32 @@
                       </packing>
                     </child>
                     <child>
+                      <object class="GtkHBox" id="hbox30">
+                        <property name="visible">True</property>
+                        <child>
+                          <object class="GtkSwitch" id="lun-write-cache-switch">
+                            <property name="visible">True</property>
+                          </object>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">False</property>
+                            <property name="position">0</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <placeholder/>
+                        </child>
+                      </object>
+                      <packing>
+                        <property name="left_attach">1</property>
+                        <property name="right_attach">2</property>
+                        <property name="top_attach">5</property>
+                        <property name="bottom_attach">6</property>
+                        <property name="x_options">GTK_FILL</property>
+                        <property name="y_options"></property>
+                      </packing>
+                    </child>
+                    <child>
                       <object class="GtkLabel" id="lun-wwn-label">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
diff --git a/src/palimpsest/gduwindow.c b/src/palimpsest/gduwindow.c
index 39e3b08..9b77b85 100644
--- a/src/palimpsest/gduwindow.c
+++ b/src/palimpsest/gduwindow.c
@@ -49,8 +49,6 @@ struct _GduWindow
 
   DetailsPage current_page;
   GDBusObjectProxy *current_object_proxy;
-
-  GtkWidget *lun_write_cache_switch;
 };
 
 typedef struct
@@ -193,7 +191,6 @@ gdu_window_constructed (GObject *object)
   GtkTreeSelection *selection;
   const gchar *path;
   GtkWidget *w;
-  GtkWidget *align;
   GtkStyleContext *context;
 
   /* chain up */
@@ -276,17 +273,6 @@ gdu_window_constructed (GObject *object)
                     G_CALLBACK (on_row_inserted),
                     window);
   gtk_tree_view_expand_all (tree_view);
-
-  /* insert widgets not yet supported by the glade app */
-  window->lun_write_cache_switch = gtk_switch_new ();
-  align = gtk_alignment_new (0.0, 0.5, 0.0, 1.0);
-  gtk_container_add (GTK_CONTAINER (align), window->lun_write_cache_switch);
-  gtk_table_attach (GTK_TABLE (gdu_window_get_widget (window, "lun-table")),
-                    align,
-                    1, 2,
-                    5, 6,
-                    GTK_FILL, 0,
-                    0, 0);
 }
 
 static void
@@ -494,7 +480,7 @@ setup_details_page (GduWindow         *window,
         set_string (window, "lun-wwn-value-label", udisks_lun_get_wwn (lun));
         set_size (window, "lun-size-value-label", udisks_lun_get_size (lun));
         /* TODO: get this from udisks */
-        gtk_switch_set_active (GTK_SWITCH (window->lun_write_cache_switch), TRUE);
+        gtk_switch_set_active (GTK_SWITCH (gdu_window_get_widget (window, "lun-write-cache-switch")), TRUE);
       }
       break;
     case DETAILS_PAGE_LOOP:



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