src/gtkconv.c

changeset 5673
47f654fb5134
parent 5629
b4e5e815b5f4
child 5674
44742bed404f
equal deleted inserted replaced
5672:3512d54630f9 5673:47f654fb5134
4597 } 4597 }
4598 } 4598 }
4599 #endif 4599 #endif
4600 } 4600 }
4601 4601
4602 void
4603 gaim_gtkconv_toggle_close_buttons(void)
4604 {
4605 GList *cl;
4606 struct gaim_conversation *conv;
4607 struct gaim_gtk_conversation *gtkconv;
4608
4609 for (cl = gaim_get_conversations(); cl != NULL; cl = cl->next) {
4610 conv = (struct gaim_conversation *)cl->data;
4611 if (!GAIM_IS_GTK_CONVERSATION(conv))
4612 continue;
4613
4614 gtkconv = GAIM_GTK_CONVERSATION(conv);
4615
4616 if (!gaim_prefs_get_bool("/gaim/gtk/conversations/close_on_tabs"))
4617 gtk_widget_hide(gtkconv->close);
4618 else
4619 gtk_widget_show_all(gtkconv->close);
4620 }
4621 }
4622
4623 static void 4602 static void
4624 remove_icon(struct gaim_gtk_conversation *gtkconv) 4603 remove_icon(struct gaim_gtk_conversation *gtkconv)
4625 { 4604 {
4626 if (gtkconv == NULL) 4605 if (gtkconv == NULL)
4627 return; 4606 return;
5349 return -1; 5328 return -1;
5350 5329
5351 return page_num; 5330 return page_num;
5352 } 5331 }
5353 5332
5333 static void
5334 close_on_tabs_pref_cb(const char *name, GaimPrefType type, gpointer value,
5335 gpointer data)
5336 {
5337 GList *l;
5338 struct gaim_conversation *conv;
5339 struct gaim_gtk_conversation *gtkconv;
5340
5341 for (l = gaim_get_conversations(); l != NULL; l = l->next) {
5342 conv = (struct gaim_conversation *)l->data;
5343
5344 if (!GAIM_IS_GTK_CONVERSATION(conv))
5345 continue;
5346
5347 gtkconv= GAIM_GTK_CONVERSATION(conv);
5348
5349 if (value)
5350 gtk_widget_show(gtkconv->close);
5351 else
5352 gtk_widget_hide(gtkconv->close);
5353 }
5354 }
5355
5356 void
5357 gaim_gtk_conversation_init(void)
5358 {
5359 /* Conversations */
5360 gaim_prefs_add_none("/gaim/gtk/conversations");
5361 gaim_prefs_add_bool("/gaim/gtk/conversations/close_on_tabs", TRUE);
5362 gaim_prefs_add_bool("/gaim/gtk/conversations/ctrl_enter_sends", FALSE);
5363 gaim_prefs_add_bool("/gaim/gtk/conversations/enter_sends", TRUE);
5364 gaim_prefs_add_bool("/gaim/gtk/conversations/escape_closes", FALSE);
5365 gaim_prefs_add_bool("/gaim/gtk/conversations/ctrl_w_closes", FALSE);
5366 gaim_prefs_add_bool("/gaim/gtk/conversations/f2_toggles_timestamps", TRUE);
5367 gaim_prefs_add_bool("/gaim/gtk/conversations/send_bold", FALSE);
5368 gaim_prefs_add_bool("/gaim/gtk/conversations/send_italic", FALSE);
5369 gaim_prefs_add_bool("/gaim/gtk/conversations/send_strikethrough", FALSE);
5370 gaim_prefs_add_bool("/gaim/gtk/conversations/send_underline", FALSE);
5371 gaim_prefs_add_bool("/gaim/gtk/conversations/show_smileys", TRUE);
5372 gaim_prefs_add_bool("/gaim/gtk/conversations/show_timestamps", TRUE);
5373 gaim_prefs_add_bool("/gaim/gtk/conversations/show_urls_as_links", TRUE);
5374 gaim_prefs_add_bool("/gaim/gtk/conversations/spellcheck", TRUE);
5375 gaim_prefs_add_bool("/gaim/gtk/conversations/ignore_colors", FALSE);
5376 gaim_prefs_add_bool("/gaim/gtk/conversations/ignore_fonts", FALSE);
5377 gaim_prefs_add_bool("/gaim/gtk/conversations/ignore_font_sizes", FALSE);
5378 gaim_prefs_add_bool("/gaim/gtk/conversations/use_custom_bgcolor", FALSE);
5379 gaim_prefs_add_bool("/gaim/gtk/conversations/use_custom_fgcolor", FALSE);
5380 gaim_prefs_add_bool("/gaim/gtk/conversations/use_custom_font", FALSE);
5381 gaim_prefs_add_bool("/gaim/gtk/conversations/use_custom_size", FALSE);
5382 gaim_prefs_add_bool("/gaim/gtk/conversations/html_shortcuts", FALSE);
5383 gaim_prefs_add_bool("/gaim/gtk/conversations/smiley_shortcuts", FALSE);
5384 gaim_prefs_add_string("/gaim/gtk/conversations/bgcolor", "#FFFFFF");
5385 gaim_prefs_add_string("/gaim/gtk/conversations/fgcolor", "#000000");
5386 gaim_prefs_add_string("/gaim/gtk/conversations/font_face", "");
5387 gaim_prefs_add_int("/gaim/gtk/conversations/font_size", 3);
5388 gaim_prefs_add_bool("/gaim/gtk/conversations/tabs", TRUE);
5389 gaim_prefs_add_int("/gaim/gtk/conversations/tab_side", GTK_POS_TOP);
5390 gaim_prefs_add_string("/gaim/gtk/conversations/placement", "");
5391
5392 /* Conversations -> Chat */
5393 gaim_prefs_add_none("/gaim/gtk/conversations/chat");
5394 gaim_prefs_add_int("/gaim/gtk/conversations/chat/button_type",
5395 GAIM_BUTTON_TEXT_IMAGE);
5396 gaim_prefs_add_bool("/gaim/gtk/conversations/chat/color_nicks", TRUE);
5397 gaim_prefs_add_bool("/gaim/gtk/conversations/chat/old_tab_complete", FALSE);
5398 gaim_prefs_add_bool("/gaim/gtk/conversations/chat/raise_on_events", FALSE);
5399 gaim_prefs_add_bool("/gaim/gtk/conversations/chat/tab_completion", TRUE);
5400 gaim_prefs_add_int("/gaim/gtk/conversations/chat/default_width", 410);
5401 gaim_prefs_add_int("/gaim/gtk/conversations/chat/default_height", 160);
5402 gaim_prefs_add_int("/gaim/gtk/conversations/chat/entry_height", 50);
5403
5404 /* Conversations -> IM */
5405 gaim_prefs_add_none("/gaim/gtk/conversations/im");
5406 gaim_prefs_add_int("/gaim/gtk/conversations/im/button_type",
5407 GAIM_BUTTON_TEXT_IMAGE);
5408 gaim_prefs_add_bool("/gaim/gtk/conversations/im/animate_buddy_icons", TRUE);
5409 gaim_prefs_add_bool("/gaim/gtk/conversations/im/hide_on_send", FALSE);
5410 gaim_prefs_add_bool("/gaim/gtk/conversations/im/raise_on_events", FALSE);
5411 gaim_prefs_add_bool("/gaim/gtk/conversations/im/show_buddy_icons", TRUE);
5412 gaim_prefs_add_int("/gaim/gtk/conversations/im/default_width", 410);
5413 gaim_prefs_add_int("/gaim/gtk/conversations/im/default_height", 160);
5414 gaim_prefs_add_int("/gaim/gtk/conversations/im/entry_height", 50);
5415
5416 /* Connect callbacks. */
5417 gaim_prefs_connect_callback("/gaim/gtk/conversations/close_on_tabs",
5418 close_on_tabs_pref_cb, NULL);
5419 }
5420

mercurial