[rygel] data,ui: 'Media Export' checkbox -> 'Media' label



commit 2071e0a73c2348050dd6fd9b89189bd4cf57f599
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Wed Feb 16 02:59:12 2011 +0200

    data,ui: 'Media Export' checkbox -> 'Media' label
    
    Replace 'Media Export' checkbox by 'Media' label.

 data/rygel-preferences.ui                   |   30 ++++++++-------------
 src/ui/rygel-media-export-pref-section.vala |   37 ---------------------------
 2 files changed, 12 insertions(+), 55 deletions(-)
---
diff --git a/data/rygel-preferences.ui b/data/rygel-preferences.ui
index 1c06807..e350b0e 100644
--- a/data/rygel-preferences.ui
+++ b/data/rygel-preferences.ui
@@ -88,22 +88,6 @@
                     <property name="column_spacing">6</property>
                     <property name="row_spacing">6</property>
                     <child>
-                      <object class="GtkCheckButton" id="mediaexport-enabled-checkbutton">
-                        <property name="label" translatable="yes">_Media Export</property>
-                        <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="receives_default">False</property>
-                        <property name="use_action_appearance">False</property>
-                        <property name="use_underline">True</property>
-                        <property name="xalign">0</property>
-                        <property name="draw_indicator">True</property>
-                      </object>
-                      <packing>
-                        <property name="x_options">GTK_FILL</property>
-                        <property name="y_options">GTK_FILL</property>
-                      </packing>
-                    </child>
-                    <child>
                       <object class="GtkLabel" id="uris-label">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
@@ -214,11 +198,21 @@
                       <packing>
                         <property name="left_attach">1</property>
                         <property name="right_attach">2</property>
-                        <property name="top_attach">2</property>
-                        <property name="bottom_attach">3</property>
+                        <property name="top_attach">1</property>
+                        <property name="bottom_attach">2</property>
                       </packing>
                     </child>
                     <child>
+                      <object class="GtkLabel" id="media-label">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="label" translatable="yes">Media</property>
+                      </object>
+                    </child>
+                    <child>
+                      <placeholder/>
+                    </child>
+                    <child>
                       <placeholder/>
                     </child>
                   </object>
diff --git a/src/ui/rygel-media-export-pref-section.vala b/src/ui/rygel-media-export-pref-section.vala
index 8902a3c..95d4d18 100644
--- a/src/ui/rygel-media-export-pref-section.vala
+++ b/src/ui/rygel-media-export-pref-section.vala
@@ -24,7 +24,6 @@ using Gtk;
 using Gee;
 
 public class Rygel.MediaExportPrefSection : PreferencesSection {
-    const string ENABLED_CHECK = "-enabled-checkbutton";
     const string NAME = "MediaExport";
     const string URIS_KEY = "uris";
     const string URIS_LABEL = URIS_KEY + "-label";
@@ -35,7 +34,6 @@ public class Rygel.MediaExportPrefSection : PreferencesSection {
     const string REMOVE_BUTTON = "remove-button";
     const string CLEAR_BUTTON = "clear-button";
 
-    private CheckButton enabled_check;
     private ArrayList<Widget> widgets; // All widgets in this section
 
     private TreeView treeview;
@@ -48,18 +46,6 @@ public class Rygel.MediaExportPrefSection : PreferencesSection {
 
         this.widgets = new ArrayList<Widget> ();
 
-        this.enabled_check = (CheckButton) builder.get_object (name.down () +
-                                                               ENABLED_CHECK);
-        assert (this.enabled_check != null);
-
-        try {
-            this.enabled_check.active = config.get_enabled (name);
-        } catch (GLib.Error err) {
-            this.enabled_check.active = false;
-        }
-
-        this.enabled_check.toggled.connect (this.on_enabled_check_toggled);
-
         this.treeview = (TreeView) builder.get_object (URIS_TEXTVIEW);
         assert (this.treeview != null);
         this.liststore = (ListStore) builder.get_object (URIS_LISTSTORE);
@@ -99,20 +85,9 @@ public class Rygel.MediaExportPrefSection : PreferencesSection {
         button = (Button) builder.get_object (CLEAR_BUTTON);
         button.clicked.connect (this.on_clear_button_clicked);
         this.widgets.add (button);
-
-        var label = (Label) builder.get_object (URIS_LABEL);
-        assert (label != null);
-        this.widgets.add (label);
-
-        // Initialize the sensitivity of all widgets
-        this.reset_widgets_sensitivity ();
     }
 
     public override void save () {
-        this.config.set_bool (this.name,
-                              UserConfig.ENABLED_KEY,
-                              this.enabled_check.active);
-
         TreeIter iter;
         var uri_list = new ArrayList<string> ();
 
@@ -128,18 +103,6 @@ public class Rygel.MediaExportPrefSection : PreferencesSection {
         this.config.set_string_list (this.name, URIS_KEY, uri_list);
     }
 
-    private void reset_widgets_sensitivity () {
-        this.title_entry.sensitive = this.enabled_check.active;
-
-        foreach (var widget in this.widgets) {
-            widget.sensitive = enabled_check.active;
-        }
-    }
-
-    private void on_enabled_check_toggled (ToggleButton enabled_check) {
-        this.reset_widgets_sensitivity ();
-    }
-
     private void on_add_button_clicked (Button button) {
         if (this.dialog.run () == ResponseType.OK) {
             TreeIter iter;



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