[rygel] Allow the old (shorter) keywords in config ui
- From: Zeeshan Ali Khattak <zeeshanak src gnome org>
- To: svn-commits-list gnome org
- Subject: [rygel] Allow the old (shorter) keywords in config ui
- Date: Mon, 11 May 2009 18:34:44 -0400 (EDT)
commit d85447186ee11a14b17b6ab87563c3fb3656e04c
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date: Mon May 11 17:27:53 2009 +0300
Allow the old (shorter) keywords in config ui
IMO, it is better to ask the user to type '%u' instead of @USERNAME
---
src/ui/rygel-plugin-pref-section.vala | 12 ++++++++----
1 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/src/ui/rygel-plugin-pref-section.vala b/src/ui/rygel-plugin-pref-section.vala
index 77cbd00..720acbb 100644
--- a/src/ui/rygel-plugin-pref-section.vala
+++ b/src/ui/rygel-plugin-pref-section.vala
@@ -42,7 +42,10 @@ public class Rygel.PluginPrefSection : PreferencesSection {
assert (this.title_entry != null);
this.enabled_check.active = config.get_enabled (name);
- this.title_entry.set_text (config.get_title (name, name));
+
+ var title = config.get_title (name, name).replace ("@REALNAME@", "%n");
+ title = title.replace ("@USERNAME@", "%u");
+ this.title_entry.set_text (title);
this.enabled_check.toggled += this.on_enabled_check_toggled;
}
@@ -51,9 +54,10 @@ public class Rygel.PluginPrefSection : PreferencesSection {
this.config.set_bool (this.name,
Configuration.ENABLED_KEY,
this.enabled_check.active);
- this.config.set_string (this.name,
- Configuration.TITLE_KEY,
- this.title_entry.get_text ());
+
+ var title = this.title_entry.get_text ().replace ("%n", "@REALNAME@");
+ title = title.replace ("%u", "@USERNAME@");
+ this.config.set_string (this.name, Configuration.TITLE_KEY, title);
}
private void on_enabled_check_toggled (CheckButton enabled_check) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]