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
| 14286 | 1 | /* |
|
16792
6174b9ff9ac5
Fix #432 - "Start Pidgin on Windows startup" doesn't work.
Daniel Atallah <datallah@pidgin.im>
parents:
16751
diff
changeset
|
2 | * pidgin - Windows Pidgin Options Plugin |
| 14286 | 3 | * |
|
16792
6174b9ff9ac5
Fix #432 - "Start Pidgin on Windows startup" doesn't work.
Daniel Atallah <datallah@pidgin.im>
parents:
16751
diff
changeset
|
4 | * Pidgin is the legal property of its developers, whose names are too numerous |
| 14286 | 5 | * to list here. Please refer to the COPYRIGHT file distributed with this |
| 6 | * source distribution. | |
| 7 | * | |
| 8 | * This program is free software; you can redistribute it and/or modify | |
| 9 | * it under the terms of the GNU General Public License as published by | |
| 10 | * the Free Software Foundation; either version 2 of the License, or | |
| 11 | * (at your option) any later version. | |
| 12 | * | |
| 13 | * This program is distributed in the hope that it will be useful, | |
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 16 | * GNU General Public License for more details. | |
| 17 | * | |
| 18 | * You should have received a copy of the GNU General Public License | |
| 19 | * along with this program; if not, write to the Free Software | |
| 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
| 21 | * | |
| 22 | */ | |
| 23 | #include <gtk/gtk.h> | |
| 24 | #include <gdk/gdkwin32.h> | |
| 25 | ||
| 26 | #include "internal.h" | |
| 27 | ||
| 28 | #include "gtkwin32dep.h" | |
| 29 | ||
| 30 | #include "core.h" | |
| 31 | #include "debug.h" | |
| 32 | #include "prefs.h" | |
| 33 | #include "signals.h" | |
| 34 | #include "version.h" | |
| 35 | ||
| 36 | #include "gtkappbar.h" | |
| 37 | #include "gtkblist.h" | |
| 38 | #include "gtkconv.h" | |
| 39 | #include "gtkplugin.h" | |
| 40 | #include "gtkprefs.h" | |
| 41 | #include "gtkutils.h" | |
| 42 | ||
| 43 | /* | |
| 44 | * MACROS & DEFINES | |
| 45 | */ | |
| 46 | #define WINPREFS_PLUGIN_ID "gtk-win-prefs" | |
| 47 | ||
|
14334
aec64dbd9564
[gaim-migrate @ 16957]
Daniel Atallah <datallah@pidgin.im>
parents:
14286
diff
changeset
|
48 | #define RUNKEY "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run" |
|
aec64dbd9564
[gaim-migrate @ 16957]
Daniel Atallah <datallah@pidgin.im>
parents:
14286
diff
changeset
|
49 | |
| 14286 | 50 | /* |
| 51 | * LOCALS | |
| 52 | */ | |
| 53 | static const char *PREF_DBLIST_DOCKABLE = "/plugins/gtk/win32/winprefs/dblist_dockable"; | |
| 54 | static const char *PREF_DBLIST_DOCKED = "/plugins/gtk/win32/winprefs/dblist_docked"; | |
| 55 | static const char *PREF_DBLIST_HEIGHT = "/plugins/gtk/win32/winprefs/dblist_height"; | |
| 56 | static const char *PREF_DBLIST_SIDE = "/plugins/gtk/win32/winprefs/dblist_side"; | |
| 57 | static const char *PREF_BLIST_ON_TOP = "/plugins/gtk/win32/winprefs/blist_on_top"; | |
| 58 | static const char *PREF_CHAT_BLINK = "/plugins/gtk/win32/winprefs/chat_blink"; | |
| 59 | ||
| 60 | /* Deprecated */ | |
| 61 | static const char *PREF_DBLIST_ON_TOP = "/plugins/gtk/win32/winprefs/dblist_on_top"; | |
| 62 | ||
| 15884 | 63 | static PurplePlugin *handle = NULL; |
| 14286 | 64 | static GtkAppBar *blist_ab = NULL; |
| 65 | static GtkWidget *blist = NULL; | |
| 66 | static guint blist_visible_cb_id = 0; | |
| 67 | ||
| 68 | enum { | |
| 69 | BLIST_TOP_NEVER = 0, | |
| 70 | BLIST_TOP_ALWAYS, | |
| 71 | BLIST_TOP_DOCKED, | |
| 72 | }; | |
| 73 | ||
| 74 | /* | |
| 75 | * CODE | |
| 76 | */ | |
| 77 | ||
| 78 | /* BLIST DOCKING */ | |
| 79 | ||
| 80 | static void blist_save_state() { | |
| 81 | if(blist_ab) { | |
| 15884 | 82 | if(purple_prefs_get_bool(PREF_DBLIST_DOCKABLE) && blist_ab->docked) { |
| 83 | purple_prefs_set_int(PREF_DBLIST_HEIGHT, blist_ab->undocked_height); | |
| 84 | purple_prefs_set_int(PREF_DBLIST_SIDE, blist_ab->side); | |
| 85 | purple_prefs_set_bool(PREF_DBLIST_DOCKED, blist_ab->docked); | |
| 14286 | 86 | } else |
| 15884 | 87 | purple_prefs_set_bool(PREF_DBLIST_DOCKED, FALSE); |
| 14286 | 88 | } |
| 89 | } | |
| 90 | ||
| 91 | static void blist_set_ontop(gboolean val) { | |
| 92 | if(!blist) | |
| 93 | return; | |
| 94 | ||
| 95 | if(val) | |
| 96 | SetWindowPos(GDK_WINDOW_HWND(blist->window), HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE); | |
| 97 | else | |
| 98 | SetWindowPos(GDK_WINDOW_HWND(blist->window), HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE); | |
| 99 | ||
| 100 | } | |
| 101 | ||
| 102 | static void blist_dock_cb(gboolean val) { | |
| 103 | if(val) { | |
| 15884 | 104 | purple_debug_info(WINPREFS_PLUGIN_ID, "Blist Docking...\n"); |
| 105 | if(purple_prefs_get_int(PREF_BLIST_ON_TOP) != BLIST_TOP_NEVER) | |
| 14286 | 106 | blist_set_ontop(TRUE); |
| 107 | } else { | |
| 15884 | 108 | purple_debug_info(WINPREFS_PLUGIN_ID, "Blist Undocking...\n"); |
| 109 | if(purple_prefs_get_int(PREF_BLIST_ON_TOP) == BLIST_TOP_ALWAYS) | |
| 14286 | 110 | blist_set_ontop(TRUE); |
| 111 | else | |
| 112 | blist_set_ontop(FALSE); | |
| 113 | } | |
| 114 | } | |
| 115 | ||
| 116 | static void blist_set_dockable(gboolean val) { | |
| 117 | if(val) { | |
| 118 | if(blist_ab == NULL && blist != NULL) { | |
| 119 | blist_ab = gtk_appbar_add(blist); | |
| 120 | gtk_appbar_add_dock_cb(blist_ab, blist_dock_cb); | |
| 121 | } | |
| 122 | } else { | |
| 123 | if(blist_ab != NULL) { | |
| 124 | gtk_appbar_remove(blist_ab); | |
| 125 | blist_ab = NULL; | |
| 126 | } | |
| 127 | ||
| 15884 | 128 | if(purple_prefs_get_int(PREF_BLIST_ON_TOP) == BLIST_TOP_ALWAYS) |
| 14286 | 129 | blist_set_ontop(TRUE); |
| 130 | else | |
| 131 | blist_set_ontop(FALSE); | |
| 132 | } | |
| 133 | } | |
| 134 | ||
| 135 | /* PLUGIN CALLBACKS */ | |
| 136 | ||
| 137 | /* We need this because the blist destroy cb won't be called before the | |
| 138 | plugin is unloaded, when quitting */ | |
| 15884 | 139 | static void purple_quit_cb() { |
| 140 | purple_debug_info(WINPREFS_PLUGIN_ID, "purple_quit_cb: removing appbar\n"); | |
| 14286 | 141 | blist_save_state(); |
| 142 | blist_set_dockable(FALSE); | |
| 143 | } | |
| 144 | ||
| 145 | /* Listen for the first time the window stops being withdrawn */ | |
| 15884 | 146 | static void blist_visible_cb(const char *pref, PurplePrefType type, |
| 14286 | 147 | gconstpointer value, gpointer user_data) { |
| 15884 | 148 | if(purple_prefs_get_bool(pref)) { |
| 14286 | 149 | gtk_appbar_dock(blist_ab, |
| 15884 | 150 | purple_prefs_get_int(PREF_DBLIST_SIDE)); |
| 14286 | 151 | |
| 15884 | 152 | if(purple_prefs_get_int(PREF_BLIST_ON_TOP) |
| 14286 | 153 | == BLIST_TOP_DOCKED) |
| 154 | blist_set_ontop(TRUE); | |
| 155 | ||
| 156 | /* We only need to be notified about this once */ | |
| 15884 | 157 | purple_prefs_disconnect_callback(blist_visible_cb_id); |
| 14286 | 158 | } |
| 159 | } | |
| 160 | ||
| 161 | /* This needs to be delayed otherwise, when the blist is originally created and | |
| 162 | * hidden, it'll trigger the blist_visible_cb */ | |
| 163 | static gboolean listen_for_blist_visible_cb(gpointer data) { | |
| 164 | if (handle != NULL) | |
| 165 | blist_visible_cb_id = | |
| 15884 | 166 | purple_prefs_connect_callback(handle, |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16073
diff
changeset
|
167 | PIDGIN_PREFS_ROOT "/blist/list_visible", |
| 14286 | 168 | blist_visible_cb, NULL); |
| 169 | ||
| 170 | return FALSE; | |
| 171 | } | |
| 172 | ||
| 15884 | 173 | static void blist_create_cb(PurpleBuddyList *purple_blist, void *data) { |
| 174 | purple_debug_info(WINPREFS_PLUGIN_ID, "buddy list created\n"); | |
| 14286 | 175 | |
| 15884 | 176 | blist = PIDGIN_BLIST(purple_blist)->window; |
| 14286 | 177 | |
| 15884 | 178 | if(purple_prefs_get_bool(PREF_DBLIST_DOCKABLE)) { |
| 14286 | 179 | blist_set_dockable(TRUE); |
| 15884 | 180 | if(purple_prefs_get_bool(PREF_DBLIST_DOCKED)) { |
| 181 | blist_ab->undocked_height = purple_prefs_get_int(PREF_DBLIST_HEIGHT); | |
| 14286 | 182 | if(!(gdk_window_get_state(blist->window) |
| 183 | & GDK_WINDOW_STATE_WITHDRAWN)) { | |
| 184 | gtk_appbar_dock(blist_ab, | |
| 15884 | 185 | purple_prefs_get_int(PREF_DBLIST_SIDE)); |
| 186 | if(purple_prefs_get_int(PREF_BLIST_ON_TOP) | |
| 14286 | 187 | == BLIST_TOP_DOCKED) |
| 188 | blist_set_ontop(TRUE); | |
| 189 | } else { | |
| 190 | g_idle_add(listen_for_blist_visible_cb, NULL); | |
| 191 | } | |
| 192 | } | |
| 193 | } | |
| 194 | ||
| 15884 | 195 | if(purple_prefs_get_int(PREF_BLIST_ON_TOP) == BLIST_TOP_ALWAYS) |
| 14286 | 196 | blist_set_ontop(TRUE); |
| 197 | ||
| 198 | } | |
| 199 | ||
| 200 | /* WIN PREFS GENERAL */ | |
| 201 | ||
| 202 | static void | |
|
14334
aec64dbd9564
[gaim-migrate @ 16957]
Daniel Atallah <datallah@pidgin.im>
parents:
14286
diff
changeset
|
203 | winprefs_set_autostart(GtkWidget *w) { |
|
aec64dbd9564
[gaim-migrate @ 16957]
Daniel Atallah <datallah@pidgin.im>
parents:
14286
diff
changeset
|
204 | char *runval = NULL; |
| 14286 | 205 | |
|
14334
aec64dbd9564
[gaim-migrate @ 16957]
Daniel Atallah <datallah@pidgin.im>
parents:
14286
diff
changeset
|
206 | if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w))) |
|
16792
6174b9ff9ac5
Fix #432 - "Start Pidgin on Windows startup" doesn't work.
Daniel Atallah <datallah@pidgin.im>
parents:
16751
diff
changeset
|
207 | runval = g_strdup_printf("%s" G_DIR_SEPARATOR_S "pidgin.exe", wpurple_install_dir()); |
| 14286 | 208 | |
|
16792
6174b9ff9ac5
Fix #432 - "Start Pidgin on Windows startup" doesn't work.
Daniel Atallah <datallah@pidgin.im>
parents:
16751
diff
changeset
|
209 | if(!wpurple_write_reg_string(HKEY_CURRENT_USER, RUNKEY, "Pidgin", runval) |
|
14334
aec64dbd9564
[gaim-migrate @ 16957]
Daniel Atallah <datallah@pidgin.im>
parents:
14286
diff
changeset
|
210 | /* For Win98 */ |
|
16792
6174b9ff9ac5
Fix #432 - "Start Pidgin on Windows startup" doesn't work.
Daniel Atallah <datallah@pidgin.im>
parents:
16751
diff
changeset
|
211 | && !wpurple_write_reg_string(HKEY_LOCAL_MACHINE, RUNKEY, "Pidgin", runval)) |
| 15884 | 212 | purple_debug_error(WINPREFS_PLUGIN_ID, "Could not set registry key value\n"); |
| 14286 | 213 | |
|
14334
aec64dbd9564
[gaim-migrate @ 16957]
Daniel Atallah <datallah@pidgin.im>
parents:
14286
diff
changeset
|
214 | g_free(runval); |
| 14286 | 215 | } |
| 216 | ||
| 217 | static void | |
| 15884 | 218 | winprefs_set_blist_dockable(const char *pref, PurplePrefType type, |
| 14286 | 219 | gconstpointer value, gpointer user_data) |
| 220 | { | |
| 221 | blist_set_dockable(GPOINTER_TO_INT(value)); | |
| 222 | } | |
| 223 | ||
| 224 | static void | |
| 15884 | 225 | winprefs_set_blist_ontop(const char *pref, PurplePrefType type, |
| 14286 | 226 | gconstpointer value, gpointer user_data) |
| 227 | { | |
| 15884 | 228 | gint setting = purple_prefs_get_int(PREF_BLIST_ON_TOP); |
| 14286 | 229 | if((setting == BLIST_TOP_DOCKED && blist_ab && blist_ab->docked) |
| 230 | || setting == BLIST_TOP_ALWAYS) | |
| 231 | blist_set_ontop(TRUE); | |
| 232 | else | |
| 233 | blist_set_ontop(FALSE); | |
| 234 | } | |
| 235 | ||
|
14762
f494a5f12981
[gaim-migrate @ 17452]
Daniel Atallah <datallah@pidgin.im>
parents:
14334
diff
changeset
|
236 | static gboolean |
| 15884 | 237 | winpidgin_conv_chat_blink(PurpleAccount *account, const char *who, char **message, |
| 238 | PurpleConversation *conv, PurpleMessageFlags flags, void *data) | |
| 14286 | 239 | { |
| 15884 | 240 | if(purple_prefs_get_bool(PREF_CHAT_BLINK)) |
|
15574
18d9d1c05994
Win32 de-gaimification of pidgin
Daniel Atallah <datallah@pidgin.im>
parents:
15562
diff
changeset
|
241 | winpidgin_conv_blink(conv, flags); |
| 14286 | 242 | |
| 243 | return FALSE; | |
| 244 | } | |
| 245 | ||
| 246 | ||
| 247 | /* | |
| 248 | * EXPORTED FUNCTIONS | |
| 249 | */ | |
| 250 | ||
| 15884 | 251 | static gboolean plugin_load(PurplePlugin *plugin) { |
| 14286 | 252 | handle = plugin; |
| 253 | ||
| 254 | /* blist docking init */ | |
| 15884 | 255 | if(purple_get_blist() && PIDGIN_BLIST(purple_get_blist()) |
| 256 | && PIDGIN_BLIST(purple_get_blist())->window) { | |
| 257 | blist_create_cb(purple_get_blist(), NULL); | |
| 14286 | 258 | } |
| 259 | ||
| 260 | /* This really shouldn't happen anymore generally, but if for some strange | |
| 261 | reason, the blist is recreated, we need to set it up again. */ | |
| 15884 | 262 | purple_signal_connect(pidgin_blist_get_handle(), "gtkblist-created", |
| 263 | plugin, PURPLE_CALLBACK(blist_create_cb), NULL); | |
| 14286 | 264 | |
| 15884 | 265 | purple_signal_connect(pidgin_conversations_get_handle(), |
| 266 | "displaying-chat-msg", plugin, PURPLE_CALLBACK(winpidgin_conv_chat_blink), | |
| 14286 | 267 | NULL); |
| 268 | ||
| 15884 | 269 | purple_signal_connect((void*)purple_get_core(), "quitting", plugin, |
| 270 | PURPLE_CALLBACK(purple_quit_cb), NULL); | |
| 14286 | 271 | |
| 15884 | 272 | purple_prefs_connect_callback(handle, PREF_BLIST_ON_TOP, |
| 14286 | 273 | winprefs_set_blist_ontop, NULL); |
| 15884 | 274 | purple_prefs_connect_callback(handle, PREF_DBLIST_DOCKABLE, |
| 14286 | 275 | winprefs_set_blist_dockable, NULL); |
| 276 | ||
| 277 | return TRUE; | |
| 278 | } | |
| 279 | ||
| 15884 | 280 | static gboolean plugin_unload(PurplePlugin *plugin) { |
| 14286 | 281 | blist_set_dockable(FALSE); |
| 282 | blist_set_ontop(FALSE); | |
| 283 | ||
| 284 | handle = NULL; | |
| 285 | ||
| 286 | return TRUE; | |
| 287 | } | |
| 288 | ||
| 15884 | 289 | static GtkWidget* get_config_frame(PurplePlugin *plugin) { |
| 14286 | 290 | GtkWidget *ret; |
| 291 | GtkWidget *vbox; | |
| 292 | GtkWidget *button; | |
|
14334
aec64dbd9564
[gaim-migrate @ 16957]
Daniel Atallah <datallah@pidgin.im>
parents:
14286
diff
changeset
|
293 | char *gtk_version = NULL; |
|
aec64dbd9564
[gaim-migrate @ 16957]
Daniel Atallah <datallah@pidgin.im>
parents:
14286
diff
changeset
|
294 | char *run_key_val; |
|
16073
e70e589dde54
more help for translators (I removed a few PIDGIN_NAME references
Nathan Walp <nwalp@pidgin.im>
parents:
15884
diff
changeset
|
295 | char *tmp; |
| 14286 | 296 | |
| 297 | ret = gtk_vbox_new(FALSE, 18); | |
| 298 | gtk_container_set_border_width(GTK_CONTAINER(ret), 12); | |
| 299 | ||
| 300 | gtk_version = g_strdup_printf("GTK+\t%u.%u.%u\nGlib\t%u.%u.%u", | |
| 301 | gtk_major_version, gtk_minor_version, gtk_micro_version, | |
| 302 | glib_major_version, glib_minor_version, glib_micro_version); | |
| 303 | ||
| 304 | /* Display Installed GTK+ Runtime Version */ | |
| 305 | if(gtk_version) { | |
| 306 | GtkWidget *label; | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15498
diff
changeset
|
307 | vbox = pidgin_make_frame(ret, _("GTK+ Runtime Version")); |
| 14286 | 308 | label = gtk_label_new(gtk_version); |
| 309 | gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0); | |
| 310 | gtk_widget_show(label); | |
| 311 | g_free(gtk_version); | |
| 312 | } | |
| 313 | ||
| 314 | /* Autostart */ | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15498
diff
changeset
|
315 | vbox = pidgin_make_frame(ret, _("Startup")); |
|
16073
e70e589dde54
more help for translators (I removed a few PIDGIN_NAME references
Nathan Walp <nwalp@pidgin.im>
parents:
15884
diff
changeset
|
316 | tmp = g_strdup_printf(_("_Start %s on Windows startup"), PIDGIN_NAME); |
|
e70e589dde54
more help for translators (I removed a few PIDGIN_NAME references
Nathan Walp <nwalp@pidgin.im>
parents:
15884
diff
changeset
|
317 | button = gtk_check_button_new_with_mnemonic(tmp); |
|
e70e589dde54
more help for translators (I removed a few PIDGIN_NAME references
Nathan Walp <nwalp@pidgin.im>
parents:
15884
diff
changeset
|
318 | g_free(tmp); |
| 14286 | 319 | gtk_box_pack_start(GTK_BOX(vbox), button, FALSE, FALSE, 0); |
|
14334
aec64dbd9564
[gaim-migrate @ 16957]
Daniel Atallah <datallah@pidgin.im>
parents:
14286
diff
changeset
|
320 | |
|
16792
6174b9ff9ac5
Fix #432 - "Start Pidgin on Windows startup" doesn't work.
Daniel Atallah <datallah@pidgin.im>
parents:
16751
diff
changeset
|
321 | if ((run_key_val = wpurple_read_reg_string(HKEY_CURRENT_USER, RUNKEY, "Pidgin")) |
|
6174b9ff9ac5
Fix #432 - "Start Pidgin on Windows startup" doesn't work.
Daniel Atallah <datallah@pidgin.im>
parents:
16751
diff
changeset
|
322 | || (run_key_val = wpurple_read_reg_string(HKEY_LOCAL_MACHINE, RUNKEY, "Pidgin"))) { |
|
14334
aec64dbd9564
[gaim-migrate @ 16957]
Daniel Atallah <datallah@pidgin.im>
parents:
14286
diff
changeset
|
323 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), TRUE); |
|
aec64dbd9564
[gaim-migrate @ 16957]
Daniel Atallah <datallah@pidgin.im>
parents:
14286
diff
changeset
|
324 | g_free(run_key_val); |
| 14286 | 325 | } |
| 326 | g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(winprefs_set_autostart), NULL); | |
| 327 | gtk_widget_show(button); | |
| 328 | ||
| 329 | /* Buddy List */ | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15498
diff
changeset
|
330 | vbox = pidgin_make_frame(ret, _("Buddy List")); |
|
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15498
diff
changeset
|
331 | pidgin_prefs_checkbox(_("_Dockable Buddy List"), |
| 14286 | 332 | PREF_DBLIST_DOCKABLE, vbox); |
| 333 | ||
| 334 | /* Blist On Top */ | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15498
diff
changeset
|
335 | pidgin_prefs_dropdown(vbox, _("_Keep Buddy List window on top:"), |
| 15884 | 336 | PURPLE_PREF_INT, PREF_BLIST_ON_TOP, |
| 14286 | 337 | _("Never"), BLIST_TOP_NEVER, |
| 338 | _("Always"), BLIST_TOP_ALWAYS, | |
| 339 | /* XXX: Did this ever work? */ | |
| 340 | _("Only when docked"), BLIST_TOP_DOCKED, | |
| 341 | NULL); | |
| 342 | ||
| 343 | /* Conversations */ | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15498
diff
changeset
|
344 | vbox = pidgin_make_frame(ret, _("Conversations")); |
|
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15498
diff
changeset
|
345 | pidgin_prefs_checkbox(_("_Flash window when chat messages are received"), |
| 14286 | 346 | PREF_CHAT_BLINK, vbox); |
| 347 | ||
| 348 | gtk_widget_show_all(ret); | |
| 349 | return ret; | |
| 350 | } | |
| 351 | ||
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15498
diff
changeset
|
352 | static PidginPluginUiInfo ui_info = |
| 14286 | 353 | { |
| 354 | get_config_frame, | |
|
16751
8e552dc2ef9f
20:06 < SimGuy> grim: add padding to the two win32 plugins while you're at it :P
Gary Kramlich <grim@reaperworld.com>
parents:
16123
diff
changeset
|
355 | 0, |
|
8e552dc2ef9f
20:06 < SimGuy> grim: add padding to the two win32 plugins while you're at it :P
Gary Kramlich <grim@reaperworld.com>
parents:
16123
diff
changeset
|
356 | |
|
8e552dc2ef9f
20:06 < SimGuy> grim: add padding to the two win32 plugins while you're at it :P
Gary Kramlich <grim@reaperworld.com>
parents:
16123
diff
changeset
|
357 | /* padding */ |
|
8e552dc2ef9f
20:06 < SimGuy> grim: add padding to the two win32 plugins while you're at it :P
Gary Kramlich <grim@reaperworld.com>
parents:
16123
diff
changeset
|
358 | NULL, |
|
8e552dc2ef9f
20:06 < SimGuy> grim: add padding to the two win32 plugins while you're at it :P
Gary Kramlich <grim@reaperworld.com>
parents:
16123
diff
changeset
|
359 | NULL, |
|
8e552dc2ef9f
20:06 < SimGuy> grim: add padding to the two win32 plugins while you're at it :P
Gary Kramlich <grim@reaperworld.com>
parents:
16123
diff
changeset
|
360 | NULL, |
|
8e552dc2ef9f
20:06 < SimGuy> grim: add padding to the two win32 plugins while you're at it :P
Gary Kramlich <grim@reaperworld.com>
parents:
16123
diff
changeset
|
361 | NULL |
| 14286 | 362 | }; |
| 363 | ||
| 15884 | 364 | static PurplePluginInfo info = |
| 14286 | 365 | { |
| 15884 | 366 | PURPLE_PLUGIN_MAGIC, |
| 367 | PURPLE_MAJOR_VERSION, | |
| 368 | PURPLE_MINOR_VERSION, | |
| 369 | PURPLE_PLUGIN_STANDARD, | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15498
diff
changeset
|
370 | PIDGIN_PLUGIN_TYPE, |
| 14286 | 371 | 0, |
| 372 | NULL, | |
| 15884 | 373 | PURPLE_PRIORITY_DEFAULT, |
| 14286 | 374 | WINPREFS_PLUGIN_ID, |
|
16792
6174b9ff9ac5
Fix #432 - "Start Pidgin on Windows startup" doesn't work.
Daniel Atallah <datallah@pidgin.im>
parents:
16751
diff
changeset
|
375 | N_("Windows Pidgin Options"), |
| 14286 | 376 | VERSION, |
|
16073
e70e589dde54
more help for translators (I removed a few PIDGIN_NAME references
Nathan Walp <nwalp@pidgin.im>
parents:
15884
diff
changeset
|
377 | N_("Options specific to Pidgin for Windows."), |
|
e70e589dde54
more help for translators (I removed a few PIDGIN_NAME references
Nathan Walp <nwalp@pidgin.im>
parents:
15884
diff
changeset
|
378 | N_("Provides options specific to Pidgin for Windows , such as buddy list docking."), |
| 14286 | 379 | "Herman Bloggs <hermanator12002@yahoo.com>", |
| 15884 | 380 | PURPLE_WEBSITE, |
| 14286 | 381 | plugin_load, |
| 382 | plugin_unload, | |
| 383 | NULL, | |
| 384 | &ui_info, | |
| 385 | NULL, | |
| 386 | NULL, | |
|
16751
8e552dc2ef9f
20:06 < SimGuy> grim: add padding to the two win32 plugins while you're at it :P
Gary Kramlich <grim@reaperworld.com>
parents:
16123
diff
changeset
|
387 | NULL, |
|
8e552dc2ef9f
20:06 < SimGuy> grim: add padding to the two win32 plugins while you're at it :P
Gary Kramlich <grim@reaperworld.com>
parents:
16123
diff
changeset
|
388 | |
|
8e552dc2ef9f
20:06 < SimGuy> grim: add padding to the two win32 plugins while you're at it :P
Gary Kramlich <grim@reaperworld.com>
parents:
16123
diff
changeset
|
389 | /* padding */ |
|
8e552dc2ef9f
20:06 < SimGuy> grim: add padding to the two win32 plugins while you're at it :P
Gary Kramlich <grim@reaperworld.com>
parents:
16123
diff
changeset
|
390 | NULL, |
|
8e552dc2ef9f
20:06 < SimGuy> grim: add padding to the two win32 plugins while you're at it :P
Gary Kramlich <grim@reaperworld.com>
parents:
16123
diff
changeset
|
391 | NULL, |
|
8e552dc2ef9f
20:06 < SimGuy> grim: add padding to the two win32 plugins while you're at it :P
Gary Kramlich <grim@reaperworld.com>
parents:
16123
diff
changeset
|
392 | NULL, |
| 14286 | 393 | NULL |
| 394 | }; | |
| 395 | ||
| 396 | static void | |
| 15884 | 397 | init_plugin(PurplePlugin *plugin) |
| 14286 | 398 | { |
| 15884 | 399 | purple_prefs_add_none("/plugins/gtk"); |
| 400 | purple_prefs_add_none("/plugins/gtk/win32"); | |
| 401 | purple_prefs_add_none("/plugins/gtk/win32/winprefs"); | |
| 402 | purple_prefs_add_bool(PREF_DBLIST_DOCKABLE, FALSE); | |
| 403 | purple_prefs_add_bool(PREF_DBLIST_DOCKED, FALSE); | |
| 404 | purple_prefs_add_int(PREF_DBLIST_HEIGHT, 0); | |
| 405 | purple_prefs_add_int(PREF_DBLIST_SIDE, 0); | |
| 406 | purple_prefs_add_bool(PREF_CHAT_BLINK, FALSE); | |
| 14286 | 407 | |
| 408 | /* Convert old preferences */ | |
| 15884 | 409 | if(purple_prefs_exists(PREF_DBLIST_ON_TOP)) { |
| 14286 | 410 | gint blist_top = BLIST_TOP_NEVER; |
| 15884 | 411 | if(purple_prefs_get_bool(PREF_BLIST_ON_TOP)) |
| 14286 | 412 | blist_top = BLIST_TOP_ALWAYS; |
| 15884 | 413 | else if(purple_prefs_get_bool(PREF_DBLIST_ON_TOP)) |
| 14286 | 414 | blist_top = BLIST_TOP_DOCKED; |
| 15884 | 415 | purple_prefs_remove(PREF_BLIST_ON_TOP); |
| 416 | purple_prefs_remove(PREF_DBLIST_ON_TOP); | |
| 417 | purple_prefs_add_int(PREF_BLIST_ON_TOP, blist_top); | |
| 14286 | 418 | } else |
| 15884 | 419 | purple_prefs_add_int(PREF_BLIST_ON_TOP, BLIST_TOP_NEVER); |
| 14286 | 420 | } |
| 421 | ||
| 15884 | 422 | PURPLE_INIT_PLUGIN(winprefs, init_plugin, info) |
| 14286 | 423 |