diff options
author | Conor Curran <conor.curran@canonical.com> | 2011-01-27 17:56:08 -0600 |
---|---|---|
committer | Conor Curran <conor.curran@canonical.com> | 2011-01-27 17:56:08 -0600 |
commit | 6b2132fb4e700fe84a26adeac5126e8afbc507b3 (patch) | |
tree | 72dc5259b76b85ac8fee71c9ac05549c946bce89 /src/mute-menu-item.c | |
parent | 1529af0e1224f04616054095742b698d8814cec4 (diff) | |
parent | 378302145a86c96a664935e5a5f27721c560aed7 (diff) | |
download | ayatana-indicator-sound-6b2132fb4e700fe84a26adeac5126e8afbc507b3.tar.gz ayatana-indicator-sound-6b2132fb4e700fe84a26adeac5126e8afbc507b3.tar.bz2 ayatana-indicator-sound-6b2132fb4e700fe84a26adeac5126e8afbc507b3.zip |
merge the little fixes branch and prep for 057
Diffstat (limited to 'src/mute-menu-item.c')
-rw-r--r-- | src/mute-menu-item.c | 30 |
1 files changed, 22 insertions, 8 deletions
diff --git a/src/mute-menu-item.c b/src/mute-menu-item.c index 2f40177..f7f3824 100644 --- a/src/mute-menu-item.c +++ b/src/mute-menu-item.c @@ -43,7 +43,8 @@ static void mute_menu_item_set_global_mute_from_ui (gpointer user_data); G_DEFINE_TYPE (MuteMenuItem, mute_menu_item, G_TYPE_OBJECT); -static void mute_menu_item_class_init (MuteMenuItemClass *klass) +static void +mute_menu_item_class_init (MuteMenuItemClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); @@ -55,7 +56,8 @@ static void mute_menu_item_class_init (MuteMenuItemClass *klass) return; } -static void mute_menu_item_init (MuteMenuItem *self) +static void +mute_menu_item_init (MuteMenuItem *self) { g_debug("Building new Mute Menu Item"); MuteMenuItemPrivate* priv = MUTE_MENU_ITEM_GET_PRIVATE(self); @@ -68,7 +70,8 @@ static void mute_menu_item_init (MuteMenuItem *self) return; } -static void mute_menu_item_dispose (GObject *object) +static void +mute_menu_item_dispose (GObject *object) { G_OBJECT_CLASS (mute_menu_item_parent_class)->dispose (object); return; @@ -93,8 +96,8 @@ mute_menu_item_set_global_mute_from_ui (gpointer user_data) toggle_global_mute (new_value); } - -void mute_menu_item_update(MuteMenuItem* item, gboolean value_update) +void +mute_menu_item_update (MuteMenuItem* item, gboolean value_update) { MuteMenuItemPrivate* priv = MUTE_MENU_ITEM_GET_PRIVATE (item); @@ -106,7 +109,8 @@ void mute_menu_item_update(MuteMenuItem* item, gboolean value_update) value_update == FALSE ? _("Mute") : _("Unmute")); } -void mute_menu_item_enable(MuteMenuItem* item, gboolean active) +void +mute_menu_item_enable (MuteMenuItem* item, gboolean active) { MuteMenuItemPrivate* priv = MUTE_MENU_ITEM_GET_PRIVATE (item); @@ -115,13 +119,23 @@ void mute_menu_item_enable(MuteMenuItem* item, gboolean active) active); } -DbusmenuMenuitem* mute_menu_item_get_button (MuteMenuItem* item) +DbusmenuMenuitem* +mute_menu_item_get_button (MuteMenuItem* item) { MuteMenuItemPrivate* priv = MUTE_MENU_ITEM_GET_PRIVATE (item); return priv->button; } -MuteMenuItem* mute_menu_item_new (gboolean initial_update, gboolean enabled) +gboolean +mute_menu_item_is_muted (MuteMenuItem* item) +{ + MuteMenuItemPrivate* priv = MUTE_MENU_ITEM_GET_PRIVATE (item); + return dbusmenu_menuitem_property_get_bool (priv->button, + DBUSMENU_MUTE_MENUITEM_VALUE); +} + +MuteMenuItem* +mute_menu_item_new (gboolean initial_update, gboolean enabled) { MuteMenuItem *self = g_object_new (MUTE_MENU_ITEM_TYPE, NULL); mute_menu_item_update (self, initial_update); |