aboutsummaryrefslogtreecommitdiff
path: root/src/player-controller.vala
diff options
context:
space:
mode:
authorConor Curran <conor.curran@canonical.com>2010-06-10 16:04:06 +0100
committerConor Curran <conor.curran@canonical.com>2010-06-10 16:04:06 +0100
commit50497b6b375cb96b77ed1700f58b8b8991f4c1ae (patch)
treead92da3c8d047b515f4c8118096834061660d605 /src/player-controller.vala
parentc98d1cd6c1f1bc875eae17d77680c8ce5d6acb5f (diff)
downloadayatana-indicator-sound-50497b6b375cb96b77ed1700f58b8b8991f4c1ae.tar.gz
ayatana-indicator-sound-50497b6b375cb96b77ed1700f58b8b8991f4c1ae.tar.bz2
ayatana-indicator-sound-50497b6b375cb96b77ed1700f58b8b8991f4c1ae.zip
working on some signals
Diffstat (limited to 'src/player-controller.vala')
-rw-r--r--src/player-controller.vala31
1 files changed, 17 insertions, 14 deletions
diff --git a/src/player-controller.vala b/src/player-controller.vala
index 9cdf527..86f0e0f 100644
--- a/src/player-controller.vala
+++ b/src/player-controller.vala
@@ -11,14 +11,20 @@ public class PlayerController : GLib.Object
public PlayerController(Dbusmenu.Menuitem root, string client_name, bool active)
{
this.root_menu = root;
- this.name = format_client_name(client_name);
+ this.name = format_client_name(client_name.strip());
this.is_active = active;
this.custom_items = new ArrayList<Dbusmenu.Menuitem>();
- //Dbusmenu.Menuitem[];
self_construct();
}
- public void self_construct()
+ public void vanish()
+ {
+ foreach(Dbusmenu.Menuitem item in this.custom_items){
+ root_menu.child_delete(item);
+ }
+ }
+
+ private void self_construct()
{
Dbusmenu.Menuitem client_item = new Dbusmenu.Menuitem();
this.custom_items.add(client_item);
@@ -29,19 +35,16 @@ public class PlayerController : GLib.Object
root_menu.child_append(transport_item);
}
- public void vanish()
+ private static string format_client_name(string client_name)
{
- foreach(Dbusmenu.Menuitem item in this.custom_items){
- root_menu.child_delete(item);
+ string formatted = client_name;
+ //debug("PlayerController->format_client_name");
+ if(formatted.len() > 1){
+ formatted = client_name.up(1).concat(client_name.slice(1, client_name.len()));
+ debug("PlayerController->format_client_name - : %s", formatted);
}
+
+ return formatted;
}
- public static string format_client_name(string client_name)
- {
- debug("PlayerController->format_client_name");
- //string first_letter = client_name.slice(1);
- //debug("PlayerController->format_client_name - first_letter: %s", first_letter);
- return client_name;
- }
-
} \ No newline at end of file