Sun, 22 Jul 2007 08:14:16 +0000
revert 'no visible tabs when only one conversation' as it proved unpopular. Made tabs only fill the entire width of the notebook when there's only one tab to avoid http://pidgin.im/~deryni/that_just_looks_dumb.png
| 15231 | 1 | /* |
| 2 | * Conversation Colors | |
| 3 | * Copyright (C) 2006 | |
| 4 | * | |
| 5 | * This program is free software; you can redistribute it and/or | |
| 6 | * modify it under the terms of the GNU General Public License as | |
| 7 | * published by the Free Software Foundation; either version 2 of the | |
| 8 | * License, or (at your option) any later version. | |
| 9 | * | |
| 10 | * This program is distributed in the hope that it will be useful, but | |
| 11 | * WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | * General Public License for more details. | |
| 14 | * | |
| 15 | * You should have received a copy of the GNU General Public License | |
| 16 | * along with this program; if not, write to the Free Software | |
| 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA | |
| 18 | * 02111-1307, USA. | |
| 19 | */ | |
| 20 | #include "internal.h" | |
| 21 | ||
| 22 | #define PLUGIN_ID "gtk-plugin_pack-convcolors" | |
|
15418
bf287f742a5a
[gaim-migrate @ 18149]
Luke Schierer <lschiere@pidgin.im>
parents:
15231
diff
changeset
|
23 | #define PLUGIN_NAME N_("Conversation Colors") |
| 15231 | 24 | #define PLUGIN_STATIC_NAME "Conversation Colors" |
|
15418
bf287f742a5a
[gaim-migrate @ 18149]
Luke Schierer <lschiere@pidgin.im>
parents:
15231
diff
changeset
|
25 | #define PLUGIN_SUMMARY N_("Customize colors in the conversation window") |
|
bf287f742a5a
[gaim-migrate @ 18149]
Luke Schierer <lschiere@pidgin.im>
parents:
15231
diff
changeset
|
26 | #define PLUGIN_DESCRIPTION N_("Customize colors in the conversation window") |
| 15231 | 27 | #define PLUGIN_AUTHOR "Sadrul H Chowdhury <sadrul@users.sourceforge.net>" |
| 28 | ||
| 29 | /* System headers */ | |
| 30 | #include <gdk/gdk.h> | |
| 31 | #include <glib.h> | |
| 32 | #include <gtk/gtk.h> | |
| 33 | ||
| 15884 | 34 | /* Purple headers */ |
| 15231 | 35 | #include <gtkplugin.h> |
| 36 | #include <version.h> | |
| 37 | ||
| 38 | #include <conversation.h> | |
| 39 | #include <gtkconv.h> | |
| 40 | #include <gtkprefs.h> | |
| 41 | #include <gtkutils.h> | |
| 42 | ||
| 43 | #define PREF_PREFIX "/plugins/gtk/" PLUGIN_ID | |
| 44 | #define PREF_IGNORE PREF_PREFIX "/ignore_incoming" | |
| 45 | #define PREF_CHATS PREF_PREFIX "/chats" | |
| 46 | #define PREF_IMS PREF_PREFIX "/ims" | |
| 47 | ||
| 48 | #define PREF_SEND PREF_PREFIX "/send" | |
| 49 | #define PREF_SEND_C PREF_SEND "/color" | |
| 50 | #define PREF_SEND_F PREF_SEND "/format" | |
| 51 | ||
| 52 | #define PREF_RECV PREF_PREFIX "/recv" | |
| 53 | #define PREF_RECV_C PREF_RECV "/color" | |
| 54 | #define PREF_RECV_F PREF_RECV "/format" | |
| 55 | ||
| 56 | #define PREF_SYSTEM PREF_PREFIX "/system" | |
| 57 | #define PREF_SYSTEM_C PREF_SYSTEM "/color" | |
| 58 | #define PREF_SYSTEM_F PREF_SYSTEM "/format" | |
| 59 | ||
| 60 | #define PREF_ERROR PREF_PREFIX "/error" | |
| 61 | #define PREF_ERROR_C PREF_ERROR "/color" | |
| 62 | #define PREF_ERROR_F PREF_ERROR "/format" | |
| 63 | ||
| 64 | #define PREF_NICK PREF_PREFIX "/nick" | |
| 65 | #define PREF_NICK_C PREF_NICK "/color" | |
| 66 | #define PREF_NICK_F PREF_NICK "/format" | |
| 67 | ||
| 68 | enum | |
| 69 | { | |
| 70 | FONT_BOLD = 1 << 0, | |
| 71 | FONT_ITALIC = 1 << 1, | |
| 72 | FONT_UNDERLINE = 1 << 2 | |
| 73 | }; | |
| 74 | ||
| 75 | struct | |
| 76 | { | |
| 15884 | 77 | PurpleMessageFlags flag; |
| 15231 | 78 | char *prefix; |
| 79 | const char *text; | |
| 80 | } formats[] = | |
| 81 | { | |
| 15884 | 82 | {PURPLE_MESSAGE_ERROR, PREF_ERROR, N_("Error Messages")}, |
| 83 | {PURPLE_MESSAGE_NICK, PREF_NICK, N_("Highlighted Messages")}, | |
| 84 | {PURPLE_MESSAGE_SYSTEM, PREF_SYSTEM, N_("System Messages")}, | |
| 85 | {PURPLE_MESSAGE_SEND, PREF_SEND, N_("Sent Messages")}, | |
| 86 | {PURPLE_MESSAGE_RECV, PREF_RECV, N_("Received Messages")}, | |
| 15231 | 87 | {0, NULL, NULL} |
| 88 | }; | |
| 89 | ||
| 90 | static gboolean | |
| 15884 | 91 | displaying_msg(PurpleAccount *account, const char *who, char **displaying, |
| 92 | PurpleConversation *conv, PurpleMessageFlags flags) | |
| 15231 | 93 | { |
| 94 | int i; | |
| 95 | char tmp[128], *t; | |
| 96 | gboolean bold, italic, underline; | |
| 97 | int f; | |
| 98 | const char *color; | |
| 99 | ||
| 100 | for (i = 0; formats[i].prefix; i++) | |
| 101 | if (flags & formats[i].flag) | |
| 102 | break; | |
| 103 | ||
| 104 | if (!formats[i].prefix) | |
| 105 | return FALSE; | |
| 106 | ||
| 15884 | 107 | if ((purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_IM && |
| 108 | !purple_prefs_get_bool(PREF_IMS)) || | |
| 109 | (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_CHAT && | |
| 110 | !purple_prefs_get_bool(PREF_CHATS))) | |
| 15231 | 111 | return FALSE; |
| 112 | ||
| 113 | g_snprintf(tmp, sizeof(tmp), "%s/color", formats[i].prefix); | |
| 15884 | 114 | color = purple_prefs_get_string(tmp); |
| 15231 | 115 | |
| 116 | g_snprintf(tmp, sizeof(tmp), "%s/format", formats[i].prefix); | |
| 15884 | 117 | f = purple_prefs_get_int(tmp); |
| 15231 | 118 | bold = (f & FONT_BOLD); |
| 119 | italic = (f & FONT_ITALIC); | |
| 120 | underline = (f & FONT_UNDERLINE); | |
| 121 | ||
| 15884 | 122 | if (purple_prefs_get_bool(PREF_IGNORE)) |
| 15231 | 123 | { |
| 124 | t = *displaying; | |
| 15884 | 125 | *displaying = purple_markup_strip_html(t); |
| 15231 | 126 | g_free(t); |
|
15488
d3de0d1f569d
Fix bug #1645435. Thanks to Dennis Ristuccia (more commonly known as EvilDennisR) for helping me find the bug.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15481
diff
changeset
|
127 | |
|
d3de0d1f569d
Fix bug #1645435. Thanks to Dennis Ristuccia (more commonly known as EvilDennisR) for helping me find the bug.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15481
diff
changeset
|
128 | t = *displaying; |
|
d3de0d1f569d
Fix bug #1645435. Thanks to Dennis Ristuccia (more commonly known as EvilDennisR) for helping me find the bug.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15481
diff
changeset
|
129 | *displaying = g_markup_escape_text(t, -1); |
|
d3de0d1f569d
Fix bug #1645435. Thanks to Dennis Ristuccia (more commonly known as EvilDennisR) for helping me find the bug.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15481
diff
changeset
|
130 | g_free(t); |
|
d3de0d1f569d
Fix bug #1645435. Thanks to Dennis Ristuccia (more commonly known as EvilDennisR) for helping me find the bug.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15481
diff
changeset
|
131 | |
|
15481
6e9da7b5bd5c
Fix convcolors to not unlinkify the links.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15435
diff
changeset
|
132 | /* Restore the links */ |
|
6e9da7b5bd5c
Fix convcolors to not unlinkify the links.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15435
diff
changeset
|
133 | t = *displaying; |
| 15884 | 134 | *displaying = purple_markup_linkify(t); |
|
15481
6e9da7b5bd5c
Fix convcolors to not unlinkify the links.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15435
diff
changeset
|
135 | g_free(t); |
| 15231 | 136 | } |
| 137 | ||
| 138 | if (color && *color) | |
| 139 | { | |
| 140 | t = *displaying; | |
| 141 | *displaying = g_strdup_printf("<FONT COLOR=\"%s\">%s</FONT>", color, t); | |
| 142 | g_free(t); | |
| 143 | } | |
| 144 | ||
| 145 | t = *displaying; | |
| 146 | *displaying = g_strdup_printf("%s%s%s%s%s%s%s", | |
| 147 | bold ? "<B>" : "</B>", | |
| 148 | italic ? "<I>" : "</I>", | |
| 149 | underline ? "<U>" : "</U>", | |
| 150 | t, | |
| 151 | bold ? "</B>" : "<B>", | |
| 152 | italic ? "</I>" : "<I>", | |
| 153 | underline ? "</U>" : "<U>" | |
| 154 | ); | |
| 155 | g_free(t); | |
| 156 | ||
| 157 | return FALSE; | |
| 158 | } | |
| 159 | ||
| 160 | static gboolean | |
| 15884 | 161 | plugin_load(PurplePlugin *plugin) |
| 15231 | 162 | { |
| 15884 | 163 | purple_signal_connect(pidgin_conversations_get_handle(), |
| 15231 | 164 | "displaying-im-msg", plugin, |
| 15884 | 165 | PURPLE_CALLBACK(displaying_msg), NULL); |
| 166 | purple_signal_connect(pidgin_conversations_get_handle(), | |
| 15231 | 167 | "displaying-chat-msg", plugin, |
| 15884 | 168 | PURPLE_CALLBACK(displaying_msg), NULL); |
| 15231 | 169 | return TRUE; |
| 170 | } | |
| 171 | ||
| 172 | static gboolean | |
| 15884 | 173 | plugin_unload(PurplePlugin *plugin) |
| 15231 | 174 | { |
| 175 | return TRUE; | |
| 176 | } | |
| 177 | ||
| 15884 | 178 | /* Ripped from PurpleRC */ |
| 15231 | 179 | static void |
| 180 | color_response(GtkDialog *color_dialog, gint response, const char *data) | |
| 181 | { | |
| 182 | if (response == GTK_RESPONSE_OK) | |
| 183 | { | |
| 184 | GtkWidget *colorsel = GTK_COLOR_SELECTION_DIALOG(color_dialog)->colorsel; | |
| 185 | GdkColor color; | |
| 186 | char colorstr[8]; | |
| 187 | char tmp[128]; | |
| 188 | ||
| 189 | gtk_color_selection_get_current_color(GTK_COLOR_SELECTION(colorsel), &color); | |
| 190 | ||
| 191 | g_snprintf(colorstr, sizeof(colorstr), "#%02X%02X%02X", | |
| 192 | color.red/256, color.green/256, color.blue/256); | |
| 193 | ||
| 194 | g_snprintf(tmp, sizeof(tmp), "%s/color", data); | |
| 195 | ||
| 15884 | 196 | purple_prefs_set_string(tmp, colorstr); |
| 15231 | 197 | } |
| 198 | ||
| 199 | gtk_widget_destroy(GTK_WIDGET(color_dialog)); | |
| 200 | } | |
| 201 | ||
| 202 | static void | |
| 203 | set_color(GtkWidget *widget, const char *data) | |
| 204 | { | |
| 205 | GtkWidget *color_dialog = NULL; | |
| 206 | GdkColor color; | |
| 207 | char title[128]; | |
| 208 | char tmp[128]; | |
| 209 | ||
| 210 | g_snprintf(title, sizeof(title), _("Select Color for %s"), _(data)); | |
| 211 | color_dialog = gtk_color_selection_dialog_new(title); | |
| 212 | g_signal_connect(G_OBJECT(color_dialog), "response", | |
| 213 | G_CALLBACK(color_response), (gpointer)data); | |
| 214 | ||
| 215 | g_snprintf(tmp, sizeof(tmp), "%s/color", data); | |
| 15884 | 216 | if (gdk_color_parse(purple_prefs_get_string(tmp), &color)) |
| 15231 | 217 | { |
| 218 | gtk_color_selection_set_current_color( | |
| 219 | GTK_COLOR_SELECTION(GTK_COLOR_SELECTION_DIALOG(color_dialog)->colorsel), &color); | |
| 220 | } | |
| 221 | ||
| 222 | gtk_window_present(GTK_WINDOW(color_dialog)); | |
| 223 | } | |
| 224 | ||
| 225 | static void | |
| 226 | toggle_something(const char *prefix, int format) | |
| 227 | { | |
| 228 | int f; | |
| 229 | char tmp[128]; | |
| 230 | ||
| 231 | g_snprintf(tmp, sizeof(tmp), "%s/format", prefix); | |
| 15884 | 232 | f = purple_prefs_get_int(tmp); |
| 15231 | 233 | f ^= format; |
| 15884 | 234 | purple_prefs_set_int(tmp, f); |
| 15231 | 235 | } |
| 236 | ||
| 237 | static void | |
| 238 | toggle_bold(GtkWidget *widget, gpointer data) | |
| 239 | { | |
| 240 | toggle_something(data, FONT_BOLD); | |
| 241 | } | |
| 242 | ||
| 243 | static void | |
| 244 | toggle_italic(GtkWidget *widget, gpointer data) | |
| 245 | { | |
| 246 | toggle_something(data, FONT_ITALIC); | |
| 247 | } | |
| 248 | ||
| 249 | static void | |
| 250 | toggle_underline(GtkWidget *widget, gpointer data) | |
| 251 | { | |
| 252 | toggle_something(data, FONT_UNDERLINE); | |
| 253 | } | |
| 254 | ||
| 255 | static GtkWidget * | |
| 15884 | 256 | get_config_frame(PurplePlugin *plugin) |
| 15231 | 257 | { |
| 258 | GtkWidget *ret; | |
| 259 | GtkWidget *frame; | |
| 260 | int i; | |
| 261 | ||
| 15882 | 262 | ret = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE); |
| 263 | gtk_container_set_border_width(GTK_CONTAINER(ret), PIDGIN_HIG_BORDER); | |
| 15231 | 264 | |
| 265 | for (i = 0; formats[i].prefix; i++) | |
| 266 | { | |
| 267 | char tmp[128]; | |
| 268 | int f; | |
| 269 | GtkWidget *vbox, *hbox, *button; | |
| 270 | ||
| 271 | g_snprintf(tmp, sizeof(tmp), "%s/format", formats[i].prefix); | |
| 15884 | 272 | f = purple_prefs_get_int(tmp); |
| 15231 | 273 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15488
diff
changeset
|
274 | frame = pidgin_make_frame(ret, _(formats[i].text)); |
| 15882 | 275 | vbox = gtk_vbox_new(FALSE, PIDGIN_HIG_BOX_SPACE); |
| 15231 | 276 | gtk_box_pack_start(GTK_BOX(frame), vbox, FALSE, FALSE, 0); |
| 277 | ||
| 15882 | 278 | hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE); |
| 15231 | 279 | gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); |
| 280 | ||
| 15568 | 281 | button = pidgin_pixbuf_button_from_stock(" Color", GTK_STOCK_SELECT_COLOR, |
| 282 | PIDGIN_BUTTON_HORIZONTAL); | |
| 15231 | 283 | gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0); |
| 284 | g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(set_color), | |
| 285 | formats[i].prefix); | |
| 286 | ||
| 287 | button = gtk_check_button_new_with_label(_("Bold")); | |
| 288 | gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0); | |
| 289 | if (f & FONT_BOLD) | |
| 290 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), TRUE); | |
| 291 | g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(toggle_bold), | |
| 292 | formats[i].prefix); | |
| 293 | ||
| 294 | button = gtk_check_button_new_with_label(_("Italic")); | |
| 295 | gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0); | |
| 296 | if (f & FONT_ITALIC) | |
| 297 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), TRUE); | |
| 298 | g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(toggle_italic), | |
| 299 | formats[i].prefix); | |
| 300 | ||
| 301 | button = gtk_check_button_new_with_label(_("Underline")); | |
| 302 | gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0); | |
| 303 | if (f & FONT_UNDERLINE) | |
| 304 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), TRUE); | |
| 305 | g_signal_connect(G_OBJECT(button), "clicked", | |
| 306 | G_CALLBACK(toggle_underline), formats[i].prefix); | |
| 307 | } | |
| 308 | ||
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15488
diff
changeset
|
309 | frame = pidgin_make_frame(ret, _("General")); |
|
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15488
diff
changeset
|
310 | pidgin_prefs_checkbox(_("Ignore incoming format"), PREF_IGNORE, frame); |
|
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15488
diff
changeset
|
311 | pidgin_prefs_checkbox(_("Apply in Chats"), PREF_CHATS, frame); |
|
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15488
diff
changeset
|
312 | pidgin_prefs_checkbox(_("Apply in IMs"), PREF_IMS, frame); |
| 15231 | 313 | |
| 314 | gtk_widget_show_all(ret); | |
| 315 | return ret; | |
| 316 | } | |
| 317 | ||
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15488
diff
changeset
|
318 | static PidginPluginUiInfo ui_info = |
| 15231 | 319 | { |
| 320 | get_config_frame, | |
| 321 | 0, | |
|
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
|
322 | |
|
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
|
323 | /* 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
|
324 | 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
|
325 | 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
|
326 | 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
|
327 | NULL |
| 15231 | 328 | }; |
| 329 | ||
| 15884 | 330 | static PurplePluginInfo info = |
| 15231 | 331 | { |
| 15884 | 332 | PURPLE_PLUGIN_MAGIC, /* Magic */ |
| 333 | PURPLE_MAJOR_VERSION, /* Purple Major Version */ | |
| 334 | PURPLE_MINOR_VERSION, /* Purple Minor Version */ | |
| 335 | PURPLE_PLUGIN_STANDARD, /* plugin type */ | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15488
diff
changeset
|
336 | PIDGIN_PLUGIN_TYPE, /* ui requirement */ |
| 15231 | 337 | 0, /* flags */ |
| 338 | NULL, /* dependencies */ | |
| 15884 | 339 | PURPLE_PRIORITY_DEFAULT, /* priority */ |
| 15231 | 340 | |
| 341 | PLUGIN_ID, /* plugin id */ | |
|
15418
bf287f742a5a
[gaim-migrate @ 18149]
Luke Schierer <lschiere@pidgin.im>
parents:
15231
diff
changeset
|
342 | PLUGIN_NAME, /* name */ |
| 15231 | 343 | VERSION, /* version */ |
|
15418
bf287f742a5a
[gaim-migrate @ 18149]
Luke Schierer <lschiere@pidgin.im>
parents:
15231
diff
changeset
|
344 | PLUGIN_SUMMARY, /* summary */ |
|
bf287f742a5a
[gaim-migrate @ 18149]
Luke Schierer <lschiere@pidgin.im>
parents:
15231
diff
changeset
|
345 | PLUGIN_DESCRIPTION, /* description */ |
| 15231 | 346 | PLUGIN_AUTHOR, /* author */ |
| 15884 | 347 | PURPLE_WEBSITE, /* website */ |
| 15231 | 348 | |
| 349 | plugin_load, /* load */ | |
| 350 | plugin_unload, /* unload */ | |
| 351 | NULL, /* destroy */ | |
| 352 | ||
| 353 | &ui_info, /* ui_info */ | |
| 354 | NULL, /* extra_info */ | |
| 355 | NULL, /* prefs_info */ | |
|
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
|
356 | NULL, /* actions */ |
|
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
|
357 | |
|
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
|
358 | /* 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
|
359 | 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
|
360 | 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
|
361 | 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
|
362 | NULL |
| 15231 | 363 | }; |
| 364 | ||
| 365 | static void | |
| 15884 | 366 | init_plugin(PurplePlugin *plugin) |
| 15231 | 367 | { |
| 15884 | 368 | purple_prefs_add_none(PREF_PREFIX); |
| 15231 | 369 | |
| 15884 | 370 | purple_prefs_add_bool(PREF_IGNORE, TRUE); |
| 371 | purple_prefs_add_bool(PREF_CHATS, TRUE); | |
| 372 | purple_prefs_add_bool(PREF_IMS, TRUE); | |
| 15231 | 373 | |
| 15884 | 374 | purple_prefs_add_none(PREF_SEND); |
| 375 | purple_prefs_add_none(PREF_RECV); | |
| 376 | purple_prefs_add_none(PREF_SYSTEM); | |
| 377 | purple_prefs_add_none(PREF_ERROR); | |
| 378 | purple_prefs_add_none(PREF_NICK); | |
| 15231 | 379 | |
| 15884 | 380 | purple_prefs_add_string(PREF_SEND_C, "#909090"); |
| 381 | purple_prefs_add_string(PREF_RECV_C, "#000000"); | |
| 382 | purple_prefs_add_string(PREF_SYSTEM_C, "#50a050"); | |
| 383 | purple_prefs_add_string(PREF_ERROR_C, "#ff0000"); | |
| 384 | purple_prefs_add_string(PREF_NICK_C, "#0000dd"); | |
| 15231 | 385 | |
| 15884 | 386 | purple_prefs_add_int(PREF_SEND_F, 0); |
| 387 | purple_prefs_add_int(PREF_RECV_F, 0); | |
| 388 | purple_prefs_add_int(PREF_SYSTEM_F, FONT_ITALIC); | |
| 389 | purple_prefs_add_int(PREF_ERROR_F, FONT_BOLD | FONT_UNDERLINE); | |
| 390 | purple_prefs_add_int(PREF_NICK_F, FONT_BOLD); | |
| 15231 | 391 | } |
| 392 | ||
| 15884 | 393 | PURPLE_INIT_PLUGIN(PLUGIN_STATIC_NAME, init_plugin, info) |