From: Zeeshan Ali (Khattak) Date: Fri, 12 Jun 2009 15:23:02 +0000 (+0300) Subject: ui: Tracker options to share type of media X-Git-Tag: RYGEL_0_4~332 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c78b83fb7e3403862d1fc532e969140d651bac34;p=profile%2Fivi%2Frygel.git ui: Tracker options to share type of media Add options under Tracker plugin that allows user to select which type of items he wants to share: videos, music and/or pictures. --- diff --git a/data/rygel-preferences.ui b/data/rygel-preferences.ui index 4621f04..aef38e9 100644 --- a/data/rygel-preferences.ui +++ b/data/rygel-preferences.ui @@ -240,7 +240,7 @@ True - 7 + 10 2 6 6 @@ -278,8 +278,8 @@ True - 2 - 3 + 5 + 6 @@ -291,8 +291,8 @@ True - 3 - 4 + 6 + 7 @@ -322,8 +322,8 @@ 1 2 - 3 - 4 + 6 + 7 @@ -336,8 +336,8 @@ True - 5 - 6 + 8 + 9 @@ -349,8 +349,8 @@ True - 6 - 7 + 9 + 10 @@ -365,8 +365,8 @@ 1 2 - 6 - 7 + 9 + 10 @@ -379,8 +379,8 @@ True - 4 - 5 + 7 + 8 @@ -455,8 +455,57 @@ 1 2 + 7 + 8 + + + + + Share _Videos + True + True + False + True + True + + + 2 + 3 + + 12 + + + + + Share M_usic + True + True + False + True + 0.54000002145767212 + True + + + 3 + 4 + + 12 + + + + + Share _Pictures + True + True + False + True + True + + 4 5 + + 12 @@ -468,6 +517,15 @@ + + + + + + + + + @@ -540,9 +598,9 @@ dialog preferences-dialog False - True False select-folder + True True diff --git a/src/ui/Makefile.am b/src/ui/Makefile.am index e33f02c..de37c0c 100644 --- a/src/ui/Makefile.am +++ b/src/ui/Makefile.am @@ -24,7 +24,8 @@ BUILT_SOURCES = rygel-preferences-dialog.c \ rygel-preferences-section.c \ rygel-general-pref-section.c \ rygel-plugin-pref-section.c \ - rygel-media-export-pref-section.c + rygel-media-export-pref-section.c \ + rygel-tracker-pref-section.c $(BUILT_SOURCES) : rygel.stamp @@ -37,7 +38,9 @@ rygel_preferences_SOURCES = rygel-preferences-dialog.c \ rygel-plugin-pref-section.c \ rygel-plugin-pref-section.vala \ rygel-media-export-pref-section.c \ - rygel-media-export-pref-section.vala + rygel-media-export-pref-section.vala \ + rygel-tracker-pref-section.c \ + rygel-tracker-pref-section.vala rygel.stamp: $(filter %.vala,$(rygel_preferences_SOURCES)) $(VALAC) -C --vapidir=$(rygeldir) \ diff --git a/src/ui/rygel-preferences-dialog.vala b/src/ui/rygel-preferences-dialog.vala index fa66dfa..adc49d2 100644 --- a/src/ui/rygel-preferences-dialog.vala +++ b/src/ui/rygel-preferences-dialog.vala @@ -44,9 +44,8 @@ public class Rygel.PreferencesDialog : GLib.Object { this.sections = new ArrayList (); this.sections.add (new GeneralPrefSection (this.builder, config)); - this.sections.add (new PluginPrefSection (this.builder, - config, - "Tracker")); + this.sections.add (new TrackerPrefSection (this.builder, + config)); this.sections.add (new PluginPrefSection (this.builder, config, "DVB")); diff --git a/src/ui/rygel-tracker-pref-section.vala b/src/ui/rygel-tracker-pref-section.vala new file mode 100644 index 0000000..c729ed7 --- /dev/null +++ b/src/ui/rygel-tracker-pref-section.vala @@ -0,0 +1,78 @@ +/* + * Copyright (C) 2009 Nokia Corporation, all rights reserved. + * + * 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 Gee; + +public class Rygel.TrackerPrefSection : Rygel.PluginPrefSection { + const string NAME = "Tracker"; + const string VIDEOS_KEY = "share-videos"; + const string MUSIC_KEY = "share-music"; + const string PICTURES_KEY = "share-pictures"; + const string TAG_KEY = "share-tagged"; + const string VIDEOS_CHECK = VIDEOS_KEY + "-checkbutton"; + const string MUSIC_CHECK = MUSIC_KEY + "-checkbutton"; + const string PICTURES_CHECK = PICTURES_KEY + "-checkbutton"; + + private CheckButton videos_check; + private CheckButton music_check; + private CheckButton pictures_check; + + public TrackerPrefSection (Builder builder, UserConfig config) { + base (builder, config, NAME); + + this.videos_check = (CheckButton) builder.get_object (VIDEOS_CHECK); + assert (this.videos_check != null); + this.music_check = (CheckButton) builder.get_object (MUSIC_CHECK); + assert (this.music_check != null); + this.pictures_check = (CheckButton) builder.get_object (PICTURES_CHECK); + assert (this.pictures_check != null); + + this.videos_check.active = true; + this.music_check.active = true; + this.pictures_check.active = true; + + try { + this.videos_check.active = config.get_bool (this.name, VIDEOS_KEY); + this.music_check.active = config.get_bool (this.name, MUSIC_KEY); + this.pictures_check.active = config.get_bool (this.name, + PICTURES_KEY); + } catch (Error err) {} + } + + public override void save () { + base.save (); + + config.set_bool (this.name, VIDEOS_KEY, this.videos_check.active); + config.set_bool (this.name, MUSIC_KEY, this.music_check.active); + config.set_bool (this.name, PICTURES_KEY, this.pictures_check.active); + } + + protected override void on_enabled_check_toggled ( + CheckButton enabled_check) { + base.on_enabled_check_toggled (enabled_check); + + this.videos_check.sensitive = enabled_check.active; + this.music_check.sensitive = enabled_check.active; + this.pictures_check.sensitive = enabled_check.active; + } +}