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