From f525c9fe26e3c1393d3c97b2d984f0829a121940 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 21 Jul 2011 16:31:18 -0500 Subject: Removing the menu item from the indicator --- src/indicator-messages.c | 48 ------------------------------------------------ 1 file changed, 48 deletions(-) (limited to 'src/indicator-messages.c') diff --git a/src/indicator-messages.c b/src/indicator-messages.c index fabf791..82a9315 100644 --- a/src/indicator-messages.c +++ b/src/indicator-messages.c @@ -75,14 +75,12 @@ INDICATOR_SET_TYPE(INDICATOR_MESSAGES_TYPE) /* Globals */ static GtkWidget * main_image = NULL; -static GtkWidget * clear_notifications = NULL; static GDBusProxy * icon_proxy = NULL; static GtkSizeGroup * indicator_right_group = NULL; static GDBusNodeInfo * bus_node_info = NULL; static GDBusInterfaceInfo * bus_interface_info = NULL; static const gchar * accessible_desc = NULL; static IndicatorObject * indicator = NULL; -static gboolean attention = FALSE; /* Prototypes */ static void indicator_messages_class_init (IndicatorMessagesClass *klass); @@ -122,33 +120,6 @@ update_a11y_desc (void) return; } -static void -clear_notifications_show(gboolean show) -{ - g_return_if_fail(clear_notifications); - - GtkWidget *separator = g_object_get_data(G_OBJECT(clear_notifications), "separator"); - g_return_if_fail(separator); - - if (show) { - gtk_widget_show(separator); - gtk_widget_show(clear_notifications); - } else { - gtk_widget_hide(separator); - gtk_widget_hide(clear_notifications); - } -} - -static void -clear_attention(void) { - g_return_if_fail(attention); - - indicator_image_helper_update(GTK_IMAGE(main_image), "indicator-messages"); - accessible_desc = _("Messages"); - clear_notifications_show(FALSE); - update_a11y_desc(); -} - /* Initialize the one-timers */ static void indicator_messages_class_init (IndicatorMessagesClass *klass) @@ -241,13 +212,10 @@ proxy_signal (GDBusProxy * proxy, const gchar * sender, const gchar * signal, GV if (prop) { indicator_image_helper_update(GTK_IMAGE(main_image), "indicator-messages-new"); accessible_desc = _("New Messages"); - attention = TRUE; } else { indicator_image_helper_update(GTK_IMAGE(main_image), "indicator-messages"); accessible_desc = _("Messages"); - attention = FALSE; } - clear_notifications_show(attention); } else if (g_strcmp0("IconChanged", signal) == 0) { if (prop) { gtk_widget_hide(main_image); @@ -281,15 +249,11 @@ attention_cb (GObject * object, GAsyncResult * ares, gpointer user_data) if (prop) { indicator_image_helper_update(GTK_IMAGE(main_image), "indicator-messages-new"); accessible_desc = _("New Messages"); - attention = TRUE; } else { indicator_image_helper_update(GTK_IMAGE(main_image), "indicator-messages"); accessible_desc = _("Messages"); - attention = FALSE; } - clear_notifications_show(attention); - update_a11y_desc(); return; @@ -786,18 +750,6 @@ get_menu (IndicatorObject * io) dbusmenu_client_add_type_handler(DBUSMENU_CLIENT(client), INDICATOR_MENUITEM_TYPE, new_indicator_item); dbusmenu_client_add_type_handler(DBUSMENU_CLIENT(client), APPLICATION_MENUITEM_TYPE, new_application_item); - GtkWidget *sep = gtk_separator_menu_item_new(); - gtk_widget_show(sep); - gtk_container_add (GTK_CONTAINER(menu), sep); - - clear_notifications = gtk_menu_item_new_with_label(_("Clear Notifications")); - gtk_widget_show(clear_notifications); - gtk_container_add(GTK_CONTAINER(menu), clear_notifications); - g_object_set_data(G_OBJECT(clear_notifications), "separator", sep); - g_signal_connect(clear_notifications, "activate", G_CALLBACK(clear_attention), NULL); - - clear_notifications_show(attention); - return GTK_MENU(menu); } -- cgit v1.2.3