Mercurial > pidgin
changeset 15669:878b1f5f64a6
docklet update
author | Sean Egan <seanegan@gmail.com> |
---|---|
date | Wed, 21 Feb 2007 21:24:41 +0000 |
parents | 603488306e23 |
children | f272a6384b7b |
files | configure.ac libpurple/savedstatuses.c pidgin/gaimstock.c pidgin/gaimstock.h pidgin/gtkdocklet-x11.c pidgin/gtkdocklet.c pidgin/gtkdocklet.h pidgin/pixmaps/Makefile.am pidgin/pixmaps/tray/16/Makefile.am pidgin/pixmaps/tray/16/tray-away.ico pidgin/pixmaps/tray/16/tray-away.png pidgin/pixmaps/tray/16/tray-busy.ico pidgin/pixmaps/tray/16/tray-busy.png pidgin/pixmaps/tray/16/tray-extended-away.ico pidgin/pixmaps/tray/16/tray-extended-away.png pidgin/pixmaps/tray/16/tray-message.ico pidgin/pixmaps/tray/16/tray-message.png pidgin/pixmaps/tray/16/tray-offline.ico pidgin/pixmaps/tray/16/tray-offline.png pidgin/pixmaps/tray/16/tray-online.ico pidgin/pixmaps/tray/16/tray-online.png pidgin/pixmaps/tray/Makefile.am |
diffstat | 22 files changed, 84 insertions(+), 56 deletions(-) [+] |
line wrap: on
line diff
--- a/configure.ac Wed Feb 21 19:48:11 2007 +0000 +++ b/configure.ac Wed Feb 21 21:24:41 2007 +0000 @@ -1937,6 +1937,8 @@ pidgin/pixmaps/toolbar/Makefile pidgin/pixmaps/toolbar/16/Makefile pidgin/pixmaps/toolbar/16/scalable/Makefile + pidgin/pixmaps/tray/Makefile + pidgin/pixmaps/tray/16/Makefile pidgin/plugins/Makefile pidgin/plugins/cap/Makefile pidgin/plugins/gestures/Makefile
--- a/libpurple/savedstatuses.c Wed Feb 21 19:48:11 2007 +0000 +++ b/libpurple/savedstatuses.c Wed Feb 21 21:24:41 2007 +0000 @@ -1068,6 +1068,8 @@ saved_status->usage_count++; saved_statuses = g_list_remove(saved_statuses, saved_status); saved_statuses = g_list_insert_sorted(saved_statuses, saved_status, saved_statuses_sort_func); + gaim_prefs_set_int("/core/savedstatus/default", + gaim_savedstatus_get_creation_time(saved_status)); accounts = gaim_accounts_get_all_active(); for (node = accounts; node != NULL; node = node->next) @@ -1081,8 +1083,6 @@ g_list_free(accounts); - gaim_prefs_set_int("/core/savedstatus/default", - gaim_savedstatus_get_creation_time(saved_status)); gaim_savedstatus_set_idleaway(FALSE); gaim_signal_emit(gaim_savedstatuses_get_handle(), "savedstatus-changed",
--- a/pidgin/gaimstock.c Wed Feb 21 19:48:11 2007 +0000 +++ b/pidgin/gaimstock.c Wed Feb 21 21:24:41 2007 +0000 @@ -160,6 +160,14 @@ { PIDGIN_STOCK_TOOLBAR_PLUGINS, "toolbar", "plugins.png", TRUE, FALSE, FALSE, FALSE }, { PIDGIN_STOCK_TOOLBAR_TYPING, "toolbar", "typing.png", TRUE, FALSE, FALSE, FALSE }, { PIDGIN_STOCK_TOOLBAR_PENDING, "status", "message-pending.png", TRUE, FALSE, FALSE, FALSE }, + + { PIDGIN_STOCK_TRAY_AVAILABLE, "tray", "tray-online.png", TRUE, FALSE, FALSE, FALSE }, + { PIDGIN_STOCK_TRAY_AWAY, "tray", "tray-away.png", TRUE, FALSE, FALSE, FALSE }, + { PIDGIN_STOCK_TRAY_BUSY, "tray", "tray-busy.png", TRUE, FALSE, FALSE, FALSE }, + { PIDGIN_STOCK_TRAY_XA, "tray", "tray-extended-away.png", TRUE, FALSE, FALSE, FALSE }, + { PIDGIN_STOCK_TRAY_OFFLINE, "tray", "tray-offline.png", TRUE, FALSE, FALSE, FALSE }, + { PIDGIN_STOCK_TRAY_CONNECT, "tray", "tray-online.png", TRUE, FALSE, FALSE, FALSE }, + { PIDGIN_STOCK_TRAY_PENDING, "tray", "tray-message.png", TRUE, FALSE, FALSE, FALSE } }; static gchar *
--- a/pidgin/gaimstock.h Wed Feb 21 19:48:11 2007 +0000 +++ b/pidgin/gaimstock.h Wed Feb 21 21:24:41 2007 +0000 @@ -119,6 +119,17 @@ #define PIDGIN_STOCK_TOOLBAR_TYPING "pidgin-typing" #define PIDGIN_STOCK_TOOLBAR_USER_INFO "pidgin-info" #define PIDGIN_STOCK_TOOLBAR_PENDING "pidgin-pending" + +/* Tray icons */ +#define PIDGIN_STOCK_TRAY_AVAILABLE "pidgin-tray-available" +#define PIDGIN_STOCK_TRAY_AWAY "pidgin-tray-away" +#define PIDGIN_STOCK_TRAY_BUSY "pidgin-tray-busy" +#define PIDGIN_STOCK_TRAY_XA "pidgin-tray-xa" +#define PIDGIN_STOCK_TRAY_OFFLINE "pidgin-tray-offline" +#define PIDGIN_STOCK_TRAY_CONNECT "pidgin-tray-connect" +#define PIDGIN_STOCK_TRAY_PENDING "pidgin-tray-pending" + + /*@}*/ /**
--- a/pidgin/gtkdocklet-x11.c Wed Feb 21 19:48:11 2007 +0000 +++ b/pidgin/gtkdocklet-x11.c Wed Feb 21 21:24:41 2007 +0000 @@ -93,27 +93,30 @@ switch (icon) { case DOCKLET_STATUS_OFFLINE: - icon_name = PIDGIN_STOCK_ICON_OFFLINE; + icon_name = PIDGIN_STOCK_TRAY_OFFLINE; break; case DOCKLET_STATUS_CONNECTING: - icon_name = PIDGIN_STOCK_ICON_CONNECT; + icon_name = PIDGIN_STOCK_TRAY_CONNECT; break; - case DOCKLET_STATUS_ONLINE: - icon_name = PIDGIN_STOCK_ICON_ONLINE; + case DOCKLET_STATUS_AVAILABLE: + icon_name = PIDGIN_STOCK_TRAY_AVAILABLE; break; - case DOCKLET_STATUS_ONLINE_PENDING: - icon_name = PIDGIN_STOCK_ICON_ONLINE_MSG; + case DOCKLET_STATUS_PENDING: + icon_name = PIDGIN_STOCK_TRAY_PENDING; break; case DOCKLET_STATUS_AWAY: - icon_name = PIDGIN_STOCK_ICON_AWAY; + icon_name = PIDGIN_STOCK_TRAY_AWAY; break; - case DOCKLET_STATUS_AWAY_PENDING: - icon_name = PIDGIN_STOCK_ICON_AWAY_MSG; + case DOCKLET_STATUS_BUSY: + icon_name = PIDGIN_STOCK_TRAY_BUSY; + break; + case DOCKLET_STATUS_XA: + icon_name = PIDGIN_STOCK_TRAY_XA; break; } if(icon_name) - gtk_image_set_from_stock(GTK_IMAGE(image), icon_name, GTK_ICON_SIZE_LARGE_TOOLBAR); + gtk_image_set_from_stock(GTK_IMAGE(image), icon_name, gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_EXTRA_SMALL)); #if 0 GdkPixbuf *p;
--- a/pidgin/gtkdocklet.c Wed Feb 21 19:48:11 2007 +0000 +++ b/pidgin/gtkdocklet.c Wed Feb 21 21:24:41 2007 +0000 @@ -67,8 +67,7 @@ blinked = !blinked; switch (status) { - case DOCKLET_STATUS_ONLINE_PENDING: - case DOCKLET_STATUS_AWAY_PENDING: + case DOCKLET_STATUS_PENDING: if (blinked) { if (ui_ops && ui_ops->blank_icon) ui_ops->blank_icon(); @@ -114,8 +113,10 @@ { GList *convs, *l; int count; + GaimSavedStatus *saved_status; + GaimStatusPrimitive prim; DockletStatus newstatus = DOCKLET_STATUS_OFFLINE; - gboolean pending = FALSE; + gboolean pending = FALSE, connecting = FALSE; /* determine if any ims have unseen messages */ convs = get_pending_list(DOCKLET_TOOLTIP_LINE_LIMIT); @@ -170,19 +171,7 @@ ui_ops->set_tooltip(NULL); } - /* iterate through all accounts and determine which - * status to show in the tray icon based on the following - * ranks (highest encountered rank will be used): - * - * 1) OFFLINE - * 2) ONLINE - * 3) ONLINE_PENDING - * 4) AWAY - * 5) AWAY_PENDING - * 6) CONNECTING - */ for(l = gaim_accounts_get_all(); l != NULL; l = l->next) { - DockletStatus tmpstatus = DOCKLET_STATUS_OFFLINE; GaimAccount *account = (GaimAccount*)l->data; GaimStatus *account_status; @@ -194,28 +183,26 @@ continue; account_status = gaim_account_get_active_status(account); - - if (gaim_account_is_connecting(account)) { - tmpstatus = DOCKLET_STATUS_CONNECTING; - } else if (gaim_status_is_online(account_status)) { - if (!gaim_status_is_available(account_status)) { - if (pending) - tmpstatus = DOCKLET_STATUS_AWAY_PENDING; - else - tmpstatus = DOCKLET_STATUS_AWAY; - } - else { - if (pending) - tmpstatus = DOCKLET_STATUS_ONLINE_PENDING; - else - tmpstatus = DOCKLET_STATUS_ONLINE; - } - } - - if (tmpstatus > newstatus) - newstatus = tmpstatus; + if (gaim_account_is_connecting(account)) + connecting = TRUE; } - + + saved_status = gaim_savedstatus_get_current(); + prim = gaim_savedstatus_get_type(saved_status); + + if (connecting) + newstatus = DOCKLET_STATUS_CONNECTING; + else if (prim == GAIM_STATUS_UNAVAILABLE) + newstatus = DOCKLET_STATUS_BUSY; + else if (prim == GAIM_STATUS_AWAY) + newstatus = DOCKLET_STATUS_AWAY; + else if (prim == GAIM_STATUS_EXTENDED_AWAY) + newstatus = DOCKLET_STATUS_XA; + else if (prim == GAIM_STATUS_OFFLINE) + newstatus = DOCKLET_STATUS_OFFLINE; + else + newstatus = DOCKLET_STATUS_AVAILABLE; + /* update the icon if we changed status */ if (status != newstatus) { status = newstatus; @@ -225,8 +212,7 @@ /* and schedule the blinker function if messages are pending */ if (gaim_prefs_get_bool("/gaim/gtk/docklet/blink") && - (status == DOCKLET_STATUS_ONLINE_PENDING - || status == DOCKLET_STATUS_AWAY_PENDING) + status == DOCKLET_STATUS_PENDING && docklet_blinking_timer == 0) { docklet_blinking_timer = g_timeout_add(500, docklet_blink_icon, NULL); } @@ -512,7 +498,7 @@ menuitem = gtk_menu_item_new_with_label(_("Unread Messages")); - if (status == DOCKLET_STATUS_ONLINE_PENDING || status == DOCKLET_STATUS_AWAY_PENDING) { + if (status == DOCKLET_STATUS_PENDING) { GtkWidget *submenu = gtk_menu_new(); GList *l = get_pending_list(0); if (l == NULL) { @@ -584,7 +570,7 @@ { switch (button_type) { case 1: - if (status == DOCKLET_STATUS_ONLINE_PENDING || status == DOCKLET_STATUS_AWAY_PENDING) { + if (status == DOCKLET_STATUS_PENDING) { GList *l = get_pending_list(1); if (l != NULL) { gaim_conversation_present((GaimConversation *)l->data);
--- a/pidgin/gtkdocklet.h Wed Feb 21 19:48:11 2007 +0000 +++ b/pidgin/gtkdocklet.h Wed Feb 21 21:24:41 2007 +0000 @@ -28,10 +28,11 @@ typedef enum { DOCKLET_STATUS_OFFLINE, - DOCKLET_STATUS_ONLINE, - DOCKLET_STATUS_ONLINE_PENDING, + DOCKLET_STATUS_AVAILABLE, + DOCKLET_STATUS_PENDING, DOCKLET_STATUS_AWAY, - DOCKLET_STATUS_AWAY_PENDING, + DOCKLET_STATUS_BUSY, + DOCKLET_STATUS_XA, DOCKLET_STATUS_CONNECTING } DockletStatus;
--- a/pidgin/pixmaps/Makefile.am Wed Feb 21 19:48:11 2007 +0000 +++ b/pidgin/pixmaps/Makefile.am Wed Feb 21 21:24:41 2007 +0000 @@ -1,4 +1,4 @@ -SUBDIRS = animations buddy_icons dialogs emblems emotes protocols status toolbar +SUBDIRS = animations buddy_icons dialogs emblems emotes protocols status toolbar tray EXTRA_DIST = \ about_menu.png \
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/pidgin/pixmaps/tray/16/Makefile.am Wed Feb 21 21:24:41 2007 +0000 @@ -0,0 +1,16 @@ +TRAY_ICONS = tray-away.png \ + tray-busy.png \ + tray-extended-away.png \ + tray-message.png \ + tray-offline.png \ + tray-online.png + +EXTRA_DIST = tray-away.ico \ + tray-busy.ico \ + tray-extended-away.ico \ + tray-message.ico \ + tray-offline.ico \ + tray-online.ico + +pidgintraypixdir = $(datadir)/pixmaps/pidgin/tray/16 +pidgintraypix_DATA = $(TRAY_ICONS)