Mercurial > pidgin.yaz
comparison pidgin/gtkconv.c @ 16062:07554cc5d090
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
until someone comes up with something cleverererer
author | Stu Tomlinson <stu@nosnilmot.com> |
---|---|
date | Wed, 11 Apr 2007 13:38:05 +0000 |
parents | d64602bb59d2 |
children | f2a4b05407d7 |
comparison
equal
deleted
inserted
replaced
16061:3b86ad370861 | 16062:07554cc5d090 |
---|---|
212 } | 212 } |
213 | 213 |
214 static gboolean | 214 static gboolean |
215 lbox_size_allocate_cb(GtkWidget *w, GtkAllocation *allocation, gpointer data) | 215 lbox_size_allocate_cb(GtkWidget *w, GtkAllocation *allocation, gpointer data) |
216 { | 216 { |
217 purple_prefs_set_int("/purple/gtk/conversations/chat/userlist_width", allocation->width == 1 ? 0 : allocation->width); | 217 purple_prefs_set_int(PIDGIN_PREFS_ROOT "/conversations/chat/userlist_width", allocation->width == 1 ? 0 : allocation->width); |
218 | 218 |
219 return FALSE; | 219 return FALSE; |
220 } | 220 } |
221 | 221 |
222 static gboolean | 222 static gboolean |
241 /* I think that the above justification is not the majority, and that the new tab resizing should | 241 /* I think that the above justification is not the majority, and that the new tab resizing should |
242 * negate it anyway. --luke */ | 242 * negate it anyway. --luke */ |
243 if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_IM) | 243 if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_IM) |
244 { | 244 { |
245 if (w == gtkconv->imhtml) { | 245 if (w == gtkconv->imhtml) { |
246 purple_prefs_set_int("/purple/gtk/conversations/im/default_width", allocation->width); | 246 purple_prefs_set_int(PIDGIN_PREFS_ROOT "/conversations/im/default_width", allocation->width); |
247 purple_prefs_set_int("/purple/gtk/conversations/im/default_height", allocation->height); | 247 purple_prefs_set_int(PIDGIN_PREFS_ROOT "/conversations/im/default_height", allocation->height); |
248 } | 248 } |
249 if (w == gtkconv->lower_hbox) | 249 if (w == gtkconv->lower_hbox) |
250 purple_prefs_set_int("/purple/gtk/conversations/im/entry_height", allocation->height); | 250 purple_prefs_set_int(PIDGIN_PREFS_ROOT "/conversations/im/entry_height", allocation->height); |
251 } | 251 } |
252 else if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_CHAT) | 252 else if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_CHAT) |
253 { | 253 { |
254 if (w == gtkconv->imhtml) { | 254 if (w == gtkconv->imhtml) { |
255 purple_prefs_set_int("/purple/gtk/conversations/chat/default_width", allocation->width); | 255 purple_prefs_set_int(PIDGIN_PREFS_ROOT "/conversations/chat/default_width", allocation->width); |
256 purple_prefs_set_int("/purple/gtk/conversations/chat/default_height", allocation->height); | 256 purple_prefs_set_int(PIDGIN_PREFS_ROOT "/conversations/chat/default_height", allocation->height); |
257 } | 257 } |
258 if (w == gtkconv->lower_hbox) | 258 if (w == gtkconv->lower_hbox) |
259 purple_prefs_set_int("/purple/gtk/conversations/chat/entry_height", allocation->height); | 259 purple_prefs_set_int(PIDGIN_PREFS_ROOT "/conversations/chat/entry_height", allocation->height); |
260 } | 260 } |
261 | 261 |
262 return FALSE; | 262 return FALSE; |
263 } | 263 } |
264 | 264 |
270 if (conv->features & PURPLE_CONNECTION_HTML) | 270 if (conv->features & PURPLE_CONNECTION_HTML) |
271 { | 271 { |
272 char color[8]; | 272 char color[8]; |
273 GdkColor fg_color, bg_color; | 273 GdkColor fg_color, bg_color; |
274 | 274 |
275 if (purple_prefs_get_bool("/purple/gtk/conversations/send_bold") != GTK_IMHTML(c->entry)->edit.bold) | 275 if (purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/conversations/send_bold") != GTK_IMHTML(c->entry)->edit.bold) |
276 gtk_imhtml_toggle_bold(GTK_IMHTML(c->entry)); | 276 gtk_imhtml_toggle_bold(GTK_IMHTML(c->entry)); |
277 | 277 |
278 if (purple_prefs_get_bool("/purple/gtk/conversations/send_italic") != GTK_IMHTML(c->entry)->edit.italic) | 278 if (purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/conversations/send_italic") != GTK_IMHTML(c->entry)->edit.italic) |
279 gtk_imhtml_toggle_italic(GTK_IMHTML(c->entry)); | 279 gtk_imhtml_toggle_italic(GTK_IMHTML(c->entry)); |
280 | 280 |
281 if (purple_prefs_get_bool("/purple/gtk/conversations/send_underline") != GTK_IMHTML(c->entry)->edit.underline) | 281 if (purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/conversations/send_underline") != GTK_IMHTML(c->entry)->edit.underline) |
282 gtk_imhtml_toggle_underline(GTK_IMHTML(c->entry)); | 282 gtk_imhtml_toggle_underline(GTK_IMHTML(c->entry)); |
283 | 283 |
284 gtk_imhtml_toggle_fontface(GTK_IMHTML(c->entry), | 284 gtk_imhtml_toggle_fontface(GTK_IMHTML(c->entry), |
285 purple_prefs_get_string("/purple/gtk/conversations/font_face")); | 285 purple_prefs_get_string(PIDGIN_PREFS_ROOT "/conversations/font_face")); |
286 | 286 |
287 if (!(conv->features & PURPLE_CONNECTION_NO_FONTSIZE)) | 287 if (!(conv->features & PURPLE_CONNECTION_NO_FONTSIZE)) |
288 { | 288 { |
289 int size = purple_prefs_get_int("/purple/gtk/conversations/font_size"); | 289 int size = purple_prefs_get_int(PIDGIN_PREFS_ROOT "/conversations/font_size"); |
290 | 290 |
291 /* 3 is the default. */ | 291 /* 3 is the default. */ |
292 if (size != 3) | 292 if (size != 3) |
293 gtk_imhtml_font_set_size(GTK_IMHTML(c->entry), size); | 293 gtk_imhtml_font_set_size(GTK_IMHTML(c->entry), size); |
294 } | 294 } |
295 | 295 |
296 if(strcmp(purple_prefs_get_string("/purple/gtk/conversations/fgcolor"), "") != 0) | 296 if(strcmp(purple_prefs_get_string(PIDGIN_PREFS_ROOT "/conversations/fgcolor"), "") != 0) |
297 { | 297 { |
298 gdk_color_parse(purple_prefs_get_string("/purple/gtk/conversations/fgcolor"), | 298 gdk_color_parse(purple_prefs_get_string(PIDGIN_PREFS_ROOT "/conversations/fgcolor"), |
299 &fg_color); | 299 &fg_color); |
300 g_snprintf(color, sizeof(color), "#%02x%02x%02x", | 300 g_snprintf(color, sizeof(color), "#%02x%02x%02x", |
301 fg_color.red / 256, | 301 fg_color.red / 256, |
302 fg_color.green / 256, | 302 fg_color.green / 256, |
303 fg_color.blue / 256); | 303 fg_color.blue / 256); |
305 strcpy(color, ""); | 305 strcpy(color, ""); |
306 | 306 |
307 gtk_imhtml_toggle_forecolor(GTK_IMHTML(c->entry), color); | 307 gtk_imhtml_toggle_forecolor(GTK_IMHTML(c->entry), color); |
308 | 308 |
309 if(!(conv->features & PURPLE_CONNECTION_NO_BGCOLOR) && | 309 if(!(conv->features & PURPLE_CONNECTION_NO_BGCOLOR) && |
310 strcmp(purple_prefs_get_string("/purple/gtk/conversations/bgcolor"), "") != 0) | 310 strcmp(purple_prefs_get_string(PIDGIN_PREFS_ROOT "/conversations/bgcolor"), "") != 0) |
311 { | 311 { |
312 gdk_color_parse(purple_prefs_get_string("/purple/gtk/conversations/bgcolor"), | 312 gdk_color_parse(purple_prefs_get_string(PIDGIN_PREFS_ROOT "/conversations/bgcolor"), |
313 &bg_color); | 313 &bg_color); |
314 g_snprintf(color, sizeof(color), "#%02x%02x%02x", | 314 g_snprintf(color, sizeof(color), "#%02x%02x%02x", |
315 bg_color.red / 256, | 315 bg_color.red / 256, |
316 bg_color.green / 256, | 316 bg_color.green / 256, |
317 bg_color.blue / 256); | 317 bg_color.blue / 256); |
457 reset_default_size(PidginConversation *gtkconv) | 457 reset_default_size(PidginConversation *gtkconv) |
458 { | 458 { |
459 PurpleConversation *conv = gtkconv->active_conv; | 459 PurpleConversation *conv = gtkconv->active_conv; |
460 if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_CHAT) | 460 if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_CHAT) |
461 gtk_widget_set_size_request(gtkconv->lower_hbox, -1, | 461 gtk_widget_set_size_request(gtkconv->lower_hbox, -1, |
462 purple_prefs_get_int("/purple/gtk/conversations/chat/entry_height")); | 462 purple_prefs_get_int(PIDGIN_PREFS_ROOT "/conversations/chat/entry_height")); |
463 else | 463 else |
464 gtk_widget_set_size_request(gtkconv->lower_hbox, -1, | 464 gtk_widget_set_size_request(gtkconv->lower_hbox, -1, |
465 purple_prefs_get_int("/purple/gtk/conversations/im/entry_height")); | 465 purple_prefs_get_int(PIDGIN_PREFS_ROOT "/conversations/im/entry_height")); |
466 } | 466 } |
467 | 467 |
468 static gboolean | 468 static gboolean |
469 check_for_and_do_command(PurpleConversation *conv) | 469 check_for_and_do_command(PurpleConversation *conv) |
470 { | 470 { |
1354 } | 1354 } |
1355 | 1355 |
1356 static void | 1356 static void |
1357 menu_toolbar_cb(gpointer data, guint action, GtkWidget *widget) | 1357 menu_toolbar_cb(gpointer data, guint action, GtkWidget *widget) |
1358 { | 1358 { |
1359 purple_prefs_set_bool("/purple/gtk/conversations/show_formatting_toolbar", | 1359 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/conversations/show_formatting_toolbar", |
1360 gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(widget))); | 1360 gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(widget))); |
1361 } | 1361 } |
1362 | 1362 |
1363 static void | 1363 static void |
1364 menu_sounds_cb(gpointer data, guint action, GtkWidget *widget) | 1364 menu_sounds_cb(gpointer data, guint action, GtkWidget *widget) |
1379 } | 1379 } |
1380 | 1380 |
1381 static void | 1381 static void |
1382 menu_timestamps_cb(gpointer data, guint action, GtkWidget *widget) | 1382 menu_timestamps_cb(gpointer data, guint action, GtkWidget *widget) |
1383 { | 1383 { |
1384 purple_prefs_set_bool("/purple/gtk/conversations/show_timestamps", | 1384 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/conversations/show_timestamps", |
1385 gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(widget))); | 1385 gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(widget))); |
1386 } | 1386 } |
1387 | 1387 |
1388 static void | 1388 static void |
1389 chat_do_im(PidginConversation *gtkconv, const char *who) | 1389 chat_do_im(PidginConversation *gtkconv, const char *who) |
3029 gtk_item_factory_get_widget(win->menu.item_factory, | 3029 gtk_item_factory_get_widget(win->menu.item_factory, |
3030 N_("/Options/Enable Logging")); | 3030 N_("/Options/Enable Logging")); |
3031 win->menu.sounds = | 3031 win->menu.sounds = |
3032 gtk_item_factory_get_widget(win->menu.item_factory, | 3032 gtk_item_factory_get_widget(win->menu.item_factory, |
3033 N_("/Options/Enable Sounds")); | 3033 N_("/Options/Enable Sounds")); |
3034 method = purple_prefs_get_string("/purple/gtk/sound/method"); | 3034 method = purple_prefs_get_string(PIDGIN_PREFS_ROOT "/sound/method"); |
3035 if (!strcmp(method, "none")) | 3035 if (method != NULL && !strcmp(method, "none")) |
3036 { | 3036 { |
3037 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(win->menu.sounds), | 3037 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(win->menu.sounds), |
3038 FALSE); | 3038 FALSE); |
3039 gtk_widget_set_sensitive(win->menu.sounds, FALSE); | 3039 gtk_widget_set_sensitive(win->menu.sounds, FALSE); |
3040 } | 3040 } |
3041 purple_prefs_connect_callback(win, "/purple/gtk/sound/method", | 3041 purple_prefs_connect_callback(win, PIDGIN_PREFS_ROOT "/sound/method", |
3042 sound_method_pref_changed_cb, win); | 3042 sound_method_pref_changed_cb, win); |
3043 | 3043 |
3044 win->menu.show_formatting_toolbar = | 3044 win->menu.show_formatting_toolbar = |
3045 gtk_item_factory_get_widget(win->menu.item_factory, | 3045 gtk_item_factory_get_widget(win->menu.item_factory, |
3046 N_("/Options/Show Formatting Toolbars")); | 3046 N_("/Options/Show Formatting Toolbars")); |
3048 gtk_item_factory_get_widget(win->menu.item_factory, | 3048 gtk_item_factory_get_widget(win->menu.item_factory, |
3049 N_("/Options/Show Timestamps")); | 3049 N_("/Options/Show Timestamps")); |
3050 win->menu.show_icon = | 3050 win->menu.show_icon = |
3051 gtk_item_factory_get_widget(win->menu.item_factory, | 3051 gtk_item_factory_get_widget(win->menu.item_factory, |
3052 N_("/Options/Show Buddy Icon")); | 3052 N_("/Options/Show Buddy Icon")); |
3053 if (!purple_prefs_get_bool("/purple/gtk/conversations/im/show_buddy_icons")) | 3053 if (!purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/conversations/im/show_buddy_icons")) |
3054 { | 3054 { |
3055 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(win->menu.show_icon), | 3055 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(win->menu.show_icon), |
3056 FALSE); | 3056 FALSE); |
3057 gtk_widget_set_sensitive(win->menu.show_icon, FALSE); | 3057 gtk_widget_set_sensitive(win->menu.show_icon, FALSE); |
3058 } | 3058 } |
3059 purple_prefs_connect_callback(win, "/purple/gtk/conversations/im/show_buddy_icons", | 3059 purple_prefs_connect_callback(win, PIDGIN_PREFS_ROOT "/conversations/im/show_buddy_icons", |
3060 show_buddy_icons_pref_changed_cb, win); | 3060 show_buddy_icons_pref_changed_cb, win); |
3061 | 3061 |
3062 win->menu.tray = pidgin_menu_tray_new(); | 3062 win->menu.tray = pidgin_menu_tray_new(); |
3063 gtk_menu_shell_append(GTK_MENU_SHELL(win->menu.menubar), | 3063 gtk_menu_shell_append(GTK_MENU_SHELL(win->menu.menubar), |
3064 win->menu.tray); | 3064 win->menu.tray); |
4190 &imhtml_sw_hscroll, NULL); | 4190 &imhtml_sw_hscroll, NULL); |
4191 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(imhtml_sw), | 4191 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(imhtml_sw), |
4192 imhtml_sw_hscroll, GTK_POLICY_ALWAYS); | 4192 imhtml_sw_hscroll, GTK_POLICY_ALWAYS); |
4193 | 4193 |
4194 gtk_widget_set_size_request(gtkconv->imhtml, | 4194 gtk_widget_set_size_request(gtkconv->imhtml, |
4195 purple_prefs_get_int("/purple/gtk/conversations/chat/default_width"), | 4195 purple_prefs_get_int(PIDGIN_PREFS_ROOT "/conversations/chat/default_width"), |
4196 purple_prefs_get_int("/purple/gtk/conversations/chat/default_height")); | 4196 purple_prefs_get_int(PIDGIN_PREFS_ROOT "/conversations/chat/default_height")); |
4197 g_signal_connect(G_OBJECT(gtkconv->imhtml), "size-allocate", | 4197 g_signal_connect(G_OBJECT(gtkconv->imhtml), "size-allocate", |
4198 G_CALLBACK(size_allocate_cb), gtkconv); | 4198 G_CALLBACK(size_allocate_cb), gtkconv); |
4199 | 4199 |
4200 g_signal_connect_after(G_OBJECT(gtkconv->imhtml), "button_press_event", | 4200 g_signal_connect_after(G_OBJECT(gtkconv->imhtml), "button_press_event", |
4201 G_CALLBACK(entry_stop_rclick_cb), NULL); | 4201 G_CALLBACK(entry_stop_rclick_cb), NULL); |
4235 col = gtk_tree_view_column_new_with_attributes(NULL, rend, | 4235 col = gtk_tree_view_column_new_with_attributes(NULL, rend, |
4236 "pixbuf", CHAT_USERS_ICON_COLUMN, NULL); | 4236 "pixbuf", CHAT_USERS_ICON_COLUMN, NULL); |
4237 gtk_tree_view_column_set_sizing(col, GTK_TREE_VIEW_COLUMN_AUTOSIZE); | 4237 gtk_tree_view_column_set_sizing(col, GTK_TREE_VIEW_COLUMN_AUTOSIZE); |
4238 gtk_tree_view_append_column(GTK_TREE_VIEW(list), col); | 4238 gtk_tree_view_append_column(GTK_TREE_VIEW(list), col); |
4239 gtk_widget_set_size_request(lbox, | 4239 gtk_widget_set_size_request(lbox, |
4240 purple_prefs_get_int("/purple/gtk/conversations/chat/userlist_width"), -1); | 4240 purple_prefs_get_int(PIDGIN_PREFS_ROOT "/conversations/chat/userlist_width"), -1); |
4241 | 4241 |
4242 g_signal_connect(G_OBJECT(list), "button_press_event", | 4242 g_signal_connect(G_OBJECT(list), "button_press_event", |
4243 G_CALLBACK(right_click_chat_cb), gtkconv); | 4243 G_CALLBACK(right_click_chat_cb), gtkconv); |
4244 g_signal_connect(G_OBJECT(list), "popup-menu", | 4244 g_signal_connect(G_OBJECT(list), "popup-menu", |
4245 G_CALLBACK(gtkconv_chat_popup_menu_cb), gtkconv); | 4245 G_CALLBACK(gtkconv_chat_popup_menu_cb), gtkconv); |
4302 | 4302 |
4303 gtk_widget_set_name(gtkconv->entry, "pidgin_conv_entry"); | 4303 gtk_widget_set_name(gtkconv->entry, "pidgin_conv_entry"); |
4304 gtk_imhtml_set_protocol_name(GTK_IMHTML(gtkconv->entry), | 4304 gtk_imhtml_set_protocol_name(GTK_IMHTML(gtkconv->entry), |
4305 purple_account_get_protocol_name(conv->account)); | 4305 purple_account_get_protocol_name(conv->account)); |
4306 gtk_widget_set_size_request(gtkconv->lower_hbox, -1, | 4306 gtk_widget_set_size_request(gtkconv->lower_hbox, -1, |
4307 purple_prefs_get_int("/purple/gtk/conversations/chat/entry_height")); | 4307 purple_prefs_get_int(PIDGIN_PREFS_ROOT "/conversations/chat/entry_height")); |
4308 gtkconv->entry_buffer = | 4308 gtkconv->entry_buffer = |
4309 gtk_text_view_get_buffer(GTK_TEXT_VIEW(gtkconv->entry)); | 4309 gtk_text_view_get_buffer(GTK_TEXT_VIEW(gtkconv->entry)); |
4310 g_object_set_data(G_OBJECT(gtkconv->entry_buffer), "user_data", gtkconv); | 4310 g_object_set_data(G_OBJECT(gtkconv->entry_buffer), "user_data", gtkconv); |
4311 g_signal_connect_swapped(G_OBJECT(gtkconv->entry_buffer), "changed", | 4311 g_signal_connect_swapped(G_OBJECT(gtkconv->entry_buffer), "changed", |
4312 G_CALLBACK(resize_imhtml_cb), gtkconv); | 4312 G_CALLBACK(resize_imhtml_cb), gtkconv); |
4364 &imhtml_sw_hscroll, NULL); | 4364 &imhtml_sw_hscroll, NULL); |
4365 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(imhtml_sw), | 4365 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(imhtml_sw), |
4366 imhtml_sw_hscroll, GTK_POLICY_ALWAYS); | 4366 imhtml_sw_hscroll, GTK_POLICY_ALWAYS); |
4367 | 4367 |
4368 gtk_widget_set_size_request(gtkconv->imhtml, | 4368 gtk_widget_set_size_request(gtkconv->imhtml, |
4369 purple_prefs_get_int("/purple/gtk/conversations/im/default_width"), | 4369 purple_prefs_get_int(PIDGIN_PREFS_ROOT "/conversations/im/default_width"), |
4370 purple_prefs_get_int("/purple/gtk/conversations/im/default_height")); | 4370 purple_prefs_get_int(PIDGIN_PREFS_ROOT "/conversations/im/default_height")); |
4371 g_signal_connect(G_OBJECT(gtkconv->imhtml), "size-allocate", | 4371 g_signal_connect(G_OBJECT(gtkconv->imhtml), "size-allocate", |
4372 G_CALLBACK(size_allocate_cb), gtkconv); | 4372 G_CALLBACK(size_allocate_cb), gtkconv); |
4373 | 4373 |
4374 g_signal_connect_after(G_OBJECT(gtkconv->imhtml), "button_press_event", | 4374 g_signal_connect_after(G_OBJECT(gtkconv->imhtml), "button_press_event", |
4375 G_CALLBACK(entry_stop_rclick_cb), NULL); | 4375 G_CALLBACK(entry_stop_rclick_cb), NULL); |
4401 | 4401 |
4402 gtk_widget_set_name(gtkconv->entry, "pidgin_conv_entry"); | 4402 gtk_widget_set_name(gtkconv->entry, "pidgin_conv_entry"); |
4403 gtk_imhtml_set_protocol_name(GTK_IMHTML(gtkconv->entry), | 4403 gtk_imhtml_set_protocol_name(GTK_IMHTML(gtkconv->entry), |
4404 purple_account_get_protocol_name(conv->account)); | 4404 purple_account_get_protocol_name(conv->account)); |
4405 gtk_widget_set_size_request(gtkconv->lower_hbox, -1, | 4405 gtk_widget_set_size_request(gtkconv->lower_hbox, -1, |
4406 purple_prefs_get_int("/purple/gtk/conversations/im/entry_height")); | 4406 purple_prefs_get_int(PIDGIN_PREFS_ROOT "/conversations/im/entry_height")); |
4407 gtkconv->entry_buffer = | 4407 gtkconv->entry_buffer = |
4408 gtk_text_view_get_buffer(GTK_TEXT_VIEW(gtkconv->entry)); | 4408 gtk_text_view_get_buffer(GTK_TEXT_VIEW(gtkconv->entry)); |
4409 g_object_set_data(G_OBJECT(gtkconv->entry_buffer), "user_data", gtkconv); | 4409 g_object_set_data(G_OBJECT(gtkconv->entry_buffer), "user_data", gtkconv); |
4410 | 4410 |
4411 g_signal_connect(G_OBJECT(gtkconv->entry), "key_press_event", | 4411 g_signal_connect(G_OBJECT(gtkconv->entry), "key_press_event", |
4430 default_formatize(gtkconv); | 4430 default_formatize(gtkconv); |
4431 | 4431 |
4432 g_signal_connect_after(G_OBJECT(gtkconv->entry), "format_function_clear", | 4432 g_signal_connect_after(G_OBJECT(gtkconv->entry), "format_function_clear", |
4433 G_CALLBACK(clear_formatting_cb), gtkconv); | 4433 G_CALLBACK(clear_formatting_cb), gtkconv); |
4434 | 4434 |
4435 gtkconv->u.im->animate = purple_prefs_get_bool("/purple/gtk/conversations/im/animate_buddy_icons"); | 4435 gtkconv->u.im->animate = purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/conversations/im/animate_buddy_icons"); |
4436 gtkconv->u.im->show_icon = TRUE; | 4436 gtkconv->u.im->show_icon = TRUE; |
4437 | 4437 |
4438 /* | 4438 /* |
4439 * Focus for IM windows should be as follows: | 4439 * Focus for IM windows should be as follows: |
4440 * Tab title -> conversation scrollback -> entry | 4440 * Tab title -> conversation scrollback -> entry |
4680 gtk_container_add(GTK_CONTAINER(tab_cont), pane); | 4680 gtk_container_add(GTK_CONTAINER(tab_cont), pane); |
4681 gtk_widget_show(pane); | 4681 gtk_widget_show(pane); |
4682 | 4682 |
4683 gtkconv->make_sound = TRUE; | 4683 gtkconv->make_sound = TRUE; |
4684 | 4684 |
4685 if (purple_prefs_get_bool("/purple/gtk/conversations/show_formatting_toolbar")) | 4685 if (purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/conversations/show_formatting_toolbar")) |
4686 gtk_widget_show(gtkconv->toolbar); | 4686 gtk_widget_show(gtkconv->toolbar); |
4687 else | 4687 else |
4688 gtk_widget_hide(gtkconv->toolbar); | 4688 gtk_widget_hide(gtkconv->toolbar); |
4689 | 4689 |
4690 gtk_imhtml_show_comments(GTK_IMHTML(gtkconv->imhtml), | 4690 gtk_imhtml_show_comments(GTK_IMHTML(gtkconv->imhtml), |
4691 purple_prefs_get_bool("/purple/gtk/conversations/show_timestamps")); | 4691 purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/conversations/show_timestamps")); |
4692 gtk_imhtml_set_protocol_name(GTK_IMHTML(gtkconv->imhtml), | 4692 gtk_imhtml_set_protocol_name(GTK_IMHTML(gtkconv->imhtml), |
4693 purple_account_get_protocol_name(conv->account)); | 4693 purple_account_get_protocol_name(conv->account)); |
4694 | 4694 |
4695 g_signal_connect_swapped(G_OBJECT(pane), "focus", | 4695 g_signal_connect_swapped(G_OBJECT(pane), "focus", |
4696 G_CALLBACK(gtk_widget_grab_focus), | 4696 G_CALLBACK(gtk_widget_grab_focus), |
4726 PurpleConversationUiOps *ui_ops = pidgin_conversations_get_conv_ui_ops(); | 4726 PurpleConversationUiOps *ui_ops = pidgin_conversations_get_conv_ui_ops(); |
4727 if (conv != NULL) | 4727 if (conv != NULL) |
4728 return; | 4728 return; |
4729 | 4729 |
4730 /* create hidden conv if hide_new pref is always */ | 4730 /* create hidden conv if hide_new pref is always */ |
4731 if (strcmp(purple_prefs_get_string("/purple/gtk/conversations/im/hide_new"), "always") == 0) | 4731 if (strcmp(purple_prefs_get_string(PIDGIN_PREFS_ROOT "/conversations/im/hide_new"), "always") == 0) |
4732 { | 4732 { |
4733 ui_ops->create_conversation = pidgin_conv_new_hidden; | 4733 ui_ops->create_conversation = pidgin_conv_new_hidden; |
4734 purple_conversation_new(PURPLE_CONV_TYPE_IM, account, sender); | 4734 purple_conversation_new(PURPLE_CONV_TYPE_IM, account, sender); |
4735 ui_ops->create_conversation = pidgin_conv_new; | 4735 ui_ops->create_conversation = pidgin_conv_new; |
4736 return; | 4736 return; |
4737 } | 4737 } |
4738 | 4738 |
4739 /* create hidden conv if hide_new pref is away and account is away */ | 4739 /* create hidden conv if hide_new pref is away and account is away */ |
4740 if (strcmp(purple_prefs_get_string("/purple/gtk/conversations/im/hide_new"), "away") == 0 && | 4740 if (strcmp(purple_prefs_get_string(PIDGIN_PREFS_ROOT "/conversations/im/hide_new"), "away") == 0 && |
4741 !purple_status_is_available(purple_account_get_active_status(account))) | 4741 !purple_status_is_available(purple_account_get_active_status(account))) |
4742 { | 4742 { |
4743 ui_ops->create_conversation = pidgin_conv_new_hidden; | 4743 ui_ops->create_conversation = pidgin_conv_new_hidden; |
4744 purple_conversation_new(PURPLE_CONV_TYPE_IM, account, sender); | 4744 purple_conversation_new(PURPLE_CONV_TYPE_IM, account, sender); |
4745 ui_ops->create_conversation = pidgin_conv_new; | 4745 ui_ops->create_conversation = pidgin_conv_new; |
4984 line_count = gtk_text_buffer_get_line_count( | 4984 line_count = gtk_text_buffer_get_line_count( |
4985 gtk_text_view_get_buffer(GTK_TEXT_VIEW( | 4985 gtk_text_view_get_buffer(GTK_TEXT_VIEW( |
4986 gtkconv->imhtml))); | 4986 gtkconv->imhtml))); |
4987 | 4987 |
4988 max_scrollback_lines = purple_prefs_get_int( | 4988 max_scrollback_lines = purple_prefs_get_int( |
4989 "/purple/gtk/conversations/scrollback_lines"); | 4989 PIDGIN_PREFS_ROOT "/conversations/scrollback_lines"); |
4990 /* If we're sitting at more than 100 lines more than the | 4990 /* If we're sitting at more than 100 lines more than the |
4991 max scrollback, trim down to max scrollback */ | 4991 max scrollback, trim down to max scrollback */ |
4992 if (max_scrollback_lines > 0 | 4992 if (max_scrollback_lines > 0 |
4993 && line_count > (max_scrollback_lines + 100)) { | 4993 && line_count > (max_scrollback_lines + 100)) { |
4994 GtkTextBuffer *text_buffer = gtk_text_view_get_buffer( | 4994 GtkTextBuffer *text_buffer = gtk_text_view_get_buffer( |
5011 gtk_text_buffer_create_mark(gtk_text_view_get_buffer(GTK_TEXT_VIEW(gtkconv->imhtml)), | 5011 gtk_text_buffer_create_mark(gtk_text_view_get_buffer(GTK_TEXT_VIEW(gtkconv->imhtml)), |
5012 tmp, &iter, TRUE); | 5012 tmp, &iter, TRUE); |
5013 g_free(tmp); | 5013 g_free(tmp); |
5014 } | 5014 } |
5015 | 5015 |
5016 if (purple_prefs_get_bool("/purple/gtk/conversations/use_smooth_scrolling")) | 5016 if (purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/conversations/use_smooth_scrolling")) |
5017 gtk_font_options_all |= GTK_IMHTML_USE_SMOOTHSCROLLING; | 5017 gtk_font_options_all |= GTK_IMHTML_USE_SMOOTHSCROLLING; |
5018 | 5018 |
5019 if (gtk_text_buffer_get_char_count(gtk_text_view_get_buffer(GTK_TEXT_VIEW(gtkconv->imhtml)))) | 5019 if (gtk_text_buffer_get_char_count(gtk_text_view_get_buffer(GTK_TEXT_VIEW(gtkconv->imhtml)))) |
5020 gtk_imhtml_append_text(GTK_IMHTML(gtkconv->imhtml), "<BR>", gtk_font_options_all); | 5020 gtk_imhtml_append_text(GTK_IMHTML(gtkconv->imhtml), "<BR>", gtk_font_options_all); |
5021 | 5021 |
5046 sml_attrib = g_strdup_printf("sml=\"%s\"", purple_account_get_protocol_name(account)); | 5046 sml_attrib = g_strdup_printf("sml=\"%s\"", purple_account_get_protocol_name(account)); |
5047 | 5047 |
5048 gtk_font_options |= GTK_IMHTML_NO_COMMENTS; | 5048 gtk_font_options |= GTK_IMHTML_NO_COMMENTS; |
5049 | 5049 |
5050 if ((flags & PURPLE_MESSAGE_RECV) && | 5050 if ((flags & PURPLE_MESSAGE_RECV) && |
5051 !purple_prefs_get_bool("/purple/gtk/conversations/show_incoming_formatting")) | 5051 !purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/conversations/show_incoming_formatting")) |
5052 gtk_font_options |= GTK_IMHTML_NO_COLOURS | GTK_IMHTML_NO_FONTS | GTK_IMHTML_NO_SIZES | GTK_IMHTML_NO_FORMATTING; | 5052 gtk_font_options |= GTK_IMHTML_NO_COLOURS | GTK_IMHTML_NO_FONTS | GTK_IMHTML_NO_SIZES | GTK_IMHTML_NO_FORMATTING; |
5053 | 5053 |
5054 /* this is gonna crash one day, I can feel it. */ | 5054 /* this is gonna crash one day, I can feel it. */ |
5055 if (PURPLE_PLUGIN_PROTOCOL_INFO(purple_find_prpl(purple_account_get_protocol_id(conv->account)))->options & | 5055 if (PURPLE_PLUGIN_PROTOCOL_INFO(purple_find_prpl(purple_account_get_protocol_id(conv->account)))->options & |
5056 OPT_PROTO_USE_POINTSIZE) { | 5056 OPT_PROTO_USE_POINTSIZE) { |
6164 if (gtkconv->u.im->iter != NULL) | 6164 if (gtkconv->u.im->iter != NULL) |
6165 g_object_unref(G_OBJECT(gtkconv->u.im->iter)); | 6165 g_object_unref(G_OBJECT(gtkconv->u.im->iter)); |
6166 | 6166 |
6167 gtkconv->u.im->iter = NULL; | 6167 gtkconv->u.im->iter = NULL; |
6168 | 6168 |
6169 if (!purple_prefs_get_bool("/purple/gtk/conversations/im/show_buddy_icons")) | 6169 if (!purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/conversations/im/show_buddy_icons")) |
6170 return; | 6170 return; |
6171 | 6171 |
6172 if (purple_conversation_get_gc(conv) == NULL) | 6172 if (purple_conversation_get_gc(conv) == NULL) |
6173 return; | 6173 return; |
6174 | 6174 |
6494 GList *l; | 6494 GList *l; |
6495 PurpleConversation *conv; | 6495 PurpleConversation *conv; |
6496 PidginConversation *gtkconv; | 6496 PidginConversation *gtkconv; |
6497 PidginWindow *win; | 6497 PidginWindow *win; |
6498 | 6498 |
6499 if (!purple_prefs_get_bool("/purple/gtk/conversations/im/show_buddy_icons")) | 6499 if (!purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/conversations/im/show_buddy_icons")) |
6500 return; | 6500 return; |
6501 | 6501 |
6502 /* Set the "animate" flag for each icon based on the new preference */ | 6502 /* Set the "animate" flag for each icon based on the new preference */ |
6503 for (l = purple_get_ims(); l != NULL; l = l->next) { | 6503 for (l = purple_get_ims(); l != NULL; l = l->next) { |
6504 conv = (PurpleConversation *)l->data; | 6504 conv = (PurpleConversation *)l->data; |
6530 | 6530 |
6531 static void | 6531 static void |
6532 conv_placement_usetabs_cb(const char *name, PurplePrefType type, | 6532 conv_placement_usetabs_cb(const char *name, PurplePrefType type, |
6533 gconstpointer value, gpointer data) | 6533 gconstpointer value, gpointer data) |
6534 { | 6534 { |
6535 purple_prefs_trigger_callback("/purple/gtk/conversations/placement"); | 6535 purple_prefs_trigger_callback(PIDGIN_PREFS_ROOT "/conversations/placement"); |
6536 } | 6536 } |
6537 | 6537 |
6538 static void | 6538 static void |
6539 account_status_changed_cb(PurpleAccount *account, PurpleStatus *oldstatus, | 6539 account_status_changed_cb(PurpleAccount *account, PurpleStatus *oldstatus, |
6540 PurpleStatus *newstatus) | 6540 PurpleStatus *newstatus) |
6541 { | 6541 { |
6542 GList *l; | 6542 GList *l; |
6543 PurpleConversation *conv = NULL; | 6543 PurpleConversation *conv = NULL; |
6544 PidginConversation *gtkconv; | 6544 PidginConversation *gtkconv; |
6545 | 6545 |
6546 if(strcmp(purple_prefs_get_string("/purple/gtk/conversations/im/hide_new"), "away")!=0) | 6546 if(strcmp(purple_prefs_get_string(PIDGIN_PREFS_ROOT "/conversations/im/hide_new"), "away")!=0) |
6547 return; | 6547 return; |
6548 | 6548 |
6549 if(purple_status_is_available(oldstatus) || !purple_status_is_available(newstatus)) | 6549 if(purple_status_is_available(oldstatus) || !purple_status_is_available(newstatus)) |
6550 return; | 6550 return; |
6551 | 6551 |
6581 gboolean when_away = FALSE; | 6581 gboolean when_away = FALSE; |
6582 | 6582 |
6583 if(!hidden_convwin) | 6583 if(!hidden_convwin) |
6584 return; | 6584 return; |
6585 | 6585 |
6586 if(strcmp(purple_prefs_get_string("/purple/gtk/conversations/im/hide_new"), "always")==0) | 6586 if(strcmp(purple_prefs_get_string(PIDGIN_PREFS_ROOT "/conversations/im/hide_new"), "always")==0) |
6587 return; | 6587 return; |
6588 | 6588 |
6589 if(strcmp(purple_prefs_get_string("/purple/gtk/conversations/im/hide_new"), "away")==0) | 6589 if(strcmp(purple_prefs_get_string(PIDGIN_PREFS_ROOT "/conversations/im/hide_new"), "away")==0) |
6590 when_away = TRUE; | 6590 when_away = TRUE; |
6591 | 6591 |
6592 while ((l = hidden_convwin->gtkconvs) != NULL) | 6592 while ((l = hidden_convwin->gtkconvs) != NULL) |
6593 { | 6593 { |
6594 gtkconv = l->data; | 6594 gtkconv = l->data; |
6610 conv_placement_pref_cb(const char *name, PurplePrefType type, | 6610 conv_placement_pref_cb(const char *name, PurplePrefType type, |
6611 gconstpointer value, gpointer data) | 6611 gconstpointer value, gpointer data) |
6612 { | 6612 { |
6613 PidginConvPlacementFunc func; | 6613 PidginConvPlacementFunc func; |
6614 | 6614 |
6615 if (strcmp(name, "/purple/gtk/conversations/placement")) | 6615 if (strcmp(name, PIDGIN_PREFS_ROOT "/conversations/placement")) |
6616 return; | 6616 return; |
6617 | 6617 |
6618 func = pidgin_conv_placement_get_fnc(value); | 6618 func = pidgin_conv_placement_get_fnc(value); |
6619 | 6619 |
6620 if (func == NULL) | 6620 if (func == NULL) |
6791 { | 6791 { |
6792 void *handle = pidgin_conversations_get_handle(); | 6792 void *handle = pidgin_conversations_get_handle(); |
6793 void *blist_handle = purple_blist_get_handle(); | 6793 void *blist_handle = purple_blist_get_handle(); |
6794 | 6794 |
6795 /* Conversations */ | 6795 /* Conversations */ |
6796 purple_prefs_add_none("/purple/gtk/conversations"); | 6796 purple_prefs_add_none(PIDGIN_PREFS_ROOT "/conversations"); |
6797 purple_prefs_add_bool("/purple/gtk/conversations/use_smooth_scrolling", TRUE); | 6797 purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/conversations/use_smooth_scrolling", TRUE); |
6798 purple_prefs_add_bool("/purple/gtk/conversations/close_on_tabs", TRUE); | 6798 purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/conversations/close_on_tabs", TRUE); |
6799 purple_prefs_add_bool("/purple/gtk/conversations/send_bold", FALSE); | 6799 purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/conversations/send_bold", FALSE); |
6800 purple_prefs_add_bool("/purple/gtk/conversations/send_italic", FALSE); | 6800 purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/conversations/send_italic", FALSE); |
6801 purple_prefs_add_bool("/purple/gtk/conversations/send_underline", FALSE); | 6801 purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/conversations/send_underline", FALSE); |
6802 purple_prefs_add_bool("/purple/gtk/conversations/spellcheck", TRUE); | 6802 purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/conversations/spellcheck", TRUE); |
6803 purple_prefs_add_bool("/purple/gtk/conversations/show_incoming_formatting", TRUE); | 6803 purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/conversations/show_incoming_formatting", TRUE); |
6804 | 6804 |
6805 purple_prefs_add_bool("/purple/gtk/conversations/show_timestamps", TRUE); | 6805 purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/conversations/show_timestamps", TRUE); |
6806 purple_prefs_add_bool("/purple/gtk/conversations/show_formatting_toolbar", TRUE); | 6806 purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/conversations/show_formatting_toolbar", TRUE); |
6807 | 6807 |
6808 purple_prefs_add_string("/purple/gtk/conversations/placement", "last"); | 6808 purple_prefs_add_string(PIDGIN_PREFS_ROOT "/conversations/placement", "last"); |
6809 purple_prefs_add_int("/purple/gtk/conversations/placement_number", 1); | 6809 purple_prefs_add_int(PIDGIN_PREFS_ROOT "/conversations/placement_number", 1); |
6810 purple_prefs_add_string("/purple/gtk/conversations/bgcolor", ""); | 6810 purple_prefs_add_string(PIDGIN_PREFS_ROOT "/conversations/bgcolor", ""); |
6811 purple_prefs_add_string("/purple/gtk/conversations/fgcolor", ""); | 6811 purple_prefs_add_string(PIDGIN_PREFS_ROOT "/conversations/fgcolor", ""); |
6812 purple_prefs_add_string("/purple/gtk/conversations/font_face", ""); | 6812 purple_prefs_add_string(PIDGIN_PREFS_ROOT "/conversations/font_face", ""); |
6813 purple_prefs_add_int("/purple/gtk/conversations/font_size", 3); | 6813 purple_prefs_add_int(PIDGIN_PREFS_ROOT "/conversations/font_size", 3); |
6814 purple_prefs_add_bool("/purple/gtk/conversations/tabs", TRUE); | 6814 purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/conversations/tabs", TRUE); |
6815 purple_prefs_add_int("/purple/gtk/conversations/tab_side", GTK_POS_TOP); | 6815 purple_prefs_add_int(PIDGIN_PREFS_ROOT "/conversations/tab_side", GTK_POS_TOP); |
6816 purple_prefs_add_int("/purple/gtk/conversations/scrollback_lines", 4000); | 6816 purple_prefs_add_int(PIDGIN_PREFS_ROOT "/conversations/scrollback_lines", 4000); |
6817 | 6817 |
6818 /* Conversations -> Chat */ | 6818 /* Conversations -> Chat */ |
6819 purple_prefs_add_none("/purple/gtk/conversations/chat"); | 6819 purple_prefs_add_none(PIDGIN_PREFS_ROOT "/conversations/chat"); |
6820 purple_prefs_add_int("/purple/gtk/conversations/chat/default_width", 410); | 6820 purple_prefs_add_int(PIDGIN_PREFS_ROOT "/conversations/chat/default_width", 410); |
6821 purple_prefs_add_int("/purple/gtk/conversations/chat/default_height", 160); | 6821 purple_prefs_add_int(PIDGIN_PREFS_ROOT "/conversations/chat/default_height", 160); |
6822 purple_prefs_add_int("/purple/gtk/conversations/chat/entry_height", 50); | 6822 purple_prefs_add_int(PIDGIN_PREFS_ROOT "/conversations/chat/entry_height", 50); |
6823 purple_prefs_add_int("/purple/gtk/conversations/chat/userlist_width", 80); | 6823 purple_prefs_add_int(PIDGIN_PREFS_ROOT "/conversations/chat/userlist_width", 80); |
6824 /* Conversations -> IM */ | 6824 /* Conversations -> IM */ |
6825 purple_prefs_add_none("/purple/gtk/conversations/im"); | 6825 purple_prefs_add_none(PIDGIN_PREFS_ROOT "/conversations/im"); |
6826 | 6826 |
6827 purple_prefs_add_bool("/purple/gtk/conversations/im/animate_buddy_icons", TRUE); | 6827 purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/conversations/im/animate_buddy_icons", TRUE); |
6828 | 6828 |
6829 purple_prefs_add_int("/purple/gtk/conversations/im/default_width", 410); | 6829 purple_prefs_add_int(PIDGIN_PREFS_ROOT "/conversations/im/default_width", 410); |
6830 purple_prefs_add_int("/purple/gtk/conversations/im/default_height", 160); | 6830 purple_prefs_add_int(PIDGIN_PREFS_ROOT "/conversations/im/default_height", 160); |
6831 purple_prefs_add_int("/purple/gtk/conversations/im/entry_height", 50); | 6831 purple_prefs_add_int(PIDGIN_PREFS_ROOT "/conversations/im/entry_height", 50); |
6832 purple_prefs_add_bool("/purple/gtk/conversations/im/show_buddy_icons", TRUE); | 6832 purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/conversations/im/show_buddy_icons", TRUE); |
6833 | 6833 |
6834 purple_prefs_add_string("/purple/gtk/conversations/im/hide_new", "never"); | 6834 purple_prefs_add_string(PIDGIN_PREFS_ROOT "/conversations/im/hide_new", "never"); |
6835 | 6835 |
6836 /* Connect callbacks. */ | 6836 /* Connect callbacks. */ |
6837 purple_prefs_connect_callback(handle, "/purple/gtk/conversations/close_on_tabs", | 6837 purple_prefs_connect_callback(handle, PIDGIN_PREFS_ROOT "/conversations/close_on_tabs", |
6838 close_on_tabs_pref_cb, NULL); | 6838 close_on_tabs_pref_cb, NULL); |
6839 purple_prefs_connect_callback(handle, "/purple/gtk/conversations/show_timestamps", | 6839 purple_prefs_connect_callback(handle, PIDGIN_PREFS_ROOT "/conversations/show_timestamps", |
6840 show_timestamps_pref_cb, NULL); | 6840 show_timestamps_pref_cb, NULL); |
6841 purple_prefs_connect_callback(handle, "/purple/gtk/conversations/show_formatting_toolbar", | 6841 purple_prefs_connect_callback(handle, PIDGIN_PREFS_ROOT "/conversations/show_formatting_toolbar", |
6842 show_formatting_toolbar_pref_cb, NULL); | 6842 show_formatting_toolbar_pref_cb, NULL); |
6843 purple_prefs_connect_callback(handle, "/purple/gtk/conversations/spellcheck", | 6843 purple_prefs_connect_callback(handle, PIDGIN_PREFS_ROOT "/conversations/spellcheck", |
6844 spellcheck_pref_cb, NULL); | 6844 spellcheck_pref_cb, NULL); |
6845 purple_prefs_connect_callback(handle, "/purple/gtk/conversations/tab_side", | 6845 purple_prefs_connect_callback(handle, PIDGIN_PREFS_ROOT "/conversations/tab_side", |
6846 tab_side_pref_cb, NULL); | 6846 tab_side_pref_cb, NULL); |
6847 | 6847 |
6848 purple_prefs_connect_callback(handle, "/purple/gtk/conversations/tabs", | 6848 purple_prefs_connect_callback(handle, PIDGIN_PREFS_ROOT "/conversations/tabs", |
6849 conv_placement_usetabs_cb, NULL); | 6849 conv_placement_usetabs_cb, NULL); |
6850 | 6850 |
6851 purple_prefs_connect_callback(handle, "/purple/gtk/conversations/placement", | 6851 purple_prefs_connect_callback(handle, PIDGIN_PREFS_ROOT "/conversations/placement", |
6852 conv_placement_pref_cb, NULL); | 6852 conv_placement_pref_cb, NULL); |
6853 purple_prefs_trigger_callback("/purple/gtk/conversations/placement"); | 6853 purple_prefs_trigger_callback(PIDGIN_PREFS_ROOT "/conversations/placement"); |
6854 | 6854 |
6855 /* IM callbacks */ | 6855 /* IM callbacks */ |
6856 purple_prefs_connect_callback(handle, "/purple/gtk/conversations/im/animate_buddy_icons", | 6856 purple_prefs_connect_callback(handle, PIDGIN_PREFS_ROOT "/conversations/im/animate_buddy_icons", |
6857 animate_buddy_icons_pref_cb, NULL); | 6857 animate_buddy_icons_pref_cb, NULL); |
6858 purple_prefs_connect_callback(handle, "/purple/gtk/conversations/im/show_buddy_icons", | 6858 purple_prefs_connect_callback(handle, PIDGIN_PREFS_ROOT "/conversations/im/show_buddy_icons", |
6859 show_buddy_icons_pref_cb, NULL); | 6859 show_buddy_icons_pref_cb, NULL); |
6860 purple_prefs_connect_callback(handle, "/purple/gtk/conversations/im/hide_new", | 6860 purple_prefs_connect_callback(handle, PIDGIN_PREFS_ROOT "/conversations/im/hide_new", |
6861 hide_new_pref_cb, NULL); | 6861 hide_new_pref_cb, NULL); |
6862 | 6862 |
6863 | 6863 |
6864 | 6864 |
6865 /********************************************************************** | 6865 /********************************************************************** |
7743 generate_send_to_items(win); | 7743 generate_send_to_items(win); |
7744 regenerate_options_items(win); | 7744 regenerate_options_items(win); |
7745 | 7745 |
7746 pidgin_conv_switch_active_conversation(conv); | 7746 pidgin_conv_switch_active_conversation(conv); |
7747 | 7747 |
7748 sound_method = purple_prefs_get_string("/purple/gtk/sound/method"); | 7748 sound_method = purple_prefs_get_string(PIDGIN_PREFS_ROOT "/sound/method"); |
7749 if (strcmp(sound_method, "none") != 0) | 7749 if (strcmp(sound_method, "none") != 0) |
7750 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(win->menu.sounds), | 7750 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(win->menu.sounds), |
7751 gtkconv->make_sound); | 7751 gtkconv->make_sound); |
7752 | 7752 |
7753 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(win->menu.show_formatting_toolbar), | 7753 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(win->menu.show_formatting_toolbar), |
7754 purple_prefs_get_bool("/purple/gtk/conversations/show_formatting_toolbar")); | 7754 purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/conversations/show_formatting_toolbar")); |
7755 | 7755 |
7756 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(win->menu.show_timestamps), | 7756 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(win->menu.show_timestamps), |
7757 purple_prefs_get_bool("/purple/gtk/conversations/show_timestamps")); | 7757 purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/conversations/show_timestamps")); |
7758 | 7758 |
7759 if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_IM && | 7759 if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_IM && |
7760 purple_prefs_get_bool("/purple/gtk/conversations/im/show_buddy_icons")) | 7760 purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/conversations/im/show_buddy_icons")) |
7761 { | 7761 { |
7762 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(win->menu.show_icon), | 7762 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(win->menu.show_icon), |
7763 gtkconv->u.im->show_icon); | 7763 gtkconv->u.im->show_icon); |
7764 } | 7764 } |
7765 | 7765 |
7842 G_CALLBACK(focus_win_cb), win); | 7842 G_CALLBACK(focus_win_cb), win); |
7843 | 7843 |
7844 /* Create the notebook. */ | 7844 /* Create the notebook. */ |
7845 win->notebook = gtk_notebook_new(); | 7845 win->notebook = gtk_notebook_new(); |
7846 | 7846 |
7847 pos = purple_prefs_get_int("/purple/gtk/conversations/tab_side"); | 7847 pos = purple_prefs_get_int(PIDGIN_PREFS_ROOT "/conversations/tab_side"); |
7848 | 7848 |
7849 #if 0 | 7849 #if 0 |
7850 gtk_notebook_set_tab_hborder(GTK_NOTEBOOK(win->notebook), 0); | 7850 gtk_notebook_set_tab_hborder(GTK_NOTEBOOK(win->notebook), 0); |
7851 gtk_notebook_set_tab_vborder(GTK_NOTEBOOK(win->notebook), 0); | 7851 gtk_notebook_set_tab_vborder(GTK_NOTEBOOK(win->notebook), 0); |
7852 #endif | 7852 #endif |
7973 | 7973 |
7974 | 7974 |
7975 win->gtkconvs = g_list_append(win->gtkconvs, gtkconv); | 7975 win->gtkconvs = g_list_append(win->gtkconvs, gtkconv); |
7976 gtkconv->win = win; | 7976 gtkconv->win = win; |
7977 | 7977 |
7978 if (purple_prefs_get_int("/purple/gtk/conversations/tab_side") == GTK_POS_LEFT || | 7978 if (purple_prefs_get_int(PIDGIN_PREFS_ROOT "/conversations/tab_side") == GTK_POS_LEFT || |
7979 purple_prefs_get_int("/purple/gtk/conversations/tab_side") == GTK_POS_RIGHT) | 7979 purple_prefs_get_int(PIDGIN_PREFS_ROOT "/conversations/tab_side") == GTK_POS_RIGHT) |
7980 tabs_side = TRUE; | 7980 tabs_side = TRUE; |
7981 else if (purple_prefs_get_int("/purple/gtk/conversations/tab_side") == (GTK_POS_LEFT|8)) | 7981 else if (purple_prefs_get_int(PIDGIN_PREFS_ROOT "/conversations/tab_side") == (GTK_POS_LEFT|8)) |
7982 angle = 90; | 7982 angle = 90; |
7983 else if (purple_prefs_get_int("/purple/gtk/conversations/tab_side") == (GTK_POS_RIGHT|8)) | 7983 else if (purple_prefs_get_int(PIDGIN_PREFS_ROOT "/conversations/tab_side") == (GTK_POS_RIGHT|8)) |
7984 angle = 270; | 7984 angle = 270; |
7985 | 7985 |
7986 if (angle) | 7986 if (angle) |
7987 gtkconv->tabby = tabby = gtk_vbox_new(FALSE, PIDGIN_HIG_BOX_SPACE); | 7987 gtkconv->tabby = tabby = gtk_vbox_new(FALSE, PIDGIN_HIG_BOX_SPACE); |
7988 else | 7988 else |
8067 | 8067 |
8068 if (angle == 90) | 8068 if (angle == 90) |
8069 gtk_box_pack_start(GTK_BOX(tabby), gtkconv->icon, FALSE, FALSE, 0); | 8069 gtk_box_pack_start(GTK_BOX(tabby), gtkconv->icon, FALSE, FALSE, 0); |
8070 else | 8070 else |
8071 gtk_box_pack_start(GTK_BOX(tabby), gtkconv->close, FALSE, FALSE, 0); | 8071 gtk_box_pack_start(GTK_BOX(tabby), gtkconv->close, FALSE, FALSE, 0); |
8072 if (purple_prefs_get_bool("/purple/gtk/conversations/close_on_tabs")) | 8072 if (purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/conversations/close_on_tabs")) |
8073 gtk_widget_show(gtkconv->close); | 8073 gtk_widget_show(gtkconv->close); |
8074 | 8074 |
8075 gtk_widget_show(tabby); | 8075 gtk_widget_show(tabby); |
8076 gtk_widget_show(menu_tabby); | 8076 gtk_widget_show(menu_tabby); |
8077 | 8077 |
8088 if (pidgin_conv_window_get_gtkconv_count(win) == 1) { | 8088 if (pidgin_conv_window_get_gtkconv_count(win) == 1) { |
8089 /* Er, bug in notebooks? Switch to the page manually. */ | 8089 /* Er, bug in notebooks? Switch to the page manually. */ |
8090 gtk_notebook_set_current_page(GTK_NOTEBOOK(win->notebook), 0); | 8090 gtk_notebook_set_current_page(GTK_NOTEBOOK(win->notebook), 0); |
8091 | 8091 |
8092 gtk_notebook_set_show_tabs(GTK_NOTEBOOK(win->notebook), | 8092 gtk_notebook_set_show_tabs(GTK_NOTEBOOK(win->notebook), |
8093 purple_prefs_get_bool("/purple/gtk/conversations/tabs")); | 8093 purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/conversations/tabs")); |
8094 } else | 8094 } else |
8095 gtk_notebook_set_show_tabs(GTK_NOTEBOOK(win->notebook), TRUE); | 8095 gtk_notebook_set_show_tabs(GTK_NOTEBOOK(win->notebook), TRUE); |
8096 | 8096 |
8097 focus_gtkconv = g_list_nth_data(pidgin_conv_window_get_gtkconvs(win), | 8097 focus_gtkconv = g_list_nth_data(pidgin_conv_window_get_gtkconvs(win), |
8098 gtk_notebook_get_current_page(GTK_NOTEBOOK(win->notebook))); | 8098 gtk_notebook_get_current_page(GTK_NOTEBOOK(win->notebook))); |
8117 gtk_notebook_remove_page(GTK_NOTEBOOK(win->notebook), index); | 8117 gtk_notebook_remove_page(GTK_NOTEBOOK(win->notebook), index); |
8118 | 8118 |
8119 /* go back to tabless if need be */ | 8119 /* go back to tabless if need be */ |
8120 if (pidgin_conv_window_get_gtkconv_count(win) <= 2) { | 8120 if (pidgin_conv_window_get_gtkconv_count(win) <= 2) { |
8121 gtk_notebook_set_show_tabs(GTK_NOTEBOOK(win->notebook), | 8121 gtk_notebook_set_show_tabs(GTK_NOTEBOOK(win->notebook), |
8122 purple_prefs_get_bool("/purple/gtk/conversations/tabs")); | 8122 purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/conversations/tabs")); |
8123 } | 8123 } |
8124 | 8124 |
8125 win->gtkconvs = g_list_remove(win->gtkconvs, gtkconv); | 8125 win->gtkconvs = g_list_remove(win->gtkconvs, gtkconv); |
8126 | 8126 |
8127 if (!win->gtkconvs && win != hidden_convwin) | 8127 if (!win->gtkconvs && win != hidden_convwin) |
8566 pidgin_conv_placement_set_current_func(PidginConvPlacementFunc func) | 8566 pidgin_conv_placement_set_current_func(PidginConvPlacementFunc func) |
8567 { | 8567 { |
8568 g_return_if_fail(func != NULL); | 8568 g_return_if_fail(func != NULL); |
8569 | 8569 |
8570 /* If tabs are enabled, set the function, otherwise, NULL it out. */ | 8570 /* If tabs are enabled, set the function, otherwise, NULL it out. */ |
8571 if (purple_prefs_get_bool("/purple/gtk/conversations/tabs")) | 8571 if (purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/conversations/tabs")) |
8572 place_conv = func; | 8572 place_conv = func; |
8573 else | 8573 else |
8574 place_conv = NULL; | 8574 place_conv = NULL; |
8575 } | 8575 } |
8576 | 8576 |