Mercurial > pidgin.yaz
comparison src/prefs.c @ 4359:5fb47ec9bfe4
[gaim-migrate @ 4625]
Wow, okay, where to begin with this one ;)
I rewrote the whole conversation backend. It is now core/UI split. Here's
how it works..
Every conversation is represented by a gaim_conversation structure. This
branches out into gaim_im and gaim_chat structures. Every conversation
lives in (well, normally, but it doesn't have to) a gaim_window structure.
This is a _CORE_ representation of a window. There can be multiple
gaim_window structures around.
The gaim_window and gaim_conversation structures have UI-specific operation
structures associated with them. At the moment, the only UI is GTK+, and
this will be for some time. Don't start thinking you can write a QT UI now.
It's just not going to happen.
Everything that is done on a conversation is done through the core API.
This API does core processing and then calls the UI operations for the
rendering and anything else.
Now, what does this give the user?
- Multiple windows.
- Multiple tabs per window.
- Draggable tabs.
- Send As menu is moved to the menubar.
- Menubar for chats.
- Some very cool stuff in the future, like replacing, say, IRC chat windows
with an X-Chat interface, or whatever.
- Later on, customizable window/conversation positioning.
For developers:
- Fully documented API
- Core/UI split
- Variable checking and mostly sane handling of incorrect variables.
- Logical structure to conversations, both core and UI.
- Some very cool stuff in the future, like replacing, say, IRC chat windows
with an X-Chat interface, or whatever.
- Later on, customizable window/conversation positioning.
- Oh yeah, and the beginning of a stock icon system.
Now, there are things that aren't there yet. You will see tabs even if you
have them turned off. This will be fixed in time. Also, the preferences
will change to work with the new structure. I'm starting school in 2 days,
so it may not be done immediately, but hopefully in the next week.
Enjoy!
committer: Tailor Script <tailor@pidgin.im>
author | Christian Hammond <chipx86@chipx86.com> |
---|---|
date | Mon, 20 Jan 2003 09:10:23 +0000 |
parents | 78bc4c8e4b2e |
children | 0ffdb9b6a5e9 |
comparison
equal
deleted
inserted
replaced
4358:2b8abf7f9cc1 | 4359:5fb47ec9bfe4 |
---|---|
432 gtk_size_group_add_widget(sg, button); | 432 gtk_size_group_add_widget(sg, button); |
433 select = gtk_button_new_from_stock(GTK_STOCK_SELECT_FONT); | 433 select = gtk_button_new_from_stock(GTK_STOCK_SELECT_FONT); |
434 | 434 |
435 if (!(font_options & OPT_FONT_FACE)) | 435 if (!(font_options & OPT_FONT_FACE)) |
436 gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE); | 436 gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE); |
437 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(toggle_sensitive), select); | 437 g_signal_connect(GTK_OBJECT(button), "clicked", |
438 g_signal_connect(GTK_OBJECT(select), "clicked", G_CALLBACK(show_font_dialog), NULL); | 438 G_CALLBACK(gaim_gtk_toggle_sensitive), select); |
439 g_signal_connect(GTK_OBJECT(select), "clicked", | |
440 G_CALLBACK(show_font_dialog), NULL); | |
439 gtk_box_pack_start(GTK_BOX(hbox), select, FALSE, FALSE, 0); | 441 gtk_box_pack_start(GTK_BOX(hbox), select, FALSE, FALSE, 0); |
440 | 442 |
441 hbox = gtk_hbox_new(FALSE, 5); | 443 hbox = gtk_hbox_new(FALSE, 5); |
442 gtk_container_add(GTK_CONTAINER(vbox), hbox); | 444 gtk_container_add(GTK_CONTAINER(vbox), hbox); |
443 button = gaim_button(_("Use custom si_ze"), &font_options, OPT_FONT_SIZE, hbox); | 445 button = gaim_button(_("Use custom si_ze"), &font_options, OPT_FONT_SIZE, hbox); |
444 gtk_size_group_add_widget(sg, button); | 446 gtk_size_group_add_widget(sg, button); |
445 select = gaim_labeled_spin_button(hbox, NULL, &fontsize, 1, 7, NULL); | 447 select = gaim_labeled_spin_button(hbox, NULL, &fontsize, 1, 7, NULL); |
446 if (!(font_options & OPT_FONT_SIZE)) | 448 if (!(font_options & OPT_FONT_SIZE)) |
447 gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE); | 449 gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE); |
448 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(toggle_sensitive), select); | 450 g_signal_connect(GTK_OBJECT(button), "clicked", |
451 G_CALLBACK(gaim_gtk_toggle_sensitive), select); | |
449 | 452 |
450 vbox = make_frame(ret, _("Color")); | 453 vbox = make_frame(ret, _("Color")); |
451 hbox = gtk_hbox_new(FALSE, 5); | 454 hbox = gtk_hbox_new(FALSE, 5); |
452 gtk_container_add(GTK_CONTAINER(vbox), hbox); | 455 gtk_container_add(GTK_CONTAINER(vbox), hbox); |
453 | 456 |
461 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(update_color), | 464 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(update_color), |
462 pref_fg_picture); | 465 pref_fg_picture); |
463 | 466 |
464 if (!(font_options & OPT_FONT_FGCOL)) | 467 if (!(font_options & OPT_FONT_FGCOL)) |
465 gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE); | 468 gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE); |
466 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(toggle_sensitive), select); | 469 g_signal_connect(GTK_OBJECT(button), "clicked", |
470 G_CALLBACK(gaim_gtk_toggle_sensitive), select); | |
467 g_signal_connect(GTK_OBJECT(select), "clicked", G_CALLBACK(show_fgcolor_dialog), NULL); | 471 g_signal_connect(GTK_OBJECT(select), "clicked", G_CALLBACK(show_fgcolor_dialog), NULL); |
468 hbox = gtk_hbox_new(FALSE, 5); | 472 hbox = gtk_hbox_new(FALSE, 5); |
469 gtk_container_add(GTK_CONTAINER(vbox), hbox); | 473 gtk_container_add(GTK_CONTAINER(vbox), hbox); |
470 | 474 |
471 button = gaim_button(_("Bac_kground color"), &font_options, OPT_FONT_BGCOL, hbox); | 475 button = gaim_button(_("Bac_kground color"), &font_options, OPT_FONT_BGCOL, hbox); |
477 pref_bg_picture); | 481 pref_bg_picture); |
478 | 482 |
479 if (!(font_options & OPT_FONT_BGCOL)) | 483 if (!(font_options & OPT_FONT_BGCOL)) |
480 gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE); | 484 gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE); |
481 g_signal_connect(GTK_OBJECT(select), "clicked", G_CALLBACK(show_bgcolor_dialog), NULL); | 485 g_signal_connect(GTK_OBJECT(select), "clicked", G_CALLBACK(show_bgcolor_dialog), NULL); |
482 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(toggle_sensitive), select); | 486 g_signal_connect(GTK_OBJECT(button), "clicked", |
487 G_CALLBACK(gaim_gtk_toggle_sensitive), select); | |
483 | 488 |
484 gtk_widget_show_all(ret); | 489 gtk_widget_show_all(ret); |
485 return ret; | 490 return ret; |
486 } | 491 } |
487 | 492 |
985 vbox = make_frame (ret, _("Auto-away")); | 990 vbox = make_frame (ret, _("Auto-away")); |
986 button = gaim_button(_("Set away _when idle"), &away_options, OPT_AWAY_AUTO, vbox); | 991 button = gaim_button(_("Set away _when idle"), &away_options, OPT_AWAY_AUTO, vbox); |
987 select = gaim_labeled_spin_button(vbox, _("_Minutes before setting away:"), &auto_away, 1, 24 * 60, sg); | 992 select = gaim_labeled_spin_button(vbox, _("_Minutes before setting away:"), &auto_away, 1, 24 * 60, sg); |
988 if (!(away_options & OPT_AWAY_AUTO)) | 993 if (!(away_options & OPT_AWAY_AUTO)) |
989 gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE); | 994 gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE); |
990 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(toggle_sensitive), select); | 995 g_signal_connect(GTK_OBJECT(button), "clicked", |
996 G_CALLBACK(gaim_gtk_toggle_sensitive), select); | |
991 | 997 |
992 label = gtk_label_new_with_mnemonic(_("Away m_essage:")); | 998 label = gtk_label_new_with_mnemonic(_("Away m_essage:")); |
993 gtk_size_group_add_widget(sg, label); | 999 gtk_size_group_add_widget(sg, label); |
994 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); | 1000 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); |
995 hbox = gtk_hbox_new(FALSE, 0); | 1001 hbox = gtk_hbox_new(FALSE, 0); |
997 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); | 1003 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); |
998 prefs_away_menu = gtk_option_menu_new(); | 1004 prefs_away_menu = gtk_option_menu_new(); |
999 gtk_label_set_mnemonic_widget(GTK_LABEL(label), prefs_away_menu); | 1005 gtk_label_set_mnemonic_widget(GTK_LABEL(label), prefs_away_menu); |
1000 if (!(away_options & OPT_AWAY_AUTO)) | 1006 if (!(away_options & OPT_AWAY_AUTO)) |
1001 gtk_widget_set_sensitive(GTK_WIDGET(prefs_away_menu), FALSE); | 1007 gtk_widget_set_sensitive(GTK_WIDGET(prefs_away_menu), FALSE); |
1002 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(toggle_sensitive), prefs_away_menu); | 1008 g_signal_connect(GTK_OBJECT(button), "clicked", |
1009 G_CALLBACK(gaim_gtk_toggle_sensitive), prefs_away_menu); | |
1003 default_away_menu_init(prefs_away_menu); | 1010 default_away_menu_init(prefs_away_menu); |
1004 gtk_widget_show(prefs_away_menu); | 1011 gtk_widget_show(prefs_away_menu); |
1005 gtk_box_pack_start(GTK_BOX(hbox), prefs_away_menu, FALSE, FALSE, 0); | 1012 gtk_box_pack_start(GTK_BOX(hbox), prefs_away_menu, FALSE, FALSE, 0); |
1006 | 1013 |
1007 gtk_widget_show_all(ret); | 1014 gtk_widget_show_all(ret); |
1858 if (option == OPT_MISC_DEBUG) | 1865 if (option == OPT_MISC_DEBUG) |
1859 show_debug(); | 1866 show_debug(); |
1860 else if(option == OPT_MISC_USE_SERVER_ALIAS) { | 1867 else if(option == OPT_MISC_USE_SERVER_ALIAS) { |
1861 redo_buddy_list(); | 1868 redo_buddy_list(); |
1862 build_edit_tree(); | 1869 build_edit_tree(); |
1863 set_convo_titles(); | 1870 gaim_conversation_foreach(gaim_conversation_autoset_title); |
1864 } | 1871 } |
1865 } | 1872 } |
1866 | 1873 |
1867 static void set_logging_option(GtkWidget *w, int option) | 1874 static void set_logging_option(GtkWidget *w, int option) |
1868 { | 1875 { |
1902 static void set_convo_option(GtkWidget *w, int option) | 1909 static void set_convo_option(GtkWidget *w, int option) |
1903 { | 1910 { |
1904 convo_options ^= option; | 1911 convo_options ^= option; |
1905 | 1912 |
1906 if (option == OPT_CONVO_SHOW_SMILEY) | 1913 if (option == OPT_CONVO_SHOW_SMILEY) |
1907 toggle_smileys(); | 1914 gaim_gtkconv_toggle_smileys(); |
1908 | 1915 |
1909 if (option == OPT_CONVO_SHOW_TIME) | 1916 if (option == OPT_CONVO_SHOW_TIME) |
1910 toggle_timestamps(); | 1917 gaim_gtkconv_toggle_timestamps(); |
1911 | 1918 |
1912 if (option == OPT_CONVO_CHECK_SPELLING) | 1919 if (option == OPT_CONVO_CHECK_SPELLING) |
1913 toggle_spellchk(); | 1920 gaim_gtkconv_toggle_spellchk(); |
1914 } | 1921 } |
1915 | 1922 |
1916 static void set_im_option(GtkWidget *w, int option) | 1923 static void set_im_option(GtkWidget *w, int option) |
1917 { | 1924 { |
1918 im_options ^= option; | 1925 im_options ^= option; |
1919 | 1926 |
1927 #if 0 | |
1920 if (option == OPT_IM_ONE_WINDOW) | 1928 if (option == OPT_IM_ONE_WINDOW) |
1921 im_tabize(); | 1929 im_tabize(); |
1930 #endif | |
1922 | 1931 |
1923 if (option == OPT_IM_HIDE_ICONS) | 1932 if (option == OPT_IM_HIDE_ICONS) |
1924 set_hide_icons(); | 1933 gaim_gtkconv_hide_buddy_icons(); |
1925 | 1934 |
1926 if (option == OPT_IM_ALIAS_TAB) { | 1935 if (option == OPT_IM_ALIAS_TAB) |
1927 set_convo_titles(); | 1936 gaim_conversation_foreach(gaim_conversation_autoset_title); |
1928 } | |
1929 | 1937 |
1930 if (option == OPT_IM_NO_ANIMATION) | 1938 if (option == OPT_IM_NO_ANIMATION) |
1931 set_anim(); | 1939 gaim_gtkconv_set_anim(); |
1932 } | 1940 } |
1933 | 1941 |
1934 static void set_chat_option(GtkWidget *w, int option) | 1942 static void set_chat_option(GtkWidget *w, int option) |
1935 { | 1943 { |
1936 chat_options ^= option; | 1944 chat_options ^= option; |
1937 | 1945 |
1946 #if 0 | |
1938 if (option == OPT_CHAT_ONE_WINDOW) | 1947 if (option == OPT_CHAT_ONE_WINDOW) |
1939 chat_tabize(); | 1948 chat_tabize(); |
1949 #endif | |
1940 } | 1950 } |
1941 | 1951 |
1942 void set_sound_option(GtkWidget *w, int option) | 1952 void set_sound_option(GtkWidget *w, int option) |
1943 { | 1953 { |
1944 sound_options ^= option; | 1954 sound_options ^= option; |
1946 | 1956 |
1947 static void set_font_option(GtkWidget *w, int option) | 1957 static void set_font_option(GtkWidget *w, int option) |
1948 { | 1958 { |
1949 font_options ^= option; | 1959 font_options ^= option; |
1950 | 1960 |
1951 update_font_buttons(); | 1961 gaim_gtkconv_update_font_buttons(); |
1952 } | 1962 } |
1953 | 1963 |
1954 static void set_away_option(GtkWidget *w, int option) | 1964 static void set_away_option(GtkWidget *w, int option) |
1955 { | 1965 { |
1956 away_options ^= option; | 1966 away_options ^= option; |
2176 gtk_widget_set_sensitive(sndcmd, TRUE); | 2186 gtk_widget_set_sensitive(sndcmd, TRUE); |
2177 else | 2187 else |
2178 gtk_widget_set_sensitive(sndcmd, FALSE); | 2188 gtk_widget_set_sensitive(sndcmd, FALSE); |
2179 } else if (option == (int*)&im_options) { | 2189 } else if (option == (int*)&im_options) { |
2180 if (clear == (OPT_IM_SIDE_TAB | OPT_IM_BR_TAB)) | 2190 if (clear == (OPT_IM_SIDE_TAB | OPT_IM_BR_TAB)) |
2181 update_im_tabs(); | 2191 gaim_gtkconv_update_tabs(); |
2192 /* CONV XXX update_im_tabs(); */ | |
2182 else if (clear == (OPT_IM_BUTTON_TEXT | OPT_IM_BUTTON_XPM)) | 2193 else if (clear == (OPT_IM_BUTTON_TEXT | OPT_IM_BUTTON_XPM)) |
2183 update_im_button_pix(); | 2194 gaim_gtkconv_update_im_button_style(); |
2184 } else if (option == (int*)&chat_options) { | 2195 } else if (option == (int*)&chat_options) { |
2185 if (clear == (OPT_CHAT_SIDE_TAB | OPT_CHAT_BR_TAB)) | 2196 if (clear == (OPT_CHAT_SIDE_TAB | OPT_CHAT_BR_TAB)) |
2186 update_chat_tabs(); | 2197 gaim_gtkconv_update_tabs(); |
2198 /* CONV XXX update_chat_tabs(); */ | |
2187 else if (clear == (OPT_CHAT_BUTTON_TEXT | OPT_CHAT_BUTTON_XPM)) | 2199 else if (clear == (OPT_CHAT_BUTTON_TEXT | OPT_CHAT_BUTTON_XPM)) |
2188 update_chat_button_pix(); | 2200 gaim_gtkconv_update_chat_button_style(); |
2189 } else if (option == (int*)&blist_options) { | 2201 } else if (option == (int*)&blist_options) { |
2190 set_blist_tab(); | 2202 set_blist_tab(); |
2191 } | 2203 } |
2192 } | 2204 } |
2193 | 2205 |