Sat, 15 Sep 2007 06:26:35 +0000
propagate from branch 'im.pidgin.pidgin' (head 7a408753ea6fcb06a8d7002498c1583ce6a5bcc7)
to branch 'im.pidgin.sadrul.conv.persistent' (head e6b980956cd23dd775a1b49bd600c1586f408212)
| 6302 | 1 | /* |
| 15884 | 2 | * Purple buddy notification plugin. |
| 6302 | 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 | |
|
19859
71d37b57eff2
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
19717
diff
changeset
|
23 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
| 6302 | 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. | |
| 15884 | 34 | * 22:23:53 <deryni> Also I think purple might re-set that sort of frequently, |
| 10606 | 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: | |
| 15884 | 83 | * -Added Raise option, formally in Purple 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 | |
| 15884 | 107 | static PurplePlugin *my_plugin = NULL; |
| 15527 | 108 | #ifndef _WIN32 |
| 14389 | 109 | static GdkAtom _Cardinal = GDK_NONE; |
| 15884 | 110 | static GdkAtom _PurpleUnseenCount = 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 */ |
| 15884 | 114 | static int notify(PurpleConversation *conv, gboolean increment); |
| 115 | static void notify_win(PidginWindow *purplewin); | |
| 116 | static void unnotify(PurpleConversation *conv, gboolean reset); | |
| 14389 | 117 | static int unnotify_cb(GtkWidget *widget, gpointer data, |
| 15884 | 118 | PurpleConversation *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 */ |
| 15884 | 130 | static void handle_string(PidginWindow *purplewin); |
| 6302 | 131 | |
| 14389 | 132 | /* count_title function */ |
| 15884 | 133 | static void handle_count_title(PidginWindow *purplewin); |
| 14389 | 134 | |
| 135 | /* count_xprop function */ | |
| 15884 | 136 | static void handle_count_xprop(PidginWindow *purplewin); |
| 6302 | 137 | |
| 6977 | 138 | /* urgent function */ |
| 15884 | 139 | static void handle_urgent(PidginWindow *purplewin, gboolean set); |
| 10606 | 140 | |
| 141 | /* raise function */ | |
| 15884 | 142 | static void handle_raise(PidginWindow *purplewin); |
| 3710 | 143 | |
| 6302 | 144 | /****************************************/ |
| 145 | /* Begin doing stuff below this line... */ | |
| 146 | /****************************************/ | |
| 14389 | 147 | static guint |
| 15884 | 148 | count_messages(PidginWindow *purplewin) |
| 9298 | 149 | { |
| 14389 | 150 | guint count = 0; |
| 14385 | 151 | GList *convs = NULL, *l; |
| 9298 | 152 | |
| 15884 | 153 | for (convs = purplewin->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) { |
| 15884 | 156 | count += GPOINTER_TO_INT(purple_conversation_get_data(l->data, "notify-message-count")); |
| 14385 | 157 | } |
| 9298 | 158 | } |
| 159 | ||
| 160 | return count; | |
| 161 | } | |
| 6302 | 162 | |
| 6977 | 163 | static int |
| 15884 | 164 | notify(PurpleConversation *conv, gboolean increment) |
| 6977 | 165 | { |
| 14385 | 166 | gint count; |
| 14326 | 167 | gboolean has_focus; |
| 15884 | 168 | PidginWindow *purplewin = NULL; |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4218
diff
changeset
|
169 | |
|
19717
bfc9d0446b60
Do not crash on hidden conversations.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16749
diff
changeset
|
170 | if (conv == NULL || PIDGIN_CONVERSATION(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 | ||
| 15884 | 176 | purplewin = PIDGIN_CONVERSATION(conv)->win; |
| 5021 | 177 | |
| 6977 | 178 | /* If we aren't doing notifications for this type of conversation, return */ |
| 15884 | 179 | if (((purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_IM) && |
| 180 | !purple_prefs_get_bool("/plugins/gtk/X11/notify/type_im")) || | |
| 181 | ((purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_CHAT) && | |
| 182 | !purple_prefs_get_bool("/plugins/gtk/X11/notify/type_chat"))) | |
| 6977 | 183 | return 0; |
| 4203 | 184 | |
| 15884 | 185 | g_object_get(G_OBJECT(purplewin->window), |
| 9298 | 186 | "has-toplevel-focus", &has_focus, NULL); |
| 3374 | 187 | |
| 15884 | 188 | if (purple_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) { |
| 15884 | 191 | count = GPOINTER_TO_INT(purple_conversation_get_data(conv, "notify-message-count")); |
| 14385 | 192 | count++; |
| 15884 | 193 | purple_conversation_set_data(conv, "notify-message-count", GINT_TO_POINTER(count)); |
| 14385 | 194 | } |
| 195 | ||
| 15884 | 196 | notify_win(purplewin); |
| 6977 | 197 | } |
| 6302 | 198 | |
| 199 | return 0; | |
| 200 | } | |
| 201 | ||
| 9298 | 202 | static void |
| 15884 | 203 | notify_win(PidginWindow *purplewin) |
| 9298 | 204 | { |
| 15884 | 205 | if (count_messages(purplewin) <= 0) |
|
10971
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 | |
| 15884 | 208 | if (purple_prefs_get_bool("/plugins/gtk/X11/notify/method_count")) |
| 209 | handle_count_title(purplewin); | |
| 210 | if (purple_prefs_get_bool("/plugins/gtk/X11/notify/method_count_xprop")) | |
| 211 | handle_count_xprop(purplewin); | |
| 212 | if (purple_prefs_get_bool("/plugins/gtk/X11/notify/method_string")) | |
| 213 | handle_string(purplewin); | |
| 214 | if (purple_prefs_get_bool("/plugins/gtk/X11/notify/method_urgent")) | |
| 215 | handle_urgent(purplewin, TRUE); | |
| 216 | if (purple_prefs_get_bool("/plugins/gtk/X11/notify/method_raise")) | |
| 217 | handle_raise(purplewin); | |
| 9298 | 218 | } |
| 219 | ||
| 220 | static void | |
| 15884 | 221 | unnotify(PurpleConversation *conv, gboolean reset) |
| 9298 | 222 | { |
| 15884 | 223 | PurpleConversation *active_conv = NULL; |
| 224 | PidginWindow *purplewin = NULL; | |
| 9298 | 225 | |
| 226 | g_return_if_fail(conv != NULL); | |
|
19717
bfc9d0446b60
Do not crash on hidden conversations.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16749
diff
changeset
|
227 | if (PIDGIN_CONVERSATION(conv) == NULL) |
|
bfc9d0446b60
Do not crash on hidden conversations.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16749
diff
changeset
|
228 | return; |
| 9298 | 229 | |
| 15884 | 230 | purplewin = PIDGIN_CONVERSATION(conv)->win; |
| 231 | active_conv = pidgin_conv_window_get_active_conversation(purplewin); | |
| 9298 | 232 | |
| 233 | /* reset the conversation window title */ | |
| 15884 | 234 | purple_conversation_autoset_title(active_conv); |
| 9298 | 235 | |
| 236 | if (reset) { | |
| 14389 | 237 | /* Only need to actually remove the urgent hinting here, since |
| 238 | * removing it just to have it readded in re-notify is an | |
| 239 | * unnecessary couple extra RTs to the server */ | |
| 15884 | 240 | handle_urgent(purplewin, FALSE); |
| 241 | purple_conversation_set_data(conv, "notify-message-count", GINT_TO_POINTER(0)); | |
| 14389 | 242 | /* Same logic as for the urgent hint, xprops are also a RT. |
| 243 | * This needs to go here so that it gets the updated message | |
| 244 | * count. */ | |
| 15884 | 245 | handle_count_xprop(purplewin); |
| 9298 | 246 | } |
| 247 | ||
| 248 | return; | |
| 249 | } | |
| 250 | ||
| 251 | static int | |
| 15884 | 252 | unnotify_cb(GtkWidget *widget, gpointer data, PurpleConversation *conv) |
| 9298 | 253 | { |
| 15884 | 254 | if (GPOINTER_TO_INT(purple_conversation_get_data(conv, "notify-message-count")) != 0) |
| 9298 | 255 | unnotify(conv, TRUE); |
| 256 | ||
| 257 | return 0; | |
| 258 | } | |
| 259 | ||
|
6485
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6464
diff
changeset
|
260 | static gboolean |
| 15884 | 261 | message_displayed_cb(PurpleAccount *account, const char *who, char *message, |
| 262 | PurpleConversation *conv, PurpleMessageFlags flags) | |
| 6977 | 263 | { |
| 15884 | 264 | if ((purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_CHAT && |
| 265 | purple_prefs_get_bool("/plugins/gtk/X11/notify/type_chat_nick") && | |
| 266 | !(flags & PURPLE_MESSAGE_NICK))) | |
|
13237
9556cdf38196
[gaim-migrate @ 15602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13234
diff
changeset
|
267 | return FALSE; |
|
9556cdf38196
[gaim-migrate @ 15602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13234
diff
changeset
|
268 | |
| 15884 | 269 | if ((flags & PURPLE_MESSAGE_RECV) && !(flags & PURPLE_MESSAGE_DELAYED)) |
| 14385 | 270 | notify(conv, TRUE); |
| 9298 | 271 | |
| 272 | return FALSE; | |
| 273 | } | |
| 274 | ||
| 6977 | 275 | static void |
| 15884 | 276 | im_sent_im(PurpleAccount *account, const char *receiver, const char *message) |
| 14389 | 277 | { |
| 15884 | 278 | PurpleConversation *conv = NULL; |
| 9298 | 279 | |
| 15884 | 280 | if (purple_prefs_get_bool("/plugins/gtk/X11/notify/notify_send")) { |
| 281 | conv = purple_find_conversation_with_account(PURPLE_CONV_TYPE_IM, receiver, account); | |
| 9298 | 282 | unnotify(conv, TRUE); |
| 283 | } | |
| 284 | } | |
| 285 | ||
| 286 | static void | |
| 15884 | 287 | chat_sent_im(PurpleAccount *account, const char *message, int id) |
| 6977 | 288 | { |
| 15884 | 289 | PurpleConversation *conv = NULL; |
| 6977 | 290 | |
| 15884 | 291 | if (purple_prefs_get_bool("/plugins/gtk/X11/notify/notify_send")) { |
| 292 | conv = purple_find_chat(purple_account_get_connection(account), id); | |
| 6977 | 293 | unnotify(conv, TRUE); |
| 294 | } | |
| 3710 | 295 | } |
| 296 | ||
| 6977 | 297 | static int |
| 15884 | 298 | attach_signals(PurpleConversation *conv) |
| 6977 | 299 | { |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15527
diff
changeset
|
300 | PidginConversation *gtkconv = NULL; |
|
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15527
diff
changeset
|
301 | PidginWindow *gtkwin = NULL; |
| 11728 | 302 | GSList *imhtml_ids = NULL, *entry_ids = NULL; |
| 6977 | 303 | guint id; |
| 304 | ||
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15527
diff
changeset
|
305 | gtkconv = PIDGIN_CONVERSATION(conv); |
| 11581 | 306 | if (!gtkconv) { |
| 15884 | 307 | purple_debug_misc("notify", "Failed to find gtkconv\n"); |
| 11581 | 308 | return 0; |
| 309 | } | |
| 310 | ||
| 311 | gtkwin = gtkconv->win; | |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4218
diff
changeset
|
312 | |
| 15884 | 313 | if (purple_prefs_get_bool("/plugins/gtk/X11/notify/notify_focus")) { |
| 14389 | 314 | /* TODO should really find a way to make this work no matter |
| 315 | * where the focus is inside the conv window, without having | |
| 316 | * to bind to focus-in-event on the g(d|t)kwindow */ | |
| 9298 | 317 | /* try setting the signal on the focus-in-event for |
| 318 | * gtkwin->notebook->container? */ | |
| 319 | id = g_signal_connect(G_OBJECT(gtkconv->entry), "focus-in-event", | |
| 320 | G_CALLBACK(unnotify_cb), conv); | |
| 11728 | 321 | entry_ids = g_slist_append(entry_ids, GUINT_TO_POINTER(id)); |
| 9298 | 322 | |
| 323 | id = g_signal_connect(G_OBJECT(gtkconv->imhtml), "focus-in-event", | |
| 324 | G_CALLBACK(unnotify_cb), conv); | |
| 11728 | 325 | imhtml_ids = g_slist_append(imhtml_ids, GUINT_TO_POINTER(id)); |
| 6977 | 326 | } |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4218
diff
changeset
|
327 | |
| 15884 | 328 | if (purple_prefs_get_bool("/plugins/gtk/X11/notify/notify_click")) { |
| 14389 | 329 | /* TODO similarly should really find a way to allow for |
| 330 | * clicking in other places of the window */ | |
| 9298 | 331 | id = g_signal_connect(G_OBJECT(gtkconv->entry), "button-press-event", |
| 332 | G_CALLBACK(unnotify_cb), conv); | |
| 6977 | 333 | entry_ids = g_slist_append(entry_ids, GUINT_TO_POINTER(id)); |
| 12286 | 334 | |
| 335 | id = g_signal_connect(G_OBJECT(gtkconv->imhtml), "button-press-event", | |
| 336 | G_CALLBACK(unnotify_cb), conv); | |
| 337 | imhtml_ids = g_slist_append(imhtml_ids, GUINT_TO_POINTER(id)); | |
| 3374 | 338 | } |
| 3710 | 339 | |
| 15884 | 340 | if (purple_prefs_get_bool("/plugins/gtk/X11/notify/notify_type")) { |
| 9298 | 341 | id = g_signal_connect(G_OBJECT(gtkconv->entry), "key-press-event", |
| 342 | G_CALLBACK(unnotify_cb), conv); | |
| 6977 | 343 | entry_ids = g_slist_append(entry_ids, GUINT_TO_POINTER(id)); |
| 3374 | 344 | } |
| 345 | ||
| 15884 | 346 | purple_conversation_set_data(conv, "notify-imhtml-signals", imhtml_ids); |
| 347 | purple_conversation_set_data(conv, "notify-entry-signals", entry_ids); | |
| 4035 | 348 | |
| 3428 | 349 | return 0; |
| 191 | 350 | } |
| 351 | ||
| 6977 | 352 | static void |
| 15884 | 353 | detach_signals(PurpleConversation *conv) |
| 6977 | 354 | { |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15527
diff
changeset
|
355 | PidginConversation *gtkconv = NULL; |
|
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15527
diff
changeset
|
356 | PidginWindow *gtkwin = NULL; |
| 11606 | 357 | GSList *ids = NULL, *l; |
|
6485
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6464
diff
changeset
|
358 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15527
diff
changeset
|
359 | gtkconv = PIDGIN_CONVERSATION(conv); |
| 11581 | 360 | if (!gtkconv) |
| 361 | return; | |
| 362 | gtkwin = gtkconv->win; | |
| 4203 | 363 | |
| 15884 | 364 | ids = purple_conversation_get_data(conv, "notify-imhtml-signals"); |
| 11606 | 365 | for (l = ids; l != NULL; l = l->next) |
| 366 | g_signal_handler_disconnect(gtkconv->imhtml, GPOINTER_TO_INT(l->data)); | |
| 367 | g_slist_free(ids); | |
| 6302 | 368 | |
| 15884 | 369 | ids = purple_conversation_get_data(conv, "notify-entry-signals"); |
| 11606 | 370 | for (l = ids; l != NULL; l = l->next) |
| 371 | g_signal_handler_disconnect(gtkconv->entry, GPOINTER_TO_INT(l->data)); | |
| 372 | g_slist_free(ids); | |
| 3710 | 373 | |
| 15884 | 374 | purple_conversation_set_data(conv, "notify-message-count", GINT_TO_POINTER(0)); |
| 14385 | 375 | |
| 15884 | 376 | purple_conversation_set_data(conv, "notify-imhtml-signals", NULL); |
| 377 | purple_conversation_set_data(conv, "notify-entry-signals", NULL); | |
| 3710 | 378 | } |
| 379 | ||
| 6977 | 380 | static void |
| 15884 | 381 | conv_created(PurpleConversation *conv) |
| 6977 | 382 | { |
| 15884 | 383 | purple_conversation_set_data(conv, "notify-message-count", |
| 14389 | 384 | GINT_TO_POINTER(0)); |
| 14385 | 385 | |
| 14389 | 386 | /* always attach the signals, notify() will take care of conversation |
| 387 | * type checking */ | |
| 6977 | 388 | attach_signals(conv); |
| 3374 | 389 | } |
| 390 | ||
| 6977 | 391 | static void |
| 15884 | 392 | conv_switched(PurpleConversation *conv) |
| 6977 | 393 | { |
|
10971
4c823ffab27a
[gaim-migrate @ 12796]
Mark Doliner <markdoliner@pidgin.im>
parents:
10841
diff
changeset
|
394 | #if 0 |
| 15884 | 395 | PidginWindow *purplewin = purple_conversation_get_window(new_conv); |
|
10971
4c823ffab27a
[gaim-migrate @ 12796]
Mark Doliner <markdoliner@pidgin.im>
parents:
10841
diff
changeset
|
396 | #endif |
| 6302 | 397 | |
|
10971
4c823ffab27a
[gaim-migrate @ 12796]
Mark Doliner <markdoliner@pidgin.im>
parents:
10841
diff
changeset
|
398 | /* |
|
4c823ffab27a
[gaim-migrate @ 12796]
Mark Doliner <markdoliner@pidgin.im>
parents:
10841
diff
changeset
|
399 | * If the conversation was switched, then make sure we re-notify |
| 15884 | 400 | * because Purple will have overwritten our custom window title. |
|
10971
4c823ffab27a
[gaim-migrate @ 12796]
Mark Doliner <markdoliner@pidgin.im>
parents:
10841
diff
changeset
|
401 | */ |
| 14385 | 402 | notify(conv, FALSE); |
|
10971
4c823ffab27a
[gaim-migrate @ 12796]
Mark Doliner <markdoliner@pidgin.im>
parents:
10841
diff
changeset
|
403 | |
|
4c823ffab27a
[gaim-migrate @ 12796]
Mark Doliner <markdoliner@pidgin.im>
parents:
10841
diff
changeset
|
404 | #if 0 |
| 9298 | 405 | printf("conv_switched - %p - %p\n", old_conv, new_conv); |
| 15884 | 406 | printf("count - %d\n", count_messages(purplewin)); |
| 407 | if (purple_prefs_get_bool("/plugins/gtk/X11/notify/notify_switch")) | |
| 9298 | 408 | unnotify(new_conv, FALSE); |
| 409 | else { | |
| 410 | /* if we don't have notification on the window then we don't want to | |
| 411 | * re-notify it */ | |
| 15884 | 412 | if (count_messages(purplewin)) |
| 413 | notify_win(purplewin); | |
| 9298 | 414 | } |
|
10971
4c823ffab27a
[gaim-migrate @ 12796]
Mark Doliner <markdoliner@pidgin.im>
parents:
10841
diff
changeset
|
415 | #endif |
| 6977 | 416 | } |
| 6302 | 417 | |
| 6977 | 418 | static void |
| 15884 | 419 | deleting_conv(PurpleConversation *conv) |
| 6977 | 420 | { |
| 15884 | 421 | PidginWindow *purplewin = NULL; |
|
19717
bfc9d0446b60
Do not crash on hidden conversations.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16749
diff
changeset
|
422 | PidginConversation *gtkconv = PIDGIN_CONVERSATION(conv); |
|
bfc9d0446b60
Do not crash on hidden conversations.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16749
diff
changeset
|
423 | |
|
bfc9d0446b60
Do not crash on hidden conversations.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16749
diff
changeset
|
424 | if (gtkconv == NULL) |
|
bfc9d0446b60
Do not crash on hidden conversations.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16749
diff
changeset
|
425 | return; |
| 9298 | 426 | |
| 6977 | 427 | detach_signals(conv); |
| 3392 | 428 | |
|
19717
bfc9d0446b60
Do not crash on hidden conversations.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16749
diff
changeset
|
429 | purplewin = gtkconv->win; |
| 11606 | 430 | |
| 15884 | 431 | handle_urgent(purplewin, FALSE); |
| 432 | purple_conversation_set_data(conv, "notify-message-count", GINT_TO_POINTER(0)); | |
| 11606 | 433 | |
| 434 | return; | |
| 435 | ||
| 11581 | 436 | #if 0 |
| 437 | /* i think this line crashes */ | |
| 15884 | 438 | if (count_messages(purplewin)) |
| 439 | notify_win(purplewin); | |
| 11581 | 440 | #endif |
| 6977 | 441 | } |
| 442 | ||
|
9303
e257ad08c77c
[gaim-migrate @ 10107]
Mark Doliner <markdoliner@pidgin.im>
parents:
9298
diff
changeset
|
443 | #if 0 |
| 6977 | 444 | static void |
| 15884 | 445 | conversation_dragging(PurpleConversation *active_conv, |
| 446 | PidginWindow *old_purplewin, | |
| 447 | PidginWindow *new_purplewin) | |
| 6977 | 448 | { |
| 15884 | 449 | if (old_purplewin != new_purplewin) { |
| 450 | if (old_purplewin == NULL) { | |
| 9298 | 451 | /* |
| 15884 | 452 | purple_conversation_autoset_title(active_conv); |
| 453 | handle_urgent(new_purplewin, FALSE); | |
| 9298 | 454 | */ |
| 455 | ||
| 15884 | 456 | if (count_messages(new_purplewin)) |
| 457 | notify_win(new_purplewin); | |
| 9298 | 458 | } else { |
| 15884 | 459 | printf("if else count = %d\n", count_messages(new_purplewin)); |
| 460 | printf("if else count = %d\n", count_messages(old_purplewin)); | |
| 9298 | 461 | /* |
| 15884 | 462 | PurpleConversation *old_active_conv = NULL; |
| 463 | old_active_conv = purple_conv_window_get_active_conversation(new_purplewin); | |
| 9298 | 464 | |
| 15884 | 465 | purple_conversation_autoset_title(old_active_conv); |
| 466 | handle_urgent(old_purplewin, FALSE); | |
| 6302 | 467 | |
| 15884 | 468 | if (count_messages(old_purplewin)) |
| 469 | notify_win(old_purplewin); | |
| 9298 | 470 | |
| 15884 | 471 | purple_conversation_autoset_title(active_conv); |
| 472 | handle_urgent(new_purplewin, FALSE); | |
| 9298 | 473 | |
| 15884 | 474 | if (count_messages(new_purplewin)) |
| 475 | notify_win(new_purplewin); | |
| 9298 | 476 | */ |
| 477 | } | |
| 478 | } else { | |
| 15884 | 479 | printf("else count = %d\n", count_messages(new_purplewin)); |
| 480 | printf("else count = %d\n", count_messages(old_purplewin)); | |
| 9298 | 481 | /* |
| 15884 | 482 | purple_conversation_autoset_title(active_conv); |
| 483 | handle_urgent(old_purplewin, FALSE); | |
| 9298 | 484 | |
| 15884 | 485 | if (count_messages(old_purplewin)) |
| 486 | notify_win(old_purplewin); | |
| 9298 | 487 | */ |
| 488 | } | |
| 4035 | 489 | } |
|
9303
e257ad08c77c
[gaim-migrate @ 10107]
Mark Doliner <markdoliner@pidgin.im>
parents:
9298
diff
changeset
|
490 | #endif |
| 4035 | 491 | |
| 6977 | 492 | static void |
| 15884 | 493 | handle_string(PidginWindow *purplewin) |
| 9298 | 494 | { |
| 495 | GtkWindow *window = NULL; | |
| 496 | gchar newtitle[256]; | |
| 497 | ||
| 15884 | 498 | g_return_if_fail(purplewin != NULL); |
| 9298 | 499 | |
| 15884 | 500 | window = GTK_WINDOW(purplewin->window); |
| 9298 | 501 | g_return_if_fail(window != NULL); |
| 502 | ||
| 503 | g_snprintf(newtitle, sizeof(newtitle), "%s%s", | |
| 15884 | 504 | purple_prefs_get_string("/plugins/gtk/X11/notify/title_string"), |
| 9298 | 505 | gtk_window_get_title(window)); |
| 506 | gtk_window_set_title(window, newtitle); | |
| 507 | } | |
| 508 | ||
| 509 | static void | |
| 15884 | 510 | handle_count_title(PidginWindow *purplewin) |
| 9298 | 511 | { |
| 512 | GtkWindow *window; | |
| 513 | char newtitle[256]; | |
| 514 | ||
| 15884 | 515 | g_return_if_fail(purplewin != NULL); |
| 9298 | 516 | |
| 15884 | 517 | window = GTK_WINDOW(purplewin->window); |
| 9298 | 518 | g_return_if_fail(window != NULL); |
| 519 | ||
| 10606 | 520 | g_snprintf(newtitle, sizeof(newtitle), "[%d] %s", |
| 15884 | 521 | count_messages(purplewin), gtk_window_get_title(window)); |
| 9298 | 522 | gtk_window_set_title(window, newtitle); |
| 523 | } | |
| 524 | ||
| 525 | static void | |
| 15884 | 526 | handle_count_xprop(PidginWindow *purplewin) |
| 14389 | 527 | { |
| 528 | #ifndef _WIN32 | |
| 529 | guint count; | |
| 530 | GtkWidget *window; | |
| 531 | GdkWindow *gdkwin; | |
| 532 | ||
| 15884 | 533 | window = purplewin->window; |
| 14389 | 534 | g_return_if_fail(window != NULL); |
| 535 | ||
| 15884 | 536 | if (_PurpleUnseenCount == GDK_NONE) { |
| 537 | _PurpleUnseenCount = gdk_atom_intern("_PIDGIN_UNSEEN_COUNT", FALSE); | |
| 14389 | 538 | } |
| 539 | ||
| 540 | if (_Cardinal == GDK_NONE) { | |
| 541 | _Cardinal = gdk_atom_intern("CARDINAL", FALSE); | |
| 542 | } | |
| 543 | ||
| 15884 | 544 | count = count_messages(purplewin); |
| 14389 | 545 | gdkwin = window->window; |
| 546 | ||
| 15884 | 547 | gdk_property_change(gdkwin, _PurpleUnseenCount, _Cardinal, 32, |
| 14389 | 548 | GDK_PROP_MODE_REPLACE, (guchar *) &count, 1); |
| 549 | #endif | |
| 550 | } | |
| 551 | ||
| 552 | static void | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15527
diff
changeset
|
553 | handle_urgent(PidginWindow *win, gboolean set) |
| 6977 | 554 | { |
| 12959 | 555 | #ifndef _WIN32 |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15527
diff
changeset
|
556 | pidgin_set_urgent(GTK_WINDOW(win->window), set); |
| 12959 | 557 | #endif |
| 4035 | 558 | } |
| 559 | ||
| 6977 | 560 | static void |
| 15884 | 561 | handle_raise(PidginWindow *purplewin) |
| 10606 | 562 | { |
| 15884 | 563 | pidgin_conv_window_raise(purplewin); |
| 10606 | 564 | } |
| 565 | ||
| 566 | static void | |
| 6977 | 567 | type_toggle_cb(GtkWidget *widget, gpointer data) |
| 568 | { | |
| 569 | gboolean on = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)); | |
| 570 | gchar pref[256]; | |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4218
diff
changeset
|
571 | |
| 14389 | 572 | g_snprintf(pref, sizeof(pref), "/plugins/gtk/X11/notify/%s", |
| 573 | (char *)data); | |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4218
diff
changeset
|
574 | |
| 15884 | 575 | purple_prefs_set_bool(pref, on); |
| 3374 | 576 | } |
| 577 | ||
| 6977 | 578 | static void |
| 579 | method_toggle_cb(GtkWidget *widget, gpointer data) | |
| 580 | { | |
| 581 | gboolean on = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)); | |
| 582 | gchar pref[256]; | |
| 583 | ||
| 14389 | 584 | g_snprintf(pref, sizeof(pref), "/plugins/gtk/X11/notify/%s", |
| 585 | (char *)data); | |
| 3374 | 586 | |
| 15884 | 587 | purple_prefs_set_bool(pref, on); |
| 6977 | 588 | |
| 589 | if (!strcmp(data, "method_string")) { | |
| 590 | GtkWidget *entry = g_object_get_data(G_OBJECT(widget), "title-entry"); | |
| 591 | gtk_widget_set_sensitive(entry, on); | |
| 592 | ||
| 15884 | 593 | purple_prefs_set_string("/plugins/gtk/X11/notify/title_string", |
| 14448 | 594 | gtk_entry_get_text(GTK_ENTRY(entry))); |
| 6977 | 595 | } |
| 596 | ||
| 597 | apply_method(); | |
| 3374 | 598 | } |
| 599 | ||
| 6977 | 600 | static void |
| 601 | notify_toggle_cb(GtkWidget *widget, gpointer data) | |
| 602 | { | |
| 603 | gboolean on = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)); | |
| 604 | gchar pref[256]; | |
|
6485
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6464
diff
changeset
|
605 | |
| 14389 | 606 | g_snprintf(pref, sizeof(pref), "/plugins/gtk/X11/notify/%s", |
| 607 | (char *)data); | |
| 3374 | 608 | |
| 15884 | 609 | purple_prefs_set_bool(pref, on); |
| 6977 | 610 | |
| 611 | apply_notify(); | |
| 3374 | 612 | } |
| 613 | ||
| 6977 | 614 | static gboolean |
| 615 | options_entry_cb(GtkWidget *widget, GdkEventFocus *evt, gpointer data) | |
| 616 | { | |
| 617 | if (data == NULL) | |
|
6982
12f08de92674
[gaim-migrate @ 7538]
Mark Doliner <markdoliner@pidgin.im>
parents:
6977
diff
changeset
|
618 | return FALSE; |
| 6302 | 619 | |
| 6977 | 620 | if (!strcmp(data, "method_string")) { |
| 15884 | 621 | purple_prefs_set_string("/plugins/gtk/X11/notify/title_string", |
| 14389 | 622 | gtk_entry_get_text(GTK_ENTRY(widget))); |
| 3374 | 623 | } |
| 6302 | 624 | |
| 6977 | 625 | apply_method(); |
| 6302 | 626 | |
| 627 | return FALSE; | |
| 628 | } | |
| 629 | ||
| 6977 | 630 | static void |
| 14389 | 631 | apply_method() |
| 632 | { | |
|
13664
fdc3b588f248
[gaim-migrate @ 16065]
Richard Laager <rlaager@pidgin.im>
parents:
13550
diff
changeset
|
633 | GList *convs; |
| 15884 | 634 | PidginWindow *purplewin = NULL; |
| 6977 | 635 | |
| 15884 | 636 | for (convs = purple_get_conversations(); convs != NULL; |
| 14389 | 637 | convs = convs->next) { |
| 15884 | 638 | PurpleConversation *conv = (PurpleConversation *)convs->data; |
| 6302 | 639 | |
| 6977 | 640 | /* remove notifications */ |
| 9298 | 641 | unnotify(conv, FALSE); |
| 642 | ||
| 15884 | 643 | purplewin = PIDGIN_CONVERSATION(conv)->win; |
| 644 | if (GPOINTER_TO_INT(purple_conversation_get_data(conv, "notify-message-count")) != 0) | |
| 6977 | 645 | /* reattach appropriate notifications */ |
| 14385 | 646 | notify(conv, FALSE); |
| 6977 | 647 | } |
| 3374 | 648 | } |
| 649 | ||
| 6977 | 650 | static void |
| 651 | apply_notify() | |
| 652 | { | |
| 15884 | 653 | GList *convs = purple_get_conversations(); |
|
6485
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6464
diff
changeset
|
654 | |
| 6977 | 655 | while (convs) { |
| 15884 | 656 | PurpleConversation *conv = (PurpleConversation *)convs->data; |
| 4203 | 657 | |
| 6977 | 658 | /* detach signals */ |
| 659 | detach_signals(conv); | |
| 660 | /* reattach appropriate signals */ | |
| 661 | attach_signals(conv); | |
| 4035 | 662 | |
| 6977 | 663 | convs = convs->next; |
| 4035 | 664 | } |
| 665 | } | |
| 666 | ||
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
667 | static GtkWidget * |
| 15884 | 668 | get_config_frame(PurplePlugin *plugin) |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
669 | { |
| 6977 | 670 | GtkWidget *ret = NULL, *frame = NULL; |
| 671 | GtkWidget *vbox = NULL, *hbox = NULL; | |
|
13237
9556cdf38196
[gaim-migrate @ 15602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13234
diff
changeset
|
672 | GtkWidget *toggle = NULL, *entry = NULL, *ref; |
| 6302 | 673 | |
| 3565 | 674 | ret = gtk_vbox_new(FALSE, 18); |
| 6302 | 675 | gtk_container_set_border_width(GTK_CONTAINER (ret), 12); |
| 3392 | 676 | |
| 6302 | 677 | /*---------- "Notify For" ----------*/ |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15527
diff
changeset
|
678 | frame = pidgin_make_frame(ret, _("Notify For")); |
| 6302 | 679 | vbox = gtk_vbox_new(FALSE, 5); |
| 680 | gtk_container_add(GTK_CONTAINER(frame), vbox); | |
| 681 | ||
| 3710 | 682 | toggle = gtk_check_button_new_with_mnemonic(_("_IM windows")); |
| 683 | gtk_box_pack_start(GTK_BOX(vbox), toggle, FALSE, FALSE, 0); | |
| 6977 | 684 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toggle), |
| 15884 | 685 | purple_prefs_get_bool("/plugins/gtk/X11/notify/type_im")); |
| 6977 | 686 | g_signal_connect(G_OBJECT(toggle), "toggled", |
| 9298 | 687 | G_CALLBACK(type_toggle_cb), "type_im"); |
| 3710 | 688 | |
| 6977 | 689 | toggle = gtk_check_button_new_with_mnemonic(_("C_hat windows")); |
| 3710 | 690 | gtk_box_pack_start(GTK_BOX(vbox), toggle, FALSE, FALSE, 0); |
| 6977 | 691 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toggle), |
| 15884 | 692 | purple_prefs_get_bool("/plugins/gtk/X11/notify/type_chat")); |
| 6977 | 693 | g_signal_connect(G_OBJECT(toggle), "toggled", |
| 9298 | 694 | G_CALLBACK(type_toggle_cb), "type_chat"); |
| 6977 | 695 | |
|
13237
9556cdf38196
[gaim-migrate @ 15602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13234
diff
changeset
|
696 | ref = toggle; |
|
13550
55c77cece2d0
[gaim-migrate @ 15926]
Richard Laager <rlaager@pidgin.im>
parents:
13237
diff
changeset
|
697 | 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
|
698 | 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
|
699 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toggle), |
| 15884 | 700 | purple_prefs_get_bool("/plugins/gtk/X11/notify/type_chat_nick")); |
|
13237
9556cdf38196
[gaim-migrate @ 15602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13234
diff
changeset
|
701 | g_signal_connect(G_OBJECT(toggle), "toggled", |
|
9556cdf38196
[gaim-migrate @ 15602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13234
diff
changeset
|
702 | G_CALLBACK(type_toggle_cb), "type_chat_nick"); |
|
9556cdf38196
[gaim-migrate @ 15602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13234
diff
changeset
|
703 | 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
|
704 | g_signal_connect(G_OBJECT(ref), "toggled", |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15527
diff
changeset
|
705 | G_CALLBACK(pidgin_toggle_sensitive), toggle); |
|
13237
9556cdf38196
[gaim-migrate @ 15602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13234
diff
changeset
|
706 | |
| 6977 | 707 | toggle = gtk_check_button_new_with_mnemonic(_("_Focused windows")); |
| 708 | gtk_box_pack_start(GTK_BOX(vbox), toggle, FALSE, FALSE, 0); | |
| 709 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toggle), | |
| 15884 | 710 | purple_prefs_get_bool("/plugins/gtk/X11/notify/type_focused")); |
| 6977 | 711 | g_signal_connect(G_OBJECT(toggle), "toggled", |
| 9298 | 712 | G_CALLBACK(type_toggle_cb), "type_focused"); |
| 3710 | 713 | |
| 6302 | 714 | /*---------- "Notification Methods" ----------*/ |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15527
diff
changeset
|
715 | frame = pidgin_make_frame(ret, _("Notification Methods")); |
| 6302 | 716 | vbox = gtk_vbox_new(FALSE, 5); |
| 717 | gtk_container_add(GTK_CONTAINER(frame), vbox); | |
| 718 | ||
| 6977 | 719 | /* String method button */ |
| 3565 | 720 | hbox = gtk_hbox_new(FALSE, 18); |
| 721 | gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); | |
| 6302 | 722 | toggle = gtk_check_button_new_with_mnemonic(_("Prepend _string into window title:")); |
| 6977 | 723 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toggle), |
| 15884 | 724 | purple_prefs_get_bool("/plugins/gtk/X11/notify/method_string")); |
| 3565 | 725 | gtk_box_pack_start(GTK_BOX(hbox), toggle, FALSE, FALSE, 0); |
| 6977 | 726 | |
| 6302 | 727 | entry = gtk_entry_new(); |
| 728 | gtk_box_pack_start(GTK_BOX(hbox), entry, FALSE, FALSE, 0); | |
| 729 | gtk_entry_set_max_length(GTK_ENTRY(entry), 10); | |
| 6977 | 730 | gtk_widget_set_sensitive(GTK_WIDGET(entry), |
| 15884 | 731 | purple_prefs_get_bool("/plugins/gtk/X11/notify/method_string")); |
| 6977 | 732 | gtk_entry_set_text(GTK_ENTRY(entry), |
| 15884 | 733 | purple_prefs_get_string("/plugins/gtk/X11/notify/title_string")); |
| 6977 | 734 | g_object_set_data(G_OBJECT(toggle), "title-entry", entry); |
| 735 | g_signal_connect(G_OBJECT(toggle), "toggled", | |
| 9298 | 736 | G_CALLBACK(method_toggle_cb), "method_string"); |
| 6977 | 737 | g_signal_connect(G_OBJECT(entry), "focus-out-event", |
| 9298 | 738 | G_CALLBACK(options_entry_cb), "method_string"); |
| 3374 | 739 | |
| 6977 | 740 | /* Count method button */ |
| 741 | toggle = gtk_check_button_new_with_mnemonic(_("Insert c_ount of new messages into window title")); | |
| 742 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toggle), | |
| 15884 | 743 | purple_prefs_get_bool("/plugins/gtk/X11/notify/method_count")); |
| 6977 | 744 | gtk_box_pack_start(GTK_BOX(vbox), toggle, FALSE, FALSE, 0); |
| 745 | g_signal_connect(G_OBJECT(toggle), "toggled", | |
| 9298 | 746 | G_CALLBACK(method_toggle_cb), "method_count"); |
| 4035 | 747 | |
| 12959 | 748 | #ifndef _WIN32 |
| 14389 | 749 | /* Count xprop method button */ |
| 750 | toggle = gtk_check_button_new_with_mnemonic(_("Insert count of new message into _X property")); | |
| 751 | gtk_box_pack_start(GTK_BOX(vbox), toggle, FALSE, FALSE, 0); | |
| 752 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toggle), | |
| 15884 | 753 | purple_prefs_get_bool("/plugins/gtk/X11/notify/method_count_xprop")); |
| 14389 | 754 | g_signal_connect(G_OBJECT(toggle), "toggled", |
| 755 | G_CALLBACK(method_toggle_cb), "method_count_xprop"); | |
| 756 | ||
| 6977 | 757 | /* Urgent method button */ |
| 758 | toggle = gtk_check_button_new_with_mnemonic(_("Set window manager \"_URGENT\" hint")); | |
| 759 | gtk_box_pack_start(GTK_BOX(vbox), toggle, FALSE, FALSE, 0); | |
| 760 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toggle), | |
| 15884 | 761 | purple_prefs_get_bool("/plugins/gtk/X11/notify/method_urgent")); |
| 9298 | 762 | g_signal_connect(G_OBJECT(toggle), "toggled", |
| 763 | G_CALLBACK(method_toggle_cb), "method_urgent"); | |
| 12959 | 764 | #endif |
| 3710 | 765 | |
| 10606 | 766 | /* Raise window method button */ |
| 767 | toggle = gtk_check_button_new_with_mnemonic(_("R_aise conversation window")); | |
| 768 | gtk_box_pack_start(GTK_BOX(vbox), toggle, FALSE, FALSE, 0); | |
| 769 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toggle), | |
| 15884 | 770 | purple_prefs_get_bool("/plugins/gtk/X11/notify/method_raise")); |
| 10606 | 771 | g_signal_connect(G_OBJECT(toggle), "toggled", |
| 772 | G_CALLBACK(method_toggle_cb), "method_raise"); | |
| 773 | ||
| 6977 | 774 | /*---------- "Notification Removals" ----------*/ |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15527
diff
changeset
|
775 | frame = pidgin_make_frame(ret, _("Notification Removal")); |
| 6302 | 776 | vbox = gtk_vbox_new(FALSE, 5); |
| 777 | gtk_container_add(GTK_CONTAINER(frame), vbox); | |
| 3374 | 778 | |
| 6977 | 779 | /* Remove on focus button */ |
| 780 | toggle = gtk_check_button_new_with_mnemonic(_("Remove when conversation window _gains focus")); | |
| 781 | gtk_box_pack_start(GTK_BOX(vbox), toggle, FALSE, FALSE, 0); | |
| 782 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toggle), | |
| 15884 | 783 | purple_prefs_get_bool("/plugins/gtk/X11/notify/notify_focus")); |
| 6977 | 784 | g_signal_connect(G_OBJECT(toggle), "toggled", G_CALLBACK(notify_toggle_cb), "notify_focus"); |
| 785 | ||
| 786 | /* Remove on click button */ | |
| 787 | toggle = gtk_check_button_new_with_mnemonic(_("Remove when conversation window _receives click")); | |
| 788 | gtk_box_pack_start(GTK_BOX(vbox), toggle, FALSE, FALSE, 0); | |
| 789 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toggle), | |
| 15884 | 790 | purple_prefs_get_bool("/plugins/gtk/X11/notify/notify_click")); |
| 6977 | 791 | g_signal_connect(G_OBJECT(toggle), "toggled", |
| 9298 | 792 | G_CALLBACK(notify_toggle_cb), "notify_click"); |
| 3710 | 793 | |
| 6977 | 794 | /* Remove on type button */ |
| 795 | toggle = gtk_check_button_new_with_mnemonic(_("Remove when _typing in conversation window")); | |
| 796 | gtk_box_pack_start(GTK_BOX(vbox), toggle, FALSE, FALSE, 0); | |
| 797 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toggle), | |
| 15884 | 798 | purple_prefs_get_bool("/plugins/gtk/X11/notify/notify_type")); |
| 6977 | 799 | g_signal_connect(G_OBJECT(toggle), "toggled", |
| 9298 | 800 | G_CALLBACK(notify_toggle_cb), "notify_type"); |
| 4035 | 801 | |
| 6977 | 802 | /* Remove on message send button */ |
| 803 | toggle = gtk_check_button_new_with_mnemonic(_("Remove when a _message gets sent")); | |
| 804 | gtk_box_pack_start(GTK_BOX(vbox), toggle, FALSE, FALSE, 0); | |
| 805 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toggle), | |
| 15884 | 806 | purple_prefs_get_bool("/plugins/gtk/X11/notify/notify_send")); |
| 6977 | 807 | g_signal_connect(G_OBJECT(toggle), "toggled", |
| 9298 | 808 | G_CALLBACK(notify_toggle_cb), "notify_send"); |
| 3565 | 809 | |
| 6977 | 810 | #if 0 |
| 811 | /* Remove on conversation switch button */ | |
| 9298 | 812 | toggle = gtk_check_button_new_with_mnemonic(_("Remove on switch to conversation ta_b")); |
| 6977 | 813 | gtk_box_pack_start(GTK_BOX(vbox), toggle, FALSE, FALSE, 0); |
| 814 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toggle), | |
| 15884 | 815 | purple_prefs_get_bool("/plugins/gtk/X11/notify/notify_switch")); |
| 6977 | 816 | g_signal_connect(G_OBJECT(toggle), "toggled", |
| 9298 | 817 | G_CALLBACK(notify_toggle_cb), "notify_switch"); |
| 6977 | 818 | #endif |
| 819 | ||
| 820 | gtk_widget_show_all(ret); | |
| 821 | return ret; | |
| 3374 | 822 | } |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
823 | |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
824 | static gboolean |
| 15884 | 825 | plugin_load(PurplePlugin *plugin) |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
826 | { |
| 15884 | 827 | GList *convs = purple_get_conversations(); |
| 828 | void *conv_handle = purple_conversations_get_handle(); | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15527
diff
changeset
|
829 | void *gtk_conv_handle = pidgin_conversations_get_handle(); |
| 6302 | 830 | |
| 831 | my_plugin = plugin; | |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
832 | |
| 15884 | 833 | purple_signal_connect(gtk_conv_handle, "displayed-im-msg", plugin, |
| 834 | PURPLE_CALLBACK(message_displayed_cb), NULL); | |
| 835 | purple_signal_connect(gtk_conv_handle, "displayed-chat-msg", plugin, | |
| 836 | PURPLE_CALLBACK(message_displayed_cb), NULL); | |
| 837 | purple_signal_connect(gtk_conv_handle, "conversation-switched", plugin, | |
| 838 | PURPLE_CALLBACK(conv_switched), NULL); | |
| 839 | purple_signal_connect(conv_handle, "sent-im-msg", plugin, | |
| 840 | PURPLE_CALLBACK(im_sent_im), NULL); | |
| 841 | purple_signal_connect(conv_handle, "sent-chat-msg", plugin, | |
| 842 | PURPLE_CALLBACK(chat_sent_im), NULL); | |
| 843 | purple_signal_connect(conv_handle, "conversation-created", plugin, | |
| 844 | PURPLE_CALLBACK(conv_created), NULL); | |
| 845 | purple_signal_connect(conv_handle, "chat-joined", plugin, | |
| 846 | PURPLE_CALLBACK(conv_created), NULL); | |
| 847 | purple_signal_connect(conv_handle, "deleting-conversation", plugin, | |
| 848 | PURPLE_CALLBACK(deleting_conv), NULL); | |
|
10971
4c823ffab27a
[gaim-migrate @ 12796]
Mark Doliner <markdoliner@pidgin.im>
parents:
10841
diff
changeset
|
849 | #if 0 |
| 15884 | 850 | purple_signal_connect(gtk_conv_handle, "conversation-dragging", plugin, |
| 851 | PURPLE_CALLBACK(conversation_dragging), NULL); | |
|
9303
e257ad08c77c
[gaim-migrate @ 10107]
Mark Doliner <markdoliner@pidgin.im>
parents:
9298
diff
changeset
|
852 | #endif |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
853 | |
| 6977 | 854 | while (convs) { |
| 15884 | 855 | PurpleConversation *conv = (PurpleConversation *)convs->data; |
| 6302 | 856 | |
| 857 | /* attach signals */ | |
| 6977 | 858 | attach_signals(conv); |
| 6302 | 859 | |
| 6977 | 860 | convs = convs->next; |
| 6302 | 861 | } |
| 862 | ||
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
863 | return TRUE; |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
864 | } |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
865 | |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
866 | static gboolean |
| 15884 | 867 | plugin_unload(PurplePlugin *plugin) |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
868 | { |
| 15884 | 869 | GList *convs = purple_get_conversations(); |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
870 | |
| 6977 | 871 | while (convs) { |
| 15884 | 872 | PurpleConversation *conv = (PurpleConversation *)convs->data; |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
873 | |
| 6302 | 874 | /* kill signals */ |
| 6977 | 875 | detach_signals(conv); |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
876 | |
| 6977 | 877 | convs = convs->next; |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
878 | } |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
879 | |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
880 | return TRUE; |
|
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 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15527
diff
changeset
|
883 | static PidginPluginUiInfo ui_info = |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
884 | { |
|
12600
7ecd4441fdc7
[gaim-migrate @ 14934]
Richard Laager <rlaager@pidgin.im>
parents:
12397
diff
changeset
|
885 | get_config_frame, |
|
16749
14a3fdc0aed7
Default plugins are done, for the release i'm not that concerned about plugins that do _NOT_ compile by default
Gary Kramlich <grim@reaperworld.com>
parents:
15884
diff
changeset
|
886 | 0, /* page_num (Reserved) */ |
|
14a3fdc0aed7
Default plugins are done, for the release i'm not that concerned about plugins that do _NOT_ compile by default
Gary Kramlich <grim@reaperworld.com>
parents:
15884
diff
changeset
|
887 | |
|
14a3fdc0aed7
Default plugins are done, for the release i'm not that concerned about plugins that do _NOT_ compile by default
Gary Kramlich <grim@reaperworld.com>
parents:
15884
diff
changeset
|
888 | /* padding */ |
|
14a3fdc0aed7
Default plugins are done, for the release i'm not that concerned about plugins that do _NOT_ compile by default
Gary Kramlich <grim@reaperworld.com>
parents:
15884
diff
changeset
|
889 | NULL, |
|
14a3fdc0aed7
Default plugins are done, for the release i'm not that concerned about plugins that do _NOT_ compile by default
Gary Kramlich <grim@reaperworld.com>
parents:
15884
diff
changeset
|
890 | NULL, |
|
14a3fdc0aed7
Default plugins are done, for the release i'm not that concerned about plugins that do _NOT_ compile by default
Gary Kramlich <grim@reaperworld.com>
parents:
15884
diff
changeset
|
891 | NULL, |
|
14a3fdc0aed7
Default plugins are done, for the release i'm not that concerned about plugins that do _NOT_ compile by default
Gary Kramlich <grim@reaperworld.com>
parents:
15884
diff
changeset
|
892 | NULL |
|
5205
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 | |
| 15884 | 895 | static PurplePluginInfo info = |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
896 | { |
| 15884 | 897 | PURPLE_PLUGIN_MAGIC, |
| 898 | PURPLE_MAJOR_VERSION, | |
| 899 | PURPLE_MINOR_VERSION, | |
| 900 | PURPLE_PLUGIN_STANDARD, /**< type */ | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15527
diff
changeset
|
901 | PIDGIN_PLUGIN_TYPE, /**< ui_requirement */ |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
902 | 0, /**< flags */ |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
903 | NULL, /**< dependencies */ |
| 15884 | 904 | PURPLE_PRIORITY_DEFAULT, /**< priority */ |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
905 | |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
906 | NOTIFY_PLUGIN_ID, /**< id */ |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
907 | N_("Message Notification"), /**< name */ |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
908 | VERSION, /**< version */ |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
909 | /** summary */ |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
910 | 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
|
911 | /** description */ |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
912 | N_("Provides a variety of ways of notifying you of unread messages."), |
| 14389 | 913 | /**< author */ |
| 9298 | 914 | "Etan Reisner <deryni@eden.rutgers.edu>\n\t\t\tBrian Tarricone <bjt23@cornell.edu>", |
| 15884 | 915 | PURPLE_WEBSITE, /**< homepage */ |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
916 | |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
917 | plugin_load, /**< load */ |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
918 | plugin_unload, /**< unload */ |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
919 | NULL, /**< destroy */ |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
920 | |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
921 | &ui_info, /**< ui_info */ |
| 8993 | 922 | NULL, /**< extra_info */ |
| 923 | NULL, | |
|
16749
14a3fdc0aed7
Default plugins are done, for the release i'm not that concerned about plugins that do _NOT_ compile by default
Gary Kramlich <grim@reaperworld.com>
parents:
15884
diff
changeset
|
924 | NULL, |
|
14a3fdc0aed7
Default plugins are done, for the release i'm not that concerned about plugins that do _NOT_ compile by default
Gary Kramlich <grim@reaperworld.com>
parents:
15884
diff
changeset
|
925 | |
|
14a3fdc0aed7
Default plugins are done, for the release i'm not that concerned about plugins that do _NOT_ compile by default
Gary Kramlich <grim@reaperworld.com>
parents:
15884
diff
changeset
|
926 | /* padding */ |
|
14a3fdc0aed7
Default plugins are done, for the release i'm not that concerned about plugins that do _NOT_ compile by default
Gary Kramlich <grim@reaperworld.com>
parents:
15884
diff
changeset
|
927 | NULL, |
|
14a3fdc0aed7
Default plugins are done, for the release i'm not that concerned about plugins that do _NOT_ compile by default
Gary Kramlich <grim@reaperworld.com>
parents:
15884
diff
changeset
|
928 | NULL, |
|
14a3fdc0aed7
Default plugins are done, for the release i'm not that concerned about plugins that do _NOT_ compile by default
Gary Kramlich <grim@reaperworld.com>
parents:
15884
diff
changeset
|
929 | NULL, |
| 8993 | 930 | NULL |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
931 | }; |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
932 | |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
933 | static void |
| 15884 | 934 | init_plugin(PurplePlugin *plugin) |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
935 | { |
| 15884 | 936 | purple_prefs_add_none("/plugins/gtk"); |
| 937 | purple_prefs_add_none("/plugins/gtk/X11"); | |
| 938 | purple_prefs_add_none("/plugins/gtk/X11/notify"); | |
| 6302 | 939 | |
| 15884 | 940 | purple_prefs_add_bool("/plugins/gtk/X11/notify/type_im", TRUE); |
| 941 | purple_prefs_add_bool("/plugins/gtk/X11/notify/type_chat", FALSE); | |
| 942 | purple_prefs_add_bool("/plugins/gtk/X11/notify/type_chat_nick", FALSE); | |
| 943 | purple_prefs_add_bool("/plugins/gtk/X11/notify/type_focused", FALSE); | |
| 944 | purple_prefs_add_bool("/plugins/gtk/X11/notify/method_string", FALSE); | |
| 945 | purple_prefs_add_string("/plugins/gtk/X11/notify/title_string", "(*)"); | |
| 946 | purple_prefs_add_bool("/plugins/gtk/X11/notify/method_urgent", FALSE); | |
| 947 | purple_prefs_add_bool("/plugins/gtk/X11/notify/method_count", FALSE); | |
| 948 | purple_prefs_add_bool("/plugins/gtk/X11/notify/method_count_xprop", FALSE); | |
| 949 | purple_prefs_add_bool("/plugins/gtk/X11/notify/method_raise", FALSE); | |
| 950 | purple_prefs_add_bool("/plugins/gtk/X11/notify/notify_focus", TRUE); | |
| 951 | purple_prefs_add_bool("/plugins/gtk/X11/notify/notify_click", FALSE); | |
| 952 | purple_prefs_add_bool("/plugins/gtk/X11/notify/notify_type", TRUE); | |
| 953 | purple_prefs_add_bool("/plugins/gtk/X11/notify/notify_send", TRUE); | |
| 954 | purple_prefs_add_bool("/plugins/gtk/X11/notify/notify_switch", TRUE); | |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
955 | } |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
956 | |
| 15884 | 957 | PURPLE_INIT_PLUGIN(notify, init_plugin, info) |