Sat, 03 Feb 2007 19:08:27 +0000
More pidgin changes
| 6302 | 1 | /* |
| 2 | * Gaim buddy notification plugin. | |
| 3 | * | |
| 4 | * Copyright (C) 2000-2001, Eric Warmenhoven (original code) | |
| 5 | * Copyright (C) 2002, Etan Reisner <deryni@eden.rutgers.edu> (rewritten code) | |
| 6 | * Copyright (C) 2003, Christian Hammond (update for changed API) | |
|
6322
35fdae8a156f
[gaim-migrate @ 6821]
Mark Doliner <markdoliner@pidgin.im>
parents:
6302
diff
changeset
|
7 | * Copyright (C) 2003, Brian Tarricone <bjt23@cornell.edu> (mostly rewritten) |
| 6302 | 8 | * Copyright (C) 2003, Mark Doliner (minor cleanup) |
| 6977 | 9 | * Copyright (C) 2003, Etan Reisner (largely rewritten again) |
| 6302 | 10 | * |
| 11 | * This program is free software; you can redistribute it and/or modify | |
| 12 | * it under the terms of the GNU General Public License as published by | |
| 13 | * the Free Software Foundation; either version 2 of the License, or | |
| 14 | * (at your option) any later version. | |
| 15 | * | |
| 16 | * This program is distributed in the hope that it will be useful, | |
| 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 19 | * GNU General Public License for more details. | |
| 3374 | 20 | * |
| 6302 | 21 | * You should have received a copy of the GNU General Public License |
| 22 | * along with this program; if not, write to the Free Software | |
| 23 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
| 24 | * | |
| 25 | */ | |
| 26 | ||
| 10606 | 27 | /* TODO |
| 28 | * 22:22:17 <seanegan> deryni: speaking of notify.c... you know what else | |
| 29 | * might be a neat feature? | |
| 30 | * 22:22:30 <seanegan> Changing the window icon. | |
| 31 | * 22:23:25 <deryni> seanegan: To what? | |
| 32 | * 22:23:42 <seanegan> deryni: I dunno. Flash it between the regular icon and | |
| 33 | * blank or something. | |
| 34 | * 22:23:53 <deryni> Also I think gaim might re-set that sort of frequently, | |
| 35 | * but I'd have to look. | |
| 11581 | 36 | * 22:25:16 <seanegan> deryni: I keep my conversations in one workspace and am |
| 10606 | 37 | * frequently in an another, and the icon flashing in the pager would be a |
| 38 | * neat visual clue. | |
| 39 | */ | |
| 40 | ||
| 6302 | 41 | /* |
| 42 | * From Etan, 2002: | |
| 43 | * -Added config dialog | |
| 44 | * -Added control over notification method | |
| 45 | * -Added control over when to release notification | |
| 46 | * | |
| 47 | * -Added option to get notification for chats also | |
| 48 | * -Cleaned up code | |
| 49 | * -Added option to notify on click as it's own option | |
| 50 | * rather then as what happens when on focus isn't clicked | |
| 51 | * -Added apply button to change the denotification methods for | |
| 52 | * open conversation windows | |
| 53 | * -Fixed apply to conversations, count now keeps count across applies | |
|
6485
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6464
diff
changeset
|
54 | * -Fixed(?) memory leak, and in the process fixed some stupidities |
| 6302 | 55 | * -Hit enter when done editing the title string entry box to save it |
| 3392 | 56 | * |
| 57 | * Thanks to Carles Pina i Estany <carles@pinux.info> | |
| 58 | * for count of new messages option | |
|
6485
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6464
diff
changeset
|
59 | * |
| 6302 | 60 | * From Brian, 20 July 2003: |
| 61 | * -Use new xml prefs | |
| 62 | * -Better handling of notification states tracking | |
| 63 | * -Better pref change handling | |
| 64 | * -Fixed a possible memleak and possible crash (rare) | |
| 65 | * -Use gtk_window_get_title() rather than gtkwin->title | |
| 66 | * -Other random fixes and cleanups | |
| 6977 | 67 | * |
| 9298 | 68 | * Etan again, 12 August 2003: |
| 6977 | 69 | * -Better use of the new xml prefs |
| 70 | * -Removed all bitmask stuff | |
| 71 | * -Even better pref change handling | |
| 72 | * -Removed unnecessary functions | |
| 73 | * -Reworking of notification/unnotification stuff | |
| 74 | * -Header file include cleanup | |
| 75 | * -General code cleanup | |
| 9298 | 76 | * |
| 77 | * Etan yet again, 04 April 2004: | |
| 78 | * -Re-added Urgent option | |
| 79 | * -Re-added unnotify on focus option (still needs work, as it will only | |
| 80 | * react to focus-in events when the entry or history widgets are focused) | |
| 10492 | 81 | * |
| 82 | * Sean, 08 January, 2005: | |
| 83 | * -Added Raise option, formally in Gaim proper | |
| 3392 | 84 | */ |
| 85 | ||
| 9791 | 86 | #include "internal.h" |
| 15577 | 87 | #include "pidgin.h" |
| 10492 | 88 | #include "gtkprefs.h" |
| 6302 | 89 | |
|
12604
893fbf89317c
[gaim-migrate @ 14939]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12600
diff
changeset
|
90 | #include "conversation.h" |
| 6302 | 91 | #include "prefs.h" |
|
6485
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6464
diff
changeset
|
92 | #include "signals.h" |
| 9943 | 93 | #include "version.h" |
| 11581 | 94 | #include "debug.h" |
|
4202
8b92de3b1c07
[gaim-migrate @ 4438]
Christian Hammond <chipx86@chipx86.com>
parents:
4165
diff
changeset
|
95 | |
| 6302 | 96 | #include "gtkplugin.h" |
| 97 | #include "gtkutils.h" | |
| 98 | ||
| 12959 | 99 | #ifndef _WIN32 |
| 6977 | 100 | #include <X11/Xatom.h> |
| 3385 | 101 | #include <X11/Xlib.h> |
| 3374 | 102 | #include <X11/Xutil.h> |
| 12959 | 103 | #endif |
| 3374 | 104 | |
| 6302 | 105 | #define NOTIFY_PLUGIN_ID "gtk-x11-notify" |
| 3710 | 106 | |
|
5436
a0e0bacaa196
[gaim-migrate @ 5818]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
107 | static GaimPlugin *my_plugin = NULL; |
| 15527 | 108 | #ifndef _WIN32 |
| 14389 | 109 | static GdkAtom _Cardinal = GDK_NONE; |
| 110 | static GdkAtom _GaimUnseenCount = GDK_NONE; | |
| 15527 | 111 | #endif |
|
5436
a0e0bacaa196
[gaim-migrate @ 5818]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
112 | |
| 6302 | 113 | /* notification set/unset */ |
| 14385 | 114 | static int notify(GaimConversation *conv, gboolean increment); |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15527
diff
changeset
|
115 | static void notify_win(PidginWindow *gaimwin); |
| 9298 | 116 | static void unnotify(GaimConversation *conv, gboolean reset); |
| 14389 | 117 | static int unnotify_cb(GtkWidget *widget, gpointer data, |
| 118 | GaimConversation *conv); | |
| 6302 | 119 | |
| 120 | /* gtk widget callbacks for prefs panel */ | |
| 6977 | 121 | static void type_toggle_cb(GtkWidget *widget, gpointer data); |
| 122 | static void method_toggle_cb(GtkWidget *widget, gpointer data); | |
| 123 | static void notify_toggle_cb(GtkWidget *widget, gpointer data); | |
| 14389 | 124 | static gboolean options_entry_cb(GtkWidget *widget, GdkEventFocus *event, |
| 125 | gpointer data); | |
|
12397
aa64ec827fdf
[gaim-migrate @ 14704]
Richard Laager <rlaager@pidgin.im>
parents:
12286
diff
changeset
|
126 | static void apply_method(void); |
|
aa64ec827fdf
[gaim-migrate @ 14704]
Richard Laager <rlaager@pidgin.im>
parents:
12286
diff
changeset
|
127 | static void apply_notify(void); |
| 191 | 128 | |
| 6977 | 129 | /* string function */ |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15527
diff
changeset
|
130 | static void handle_string(PidginWindow *gaimwin); |
| 6302 | 131 | |
| 14389 | 132 | /* count_title function */ |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15527
diff
changeset
|
133 | static void handle_count_title(PidginWindow *gaimwin); |
| 14389 | 134 | |
| 135 | /* count_xprop function */ | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15527
diff
changeset
|
136 | static void handle_count_xprop(PidginWindow *gaimwin); |
| 6302 | 137 | |
| 6977 | 138 | /* urgent function */ |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15527
diff
changeset
|
139 | static void handle_urgent(PidginWindow *gaimwin, gboolean set); |
| 10606 | 140 | |
| 141 | /* raise function */ | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15527
diff
changeset
|
142 | static void handle_raise(PidginWindow *gaimwin); |
| 3710 | 143 | |
| 6302 | 144 | /****************************************/ |
| 145 | /* Begin doing stuff below this line... */ | |
| 146 | /****************************************/ | |
| 14389 | 147 | static guint |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15527
diff
changeset
|
148 | count_messages(PidginWindow *gaimwin) |
| 9298 | 149 | { |
| 14389 | 150 | guint count = 0; |
| 14385 | 151 | GList *convs = NULL, *l; |
| 9298 | 152 | |
| 14385 | 153 | for (convs = gaimwin->gtkconvs; convs != NULL; convs = convs->next) { |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15527
diff
changeset
|
154 | PidginConversation *conv = convs->data; |
| 14385 | 155 | for (l = conv->convs; l != NULL; l = l->next) { |
| 156 | count += GPOINTER_TO_INT(gaim_conversation_get_data(l->data, "notify-message-count")); | |
| 157 | } | |
| 9298 | 158 | } |
| 159 | ||
| 160 | return count; | |
| 161 | } | |
| 6302 | 162 | |
| 6977 | 163 | static int |
| 14385 | 164 | notify(GaimConversation *conv, gboolean increment) |
| 6977 | 165 | { |
| 14385 | 166 | gint count; |
| 14326 | 167 | gboolean has_focus; |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15527
diff
changeset
|
168 | PidginWindow *gaimwin = NULL; |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4218
diff
changeset
|
169 | |
| 6977 | 170 | if (conv == NULL) |
| 6302 | 171 | return 0; |
| 172 | ||
| 6977 | 173 | /* We want to remove the notifications, but not reset the counter */ |
| 174 | unnotify(conv, FALSE); | |
| 175 | ||
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15527
diff
changeset
|
176 | gaimwin = PIDGIN_CONVERSATION(conv)->win; |
| 5021 | 177 | |
| 6977 | 178 | /* If we aren't doing notifications for this type of conversation, return */ |
|
11338
1a3663ac9b05
[gaim-migrate @ 13551]
Mark Doliner <markdoliner@pidgin.im>
parents:
10984
diff
changeset
|
179 | if (((gaim_conversation_get_type(conv) == GAIM_CONV_TYPE_IM) && |
| 9298 | 180 | !gaim_prefs_get_bool("/plugins/gtk/X11/notify/type_im")) || |
|
11338
1a3663ac9b05
[gaim-migrate @ 13551]
Mark Doliner <markdoliner@pidgin.im>
parents:
10984
diff
changeset
|
181 | ((gaim_conversation_get_type(conv) == GAIM_CONV_TYPE_CHAT) && |
| 9298 | 182 | !gaim_prefs_get_bool("/plugins/gtk/X11/notify/type_chat"))) |
| 6977 | 183 | return 0; |
| 4203 | 184 | |
| 11581 | 185 | g_object_get(G_OBJECT(gaimwin->window), |
| 9298 | 186 | "has-toplevel-focus", &has_focus, NULL); |
| 3374 | 187 | |
| 6977 | 188 | if (gaim_prefs_get_bool("/plugins/gtk/X11/notify/type_focused") || |
|
10984
8d8c654bf34d
[gaim-migrate @ 12819]
Mark Doliner <markdoliner@pidgin.im>
parents:
10971
diff
changeset
|
189 | !has_focus) { |
| 14385 | 190 | if (increment) { |
| 191 | count = GPOINTER_TO_INT(gaim_conversation_get_data(conv, "notify-message-count")); | |
| 192 | count++; | |
| 193 | gaim_conversation_set_data(conv, "notify-message-count", GINT_TO_POINTER(count)); | |
| 194 | } | |
| 195 | ||
| 9298 | 196 | notify_win(gaimwin); |
| 6977 | 197 | } |
| 6302 | 198 | |
| 199 | return 0; | |
| 200 | } | |
| 201 | ||
| 9298 | 202 | static void |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15527
diff
changeset
|
203 | notify_win(PidginWindow *gaimwin) |
| 9298 | 204 | { |
|
10971
4c823ffab27a
[gaim-migrate @ 12796]
Mark Doliner <markdoliner@pidgin.im>
parents:
10841
diff
changeset
|
205 | if (count_messages(gaimwin) <= 0) |
|
4c823ffab27a
[gaim-migrate @ 12796]
Mark Doliner <markdoliner@pidgin.im>
parents:
10841
diff
changeset
|
206 | return; |
|
4c823ffab27a
[gaim-migrate @ 12796]
Mark Doliner <markdoliner@pidgin.im>
parents:
10841
diff
changeset
|
207 | |
| 9298 | 208 | if (gaim_prefs_get_bool("/plugins/gtk/X11/notify/method_count")) |
| 14389 | 209 | handle_count_title(gaimwin); |
| 210 | if (gaim_prefs_get_bool("/plugins/gtk/X11/notify/method_count_xprop")) | |
| 211 | handle_count_xprop(gaimwin); | |
| 9298 | 212 | if (gaim_prefs_get_bool("/plugins/gtk/X11/notify/method_string")) |
| 213 | handle_string(gaimwin); | |
| 214 | if (gaim_prefs_get_bool("/plugins/gtk/X11/notify/method_urgent")) | |
| 215 | handle_urgent(gaimwin, TRUE); | |
| 10492 | 216 | if (gaim_prefs_get_bool("/plugins/gtk/X11/notify/method_raise")) |
| 217 | handle_raise(gaimwin); | |
| 9298 | 218 | } |
| 219 | ||
| 220 | static void | |
| 221 | unnotify(GaimConversation *conv, gboolean reset) | |
| 222 | { | |
| 223 | GaimConversation *active_conv = NULL; | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15527
diff
changeset
|
224 | PidginWindow *gaimwin = NULL; |
| 9298 | 225 | |
| 226 | g_return_if_fail(conv != NULL); | |
| 227 | ||
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15527
diff
changeset
|
228 | gaimwin = PIDGIN_CONVERSATION(conv)->win; |
|
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15527
diff
changeset
|
229 | active_conv = pidgin_conv_window_get_active_conversation(gaimwin); |
| 9298 | 230 | |
| 231 | /* reset the conversation window title */ | |
| 232 | gaim_conversation_autoset_title(active_conv); | |
| 233 | ||
| 234 | if (reset) { | |
| 14389 | 235 | /* Only need to actually remove the urgent hinting here, since |
| 236 | * removing it just to have it readded in re-notify is an | |
| 237 | * unnecessary couple extra RTs to the server */ | |
| 9298 | 238 | handle_urgent(gaimwin, FALSE); |
| 14385 | 239 | gaim_conversation_set_data(conv, "notify-message-count", GINT_TO_POINTER(0)); |
| 14389 | 240 | /* Same logic as for the urgent hint, xprops are also a RT. |
| 241 | * This needs to go here so that it gets the updated message | |
| 242 | * count. */ | |
| 243 | handle_count_xprop(gaimwin); | |
| 9298 | 244 | } |
| 245 | ||
| 246 | return; | |
| 247 | } | |
| 248 | ||
| 249 | static int | |
| 250 | unnotify_cb(GtkWidget *widget, gpointer data, GaimConversation *conv) | |
| 251 | { | |
| 14385 | 252 | if (GPOINTER_TO_INT(gaim_conversation_get_data(conv, "notify-message-count")) != 0) |
| 9298 | 253 | unnotify(conv, TRUE); |
| 254 | ||
| 255 | return 0; | |
| 256 | } | |
| 257 | ||
|
6485
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6464
diff
changeset
|
258 | static gboolean |
|
13234
1d8e569b2053
[gaim-migrate @ 15598]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12968
diff
changeset
|
259 | message_displayed_cb(GaimAccount *account, const char *who, char *message, |
| 14389 | 260 | GaimConversation *conv, GaimMessageFlags flags) |
| 6977 | 261 | { |
|
13237
9556cdf38196
[gaim-migrate @ 15602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13234
diff
changeset
|
262 | if ((gaim_conversation_get_type(conv) == GAIM_CONV_TYPE_CHAT && |
|
9556cdf38196
[gaim-migrate @ 15602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13234
diff
changeset
|
263 | gaim_prefs_get_bool("/plugins/gtk/X11/notify/type_chat_nick") && |
|
9556cdf38196
[gaim-migrate @ 15602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13234
diff
changeset
|
264 | !(flags & GAIM_MESSAGE_NICK))) |
|
9556cdf38196
[gaim-migrate @ 15602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13234
diff
changeset
|
265 | return FALSE; |
|
9556cdf38196
[gaim-migrate @ 15602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13234
diff
changeset
|
266 | |
|
12604
893fbf89317c
[gaim-migrate @ 14939]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12600
diff
changeset
|
267 | if ((flags & GAIM_MESSAGE_RECV) && !(flags & GAIM_MESSAGE_DELAYED)) |
| 14385 | 268 | notify(conv, TRUE); |
| 9298 | 269 | |
| 270 | return FALSE; | |
| 271 | } | |
| 272 | ||
| 6977 | 273 | static void |
| 14389 | 274 | im_sent_im(GaimAccount *account, const char *receiver, const char *message) |
| 275 | { | |
| 9298 | 276 | GaimConversation *conv = NULL; |
| 277 | ||
| 278 | if (gaim_prefs_get_bool("/plugins/gtk/X11/notify/notify_send")) { | |
|
11338
1a3663ac9b05
[gaim-migrate @ 13551]
Mark Doliner <markdoliner@pidgin.im>
parents:
10984
diff
changeset
|
279 | conv = gaim_find_conversation_with_account(GAIM_CONV_TYPE_IM, receiver, account); |
| 9298 | 280 | unnotify(conv, TRUE); |
| 281 | } | |
| 282 | } | |
| 283 | ||
| 284 | static void | |
| 285 | chat_sent_im(GaimAccount *account, const char *message, int id) | |
| 6977 | 286 | { |
| 287 | GaimConversation *conv = NULL; | |
| 288 | ||
| 289 | if (gaim_prefs_get_bool("/plugins/gtk/X11/notify/notify_send")) { | |
| 290 | conv = gaim_find_chat(gaim_account_get_connection(account), id); | |
| 291 | unnotify(conv, TRUE); | |
| 292 | } | |
| 3710 | 293 | } |
| 294 | ||
| 6977 | 295 | static int |
| 296 | attach_signals(GaimConversation *conv) | |
| 297 | { | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15527
diff
changeset
|
298 | PidginConversation *gtkconv = NULL; |
|
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15527
diff
changeset
|
299 | PidginWindow *gtkwin = NULL; |
| 11728 | 300 | GSList *imhtml_ids = NULL, *entry_ids = NULL; |
| 6977 | 301 | guint id; |
| 302 | ||
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15527
diff
changeset
|
303 | gtkconv = PIDGIN_CONVERSATION(conv); |
| 11581 | 304 | if (!gtkconv) { |
| 305 | gaim_debug_misc("notify", "Failed to find gtkconv\n"); | |
| 306 | return 0; | |
| 307 | } | |
| 308 | ||
| 309 | gtkwin = gtkconv->win; | |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4218
diff
changeset
|
310 | |
| 6977 | 311 | if (gaim_prefs_get_bool("/plugins/gtk/X11/notify/notify_focus")) { |
| 14389 | 312 | /* TODO should really find a way to make this work no matter |
| 313 | * where the focus is inside the conv window, without having | |
| 314 | * to bind to focus-in-event on the g(d|t)kwindow */ | |
| 9298 | 315 | /* try setting the signal on the focus-in-event for |
| 316 | * gtkwin->notebook->container? */ | |
| 317 | id = g_signal_connect(G_OBJECT(gtkconv->entry), "focus-in-event", | |
| 318 | G_CALLBACK(unnotify_cb), conv); | |
| 11728 | 319 | entry_ids = g_slist_append(entry_ids, GUINT_TO_POINTER(id)); |
| 9298 | 320 | |
| 321 | id = g_signal_connect(G_OBJECT(gtkconv->imhtml), "focus-in-event", | |
| 322 | G_CALLBACK(unnotify_cb), conv); | |
| 11728 | 323 | imhtml_ids = g_slist_append(imhtml_ids, GUINT_TO_POINTER(id)); |
| 6977 | 324 | } |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4218
diff
changeset
|
325 | |
| 6977 | 326 | if (gaim_prefs_get_bool("/plugins/gtk/X11/notify/notify_click")) { |
| 14389 | 327 | /* TODO similarly should really find a way to allow for |
| 328 | * clicking in other places of the window */ | |
| 9298 | 329 | id = g_signal_connect(G_OBJECT(gtkconv->entry), "button-press-event", |
| 330 | G_CALLBACK(unnotify_cb), conv); | |
| 6977 | 331 | entry_ids = g_slist_append(entry_ids, GUINT_TO_POINTER(id)); |
| 12286 | 332 | |
| 333 | id = g_signal_connect(G_OBJECT(gtkconv->imhtml), "button-press-event", | |
| 334 | G_CALLBACK(unnotify_cb), conv); | |
| 335 | imhtml_ids = g_slist_append(imhtml_ids, GUINT_TO_POINTER(id)); | |
| 3374 | 336 | } |
| 3710 | 337 | |
| 6977 | 338 | if (gaim_prefs_get_bool("/plugins/gtk/X11/notify/notify_type")) { |
| 9298 | 339 | id = g_signal_connect(G_OBJECT(gtkconv->entry), "key-press-event", |
| 340 | G_CALLBACK(unnotify_cb), conv); | |
| 6977 | 341 | entry_ids = g_slist_append(entry_ids, GUINT_TO_POINTER(id)); |
| 3374 | 342 | } |
| 343 | ||
| 6977 | 344 | gaim_conversation_set_data(conv, "notify-imhtml-signals", imhtml_ids); |
| 345 | gaim_conversation_set_data(conv, "notify-entry-signals", entry_ids); | |
| 4035 | 346 | |
| 3428 | 347 | return 0; |
| 191 | 348 | } |
| 349 | ||
| 6977 | 350 | static void |
| 351 | detach_signals(GaimConversation *conv) | |
| 352 | { | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15527
diff
changeset
|
353 | PidginConversation *gtkconv = NULL; |
|
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15527
diff
changeset
|
354 | PidginWindow *gtkwin = NULL; |
| 11606 | 355 | GSList *ids = NULL, *l; |
|
6485
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6464
diff
changeset
|
356 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15527
diff
changeset
|
357 | gtkconv = PIDGIN_CONVERSATION(conv); |
| 11581 | 358 | if (!gtkconv) |
| 359 | return; | |
| 360 | gtkwin = gtkconv->win; | |
| 4203 | 361 | |
| 6977 | 362 | ids = gaim_conversation_get_data(conv, "notify-imhtml-signals"); |
| 11606 | 363 | for (l = ids; l != NULL; l = l->next) |
| 364 | g_signal_handler_disconnect(gtkconv->imhtml, GPOINTER_TO_INT(l->data)); | |
| 365 | g_slist_free(ids); | |
| 6302 | 366 | |
| 6977 | 367 | ids = gaim_conversation_get_data(conv, "notify-entry-signals"); |
| 11606 | 368 | for (l = ids; l != NULL; l = l->next) |
| 369 | g_signal_handler_disconnect(gtkconv->entry, GPOINTER_TO_INT(l->data)); | |
| 370 | g_slist_free(ids); | |
| 3710 | 371 | |
| 14385 | 372 | gaim_conversation_set_data(conv, "notify-message-count", GINT_TO_POINTER(0)); |
| 373 | ||
| 6977 | 374 | gaim_conversation_set_data(conv, "notify-imhtml-signals", NULL); |
| 375 | gaim_conversation_set_data(conv, "notify-entry-signals", NULL); | |
| 3710 | 376 | } |
| 377 | ||
| 6977 | 378 | static void |
| 379 | conv_created(GaimConversation *conv) | |
| 380 | { | |
| 14389 | 381 | gaim_conversation_set_data(conv, "notify-message-count", |
| 382 | GINT_TO_POINTER(0)); | |
| 14385 | 383 | |
| 14389 | 384 | /* always attach the signals, notify() will take care of conversation |
| 385 | * type checking */ | |
| 6977 | 386 | attach_signals(conv); |
| 3374 | 387 | } |
| 388 | ||
| 6977 | 389 | static void |
| 12968 | 390 | conv_switched(GaimConversation *conv) |
| 6977 | 391 | { |
|
10971
4c823ffab27a
[gaim-migrate @ 12796]
Mark Doliner <markdoliner@pidgin.im>
parents:
10841
diff
changeset
|
392 | #if 0 |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15527
diff
changeset
|
393 | PidginWindow *gaimwin = gaim_conversation_get_window(new_conv); |
|
10971
4c823ffab27a
[gaim-migrate @ 12796]
Mark Doliner <markdoliner@pidgin.im>
parents:
10841
diff
changeset
|
394 | #endif |
| 6302 | 395 | |
|
10971
4c823ffab27a
[gaim-migrate @ 12796]
Mark Doliner <markdoliner@pidgin.im>
parents:
10841
diff
changeset
|
396 | /* |
|
4c823ffab27a
[gaim-migrate @ 12796]
Mark Doliner <markdoliner@pidgin.im>
parents:
10841
diff
changeset
|
397 | * If the conversation was switched, then make sure we re-notify |
|
4c823ffab27a
[gaim-migrate @ 12796]
Mark Doliner <markdoliner@pidgin.im>
parents:
10841
diff
changeset
|
398 | * because Gaim will have overwritten our custom window title. |
|
4c823ffab27a
[gaim-migrate @ 12796]
Mark Doliner <markdoliner@pidgin.im>
parents:
10841
diff
changeset
|
399 | */ |
| 14385 | 400 | notify(conv, FALSE); |
|
10971
4c823ffab27a
[gaim-migrate @ 12796]
Mark Doliner <markdoliner@pidgin.im>
parents:
10841
diff
changeset
|
401 | |
|
4c823ffab27a
[gaim-migrate @ 12796]
Mark Doliner <markdoliner@pidgin.im>
parents:
10841
diff
changeset
|
402 | #if 0 |
| 9298 | 403 | printf("conv_switched - %p - %p\n", old_conv, new_conv); |
| 404 | printf("count - %d\n", count_messages(gaimwin)); | |
| 405 | if (gaim_prefs_get_bool("/plugins/gtk/X11/notify/notify_switch")) | |
| 406 | unnotify(new_conv, FALSE); | |
| 407 | else { | |
| 408 | /* if we don't have notification on the window then we don't want to | |
| 409 | * re-notify it */ | |
| 410 | if (count_messages(gaimwin)) | |
| 411 | notify_win(gaimwin); | |
| 412 | } | |
|
10971
4c823ffab27a
[gaim-migrate @ 12796]
Mark Doliner <markdoliner@pidgin.im>
parents:
10841
diff
changeset
|
413 | #endif |
| 6977 | 414 | } |
| 6302 | 415 | |
| 6977 | 416 | static void |
| 417 | deleting_conv(GaimConversation *conv) | |
| 418 | { | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15527
diff
changeset
|
419 | PidginWindow *gaimwin = NULL; |
| 9298 | 420 | |
| 6977 | 421 | detach_signals(conv); |
| 3392 | 422 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15527
diff
changeset
|
423 | gaimwin = PIDGIN_CONVERSATION(conv)->win; |
| 11606 | 424 | |
| 425 | handle_urgent(gaimwin, FALSE); | |
| 14385 | 426 | gaim_conversation_set_data(conv, "notify-message-count", GINT_TO_POINTER(0)); |
| 11606 | 427 | |
| 428 | return; | |
| 429 | ||
| 11581 | 430 | #if 0 |
| 431 | /* i think this line crashes */ | |
| 9298 | 432 | if (count_messages(gaimwin)) |
| 433 | notify_win(gaimwin); | |
| 11581 | 434 | #endif |
| 6977 | 435 | } |
| 436 | ||
|
9303
e257ad08c77c
[gaim-migrate @ 10107]
Mark Doliner <markdoliner@pidgin.im>
parents:
9298
diff
changeset
|
437 | #if 0 |
| 6977 | 438 | static void |
|
11447
23594a754163
[gaim-migrate @ 13686]
Daniel Atallah <datallah@pidgin.im>
parents:
11338
diff
changeset
|
439 | conversation_dragging(GaimConversation *active_conv, |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15527
diff
changeset
|
440 | PidginWindow *old_gaimwin, |
|
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15527
diff
changeset
|
441 | PidginWindow *new_gaimwin) |
| 6977 | 442 | { |
| 9298 | 443 | if (old_gaimwin != new_gaimwin) { |
| 444 | if (old_gaimwin == NULL) { | |
| 445 | /* | |
| 446 | gaim_conversation_autoset_title(active_conv); | |
| 447 | handle_urgent(new_gaimwin, FALSE); | |
| 448 | */ | |
| 449 | ||
| 450 | if (count_messages(new_gaimwin)) | |
| 451 | notify_win(new_gaimwin); | |
| 452 | } else { | |
| 453 | printf("if else count = %d\n", count_messages(new_gaimwin)); | |
| 454 | printf("if else count = %d\n", count_messages(old_gaimwin)); | |
| 455 | /* | |
| 456 | GaimConversation *old_active_conv = NULL; | |
| 457 | old_active_conv = gaim_conv_window_get_active_conversation(new_gaimwin); | |
| 458 | ||
| 459 | gaim_conversation_autoset_title(old_active_conv); | |
| 460 | handle_urgent(old_gaimwin, FALSE); | |
| 6302 | 461 | |
| 9298 | 462 | if (count_messages(old_gaimwin)) |
| 463 | notify_win(old_gaimwin); | |
| 464 | ||
| 465 | gaim_conversation_autoset_title(active_conv); | |
| 466 | handle_urgent(new_gaimwin, FALSE); | |
| 467 | ||
| 468 | if (count_messages(new_gaimwin)) | |
| 469 | notify_win(new_gaimwin); | |
| 470 | */ | |
| 471 | } | |
| 472 | } else { | |
| 473 | printf("else count = %d\n", count_messages(new_gaimwin)); | |
| 474 | printf("else count = %d\n", count_messages(old_gaimwin)); | |
| 475 | /* | |
| 476 | gaim_conversation_autoset_title(active_conv); | |
| 477 | handle_urgent(old_gaimwin, FALSE); | |
| 478 | ||
| 479 | if (count_messages(old_gaimwin)) | |
| 480 | notify_win(old_gaimwin); | |
| 481 | */ | |
| 482 | } | |
| 4035 | 483 | } |
|
9303
e257ad08c77c
[gaim-migrate @ 10107]
Mark Doliner <markdoliner@pidgin.im>
parents:
9298
diff
changeset
|
484 | #endif |
| 4035 | 485 | |
| 6977 | 486 | static void |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15527
diff
changeset
|
487 | handle_string(PidginWindow *gaimwin) |
| 9298 | 488 | { |
| 489 | GtkWindow *window = NULL; | |
| 490 | gchar newtitle[256]; | |
| 491 | ||
| 492 | g_return_if_fail(gaimwin != NULL); | |
| 493 | ||
| 11581 | 494 | window = GTK_WINDOW(gaimwin->window); |
| 9298 | 495 | g_return_if_fail(window != NULL); |
| 496 | ||
| 497 | g_snprintf(newtitle, sizeof(newtitle), "%s%s", | |
| 498 | gaim_prefs_get_string("/plugins/gtk/X11/notify/title_string"), | |
| 499 | gtk_window_get_title(window)); | |
| 500 | gtk_window_set_title(window, newtitle); | |
| 501 | } | |
| 502 | ||
| 503 | static void | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15527
diff
changeset
|
504 | handle_count_title(PidginWindow *gaimwin) |
| 9298 | 505 | { |
| 506 | GtkWindow *window; | |
| 507 | char newtitle[256]; | |
| 508 | ||
| 509 | g_return_if_fail(gaimwin != NULL); | |
| 510 | ||
| 11581 | 511 | window = GTK_WINDOW(gaimwin->window); |
| 9298 | 512 | g_return_if_fail(window != NULL); |
| 513 | ||
| 10606 | 514 | g_snprintf(newtitle, sizeof(newtitle), "[%d] %s", |
| 515 | count_messages(gaimwin), gtk_window_get_title(window)); | |
| 9298 | 516 | gtk_window_set_title(window, newtitle); |
| 517 | } | |
| 518 | ||
| 519 | static void | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15527
diff
changeset
|
520 | handle_count_xprop(PidginWindow *gaimwin) |
| 14389 | 521 | { |
| 522 | #ifndef _WIN32 | |
| 523 | guint count; | |
| 524 | GtkWidget *window; | |
| 525 | GdkWindow *gdkwin; | |
| 526 | ||
| 527 | window = gaimwin->window; | |
| 528 | g_return_if_fail(window != NULL); | |
| 529 | ||
| 530 | if (_GaimUnseenCount == GDK_NONE) { | |
|
15566
ce486027d329
GAIM_UNSEEN to PIDGIN_UNSEEN
Sean Egan <seanegan@pidgin.im>
parents:
15562
diff
changeset
|
531 | _GaimUnseenCount = gdk_atom_intern("_PIDGIN_UNSEEN_COUNT", FALSE); |
| 14389 | 532 | } |
| 533 | ||
| 534 | if (_Cardinal == GDK_NONE) { | |
| 535 | _Cardinal = gdk_atom_intern("CARDINAL", FALSE); | |
| 536 | } | |
| 537 | ||
| 538 | count = count_messages(gaimwin); | |
| 539 | gdkwin = window->window; | |
| 540 | ||
| 541 | gdk_property_change(gdkwin, _GaimUnseenCount, _Cardinal, 32, | |
| 542 | GDK_PROP_MODE_REPLACE, (guchar *) &count, 1); | |
| 543 | #endif | |
| 544 | } | |
| 545 | ||
| 546 | static void | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15527
diff
changeset
|
547 | handle_urgent(PidginWindow *win, gboolean set) |
| 6977 | 548 | { |
| 12959 | 549 | #ifndef _WIN32 |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15527
diff
changeset
|
550 | pidgin_set_urgent(GTK_WINDOW(win->window), set); |
| 12959 | 551 | #endif |
| 4035 | 552 | } |
| 553 | ||
| 6977 | 554 | static void |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15527
diff
changeset
|
555 | handle_raise(PidginWindow *gaimwin) |
| 10606 | 556 | { |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15527
diff
changeset
|
557 | pidgin_conv_window_raise(gaimwin); |
| 10606 | 558 | } |
| 559 | ||
| 560 | static void | |
| 6977 | 561 | type_toggle_cb(GtkWidget *widget, gpointer data) |
| 562 | { | |
| 563 | gboolean on = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)); | |
| 564 | gchar pref[256]; | |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4218
diff
changeset
|
565 | |
| 14389 | 566 | g_snprintf(pref, sizeof(pref), "/plugins/gtk/X11/notify/%s", |
| 567 | (char *)data); | |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4218
diff
changeset
|
568 | |
| 6977 | 569 | gaim_prefs_set_bool(pref, on); |
| 3374 | 570 | } |
| 571 | ||
| 6977 | 572 | static void |
| 573 | method_toggle_cb(GtkWidget *widget, gpointer data) | |
| 574 | { | |
| 575 | gboolean on = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)); | |
| 576 | gchar pref[256]; | |
| 577 | ||
| 14389 | 578 | g_snprintf(pref, sizeof(pref), "/plugins/gtk/X11/notify/%s", |
| 579 | (char *)data); | |
| 3374 | 580 | |
| 6977 | 581 | gaim_prefs_set_bool(pref, on); |
| 582 | ||
| 583 | if (!strcmp(data, "method_string")) { | |
| 584 | GtkWidget *entry = g_object_get_data(G_OBJECT(widget), "title-entry"); | |
| 585 | gtk_widget_set_sensitive(entry, on); | |
| 586 | ||
| 14448 | 587 | gaim_prefs_set_string("/plugins/gtk/X11/notify/title_string", |
| 588 | gtk_entry_get_text(GTK_ENTRY(entry))); | |
| 6977 | 589 | } |
| 590 | ||
| 591 | apply_method(); | |
| 3374 | 592 | } |
| 593 | ||
| 6977 | 594 | static void |
| 595 | notify_toggle_cb(GtkWidget *widget, gpointer data) | |
| 596 | { | |
| 597 | gboolean on = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)); | |
| 598 | gchar pref[256]; | |
|
6485
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6464
diff
changeset
|
599 | |
| 14389 | 600 | g_snprintf(pref, sizeof(pref), "/plugins/gtk/X11/notify/%s", |
| 601 | (char *)data); | |
| 3374 | 602 | |
| 6977 | 603 | gaim_prefs_set_bool(pref, on); |
| 604 | ||
| 605 | apply_notify(); | |
| 3374 | 606 | } |
| 607 | ||
| 6977 | 608 | static gboolean |
| 609 | options_entry_cb(GtkWidget *widget, GdkEventFocus *evt, gpointer data) | |
| 610 | { | |
| 611 | if (data == NULL) | |
|
6982
12f08de92674
[gaim-migrate @ 7538]
Mark Doliner <markdoliner@pidgin.im>
parents:
6977
diff
changeset
|
612 | return FALSE; |
| 6302 | 613 | |
| 6977 | 614 | if (!strcmp(data, "method_string")) { |
| 14389 | 615 | gaim_prefs_set_string("/plugins/gtk/X11/notify/title_string", |
| 616 | gtk_entry_get_text(GTK_ENTRY(widget))); | |
| 3374 | 617 | } |
| 6302 | 618 | |
| 6977 | 619 | apply_method(); |
| 6302 | 620 | |
| 621 | return FALSE; | |
| 622 | } | |
| 623 | ||
| 6977 | 624 | static void |
| 14389 | 625 | apply_method() |
| 626 | { | |
|
13664
fdc3b588f248
[gaim-migrate @ 16065]
Richard Laager <rlaager@pidgin.im>
parents:
13550
diff
changeset
|
627 | GList *convs; |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15527
diff
changeset
|
628 | PidginWindow *gaimwin = NULL; |
| 6977 | 629 | |
| 14389 | 630 | for (convs = gaim_get_conversations(); convs != NULL; |
| 631 | convs = convs->next) { | |
| 14385 | 632 | GaimConversation *conv = (GaimConversation *)convs->data; |
| 6302 | 633 | |
| 6977 | 634 | /* remove notifications */ |
| 9298 | 635 | unnotify(conv, FALSE); |
| 636 | ||
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15527
diff
changeset
|
637 | gaimwin = PIDGIN_CONVERSATION(conv)->win; |
| 14385 | 638 | if (GPOINTER_TO_INT(gaim_conversation_get_data(conv, "notify-message-count")) != 0) |
| 6977 | 639 | /* reattach appropriate notifications */ |
| 14385 | 640 | notify(conv, FALSE); |
| 6977 | 641 | } |
| 3374 | 642 | } |
| 643 | ||
| 6977 | 644 | static void |
| 645 | apply_notify() | |
| 646 | { | |
| 647 | GList *convs = gaim_get_conversations(); | |
|
6485
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6464
diff
changeset
|
648 | |
| 6977 | 649 | while (convs) { |
| 650 | GaimConversation *conv = (GaimConversation *)convs->data; | |
| 4203 | 651 | |
| 6977 | 652 | /* detach signals */ |
| 653 | detach_signals(conv); | |
| 654 | /* reattach appropriate signals */ | |
| 655 | attach_signals(conv); | |
| 4035 | 656 | |
| 6977 | 657 | convs = convs->next; |
| 4035 | 658 | } |
| 659 | } | |
| 660 | ||
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
661 | static GtkWidget * |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
662 | get_config_frame(GaimPlugin *plugin) |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
663 | { |
| 6977 | 664 | GtkWidget *ret = NULL, *frame = NULL; |
| 665 | GtkWidget *vbox = NULL, *hbox = NULL; | |
|
13237
9556cdf38196
[gaim-migrate @ 15602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13234
diff
changeset
|
666 | GtkWidget *toggle = NULL, *entry = NULL, *ref; |
| 6302 | 667 | |
| 3565 | 668 | ret = gtk_vbox_new(FALSE, 18); |
| 6302 | 669 | gtk_container_set_border_width(GTK_CONTAINER (ret), 12); |
| 3392 | 670 | |
| 6302 | 671 | /*---------- "Notify For" ----------*/ |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15527
diff
changeset
|
672 | frame = pidgin_make_frame(ret, _("Notify For")); |
| 6302 | 673 | vbox = gtk_vbox_new(FALSE, 5); |
| 674 | gtk_container_add(GTK_CONTAINER(frame), vbox); | |
| 675 | ||
| 3710 | 676 | toggle = gtk_check_button_new_with_mnemonic(_("_IM windows")); |
| 677 | gtk_box_pack_start(GTK_BOX(vbox), toggle, FALSE, FALSE, 0); | |
| 6977 | 678 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toggle), |
| 9298 | 679 | gaim_prefs_get_bool("/plugins/gtk/X11/notify/type_im")); |
| 6977 | 680 | g_signal_connect(G_OBJECT(toggle), "toggled", |
| 9298 | 681 | G_CALLBACK(type_toggle_cb), "type_im"); |
| 3710 | 682 | |
| 6977 | 683 | toggle = gtk_check_button_new_with_mnemonic(_("C_hat windows")); |
| 3710 | 684 | gtk_box_pack_start(GTK_BOX(vbox), toggle, FALSE, FALSE, 0); |
| 6977 | 685 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toggle), |
| 9298 | 686 | gaim_prefs_get_bool("/plugins/gtk/X11/notify/type_chat")); |
| 6977 | 687 | g_signal_connect(G_OBJECT(toggle), "toggled", |
| 9298 | 688 | G_CALLBACK(type_toggle_cb), "type_chat"); |
| 6977 | 689 | |
|
13237
9556cdf38196
[gaim-migrate @ 15602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13234
diff
changeset
|
690 | ref = toggle; |
|
13550
55c77cece2d0
[gaim-migrate @ 15926]
Richard Laager <rlaager@pidgin.im>
parents:
13237
diff
changeset
|
691 | toggle = gtk_check_button_new_with_mnemonic(_("\t_Only when someone says your screen name")); |
|
13237
9556cdf38196
[gaim-migrate @ 15602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13234
diff
changeset
|
692 | gtk_box_pack_start(GTK_BOX(vbox), toggle, FALSE, FALSE, 0); |
|
9556cdf38196
[gaim-migrate @ 15602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13234
diff
changeset
|
693 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toggle), |
|
9556cdf38196
[gaim-migrate @ 15602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13234
diff
changeset
|
694 | gaim_prefs_get_bool("/plugins/gtk/X11/notify/type_chat_nick")); |
|
9556cdf38196
[gaim-migrate @ 15602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13234
diff
changeset
|
695 | g_signal_connect(G_OBJECT(toggle), "toggled", |
|
9556cdf38196
[gaim-migrate @ 15602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13234
diff
changeset
|
696 | G_CALLBACK(type_toggle_cb), "type_chat_nick"); |
|
9556cdf38196
[gaim-migrate @ 15602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13234
diff
changeset
|
697 | gtk_widget_set_sensitive(toggle, gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(ref))); |
|
9556cdf38196
[gaim-migrate @ 15602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13234
diff
changeset
|
698 | g_signal_connect(G_OBJECT(ref), "toggled", |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15527
diff
changeset
|
699 | G_CALLBACK(pidgin_toggle_sensitive), toggle); |
|
13237
9556cdf38196
[gaim-migrate @ 15602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13234
diff
changeset
|
700 | |
| 6977 | 701 | toggle = gtk_check_button_new_with_mnemonic(_("_Focused windows")); |
| 702 | gtk_box_pack_start(GTK_BOX(vbox), toggle, FALSE, FALSE, 0); | |
| 703 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toggle), | |
| 9298 | 704 | gaim_prefs_get_bool("/plugins/gtk/X11/notify/type_focused")); |
| 6977 | 705 | g_signal_connect(G_OBJECT(toggle), "toggled", |
| 9298 | 706 | G_CALLBACK(type_toggle_cb), "type_focused"); |
| 3710 | 707 | |
| 6302 | 708 | /*---------- "Notification Methods" ----------*/ |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15527
diff
changeset
|
709 | frame = pidgin_make_frame(ret, _("Notification Methods")); |
| 6302 | 710 | vbox = gtk_vbox_new(FALSE, 5); |
| 711 | gtk_container_add(GTK_CONTAINER(frame), vbox); | |
| 712 | ||
| 6977 | 713 | /* String method button */ |
| 3565 | 714 | hbox = gtk_hbox_new(FALSE, 18); |
| 715 | gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); | |
| 6302 | 716 | toggle = gtk_check_button_new_with_mnemonic(_("Prepend _string into window title:")); |
| 6977 | 717 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toggle), |
| 9298 | 718 | gaim_prefs_get_bool("/plugins/gtk/X11/notify/method_string")); |
| 3565 | 719 | gtk_box_pack_start(GTK_BOX(hbox), toggle, FALSE, FALSE, 0); |
| 6977 | 720 | |
| 6302 | 721 | entry = gtk_entry_new(); |
| 722 | gtk_box_pack_start(GTK_BOX(hbox), entry, FALSE, FALSE, 0); | |
| 723 | gtk_entry_set_max_length(GTK_ENTRY(entry), 10); | |
| 6977 | 724 | gtk_widget_set_sensitive(GTK_WIDGET(entry), |
| 9298 | 725 | gaim_prefs_get_bool("/plugins/gtk/X11/notify/method_string")); |
| 6977 | 726 | gtk_entry_set_text(GTK_ENTRY(entry), |
| 9298 | 727 | gaim_prefs_get_string("/plugins/gtk/X11/notify/title_string")); |
| 6977 | 728 | g_object_set_data(G_OBJECT(toggle), "title-entry", entry); |
| 729 | g_signal_connect(G_OBJECT(toggle), "toggled", | |
| 9298 | 730 | G_CALLBACK(method_toggle_cb), "method_string"); |
| 6977 | 731 | g_signal_connect(G_OBJECT(entry), "focus-out-event", |
| 9298 | 732 | G_CALLBACK(options_entry_cb), "method_string"); |
| 3374 | 733 | |
| 6977 | 734 | /* Count method button */ |
| 735 | toggle = gtk_check_button_new_with_mnemonic(_("Insert c_ount of new messages into window title")); | |
| 736 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toggle), | |
| 9298 | 737 | gaim_prefs_get_bool("/plugins/gtk/X11/notify/method_count")); |
| 6977 | 738 | gtk_box_pack_start(GTK_BOX(vbox), toggle, FALSE, FALSE, 0); |
| 739 | g_signal_connect(G_OBJECT(toggle), "toggled", | |
| 9298 | 740 | G_CALLBACK(method_toggle_cb), "method_count"); |
| 4035 | 741 | |
| 12959 | 742 | #ifndef _WIN32 |
| 14389 | 743 | /* Count xprop method button */ |
| 744 | toggle = gtk_check_button_new_with_mnemonic(_("Insert count of new message into _X property")); | |
| 745 | gtk_box_pack_start(GTK_BOX(vbox), toggle, FALSE, FALSE, 0); | |
| 746 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toggle), | |
| 747 | gaim_prefs_get_bool("/plugins/gtk/X11/notify/method_count_xprop")); | |
| 748 | g_signal_connect(G_OBJECT(toggle), "toggled", | |
| 749 | G_CALLBACK(method_toggle_cb), "method_count_xprop"); | |
| 750 | ||
| 6977 | 751 | /* Urgent method button */ |
| 752 | toggle = gtk_check_button_new_with_mnemonic(_("Set window manager \"_URGENT\" hint")); | |
| 753 | gtk_box_pack_start(GTK_BOX(vbox), toggle, FALSE, FALSE, 0); | |
| 754 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toggle), | |
| 9298 | 755 | gaim_prefs_get_bool("/plugins/gtk/X11/notify/method_urgent")); |
| 756 | g_signal_connect(G_OBJECT(toggle), "toggled", | |
| 757 | G_CALLBACK(method_toggle_cb), "method_urgent"); | |
| 12959 | 758 | #endif |
| 3710 | 759 | |
| 10606 | 760 | /* Raise window method button */ |
| 761 | toggle = gtk_check_button_new_with_mnemonic(_("R_aise conversation window")); | |
| 762 | gtk_box_pack_start(GTK_BOX(vbox), toggle, FALSE, FALSE, 0); | |
| 763 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toggle), | |
| 764 | gaim_prefs_get_bool("/plugins/gtk/X11/notify/method_raise")); | |
| 765 | g_signal_connect(G_OBJECT(toggle), "toggled", | |
| 766 | G_CALLBACK(method_toggle_cb), "method_raise"); | |
| 767 | ||
| 6977 | 768 | /*---------- "Notification Removals" ----------*/ |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15527
diff
changeset
|
769 | frame = pidgin_make_frame(ret, _("Notification Removal")); |
| 6302 | 770 | vbox = gtk_vbox_new(FALSE, 5); |
| 771 | gtk_container_add(GTK_CONTAINER(frame), vbox); | |
| 3374 | 772 | |
| 6977 | 773 | /* Remove on focus button */ |
| 774 | toggle = gtk_check_button_new_with_mnemonic(_("Remove when conversation window _gains focus")); | |
| 775 | gtk_box_pack_start(GTK_BOX(vbox), toggle, FALSE, FALSE, 0); | |
| 776 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toggle), | |
| 9298 | 777 | gaim_prefs_get_bool("/plugins/gtk/X11/notify/notify_focus")); |
| 6977 | 778 | g_signal_connect(G_OBJECT(toggle), "toggled", G_CALLBACK(notify_toggle_cb), "notify_focus"); |
| 779 | ||
| 780 | /* Remove on click button */ | |
| 781 | toggle = gtk_check_button_new_with_mnemonic(_("Remove when conversation window _receives click")); | |
| 782 | gtk_box_pack_start(GTK_BOX(vbox), toggle, FALSE, FALSE, 0); | |
| 783 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toggle), | |
| 9298 | 784 | gaim_prefs_get_bool("/plugins/gtk/X11/notify/notify_click")); |
| 6977 | 785 | g_signal_connect(G_OBJECT(toggle), "toggled", |
| 9298 | 786 | G_CALLBACK(notify_toggle_cb), "notify_click"); |
| 3710 | 787 | |
| 6977 | 788 | /* Remove on type button */ |
| 789 | toggle = gtk_check_button_new_with_mnemonic(_("Remove when _typing in conversation window")); | |
| 790 | gtk_box_pack_start(GTK_BOX(vbox), toggle, FALSE, FALSE, 0); | |
| 791 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toggle), | |
| 9298 | 792 | gaim_prefs_get_bool("/plugins/gtk/X11/notify/notify_type")); |
| 6977 | 793 | g_signal_connect(G_OBJECT(toggle), "toggled", |
| 9298 | 794 | G_CALLBACK(notify_toggle_cb), "notify_type"); |
| 4035 | 795 | |
| 6977 | 796 | /* Remove on message send button */ |
| 797 | toggle = gtk_check_button_new_with_mnemonic(_("Remove when a _message gets sent")); | |
| 798 | gtk_box_pack_start(GTK_BOX(vbox), toggle, FALSE, FALSE, 0); | |
| 799 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toggle), | |
| 9298 | 800 | gaim_prefs_get_bool("/plugins/gtk/X11/notify/notify_send")); |
| 6977 | 801 | g_signal_connect(G_OBJECT(toggle), "toggled", |
| 9298 | 802 | G_CALLBACK(notify_toggle_cb), "notify_send"); |
| 3565 | 803 | |
| 6977 | 804 | #if 0 |
| 805 | /* Remove on conversation switch button */ | |
| 9298 | 806 | toggle = gtk_check_button_new_with_mnemonic(_("Remove on switch to conversation ta_b")); |
| 6977 | 807 | gtk_box_pack_start(GTK_BOX(vbox), toggle, FALSE, FALSE, 0); |
| 808 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toggle), | |
| 9298 | 809 | gaim_prefs_get_bool("/plugins/gtk/X11/notify/notify_switch")); |
| 6977 | 810 | g_signal_connect(G_OBJECT(toggle), "toggled", |
| 9298 | 811 | G_CALLBACK(notify_toggle_cb), "notify_switch"); |
| 6977 | 812 | #endif |
| 813 | ||
| 814 | gtk_widget_show_all(ret); | |
| 815 | return ret; | |
| 3374 | 816 | } |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
817 | |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
818 | static gboolean |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
819 | plugin_load(GaimPlugin *plugin) |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
820 | { |
| 6977 | 821 | GList *convs = gaim_get_conversations(); |
|
6485
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6464
diff
changeset
|
822 | void *conv_handle = gaim_conversations_get_handle(); |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15527
diff
changeset
|
823 | void *gtk_conv_handle = pidgin_conversations_get_handle(); |
| 6302 | 824 | |
| 825 | my_plugin = plugin; | |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
826 | |
|
12604
893fbf89317c
[gaim-migrate @ 14939]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12600
diff
changeset
|
827 | gaim_signal_connect(gtk_conv_handle, "displayed-im-msg", plugin, |
| 12968 | 828 | GAIM_CALLBACK(message_displayed_cb), NULL); |
|
12604
893fbf89317c
[gaim-migrate @ 14939]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12600
diff
changeset
|
829 | gaim_signal_connect(gtk_conv_handle, "displayed-chat-msg", plugin, |
| 12968 | 830 | GAIM_CALLBACK(message_displayed_cb), NULL); |
| 831 | gaim_signal_connect(gtk_conv_handle, "conversation-switched", plugin, | |
| 832 | GAIM_CALLBACK(conv_switched), NULL); | |
| 6977 | 833 | gaim_signal_connect(conv_handle, "sent-im-msg", plugin, |
| 9298 | 834 | GAIM_CALLBACK(im_sent_im), NULL); |
| 6977 | 835 | gaim_signal_connect(conv_handle, "sent-chat-msg", plugin, |
| 9298 | 836 | GAIM_CALLBACK(chat_sent_im), NULL); |
| 6977 | 837 | gaim_signal_connect(conv_handle, "conversation-created", plugin, |
| 9298 | 838 | GAIM_CALLBACK(conv_created), NULL); |
| 6977 | 839 | gaim_signal_connect(conv_handle, "chat-joined", plugin, |
| 9298 | 840 | GAIM_CALLBACK(conv_created), NULL); |
| 6977 | 841 | gaim_signal_connect(conv_handle, "deleting-conversation", plugin, |
| 9298 | 842 | GAIM_CALLBACK(deleting_conv), NULL); |
|
10971
4c823ffab27a
[gaim-migrate @ 12796]
Mark Doliner <markdoliner@pidgin.im>
parents:
10841
diff
changeset
|
843 | #if 0 |
|
11447
23594a754163
[gaim-migrate @ 13686]
Daniel Atallah <datallah@pidgin.im>
parents:
11338
diff
changeset
|
844 | gaim_signal_connect(gtk_conv_handle, "conversation-dragging", plugin, |
|
23594a754163
[gaim-migrate @ 13686]
Daniel Atallah <datallah@pidgin.im>
parents:
11338
diff
changeset
|
845 | GAIM_CALLBACK(conversation_dragging), NULL); |
|
9303
e257ad08c77c
[gaim-migrate @ 10107]
Mark Doliner <markdoliner@pidgin.im>
parents:
9298
diff
changeset
|
846 | #endif |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
847 | |
| 6977 | 848 | while (convs) { |
| 849 | GaimConversation *conv = (GaimConversation *)convs->data; | |
| 6302 | 850 | |
| 851 | /* attach signals */ | |
| 6977 | 852 | attach_signals(conv); |
| 6302 | 853 | |
| 6977 | 854 | convs = convs->next; |
| 6302 | 855 | } |
| 856 | ||
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
857 | return TRUE; |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
858 | } |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
859 | |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
860 | static gboolean |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
861 | plugin_unload(GaimPlugin *plugin) |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
862 | { |
| 6977 | 863 | GList *convs = gaim_get_conversations(); |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
864 | |
| 6977 | 865 | while (convs) { |
| 866 | GaimConversation *conv = (GaimConversation *)convs->data; | |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
867 | |
| 6302 | 868 | /* kill signals */ |
| 6977 | 869 | detach_signals(conv); |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
870 | |
| 6977 | 871 | convs = convs->next; |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
872 | } |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
873 | |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
874 | return TRUE; |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
875 | } |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
876 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15527
diff
changeset
|
877 | static PidginPluginUiInfo ui_info = |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
878 | { |
|
12600
7ecd4441fdc7
[gaim-migrate @ 14934]
Richard Laager <rlaager@pidgin.im>
parents:
12397
diff
changeset
|
879 | get_config_frame, |
|
7ecd4441fdc7
[gaim-migrate @ 14934]
Richard Laager <rlaager@pidgin.im>
parents:
12397
diff
changeset
|
880 | 0 /* page_num (Reserved) */ |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
881 | }; |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
882 | |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
883 | static GaimPluginInfo info = |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
884 | { |
| 9943 | 885 | GAIM_PLUGIN_MAGIC, |
| 886 | GAIM_MAJOR_VERSION, | |
| 887 | GAIM_MINOR_VERSION, | |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
888 | GAIM_PLUGIN_STANDARD, /**< type */ |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15527
diff
changeset
|
889 | PIDGIN_PLUGIN_TYPE, /**< ui_requirement */ |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
890 | 0, /**< flags */ |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
891 | NULL, /**< dependencies */ |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
892 | GAIM_PRIORITY_DEFAULT, /**< priority */ |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
893 | |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
894 | NOTIFY_PLUGIN_ID, /**< id */ |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
895 | N_("Message Notification"), /**< name */ |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
896 | VERSION, /**< version */ |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
897 | /** summary */ |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
898 | N_("Provides a variety of ways of notifying you of unread messages."), |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
899 | /** description */ |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
900 | N_("Provides a variety of ways of notifying you of unread messages."), |
| 14389 | 901 | /**< author */ |
| 9298 | 902 | "Etan Reisner <deryni@eden.rutgers.edu>\n\t\t\tBrian Tarricone <bjt23@cornell.edu>", |
|
6485
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6464
diff
changeset
|
903 | GAIM_WEBSITE, /**< homepage */ |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
904 | |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
905 | plugin_load, /**< load */ |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
906 | plugin_unload, /**< unload */ |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
907 | NULL, /**< destroy */ |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
908 | |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
909 | &ui_info, /**< ui_info */ |
| 8993 | 910 | NULL, /**< extra_info */ |
| 911 | NULL, | |
| 912 | NULL | |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
913 | }; |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
914 | |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
915 | static void |
|
5920
963bfdefee02
[gaim-migrate @ 6360]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
916 | init_plugin(GaimPlugin *plugin) |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
917 | { |
| 6302 | 918 | gaim_prefs_add_none("/plugins/gtk"); |
| 919 | gaim_prefs_add_none("/plugins/gtk/X11"); | |
| 920 | gaim_prefs_add_none("/plugins/gtk/X11/notify"); | |
| 921 | ||
| 6464 | 922 | gaim_prefs_add_bool("/plugins/gtk/X11/notify/type_im", TRUE); |
| 923 | gaim_prefs_add_bool("/plugins/gtk/X11/notify/type_chat", FALSE); | |
|
13237
9556cdf38196
[gaim-migrate @ 15602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13234
diff
changeset
|
924 | gaim_prefs_add_bool("/plugins/gtk/X11/notify/type_chat_nick", FALSE); |
| 6464 | 925 | gaim_prefs_add_bool("/plugins/gtk/X11/notify/type_focused", FALSE); |
| 6302 | 926 | gaim_prefs_add_bool("/plugins/gtk/X11/notify/method_string", FALSE); |
| 927 | gaim_prefs_add_string("/plugins/gtk/X11/notify/title_string", "(*)"); | |
| 928 | gaim_prefs_add_bool("/plugins/gtk/X11/notify/method_urgent", FALSE); | |
| 929 | gaim_prefs_add_bool("/plugins/gtk/X11/notify/method_count", FALSE); | |
| 14389 | 930 | gaim_prefs_add_bool("/plugins/gtk/X11/notify/method_count_xprop", FALSE); |
| 10492 | 931 | gaim_prefs_add_bool("/plugins/gtk/X11/notify/method_raise", FALSE); |
| 14778 | 932 | gaim_prefs_add_bool("/plugins/gtk/X11/notify/notify_focus", TRUE); |
| 6302 | 933 | gaim_prefs_add_bool("/plugins/gtk/X11/notify/notify_click", FALSE); |
| 934 | gaim_prefs_add_bool("/plugins/gtk/X11/notify/notify_type", TRUE); | |
| 6464 | 935 | gaim_prefs_add_bool("/plugins/gtk/X11/notify/notify_send", TRUE); |
| 936 | gaim_prefs_add_bool("/plugins/gtk/X11/notify/notify_switch", TRUE); | |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
937 | } |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
938 | |
| 6063 | 939 | GAIM_INIT_PLUGIN(notify, init_plugin, info) |