From: Zeeshan Ali (Khattak) Date: Thu, 17 Feb 2011 16:19:37 +0000 (+0200) Subject: ui: Separete general section class now unneeded X-Git-Tag: RYGEL_0_9_9~26 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=89a4cbe62440ea0338347b71e05a0e8432404c13;p=profile%2Fivi%2Frygel.git ui: Separete general section class now unneeded --- diff --git a/po/POTFILES.in b/po/POTFILES.in index 5426e42..01d949c 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -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 diff --git a/src/ui/Makefile.am b/src/ui/Makefile.am index 1e48c63..02709cf 100644 --- a/src/ui/Makefile.am +++ b/src/ui/Makefile.am @@ -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 index 85286d3..0000000 --- a/src/ui/rygel-general-pref-section.vala +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (C) 2009 Nokia Corporation. - * - * Author: Zeeshan Ali (Khattak) - * - * - * 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); - } -} diff --git a/src/ui/rygel-preferences-dialog.vala b/src/ui/rygel-preferences-dialog.vala index bd02172..e5cf50c 100644 --- a/src/ui/rygel-preferences-dialog.vala +++ b/src/ui/rygel-preferences-dialog.vala @@ -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 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 (); - 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 (); }