aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Gould <ted@canonical.com>2009-09-09 11:36:48 -0500
committerTed Gould <ted@canonical.com>2009-09-09 11:36:48 -0500
commit0ff6a4d2393c1f56200bd5ca4e5f6f493cadec02 (patch)
tree86be3477c938018f949d0f81a09cbada3fc393cc
parent7623fd9959b213e529288f80f2708457d4e9fb67 (diff)
downloadayatana-indicator-messages-0ff6a4d2393c1f56200bd5ca4e5f6f493cadec02.tar.gz
ayatana-indicator-messages-0ff6a4d2393c1f56200bd5ca4e5f6f493cadec02.tar.bz2
ayatana-indicator-messages-0ff6a4d2393c1f56200bd5ca4e5f6f493cadec02.zip
Making the server separator and putting it in.
-rw-r--r--src/messages-service.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/messages-service.c b/src/messages-service.c
index f7b869e..29eaca3 100644
--- a/src/messages-service.c
+++ b/src/messages-service.c
@@ -26,6 +26,7 @@ with this program. If not, see <http://www.gnu.org/licenses/>.
#include <libindicate/listener.h>
#include <gio/gio.h>
+#include <libdbusmenu-glib/client.h>
#include <libdbusmenu-glib/server.h>
#include "im-menu-item.h"
@@ -71,6 +72,7 @@ typedef struct _serverList_t serverList_t;
struct _serverList_t {
IndicateListenerServer * server;
AppMenuItem * menuitem;
+ DbusmenuMenuitem * separator;
gboolean attention;
guint count;
GList * imList;
@@ -113,6 +115,7 @@ struct _imList_t {
IndicateListenerServer * server;
IndicateListenerIndicator * indicator;
DbusmenuMenuitem * menuitem;
+ DbusmenuMenuitem * separator;
gulong timechange_cb;
gulong attentionchange_cb;
};
@@ -477,6 +480,10 @@ server_added (IndicateListener * listener, IndicateListenerServer * server, gcha
sl_item->attention = FALSE;
sl_item->count = 0;
+ /* Build a separator */
+ sl_item->separator = dbusmenu_menuitem_new();
+ dbusmenu_menuitem_property_set(sl_item->separator, "type", DBUSMENU_CLIENT_TYPES_SEPARATOR);
+
/* Incase we got an indicator first */
GList * alreadythere = g_list_find_custom(serverList, sl_item, serverList_equal);
if (alreadythere != NULL) {
@@ -494,8 +501,11 @@ server_added (IndicateListener * listener, IndicateListenerServer * server, gcha
g_signal_connect(G_OBJECT(menuitem), APP_MENU_ITEM_SIGNAL_COUNT_CHANGED, G_CALLBACK(server_count_changed), sl_item);
g_signal_connect(G_OBJECT(menuitem), APP_MENU_ITEM_SIGNAL_NAME_CHANGED, G_CALLBACK(server_name_changed), menushell);
+ /* Put our new menu item in, with the separator behind it.
+ resort_menu will take care of whether it should be hidden
+ or not. */
dbusmenu_menuitem_child_append(menushell, DBUSMENU_MENUITEM(menuitem));
- /* Should be prepend ^ */
+ dbusmenu_menuitem_child_append(menushell, DBUSMENU_MENUITEM(sl_item->separator));
resort_menu(menushell);
check_hidden();