aboutsummaryrefslogtreecommitdiff
path: root/src/launcher-menu-item.c
diff options
context:
space:
mode:
authorTed Gould <ted@canonical.com>2009-08-19 21:59:43 -0500
committerTed Gould <ted@canonical.com>2009-08-19 21:59:43 -0500
commit99744b30f0ebf4c7054b8274c30af063ec52b248 (patch)
tree4be67f3473c44d76d1044f5631c30b24081d8ac2 /src/launcher-menu-item.c
parentde5f8b0273d835a96eccdcb2ecb744e41ec082db (diff)
downloadayatana-indicator-messages-99744b30f0ebf4c7054b8274c30af063ec52b248.tar.gz
ayatana-indicator-messages-99744b30f0ebf4c7054b8274c30af063ec52b248.tar.bz2
ayatana-indicator-messages-99744b30f0ebf4c7054b8274c30af063ec52b248.zip
Adding an eclipsed function for the LMI
Diffstat (limited to 'src/launcher-menu-item.c')
-rw-r--r--src/launcher-menu-item.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/launcher-menu-item.c b/src/launcher-menu-item.c
index 7970288..b869a40 100644
--- a/src/launcher-menu-item.c
+++ b/src/launcher-menu-item.c
@@ -48,7 +48,7 @@ static void launcher_menu_item_class_init (LauncherMenuItemClass *klass);
static void launcher_menu_item_init (LauncherMenuItem *self);
static void launcher_menu_item_dispose (GObject *object);
static void launcher_menu_item_finalize (GObject *object);
-void activate_cb (LauncherMenuItem * self, gpointer data);
+static void activate_cb (LauncherMenuItem * self, gpointer data);
G_DEFINE_TYPE (LauncherMenuItem, launcher_menu_item, DBUSMENU_TYPE_MENUITEM);
@@ -139,7 +139,9 @@ launcher_menu_item_get_name (LauncherMenuItem * appitem)
}
}
-void
+/* When the menu item is clicked on it tries to launch
+ the application that is represented by the desktop file */
+static void
activate_cb (LauncherMenuItem * self, gpointer data)
{
LauncherMenuItemPrivate * priv = LAUNCHER_MENU_ITEM_GET_PRIVATE(self);
@@ -153,3 +155,13 @@ activate_cb (LauncherMenuItem * self, gpointer data)
return;
}
+
+/* Hides the menu item based on whether it is eclipsed
+ or not. */
+void
+launcher_menu_item_set_eclipsed (LauncherMenuItem * li, gboolean eclipsed)
+{
+ g_debug("Laucher '%s' is %s", launcher_menu_item_get_name(li), eclipsed ? "now eclipsed" : "shown again");
+ dbusmenu_menuitem_property_set(DBUSMENU_MENUITEM(li), "show", eclipsed ? "false" : "true");
+ return;
+}