Mercurial > pidgin
comparison src/prefs.c @ 4469:d76095396a0e
[gaim-migrate @ 4744]
Phase 2 of the conversation rewrite! Did you think I was done?
Okay everybody, the prefs page was slightly redesigned. Not much, though.
It needs an overhaul, and still, not everything works.. What we have now
is:
Conversations
|
|- IMs
|- Chats
`- Tabs
But that's not the good part of this patch. Oh no, not close. You see, in
Conversations, we now have a "Placement" drop-down box. Though this prefs
page is ugly and will eventually be redesigned, this gives you the
opportunity to set one of a number of different types of conversation
placement options.
The defaults are:
- Last created window: Adds the new conversation to the last created
window, like how things have been lately.
- New window: Adds the new conversation to a brand new window, every
time. Tabs are still there, so you can drag them between windows if you
want to manually group them.
- By group: This is my new favorite. This will put the new conversation
in whatever window it finds first that has another member from that
same group on your buddy list. If it doesn't find one, it creates a new
window. If the person you IM'd or the person who IM'd you is not on your
list, it gets put in a window with other people not on your list.
These are the only ones implemented, but don't think you're limited to
that. You see, we have new API functions for registering these
Conversation Placement functions. All a plugin would need to do is to write
a function, take into account OPT_CONVO_COMBINE (oh yeah, "Show IMs and
chats in same tabbed window" works again), make sure the conversation is
added _somewhere_, and then just register that function. If the plugin is
loaded, the user can select it from the existing drop-down box.
Cool, huh? Make sure to unregister the function when the plugin is
unloaded.
Have fun.
committer: Tailor Script <tailor@pidgin.im>
author | Christian Hammond <chipx86@chipx86.com> |
---|---|
date | Thu, 30 Jan 2003 09:22:15 +0000 |
parents | 75ff69e592cc |
children | 890024103ae5 |
comparison
equal
deleted
inserted
replaced
4468:a046ff4793ca | 4469:d76095396a0e |
---|---|
564 | 564 |
565 gtk_widget_show_all(ret); | 565 gtk_widget_show_all(ret); |
566 return ret; | 566 return ret; |
567 } | 567 } |
568 | 568 |
569 GtkWidget *conv_page() { | |
570 GtkWidget *ret; | |
571 GtkWidget *vbox; | |
572 GtkWidget *label; | |
573 GtkSizeGroup *sg; | |
574 GList *names = NULL; | |
575 int i; | |
576 | |
577 ret = gtk_vbox_new(FALSE, 18); | |
578 gtk_container_set_border_width(GTK_CONTAINER(ret), 12); | |
579 | |
580 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); | |
581 vbox = make_frame(ret, _("Conversations")); | |
582 | |
583 /* Build a list of names. */ | |
584 for (i = 0; i < gaim_conv_placement_get_fnc_count(); i++) { | |
585 names = g_list_append(names, (char *)gaim_conv_placement_get_name(i)); | |
586 names = g_list_append(names, GINT_TO_POINTER(i)); | |
587 } | |
588 | |
589 label = gaim_dropdown_from_list(vbox, _("_Placement:"), | |
590 &conv_placement_option, -1, names); | |
591 | |
592 g_list_free(names); | |
593 | |
594 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); | |
595 gtk_size_group_add_widget(sg, label); | |
596 | |
597 gaim_button(_("Show IMs and chats in _same tabbed window."), | |
598 &convo_options, OPT_CONVO_COMBINE, vbox); | |
599 | |
600 gtk_widget_show_all(ret); | |
601 | |
602 return ret; | |
603 } | |
604 | |
569 GtkWidget *im_page() { | 605 GtkWidget *im_page() { |
570 GtkWidget *ret; | 606 GtkWidget *ret; |
571 GtkWidget *vbox; | 607 GtkWidget *vbox; |
572 GtkWidget *typingbutton, *widge; | 608 GtkWidget *typingbutton, *widge; |
573 GtkSizeGroup *sg; | 609 GtkSizeGroup *sg; |
679 _("Top"), 0, | 715 _("Top"), 0, |
680 _("Bottom"), OPT_BLIST_BOTTOM_TAB, NULL); | 716 _("Bottom"), OPT_BLIST_BOTTOM_TAB, NULL); |
681 gtk_size_group_add_widget(sg, dd); | 717 gtk_size_group_add_widget(sg, dd); |
682 | 718 |
683 vbox = make_frame (ret, _("Tab Options")); | 719 vbox = make_frame (ret, _("Tab Options")); |
684 gaim_button(_("Show IMs and chats in _same tabbed window."), &convo_options, OPT_CONVO_COMBINE, vbox); | |
685 button = gaim_button(_("Show _close button on tabs."), &convo_options, OPT_CONVO_NO_X_ON_TAB, vbox); | 720 button = gaim_button(_("Show _close button on tabs."), &convo_options, OPT_CONVO_NO_X_ON_TAB, vbox); |
686 convo_options ^= OPT_CONVO_NO_X_ON_TAB; | 721 convo_options ^= OPT_CONVO_NO_X_ON_TAB; |
687 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(button), !gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(button))); | 722 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(button), !gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(button))); |
688 | 723 |
689 | 724 |
1663 gtk_notebook_append_page(GTK_NOTEBOOK(prefsnotebook), page, gtk_label_new(text)); | 1698 gtk_notebook_append_page(GTK_NOTEBOOK(prefsnotebook), page, gtk_label_new(text)); |
1664 return iter; | 1699 return iter; |
1665 } | 1700 } |
1666 | 1701 |
1667 void prefs_notebook_init() { | 1702 void prefs_notebook_init() { |
1668 GtkTreeIter p, c; | 1703 GtkTreeIter p, p2, c; |
1669 #if USE_PLUGINS | 1704 #if USE_PLUGINS |
1670 GtkWidget *(*config)(); | 1705 GtkWidget *(*config)(); |
1671 GList *l = plugins; | 1706 GList *l = plugins; |
1672 struct gaim_plugin *plug; | 1707 struct gaim_plugin *plug; |
1673 #endif | 1708 #endif |
1675 prefs_notebook_add_page(_("Themes"), NULL, theme_page(), &c, &p, notebook_page++); | 1710 prefs_notebook_add_page(_("Themes"), NULL, theme_page(), &c, &p, notebook_page++); |
1676 prefs_notebook_add_page(_("Fonts"), NULL, font_page(), &c, &p, notebook_page++); | 1711 prefs_notebook_add_page(_("Fonts"), NULL, font_page(), &c, &p, notebook_page++); |
1677 prefs_notebook_add_page(_("Message Text"), NULL, messages_page(), &c, &p, notebook_page++); | 1712 prefs_notebook_add_page(_("Message Text"), NULL, messages_page(), &c, &p, notebook_page++); |
1678 prefs_notebook_add_page(_("Shortcuts"), NULL, hotkeys_page(), &c, &p, notebook_page++); | 1713 prefs_notebook_add_page(_("Shortcuts"), NULL, hotkeys_page(), &c, &p, notebook_page++); |
1679 prefs_notebook_add_page(_("Buddy List"), NULL, list_page(), &c, &p, notebook_page++); | 1714 prefs_notebook_add_page(_("Buddy List"), NULL, list_page(), &c, &p, notebook_page++); |
1680 prefs_notebook_add_page(_("IM Window"), NULL, im_page(), &c, &p, notebook_page++); | 1715 prefs_notebook_add_page(_("Conversations"), NULL, conv_page(), &p2, &p, notebook_page++); |
1681 prefs_notebook_add_page(_("Chat Window"), NULL, chat_page(), &c, &p, notebook_page++); | 1716 prefs_notebook_add_page(_("IMs"), NULL, im_page(), &c, &p2, notebook_page++); |
1682 prefs_notebook_add_page(_("Tabs"), NULL, tab_page(), &c, &p, notebook_page++); | 1717 prefs_notebook_add_page(_("Chats"), NULL, chat_page(), &c, &p2, notebook_page++); |
1718 prefs_notebook_add_page(_("Tabs"), NULL, tab_page(), &c, &p2, notebook_page++); | |
1683 prefs_notebook_add_page(_("Proxy"), NULL, proxy_page(), &p, NULL, notebook_page++); | 1719 prefs_notebook_add_page(_("Proxy"), NULL, proxy_page(), &p, NULL, notebook_page++); |
1684 #ifndef _WIN32 | 1720 #ifndef _WIN32 |
1685 /* We use the registered default browser in windows */ | 1721 /* We use the registered default browser in windows */ |
1686 prefs_notebook_add_page(_("Browser"), NULL, browser_page(), &p, NULL, notebook_page++); | 1722 prefs_notebook_add_page(_("Browser"), NULL, browser_page(), &p, NULL, notebook_page++); |
1687 #endif | 1723 #endif |
2273 else | 2309 else |
2274 gtk_widget_set_sensitive(sndcmd, FALSE); | 2310 gtk_widget_set_sensitive(sndcmd, FALSE); |
2275 } else if (option == (int*)&im_options) { | 2311 } else if (option == (int*)&im_options) { |
2276 if (clear == (OPT_IM_SIDE_TAB | OPT_IM_BR_TAB)) | 2312 if (clear == (OPT_IM_SIDE_TAB | OPT_IM_BR_TAB)) |
2277 gaim_gtkconv_update_tabs(); | 2313 gaim_gtkconv_update_tabs(); |
2278 /* CONV XXX update_im_tabs(); */ | |
2279 else if (clear == (OPT_IM_BUTTON_TEXT | OPT_IM_BUTTON_XPM)) | 2314 else if (clear == (OPT_IM_BUTTON_TEXT | OPT_IM_BUTTON_XPM)) |
2280 gaim_gtkconv_update_im_button_style(); | 2315 gaim_gtkconv_update_im_button_style(); |
2281 } else if (option == (int*)&chat_options) { | 2316 } else if (option == (int*)&chat_options) { |
2282 if (clear == (OPT_CHAT_SIDE_TAB | OPT_CHAT_BR_TAB)) | 2317 if (clear == (OPT_CHAT_SIDE_TAB | OPT_CHAT_BR_TAB)) |
2283 gaim_gtkconv_update_tabs(); | 2318 gaim_gtkconv_update_tabs(); |
2284 /* CONV XXX update_chat_tabs(); */ | |
2285 else if (clear == (OPT_CHAT_BUTTON_TEXT | OPT_CHAT_BUTTON_XPM)) | 2319 else if (clear == (OPT_CHAT_BUTTON_TEXT | OPT_CHAT_BUTTON_XPM)) |
2286 gaim_gtkconv_update_chat_button_style(); | 2320 gaim_gtkconv_update_chat_button_style(); |
2287 } else if (option == (int*)&blist_options) { | 2321 } else if (option == (int*)&blist_options) { |
2288 set_blist_tab(); | 2322 set_blist_tab(); |
2323 } else if (option == (int *)&conv_placement_option) { | |
2324 gaim_conv_placement_set_active(conv_placement_option); | |
2289 } | 2325 } |
2290 } | 2326 } |
2291 | 2327 |
2292 static GtkWidget *gaim_dropdown(GtkWidget *box, const gchar *title, int *option, int clear, ...) | 2328 static GtkWidget *gaim_dropdown(GtkWidget *box, const gchar *title, int *option, int clear, ...) |
2293 { | 2329 { |