annotate plugins/notify.c @ 9953:d908907d9441

[gaim-migrate @ 10849] grim | patch -p0 && cvs commit committer: Tailor Script <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Sun, 05 Sep 2004 06:29:51 +0000
parents f8e395a054e2
children 60db14d54914
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
6302
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
1 /*
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
2 * Gaim buddy notification plugin.
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
3 *
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
4 * Copyright (C) 2000-2001, Eric Warmenhoven (original code)
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
5 * Copyright (C) 2002, Etan Reisner <deryni@eden.rutgers.edu> (rewritten code)
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
6 * Copyright (C) 2003, Christian Hammond (update for changed API)
6322
dd2be7cd66df [gaim-migrate @ 6821]
Mark Doliner <mark@kingant.net>
parents: 6302
diff changeset
7 * Copyright (C) 2003, Brian Tarricone <bjt23@cornell.edu> (mostly rewritten)
6302
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
8 * Copyright (C) 2003, Mark Doliner (minor cleanup)
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
9 * Copyright (C) 2003, Etan Reisner (largely rewritten again)
6302
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
10 *
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
11 * This program is free software; you can redistribute it and/or modify
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
12 * it under the terms of the GNU General Public License as published by
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
13 * the Free Software Foundation; either version 2 of the License, or
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
14 * (at your option) any later version.
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
15 *
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
16 * This program is distributed in the hope that it will be useful,
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
19 * GNU General Public License for more details.
3374
3cd2fbddf95a [gaim-migrate @ 3393]
Sean Egan <seanegan@gmail.com>
parents: 2313
diff changeset
20 *
6302
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
21 * You should have received a copy of the GNU General Public License
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
22 * along with this program; if not, write to the Free Software
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
24 *
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
25 */
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
26
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
27 /*
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
28 * From Etan, 2002:
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
29 * -Added config dialog
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
30 * -Added control over notification method
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
31 * -Added control over when to release notification
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
32 *
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
33 * -Added option to get notification for chats also
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
34 * -Cleaned up code
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
35 * -Added option to notify on click as it's own option
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
36 * rather then as what happens when on focus isn't clicked
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
37 * -Added apply button to change the denotification methods for
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
38 * open conversation windows
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
39 * -Fixed apply to conversations, count now keeps count across applies
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6464
diff changeset
40 * -Fixed(?) memory leak, and in the process fixed some stupidities
6302
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
41 * -Hit enter when done editing the title string entry box to save it
3392
5a5df7968b6e [gaim-migrate @ 3411]
Sean Egan <seanegan@gmail.com>
parents: 3385
diff changeset
42 *
5a5df7968b6e [gaim-migrate @ 3411]
Sean Egan <seanegan@gmail.com>
parents: 3385
diff changeset
43 * Thanks to Carles Pina i Estany <carles@pinux.info>
5a5df7968b6e [gaim-migrate @ 3411]
Sean Egan <seanegan@gmail.com>
parents: 3385
diff changeset
44 * for count of new messages option
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6464
diff changeset
45 *
6302
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
46 * From Brian, 20 July 2003:
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
47 * -Use new xml prefs
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
48 * -Better handling of notification states tracking
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
49 * -Better pref change handling
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
50 * -Fixed a possible memleak and possible crash (rare)
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
51 * -Use gtk_window_get_title() rather than gtkwin->title
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
52 * -Other random fixes and cleanups
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
53 *
9298
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
54 * Etan again, 12 August 2003:
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
55 * -Better use of the new xml prefs
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
56 * -Removed all bitmask stuff
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
57 * -Even better pref change handling
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
58 * -Removed unnecessary functions
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
59 * -Reworking of notification/unnotification stuff
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
60 * -Header file include cleanup
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
61 * -General code cleanup
9298
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
62 *
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
63 * Etan yet again, 04 April 2004:
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
64 * -Re-added Urgent option
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
65 * -Re-added unnotify on focus option (still needs work, as it will only
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
66 * react to focus-in events when the entry or history widgets are focused)
3392
5a5df7968b6e [gaim-migrate @ 3411]
Sean Egan <seanegan@gmail.com>
parents: 3385
diff changeset
67 */
5a5df7968b6e [gaim-migrate @ 3411]
Sean Egan <seanegan@gmail.com>
parents: 3385
diff changeset
68
9791
4a15962c344a [gaim-migrate @ 10659]
Mark Doliner <mark@kingant.net>
parents: 9303
diff changeset
69 #include "internal.h"
4a15962c344a [gaim-migrate @ 10659]
Mark Doliner <mark@kingant.net>
parents: 9303
diff changeset
70 #include "gtkgaim.h"
6302
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
71
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
72 #include "debug.h"
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
73 #include "prefs.h"
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6464
diff changeset
74 #include "signals.h"
9943
f8e395a054e2 [gaim-migrate @ 10835]
Nathan Walp <nwalp@pidgin.im>
parents: 9791
diff changeset
75 #include "version.h"
4202
59751fe608c5 [gaim-migrate @ 4438]
Christian Hammond <chipx86@chipx86.com>
parents: 4165
diff changeset
76
6302
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
77 #include "gtkplugin.h"
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
78 #include "gtkutils.h"
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
79
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
80 #include <X11/Xatom.h>
3385
7931eb8bba19 [gaim-migrate @ 3404]
Sean Egan <seanegan@gmail.com>
parents: 3374
diff changeset
81 #include <X11/Xlib.h>
3374
3cd2fbddf95a [gaim-migrate @ 3393]
Sean Egan <seanegan@gmail.com>
parents: 2313
diff changeset
82 #include <X11/Xutil.h>
3cd2fbddf95a [gaim-migrate @ 3393]
Sean Egan <seanegan@gmail.com>
parents: 2313
diff changeset
83
6302
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
84 #define NOTIFY_PLUGIN_ID "gtk-x11-notify"
3710
03ba413ca20b [gaim-migrate @ 3843]
Luke Schierer <lschiere@pidgin.im>
parents: 3565
diff changeset
85
5436
ad445074d239 [gaim-migrate @ 5818]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
86 static GaimPlugin *my_plugin = NULL;
ad445074d239 [gaim-migrate @ 5818]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
87
6302
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
88 /* notification set/unset */
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
89 static int notify(GaimConversation *conv, gboolean increment);
9298
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
90 static void notify_win(GaimConvWindow *gaimwin);
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
91 static void unnotify(GaimConversation *conv, gboolean reset);
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
92 static int unnotify_cb(GtkWidget *widget, gpointer data, GaimConversation *conv);
6302
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
93
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
94 /* gtk widget callbacks for prefs panel */
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
95 static void type_toggle_cb(GtkWidget *widget, gpointer data);
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
96 static void method_toggle_cb(GtkWidget *widget, gpointer data);
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
97 static void notify_toggle_cb(GtkWidget *widget, gpointer data);
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
98 static gboolean options_entry_cb(GtkWidget *widget, GdkEventFocus *event, gpointer data);
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
99 static void apply_method();
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
100 static void apply_notify();
191
948100a8cb23 [gaim-migrate @ 201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
101
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
102 /* string function */
9298
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
103 static void handle_string(GaimConvWindow *window);
6302
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
104
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
105 /* count function */
9298
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
106 static void handle_count(GaimConvWindow *window);
6302
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
107
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
108 /* urgent function */
9298
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
109 static void handle_urgent(GaimConvWindow *window, gboolean add);
3710
03ba413ca20b [gaim-migrate @ 3843]
Luke Schierer <lschiere@pidgin.im>
parents: 3565
diff changeset
110
6302
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
111 /****************************************/
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
112 /* Begin doing stuff below this line... */
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
113 /****************************************/
9298
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
114 static int
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
115 count_messages(GaimConvWindow *gaimwin)
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
116 {
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
117 gint count = 0;
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
118 GList *convs = NULL;
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
119
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
120 for (convs = gaim_conv_window_get_conversations(gaimwin);
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
121 convs != NULL; convs = convs->next) {
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
122 GaimConversation *conv = convs->data;
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
123 count += GPOINTER_TO_INT(gaim_conversation_get_data(conv, "notify-message-count"));
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
124 }
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
125
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
126 return count;
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
127 }
6302
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
128
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
129 static int
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
130 notify(GaimConversation *conv, gboolean increment)
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
131 {
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 6982
diff changeset
132 GaimConvWindow *gaimwin = NULL;
6302
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
133 gint count;
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
134 gboolean has_focus;
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4218
diff changeset
135
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
136 if (conv == NULL)
6302
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
137 return 0;
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
138
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
139 /* We want to remove the notifications, but not reset the counter */
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
140 unnotify(conv, FALSE);
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
141
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
142 gaimwin = gaim_conversation_get_window(conv);
5021
00b6af528964 [gaim-migrate @ 5357]
Luke Schierer <lschiere@pidgin.im>
parents: 4793
diff changeset
143
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
144 /* If we aren't doing notifications for this type of conversation, return */
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
145 if (((gaim_conversation_get_type(conv) == GAIM_CONV_IM) &&
9298
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
146 !gaim_prefs_get_bool("/plugins/gtk/X11/notify/type_im")) ||
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
147 ((gaim_conversation_get_type(conv) == GAIM_CONV_CHAT) &&
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
148 !gaim_prefs_get_bool("/plugins/gtk/X11/notify/type_chat")))
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
149 return 0;
4203
ec6d0c5e5c23 [gaim-migrate @ 4439]
Christian Hammond <chipx86@chipx86.com>
parents: 4202
diff changeset
150
9298
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
151 g_object_get(G_OBJECT(GAIM_GTK_WINDOW(gaimwin)->window),
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
152 "has-toplevel-focus", &has_focus, NULL);
3374
3cd2fbddf95a [gaim-migrate @ 3393]
Sean Egan <seanegan@gmail.com>
parents: 2313
diff changeset
153
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
154 if (gaim_prefs_get_bool("/plugins/gtk/X11/notify/type_focused") ||
9298
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
155 (has_focus && gaim_conv_window_get_active_conversation(gaimwin) != conv) ||
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
156 !has_focus) {
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
157 if (increment) {
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
158 count = GPOINTER_TO_INT(gaim_conversation_get_data(conv, "notify-message-count"));
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
159 count++;
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
160 gaim_conversation_set_data(conv, "notify-message-count", GINT_TO_POINTER(count));
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
161 }
6302
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
162
9298
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
163 notify_win(gaimwin);
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
164 }
6302
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
165
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
166 return 0;
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
167 }
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
168
9298
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
169 static void
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
170 notify_win(GaimConvWindow *gaimwin)
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
171 {
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
172 if (gaim_prefs_get_bool("/plugins/gtk/X11/notify/method_count"))
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
173 handle_count(gaimwin);
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
174 if (gaim_prefs_get_bool("/plugins/gtk/X11/notify/method_string"))
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
175 handle_string(gaimwin);
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
176 if (gaim_prefs_get_bool("/plugins/gtk/X11/notify/method_urgent"))
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
177 handle_urgent(gaimwin, TRUE);
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
178 }
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
179
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
180 static void
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
181 unnotify(GaimConversation *conv, gboolean reset)
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
182 {
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
183 GaimConversation *active_conv = NULL;
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
184 GaimConvWindow *gaimwin = NULL;
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
185
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
186 g_return_if_fail(conv != NULL);
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
187
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
188 gaimwin = gaim_conversation_get_window(conv);
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
189 active_conv = gaim_conv_window_get_active_conversation(gaimwin);
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
190
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
191 /* reset the conversation window title */
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
192 gaim_conversation_autoset_title(active_conv);
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
193
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
194 if (reset) {
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
195 /* Only need to actually remove the urgent hinting here, since removing it
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
196 * just to have it readded in re-notify is an unnecessary couple extra RTs
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
197 * to the server */
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
198 handle_urgent(gaimwin, FALSE);
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
199 gaim_conversation_set_data(conv, "notify-message-count", GINT_TO_POINTER(0));
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
200 }
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
201
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
202 return;
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
203 }
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
204
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
205 static int
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
206 unnotify_cb(GtkWidget *widget, gpointer data, GaimConversation *conv)
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
207 {
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
208 if (GPOINTER_TO_INT(gaim_conversation_get_data(conv, "notify-message-count")) != 0)
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
209 unnotify(conv, TRUE);
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
210
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
211 return 0;
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
212 }
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
213
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6464
diff changeset
214 static gboolean
9298
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
215 im_recv_im(GaimAccount *account, char *sender, char *message,
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
216 int *flags)
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
217 {
9298
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
218 GaimConversation *conv = gaim_find_conversation_with_account(sender, account);
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
219
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
220 notify(conv, TRUE);
3710
03ba413ca20b [gaim-migrate @ 3843]
Luke Schierer <lschiere@pidgin.im>
parents: 3565
diff changeset
221
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6464
diff changeset
222 return FALSE;
3710
03ba413ca20b [gaim-migrate @ 3843]
Luke Schierer <lschiere@pidgin.im>
parents: 3565
diff changeset
223 }
03ba413ca20b [gaim-migrate @ 3843]
Luke Schierer <lschiere@pidgin.im>
parents: 3565
diff changeset
224
9298
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
225 static gboolean
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
226 chat_recv_im(GaimAccount *account, char *sender, char *message,
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
227 GaimConversation *conv)
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
228 {
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
229 notify(conv, TRUE);
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
230
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
231 return FALSE;
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
232 }
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
233
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
234 static void
9298
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
235 im_sent_im(GaimAccount *account, char *receiver, const char *message) {
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
236 GaimConversation *conv = NULL;
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
237
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
238 if (gaim_prefs_get_bool("/plugins/gtk/X11/notify/notify_send")) {
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
239 conv = gaim_find_conversation_with_account(receiver, account);
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
240 unnotify(conv, TRUE);
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
241 }
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
242 }
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
243
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
244 static void
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
245 chat_sent_im(GaimAccount *account, const char *message, int id)
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
246 {
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
247 GaimConversation *conv = NULL;
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
248
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
249 if (gaim_prefs_get_bool("/plugins/gtk/X11/notify/notify_send")) {
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
250 conv = gaim_find_chat(gaim_account_get_connection(account), id);
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
251 unnotify(conv, TRUE);
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
252 }
3710
03ba413ca20b [gaim-migrate @ 3843]
Luke Schierer <lschiere@pidgin.im>
parents: 3565
diff changeset
253 }
03ba413ca20b [gaim-migrate @ 3843]
Luke Schierer <lschiere@pidgin.im>
parents: 3565
diff changeset
254
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
255 static int
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
256 attach_signals(GaimConversation *conv)
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
257 {
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
258 GaimGtkConversation *gtkconv = NULL;
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
259 GaimGtkWindow *gtkwin = NULL;
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
260 GSList *window_ids = NULL, *imhtml_ids = NULL, *entry_ids = NULL;
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
261 guint id;
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
262
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
263 gtkconv = GAIM_GTK_CONVERSATION(conv);
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
264 gtkwin = GAIM_GTK_WINDOW(gaim_conversation_get_window(conv));
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4218
diff changeset
265
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
266 if (gaim_prefs_get_bool("/plugins/gtk/X11/notify/notify_focus")) {
9298
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
267 GtkWidget *child = NULL;
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
268 gint page_num;
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
269
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
270 page_num = gaim_conversation_get_index(conv);
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
271 child = gtk_notebook_get_nth_page(GTK_NOTEBOOK(gtkwin->notebook), page_num);
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
272
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
273 /* TODO should really find a way to make this work no matter where the
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
274 * focus is inside the conv window, without having to bind to
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
275 * focus-in-event on the g(d|t)kwindow */
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
276 /* try setting the signal on the focus-in-event for
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
277 * gtkwin->notebook->container? */
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
278 id = g_signal_connect(G_OBJECT(gtkconv->entry), "focus-in-event",
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
279 G_CALLBACK(unnotify_cb), conv);
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
280 window_ids = g_slist_append(window_ids, GUINT_TO_POINTER(id));
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
281
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
282 id = g_signal_connect(G_OBJECT(gtkconv->imhtml), "focus-in-event",
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
283 G_CALLBACK(unnotify_cb), conv);
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
284 window_ids = g_slist_append(window_ids, GUINT_TO_POINTER(id));
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
285 }
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4218
diff changeset
286
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
287 if (gaim_prefs_get_bool("/plugins/gtk/X11/notify/notify_click")) {
9298
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
288 /* TODO similarly should really find a way to allow for clicking in other
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
289 * places of the window */
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
290 id = g_signal_connect(G_OBJECT(gtkconv->imhtml), "button-press-event",
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
291 G_CALLBACK(unnotify_cb), conv);
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
292 imhtml_ids = g_slist_append(imhtml_ids, GUINT_TO_POINTER(id));
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
293
9298
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
294 id = g_signal_connect(G_OBJECT(gtkconv->entry), "button-press-event",
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
295 G_CALLBACK(unnotify_cb), conv);
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
296 entry_ids = g_slist_append(entry_ids, GUINT_TO_POINTER(id));
3374
3cd2fbddf95a [gaim-migrate @ 3393]
Sean Egan <seanegan@gmail.com>
parents: 2313
diff changeset
297 }
3710
03ba413ca20b [gaim-migrate @ 3843]
Luke Schierer <lschiere@pidgin.im>
parents: 3565
diff changeset
298
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
299 if (gaim_prefs_get_bool("/plugins/gtk/X11/notify/notify_type")) {
9298
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
300 id = g_signal_connect(G_OBJECT(gtkconv->entry), "key-press-event",
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
301 G_CALLBACK(unnotify_cb), conv);
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
302 entry_ids = g_slist_append(entry_ids, GUINT_TO_POINTER(id));
3374
3cd2fbddf95a [gaim-migrate @ 3393]
Sean Egan <seanegan@gmail.com>
parents: 2313
diff changeset
303 }
3cd2fbddf95a [gaim-migrate @ 3393]
Sean Egan <seanegan@gmail.com>
parents: 2313
diff changeset
304
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
305 gaim_conversation_set_data(conv, "notify-window-signals", window_ids);
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
306 gaim_conversation_set_data(conv, "notify-imhtml-signals", imhtml_ids);
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
307 gaim_conversation_set_data(conv, "notify-entry-signals", entry_ids);
4035
4cea75cf291d [gaim-migrate @ 4241]
Luke Schierer <lschiere@pidgin.im>
parents: 3710
diff changeset
308
3428
0202b5e1af69 [gaim-migrate @ 3454]
Sean Egan <seanegan@gmail.com>
parents: 3427
diff changeset
309 return 0;
191
948100a8cb23 [gaim-migrate @ 201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
310 }
948100a8cb23 [gaim-migrate @ 201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
311
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
312 static void
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
313 detach_signals(GaimConversation *conv)
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
314 {
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
315 GaimGtkConversation *gtkconv = NULL;
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
316 GaimGtkWindow *gtkwin = NULL;
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
317 GSList *ids = NULL;
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6464
diff changeset
318
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
319 gtkconv = GAIM_GTK_CONVERSATION(conv);
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
320 gtkwin = GAIM_GTK_WINDOW(gaim_conversation_get_window(conv));
4203
ec6d0c5e5c23 [gaim-migrate @ 4439]
Christian Hammond <chipx86@chipx86.com>
parents: 4202
diff changeset
321
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
322 ids = gaim_conversation_get_data(conv, "notify-window-signals");
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
323 for (; ids != NULL; ids = ids->next)
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
324 g_signal_handler_disconnect(gtkwin->window, GPOINTER_TO_INT(ids->data));
6302
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
325
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
326 ids = gaim_conversation_get_data(conv, "notify-imhtml-signals");
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
327 for (; ids != NULL; ids = ids->next)
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
328 g_signal_handler_disconnect(gtkconv->imhtml, GPOINTER_TO_INT(ids->data));
6302
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
329
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
330 ids = gaim_conversation_get_data(conv, "notify-entry-signals");
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
331 for (; ids != NULL; ids = ids->next)
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
332 g_signal_handler_disconnect(gtkconv->entry, GPOINTER_TO_INT(ids->data));
3710
03ba413ca20b [gaim-migrate @ 3843]
Luke Schierer <lschiere@pidgin.im>
parents: 3565
diff changeset
333
9298
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
334 gaim_conversation_set_data(conv, "notify-message-count", GINT_TO_POINTER(0));
3710
03ba413ca20b [gaim-migrate @ 3843]
Luke Schierer <lschiere@pidgin.im>
parents: 3565
diff changeset
335
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
336 gaim_conversation_set_data(conv, "notify-window-signals", NULL);
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
337 gaim_conversation_set_data(conv, "notify-imhtml-signals", NULL);
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
338 gaim_conversation_set_data(conv, "notify-entry-signals", NULL);
3710
03ba413ca20b [gaim-migrate @ 3843]
Luke Schierer <lschiere@pidgin.im>
parents: 3565
diff changeset
339 }
03ba413ca20b [gaim-migrate @ 3843]
Luke Schierer <lschiere@pidgin.im>
parents: 3565
diff changeset
340
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
341 static void
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
342 conv_created(GaimConversation *conv)
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
343 {
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 6982
diff changeset
344 GaimConvWindow *gaimwin = NULL;
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
345 GaimGtkWindow *gtkwin = NULL;
6302
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
346
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
347 gaimwin = gaim_conversation_get_window(conv);
6302
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
348
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
349 if (gaimwin == NULL)
6302
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
350 return;
3374
3cd2fbddf95a [gaim-migrate @ 3393]
Sean Egan <seanegan@gmail.com>
parents: 2313
diff changeset
351
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
352 gtkwin = GAIM_GTK_WINDOW(gaimwin);
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
353
9298
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
354 gaim_conversation_set_data(conv, "notify-message-count", GINT_TO_POINTER(0));
6302
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
355
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
356 /* always attach the signals, notify() will take care of conversation type
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
357 * checking */
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
358 attach_signals(conv);
3374
3cd2fbddf95a [gaim-migrate @ 3393]
Sean Egan <seanegan@gmail.com>
parents: 2313
diff changeset
359 }
3cd2fbddf95a [gaim-migrate @ 3393]
Sean Egan <seanegan@gmail.com>
parents: 2313
diff changeset
360
9303
fe931c791fc0 [gaim-migrate @ 10107]
Mark Doliner <mark@kingant.net>
parents: 9298
diff changeset
361 #if 0
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
362 static void
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
363 conv_switched(GaimConversation *old_conv, GaimConversation *new_conv)
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
364 {
9298
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
365 GaimConvWindow *gaimwin = gaim_conversation_get_window(new_conv);
6302
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
366
9298
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
367 printf("conv_switched - %p - %p\n", old_conv, new_conv);
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
368 printf("count - %d\n", count_messages(gaimwin));
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
369 if (gaim_prefs_get_bool("/plugins/gtk/X11/notify/notify_switch"))
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
370 unnotify(new_conv, FALSE);
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
371 else {
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
372 /* if we don't have notification on the window then we don't want to
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
373 * re-notify it */
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
374 if (count_messages(gaimwin))
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
375 notify_win(gaimwin);
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
376 }
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
377 }
9303
fe931c791fc0 [gaim-migrate @ 10107]
Mark Doliner <mark@kingant.net>
parents: 9298
diff changeset
378 #endif
6302
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
379
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
380 static void
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
381 deleting_conv(GaimConversation *conv)
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
382 {
9298
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
383 GaimConvWindow *gaimwin = NULL;
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
384
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
385 detach_signals(conv);
3392
5a5df7968b6e [gaim-migrate @ 3411]
Sean Egan <seanegan@gmail.com>
parents: 3385
diff changeset
386
9298
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
387 unnotify(conv, TRUE);
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
388
9298
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
389 gaimwin = gaim_conversation_get_window(conv);
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
390 if (count_messages(gaimwin))
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
391 notify_win(gaimwin);
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
392 }
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
393
9303
fe931c791fc0 [gaim-migrate @ 10107]
Mark Doliner <mark@kingant.net>
parents: 9298
diff changeset
394 #if 0
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
395 static void
9298
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
396 conversation_drag_ended(GaimConversation *active_conv,
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
397 GaimConvWindow *old_gaimwin,
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
398 GaimConvWindow *new_gaimwin)
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
399 {
9298
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
400 if (old_gaimwin != new_gaimwin) {
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
401 if (old_gaimwin == NULL) {
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
402 /*
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
403 gaim_conversation_autoset_title(active_conv);
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
404 handle_urgent(new_gaimwin, FALSE);
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
405 */
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
406
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
407 if (count_messages(new_gaimwin))
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
408 notify_win(new_gaimwin);
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
409 } else {
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
410 printf("if else count = %d\n", count_messages(new_gaimwin));
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
411 printf("if else count = %d\n", count_messages(old_gaimwin));
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
412 /*
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
413 GaimConversation *old_active_conv = NULL;
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
414 old_active_conv = gaim_conv_window_get_active_conversation(new_gaimwin);
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
415
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
416 gaim_conversation_autoset_title(old_active_conv);
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
417 handle_urgent(old_gaimwin, FALSE);
6302
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
418
9298
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
419 if (count_messages(old_gaimwin))
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
420 notify_win(old_gaimwin);
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
421
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
422 gaim_conversation_autoset_title(active_conv);
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
423 handle_urgent(new_gaimwin, FALSE);
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
424
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
425 if (count_messages(new_gaimwin))
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
426 notify_win(new_gaimwin);
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
427 */
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
428 }
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
429 } else {
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
430 printf("else count = %d\n", count_messages(new_gaimwin));
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
431 printf("else count = %d\n", count_messages(old_gaimwin));
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
432 /*
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
433 gaim_conversation_autoset_title(active_conv);
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
434 handle_urgent(old_gaimwin, FALSE);
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
435
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
436 if (count_messages(old_gaimwin))
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
437 notify_win(old_gaimwin);
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
438 */
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
439 }
4035
4cea75cf291d [gaim-migrate @ 4241]
Luke Schierer <lschiere@pidgin.im>
parents: 3710
diff changeset
440 }
9303
fe931c791fc0 [gaim-migrate @ 10107]
Mark Doliner <mark@kingant.net>
parents: 9298
diff changeset
441 #endif
4035
4cea75cf291d [gaim-migrate @ 4241]
Luke Schierer <lschiere@pidgin.im>
parents: 3710
diff changeset
442
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
443 static void
9298
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
444 handle_string(GaimConvWindow *gaimwin)
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
445 {
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
446 GtkWindow *window = NULL;
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
447 gchar newtitle[256];
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
448
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
449 g_return_if_fail(gaimwin != NULL);
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
450
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
451 window = GTK_WINDOW(GAIM_GTK_WINDOW(gaimwin)->window);
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
452 g_return_if_fail(window != NULL);
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
453
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
454 g_snprintf(newtitle, sizeof(newtitle), "%s%s",
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
455 gaim_prefs_get_string("/plugins/gtk/X11/notify/title_string"),
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
456 gtk_window_get_title(window));
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
457 gtk_window_set_title(window, newtitle);
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
458 }
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
459
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
460 static void
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
461 handle_count(GaimConvWindow *gaimwin)
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
462 {
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
463 GtkWindow *window;
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
464 char newtitle[256];
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
465
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
466 g_return_if_fail(gaimwin != NULL);
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
467
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
468 window = GTK_WINDOW(GAIM_GTK_WINDOW(gaimwin)->window);
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
469 g_return_if_fail(window != NULL);
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
470
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
471 g_snprintf(newtitle, sizeof(newtitle), "[%d] %s", count_messages(gaimwin),
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
472 gtk_window_get_title(window));
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
473 gtk_window_set_title(window, newtitle);
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
474 }
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
475
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
476 static void
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
477 handle_urgent(GaimConvWindow *gaimwin, gboolean add)
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
478 {
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4218
diff changeset
479 XWMHints *hints;
9298
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
480 GaimGtkWindow *gtkwin = GAIM_GTK_WINDOW(gaimwin);
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4218
diff changeset
481
9298
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
482 g_return_if_fail(gtkwin != NULL);
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
483 g_return_if_fail(gtkwin->window != NULL);
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
484 g_return_if_fail(gtkwin->window->window != NULL);
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
485
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
486 hints = XGetWMHints(GDK_WINDOW_XDISPLAY(gtkwin->window->window), GDK_WINDOW_XWINDOW(gtkwin->window->window));
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
487 if (add)
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
488 hints->flags |= XUrgencyHint;
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
489 else
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
490 hints->flags &= ~XUrgencyHint;
9298
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
491 XSetWMHints(GDK_WINDOW_XDISPLAY(gtkwin->window->window),
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
492 GDK_WINDOW_XWINDOW(gtkwin->window->window), hints);
4218
fac89c0d55c2 [gaim-migrate @ 4462]
Sean Egan <seanegan@gmail.com>
parents: 4203
diff changeset
493 XFree(hints);
4035
4cea75cf291d [gaim-migrate @ 4241]
Luke Schierer <lschiere@pidgin.im>
parents: 3710
diff changeset
494 }
4cea75cf291d [gaim-migrate @ 4241]
Luke Schierer <lschiere@pidgin.im>
parents: 3710
diff changeset
495
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
496 static void
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
497 type_toggle_cb(GtkWidget *widget, gpointer data)
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
498 {
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
499 gboolean on = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
500 gchar pref[256];
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4218
diff changeset
501
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
502 g_snprintf(pref, sizeof(pref), "/plugins/gtk/X11/notify/%s", (char *)data);
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4218
diff changeset
503
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
504 gaim_prefs_set_bool(pref, on);
3374
3cd2fbddf95a [gaim-migrate @ 3393]
Sean Egan <seanegan@gmail.com>
parents: 2313
diff changeset
505 }
3cd2fbddf95a [gaim-migrate @ 3393]
Sean Egan <seanegan@gmail.com>
parents: 2313
diff changeset
506
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
507 static void
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
508 method_toggle_cb(GtkWidget *widget, gpointer data)
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
509 {
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
510 gboolean on = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
511 gchar pref[256];
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
512
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
513 g_snprintf(pref, sizeof(pref), "/plugins/gtk/X11/notify/%s", (char *)data);
3374
3cd2fbddf95a [gaim-migrate @ 3393]
Sean Egan <seanegan@gmail.com>
parents: 2313
diff changeset
514
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
515 gaim_prefs_set_bool(pref, on);
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
516
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
517 if (!strcmp(data, "method_string")) {
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
518 GtkWidget *entry = g_object_get_data(G_OBJECT(widget), "title-entry");
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
519 gtk_widget_set_sensitive(entry, on);
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
520
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
521 gaim_prefs_set_string("/plugins/gtk/X11/notify/title_string", gtk_entry_get_text(GTK_ENTRY(entry)));
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
522 }
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
523
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
524 apply_method();
3374
3cd2fbddf95a [gaim-migrate @ 3393]
Sean Egan <seanegan@gmail.com>
parents: 2313
diff changeset
525 }
3cd2fbddf95a [gaim-migrate @ 3393]
Sean Egan <seanegan@gmail.com>
parents: 2313
diff changeset
526
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
527 static void
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
528 notify_toggle_cb(GtkWidget *widget, gpointer data)
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
529 {
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
530 gboolean on = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
531 gchar pref[256];
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6464
diff changeset
532
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
533 g_snprintf(pref, sizeof(pref), "/plugins/gtk/X11/notify/%s", (char *)data);
3374
3cd2fbddf95a [gaim-migrate @ 3393]
Sean Egan <seanegan@gmail.com>
parents: 2313
diff changeset
534
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
535 gaim_prefs_set_bool(pref, on);
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
536
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
537 apply_notify();
3374
3cd2fbddf95a [gaim-migrate @ 3393]
Sean Egan <seanegan@gmail.com>
parents: 2313
diff changeset
538 }
3cd2fbddf95a [gaim-migrate @ 3393]
Sean Egan <seanegan@gmail.com>
parents: 2313
diff changeset
539
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
540 static gboolean
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
541 options_entry_cb(GtkWidget *widget, GdkEventFocus *evt, gpointer data)
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
542 {
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
543 if (data == NULL)
6982
083d1e4a9c78 [gaim-migrate @ 7538]
Mark Doliner <mark@kingant.net>
parents: 6977
diff changeset
544 return FALSE;
6302
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
545
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
546 if (!strcmp(data, "method_string")) {
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
547 gaim_prefs_set_string("/plugins/gtk/X11/notify/title_string", gtk_entry_get_text(GTK_ENTRY(widget)));
3374
3cd2fbddf95a [gaim-migrate @ 3393]
Sean Egan <seanegan@gmail.com>
parents: 2313
diff changeset
548 }
6302
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
549
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
550 apply_method();
6302
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
551
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
552 return FALSE;
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
553 }
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
554
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
555 static void
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
556 apply_method() {
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
557 GList *convs = gaim_get_conversations();
9298
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
558 GaimConvWindow *gaimwin = NULL;
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
559
9298
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
560 for (convs = gaim_get_conversations(); convs != NULL; convs = convs->next) {
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
561 GaimConversation *conv = (GaimConversation *)convs->data;
6302
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
562
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
563 /* remove notifications */
9298
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
564 unnotify(conv, FALSE);
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
565
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
566 gaimwin = gaim_conversation_get_window(conv);
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
567 if (GPOINTER_TO_INT(gaim_conversation_get_data(conv, "notify-message-count")) != 0)
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
568 /* reattach appropriate notifications */
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
569 notify(conv, FALSE);
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
570 }
3374
3cd2fbddf95a [gaim-migrate @ 3393]
Sean Egan <seanegan@gmail.com>
parents: 2313
diff changeset
571 }
3cd2fbddf95a [gaim-migrate @ 3393]
Sean Egan <seanegan@gmail.com>
parents: 2313
diff changeset
572
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
573 static void
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
574 apply_notify()
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
575 {
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
576 GList *convs = gaim_get_conversations();
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6464
diff changeset
577
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
578 while (convs) {
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
579 GaimConversation *conv = (GaimConversation *)convs->data;
4203
ec6d0c5e5c23 [gaim-migrate @ 4439]
Christian Hammond <chipx86@chipx86.com>
parents: 4202
diff changeset
580
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
581 /* detach signals */
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
582 detach_signals(conv);
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
583 /* reattach appropriate signals */
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
584 attach_signals(conv);
4035
4cea75cf291d [gaim-migrate @ 4241]
Luke Schierer <lschiere@pidgin.im>
parents: 3710
diff changeset
585
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
586 convs = convs->next;
4035
4cea75cf291d [gaim-migrate @ 4241]
Luke Schierer <lschiere@pidgin.im>
parents: 3710
diff changeset
587 }
4cea75cf291d [gaim-migrate @ 4241]
Luke Schierer <lschiere@pidgin.im>
parents: 3710
diff changeset
588 }
4cea75cf291d [gaim-migrate @ 4241]
Luke Schierer <lschiere@pidgin.im>
parents: 3710
diff changeset
589
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5021
diff changeset
590 static GtkWidget *
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5021
diff changeset
591 get_config_frame(GaimPlugin *plugin)
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5021
diff changeset
592 {
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
593 GtkWidget *ret = NULL, *frame = NULL;
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
594 GtkWidget *vbox = NULL, *hbox = NULL;
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
595 GtkWidget *toggle = NULL, *entry = NULL;
6302
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
596
3565
154c4a9d9b6d [gaim-migrate @ 3660]
Sean Egan <seanegan@gmail.com>
parents: 3561
diff changeset
597 ret = gtk_vbox_new(FALSE, 18);
6302
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
598 gtk_container_set_border_width(GTK_CONTAINER (ret), 12);
3392
5a5df7968b6e [gaim-migrate @ 3411]
Sean Egan <seanegan@gmail.com>
parents: 3385
diff changeset
599
6302
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
600 /*---------- "Notify For" ----------*/
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
601 frame = gaim_gtk_make_frame(ret, _("Notify For"));
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
602 vbox = gtk_vbox_new(FALSE, 5);
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
603 gtk_container_add(GTK_CONTAINER(frame), vbox);
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
604
3710
03ba413ca20b [gaim-migrate @ 3843]
Luke Schierer <lschiere@pidgin.im>
parents: 3565
diff changeset
605 toggle = gtk_check_button_new_with_mnemonic(_("_IM windows"));
03ba413ca20b [gaim-migrate @ 3843]
Luke Schierer <lschiere@pidgin.im>
parents: 3565
diff changeset
606 gtk_box_pack_start(GTK_BOX(vbox), toggle, FALSE, FALSE, 0);
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
607 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toggle),
9298
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
608 gaim_prefs_get_bool("/plugins/gtk/X11/notify/type_im"));
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
609 g_signal_connect(G_OBJECT(toggle), "toggled",
9298
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
610 G_CALLBACK(type_toggle_cb), "type_im");
3710
03ba413ca20b [gaim-migrate @ 3843]
Luke Schierer <lschiere@pidgin.im>
parents: 3565
diff changeset
611
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
612 toggle = gtk_check_button_new_with_mnemonic(_("C_hat windows"));
3710
03ba413ca20b [gaim-migrate @ 3843]
Luke Schierer <lschiere@pidgin.im>
parents: 3565
diff changeset
613 gtk_box_pack_start(GTK_BOX(vbox), toggle, FALSE, FALSE, 0);
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
614 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toggle),
9298
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
615 gaim_prefs_get_bool("/plugins/gtk/X11/notify/type_chat"));
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
616 g_signal_connect(G_OBJECT(toggle), "toggled",
9298
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
617 G_CALLBACK(type_toggle_cb), "type_chat");
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
618
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
619 toggle = gtk_check_button_new_with_mnemonic(_("_Focused windows"));
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
620 gtk_box_pack_start(GTK_BOX(vbox), toggle, FALSE, FALSE, 0);
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
621 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toggle),
9298
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
622 gaim_prefs_get_bool("/plugins/gtk/X11/notify/type_focused"));
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
623 g_signal_connect(G_OBJECT(toggle), "toggled",
9298
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
624 G_CALLBACK(type_toggle_cb), "type_focused");
3710
03ba413ca20b [gaim-migrate @ 3843]
Luke Schierer <lschiere@pidgin.im>
parents: 3565
diff changeset
625
6302
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
626 /*---------- "Notification Methods" ----------*/
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
627 frame = gaim_gtk_make_frame(ret, _("Notification Methods"));
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
628 vbox = gtk_vbox_new(FALSE, 5);
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
629 gtk_container_add(GTK_CONTAINER(frame), vbox);
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
630
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
631 /* String method button */
3565
154c4a9d9b6d [gaim-migrate @ 3660]
Sean Egan <seanegan@gmail.com>
parents: 3561
diff changeset
632 hbox = gtk_hbox_new(FALSE, 18);
154c4a9d9b6d [gaim-migrate @ 3660]
Sean Egan <seanegan@gmail.com>
parents: 3561
diff changeset
633 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
6302
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
634 toggle = gtk_check_button_new_with_mnemonic(_("Prepend _string into window title:"));
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
635 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toggle),
9298
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
636 gaim_prefs_get_bool("/plugins/gtk/X11/notify/method_string"));
3565
154c4a9d9b6d [gaim-migrate @ 3660]
Sean Egan <seanegan@gmail.com>
parents: 3561
diff changeset
637 gtk_box_pack_start(GTK_BOX(hbox), toggle, FALSE, FALSE, 0);
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
638
6302
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
639 entry = gtk_entry_new();
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
640 gtk_box_pack_start(GTK_BOX(hbox), entry, FALSE, FALSE, 0);
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
641 gtk_entry_set_max_length(GTK_ENTRY(entry), 10);
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
642 gtk_widget_set_sensitive(GTK_WIDGET(entry),
9298
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
643 gaim_prefs_get_bool("/plugins/gtk/X11/notify/method_string"));
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
644 gtk_entry_set_text(GTK_ENTRY(entry),
9298
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
645 gaim_prefs_get_string("/plugins/gtk/X11/notify/title_string"));
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
646 g_object_set_data(G_OBJECT(toggle), "title-entry", entry);
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
647 g_signal_connect(G_OBJECT(toggle), "toggled",
9298
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
648 G_CALLBACK(method_toggle_cb), "method_string");
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
649 g_signal_connect(G_OBJECT(entry), "focus-out-event",
9298
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
650 G_CALLBACK(options_entry_cb), "method_string");
3374
3cd2fbddf95a [gaim-migrate @ 3393]
Sean Egan <seanegan@gmail.com>
parents: 2313
diff changeset
651
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
652 /* Count method button */
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
653 toggle = gtk_check_button_new_with_mnemonic(_("Insert c_ount of new messages into window title"));
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
654 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toggle),
9298
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
655 gaim_prefs_get_bool("/plugins/gtk/X11/notify/method_count"));
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
656 gtk_box_pack_start(GTK_BOX(vbox), toggle, FALSE, FALSE, 0);
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
657 g_signal_connect(G_OBJECT(toggle), "toggled",
9298
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
658 G_CALLBACK(method_toggle_cb), "method_count");
4035
4cea75cf291d [gaim-migrate @ 4241]
Luke Schierer <lschiere@pidgin.im>
parents: 3710
diff changeset
659
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
660 /* Urgent method button */
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
661 toggle = gtk_check_button_new_with_mnemonic(_("Set window manager \"_URGENT\" hint"));
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
662 gtk_box_pack_start(GTK_BOX(vbox), toggle, FALSE, FALSE, 0);
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
663 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toggle),
9298
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
664 gaim_prefs_get_bool("/plugins/gtk/X11/notify/method_urgent"));
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
665 g_signal_connect(G_OBJECT(toggle), "toggled",
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
666 G_CALLBACK(method_toggle_cb), "method_urgent");
3710
03ba413ca20b [gaim-migrate @ 3843]
Luke Schierer <lschiere@pidgin.im>
parents: 3565
diff changeset
667
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
668 /*---------- "Notification Removals" ----------*/
6302
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
669 frame = gaim_gtk_make_frame(ret, _("Notification Removal"));
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
670 vbox = gtk_vbox_new(FALSE, 5);
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
671 gtk_container_add(GTK_CONTAINER(frame), vbox);
3374
3cd2fbddf95a [gaim-migrate @ 3393]
Sean Egan <seanegan@gmail.com>
parents: 2313
diff changeset
672
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
673 /* Remove on focus button */
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
674 toggle = gtk_check_button_new_with_mnemonic(_("Remove when conversation window _gains focus"));
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
675 gtk_box_pack_start(GTK_BOX(vbox), toggle, FALSE, FALSE, 0);
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
676 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toggle),
9298
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
677 gaim_prefs_get_bool("/plugins/gtk/X11/notify/notify_focus"));
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
678 g_signal_connect(G_OBJECT(toggle), "toggled", G_CALLBACK(notify_toggle_cb), "notify_focus");
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
679
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
680 /* Remove on click button */
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
681 toggle = gtk_check_button_new_with_mnemonic(_("Remove when conversation window _receives click"));
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
682 gtk_box_pack_start(GTK_BOX(vbox), toggle, FALSE, FALSE, 0);
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
683 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toggle),
9298
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
684 gaim_prefs_get_bool("/plugins/gtk/X11/notify/notify_click"));
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
685 g_signal_connect(G_OBJECT(toggle), "toggled",
9298
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
686 G_CALLBACK(notify_toggle_cb), "notify_click");
3710
03ba413ca20b [gaim-migrate @ 3843]
Luke Schierer <lschiere@pidgin.im>
parents: 3565
diff changeset
687
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
688 /* Remove on type button */
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
689 toggle = gtk_check_button_new_with_mnemonic(_("Remove when _typing in conversation window"));
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
690 gtk_box_pack_start(GTK_BOX(vbox), toggle, FALSE, FALSE, 0);
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
691 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toggle),
9298
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
692 gaim_prefs_get_bool("/plugins/gtk/X11/notify/notify_type"));
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
693 g_signal_connect(G_OBJECT(toggle), "toggled",
9298
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
694 G_CALLBACK(notify_toggle_cb), "notify_type");
4035
4cea75cf291d [gaim-migrate @ 4241]
Luke Schierer <lschiere@pidgin.im>
parents: 3710
diff changeset
695
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
696 /* Remove on message send button */
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
697 toggle = gtk_check_button_new_with_mnemonic(_("Remove when a _message gets sent"));
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
698 gtk_box_pack_start(GTK_BOX(vbox), toggle, FALSE, FALSE, 0);
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
699 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toggle),
9298
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
700 gaim_prefs_get_bool("/plugins/gtk/X11/notify/notify_send"));
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
701 g_signal_connect(G_OBJECT(toggle), "toggled",
9298
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
702 G_CALLBACK(notify_toggle_cb), "notify_send");
3565
154c4a9d9b6d [gaim-migrate @ 3660]
Sean Egan <seanegan@gmail.com>
parents: 3561
diff changeset
703
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
704 #if 0
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
705 /* Remove on conversation switch button */
9298
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
706 toggle = gtk_check_button_new_with_mnemonic(_("Remove on switch to conversation ta_b"));
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
707 gtk_box_pack_start(GTK_BOX(vbox), toggle, FALSE, FALSE, 0);
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
708 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toggle),
9298
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
709 gaim_prefs_get_bool("/plugins/gtk/X11/notify/notify_switch"));
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
710 g_signal_connect(G_OBJECT(toggle), "toggled",
9298
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
711 G_CALLBACK(notify_toggle_cb), "notify_switch");
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
712 #endif
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
713
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
714 gtk_widget_show_all(ret);
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
715 return ret;
3374
3cd2fbddf95a [gaim-migrate @ 3393]
Sean Egan <seanegan@gmail.com>
parents: 2313
diff changeset
716 }
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5021
diff changeset
717
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5021
diff changeset
718 static gboolean
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5021
diff changeset
719 plugin_load(GaimPlugin *plugin)
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5021
diff changeset
720 {
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
721 GList *convs = gaim_get_conversations();
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6464
diff changeset
722 void *conv_handle = gaim_conversations_get_handle();
9298
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
723 /*
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
724 void *gtk_conv_handle = gaim_gtk_conversations_get_handle();
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
725 */
6302
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
726
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
727 my_plugin = plugin;
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5021
diff changeset
728
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
729 gaim_signal_connect(conv_handle, "received-im-msg", plugin,
9298
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
730 GAIM_CALLBACK(im_recv_im), NULL);
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
731 gaim_signal_connect(conv_handle, "received-chat-msg", plugin,
9298
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
732 GAIM_CALLBACK(chat_recv_im), NULL);
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
733 gaim_signal_connect(conv_handle, "sent-im-msg", plugin,
9298
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
734 GAIM_CALLBACK(im_sent_im), NULL);
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
735 gaim_signal_connect(conv_handle, "sent-chat-msg", plugin,
9298
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
736 GAIM_CALLBACK(chat_sent_im), NULL);
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
737 gaim_signal_connect(conv_handle, "conversation-created", plugin,
9298
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
738 GAIM_CALLBACK(conv_created), NULL);
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
739 gaim_signal_connect(conv_handle, "chat-joined", plugin,
9298
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
740 GAIM_CALLBACK(conv_created), NULL);
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
741 gaim_signal_connect(conv_handle, "deleting-conversation", plugin,
9298
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
742 GAIM_CALLBACK(deleting_conv), NULL);
9303
fe931c791fc0 [gaim-migrate @ 10107]
Mark Doliner <mark@kingant.net>
parents: 9298
diff changeset
743 #if 0
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
744 gaim_signal_connect(conv_handle, "conversation-switched", plugin,
9298
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
745 GAIM_CALLBACK(conv_switched), NULL);
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
746 gaim_signal_connect(gtk_conv_handle, "conversation-drag-ended", plugin,
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
747 GAIM_CALLBACK(conversation_drag_ended), NULL);
9303
fe931c791fc0 [gaim-migrate @ 10107]
Mark Doliner <mark@kingant.net>
parents: 9298
diff changeset
748 #endif
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5021
diff changeset
749
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
750 while (convs) {
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
751 GaimConversation *conv = (GaimConversation *)convs->data;
6302
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
752
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
753 /* attach signals */
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
754 attach_signals(conv);
6302
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
755
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
756 convs = convs->next;
6302
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
757 }
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
758
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5021
diff changeset
759 return TRUE;
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5021
diff changeset
760 }
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5021
diff changeset
761
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5021
diff changeset
762 static gboolean
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5021
diff changeset
763 plugin_unload(GaimPlugin *plugin)
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5021
diff changeset
764 {
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
765 GList *convs = gaim_get_conversations();
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5021
diff changeset
766
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
767 while (convs) {
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
768 GaimConversation *conv = (GaimConversation *)convs->data;
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5021
diff changeset
769
6302
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
770 /* kill signals */
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
771 detach_signals(conv);
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5021
diff changeset
772
6977
996a182029f7 [gaim-migrate @ 7530]
Luke Schierer <lschiere@pidgin.im>
parents: 6735
diff changeset
773 convs = convs->next;
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5021
diff changeset
774 }
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5021
diff changeset
775
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5021
diff changeset
776 return TRUE;
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5021
diff changeset
777 }
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5021
diff changeset
778
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5021
diff changeset
779 static GaimGtkPluginUiInfo ui_info =
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5021
diff changeset
780 {
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5021
diff changeset
781 get_config_frame
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5021
diff changeset
782 };
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5021
diff changeset
783
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5021
diff changeset
784 static GaimPluginInfo info =
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5021
diff changeset
785 {
9943
f8e395a054e2 [gaim-migrate @ 10835]
Nathan Walp <nwalp@pidgin.im>
parents: 9791
diff changeset
786 GAIM_PLUGIN_MAGIC,
f8e395a054e2 [gaim-migrate @ 10835]
Nathan Walp <nwalp@pidgin.im>
parents: 9791
diff changeset
787 GAIM_MAJOR_VERSION,
f8e395a054e2 [gaim-migrate @ 10835]
Nathan Walp <nwalp@pidgin.im>
parents: 9791
diff changeset
788 GAIM_MINOR_VERSION,
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5021
diff changeset
789 GAIM_PLUGIN_STANDARD, /**< type */
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5021
diff changeset
790 GAIM_GTK_PLUGIN_TYPE, /**< ui_requirement */
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5021
diff changeset
791 0, /**< flags */
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5021
diff changeset
792 NULL, /**< dependencies */
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5021
diff changeset
793 GAIM_PRIORITY_DEFAULT, /**< priority */
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5021
diff changeset
794
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5021
diff changeset
795 NOTIFY_PLUGIN_ID, /**< id */
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5021
diff changeset
796 N_("Message Notification"), /**< name */
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5021
diff changeset
797 VERSION, /**< version */
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5021
diff changeset
798 /** summary */
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5021
diff changeset
799 N_("Provides a variety of ways of notifying you of unread messages."),
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5021
diff changeset
800 /** description */
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5021
diff changeset
801 N_("Provides a variety of ways of notifying you of unread messages."),
9298
b0b544e0f246 [gaim-migrate @ 10101]
Luke Schierer <lschiere@pidgin.im>
parents: 8999
diff changeset
802 "Etan Reisner <deryni@eden.rutgers.edu>\n\t\t\tBrian Tarricone <bjt23@cornell.edu>",
6302
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
803 /**< author */
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6464
diff changeset
804 GAIM_WEBSITE, /**< homepage */
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5021
diff changeset
805
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5021
diff changeset
806 plugin_load, /**< load */
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5021
diff changeset
807 plugin_unload, /**< unload */
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5021
diff changeset
808 NULL, /**< destroy */
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5021
diff changeset
809
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5021
diff changeset
810 &ui_info, /**< ui_info */
8993
294ae6548d4e [gaim-migrate @ 9768]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
811 NULL, /**< extra_info */
294ae6548d4e [gaim-migrate @ 9768]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
812 NULL,
294ae6548d4e [gaim-migrate @ 9768]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
813 NULL
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5021
diff changeset
814 };
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5021
diff changeset
815
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5021
diff changeset
816 static void
5920
7d385de2f9cd [gaim-migrate @ 6360]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
817 init_plugin(GaimPlugin *plugin)
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5021
diff changeset
818 {
6302
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
819 gaim_prefs_add_none("/plugins/gtk");
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
820 gaim_prefs_add_none("/plugins/gtk/X11");
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
821 gaim_prefs_add_none("/plugins/gtk/X11/notify");
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
822
6464
059649ed25ed [gaim-migrate @ 6973]
Mark Doliner <mark@kingant.net>
parents: 6371
diff changeset
823 gaim_prefs_add_bool("/plugins/gtk/X11/notify/type_im", TRUE);
059649ed25ed [gaim-migrate @ 6973]
Mark Doliner <mark@kingant.net>
parents: 6371
diff changeset
824 gaim_prefs_add_bool("/plugins/gtk/X11/notify/type_chat", FALSE);
059649ed25ed [gaim-migrate @ 6973]
Mark Doliner <mark@kingant.net>
parents: 6371
diff changeset
825 gaim_prefs_add_bool("/plugins/gtk/X11/notify/type_focused", FALSE);
6302
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
826 gaim_prefs_add_bool("/plugins/gtk/X11/notify/method_string", FALSE);
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
827 gaim_prefs_add_string("/plugins/gtk/X11/notify/title_string", "(*)");
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
828 gaim_prefs_add_bool("/plugins/gtk/X11/notify/method_urgent", FALSE);
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
829 gaim_prefs_add_bool("/plugins/gtk/X11/notify/method_count", FALSE);
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
830 gaim_prefs_add_bool("/plugins/gtk/X11/notify/notify_focus", FALSE);
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
831 gaim_prefs_add_bool("/plugins/gtk/X11/notify/notify_click", FALSE);
511003c99302 [gaim-migrate @ 6801]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
832 gaim_prefs_add_bool("/plugins/gtk/X11/notify/notify_type", TRUE);
6464
059649ed25ed [gaim-migrate @ 6973]
Mark Doliner <mark@kingant.net>
parents: 6371
diff changeset
833 gaim_prefs_add_bool("/plugins/gtk/X11/notify/notify_send", TRUE);
059649ed25ed [gaim-migrate @ 6973]
Mark Doliner <mark@kingant.net>
parents: 6371
diff changeset
834 gaim_prefs_add_bool("/plugins/gtk/X11/notify/notify_switch", TRUE);
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5021
diff changeset
835 }
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5021
diff changeset
836
6063
5239a3b4ab33 [gaim-migrate @ 6513]
Nathan Walp <nwalp@pidgin.im>
parents: 5920
diff changeset
837 GAIM_INIT_PLUGIN(notify, init_plugin, info)