diff options
author | Ted Gould <ted@canonical.com> | 2009-09-04 17:21:30 -0500 |
---|---|---|
committer | Ted Gould <ted@canonical.com> | 2009-09-04 17:21:30 -0500 |
commit | cecbadf9b10264eab61dc82ca259b07250b830fe (patch) | |
tree | 5afa89a56e408a11f14d5ee018195c2cdd4a2250 /src | |
parent | e16fd98511c81dceef2f063fe7a67f384713a8bc (diff) | |
download | ayatana-indicator-messages-cecbadf9b10264eab61dc82ca259b07250b830fe.tar.gz ayatana-indicator-messages-cecbadf9b10264eab61dc82ca259b07250b830fe.tar.bz2 ayatana-indicator-messages-cecbadf9b10264eab61dc82ca259b07250b830fe.zip |
Hiding the items that go over our bounds. That's how it is. Hard, hard, limits.
Diffstat (limited to 'src')
-rw-r--r-- | src/messages-service.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/messages-service.c b/src/messages-service.c index c59edc2..f7c879f 100644 --- a/src/messages-service.c +++ b/src/messages-service.c @@ -693,6 +693,18 @@ indicator_added (IndicateListener * listener, IndicateListenerServer * server, I sl_item->imList = g_list_insert_sorted(sl_item->imList, listItem, imList_sort); listItem->timechange_cb = g_signal_connect(G_OBJECT(menuitem), IM_MENU_ITEM_SIGNAL_TIME_CHANGED, G_CALLBACK(im_time_changed), sl_item); + /* Check the length of the list. If we've got more inidactors + than we allow. Well. Someone's gotta pay. Sorry. I didn't + want to do this, but you did it to yourself. */ + if (g_list_length(sl_item->imList) > MAX_NUMBER_OF_INDICATORS) { + GList * indicatoritem; + gint count; + for (indicatoritem = sl_item->imList, count = 0; indicatoritem != NULL; indicatoritem = g_list_next(indicatoritem), count++) { + imList_t * im = (imList_t *)indicatoritem->data; + im_menu_item_show(IM_MENU_ITEM(im->menuitem), count < MAX_NUMBER_OF_INDICATORS); + } + } + /* Placing the item into the shell. Look to see if we can find our server and slip in there. Otherwise we'll just append. */ |