ui: Separete general section class now unneeded
authorZeeshan Ali (Khattak) <zeeshanak@gnome.org>
Thu, 17 Feb 2011 16:19:37 +0000 (18:19 +0200)
committerZeeshan Ali (Khattak) <zeeshanak@gnome.org>
Thu, 17 Feb 2011 23:47:15 +0000 (01:47 +0200)
po/POTFILES.in
src/ui/Makefile.am
src/ui/rygel-general-pref-section.vala [deleted file]
src/ui/rygel-preferences-dialog.vala

index 5426e42..01d949c 100644 (file)
@@ -146,7 +146,6 @@ src/rygel/rygel-wmv-transcoder-bin.vala
 src/rygel/rygel-wmv-transcoder.vala
 src/rygel/rygel-xbox-hacks.vala
 src/rygel/rygel-changelog.vala
-src/ui/rygel-general-pref-section.vala
 src/ui/rygel-media-export-pref-section.vala
 src/ui/rygel-preferences-dialog.vala
 src/ui/rygel-preferences-section.vala
index 1e48c63..02709cf 100644 (file)
@@ -26,7 +26,6 @@ bin_PROGRAMS = rygel-preferences
 rygel_preferences_SOURCES = \
                            rygel-preferences-dialog.vala \
                            rygel-preferences-section.vala \
-                           rygel-general-pref-section.vala \
                            rygel-media-export-pref-section.vala \
                            rygel-writable-user-config.vala \
                            rygel-network-pref-section.vala
diff --git a/src/ui/rygel-general-pref-section.vala b/src/ui/rygel-general-pref-section.vala
deleted file mode 100644 (file)
index 85286d3..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright (C) 2009 Nokia Corporation.
- *
- * Author: Zeeshan Ali (Khattak) <zeeshanak@gnome.org>
- *                               <zeeshan.ali@nokia.com>
- *
- * This file is part of Rygel.
- *
- * Rygel is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * Rygel is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-using Gtk;
-using GUPnP;
-
-public class Rygel.GeneralPrefSection : PreferencesSection {
-    const string UPNP_CHECKBUTTON = "upnp-checkbutton";
-
-    private CheckButton upnp_check;
-
-    public GeneralPrefSection (Builder            builder,
-                               WritableUserConfig config) throws Error {
-        base (config, "general");
-
-        this.upnp_check = (CheckButton) builder.get_object (UPNP_CHECKBUTTON);
-        assert (this.upnp_check != null);
-
-        try {
-            this.upnp_check.active = this.config.get_upnp_enabled ();
-        } catch (GLib.Error err) {}
-    }
-
-    public override void save () {
-        this.config.set_upnp_enabled (this.upnp_check.active);
-    }
-}
index bd02172..e5cf50c 100644 (file)
@@ -27,10 +27,12 @@ public class Rygel.PreferencesDialog : GLib.Object {
     const string UI_FILE = BuildConfig.DATA_DIR + "/rygel-preferences.ui";
     const string DIALOG = "preferences-dialog";
     const string ICON = BuildConfig.SMALL_ICON_DIR + "/rygel.png";
+    const string UPNP_CHECKBUTTON = "upnp-checkbutton";
 
     private WritableUserConfig config;
     private Builder builder;
     private Dialog dialog;
+    private CheckButton upnp_check;
     private ArrayList<PreferencesSection> sections;
 
     public PreferencesDialog () throws Error {
@@ -41,11 +43,16 @@ public class Rygel.PreferencesDialog : GLib.Object {
 
         this.dialog = (Dialog) this.builder.get_object (DIALOG);
         assert (this.dialog != null);
+        this.upnp_check = (CheckButton) builder.get_object (UPNP_CHECKBUTTON);
+        assert (this.upnp_check != null);
 
         this.dialog.set_icon_from_file (ICON);
 
+        try {
+            this.upnp_check.active = this.config.get_upnp_enabled ();
+        } catch (GLib.Error err) {}
+
         this.sections = new ArrayList<PreferencesSection> ();
-        this.sections.add (new GeneralPrefSection (this.builder, this.config));
         this.sections.add (new NetworkPrefSection (this.builder, this.config));
         this.sections.add (new MediaExportPrefSection (this.builder,
                                                        this.config));
@@ -54,6 +61,7 @@ public class Rygel.PreferencesDialog : GLib.Object {
     public void run () {
         this.dialog.run ();
 
+        this.config.set_upnp_enabled (this.upnp_check.active);
         foreach (var section in this.sections) {
             section.save ();
         }