diff options
author | Conor Curran <conor.curran@canonical.com> | 2010-07-07 17:50:02 +0100 |
---|---|---|
committer | Conor Curran <conor.curran@canonical.com> | 2010-07-07 17:50:02 +0100 |
commit | 3a06565090107aef0ab7bc22b9ab5c965a729746 (patch) | |
tree | 4688b2639eeef2b4cb424358da742e853a902952 /src/title-menu-item.vala | |
parent | 6eef19e54ead5184d2cb136d3e6fdacc6eef37bf (diff) | |
parent | b41d94677b3471742fa957cc4f60381d8f67ea5d (diff) | |
download | ayatana-indicator-sound-3a06565090107aef0ab7bc22b9ab5c965a729746.tar.gz ayatana-indicator-sound-3a06565090107aef0ab7bc22b9ab5c965a729746.tar.bz2 ayatana-indicator-sound-3a06565090107aef0ab7bc22b9ab5c965a729746.zip |
merged the last of the libindicate work
Diffstat (limited to 'src/title-menu-item.vala')
-rw-r--r-- | src/title-menu-item.vala | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/src/title-menu-item.vala b/src/title-menu-item.vala new file mode 100644 index 0000000..0acd97f --- /dev/null +++ b/src/title-menu-item.vala @@ -0,0 +1,48 @@ +/* +Copyright 2010 Canonical Ltd. + +Authors: + Conor Curran <conor.curran@canonical.com> + +This program is free software: you can redistribute it and/or modify it +under the terms of the GNU General Public License version 3, as published +by the Free Software Foundation. + +This program is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranties of +MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR +PURPOSE. See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along +with this program. If not, see <http://www.gnu.org/licenses/>. +*/ + +using Dbusmenu; +using DbusmenuTitle; +using Gee; + +public class TitleMenuitem : PlayerItem +{ + public TitleMenuitem(PlayerController parent, string name) + { + Object(item_type: MENUITEM_TYPE, owner: parent); + this.property_set(MENUITEM_TEXT_NAME, name); + } + + public override void handle_event(string name, GLib.Value input_value, uint timestamp) + { + debug("handle_event with bool value %s", input_value.get_boolean().to_string()); + if(this.owner.current_state == PlayerController.OFFLINE) + { + this.owner.instantiate(); + } + } + + + public static HashSet<string> attributes_format() + { + HashSet<string> attrs = new HashSet<string>(); + attrs.add(MENUITEM_TEXT_NAME); + return attrs; + } +}
\ No newline at end of file |