annotate pidgin/plugins/convcolors.c @ 28264:027f342110b6

Remove directconn.c from Makefile.mingw, since nothing uses it and it includes an #error now.
author Paul Aurich <paul@darkrain42.org>
date Sat, 15 Aug 2009 19:59:14 +0000
parents af4a4ebc6441
children 4e7a9940627e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1 /*
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2 * Conversation Colors
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3 * Copyright (C) 2006
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5 * This program is free software; you can redistribute it and/or
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6 * modify it under the terms of the GNU General Public License as
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
7 * published by the Free Software Foundation; either version 2 of the
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
8 * License, or (at your option) any later version.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
9 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
10 * This program is distributed in the hope that it will be useful, but
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
13 * General Public License for more details.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
14 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
16 * along with this program; if not, write to the Free Software
19680
44b4e8bd759b The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 16678
diff changeset
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
44b4e8bd759b The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 16678
diff changeset
18 * 02111-1301, USA.
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
19 */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
20 #include "internal.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
21
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
22 #define PLUGIN_ID "gtk-plugin_pack-convcolors"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
23 #define PLUGIN_NAME N_("Conversation Colors")
25124
ea62e934c80b Fix some more mis-identified plugins, like 3b3526a0...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22050
diff changeset
24 #define PLUGIN_STATIC_NAME ConversationColors
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
25 #define PLUGIN_SUMMARY N_("Customize colors in the conversation window")
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
26 #define PLUGIN_DESCRIPTION N_("Customize colors in the conversation window")
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
27 #define PLUGIN_AUTHOR "Sadrul H Chowdhury <sadrul@users.sourceforge.net>"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
28
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
29 /* System headers */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
30 #include <gdk/gdk.h>
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
31 #include <glib.h>
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
32 #include <gtk/gtk.h>
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
33
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15821
diff changeset
34 /* Purple headers */
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
35 #include <gtkplugin.h>
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
36 #include <version.h>
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
37
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
38 #include <conversation.h>
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
39 #include <gtkconv.h>
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
40 #include <gtkprefs.h>
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
41 #include <gtkutils.h>
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
42
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
43 #define PREF_PREFIX "/plugins/gtk/" PLUGIN_ID
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
44 #define PREF_IGNORE PREF_PREFIX "/ignore_incoming"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
45 #define PREF_CHATS PREF_PREFIX "/chats"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
46 #define PREF_IMS PREF_PREFIX "/ims"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
47
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
48 #define PREF_SEND PREF_PREFIX "/send"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
49 #define PREF_SEND_C PREF_SEND "/color"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
50 #define PREF_SEND_F PREF_SEND "/format"
21676
8afd3495c488 Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <stu@nosnilmot.com>
parents: 21030
diff changeset
51 #define PREF_SEND_E PREF_SEND "/enabled"
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
52
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
53 #define PREF_RECV PREF_PREFIX "/recv"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
54 #define PREF_RECV_C PREF_RECV "/color"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
55 #define PREF_RECV_F PREF_RECV "/format"
21676
8afd3495c488 Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <stu@nosnilmot.com>
parents: 21030
diff changeset
56 #define PREF_RECV_E PREF_RECV "/enabled"
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
57
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
58 #define PREF_SYSTEM PREF_PREFIX "/system"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
59 #define PREF_SYSTEM_C PREF_SYSTEM "/color"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
60 #define PREF_SYSTEM_F PREF_SYSTEM "/format"
21676
8afd3495c488 Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <stu@nosnilmot.com>
parents: 21030
diff changeset
61 #define PREF_SYSTEM_E PREF_SYSTEM "/enabled"
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
62
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
63 #define PREF_ERROR PREF_PREFIX "/error"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
64 #define PREF_ERROR_C PREF_ERROR "/color"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
65 #define PREF_ERROR_F PREF_ERROR "/format"
21676
8afd3495c488 Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <stu@nosnilmot.com>
parents: 21030
diff changeset
66 #define PREF_ERROR_E PREF_ERROR "/enabled"
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
67
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
68 #define PREF_NICK PREF_PREFIX "/nick"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
69 #define PREF_NICK_C PREF_NICK "/color"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
70 #define PREF_NICK_F PREF_NICK "/format"
21676
8afd3495c488 Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <stu@nosnilmot.com>
parents: 21030
diff changeset
71 #define PREF_NICK_E PREF_NICK "/enabled"
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
72
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
73 enum
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
74 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
75 FONT_BOLD = 1 << 0,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
76 FONT_ITALIC = 1 << 1,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
77 FONT_UNDERLINE = 1 << 2
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
78 };
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
79
22050
2d4c3b775620 Prpls seem to be sending '\n' (or '\r\n') for newlines, instead of '<br>' to the core. Fixes #4545.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21676
diff changeset
80 static struct
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
81 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15821
diff changeset
82 PurpleMessageFlags flag;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
83 char *prefix;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
84 const char *text;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
85 } formats[] =
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
86 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15821
diff changeset
87 {PURPLE_MESSAGE_ERROR, PREF_ERROR, N_("Error Messages")},
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15821
diff changeset
88 {PURPLE_MESSAGE_NICK, PREF_NICK, N_("Highlighted Messages")},
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15821
diff changeset
89 {PURPLE_MESSAGE_SYSTEM, PREF_SYSTEM, N_("System Messages")},
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15821
diff changeset
90 {PURPLE_MESSAGE_SEND, PREF_SEND, N_("Sent Messages")},
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15821
diff changeset
91 {PURPLE_MESSAGE_RECV, PREF_RECV, N_("Received Messages")},
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
92 {0, NULL, NULL}
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
93 };
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
94
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
95 static gboolean
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15821
diff changeset
96 displaying_msg(PurpleAccount *account, const char *who, char **displaying,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15821
diff changeset
97 PurpleConversation *conv, PurpleMessageFlags flags)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
98 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
99 int i;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
100 char tmp[128], *t;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
101 gboolean bold, italic, underline;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
102 int f;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
103 const char *color;
27094
af4a4ebc6441 Add a utlity function purple_markup_is_rtl
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 25124
diff changeset
104 gboolean rtl = FALSE;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
105
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
106 for (i = 0; formats[i].prefix; i++)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
107 if (flags & formats[i].flag)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
108 break;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
109
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
110 if (!formats[i].prefix)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
111 return FALSE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
112
21676
8afd3495c488 Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <stu@nosnilmot.com>
parents: 21030
diff changeset
113 g_snprintf(tmp, sizeof(tmp), "%s/enabled", formats[i].prefix);
8afd3495c488 Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <stu@nosnilmot.com>
parents: 21030
diff changeset
114
8afd3495c488 Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <stu@nosnilmot.com>
parents: 21030
diff changeset
115 if (!purple_prefs_get_bool(tmp) ||
8afd3495c488 Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <stu@nosnilmot.com>
parents: 21030
diff changeset
116 (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_IM &&
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15821
diff changeset
117 !purple_prefs_get_bool(PREF_IMS)) ||
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15821
diff changeset
118 (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_CHAT &&
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15821
diff changeset
119 !purple_prefs_get_bool(PREF_CHATS)))
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
120 return FALSE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
121
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
122 g_snprintf(tmp, sizeof(tmp), "%s/color", formats[i].prefix);
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15821
diff changeset
123 color = purple_prefs_get_string(tmp);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
124
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
125 g_snprintf(tmp, sizeof(tmp), "%s/format", formats[i].prefix);
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15821
diff changeset
126 f = purple_prefs_get_int(tmp);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
127 bold = (f & FONT_BOLD);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
128 italic = (f & FONT_ITALIC);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
129 underline = (f & FONT_UNDERLINE);
27094
af4a4ebc6441 Add a utlity function purple_markup_is_rtl
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 25124
diff changeset
130 rtl = purple_markup_is_rtl(*displaying);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
131
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15821
diff changeset
132 if (purple_prefs_get_bool(PREF_IGNORE))
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
133 {
22050
2d4c3b775620 Prpls seem to be sending '\n' (or '\r\n') for newlines, instead of '<br>' to the core. Fixes #4545.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21676
diff changeset
134 /* This seems to be necessary, especially for received messages. */
2d4c3b775620 Prpls seem to be sending '\n' (or '\r\n') for newlines, instead of '<br>' to the core. Fixes #4545.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21676
diff changeset
135 t = *displaying;
2d4c3b775620 Prpls seem to be sending '\n' (or '\r\n') for newlines, instead of '<br>' to the core. Fixes #4545.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21676
diff changeset
136 *displaying = purple_strreplace(t, "\n", "<br>");
2d4c3b775620 Prpls seem to be sending '\n' (or '\r\n') for newlines, instead of '<br>' to the core. Fixes #4545.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21676
diff changeset
137 g_free(t);
2d4c3b775620 Prpls seem to be sending '\n' (or '\r\n') for newlines, instead of '<br>' to the core. Fixes #4545.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21676
diff changeset
138
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
139 t = *displaying;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15821
diff changeset
140 *displaying = purple_markup_strip_html(t);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
141 g_free(t);
15428
ce0cd7474b64 Fix bug #1645435. Thanks to Dennis Ristuccia (more commonly known as EvilDennisR) for helping me find the bug.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 15420
diff changeset
142
ce0cd7474b64 Fix bug #1645435. Thanks to Dennis Ristuccia (more commonly known as EvilDennisR) for helping me find the bug.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 15420
diff changeset
143 t = *displaying;
ce0cd7474b64 Fix bug #1645435. Thanks to Dennis Ristuccia (more commonly known as EvilDennisR) for helping me find the bug.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 15420
diff changeset
144 *displaying = g_markup_escape_text(t, -1);
ce0cd7474b64 Fix bug #1645435. Thanks to Dennis Ristuccia (more commonly known as EvilDennisR) for helping me find the bug.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 15420
diff changeset
145 g_free(t);
ce0cd7474b64 Fix bug #1645435. Thanks to Dennis Ristuccia (more commonly known as EvilDennisR) for helping me find the bug.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 15420
diff changeset
146
15420
b25a5eddff9c Fix convcolors to not unlinkify the links.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 15374
diff changeset
147 /* Restore the links */
b25a5eddff9c Fix convcolors to not unlinkify the links.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 15374
diff changeset
148 t = *displaying;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15821
diff changeset
149 *displaying = purple_markup_linkify(t);
15420
b25a5eddff9c Fix convcolors to not unlinkify the links.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 15374
diff changeset
150 g_free(t);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
151 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
152
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
153 if (color && *color)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
154 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
155 t = *displaying;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
156 *displaying = g_strdup_printf("<FONT COLOR=\"%s\">%s</FONT>", color, t);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
157 g_free(t);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
158 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
159
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
160 t = *displaying;
27094
af4a4ebc6441 Add a utlity function purple_markup_is_rtl
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 25124
diff changeset
161 *displaying = g_strdup_printf("%s%s%s%s%s%s%s%s%s",
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
162 bold ? "<B>" : "</B>",
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
163 italic ? "<I>" : "</I>",
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
164 underline ? "<U>" : "</U>",
27094
af4a4ebc6441 Add a utlity function purple_markup_is_rtl
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 25124
diff changeset
165 rtl ? "<SPAN style=\"direction:rtl;text-align:right;\">" : "",
af4a4ebc6441 Add a utlity function purple_markup_is_rtl
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 25124
diff changeset
166 t,
af4a4ebc6441 Add a utlity function purple_markup_is_rtl
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 25124
diff changeset
167 rtl ? "</SPAN>" : "",
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
168 bold ? "</B>" : "<B>",
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
169 italic ? "</I>" : "<I>",
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
170 underline ? "</U>" : "<U>"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
171 );
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
172 g_free(t);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
173
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
174 return FALSE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
175 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
176
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
177 static gboolean
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15821
diff changeset
178 plugin_load(PurplePlugin *plugin)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
179 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15821
diff changeset
180 purple_signal_connect(pidgin_conversations_get_handle(),
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
181 "displaying-im-msg", plugin,
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15821
diff changeset
182 PURPLE_CALLBACK(displaying_msg), NULL);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15821
diff changeset
183 purple_signal_connect(pidgin_conversations_get_handle(),
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
184 "displaying-chat-msg", plugin,
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15821
diff changeset
185 PURPLE_CALLBACK(displaying_msg), NULL);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
186 return TRUE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
187 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
188
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
189 static gboolean
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15821
diff changeset
190 plugin_unload(PurplePlugin *plugin)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
191 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
192 return TRUE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
193 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
194
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15821
diff changeset
195 /* Ripped from PurpleRC */
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
196 static void
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
197 color_response(GtkDialog *color_dialog, gint response, const char *data)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
198 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
199 if (response == GTK_RESPONSE_OK)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
200 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
201 GtkWidget *colorsel = GTK_COLOR_SELECTION_DIALOG(color_dialog)->colorsel;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
202 GdkColor color;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
203 char colorstr[8];
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
204 char tmp[128];
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
205
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
206 gtk_color_selection_get_current_color(GTK_COLOR_SELECTION(colorsel), &color);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
207
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
208 g_snprintf(colorstr, sizeof(colorstr), "#%02X%02X%02X",
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
209 color.red/256, color.green/256, color.blue/256);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
210
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
211 g_snprintf(tmp, sizeof(tmp), "%s/color", data);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
212
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15821
diff changeset
213 purple_prefs_set_string(tmp, colorstr);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
214 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
215
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
216 gtk_widget_destroy(GTK_WIDGET(color_dialog));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
217 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
218
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
219 static void
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
220 set_color(GtkWidget *widget, const char *data)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
221 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
222 GtkWidget *color_dialog = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
223 GdkColor color;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
224 char title[128];
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
225 char tmp[128];
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
226
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
227 g_snprintf(title, sizeof(title), _("Select Color for %s"), _(data));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
228 color_dialog = gtk_color_selection_dialog_new(title);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
229 g_signal_connect(G_OBJECT(color_dialog), "response",
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
230 G_CALLBACK(color_response), (gpointer)data);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
231
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
232 g_snprintf(tmp, sizeof(tmp), "%s/color", data);
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15821
diff changeset
233 if (gdk_color_parse(purple_prefs_get_string(tmp), &color))
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
234 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
235 gtk_color_selection_set_current_color(
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
236 GTK_COLOR_SELECTION(GTK_COLOR_SELECTION_DIALOG(color_dialog)->colorsel), &color);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
237 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
238
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
239 gtk_window_present(GTK_WINDOW(color_dialog));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
240 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
241
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
242 static void
21676
8afd3495c488 Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <stu@nosnilmot.com>
parents: 21030
diff changeset
243 toggle_enabled(GtkWidget *widget, gpointer data)
8afd3495c488 Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <stu@nosnilmot.com>
parents: 21030
diff changeset
244 {
8afd3495c488 Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <stu@nosnilmot.com>
parents: 21030
diff changeset
245 const char *prefix = (char *)data;
8afd3495c488 Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <stu@nosnilmot.com>
parents: 21030
diff changeset
246 gboolean e;
8afd3495c488 Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <stu@nosnilmot.com>
parents: 21030
diff changeset
247 char tmp[128];
8afd3495c488 Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <stu@nosnilmot.com>
parents: 21030
diff changeset
248
8afd3495c488 Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <stu@nosnilmot.com>
parents: 21030
diff changeset
249 g_snprintf(tmp, sizeof(tmp), "%s/enabled", prefix);
8afd3495c488 Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <stu@nosnilmot.com>
parents: 21030
diff changeset
250 e = purple_prefs_get_bool(tmp);
8afd3495c488 Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <stu@nosnilmot.com>
parents: 21030
diff changeset
251 purple_prefs_set_bool(tmp, !e);
8afd3495c488 Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <stu@nosnilmot.com>
parents: 21030
diff changeset
252 }
8afd3495c488 Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <stu@nosnilmot.com>
parents: 21030
diff changeset
253
8afd3495c488 Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <stu@nosnilmot.com>
parents: 21030
diff changeset
254 static void
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
255 toggle_something(const char *prefix, int format)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
256 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
257 int f;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
258 char tmp[128];
21676
8afd3495c488 Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <stu@nosnilmot.com>
parents: 21030
diff changeset
259
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
260 g_snprintf(tmp, sizeof(tmp), "%s/format", prefix);
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15821
diff changeset
261 f = purple_prefs_get_int(tmp);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
262 f ^= format;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15821
diff changeset
263 purple_prefs_set_int(tmp, f);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
264 }
21676
8afd3495c488 Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <stu@nosnilmot.com>
parents: 21030
diff changeset
265
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
266 static void
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
267 toggle_bold(GtkWidget *widget, gpointer data)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
268 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
269 toggle_something(data, FONT_BOLD);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
270 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
271
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
272 static void
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
273 toggle_italic(GtkWidget *widget, gpointer data)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
274 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
275 toggle_something(data, FONT_ITALIC);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
276 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
277
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
278 static void
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
279 toggle_underline(GtkWidget *widget, gpointer data)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
280 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
281 toggle_something(data, FONT_UNDERLINE);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
282 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
283
21676
8afd3495c488 Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <stu@nosnilmot.com>
parents: 21030
diff changeset
284 static void
8afd3495c488 Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <stu@nosnilmot.com>
parents: 21030
diff changeset
285 enable_toggled(const char *name, PurplePrefType type, gconstpointer val, gpointer data)
8afd3495c488 Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <stu@nosnilmot.com>
parents: 21030
diff changeset
286 {
8afd3495c488 Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <stu@nosnilmot.com>
parents: 21030
diff changeset
287 GtkWidget *widget = (GtkWidget *)data;
8afd3495c488 Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <stu@nosnilmot.com>
parents: 21030
diff changeset
288
8afd3495c488 Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <stu@nosnilmot.com>
parents: 21030
diff changeset
289 gtk_widget_set_sensitive(widget, GPOINTER_TO_INT(val));
8afd3495c488 Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <stu@nosnilmot.com>
parents: 21030
diff changeset
290 }
8afd3495c488 Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <stu@nosnilmot.com>
parents: 21030
diff changeset
291
8afd3495c488 Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <stu@nosnilmot.com>
parents: 21030
diff changeset
292 static void
8afd3495c488 Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <stu@nosnilmot.com>
parents: 21030
diff changeset
293 disconnect_prefs_callbacks(GtkObject *object, gpointer data)
8afd3495c488 Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <stu@nosnilmot.com>
parents: 21030
diff changeset
294 {
8afd3495c488 Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <stu@nosnilmot.com>
parents: 21030
diff changeset
295 PurplePlugin *plugin = (PurplePlugin *)data;
8afd3495c488 Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <stu@nosnilmot.com>
parents: 21030
diff changeset
296
8afd3495c488 Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <stu@nosnilmot.com>
parents: 21030
diff changeset
297 purple_prefs_disconnect_by_handle(plugin);
8afd3495c488 Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <stu@nosnilmot.com>
parents: 21030
diff changeset
298 }
8afd3495c488 Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <stu@nosnilmot.com>
parents: 21030
diff changeset
299
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
300 static GtkWidget *
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15821
diff changeset
301 get_config_frame(PurplePlugin *plugin)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
302 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
303 GtkWidget *ret;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
304 GtkWidget *frame;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
305 int i;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
306
15821
cebfc6af3eb5 More Gaim to Pidgin stuff
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
307 ret = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE);
cebfc6af3eb5 More Gaim to Pidgin stuff
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
308 gtk_container_set_border_width(GTK_CONTAINER(ret), PIDGIN_HIG_BORDER);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
309
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
310 for (i = 0; formats[i].prefix; i++)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
311 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
312 char tmp[128];
21676
8afd3495c488 Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <stu@nosnilmot.com>
parents: 21030
diff changeset
313 char tmp2[128];
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
314 int f;
21676
8afd3495c488 Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <stu@nosnilmot.com>
parents: 21030
diff changeset
315 gboolean e;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
316 GtkWidget *vbox, *hbox, *button;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
317
21676
8afd3495c488 Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <stu@nosnilmot.com>
parents: 21030
diff changeset
318 g_snprintf(tmp2, sizeof(tmp2), "%s/enabled", formats[i].prefix);
8afd3495c488 Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <stu@nosnilmot.com>
parents: 21030
diff changeset
319 e = purple_prefs_get_bool(tmp2);
8afd3495c488 Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <stu@nosnilmot.com>
parents: 21030
diff changeset
320
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
321 g_snprintf(tmp, sizeof(tmp), "%s/format", formats[i].prefix);
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15821
diff changeset
322 f = purple_prefs_get_int(tmp);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
323
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15428
diff changeset
324 frame = pidgin_make_frame(ret, _(formats[i].text));
15821
cebfc6af3eb5 More Gaim to Pidgin stuff
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
325 vbox = gtk_vbox_new(FALSE, PIDGIN_HIG_BOX_SPACE);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
326 gtk_box_pack_start(GTK_BOX(frame), vbox, FALSE, FALSE, 0);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
327
15821
cebfc6af3eb5 More Gaim to Pidgin stuff
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
328 hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
329 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
330
21676
8afd3495c488 Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <stu@nosnilmot.com>
parents: 21030
diff changeset
331 button = gtk_check_button_new_with_label(_("Enabled"));
8afd3495c488 Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <stu@nosnilmot.com>
parents: 21030
diff changeset
332 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0);
8afd3495c488 Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <stu@nosnilmot.com>
parents: 21030
diff changeset
333 if (e)
8afd3495c488 Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <stu@nosnilmot.com>
parents: 21030
diff changeset
334 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), TRUE);
8afd3495c488 Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <stu@nosnilmot.com>
parents: 21030
diff changeset
335 g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(toggle_enabled),
8afd3495c488 Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <stu@nosnilmot.com>
parents: 21030
diff changeset
336 formats[i].prefix);
8afd3495c488 Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <stu@nosnilmot.com>
parents: 21030
diff changeset
337
15507
311315e979f7 gtkutils changes
Sean Egan <seanegan@gmail.com>
parents: 15501
diff changeset
338 button = pidgin_pixbuf_button_from_stock(" Color", GTK_STOCK_SELECT_COLOR,
311315e979f7 gtkutils changes
Sean Egan <seanegan@gmail.com>
parents: 15501
diff changeset
339 PIDGIN_BUTTON_HORIZONTAL);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
340 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
341 g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(set_color),
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
342 formats[i].prefix);
21676
8afd3495c488 Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <stu@nosnilmot.com>
parents: 21030
diff changeset
343 gtk_widget_set_sensitive(button, e);
8afd3495c488 Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <stu@nosnilmot.com>
parents: 21030
diff changeset
344 purple_prefs_connect_callback(plugin, tmp2, enable_toggled, button);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
345
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
346 button = gtk_check_button_new_with_label(_("Bold"));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
347 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
348 if (f & FONT_BOLD)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
349 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), TRUE);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
350 g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(toggle_bold),
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
351 formats[i].prefix);
21676
8afd3495c488 Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <stu@nosnilmot.com>
parents: 21030
diff changeset
352 gtk_widget_set_sensitive(button, e);
8afd3495c488 Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <stu@nosnilmot.com>
parents: 21030
diff changeset
353 purple_prefs_connect_callback(plugin, tmp2, enable_toggled, button);
8afd3495c488 Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <stu@nosnilmot.com>
parents: 21030
diff changeset
354
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
355 button = gtk_check_button_new_with_label(_("Italic"));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
356 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
357 if (f & FONT_ITALIC)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
358 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), TRUE);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
359 g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(toggle_italic),
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
360 formats[i].prefix);
21676
8afd3495c488 Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <stu@nosnilmot.com>
parents: 21030
diff changeset
361 gtk_widget_set_sensitive(button, e);
8afd3495c488 Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <stu@nosnilmot.com>
parents: 21030
diff changeset
362 purple_prefs_connect_callback(plugin, tmp2, enable_toggled, button);
8afd3495c488 Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <stu@nosnilmot.com>
parents: 21030
diff changeset
363
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
364 button = gtk_check_button_new_with_label(_("Underline"));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
365 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
366 if (f & FONT_UNDERLINE)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
367 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), TRUE);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
368 g_signal_connect(G_OBJECT(button), "clicked",
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
369 G_CALLBACK(toggle_underline), formats[i].prefix);
21676
8afd3495c488 Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <stu@nosnilmot.com>
parents: 21030
diff changeset
370 gtk_widget_set_sensitive(button, e);
8afd3495c488 Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <stu@nosnilmot.com>
parents: 21030
diff changeset
371 purple_prefs_connect_callback(plugin, tmp2, enable_toggled, button);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
372 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
373
21676
8afd3495c488 Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <stu@nosnilmot.com>
parents: 21030
diff changeset
374 g_signal_connect(GTK_OBJECT(ret), "destroy", G_CALLBACK(disconnect_prefs_callbacks), plugin);
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15428
diff changeset
375 frame = pidgin_make_frame(ret, _("General"));
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15428
diff changeset
376 pidgin_prefs_checkbox(_("Ignore incoming format"), PREF_IGNORE, frame);
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15428
diff changeset
377 pidgin_prefs_checkbox(_("Apply in Chats"), PREF_CHATS, frame);
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15428
diff changeset
378 pidgin_prefs_checkbox(_("Apply in IMs"), PREF_IMS, frame);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
379
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
380 gtk_widget_show_all(ret);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
381 return ret;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
382 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
383
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15428
diff changeset
384 static PidginPluginUiInfo ui_info =
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
385 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
386 get_config_frame,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
387 0,
16678
3d41d0d7fb9b 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: 15823
diff changeset
388
3d41d0d7fb9b 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: 15823
diff changeset
389 /* padding */
3d41d0d7fb9b 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: 15823
diff changeset
390 NULL,
3d41d0d7fb9b 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: 15823
diff changeset
391 NULL,
3d41d0d7fb9b 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: 15823
diff changeset
392 NULL,
3d41d0d7fb9b 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: 15823
diff changeset
393 NULL
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
394 };
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
395
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15821
diff changeset
396 static PurplePluginInfo info =
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
397 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15821
diff changeset
398 PURPLE_PLUGIN_MAGIC, /* Magic */
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15821
diff changeset
399 PURPLE_MAJOR_VERSION, /* Purple Major Version */
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15821
diff changeset
400 PURPLE_MINOR_VERSION, /* Purple Minor Version */
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15821
diff changeset
401 PURPLE_PLUGIN_STANDARD, /* plugin type */
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15428
diff changeset
402 PIDGIN_PLUGIN_TYPE, /* ui requirement */
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
403 0, /* flags */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
404 NULL, /* dependencies */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15821
diff changeset
405 PURPLE_PRIORITY_DEFAULT, /* priority */
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
406
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
407 PLUGIN_ID, /* plugin id */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
408 PLUGIN_NAME, /* name */
21030
3cc856ca2338 Add a --with-extraversion option to ./configure so packagers can fine tune
Stu Tomlinson <stu@nosnilmot.com>
parents: 19680
diff changeset
409 DISPLAY_VERSION, /* version */
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
410 PLUGIN_SUMMARY, /* summary */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
411 PLUGIN_DESCRIPTION, /* description */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
412 PLUGIN_AUTHOR, /* author */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15821
diff changeset
413 PURPLE_WEBSITE, /* website */
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
414
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
415 plugin_load, /* load */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
416 plugin_unload, /* unload */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
417 NULL, /* destroy */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
418
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
419 &ui_info, /* ui_info */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
420 NULL, /* extra_info */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
421 NULL, /* prefs_info */
16678
3d41d0d7fb9b 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: 15823
diff changeset
422 NULL, /* actions */
3d41d0d7fb9b 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: 15823
diff changeset
423
3d41d0d7fb9b 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: 15823
diff changeset
424 /* padding */
3d41d0d7fb9b 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: 15823
diff changeset
425 NULL,
3d41d0d7fb9b 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: 15823
diff changeset
426 NULL,
3d41d0d7fb9b 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: 15823
diff changeset
427 NULL,
3d41d0d7fb9b 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: 15823
diff changeset
428 NULL
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
429 };
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
430
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
431 static void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15821
diff changeset
432 init_plugin(PurplePlugin *plugin)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
433 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15821
diff changeset
434 purple_prefs_add_none(PREF_PREFIX);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
435
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15821
diff changeset
436 purple_prefs_add_bool(PREF_IGNORE, TRUE);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15821
diff changeset
437 purple_prefs_add_bool(PREF_CHATS, TRUE);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15821
diff changeset
438 purple_prefs_add_bool(PREF_IMS, TRUE);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
439
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15821
diff changeset
440 purple_prefs_add_none(PREF_SEND);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15821
diff changeset
441 purple_prefs_add_none(PREF_RECV);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15821
diff changeset
442 purple_prefs_add_none(PREF_SYSTEM);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15821
diff changeset
443 purple_prefs_add_none(PREF_ERROR);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15821
diff changeset
444 purple_prefs_add_none(PREF_NICK);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
445
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15821
diff changeset
446 purple_prefs_add_string(PREF_SEND_C, "#909090");
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15821
diff changeset
447 purple_prefs_add_string(PREF_RECV_C, "#000000");
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15821
diff changeset
448 purple_prefs_add_string(PREF_SYSTEM_C, "#50a050");
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15821
diff changeset
449 purple_prefs_add_string(PREF_ERROR_C, "#ff0000");
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15821
diff changeset
450 purple_prefs_add_string(PREF_NICK_C, "#0000dd");
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
451
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15821
diff changeset
452 purple_prefs_add_int(PREF_SEND_F, 0);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15821
diff changeset
453 purple_prefs_add_int(PREF_RECV_F, 0);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15821
diff changeset
454 purple_prefs_add_int(PREF_SYSTEM_F, FONT_ITALIC);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15821
diff changeset
455 purple_prefs_add_int(PREF_ERROR_F, FONT_BOLD | FONT_UNDERLINE);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15821
diff changeset
456 purple_prefs_add_int(PREF_NICK_F, FONT_BOLD);
21676
8afd3495c488 Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <stu@nosnilmot.com>
parents: 21030
diff changeset
457
8afd3495c488 Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <stu@nosnilmot.com>
parents: 21030
diff changeset
458 purple_prefs_add_bool(PREF_SEND_E, TRUE);
8afd3495c488 Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <stu@nosnilmot.com>
parents: 21030
diff changeset
459 purple_prefs_add_bool(PREF_RECV_E, TRUE);
8afd3495c488 Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <stu@nosnilmot.com>
parents: 21030
diff changeset
460 purple_prefs_add_bool(PREF_SYSTEM_E, TRUE);
8afd3495c488 Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <stu@nosnilmot.com>
parents: 21030
diff changeset
461 purple_prefs_add_bool(PREF_ERROR_E, TRUE);
8afd3495c488 Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <stu@nosnilmot.com>
parents: 21030
diff changeset
462 purple_prefs_add_bool(PREF_NICK_E, TRUE);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
463 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
464
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15821
diff changeset
465 PURPLE_INIT_PLUGIN(PLUGIN_STATIC_NAME, init_plugin, info)