Sat, 27 Jan 2007 11:41:32 +0000
This should be the last of the string changes
| 14286 | 1 | /* |
| 2 | * gaim - WinGaim Options Plugin | |
| 3 | * | |
| 4 | * Gaim is the legal property of its developers, whose names are too numerous | |
| 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 | ||
| 63 | static GaimPlugin *handle = NULL; | |
| 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) { | |
| 82 | if(gaim_prefs_get_bool(PREF_DBLIST_DOCKABLE) && blist_ab->docked) { | |
| 83 | gaim_prefs_set_int(PREF_DBLIST_HEIGHT, blist_ab->undocked_height); | |
| 84 | gaim_prefs_set_int(PREF_DBLIST_SIDE, blist_ab->side); | |
| 85 | gaim_prefs_set_bool(PREF_DBLIST_DOCKED, blist_ab->docked); | |
| 86 | } else | |
| 87 | gaim_prefs_set_bool(PREF_DBLIST_DOCKED, FALSE); | |
| 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) { | |
| 104 | gaim_debug_info(WINPREFS_PLUGIN_ID, "Blist Docking...\n"); | |
| 105 | if(gaim_prefs_get_int(PREF_BLIST_ON_TOP) != BLIST_TOP_NEVER) | |
| 106 | blist_set_ontop(TRUE); | |
| 107 | } else { | |
| 108 | gaim_debug_info(WINPREFS_PLUGIN_ID, "Blist Undocking...\n"); | |
| 109 | if(gaim_prefs_get_int(PREF_BLIST_ON_TOP) == BLIST_TOP_ALWAYS) | |
| 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 | ||
| 128 | if(gaim_prefs_get_int(PREF_BLIST_ON_TOP) == BLIST_TOP_ALWAYS) | |
| 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 */ | |
| 139 | static void gaim_quit_cb() { | |
| 140 | gaim_debug_info(WINPREFS_PLUGIN_ID, "gaim_quit_cb: removing appbar\n"); | |
| 141 | blist_save_state(); | |
| 142 | blist_set_dockable(FALSE); | |
| 143 | } | |
| 144 | ||
| 145 | /* Listen for the first time the window stops being withdrawn */ | |
| 146 | static void blist_visible_cb(const char *pref, GaimPrefType type, | |
| 147 | gconstpointer value, gpointer user_data) { | |
| 148 | if(gaim_prefs_get_bool(pref)) { | |
| 149 | gtk_appbar_dock(blist_ab, | |
| 150 | gaim_prefs_get_int(PREF_DBLIST_SIDE)); | |
| 151 | ||
| 152 | if(gaim_prefs_get_int(PREF_BLIST_ON_TOP) | |
| 153 | == BLIST_TOP_DOCKED) | |
| 154 | blist_set_ontop(TRUE); | |
| 155 | ||
| 156 | /* We only need to be notified about this once */ | |
| 157 | gaim_prefs_disconnect_callback(blist_visible_cb_id); | |
| 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 = | |
| 166 | gaim_prefs_connect_callback(handle, | |
| 167 | "/gaim/gtk/blist/list_visible", | |
| 168 | blist_visible_cb, NULL); | |
| 169 | ||
| 170 | return FALSE; | |
| 171 | } | |
| 172 | ||
| 173 | static void blist_create_cb(GaimBuddyList *gaim_blist, void *data) { | |
| 174 | gaim_debug_info(WINPREFS_PLUGIN_ID, "buddy list created\n"); | |
| 175 | ||
| 176 | blist = GAIM_GTK_BLIST(gaim_blist)->window; | |
| 177 | ||
| 178 | if(gaim_prefs_get_bool(PREF_DBLIST_DOCKABLE)) { | |
| 179 | blist_set_dockable(TRUE); | |
| 180 | if(gaim_prefs_get_bool(PREF_DBLIST_DOCKED)) { | |
| 181 | blist_ab->undocked_height = gaim_prefs_get_int(PREF_DBLIST_HEIGHT); | |
| 182 | if(!(gdk_window_get_state(blist->window) | |
| 183 | & GDK_WINDOW_STATE_WITHDRAWN)) { | |
| 184 | gtk_appbar_dock(blist_ab, | |
| 185 | gaim_prefs_get_int(PREF_DBLIST_SIDE)); | |
| 186 | if(gaim_prefs_get_int(PREF_BLIST_ON_TOP) | |
| 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 | ||
| 195 | if(gaim_prefs_get_int(PREF_BLIST_ON_TOP) == BLIST_TOP_ALWAYS) | |
| 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))) |
|
aec64dbd9564
[gaim-migrate @ 16957]
Daniel Atallah <datallah@pidgin.im>
parents:
14286
diff
changeset
|
207 | runval = g_strdup_printf("%s" G_DIR_SEPARATOR_S "gaim.exe", wgaim_install_dir()); |
| 14286 | 208 | |
|
14334
aec64dbd9564
[gaim-migrate @ 16957]
Daniel Atallah <datallah@pidgin.im>
parents:
14286
diff
changeset
|
209 | if(!wgaim_write_reg_string(HKEY_CURRENT_USER, RUNKEY, "Gaim", runval) |
|
aec64dbd9564
[gaim-migrate @ 16957]
Daniel Atallah <datallah@pidgin.im>
parents:
14286
diff
changeset
|
210 | /* For Win98 */ |
|
aec64dbd9564
[gaim-migrate @ 16957]
Daniel Atallah <datallah@pidgin.im>
parents:
14286
diff
changeset
|
211 | && !wgaim_write_reg_string(HKEY_LOCAL_MACHINE, RUNKEY, "Gaim", runval)) |
|
aec64dbd9564
[gaim-migrate @ 16957]
Daniel Atallah <datallah@pidgin.im>
parents:
14286
diff
changeset
|
212 | gaim_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 | |
| 218 | winprefs_set_blist_dockable(const char *pref, GaimPrefType type, | |
| 219 | gconstpointer value, gpointer user_data) | |
| 220 | { | |
| 221 | blist_set_dockable(GPOINTER_TO_INT(value)); | |
| 222 | } | |
| 223 | ||
| 224 | static void | |
| 225 | winprefs_set_blist_ontop(const char *pref, GaimPrefType type, | |
| 226 | gconstpointer value, gpointer user_data) | |
| 227 | { | |
| 228 | gint setting = gaim_prefs_get_int(PREF_BLIST_ON_TOP); | |
| 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 |
|
f494a5f12981
[gaim-migrate @ 17452]
Daniel Atallah <datallah@pidgin.im>
parents:
14334
diff
changeset
|
237 | gtkwgaim_conv_chat_blink(GaimAccount *account, const char *who, char **message, |
|
f494a5f12981
[gaim-migrate @ 17452]
Daniel Atallah <datallah@pidgin.im>
parents:
14334
diff
changeset
|
238 | GaimConversation *conv, GaimMessageFlags flags, void *data) |
| 14286 | 239 | { |
|
14766
f6e23a87ae57
[gaim-migrate @ 17456]
Daniel Atallah <datallah@pidgin.im>
parents:
14762
diff
changeset
|
240 | if(gaim_prefs_get_bool(PREF_CHAT_BLINK)) |
|
14762
f494a5f12981
[gaim-migrate @ 17452]
Daniel Atallah <datallah@pidgin.im>
parents:
14334
diff
changeset
|
241 | gtkwgaim_conv_blink(conv, flags); |
| 14286 | 242 | |
| 243 | return FALSE; | |
| 244 | } | |
| 245 | ||
| 246 | ||
| 247 | /* | |
| 248 | * EXPORTED FUNCTIONS | |
| 249 | */ | |
| 250 | ||
| 251 | static gboolean plugin_load(GaimPlugin *plugin) { | |
| 252 | handle = plugin; | |
| 253 | ||
| 254 | /* blist docking init */ | |
| 255 | if(gaim_get_blist() && GAIM_GTK_BLIST(gaim_get_blist()) | |
| 256 | && GAIM_GTK_BLIST(gaim_get_blist())->window) { | |
| 257 | blist_create_cb(gaim_get_blist(), NULL); | |
| 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. */ | |
| 262 | gaim_signal_connect(gaim_gtk_blist_get_handle(), "gtkblist-created", | |
| 263 | plugin, GAIM_CALLBACK(blist_create_cb), NULL); | |
| 264 | ||
| 265 | gaim_signal_connect(gaim_gtk_conversations_get_handle(), | |
|
14762
f494a5f12981
[gaim-migrate @ 17452]
Daniel Atallah <datallah@pidgin.im>
parents:
14334
diff
changeset
|
266 | "displaying-chat-msg", plugin, GAIM_CALLBACK(gtkwgaim_conv_chat_blink), |
| 14286 | 267 | NULL); |
| 268 | ||
| 269 | gaim_signal_connect((void*)gaim_get_core(), "quitting", plugin, | |
| 270 | GAIM_CALLBACK(gaim_quit_cb), NULL); | |
| 271 | ||
| 272 | gaim_prefs_connect_callback(handle, PREF_BLIST_ON_TOP, | |
| 273 | winprefs_set_blist_ontop, NULL); | |
| 274 | gaim_prefs_connect_callback(handle, PREF_DBLIST_DOCKABLE, | |
| 275 | winprefs_set_blist_dockable, NULL); | |
| 276 | ||
| 277 | return TRUE; | |
| 278 | } | |
| 279 | ||
| 280 | static gboolean plugin_unload(GaimPlugin *plugin) { | |
| 281 | blist_set_dockable(FALSE); | |
| 282 | blist_set_ontop(FALSE); | |
| 283 | ||
| 284 | handle = NULL; | |
| 285 | ||
| 286 | return TRUE; | |
| 287 | } | |
| 288 | ||
| 289 | static GtkWidget* get_config_frame(GaimPlugin *plugin) { | |
| 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; |
| 14286 | 295 | |
| 296 | ret = gtk_vbox_new(FALSE, 18); | |
| 297 | gtk_container_set_border_width(GTK_CONTAINER(ret), 12); | |
| 298 | ||
| 299 | gtk_version = g_strdup_printf("GTK+\t%u.%u.%u\nGlib\t%u.%u.%u", | |
| 300 | gtk_major_version, gtk_minor_version, gtk_micro_version, | |
| 301 | glib_major_version, glib_minor_version, glib_micro_version); | |
| 302 | ||
| 303 | /* Display Installed GTK+ Runtime Version */ | |
| 304 | if(gtk_version) { | |
| 305 | GtkWidget *label; | |
| 306 | vbox = gaim_gtk_make_frame(ret, _("GTK+ Runtime Version")); | |
| 307 | label = gtk_label_new(gtk_version); | |
| 308 | gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0); | |
| 309 | gtk_widget_show(label); | |
| 310 | g_free(gtk_version); | |
| 311 | } | |
| 312 | ||
| 313 | /* Autostart */ | |
| 314 | vbox = gaim_gtk_make_frame(ret, _("Startup")); | |
|
15498
2ee3112b6f24
This should be the last of the string changes
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
315 | button = gtk_check_button_new_with_mnemonic(_("_Start " PIDGIN_NAME " on Windows startup")); |
| 14286 | 316 | 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
|
317 | |
|
aec64dbd9564
[gaim-migrate @ 16957]
Daniel Atallah <datallah@pidgin.im>
parents:
14286
diff
changeset
|
318 | if ((run_key_val = wgaim_read_reg_string(HKEY_CURRENT_USER, RUNKEY, "Gaim")) |
|
aec64dbd9564
[gaim-migrate @ 16957]
Daniel Atallah <datallah@pidgin.im>
parents:
14286
diff
changeset
|
319 | || (run_key_val = wgaim_read_reg_string(HKEY_LOCAL_MACHINE, RUNKEY, "Gaim"))) { |
|
aec64dbd9564
[gaim-migrate @ 16957]
Daniel Atallah <datallah@pidgin.im>
parents:
14286
diff
changeset
|
320 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), TRUE); |
|
aec64dbd9564
[gaim-migrate @ 16957]
Daniel Atallah <datallah@pidgin.im>
parents:
14286
diff
changeset
|
321 | g_free(run_key_val); |
| 14286 | 322 | } |
| 323 | g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(winprefs_set_autostart), NULL); | |
| 324 | gtk_widget_show(button); | |
| 325 | ||
| 326 | /* Buddy List */ | |
| 327 | vbox = gaim_gtk_make_frame(ret, _("Buddy List")); | |
| 328 | gaim_gtk_prefs_checkbox(_("_Dockable Buddy List"), | |
| 329 | PREF_DBLIST_DOCKABLE, vbox); | |
| 330 | ||
| 331 | /* Blist On Top */ | |
| 332 | gaim_gtk_prefs_dropdown(vbox, _("_Keep Buddy List window on top:"), | |
| 333 | GAIM_PREF_INT, PREF_BLIST_ON_TOP, | |
| 334 | _("Never"), BLIST_TOP_NEVER, | |
| 335 | _("Always"), BLIST_TOP_ALWAYS, | |
| 336 | /* XXX: Did this ever work? */ | |
| 337 | _("Only when docked"), BLIST_TOP_DOCKED, | |
| 338 | NULL); | |
| 339 | ||
| 340 | /* Conversations */ | |
| 341 | vbox = gaim_gtk_make_frame(ret, _("Conversations")); | |
| 342 | gaim_gtk_prefs_checkbox(_("_Flash window when chat messages are received"), | |
| 343 | PREF_CHAT_BLINK, vbox); | |
| 344 | ||
| 345 | gtk_widget_show_all(ret); | |
| 346 | return ret; | |
| 347 | } | |
| 348 | ||
| 349 | static GaimGtkPluginUiInfo ui_info = | |
| 350 | { | |
| 351 | get_config_frame, | |
| 352 | 0 | |
| 353 | }; | |
| 354 | ||
| 355 | static GaimPluginInfo info = | |
| 356 | { | |
| 357 | GAIM_PLUGIN_MAGIC, | |
| 358 | GAIM_MAJOR_VERSION, | |
| 359 | GAIM_MINOR_VERSION, | |
| 360 | GAIM_PLUGIN_STANDARD, | |
| 361 | GAIM_GTK_PLUGIN_TYPE, | |
| 362 | 0, | |
| 363 | NULL, | |
| 364 | GAIM_PRIORITY_DEFAULT, | |
| 365 | WINPREFS_PLUGIN_ID, | |
|
15498
2ee3112b6f24
This should be the last of the string changes
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
366 | N_("Pidgwin Options"), |
| 14286 | 367 | VERSION, |
|
15498
2ee3112b6f24
This should be the last of the string changes
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
368 | N_("Options specific to Windows " PIDGIN_NAME "."), |
|
2ee3112b6f24
This should be the last of the string changes
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
369 | N_("Provides options specific to Windows " PIDGIN_NAME ", such as buddy list docking."), |
| 14286 | 370 | "Herman Bloggs <hermanator12002@yahoo.com>", |
| 371 | GAIM_WEBSITE, | |
| 372 | plugin_load, | |
| 373 | plugin_unload, | |
| 374 | NULL, | |
| 375 | &ui_info, | |
| 376 | NULL, | |
| 377 | NULL, | |
| 378 | NULL | |
| 379 | }; | |
| 380 | ||
| 381 | static void | |
| 382 | init_plugin(GaimPlugin *plugin) | |
| 383 | { | |
| 384 | gaim_prefs_add_none("/plugins/gtk"); | |
| 385 | gaim_prefs_add_none("/plugins/gtk/win32"); | |
| 386 | gaim_prefs_add_none("/plugins/gtk/win32/winprefs"); | |
| 387 | gaim_prefs_add_bool(PREF_DBLIST_DOCKABLE, FALSE); | |
| 388 | gaim_prefs_add_bool(PREF_DBLIST_DOCKED, FALSE); | |
| 389 | gaim_prefs_add_int(PREF_DBLIST_HEIGHT, 0); | |
| 390 | gaim_prefs_add_int(PREF_DBLIST_SIDE, 0); | |
| 391 | gaim_prefs_add_bool(PREF_CHAT_BLINK, FALSE); | |
| 392 | ||
| 393 | /* Convert old preferences */ | |
| 394 | if(gaim_prefs_exists(PREF_DBLIST_ON_TOP)) { | |
| 395 | gint blist_top = BLIST_TOP_NEVER; | |
| 396 | if(gaim_prefs_get_bool(PREF_BLIST_ON_TOP)) | |
| 397 | blist_top = BLIST_TOP_ALWAYS; | |
| 398 | else if(gaim_prefs_get_bool(PREF_DBLIST_ON_TOP)) | |
| 399 | blist_top = BLIST_TOP_DOCKED; | |
| 400 | gaim_prefs_remove(PREF_BLIST_ON_TOP); | |
| 401 | gaim_prefs_remove(PREF_DBLIST_ON_TOP); | |
| 402 | gaim_prefs_add_int(PREF_BLIST_ON_TOP, blist_top); | |
| 403 | } else | |
| 404 | gaim_prefs_add_int(PREF_BLIST_ON_TOP, BLIST_TOP_NEVER); | |
| 405 | } | |
| 406 | ||
| 407 | GAIM_INIT_PLUGIN(winprefs, init_plugin, info) | |
| 408 |