From: <sa...@us...> - 2006-08-16 14:19:07
|
Revision: 16789 Author: sadrul Date: 2006-08-16 07:18:58 -0700 (Wed, 16 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16789&view=rev Log Message: ----------- Update gntgf to work for nick-said messages in chats. Modified Paths: -------------- trunk/console/plugins/gntgf.c Modified: trunk/console/plugins/gntgf.c =================================================================== --- trunk/console/plugins/gntgf.c 2006-08-16 11:13:19 UTC (rev 16788) +++ trunk/console/plugins/gntgf.c 2006-08-16 14:18:58 UTC (rev 16789) @@ -34,6 +34,7 @@ #include <version.h> #include <blist.h> #include <conversation.h> +#include <util.h> #include <gnt.h> #include <gntbox.h> @@ -144,7 +145,18 @@ received_chat_msg(GaimAccount *account, const char *sender, const char *msg, GaimConversation *conv, GaimMessageFlags flags, gpointer null) { - if (gaim_prefs_get_bool(PREFS_EVENT_CHAT_NICK) && (flags & GAIM_MESSAGE_NICK)) + const char *nick; + + if (flags & GAIM_MESSAGE_WHISPER) + return; + + nick = GAIM_CONV_CHAT(conv)->nick; + + if (g_utf8_collate(sender, nick) == 0) + return; + + if (gaim_prefs_get_bool(PREFS_EVENT_CHAT_NICK) && + (gaim_utf8_has_word(msg, nick))) notify(_("%s said your nick in %s"), sender, gaim_conversation_get_name(conv)); else if (gaim_prefs_get_bool(PREFS_EVENT_CHAT_MSG)) notify(_("%s sent a message in %s"), sender, gaim_conversation_get_name(conv)); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2006-08-17 01:58:24
|
Revision: 16802 Author: sadrul Date: 2006-08-16 18:58:20 -0700 (Wed, 16 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16802&view=rev Log Message: ----------- Add an option to beep on events. Modified Paths: -------------- trunk/console/plugins/gntgf.c Modified: trunk/console/plugins/gntgf.c =================================================================== --- trunk/console/plugins/gntgf.c 2006-08-17 01:06:27 UTC (rev 16801) +++ trunk/console/plugins/gntgf.c 2006-08-17 01:58:20 UTC (rev 16802) @@ -22,11 +22,13 @@ #define PLUGIN_STATIC_NAME "GntGf" -#define PREFS_EVENT "/plugins/gnt/gntgf/events" +#define PREFS_PREFIX "/plugins/gnt/gntgf" +#define PREFS_EVENT PREFS_PREFIX "/events" #define PREFS_EVENT_SIGNONF PREFS_EVENT "/signonf" #define PREFS_EVENT_IM_MSG PREFS_EVENT "/immsg" #define PREFS_EVENT_CHAT_MSG PREFS_EVENT "/chatmsg" #define PREFS_EVENT_CHAT_NICK PREFS_EVENT "/chatnick" +#define PREFS_BEEP PREFS_PREFIX "/beep" #include <glib.h> @@ -39,6 +41,7 @@ #include <gnt.h> #include <gntbox.h> #include <gntbutton.h> +#include <gntcheckbox.h> #include <gntlabel.h> #include <gnttree.h> @@ -96,6 +99,9 @@ int h, w; va_list args; + if (gaim_prefs_get_bool(PREFS_BEEP)) + beep(); + toast->window = window = gnt_vbox_new(FALSE); GNT_WIDGET_SET_FLAGS(window, GNT_WIDGET_TRANSIENT); GNT_WIDGET_UNSET_FLAGS(window, GNT_WIDGET_NO_BORDER); @@ -197,7 +203,7 @@ } prefs[] = { {PREFS_EVENT_SIGNONF, _("Buddy signs on/off")}, - {PREFS_EVENT_IM_MSG, _("You receive an IMs")}, + {PREFS_EVENT_IM_MSG, _("You receive an IM")}, {PREFS_EVENT_CHAT_MSG, _("Someone speaks in a chat")}, {PREFS_EVENT_CHAT_NICK, _("Someone says your name in a chat")}, {NULL, NULL} @@ -209,10 +215,16 @@ gaim_prefs_set_bool(key, gnt_tree_get_choice(tree, key)); } +static void +beep_toggled(GntCheckBox *check, gpointer null) +{ + gaim_prefs_set_bool(PREFS_BEEP, gnt_check_box_get_checked(check)); +} + static GntWidget * config_frame() { - GntWidget *window, *tree; + GntWidget *window, *tree, *check; int i; window = gnt_vbox_new(FALSE); @@ -236,6 +248,11 @@ gnt_tree_set_col_width(GNT_TREE(tree), 0, 40); g_signal_connect(G_OBJECT(tree), "toggled", G_CALLBACK(pref_toggled), NULL); + check = gnt_check_box_new(_("Beep too!")); + gnt_check_box_set_checked(GNT_CHECK_BOX(check), gaim_prefs_get_bool(PREFS_BEEP)); + g_signal_connect(G_OBJECT(check), "toggled", G_CALLBACK(beep_toggled), NULL); + gnt_box_add_widget(GNT_BOX(window), check); + return window; } @@ -278,6 +295,8 @@ gaim_prefs_add_bool(PREFS_EVENT_IM_MSG, TRUE); gaim_prefs_add_bool(PREFS_EVENT_CHAT_MSG, TRUE); gaim_prefs_add_bool(PREFS_EVENT_CHAT_NICK, TRUE); + + gaim_prefs_add_bool(PREFS_BEEP, TRUE); } GAIM_INIT_PLUGIN(PLUGIN_STATIC_NAME, init_plugin, info) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2006-08-23 04:22:10
|
Revision: 16993 Author: sadrul Date: 2006-08-22 21:22:04 -0700 (Tue, 22 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16993&view=rev Log Message: ----------- Patch from wabz (Richard Nelson): Do not crash when there are too many popups. Move the new ones to a different column instead. Modified Paths: -------------- trunk/console/plugins/gntgf.c Modified: trunk/console/plugins/gntgf.c =================================================================== --- trunk/console/plugins/gntgf.c 2006-08-23 03:00:10 UTC (rev 16992) +++ trunk/console/plugins/gntgf.c 2006-08-23 04:22:04 UTC (rev 16993) @@ -31,12 +31,15 @@ #define PREFS_EVENT_CHAT_NICK PREFS_EVENT "/chatnick" #define PREFS_BEEP PREFS_PREFIX "/beep" +#define MAX_COLS 3 + #include <glib.h> #include <plugin.h> #include <version.h> #include <blist.h> #include <conversation.h> +#include <debug.h> #include <util.h> #include <gnt.h> @@ -52,10 +55,12 @@ { GntWidget *window; int timer; + int column; } GntToast; static GList *toasters; -static int gpsy; +static int gpsy[MAX_COLS]; +static int gpsw[MAX_COLS]; static void destroy_toaster(GntToast *toast) @@ -71,21 +76,30 @@ { GList *iter; int h; + int col; + int nwin[MAX_COLS]; gnt_widget_get_size(toast->window, NULL, &h); - gpsy -= h; + gpsy[toast->column] -= h; + col = toast->column; + memset(&nwin, 0, sizeof(nwin)); destroy_toaster(toast); for (iter = toasters; iter; iter = iter->next) { int x, y; toast = iter->data; + nwin[toast->column]++; + if (toast->column != col) continue; gnt_widget_get_position(toast->window, &x, &y); y += h; gnt_screen_move_widget(toast->window, x, y); } + if (nwin[col] == 0) + gpsw[col] = 0; + return FALSE; } @@ -93,15 +107,15 @@ notify(const char *fmt, ...) { GntWidget *window; - GntToast *toast = g_new0(GntToast, 1); + GntToast *toast; char *str; - int h, w; + int h, w, i; va_list args; if (gaim_prefs_get_bool(PREFS_BEEP)) beep(); - toast->window = window = gnt_vbox_new(FALSE); + window = gnt_vbox_new(FALSE); GNT_WIDGET_SET_FLAGS(window, GNT_WIDGET_TRANSIENT); GNT_WIDGET_UNSET_FLAGS(window, GNT_WIDGET_NO_BORDER); @@ -115,9 +129,33 @@ g_free(str); gnt_widget_size_request(window); gnt_widget_get_size(window, &w, &h); - gpsy += h; - gnt_widget_set_position(window, getmaxx(stdscr) - w - 1, - getmaxy(stdscr) - gpsy - 1); + for (i = 0; i < MAX_COLS && gpsy[i] + h > getmaxy(stdscr) ; ++i) + ; + if (i >= MAX_COLS) { + gaim_debug_warning("GntGf", "Dude, that's way too many popups\n"); + gnt_widget_destroy(window); + return; + } + + toast = g_new0(GntToast, 1); + toast->window = window; + toast->column = i; + gpsy[i] += h; + if (w > gpsw[i]) { + if (i == 0) + gpsw[i] = w; + else + gpsw[i] = gpsw[i - 1] + w + 1; + } + + if (i == 0 || (w + gpsw[i - 1] >= getmaxx(stdscr))) { + /* if it's going to be too far left, overlap. */ + gnt_widget_set_position(window, getmaxx(stdscr) - w - 1, + getmaxy(stdscr) - gpsy[i] - 1); + } else { + gnt_widget_set_position(window, getmaxx(stdscr) - gpsw[i - 1] - w - 1, + getmaxy(stdscr) - gpsy[i] - 1); + } gnt_widget_draw(window); toast->timer = g_timeout_add(4000, (GSourceFunc)remove_toaster, toast); @@ -179,7 +217,8 @@ gaim_signal_connect(gaim_conversations_get_handle(), "received-chat-msg", plugin, GAIM_CALLBACK(received_chat_msg), NULL); - gpsy = 0; + memset(&gpsy, 0, sizeof(gpsy)); + memset(&gpsw, 0, sizeof(gpsw)); return TRUE; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2006-08-23 05:10:27
|
Revision: 16995 Author: sadrul Date: 2006-08-22 22:10:08 -0700 (Tue, 22 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16995&view=rev Log Message: ----------- Do it right Modified Paths: -------------- trunk/console/plugins/gntgf.c Modified: trunk/console/plugins/gntgf.c =================================================================== --- trunk/console/plugins/gntgf.c 2006-08-23 04:29:16 UTC (rev 16994) +++ trunk/console/plugins/gntgf.c 2006-08-23 05:10:08 UTC (rev 16995) @@ -129,7 +129,7 @@ g_free(str); gnt_widget_size_request(window); gnt_widget_get_size(window, &w, &h); - for (i = 0; i < MAX_COLS && gpsy[i] + h > getmaxy(stdscr) ; ++i) + for (i = 0; i < MAX_COLS && gpsy[i] + h >= getmaxy(stdscr) ; ++i) ; if (i >= MAX_COLS) { gaim_debug_warning("GntGf", "Dude, that's way too many popups\n"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2006-09-01 07:13:38
|
Revision: 17108 http://svn.sourceforge.net/gaim/?rev=17108&view=rev Author: sadrul Date: 2006-09-01 00:13:08 -0700 (Fri, 01 Sep 2006) Log Message: ----------- It's a better idea to not set urgent-hints by default, especially because it's borked. Modified Paths: -------------- trunk/console/plugins/gntgf.c Modified: trunk/console/plugins/gntgf.c =================================================================== --- trunk/console/plugins/gntgf.c 2006-09-01 07:09:40 UTC (rev 17107) +++ trunk/console/plugins/gntgf.c 2006-09-01 07:13:08 UTC (rev 17108) @@ -383,7 +383,7 @@ gaim_prefs_add_bool(PREFS_BEEP, TRUE); #ifdef HAVE_X11 - gaim_prefs_add_bool(PREFS_URGENT, TRUE); + gaim_prefs_add_bool(PREFS_URGENT, FALSE); #endif } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |