Sun, 08 Dec 2013 02:52:23 +0100
Win32: fix a warning
| 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 | |
|
19859
71d37b57eff2
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
19381
diff
changeset
|
20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
| 14286 | 21 | * |
| 22 | */ | |
| 23 | #include "internal.h" | |
| 24 | ||
| 25 | #include "gtkwin32dep.h" | |
| 26 | ||
| 27 | #include "core.h" | |
| 28 | #include "debug.h" | |
| 29 | #include "prefs.h" | |
| 30 | #include "signals.h" | |
| 31 | #include "version.h" | |
| 32 | ||
| 33 | #include "gtkappbar.h" | |
|
34708
dd67596485ca
Undo renames of UI blist headers back to gntblist.h and gtkblist.h
Ankit Vani <a@nevitus.org>
parents:
34706
diff
changeset
|
34 | #include "gtkblist.h" |
| 14286 | 35 | #include "gtkconv.h" |
| 36 | #include "gtkplugin.h" | |
| 37 | #include "gtkprefs.h" | |
| 38 | #include "gtkutils.h" | |
| 39 | ||
| 40 | /* | |
| 41 | * MACROS & DEFINES | |
| 42 | */ | |
| 43 | #define WINPREFS_PLUGIN_ID "gtk-win-prefs" | |
| 44 | ||
|
14334
aec64dbd9564
[gaim-migrate @ 16957]
Daniel Atallah <datallah@pidgin.im>
parents:
14286
diff
changeset
|
45 | #define RUNKEY "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run" |
|
aec64dbd9564
[gaim-migrate @ 16957]
Daniel Atallah <datallah@pidgin.im>
parents:
14286
diff
changeset
|
46 | |
| 14286 | 47 | /* |
| 48 | * LOCALS | |
| 49 | */ | |
| 50 | static const char *PREF_DBLIST_DOCKABLE = "/plugins/gtk/win32/winprefs/dblist_dockable"; | |
| 51 | static const char *PREF_DBLIST_DOCKED = "/plugins/gtk/win32/winprefs/dblist_docked"; | |
| 52 | static const char *PREF_DBLIST_HEIGHT = "/plugins/gtk/win32/winprefs/dblist_height"; | |
| 53 | static const char *PREF_DBLIST_SIDE = "/plugins/gtk/win32/winprefs/dblist_side"; | |
| 54 | static const char *PREF_BLIST_ON_TOP = "/plugins/gtk/win32/winprefs/blist_on_top"; | |
|
25544
afa0851cca1e
Remove the "Flash window when chat messages are received" pref from the winprefs
Daniel Atallah <datallah@pidgin.im>
parents:
20288
diff
changeset
|
55 | /* Deprecated */ |
| 14286 | 56 | static const char *PREF_CHAT_BLINK = "/plugins/gtk/win32/winprefs/chat_blink"; |
| 57 | static const char *PREF_DBLIST_ON_TOP = "/plugins/gtk/win32/winprefs/dblist_on_top"; | |
| 58 | ||
| 15884 | 59 | static PurplePlugin *handle = NULL; |
| 14286 | 60 | static GtkAppBar *blist_ab = NULL; |
| 61 | static GtkWidget *blist = NULL; | |
| 62 | static guint blist_visible_cb_id = 0; | |
| 63 | ||
| 64 | enum { | |
| 65 | BLIST_TOP_NEVER = 0, | |
| 66 | BLIST_TOP_ALWAYS, | |
| 67 | BLIST_TOP_DOCKED, | |
| 68 | }; | |
| 69 | ||
| 70 | /* | |
| 71 | * CODE | |
| 72 | */ | |
| 73 | ||
| 74 | /* BLIST DOCKING */ | |
| 75 | ||
| 76 | static void blist_save_state() { | |
| 77 | if(blist_ab) { | |
| 15884 | 78 | if(purple_prefs_get_bool(PREF_DBLIST_DOCKABLE) && blist_ab->docked) { |
| 79 | purple_prefs_set_int(PREF_DBLIST_HEIGHT, blist_ab->undocked_height); | |
| 80 | purple_prefs_set_int(PREF_DBLIST_SIDE, blist_ab->side); | |
| 81 | purple_prefs_set_bool(PREF_DBLIST_DOCKED, blist_ab->docked); | |
| 14286 | 82 | } else |
| 15884 | 83 | purple_prefs_set_bool(PREF_DBLIST_DOCKED, FALSE); |
| 14286 | 84 | } |
| 85 | } | |
| 86 | ||
| 87 | static void blist_set_ontop(gboolean val) { | |
| 88 | if(!blist) | |
| 89 | return; | |
| 90 | ||
|
34726
af52ff6660c0
Replaced purple_get_blist() with purple_blist_get_buddy_list()
Ankit Vani <a@nevitus.org>
parents:
34708
diff
changeset
|
91 | gtk_window_set_keep_above(GTK_WINDOW(PIDGIN_BLIST(purple_blist_get_buddy_list())->window), val); |
| 14286 | 92 | } |
| 93 | ||
| 94 | static void blist_dock_cb(gboolean val) { | |
| 95 | if(val) { | |
| 15884 | 96 | purple_debug_info(WINPREFS_PLUGIN_ID, "Blist Docking...\n"); |
| 97 | if(purple_prefs_get_int(PREF_BLIST_ON_TOP) != BLIST_TOP_NEVER) | |
| 14286 | 98 | blist_set_ontop(TRUE); |
| 99 | } else { | |
| 15884 | 100 | purple_debug_info(WINPREFS_PLUGIN_ID, "Blist Undocking...\n"); |
|
28576
6ce76c426ce8
Add support for setting the multiple instances flag in the Windows Preferences plugin.
Daniel Atallah <datallah@pidgin.im>
parents:
27525
diff
changeset
|
101 | blist_set_ontop(purple_prefs_get_int(PREF_BLIST_ON_TOP) == BLIST_TOP_ALWAYS); |
| 14286 | 102 | } |
| 103 | } | |
| 104 | ||
| 105 | static void blist_set_dockable(gboolean val) { | |
| 106 | if(val) { | |
| 107 | if(blist_ab == NULL && blist != NULL) { | |
| 108 | blist_ab = gtk_appbar_add(blist); | |
| 109 | gtk_appbar_add_dock_cb(blist_ab, blist_dock_cb); | |
| 110 | } | |
| 111 | } else { | |
| 112 | if(blist_ab != NULL) { | |
| 113 | gtk_appbar_remove(blist_ab); | |
| 114 | blist_ab = NULL; | |
| 115 | } | |
| 116 | ||
|
28576
6ce76c426ce8
Add support for setting the multiple instances flag in the Windows Preferences plugin.
Daniel Atallah <datallah@pidgin.im>
parents:
27525
diff
changeset
|
117 | blist_set_ontop(purple_prefs_get_int(PREF_BLIST_ON_TOP) == BLIST_TOP_ALWAYS); |
| 14286 | 118 | } |
| 119 | } | |
| 120 | ||
| 121 | /* PLUGIN CALLBACKS */ | |
| 122 | ||
| 123 | /* We need this because the blist destroy cb won't be called before the | |
| 124 | plugin is unloaded, when quitting */ | |
| 15884 | 125 | static void purple_quit_cb() { |
| 126 | purple_debug_info(WINPREFS_PLUGIN_ID, "purple_quit_cb: removing appbar\n"); | |
| 14286 | 127 | blist_save_state(); |
| 128 | blist_set_dockable(FALSE); | |
| 129 | } | |
| 130 | ||
| 131 | /* Listen for the first time the window stops being withdrawn */ | |
| 15884 | 132 | static void blist_visible_cb(const char *pref, PurplePrefType type, |
| 14286 | 133 | gconstpointer value, gpointer user_data) { |
| 15884 | 134 | if(purple_prefs_get_bool(pref)) { |
| 14286 | 135 | gtk_appbar_dock(blist_ab, |
| 15884 | 136 | purple_prefs_get_int(PREF_DBLIST_SIDE)); |
| 14286 | 137 | |
| 15884 | 138 | if(purple_prefs_get_int(PREF_BLIST_ON_TOP) |
| 14286 | 139 | == BLIST_TOP_DOCKED) |
| 140 | blist_set_ontop(TRUE); | |
| 141 | ||
| 142 | /* We only need to be notified about this once */ | |
| 15884 | 143 | purple_prefs_disconnect_callback(blist_visible_cb_id); |
| 14286 | 144 | } |
| 145 | } | |
| 146 | ||
| 147 | /* This needs to be delayed otherwise, when the blist is originally created and | |
| 148 | * hidden, it'll trigger the blist_visible_cb */ | |
| 149 | static gboolean listen_for_blist_visible_cb(gpointer data) { | |
| 150 | if (handle != NULL) | |
| 151 | blist_visible_cb_id = | |
| 15884 | 152 | 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
|
153 | PIDGIN_PREFS_ROOT "/blist/list_visible", |
| 14286 | 154 | blist_visible_cb, NULL); |
| 155 | ||
| 156 | return FALSE; | |
| 157 | } | |
| 158 | ||
| 15884 | 159 | static void blist_create_cb(PurpleBuddyList *purple_blist, void *data) { |
| 160 | purple_debug_info(WINPREFS_PLUGIN_ID, "buddy list created\n"); | |
| 14286 | 161 | |
| 15884 | 162 | blist = PIDGIN_BLIST(purple_blist)->window; |
| 14286 | 163 | |
| 15884 | 164 | if(purple_prefs_get_bool(PREF_DBLIST_DOCKABLE)) { |
| 14286 | 165 | blist_set_dockable(TRUE); |
| 15884 | 166 | if(purple_prefs_get_bool(PREF_DBLIST_DOCKED)) { |
| 167 | blist_ab->undocked_height = purple_prefs_get_int(PREF_DBLIST_HEIGHT); | |
| 14286 | 168 | if(!(gdk_window_get_state(blist->window) |
| 169 | & GDK_WINDOW_STATE_WITHDRAWN)) { | |
| 170 | gtk_appbar_dock(blist_ab, | |
| 15884 | 171 | purple_prefs_get_int(PREF_DBLIST_SIDE)); |
| 172 | if(purple_prefs_get_int(PREF_BLIST_ON_TOP) | |
| 14286 | 173 | == BLIST_TOP_DOCKED) |
| 174 | blist_set_ontop(TRUE); | |
| 175 | } else { | |
| 176 | g_idle_add(listen_for_blist_visible_cb, NULL); | |
| 177 | } | |
| 178 | } | |
| 179 | } | |
| 180 | ||
| 15884 | 181 | if(purple_prefs_get_int(PREF_BLIST_ON_TOP) == BLIST_TOP_ALWAYS) |
| 14286 | 182 | blist_set_ontop(TRUE); |
| 183 | ||
| 184 | } | |
| 185 | ||
| 186 | /* WIN PREFS GENERAL */ | |
| 187 | ||
| 188 | static void | |
|
14334
aec64dbd9564
[gaim-migrate @ 16957]
Daniel Atallah <datallah@pidgin.im>
parents:
14286
diff
changeset
|
189 | winprefs_set_autostart(GtkWidget *w) { |
|
aec64dbd9564
[gaim-migrate @ 16957]
Daniel Atallah <datallah@pidgin.im>
parents:
14286
diff
changeset
|
190 | char *runval = NULL; |
| 14286 | 191 | |
|
14334
aec64dbd9564
[gaim-migrate @ 16957]
Daniel Atallah <datallah@pidgin.im>
parents:
14286
diff
changeset
|
192 | if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w))) |
|
30876
cd041b5b7ceb
Quote the path for the windows "run at startup" registry key.
Daniel Atallah <datallah@pidgin.im>
parents:
28576
diff
changeset
|
193 | runval = g_strdup_printf("\"%s" G_DIR_SEPARATOR_S "pidgin.exe\"", wpurple_install_dir()); |
| 14286 | 194 | |
|
16792
6174b9ff9ac5
Fix #432 - "Start Pidgin on Windows startup" doesn't work.
Daniel Atallah <datallah@pidgin.im>
parents:
16751
diff
changeset
|
195 | 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
|
196 | /* For Win98 */ |
|
16792
6174b9ff9ac5
Fix #432 - "Start Pidgin on Windows startup" doesn't work.
Daniel Atallah <datallah@pidgin.im>
parents:
16751
diff
changeset
|
197 | && !wpurple_write_reg_string(HKEY_LOCAL_MACHINE, RUNKEY, "Pidgin", runval)) |
| 15884 | 198 | purple_debug_error(WINPREFS_PLUGIN_ID, "Could not set registry key value\n"); |
| 14286 | 199 | |
|
14334
aec64dbd9564
[gaim-migrate @ 16957]
Daniel Atallah <datallah@pidgin.im>
parents:
14286
diff
changeset
|
200 | g_free(runval); |
| 14286 | 201 | } |
| 202 | ||
| 203 | static void | |
|
28576
6ce76c426ce8
Add support for setting the multiple instances flag in the Windows Preferences plugin.
Daniel Atallah <datallah@pidgin.im>
parents:
27525
diff
changeset
|
204 | winprefs_set_multiple_instances(GtkWidget *w) { |
|
6ce76c426ce8
Add support for setting the multiple instances flag in the Windows Preferences plugin.
Daniel Atallah <datallah@pidgin.im>
parents:
27525
diff
changeset
|
205 | wpurple_write_reg_string(HKEY_CURRENT_USER, "Environment", "PIDGIN_MULTI_INST", |
|
6ce76c426ce8
Add support for setting the multiple instances flag in the Windows Preferences plugin.
Daniel Atallah <datallah@pidgin.im>
parents:
27525
diff
changeset
|
206 | gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w)) ? "1" : NULL); |
|
6ce76c426ce8
Add support for setting the multiple instances flag in the Windows Preferences plugin.
Daniel Atallah <datallah@pidgin.im>
parents:
27525
diff
changeset
|
207 | } |
|
6ce76c426ce8
Add support for setting the multiple instances flag in the Windows Preferences plugin.
Daniel Atallah <datallah@pidgin.im>
parents:
27525
diff
changeset
|
208 | |
|
6ce76c426ce8
Add support for setting the multiple instances flag in the Windows Preferences plugin.
Daniel Atallah <datallah@pidgin.im>
parents:
27525
diff
changeset
|
209 | static void |
| 15884 | 210 | winprefs_set_blist_dockable(const char *pref, PurplePrefType type, |
| 14286 | 211 | gconstpointer value, gpointer user_data) |
| 212 | { | |
| 213 | blist_set_dockable(GPOINTER_TO_INT(value)); | |
| 214 | } | |
| 215 | ||
| 216 | static void | |
| 15884 | 217 | winprefs_set_blist_ontop(const char *pref, PurplePrefType type, |
| 14286 | 218 | gconstpointer value, gpointer user_data) |
| 219 | { | |
| 15884 | 220 | gint setting = purple_prefs_get_int(PREF_BLIST_ON_TOP); |
| 14286 | 221 | if((setting == BLIST_TOP_DOCKED && blist_ab && blist_ab->docked) |
| 222 | || setting == BLIST_TOP_ALWAYS) | |
| 223 | blist_set_ontop(TRUE); | |
| 224 | else | |
| 225 | blist_set_ontop(FALSE); | |
| 226 | } | |
| 227 | ||
| 228 | /* | |
| 229 | * EXPORTED FUNCTIONS | |
| 230 | */ | |
| 231 | ||
| 15884 | 232 | static gboolean plugin_load(PurplePlugin *plugin) { |
| 14286 | 233 | handle = plugin; |
| 234 | ||
| 235 | /* blist docking init */ | |
|
34726
af52ff6660c0
Replaced purple_get_blist() with purple_blist_get_buddy_list()
Ankit Vani <a@nevitus.org>
parents:
34708
diff
changeset
|
236 | if(purple_blist_get_buddy_list() && PIDGIN_BLIST(purple_blist_get_buddy_list()) |
|
af52ff6660c0
Replaced purple_get_blist() with purple_blist_get_buddy_list()
Ankit Vani <a@nevitus.org>
parents:
34708
diff
changeset
|
237 | && PIDGIN_BLIST(purple_blist_get_buddy_list())->window) { |
|
af52ff6660c0
Replaced purple_get_blist() with purple_blist_get_buddy_list()
Ankit Vani <a@nevitus.org>
parents:
34708
diff
changeset
|
238 | blist_create_cb(purple_blist_get_buddy_list(), NULL); |
| 14286 | 239 | } |
| 240 | ||
| 241 | /* This really shouldn't happen anymore generally, but if for some strange | |
| 242 | reason, the blist is recreated, we need to set it up again. */ | |
| 15884 | 243 | purple_signal_connect(pidgin_blist_get_handle(), "gtkblist-created", |
| 244 | plugin, PURPLE_CALLBACK(blist_create_cb), NULL); | |
| 14286 | 245 | |
| 15884 | 246 | purple_signal_connect((void*)purple_get_core(), "quitting", plugin, |
| 247 | PURPLE_CALLBACK(purple_quit_cb), NULL); | |
| 14286 | 248 | |
| 15884 | 249 | purple_prefs_connect_callback(handle, PREF_BLIST_ON_TOP, |
| 14286 | 250 | winprefs_set_blist_ontop, NULL); |
| 15884 | 251 | purple_prefs_connect_callback(handle, PREF_DBLIST_DOCKABLE, |
| 14286 | 252 | winprefs_set_blist_dockable, NULL); |
| 253 | ||
| 254 | return TRUE; | |
| 255 | } | |
| 256 | ||
| 15884 | 257 | static gboolean plugin_unload(PurplePlugin *plugin) { |
| 14286 | 258 | blist_set_dockable(FALSE); |
| 259 | blist_set_ontop(FALSE); | |
| 260 | ||
| 261 | handle = NULL; | |
| 262 | ||
| 263 | return TRUE; | |
| 264 | } | |
| 265 | ||
| 15884 | 266 | static GtkWidget* get_config_frame(PurplePlugin *plugin) { |
|
30878
3edf77c86d98
Revert unrelated changes that snuck into aa3b95627
Daniel Atallah <datallah@pidgin.im>
parents:
30876
diff
changeset
|
267 | GtkWidget *ret; |
|
3edf77c86d98
Revert unrelated changes that snuck into aa3b95627
Daniel Atallah <datallah@pidgin.im>
parents:
30876
diff
changeset
|
268 | GtkWidget *vbox; |
|
3edf77c86d98
Revert unrelated changes that snuck into aa3b95627
Daniel Atallah <datallah@pidgin.im>
parents:
30876
diff
changeset
|
269 | GtkWidget *button; |
|
14334
aec64dbd9564
[gaim-migrate @ 16957]
Daniel Atallah <datallah@pidgin.im>
parents:
14286
diff
changeset
|
270 | 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
|
271 | char *tmp; |
| 14286 | 272 | |
| 273 | ret = gtk_vbox_new(FALSE, 18); | |
| 274 | gtk_container_set_border_width(GTK_CONTAINER(ret), 12); | |
| 275 | ||
| 276 | /* Autostart */ | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15498
diff
changeset
|
277 | 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
|
278 | 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
|
279 | 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
|
280 | g_free(tmp); |
| 14286 | 281 | gtk_box_pack_start(GTK_BOX(vbox), button, FALSE, FALSE, 0); |
|
16792
6174b9ff9ac5
Fix #432 - "Start Pidgin on Windows startup" doesn't work.
Daniel Atallah <datallah@pidgin.im>
parents:
16751
diff
changeset
|
282 | 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
|
283 | || (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
|
284 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), TRUE); |
|
aec64dbd9564
[gaim-migrate @ 16957]
Daniel Atallah <datallah@pidgin.im>
parents:
14286
diff
changeset
|
285 | g_free(run_key_val); |
| 14286 | 286 | } |
| 287 | g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(winprefs_set_autostart), NULL); | |
| 288 | gtk_widget_show(button); | |
| 289 | ||
|
28576
6ce76c426ce8
Add support for setting the multiple instances flag in the Windows Preferences plugin.
Daniel Atallah <datallah@pidgin.im>
parents:
27525
diff
changeset
|
290 | button = gtk_check_button_new_with_mnemonic(_("Allow multiple instances")); |
|
6ce76c426ce8
Add support for setting the multiple instances flag in the Windows Preferences plugin.
Daniel Atallah <datallah@pidgin.im>
parents:
27525
diff
changeset
|
291 | gtk_box_pack_start(GTK_BOX(vbox), button, FALSE, FALSE, 0); |
|
6ce76c426ce8
Add support for setting the multiple instances flag in the Windows Preferences plugin.
Daniel Atallah <datallah@pidgin.im>
parents:
27525
diff
changeset
|
292 | if ((run_key_val = wpurple_read_reg_string(HKEY_CURRENT_USER, "Environment", "PIDGIN_MULTI_INST"))) { |
|
6ce76c426ce8
Add support for setting the multiple instances flag in the Windows Preferences plugin.
Daniel Atallah <datallah@pidgin.im>
parents:
27525
diff
changeset
|
293 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), TRUE); |
|
6ce76c426ce8
Add support for setting the multiple instances flag in the Windows Preferences plugin.
Daniel Atallah <datallah@pidgin.im>
parents:
27525
diff
changeset
|
294 | g_free(run_key_val); |
|
6ce76c426ce8
Add support for setting the multiple instances flag in the Windows Preferences plugin.
Daniel Atallah <datallah@pidgin.im>
parents:
27525
diff
changeset
|
295 | } |
|
6ce76c426ce8
Add support for setting the multiple instances flag in the Windows Preferences plugin.
Daniel Atallah <datallah@pidgin.im>
parents:
27525
diff
changeset
|
296 | g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(winprefs_set_multiple_instances), NULL); |
|
6ce76c426ce8
Add support for setting the multiple instances flag in the Windows Preferences plugin.
Daniel Atallah <datallah@pidgin.im>
parents:
27525
diff
changeset
|
297 | gtk_widget_show(button); |
|
6ce76c426ce8
Add support for setting the multiple instances flag in the Windows Preferences plugin.
Daniel Atallah <datallah@pidgin.im>
parents:
27525
diff
changeset
|
298 | |
| 14286 | 299 | /* Buddy List */ |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15498
diff
changeset
|
300 | vbox = pidgin_make_frame(ret, _("Buddy List")); |
|
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15498
diff
changeset
|
301 | pidgin_prefs_checkbox(_("_Dockable Buddy List"), |
| 14286 | 302 | PREF_DBLIST_DOCKABLE, vbox); |
| 303 | ||
| 304 | /* Blist On Top */ | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15498
diff
changeset
|
305 | pidgin_prefs_dropdown(vbox, _("_Keep Buddy List window on top:"), |
| 15884 | 306 | PURPLE_PREF_INT, PREF_BLIST_ON_TOP, |
| 14286 | 307 | _("Never"), BLIST_TOP_NEVER, |
| 308 | _("Always"), BLIST_TOP_ALWAYS, | |
| 309 | /* XXX: Did this ever work? */ | |
| 310 | _("Only when docked"), BLIST_TOP_DOCKED, | |
| 311 | NULL); | |
| 312 | ||
| 313 | gtk_widget_show_all(ret); | |
| 314 | return ret; | |
| 315 | } | |
| 316 | ||
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15498
diff
changeset
|
317 | static PidginPluginUiInfo ui_info = |
| 14286 | 318 | { |
| 319 | 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
|
320 | |
|
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
|
321 | /* 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
|
322 | 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
|
323 | 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
|
324 | 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
|
325 | NULL |
| 14286 | 326 | }; |
| 327 | ||
| 15884 | 328 | static PurplePluginInfo info = |
| 14286 | 329 | { |
| 15884 | 330 | PURPLE_PLUGIN_MAGIC, |
| 331 | PURPLE_MAJOR_VERSION, | |
| 332 | PURPLE_MINOR_VERSION, | |
| 333 | PURPLE_PLUGIN_STANDARD, | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15498
diff
changeset
|
334 | PIDGIN_PLUGIN_TYPE, |
| 14286 | 335 | 0, |
| 336 | NULL, | |
| 15884 | 337 | PURPLE_PRIORITY_DEFAULT, |
| 14286 | 338 | WINPREFS_PLUGIN_ID, |
|
16792
6174b9ff9ac5
Fix #432 - "Start Pidgin on Windows startup" doesn't work.
Daniel Atallah <datallah@pidgin.im>
parents:
16751
diff
changeset
|
339 | N_("Windows Pidgin Options"), |
|
20288
5ca925a094e2
applied changes from 03b709ec2a153e7e82719df0ba4635108bb1d3c6
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
19859
diff
changeset
|
340 | DISPLAY_VERSION, |
|
16073
e70e589dde54
more help for translators (I removed a few PIDGIN_NAME references
Nathan Walp <nwalp@pidgin.im>
parents:
15884
diff
changeset
|
341 | N_("Options specific to Pidgin for Windows."), |
|
27525
579b9d64b364
A semi-random collection of English spelling and grammatical changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25544
diff
changeset
|
342 | N_("Provides options specific to Pidgin for Windows, such as buddy list docking."), |
| 14286 | 343 | "Herman Bloggs <hermanator12002@yahoo.com>", |
| 15884 | 344 | PURPLE_WEBSITE, |
| 14286 | 345 | plugin_load, |
| 346 | plugin_unload, | |
| 347 | NULL, | |
| 348 | &ui_info, | |
| 349 | NULL, | |
| 350 | 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
|
351 | 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
|
352 | |
|
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
|
353 | /* 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
|
354 | 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
|
355 | 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
|
356 | NULL, |
| 14286 | 357 | NULL |
| 358 | }; | |
| 359 | ||
| 360 | static void | |
| 15884 | 361 | init_plugin(PurplePlugin *plugin) |
| 14286 | 362 | { |
| 15884 | 363 | purple_prefs_add_none("/plugins/gtk"); |
| 364 | purple_prefs_add_none("/plugins/gtk/win32"); | |
| 365 | purple_prefs_add_none("/plugins/gtk/win32/winprefs"); | |
| 366 | purple_prefs_add_bool(PREF_DBLIST_DOCKABLE, FALSE); | |
| 367 | purple_prefs_add_bool(PREF_DBLIST_DOCKED, FALSE); | |
| 368 | purple_prefs_add_int(PREF_DBLIST_HEIGHT, 0); | |
| 369 | purple_prefs_add_int(PREF_DBLIST_SIDE, 0); | |
| 14286 | 370 | |
| 371 | /* Convert old preferences */ | |
| 15884 | 372 | if(purple_prefs_exists(PREF_DBLIST_ON_TOP)) { |
| 14286 | 373 | gint blist_top = BLIST_TOP_NEVER; |
| 15884 | 374 | if(purple_prefs_get_bool(PREF_BLIST_ON_TOP)) |
| 14286 | 375 | blist_top = BLIST_TOP_ALWAYS; |
| 15884 | 376 | else if(purple_prefs_get_bool(PREF_DBLIST_ON_TOP)) |
| 14286 | 377 | blist_top = BLIST_TOP_DOCKED; |
| 15884 | 378 | purple_prefs_remove(PREF_BLIST_ON_TOP); |
| 379 | purple_prefs_remove(PREF_DBLIST_ON_TOP); | |
| 380 | purple_prefs_add_int(PREF_BLIST_ON_TOP, blist_top); | |
| 14286 | 381 | } else |
| 15884 | 382 | purple_prefs_add_int(PREF_BLIST_ON_TOP, BLIST_TOP_NEVER); |
|
25544
afa0851cca1e
Remove the "Flash window when chat messages are received" pref from the winprefs
Daniel Atallah <datallah@pidgin.im>
parents:
20288
diff
changeset
|
383 | purple_prefs_remove(PREF_CHAT_BLINK); |
| 14286 | 384 | } |
| 385 | ||
| 15884 | 386 | PURPLE_INIT_PLUGIN(winprefs, init_plugin, info) |
| 14286 | 387 |