diff options
author | Mark Doliner <markdoliner@pidgin.im> | 2005-06-06 01:40:46 +0000 |
---|---|---|
committer | Mark Doliner <markdoliner@pidgin.im> | 2005-06-06 01:40:46 +0000 |
commit | 2fb514c73e8ded9734764d46985d86af7a6be762 (patch) | |
tree | 9263144ecb5f1f07c1d1d2acf8262601a619d414 | |
parent | 3cb1985390576e9c7f994abe684a0e72eb018e9e (diff) | |
download | pidgin-2fb514c73e8ded9734764d46985d86af7a6be762.tar.gz |
[gaim-migrate @ 12796]
This commit includes the changes I made to oldstatus to make
urgent notification/taskbar flashing more sensible (auto- tab switching),
the changes to notify.c so that tab switching doesn't reset the counters,
and the changes and translations for gaim.desktop
-rw-r--r-- | ChangeLog | 2 | ||||
-rw-r--r-- | gaim.desktop | 66 | ||||
-rw-r--r-- | plugins/ChangeLog.API | 2 | ||||
-rw-r--r-- | plugins/notify.c | 21 | ||||
-rw-r--r-- | src/conversation.c | 30 | ||||
-rw-r--r-- | src/gtkconv.c | 25 |
6 files changed, 105 insertions, 41 deletions
@@ -1,6 +1,6 @@ Gaim: The Pimpin' Penguin IM Client that's good for the soul! -version 2.0.0 +version 2.0.0: New Features: * Insane rewrite of all code dealing with buddy and account status, away messages, away states, online/offline, etc. Huge thanks to Christian, diff --git a/gaim.desktop b/gaim.desktop index e1d0cdfb10..877d667adb 100644 --- a/gaim.desktop +++ b/gaim.desktop @@ -1,45 +1,55 @@ [Desktop Entry] Encoding=UTF-8 -Name=Gaim Internet Messenger -Name[da]=Gaim - internet beskeder -Name[de]=Gaim Internet Messenger -Name[fr]=Gaim Messagerie Instantanée -Name[hu]=Gaim IM -Name[it]=Gaim Internet Messenger -Name[ko]=게임 메신저 -Name[nl]=Gaim - Expresberichten -Name[pl]=Komunikator Internetowy Gaim -Name[pt]=Mensageiro Instantâneo Gaim -Name[sl]=Gaim - spletni sel -Name[sv]=Gaim Internet Messenger -GenericName=Internet Messenger -GenericName[da]=Internet beskeder -GenericName[fr]=Messagerie instantanée -GenericName[hu]=IM -GenericName[it]=Internet Messenger -GenericName[ko]=메신저 -GenericName[nl]=Expresberichten -GenericName[pl]=Komunikator Internetowy -GenericName[pt]=Mensageiro Instantâneo -GenericName[pt_BR]=Mensageiro da Internet Gaim -GenericName[sl]=Spletni sel +Categories=Application;Network; Comment=Send instant messages over multiple protocols -Comment[da]=Multiprotokolsklient til at sende og modtage beskeder +Comment[da]=Send beskeder over flere protokoller Comment[de]=Multi-Protokoll Instant Messenger Client Comment[es]=Cliente de mensajería instantánea multiprotocolo Comment[fr]=Client de messagerie instantanée multiprotocole Comment[hu]=Többprotokollos üzenőkliens Comment[it]=Client multiprotocollo per messaggi immediati Comment[ko]=다중 프로토콜 메신저 +Comment[nb]=Send lynmeldinger over flere protokoller Comment[nl]=Multi-protocol programma voor expresberichten Comment[pl]=Komunikator internetowy obsługujący kilka protokołów -Comment[pt]=Cliente de mensagens instantâneas multi-protocolo Comment[pt_BR]=Cliente multi-protocolo de mensagens +Comment[pt]=Envie mensagens instantâneas sobre vários protocolos Comment[sl]=Večprotokolni odjemalec za neposredno sporočanje -Comment[sv]=Meddelandenklient för många protokoll +Comment[sq]=Dërgoni mesazhe të atypëratyshëm protokollesh të ndryshëm +Comment[sv]=Sänder snabbmeddelande över många protokoll +Comment[zh_CN]=通过多种协议发送即时消息 +GenericName=Internet Messenger +GenericName[da]=Internet beskeder +GenericName[fr]=Messagerie instantanée +GenericName[hu]=IM +GenericName[it]=Internet Messenger +GenericName[ko]=메신저 +GenericName[nb]=Lynmeldingsklient +GenericName[nl]=Expresberichten +GenericName[pl]=Komunikator Internetowy +GenericName[pt_BR]=Mensageiro da Internet Gaim +GenericName[pt]=Mensageiro Internet +GenericName[sl]=Spletni sel +GenericName[sq]=Lajmësjellës Internet +GenericName[sv]=Meddelandeklient +GenericName[zh_CN]=互联网通讯程序 +Name=Gaim Internet Messenger +Name[da]=Gaim - internet beskeder +Name[de]=Gaim Internet Messenger +Name[fr]=Gaim Messagerie Instantanée +Name[hu]=Gaim IM +Name[it]=Gaim Internet Messenger +Name[ko]=게임 메신저 +Name[nb]=Gaim lynmeldingsklient +Name[nl]=Gaim - Expresberichten +Name[pl]=Komunikator Internetowy Gaim +Name[pt]=Mensageiro Internet Gaim +Name[sl]=Gaim - spletni sel +Name[sq]=Lajmësjellësi Internet Gaim +Name[sv]=Gaim Internet Messenger +Name[zh_CN]=Gaim 互联网通讯程序 Exec=gaim Icon=gaim.png +StartupNotify=true Terminal=false Type=Application -Categories=Application;Network; -StartupNotify=true diff --git a/plugins/ChangeLog.API b/plugins/ChangeLog.API index 61af16e0c0..7198be6f72 100644 --- a/plugins/ChangeLog.API +++ b/plugins/ChangeLog.API @@ -1,6 +1,6 @@ Gaim: The Pimpin' Penguin IM Client that's good for the soul! -version 2.0.0cvs: +version 2.0.0: * Changed: All the status stuff. Yay! * Changed: gaim_prefs_connect_callback(), added handle parameter * Added: gaim_prefs_disconnect_by_handle() diff --git a/plugins/notify.c b/plugins/notify.c index 28cca08080..bbcadc57f9 100644 --- a/plugins/notify.c +++ b/plugins/notify.c @@ -179,8 +179,8 @@ notify(GaimConversation *conv, gboolean increment) "has-toplevel-focus", &has_focus, NULL); if (gaim_prefs_get_bool("/plugins/gtk/X11/notify/type_focused") || - (has_focus && gaim_conv_window_get_active_conversation(gaimwin) != conv) || - !has_focus) { + !has_focus || + gaim_conv_window_get_active_conversation(gaimwin) != conv) { if (increment) { count = GPOINTER_TO_INT(gaim_conversation_get_data(conv, "notify-message-count")); count++; @@ -196,6 +196,9 @@ notify(GaimConversation *conv, gboolean increment) static void notify_win(GaimConvWindow *gaimwin) { + if (count_messages(gaimwin) <= 0) + return; + if (gaim_prefs_get_bool("/plugins/gtk/X11/notify/method_count")) handle_count(gaimwin); if (gaim_prefs_get_bool("/plugins/gtk/X11/notify/method_string")) @@ -382,12 +385,20 @@ conv_created(GaimConversation *conv) attach_signals(conv); } -#if 0 static void conv_switched(GaimConversation *old_conv, GaimConversation *new_conv) { +#if 0 GaimConvWindow *gaimwin = gaim_conversation_get_window(new_conv); +#endif + + /* + * If the conversation was switched, then make sure we re-notify + * because Gaim will have overwritten our custom window title. + */ + notify(new_conv, FALSE); +#if 0 printf("conv_switched - %p - %p\n", old_conv, new_conv); printf("count - %d\n", count_messages(gaimwin)); if (gaim_prefs_get_bool("/plugins/gtk/X11/notify/notify_switch")) @@ -398,8 +409,8 @@ conv_switched(GaimConversation *old_conv, GaimConversation *new_conv) if (count_messages(gaimwin)) notify_win(gaimwin); } -} #endif +} static void deleting_conv(GaimConversation *conv) @@ -779,9 +790,9 @@ plugin_load(GaimPlugin *plugin) GAIM_CALLBACK(conv_created), NULL); gaim_signal_connect(conv_handle, "deleting-conversation", plugin, GAIM_CALLBACK(deleting_conv), NULL); -#if 0 gaim_signal_connect(conv_handle, "conversation-switched", plugin, GAIM_CALLBACK(conv_switched), NULL); +#if 0 gaim_signal_connect(gtk_conv_handle, "conversation-drag-ended", plugin, GAIM_CALLBACK(conversation_drag_ended), NULL); #endif diff --git a/src/conversation.c b/src/conversation.c index dccdda8596..5bc9a9e223 100644 --- a/src/conversation.c +++ b/src/conversation.c @@ -533,8 +533,6 @@ gaim_conv_window_switch_conversation(GaimConvWindow *win, GaimConversation *conv if (ops != NULL && ops->switch_conversation != NULL) ops->switch_conversation(win, conv); - gaim_conversation_set_unseen(conv, GAIM_UNSEEN_NONE); - gaim_signal_emit(gaim_conversations_get_handle(), "conversation-switched", old_conv, conv); } @@ -1362,7 +1360,13 @@ gaim_conversation_write(GaimConversation *conv, const char *who, gaim_conv_im_set_typing_state(GAIM_CONV_IM(conv), GAIM_NOT_TYPING); } - if (gaim_conv_window_get_active_conversation(win) != conv) { + if (gaim_conv_window_has_focus(win) && + gaim_conv_window_get_active_conversation(win) == conv) + { + unseen = GAIM_UNSEEN_NONE; + } + else + { if ((flags & GAIM_MESSAGE_NICK) == GAIM_MESSAGE_NICK || gaim_conversation_get_unseen(conv) == GAIM_UNSEEN_NICK) unseen = GAIM_UNSEEN_NICK; @@ -1373,10 +1377,25 @@ gaim_conversation_write(GaimConversation *conv, const char *who, else unseen = GAIM_UNSEEN_TEXT; } - else - unseen = GAIM_UNSEEN_NONE; gaim_conversation_set_unseen(conv, unseen); + + /* + * If we received an IM, and the GaimConvWindow is not active, + * then make this conversation the active tab in this GaimConvWindow. + * + * We do this so that, when the user comes back to the conversation + * window, the first thing they'll see is the new message. This is + * especially important when the IM window is flashing in their + * taskbar--we want the title of the window to be set to the name + * of the person that IMed them most recently. + */ + if ((gaim_conversation_get_type(conv) == GAIM_CONV_IM) && + (flags & (GAIM_MESSAGE_RECV | GAIM_MESSAGE_ERROR)) && + (!gaim_conv_window_has_focus(win))) + { + gaim_conv_window_switch_conversation(win, conv); + } } void @@ -1620,6 +1639,7 @@ gboolean gaim_conv_present_error(const char *who, GaimAccount *account, const ch /* * Change the active conversation to this conversation unless the * user is already using this window. + * TODO: There's a good chance this is no longer necessary */ if (!gaim_conv_window_has_focus(window)) gaim_conv_window_switch_conversation(window, conv); diff --git a/src/gtkconv.c b/src/gtkconv.c index d40f565aca..05edb1bdca 100644 --- a/src/gtkconv.c +++ b/src/gtkconv.c @@ -135,6 +135,22 @@ close_win_cb(GtkWidget *w, GdkEventAny *e, gpointer d) return TRUE; } +/* + * When a conversation window is focused, we know the user + * has looked at it so we know there are no longer unseen + * messages. + */ +static gint +focus_win_cb(GtkWidget *w, GdkEventFocus *e, gpointer d) +{ + GaimConvWindow *win = (GaimConvWindow *)d; + GaimConversation *conv = gaim_conv_window_get_active_conversation(win); + + gaim_conversation_set_unseen(conv, GAIM_UNSEEN_NONE); + + return FALSE; +} + static gint close_conv_cb(GtkWidget *w, GaimGtkConversation *gtkconv) { @@ -2863,7 +2879,11 @@ switch_conv_cb(GtkNotebook *notebook, GtkWidget *page, gint page_num, gtkwin = GAIM_GTK_WINDOW(win); - gaim_conversation_set_unseen(conv, GAIM_UNSEEN_NONE); + /* + * Only set "unseen" to "none" if the window has focus + */ + if (gaim_conv_window_has_focus(win)) + gaim_conversation_set_unseen(conv, GAIM_UNSEEN_NONE); /* Update the menubar */ gray_stuff_out(gtkconv); @@ -4191,6 +4211,9 @@ gaim_gtk_new_window(GaimConvWindow *win) g_signal_connect(G_OBJECT(gtkwin->window), "delete_event", G_CALLBACK(close_win_cb), win); + g_signal_connect(G_OBJECT(gtkwin->window), "focus_in_event", + G_CALLBACK(focus_win_cb), win); + /* Create the notebook. */ gtkwin->notebook = gtk_notebook_new(); |