ui: Connect signals from UI description as much as possible
authorZeeshan Ali (Khattak) <zeeshanak@gnome.org>
Wed, 3 Jun 2009 15:16:06 +0000 (18:16 +0300)
committerZeeshan Ali (Khattak) <zeeshanak@gnome.org>
Wed, 3 Jun 2009 15:16:06 +0000 (18:16 +0300)
data/rygel-preferences.ui
src/ui/rygel-general-pref-section.vala

index 2b2b4dc..042cd68 100644 (file)
@@ -64,6 +64,7 @@
                             <property name="receives_default">False</property>
                             <property name="use_underline">True</property>
                             <property name="draw_indicator">True</property>
+                            <signal name="toggled" handler="rygel_general_pref_section_on_trans_check_toggled"/>
                           </object>
                           <packing>
                             <property name="y_options"></property>
index 7eccc43..e9e65ab 100644 (file)
@@ -66,7 +66,7 @@ public class Rygel.GeneralPrefSection : PreferencesSection {
         this.mp2ts_check.active = this.config.mp2ts_transcoder;
         this.lpcm_check.active = this.config.lpcm_transcoder;
 
-        this.trans_check.toggled += this.on_trans_check_toggled;
+        builder.connect_signals (this);
     }
 
     public override void save () {
@@ -79,7 +79,8 @@ public class Rygel.GeneralPrefSection : PreferencesSection {
         this.config.lpcm_transcoder = this.lpcm_check.active;
     }
 
-    private void on_trans_check_toggled (CheckButton trans_check) {
+    [CCode (instance_pos = -1)]
+    public void on_trans_check_toggled (CheckButton trans_check) {
         this.mp3_check.sensitive =
         this.mp2ts_check.sensitive =
         this.lpcm_check.sensitive = trans_check.active;