Mercurial > pidgin.yaz
changeset 2313:bd9d403fb15b
[gaim-migrate @ 2323]
more room
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Thu, 20 Sep 2001 01:23:04 +0000 |
parents | 766603034af8 |
children | 64b4c69c1c5e |
files | ChangeLog TODO plugins/notify.c src/about.c src/aim.c src/away.c src/buddy.c src/buddy_chat.c src/conversation.c src/dialogs.c src/gaim.h src/gaimrc.c src/idle.c src/prefs.c src/server.c src/ticker.c src/util.c |
diffstat | 17 files changed, 642 insertions(+), 540 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog Wed Sep 19 20:38:07 2001 +0000 +++ b/ChangeLog Thu Sep 20 01:23:04 2001 +0000 @@ -18,6 +18,7 @@ * event_im_recv and event_im_display_rcvd passed whether the message received was auto-response (see SIGNALS) * IRC fixes (largly copied from X-Chat) + * Internal change to how preferences are stored version 0.43 (09/06/2001): * Updated German Translation (thanks Daniel Seifert)
--- a/TODO Wed Sep 19 20:38:07 2001 +0000 +++ b/TODO Thu Sep 20 01:23:04 2001 +0000 @@ -24,10 +24,6 @@ good way to do this? IRC it varies based on who you're connected as, Jabber you need a connection to retrieve the list, and AIM you can get it while you're offline.) - We've run out of room in display and general _options. We need to either make - more variables (which I'm opposed to) or find some way to make them - 64-bit variables (which is probably tricky and not portable but what - I'd prefer, if it is portable). Syd is cool and gave all of these ideas: Have multiple tickers in the same window, one for buddies
--- a/plugins/notify.c Wed Sep 19 20:38:07 2001 +0000 +++ b/plugins/notify.c Thu Sep 20 01:23:04 2001 +0000 @@ -20,7 +20,7 @@ if (cnv == NULL) { - if (general_options & OPT_GEN_QUEUE_WHEN_AWAY) + if (away_options & OPT_AWAY_QUEUE) return; cnv = new_conversation(*who);
--- a/src/about.c Wed Sep 19 20:38:07 2001 +0000 +++ b/src/about.c Thu Sep 20 01:23:04 2001 +0000 @@ -168,7 +168,7 @@ gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(about_click), NULL); - if (display_options & OPT_DISP_COOL_LOOK) + if (misc_options & OPT_MISC_COOL_LOOK) gtk_button_set_relief(GTK_BUTTON(button), GTK_RELIEF_NONE); }
--- a/src/aim.c Wed Sep 19 20:38:07 2001 +0000 +++ b/src/aim.c Thu Sep 20 01:23:04 2001 +0000 @@ -297,7 +297,7 @@ #endif signon = gtk_button_new_with_label(_("Signon")); - if (display_options & OPT_DISP_COOL_LOOK) { + if (misc_options & OPT_MISC_COOL_LOOK) { gtk_button_set_relief(GTK_BUTTON(cancel), GTK_RELIEF_NONE); #ifndef NO_MULTI gtk_button_set_relief(GTK_BUTTON(accts), GTK_RELIEF_NONE); @@ -332,7 +332,7 @@ #ifdef GAIM_PLUGINS plugs = gtk_button_new_with_label(_("Plugins")); #endif - if (display_options & OPT_DISP_COOL_LOOK) { + if (misc_options & OPT_MISC_COOL_LOOK) { gtk_button_set_relief(GTK_BUTTON(help), GTK_RELIEF_NONE); gtk_button_set_relief(GTK_BUTTON(options), GTK_RELIEF_NONE); #ifdef GAIM_PLUGINS @@ -373,8 +373,6 @@ gtk_widget_show(mainwindow); } -extern void show_debug(GtkObject *); - #if HAVE_SIGNAL_H void sighandler(int sig) { @@ -596,7 +594,6 @@ /* show version window */ if (opt_version) { gtk_init(&argc, &argv); - set_defaults(FALSE); /* needed for open_url_nw */ load_prefs(); show_about(0, (void *)2); gtk_main(); @@ -604,7 +601,6 @@ } - set_defaults(FALSE); load_prefs(); /* set the default username */ @@ -616,8 +612,8 @@ #endif /* USE_GNOME */ } - if (general_options & OPT_GEN_DEBUG) - show_debug(NULL); + if (misc_options & OPT_MISC_DEBUG) + show_debug(); gtkspell_start(NULL, ispell_cmd); #ifdef USE_PERL
--- a/src/away.c Wed Sep 19 20:38:07 2001 +0000 +++ b/src/away.c Thu Sep 20 01:23:04 2001 +0000 @@ -90,7 +90,7 @@ if (!clistqueue || !clistqueuesw) return; - if (general_options & OPT_GEN_QUEUE_WHEN_AWAY) { + if (away_options & OPT_AWAY_QUEUE) { gtk_widget_show(clistqueue); gtk_widget_show(clistqueuesw); } else { @@ -188,7 +188,7 @@ gtk_widget_set_usize(GTK_WIDGET(clistqueue), -1, 50); gtk_container_add(GTK_CONTAINER(clistqueuesw), clistqueue); - if (general_options & OPT_GEN_QUEUE_WHEN_AWAY) { + if (away_options & OPT_AWAY_QUEUE) { gtk_widget_show(clistqueuesw); gtk_widget_show(clistqueue); }
--- a/src/buddy.c Wed Sep 19 20:38:07 2001 +0000 +++ b/src/buddy.c Thu Sep 20 01:23:04 2001 +0000 @@ -305,7 +305,7 @@ GtkWidget *label; /*if the user had opted to put pictures on the buttons*/ - if (display_options & OPT_DISP_SHOW_BUTTON_XPM && xpm) { + if (blist_options & OPT_BLIST_SHOW_BUTTON_XPM && xpm) { pm = gdk_pixmap_create_from_xpm_d(blist->window, &bm, NULL, xpm); pic = gtk_pixmap_new(pm, bm); gtk_widget_show(pic); @@ -326,7 +326,7 @@ void toggle_show_empty_groups() { - if (display_options & OPT_DISP_NO_MT_GRP) { + if (blist_options & OPT_BLIST_NO_MT_GRP) { /* remove any group_shows with empty members */ GSList *s = shows; struct group_show *g; @@ -376,7 +376,7 @@ m = g->members; while (m) { b = m->data; - if (display_options & OPT_DISP_SHOW_PIXMAPS) + if (blist_options & OPT_BLIST_SHOW_PIXMAPS) gtk_widget_show(b->pix); else gtk_widget_hide(b->pix); @@ -415,7 +415,7 @@ c = g_slist_next(c); } - if (display_options & OPT_DISP_SHOW_GRPNUM) + if (blist_options & OPT_BLIST_SHOW_GRPNUM) g_snprintf(buf, sizeof buf, "%s (%d/%d)", gs->name, on, total); else g_snprintf(buf, sizeof buf, "%s", gs->name); @@ -441,7 +441,7 @@ adjust_pic(groupbutton, _("Group"), (gchar **)group_xpm); adjust_pic(rembutton, _("Remove"), (gchar **)gnome_remove_xpm); - if (!(display_options & OPT_DISP_NO_BUTTONS)) { + if (!(blist_options & OPT_BLIST_NO_BUTTONS)) { adjust_pic(awaybutton, _("Away"), (gchar **)away_big_xpm); adjust_pic(chatbutton, _("Chat"), (gchar **)join_xpm); adjust_pic(imbutton, _("IM"), (gchar **)tmp_send_xpm); @@ -449,7 +449,7 @@ } gtk_widget_hide(addbutton->parent); gtk_widget_show(addbutton->parent); - if (!(display_options & OPT_DISP_NO_BUTTONS)) { + if (!(blist_options & OPT_BLIST_NO_BUTTONS)) { gtk_widget_hide(chatbutton->parent); gtk_widget_show(chatbutton->parent); } @@ -541,7 +541,7 @@ #else show_login(); #endif /* USE_APPLET */ - if ( display_options & OPT_DISP_SHOW_BUDDYTICKER ) + if ( misc_options & OPT_MISC_BUDDY_TICKER ) BuddyTickerSignoff(); } @@ -644,7 +644,7 @@ c = new_conversation(b->name); set_convo_gc(c, b->connlist->data); - if (display_options & OPT_DISP_ONE_WINDOW) + if (im_options & OPT_IM_ONE_WINDOW) raise_convo_tab(c); } else if (event->type == GDK_BUTTON_PRESS && event->button == 3) { GtkWidget *menu; @@ -887,7 +887,7 @@ g_free(bs->name); g_free(bs); if (!g_slist_length(gs->members) && - (display_options & OPT_DISP_NO_MT_GRP)) { + (blist_options & OPT_BLIST_NO_MT_GRP)) { shows = g_slist_remove(shows, gs); gtk_tree_remove_item(GTK_TREE(buddies), gs->item); g_free(gs->name); @@ -1032,7 +1032,7 @@ g = (struct group *)gr->data; gr = gr->next; gs = find_group_show(g->name); - if (!gs && !(display_options & OPT_DISP_NO_MT_GRP)) + if (!gs && !(blist_options & OPT_BLIST_NO_MT_GRP)) gs = new_group_show(g->name); m = g->members; while (m) { @@ -1361,7 +1361,7 @@ NULL, NULL, 0, 1); gtk_ctree_node_set_row_data(GTK_CTREE(edittree), p, g); - if (!(display_options & OPT_DISP_NO_MT_GRP) && !find_group_show(group)) + if (!(blist_options & OPT_BLIST_NO_MT_GRP) && !find_group_show(group)) new_group_show(group); return g; @@ -2035,7 +2035,7 @@ b->pix = gtk_pixmap_new(pm, bm); gtk_box_pack_start(GTK_BOX(box), b->pix, FALSE, FALSE, 1); gtk_widget_show(b->pix); - if (!(display_options & OPT_DISP_SHOW_PIXMAPS)) + if (!(blist_options & OPT_BLIST_SHOW_PIXMAPS)) gtk_widget_hide(b->pix); gdk_pixmap_unref(pm); gdk_bitmap_unref(bm); @@ -2114,7 +2114,7 @@ remove_buddy_show(g, b); else debug_printf("log_timeout but buddy list not available\n"); - if ((g->members == NULL) && (display_options & OPT_DISP_NO_MT_GRP)) { + if ((g->members == NULL) && (blist_options & OPT_BLIST_NO_MT_GRP)) { shows = g_slist_remove(shows, g); if (blist) gtk_tree_remove_item(GTK_TREE(buddies), g->item); @@ -2140,9 +2140,9 @@ gtk_widget_hide(b->pix); gtk_pixmap_set(GTK_PIXMAP(b->pix), pm, bm); gtk_widget_show(b->pix); - if (!(display_options & OPT_DISP_SHOW_PIXMAPS)) + if (!(blist_options & OPT_BLIST_SHOW_PIXMAPS)) gtk_widget_hide(b->pix); - if (display_options & OPT_DISP_SHOW_BUDDYTICKER) + if (misc_options & OPT_MISC_BUDDY_TICKER) BuddyTickerSetPixmap(b->name, pm, bm); gdk_pixmap_unref(pm); gdk_bitmap_unref(bm); @@ -2228,7 +2228,7 @@ gtk_label_set(GTK_LABEL(bs->idle), idlet); else gtk_label_set(GTK_LABEL(bs->idle), ""); - if (display_options & OPT_DISP_SHOW_IDLETIME) + if (blist_options & OPT_BLIST_SHOW_IDLETIME) gtk_widget_show(bs->idle); /* now we do the tooltip */ @@ -2254,7 +2254,7 @@ } gtk_widget_hide(bs->warn); gtk_label_set(GTK_LABEL(bs->warn), warnl); - if (display_options & OPT_DISP_SHOW_WARN) + if (blist_options & OPT_BLIST_SHOW_WARN) gtk_widget_show(bs->warn); if (b->caps) @@ -2320,7 +2320,7 @@ gtk_widget_hide(bs->pix); gtk_pixmap_set(GTK_PIXMAP(bs->pix), pm, bm); gtk_widget_show(bs->pix); - if (display_options & OPT_DISP_SHOW_BUDDYTICKER) { + if (misc_options & OPT_MISC_BUDDY_TICKER) { BuddyTickerAddUser(b->name, pm, bm); gtk_timeout_add(10000, (GtkFunction)BuddyTickerLogonTimeout, b->name); } @@ -2331,7 +2331,7 @@ gtk_timeout_remove(bs->log_timer); bs->log_timer = gtk_timeout_add(10000, (GtkFunction)log_timeout, bs); update_num_group(gs); - if ((bs->sound != 2) && (display_options & OPT_DISP_SHOW_LOGON)) { + if ((bs->sound != 2) && (im_options & OPT_IM_LOGON)) { struct conversation *c = find_conversation(b->name); if (c) { char tmp[1024]; @@ -2349,9 +2349,9 @@ gtk_widget_hide(bs->pix); gtk_pixmap_set(GTK_PIXMAP(bs->pix), pm, bm); gtk_widget_show(bs->pix); - if (!(display_options & OPT_DISP_SHOW_PIXMAPS)) + if (!(blist_options & OPT_BLIST_SHOW_PIXMAPS)) gtk_widget_hide(bs->pix); - if (display_options & OPT_DISP_SHOW_BUDDYTICKER) + if (misc_options & OPT_MISC_BUDDY_TICKER) BuddyTickerSetPixmap(b->name, pm, bm); gdk_pixmap_unref(pm); gdk_bitmap_unref(bm); @@ -2377,13 +2377,13 @@ gtk_widget_hide(bs->pix); gtk_pixmap_set(GTK_PIXMAP(bs->pix), pm, bm); gtk_widget_show(bs->pix); - if (display_options & OPT_DISP_SHOW_BUDDYTICKER) { + if (misc_options & OPT_MISC_BUDDY_TICKER) { BuddyTickerSetPixmap(b->name, pm, bm); gtk_timeout_add(10000, (GtkFunction)BuddyTickerLogoutTimeout, b->name); } gdk_pixmap_unref(pm); gdk_bitmap_unref(bm); - if ((bs->sound != 1) && (display_options & OPT_DISP_SHOW_LOGON)) { + if ((bs->sound != 1) && (im_options & OPT_IM_LOGON)) { struct conversation *c = find_conversation(b->name); if (c) { char tmp[1024]; @@ -2531,7 +2531,7 @@ imchatbox = gtk_hbox_new(TRUE, 10); - if (display_options & OPT_DISP_COOL_LOOK) + if (misc_options & OPT_MISC_COOL_LOOK) { gtk_button_set_relief(GTK_BUTTON(imbutton), GTK_RELIEF_NONE); gtk_button_set_relief(GTK_BUTTON(infobutton), GTK_RELIEF_NONE); @@ -2781,7 +2781,7 @@ gtk_box_pack_start(GTK_BOX(buddypane), sw, TRUE, TRUE, 0); gtk_widget_show(buddypane); - if (!(display_options & OPT_DISP_NO_BUTTONS)) + if (!(blist_options & OPT_BLIST_NO_BUTTONS)) build_imchat_box(TRUE); @@ -2792,8 +2792,7 @@ groupbutton = gtk_button_new_with_label(_("Group")); rembutton = gtk_button_new_with_label(_("Remove")); - if (display_options & OPT_DISP_COOL_LOOK) - { + if (misc_options & OPT_MISC_COOL_LOOK) { gtk_button_set_relief(GTK_BUTTON(addbutton), GTK_RELIEF_NONE); gtk_button_set_relief(GTK_BUTTON(groupbutton), GTK_RELIEF_NONE); gtk_button_set_relief(GTK_BUTTON(rembutton), GTK_RELIEF_NONE); @@ -2890,7 +2889,7 @@ gtk_window_set_title(GTK_WINDOW(blist), _("Gaim - Buddy List")); - if (general_options & OPT_GEN_SAVED_WINDOWS) { + if (blist_options & OPT_BLIST_SAVED_WINDOWS) { if (blist_pos.width != 0) { /* Sanity check! */ gtk_widget_set_uposition(blist, blist_pos.x - blist_pos.xoff, blist_pos.y - blist_pos.yoff);
--- a/src/buddy_chat.c Wed Sep 19 20:38:07 2001 +0000 +++ b/src/buddy_chat.c Thu Sep 20 01:23:04 2001 +0000 @@ -383,11 +383,6 @@ /* Now we should fill out all of the names */ gtk_combo_set_popdown_strings(GTK_COMBO(inviteentry), generate_invite_user_names(b->gc)); - if (display_options & OPT_DISP_COOL_LOOK) { - gtk_button_set_relief(GTK_BUTTON(cancel), GTK_RELIEF_NONE); - gtk_button_set_relief(GTK_BUTTON(invite_btn), GTK_RELIEF_NONE); - } - vbox = gtk_vbox_new(FALSE, 0); gtk_box_pack_start(GTK_BOX(vbox), frame, TRUE, TRUE, 0); gtk_container_add(GTK_CONTAINER(frame), table); @@ -667,7 +662,7 @@ if (b->makesound && (sound_options & OPT_SOUND_CHAT_JOIN)) play_sound(CHAT_JOIN); - if (display_options & OPT_DISP_CHAT_LOGON) { + if (chat_options & OPT_CHAT_LOGON) { g_snprintf(tmp, sizeof(tmp), _("%s entered the room."), name); write_to_conv(b, tmp, WFLAG_SYSTEM, NULL, time((time_t)NULL)); } @@ -730,7 +725,7 @@ gtk_list_insert_items(GTK_LIST(b->list), g_list_append(NULL, list_item), pos); gtk_widget_show(list_item); - if (display_options & OPT_DISP_CHAT_LOGON) { + if (chat_options & OPT_CHAT_LOGON) { g_snprintf(tmp, sizeof(tmp), _("%s is now known as %s"), old, new); write_to_conv(b, tmp, WFLAG_SYSTEM, NULL, time((time_t)NULL)); } @@ -773,7 +768,7 @@ if (b->makesound && (sound_options & OPT_SOUND_CHAT_PART)) play_sound(CHAT_LEAVE); - if (display_options & OPT_DISP_CHAT_LOGON) { + if (chat_options & OPT_CHAT_LOGON) { g_snprintf(tmp, sizeof(tmp), _("%s left the room."), buddy); write_to_conv(b, tmp, WFLAG_SYSTEM, NULL, time((time_t)NULL)); } @@ -893,7 +888,7 @@ int dispstyle = set_dispstyle(1); - if (display_options & OPT_DISP_ONE_CHAT_WINDOW) { + if (chat_options & OPT_CHAT_ONE_WINDOW) { if (!all_chats) { win = all_chats = b->window = gtk_window_new(GTK_WINDOW_TOPLEVEL); gtk_window_set_wmclass(GTK_WINDOW(win), "buddy_chat", "Gaim"); @@ -906,8 +901,8 @@ GTK_SIGNAL_FUNC(delete_all_chats), NULL); chat_notebook = gtk_notebook_new(); - if (display_options & OPT_DISP_CHAT_SIDE_TAB) { - if (display_options & OPT_DISP_CHAT_BR_TAB) { + if (chat_options & OPT_CHAT_SIDE_TAB) { + if (chat_options & OPT_CHAT_BR_TAB) { gtk_notebook_set_tab_pos(GTK_NOTEBOOK(chat_notebook), GTK_POS_RIGHT); } else { @@ -915,7 +910,7 @@ GTK_POS_LEFT); } } else { - if (display_options & OPT_DISP_CHAT_BR_TAB) { + if (chat_options & OPT_CHAT_BR_TAB) { gtk_notebook_set_tab_pos(GTK_NOTEBOOK(chat_notebook), GTK_POS_BOTTOM); } else { @@ -994,7 +989,7 @@ gtk_container_add(GTK_CONTAINER(sw), text); GTK_LAYOUT(text)->hadjustment->step_increment = 10.0; GTK_LAYOUT(text)->vadjustment->step_increment = 10.0; - if (display_options & OPT_DISP_SHOW_TIME) + if (convo_options & OPT_CONVO_SHOW_TIME) gtk_imhtml_show_comments(GTK_IMHTML(text), TRUE); gaim_setup_imhtml(text); gtk_widget_show(text); @@ -1041,7 +1036,7 @@ chatentry = gtk_text_new(NULL, NULL); b->entry = chatentry; - if (!(display_options & OPT_DISP_ONE_CHAT_WINDOW)) + if (!(chat_options & OPT_CHAT_ONE_WINDOW)) gtk_window_set_focus(GTK_WINDOW(b->window), b->entry); toolbar = build_conv_toolbar(b); @@ -1055,7 +1050,7 @@ b); gtk_signal_connect(GTK_OBJECT(chatentry), "key_press_event", GTK_SIGNAL_FUNC(entry_key_pressed), chatentry); - if (general_options & OPT_GEN_CHECK_SPELLING) + if (convo_options & OPT_CONVO_CHECK_SPELLING) gtkspell_attach(GTK_TEXT(chatentry)); gtk_box_pack_start(GTK_BOX(vbox), chatentry, TRUE, TRUE, 0); gtk_widget_set_usize(chatentry, buddy_chat_size.width, buddy_chat_size.entry_height); @@ -1220,7 +1215,7 @@ void chat_tabize() { /* evil, evil i tell you! evil! */ - if (display_options & OPT_DISP_ONE_CHAT_WINDOW) { + if (chat_options & OPT_CHAT_ONE_WINDOW) { GList *x = chats; while (x) { struct conversation *c = x->data;
--- a/src/conversation.c Wed Sep 19 20:38:07 2001 +0000 +++ b/src/conversation.c Thu Sep 20 01:23:04 2001 +0000 @@ -90,7 +90,7 @@ { g_return_if_fail(imhtml != NULL); g_return_if_fail(GTK_IS_IMHTML(imhtml)); - if (!(display_options & OPT_DISP_SHOW_SMILEY)) + if (!(convo_options & OPT_CONVO_SHOW_SMILEY)) gtk_imhtml_show_smileys(GTK_IMHTML(imhtml), FALSE); gtk_signal_connect(GTK_OBJECT(imhtml), "url_clicked", GTK_SIGNAL_FUNC(open_url_nw), NULL); gtk_imhtml_associate_smiley(GTK_IMHTML(imhtml), "C:)", luke03_xpm); @@ -206,7 +206,7 @@ g_snprintf(buf, sizeof(buf), CONVERSATION_TITLE, cnv->name); else g_snprintf(buf, sizeof(buf), LOG_CONVERSATION_TITLE, cnv->name); - if (!(display_options & OPT_DISP_ONE_WINDOW)) + if (!(im_options & OPT_IM_ONE_WINDOW)) gtk_window_set_title(GTK_WINDOW(cnv->window), buf); } } @@ -401,7 +401,7 @@ int close_callback(GtkWidget *widget, struct conversation *c) { - if (c->is_chat && (widget == c->close) && !(display_options & OPT_DISP_ONE_CHAT_WINDOW)) { + if (c->is_chat && (widget == c->close) && !(chat_options & OPT_CHAT_ONE_WINDOW)) { GtkWidget *tmp = c->window; debug_printf("chat clicked close button\n"); c->window = NULL; @@ -411,7 +411,7 @@ debug_printf("conversation close callback\n"); - if (general_options & OPT_GEN_CHECK_SPELLING) + if (convo_options & OPT_CONVO_CHECK_SPELLING) gtkspell_detach(GTK_TEXT(c->entry)); if (!c->is_chat) { @@ -424,7 +424,7 @@ } remove_icon(c); remove_checkbox(c); - if (display_options & OPT_DISP_ONE_WINDOW) { + if (im_options & OPT_IM_ONE_WINDOW) { if (g_list_length(conversations) > 1) { gtk_notebook_remove_page(GTK_NOTEBOOK(convo_notebook), g_list_index(conversations, c)); @@ -441,7 +441,7 @@ c->window = NULL; } } else { - if (display_options & OPT_DISP_ONE_CHAT_WINDOW) { + if (chat_options & OPT_CHAT_ONE_WINDOW) { if (g_list_length(chats) > 1) { gtk_notebook_remove_page(GTK_NOTEBOOK(chat_notebook), g_list_index(chats, c)); @@ -580,17 +580,17 @@ { int pos; if (event->keyval == GDK_Escape) { - if (general_options & OPT_GEN_ESC_CAN_CLOSE) { + if (convo_options & OPT_CONVO_ESC_CAN_CLOSE) { gtk_signal_emit_stop_by_name(GTK_OBJECT(entry), "key_press_event"); close_callback(c->close, c); } - } else if ((event->keyval == GDK_F2) && (general_options & OPT_GEN_F2_TOGGLES)) { + } else if ((event->keyval == GDK_F2) && (convo_options & OPT_CONVO_F2_TOGGLES)) { gtk_imhtml_show_comments(GTK_IMHTML(c->text), !GTK_IMHTML(c->text)->comments); } else if ((event->keyval == GDK_Return) || (event->keyval == GDK_KP_Enter)) { - if ((event->state & GDK_CONTROL_MASK) && (general_options & OPT_GEN_CTL_ENTER)) { + if ((event->state & GDK_CONTROL_MASK) && (convo_options & OPT_CONVO_CTL_ENTER)) { gtk_signal_emit_by_name(GTK_OBJECT(entry), "activate", c); gtk_signal_emit_stop_by_name(GTK_OBJECT(entry), "key_press_event"); - } else if (!(event->state & GDK_SHIFT_MASK) && (general_options & OPT_GEN_ENTER_SENDS)) { + } else if (!(event->state & GDK_SHIFT_MASK) && (convo_options & OPT_CONVO_ENTER_SENDS)) { gtk_signal_emit_by_name(GTK_OBJECT(entry), "activate", c); gtk_signal_emit_stop_by_name(GTK_OBJECT(entry), "key_press_event"); } else { @@ -599,7 +599,7 @@ gtk_editable_insert_text(GTK_EDITABLE(entry), "\n", 1, &pos); } } else if (event->state & GDK_CONTROL_MASK) { - if (general_options & OPT_GEN_CTL_CHARS) { + if (convo_options & OPT_CONVO_CTL_CHARS) { switch (event->keyval) { case 'i': case 'I': @@ -632,7 +632,7 @@ break; } } - if (general_options & OPT_GEN_CTL_SMILEYS) { + if (convo_options & OPT_CONVO_CTL_SMILEYS) { char buf[7]; buf[0] = '\0'; switch (event->keyval) { @@ -698,8 +698,8 @@ gtk_signal_emit_stop_by_name(GTK_OBJECT(entry), "key_press_event"); } } - if ((!c->is_chat && (display_options & OPT_DISP_ONE_WINDOW)) || - ( c->is_chat && (display_options & OPT_DISP_ONE_CHAT_WINDOW))) { + if ((!c->is_chat && (im_options & OPT_IM_ONE_WINDOW)) || + ( c->is_chat && (chat_options & OPT_CHAT_ONE_WINDOW))) { GtkWidget *notebook = (c->is_chat ? chat_notebook : convo_notebook); if (event->keyval == '[') { gtk_notebook_prev_page(GTK_NOTEBOOK(notebook)); @@ -749,8 +749,8 @@ gtk_signal_emit_stop_by_name(GTK_OBJECT(entry), "key_press_event"); } } - } else if (((!c->is_chat && (display_options & OPT_DISP_ONE_WINDOW)) || - ( c->is_chat && (display_options & OPT_DISP_ONE_CHAT_WINDOW))) && + } else if (((!c->is_chat && (im_options & OPT_IM_ONE_WINDOW)) || + ( c->is_chat && (chat_options & OPT_CHAT_ONE_WINDOW))) && (event->state & GDK_MOD1_MASK) && isdigit(event->keyval) && (event->keyval > '0')) { GtkWidget *notebook = (c->is_chat ? chat_notebook : convo_notebook); @@ -784,7 +784,7 @@ buf2 = g_malloc(limit); if (c->gc->prpl->options & OPT_PROTO_HTML) { - if (general_options & OPT_GEN_SEND_LINKS) + if (convo_options & OPT_CONVO_SEND_LINKS) linkify_text(buf); if (font_options & OPT_FONT_BOLD) { @@ -897,7 +897,7 @@ } else { gtk_editable_delete_text(GTK_EDITABLE(c->entry), 0, -1); - if (general_options & OPT_GEN_BACK_ON_IM) { + if (away_options & OPT_AWAY_BACK_ON_IM) { if (awaymessage != NULL) { do_im_back(); } else if (c->gc->away) { @@ -1063,7 +1063,7 @@ int dummy; int start, finish; - if (general_options & OPT_GEN_CHECK_SPELLING) { + if (convo_options & OPT_CONVO_CHECK_SPELLING) { gtkspell_detach(GTK_TEXT(entry)); } @@ -1097,7 +1097,7 @@ } } - if (general_options & OPT_GEN_CHECK_SPELLING) { + if (convo_options & OPT_CONVO_CHECK_SPELLING) { gtkspell_attach(GTK_TEXT(entry)); } @@ -1332,13 +1332,13 @@ gtk_font_options = gtk_font_options ^ GTK_IMHTML_NO_COMMENTS; - if (display_options & OPT_DISP_IGNORE_COLOUR) + if (convo_options & OPT_CONVO_IGNORE_COLOUR) gtk_font_options = gtk_font_options ^ GTK_IMHTML_NO_COLOURS; - if (display_options & OPT_DISP_IGNORE_FONTS) + if (convo_options & OPT_CONVO_IGNORE_FONTS) gtk_font_options = gtk_font_options ^ GTK_IMHTML_NO_FONTS; - if (display_options & OPT_DISP_IGNORE_SIZES) + if (convo_options & OPT_CONVO_IGNORE_SIZES) gtk_font_options = gtk_font_options ^ GTK_IMHTML_NO_SIZES; if (!(logging_options & OPT_LOG_STRIP_HTML)) @@ -1370,7 +1370,7 @@ if (flags & WFLAG_SYSTEM) { - if (general_options & OPT_DISP_SHOW_TIME) + if (convo_options & OPT_CONVO_SHOW_TIME) g_snprintf(buf, BUF_LONG, "<FONT SIZE=\"2\">(%s) </FONT><B>%s</B>", mdate, what); else g_snprintf(buf, BUF_LONG, "<B>%s</B>", what); @@ -1449,7 +1449,7 @@ } } - if (general_options & OPT_DISP_SHOW_TIME) + if (convo_options & OPT_CONVO_SHOW_TIME) g_snprintf(buf, BUF_LONG, "<FONT COLOR=\"%s\"><FONT SIZE=\"2\">(%s) </FONT>" "<B>%s</B></FONT> ", colour, mdate, str); else @@ -1527,15 +1527,15 @@ } */ - if ((c->is_chat && (general_options & OPT_GEN_POPUP_CHAT)) || - (!c->is_chat && (general_options & OPT_GEN_POPUP_WINDOWS))) + if ((c->is_chat && (chat_options & OPT_CHAT_POPUP)) || + (!c->is_chat && (im_options & OPT_IM_POPUP))) gdk_window_show(c->window->window); if (((flags & WFLAG_RECV) || (flags & WFLAG_SYSTEM)) && - ((!c->is_chat && (display_options & OPT_DISP_ONE_WINDOW) && + ((!c->is_chat && (im_options & OPT_IM_ONE_WINDOW) && (gtk_notebook_get_current_page(GTK_NOTEBOOK(convo_notebook)) != g_list_index(conversations, c))) || - ( c->is_chat && (display_options & OPT_DISP_ONE_CHAT_WINDOW) && + ( c->is_chat && (chat_options & OPT_CHAT_ONE_WINDOW) && (gtk_notebook_get_current_page(GTK_NOTEBOOK(chat_notebook)) != g_list_index(chats, c))))) { GtkWidget *notebook = (c->is_chat ? chat_notebook : convo_notebook); @@ -1735,7 +1735,7 @@ gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(speaker), TRUE); /* use a slicker look if the user wants to */ - if (display_options & OPT_DISP_COOL_LOOK) { + if (misc_options & OPT_MISC_COOL_LOOK) { gtk_button_set_relief(GTK_BUTTON(bold), GTK_RELIEF_NONE); gtk_button_set_relief(GTK_BUTTON(italic), GTK_RELIEF_NONE); gtk_button_set_relief(GTK_BUTTON(underline), GTK_RELIEF_NONE); @@ -2050,7 +2050,7 @@ c->fgcol = fgcolor; c->hasfg = 0; - if (display_options & OPT_DISP_ONE_WINDOW) { + if (im_options & OPT_IM_ONE_WINDOW) { if (!all_convos) { win = all_convos = c->window = gtk_window_new(GTK_WINDOW_TOPLEVEL); gtk_window_set_wmclass(GTK_WINDOW(win), "conversation", "Gaim"); @@ -2063,8 +2063,8 @@ GTK_SIGNAL_FUNC(delete_all_convo), NULL); convo_notebook = gtk_notebook_new(); - if (display_options & OPT_DISP_CONV_SIDE_TAB) { - if (display_options & OPT_DISP_CONV_BR_TAB) { + if (im_options & OPT_IM_SIDE_TAB) { + if (im_options & OPT_IM_BR_TAB) { gtk_notebook_set_tab_pos(GTK_NOTEBOOK(convo_notebook), GTK_POS_RIGHT); } else { @@ -2072,7 +2072,7 @@ GTK_POS_LEFT); } } else { - if (display_options & OPT_DISP_CONV_BR_TAB) { + if (im_options & OPT_IM_BR_TAB) { gtk_notebook_set_tab_pos(GTK_NOTEBOOK(convo_notebook), GTK_POS_BOTTOM); } else { @@ -2132,7 +2132,7 @@ gtk_container_add(GTK_CONTAINER(sw), text); GTK_LAYOUT(text)->hadjustment->step_increment = 10.0; GTK_LAYOUT(text)->vadjustment->step_increment = 10.0; - if (display_options & OPT_DISP_SHOW_TIME) + if (convo_options & OPT_CONVO_SHOW_TIME) gtk_imhtml_show_comments(GTK_IMHTML(text), TRUE); gaim_setup_imhtml(text); gtk_widget_show(text); @@ -2161,7 +2161,7 @@ entry = gtk_text_new(NULL, NULL); c->entry = entry; - if (!(display_options & OPT_DISP_ONE_WINDOW)) + if (!(im_options & OPT_IM_ONE_WINDOW)) gtk_window_set_focus(GTK_WINDOW(c->window), c->entry); toolbar = build_conv_toolbar(c); @@ -2176,7 +2176,7 @@ gtk_signal_connect(GTK_OBJECT(entry), "key_press_event", GTK_SIGNAL_FUNC(keypress_callback), c); gtk_signal_connect(GTK_OBJECT(entry), "key_press_event", GTK_SIGNAL_FUNC(entry_key_pressed), entry); - if (general_options & OPT_GEN_CHECK_SPELLING) + if (convo_options & OPT_CONVO_CHECK_SPELLING) gtkspell_attach(GTK_TEXT(c->entry)); gtk_box_pack_start(GTK_BOX(vbox2), entry, TRUE, TRUE, 0); gtk_widget_show(entry); @@ -2255,7 +2255,7 @@ while (cnv) { c = (struct conversation *)cnv->data; - if (general_options & OPT_GEN_CHECK_SPELLING) + if (convo_options & OPT_CONVO_CHECK_SPELLING) gtkspell_attach(GTK_TEXT(c->entry)); else gtkspell_detach(GTK_TEXT(c->entry)); @@ -2267,7 +2267,7 @@ cht = gc->buddy_chats; while (cht) { c = (struct conversation *)cht->data; - if (general_options & OPT_GEN_CHECK_SPELLING) + if (convo_options & OPT_CONVO_CHECK_SPELLING) gtkspell_attach(GTK_TEXT(c->entry)); else gtkspell_detach(GTK_TEXT(c->entry)); @@ -2287,7 +2287,7 @@ while (cnv) { c = (struct conversation *)cnv->data; - if (display_options & OPT_DISP_SHOW_TIME) + if (convo_options & OPT_CONVO_SHOW_TIME) gtk_imhtml_show_comments(GTK_IMHTML(c->text), TRUE); else gtk_imhtml_show_comments(GTK_IMHTML(c->text), FALSE); @@ -2299,7 +2299,7 @@ cht = gc->buddy_chats; while (cht) { c = (struct conversation *)cht->data; - if (display_options & OPT_DISP_SHOW_TIME) + if (convo_options & OPT_CONVO_SHOW_TIME) gtk_imhtml_show_comments(GTK_IMHTML(c->text), TRUE); else gtk_imhtml_show_comments(GTK_IMHTML(c->text), FALSE); @@ -2319,7 +2319,7 @@ while (cnv) { c = (struct conversation *)cnv->data; - if (display_options & OPT_DISP_SHOW_SMILEY) + if (convo_options & OPT_CONVO_SHOW_SMILEY) gtk_imhtml_show_smileys(GTK_IMHTML(c->text), TRUE); else gtk_imhtml_show_smileys(GTK_IMHTML(c->text), FALSE); @@ -2331,7 +2331,7 @@ cht = gc->buddy_chats; while (cht) { c = (struct conversation *)cht->data; - if (display_options & OPT_DISP_SHOW_SMILEY) + if (convo_options & OPT_CONVO_SHOW_SMILEY) gtk_imhtml_show_smileys(GTK_IMHTML(c->text), TRUE); else gtk_imhtml_show_smileys(GTK_IMHTML(c->text), FALSE); @@ -2344,7 +2344,7 @@ void tabize() { /* evil, evil i tell you! evil! */ - if (display_options & OPT_DISP_ONE_WINDOW) { + if (im_options & OPT_IM_ONE_WINDOW) { GList *x = conversations; while (x) { struct conversation *c = x->data; @@ -2408,8 +2408,8 @@ void update_im_tabs() { if (!convo_notebook || !all_convos) return; - if (display_options & OPT_DISP_CONV_SIDE_TAB) { - if (display_options & OPT_DISP_CONV_BR_TAB) { + if (im_options & OPT_IM_SIDE_TAB) { + if (im_options & OPT_IM_BR_TAB) { gtk_notebook_set_tab_pos(GTK_NOTEBOOK(convo_notebook), GTK_POS_RIGHT); } else { @@ -2417,7 +2417,7 @@ GTK_POS_LEFT); } } else { - if (display_options & OPT_DISP_CONV_BR_TAB) { + if (im_options & OPT_IM_BR_TAB) { gtk_notebook_set_tab_pos(GTK_NOTEBOOK(convo_notebook), GTK_POS_BOTTOM); } else { @@ -2430,8 +2430,8 @@ void update_chat_tabs() { if (!chat_notebook || !all_chats) return; - if (display_options & OPT_DISP_CHAT_SIDE_TAB) { - if (display_options & OPT_DISP_CHAT_BR_TAB) { + if (chat_options & OPT_CHAT_SIDE_TAB) { + if (chat_options & OPT_CHAT_BR_TAB) { gtk_notebook_set_tab_pos(GTK_NOTEBOOK(chat_notebook), GTK_POS_RIGHT); } else { @@ -2439,7 +2439,7 @@ GTK_POS_LEFT); } } else { - if (display_options & OPT_DISP_CHAT_BR_TAB) { + if (chat_options & OPT_CHAT_BR_TAB) { gtk_notebook_set_tab_pos(GTK_NOTEBOOK(chat_notebook), GTK_POS_BOTTOM); } else {
--- a/src/dialogs.c Wed Sep 19 20:38:07 2001 +0000 +++ b/src/dialogs.c Thu Sep 20 01:23:04 2001 +0000 @@ -439,9 +439,6 @@ close = picture_button(d, _("Close"), cancel_xpm); - if (display_options & OPT_DISP_COOL_LOOK) - gtk_button_set_relief(GTK_BUTTON(close), GTK_RELIEF_NONE); - gtk_box_pack_start(GTK_BOX(GTK_DIALOG(d)->action_area), close, FALSE, FALSE, 5); @@ -610,13 +607,10 @@ GtkWidget *eedialog; eedialog = gtk_window_new(GTK_WINDOW_DIALOG); - ok = gtk_button_new_with_label(_("OK")); + gtk_widget_realize(eedialog); + ok = picture_button(eedialog, _("OK"), ok_xpm); box = gtk_vbox_new(FALSE, 10); - - if (display_options & OPT_DISP_COOL_LOOK) - gtk_button_set_relief(GTK_BUTTON(ok), GTK_RELIEF_NONE); - if (ee == 0) label = gtk_label_new("Amazing! Simply Amazing!"); else if (ee == 1) @@ -1741,9 +1735,6 @@ gtk_signal_connect(GTK_OBJECT(ok), "clicked", GTK_SIGNAL_FUNC(destroy_dialog), b->window); - if (display_options & OPT_DISP_COOL_LOOK) - gtk_button_set_relief(GTK_BUTTON(ok), GTK_RELIEF_NONE); - label = gtk_label_new(_("Below are the results of your search: ")); sw = gtk_scrolled_window_new (NULL, NULL); @@ -1767,11 +1758,11 @@ aol_icon(b->window->window); gtk_widget_show_all(b->window); - if (display_options & OPT_DISP_IGNORE_COLOUR) + if (convo_options & OPT_CONVO_IGNORE_COLOUR) options ^= GTK_IMHTML_NO_COLOURS; - if (display_options & OPT_DISP_IGNORE_FONTS) + if (convo_options & OPT_CONVO_IGNORE_FONTS) options ^= GTK_IMHTML_NO_FONTS; - if (display_options & OPT_DISP_IGNORE_SIZES) + if (convo_options & OPT_CONVO_IGNORE_SIZES) options ^= GTK_IMHTML_NO_SIZES; options ^= GTK_IMHTML_NO_COMMENTS; options ^= GTK_IMHTML_NO_TITLE; @@ -3626,16 +3617,12 @@ gtk_widget_show(hbox); button = picture_button(window, _("Cancel"), cancel_xpm); - if (display_options & OPT_DISP_COOL_LOOK) - gtk_button_set_relief(GTK_BUTTON(button), GTK_RELIEF_NONE); gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(destroy_dialog), window); gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 5); gtk_widget_show(button); button = picture_button(window, _("Okay"), ok_xpm); - if (display_options & OPT_DISP_COOL_LOOK) - gtk_button_set_relief(GTK_BUTTON(button), GTK_RELIEF_NONE); gtk_object_set_user_data(GTK_OBJECT(button), gtk_object_get_user_data(GTK_OBJECT(w))); gtk_signal_connect(GTK_OBJECT(button), "clicked", @@ -3686,11 +3673,11 @@ } options = GTK_IMHTML_NO_COMMENTS | GTK_IMHTML_NO_TITLE | GTK_IMHTML_NO_SCROLL; - if (display_options & OPT_DISP_IGNORE_COLOUR) + if (convo_options & OPT_CONVO_IGNORE_COLOUR) options ^= GTK_IMHTML_NO_COLOURS; - if (display_options & OPT_DISP_IGNORE_FONTS) + if (convo_options & OPT_CONVO_IGNORE_FONTS) options ^= GTK_IMHTML_NO_FONTS; - if (display_options & OPT_DISP_IGNORE_SIZES) + if (convo_options & OPT_CONVO_IGNORE_SIZES) options ^= GTK_IMHTML_NO_SIZES; window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
--- a/src/gaim.h Wed Sep 19 20:38:07 2001 +0000 +++ b/src/gaim.h Thu Sep 20 01:23:04 2001 +0000 @@ -38,21 +38,20 @@ #include "multi.h" -/* - 1. gethostbyname(); - 2. connect(); - 3. toc_signon(); - 4. toc_wait_signon(); - 5. toc_wait_config(); - 6. actually done.. -*/ - #define BROWSER_NETSCAPE 0 #define BROWSER_KFM 1 #define BROWSER_MANUAL 2 /*#define BROWSER_INTERNAL 3*/ #define BROWSER_GNOME 4 +#define IM_FLAG_AWAY 0x01 +#define IM_FLAG_CHECKBOX 0x02 +#define IM_FLAG_GAIMUSER 0x04 + +#define IDLE_NONE 0 +#define IDLE_GAIM 1 +#define IDLE_SCREENSAVER 2 + #define PERMIT_ALL 1 #define PERMIT_NONE 2 #define PERMIT_SOME 3 @@ -64,10 +63,6 @@ #define UC_NORMAL 8 #define UC_UNAVAILABLE 16 -#define IDLE_NONE 0 -#define IDLE_GAIM 1 -#define IDLE_SCREENSAVER 2 - #define WFLAG_SEND 1 #define WFLAG_RECV 2 #define WFLAG_AUTO 4 @@ -153,6 +148,13 @@ GtkWidget *kick_dlg; }; +#define OPT_USR_AUTO 0x00000001 +/*#define OPT_USR_KEEPALV 0x00000002 this shouldn't be optional */ +#define OPT_USR_REM_PASS 0x00000004 +#define OPT_USR_MAIL_CHECK 0x00000008 + +#define DEFAULT_INFO "Visit the GAIM website at <A HREF=\"http://gaim.sourceforge.net/\">http://gaim.sourceforge.net/</A>." + struct save_pos { int x; int y; @@ -417,19 +419,6 @@ #define BUF_LONG BUF_LEN * 2 -#define BUDDY_ARRIVE 0 -#define BUDDY_LEAVE 1 -#define RECEIVE 2 -#define FIRST_RECEIVE 3 -#define SEND 4 -#define CHAT_JOIN 5 -#define CHAT_LEAVE 6 -#define CHAT_YOU_SAY 7 -#define CHAT_SAY 8 -#define POUNCE_DEFAULT 9 -#define NUM_SOUNDS 10 - - #ifdef USE_APPLET extern GtkWidget *applet; #endif /* USE_APPLET */ @@ -476,113 +465,111 @@ extern GtkWidget *bpmenu; extern GtkWidget *blist; -extern int general_options; -#define OPT_GEN_ENTER_SENDS 0x00000001 -/* #define OPT_GEN_AUTO_LOGIN 0x00000002 now OPT_USR_AUTO */ -#define OPT_GEN_LOG_ALL 0x00000004 /* now OPT_LOG_ALL */ -#define OPT_GEN_STRIP_HTML 0x00000008 /* now OPT_LOG_STRIP_HTML */ -#define OPT_GEN_APP_BUDDY_SHOW 0x00000010 -#define OPT_GEN_POPUP_WINDOWS 0x00000020 -#define OPT_GEN_SEND_LINKS 0x00000040 -#define OPT_GEN_DEBUG 0x00000100 -/* #define OPT_GEN_REMEMBER_PASS 0x00000200 now OPT_USR_REM_PASS */ -#define OPT_GEN_REGISTERED 0x00000400 -#define OPT_GEN_BROWSER_POPUP 0x00000800 -#define OPT_GEN_SAVED_WINDOWS 0x00001000 -#define OPT_GEN_DISCARD_WHEN_AWAY 0x00002000 -#define OPT_GEN_NEAR_APPLET 0x00004000 -#define OPT_GEN_CHECK_SPELLING 0x00008000 -#define OPT_GEN_POPUP_CHAT 0x00010000 -#define OPT_GEN_BACK_ON_IM 0x00020000 -/* #define OPT_GEN_USE_OSCAR 0x00040000 now PROTO_OSCAR */ -#define OPT_GEN_CTL_CHARS 0x00080000 -#define OPT_GEN_TIK_HACK 0x00100000 -#define OPT_GEN_CTL_SMILEYS 0x00200000 -/* #define OPT_GEN_KEEPALIVE 0x00400000 now OPT_USR_KEEPALV */ -#define OPT_GEN_AUTO_AWAY 0x00800000 -#define OPT_GEN_ESC_CAN_CLOSE 0x01000000 -#define OPT_GEN_CTL_ENTER 0x02000000 -#define OPT_GEN_F2_TOGGLES 0x04000000 -#define OPT_GEN_NO_AUTO_RESP 0x08000000 -#define OPT_GEN_QUEUE_WHEN_AWAY 0x10000000 +extern guint misc_options; +#define OPT_MISC_DEBUG 0x00000001 +#define OPT_MISC_BROWSER_POPUP 0x00000002 +#define OPT_MISC_BUDDY_TICKER 0x00000004 +#define OPT_MISC_COOL_LOOK 0x00000008 + +extern guint logging_options; +#define OPT_LOG_ALL 0x00000001 +#define OPT_LOG_STRIP_HTML 0x00000002 +#define OPT_LOG_BUDDY_SIGNON 0x00000004 +#define OPT_LOG_BUDDY_IDLE 0x00000008 +#define OPT_LOG_BUDDY_AWAY 0x00000010 +#define OPT_LOG_MY_SIGNON 0x00000020 +#define OPT_LOG_INDIVIDUAL 0x00000040 + +extern guint blist_options; +#define OPT_BLIST_APP_BUDDY_SHOW 0x00000001 +#define OPT_BLIST_SAVED_WINDOWS 0x00000002 +#define OPT_BLIST_NEAR_APPLET 0x00000004 +#define OPT_BLIST_SHOW_GRPNUM 0x00000008 +#define OPT_BLIST_SHOW_PIXMAPS 0x00000010 +#define OPT_BLIST_SHOW_IDLETIME 0x00000020 +#define OPT_BLIST_SHOW_BUTTON_XPM 0x00000040 +#define OPT_BLIST_NO_BUTTONS 0x00000080 +#define OPT_BLIST_NO_MT_GRP 0x00000100 +#define OPT_BLIST_SHOW_WARN 0x00000200 + +extern guint convo_options; +#define OPT_CONVO_ENTER_SENDS 0x00000001 +#define OPT_CONVO_SEND_LINKS 0x00000002 +#define OPT_CONVO_CHECK_SPELLING 0x00000004 +#define OPT_CONVO_CTL_CHARS 0x00000008 +#define OPT_CONVO_CTL_SMILEYS 0x00000010 +#define OPT_CONVO_ESC_CAN_CLOSE 0x00000020 +#define OPT_CONVO_CTL_ENTER 0x00000040 +#define OPT_CONVO_F2_TOGGLES 0x00000080 +#define OPT_CONVO_SHOW_TIME 0x00000100 +#define OPT_CONVO_IGNORE_COLOUR 0x00000200 +#define OPT_CONVO_SHOW_SMILEY 0x00000400 +#define OPT_CONVO_IGNORE_FONTS 0x00000800 +#define OPT_CONVO_IGNORE_SIZES 0x00001000 -extern int display_options; -#define OPT_DISP_SHOW_TIME 0x00000001 -#define OPT_DISP_SHOW_GRPNUM 0x00000002 -#define OPT_DISP_SHOW_PIXMAPS 0x00000004 -#define OPT_DISP_SHOW_IDLETIME 0x00000008 -#define OPT_DISP_SHOW_BUTTON_XPM 0x00000010 -#define OPT_DISP_IGNORE_COLOUR 0x00000020 -#define OPT_DISP_SHOW_LOGON 0x00000040 -#define OPT_DISP_DEVIL_PIXMAPS 0x00000080 -#define OPT_DISP_SHOW_SMILEY 0x00000100 -#define OPT_DISP_SHOW_BUDDYTICKER 0x00000200 -#define OPT_DISP_COOL_LOOK 0x00000400 -#define OPT_DISP_CHAT_LOGON 0x00000800 -#define OPT_DISP_IGN_WHITE 0x00001000 -#define OPT_DISP_NO_BUTTONS 0x00002000 -#define OPT_DISP_CONV_BUTTON_TEXT 0x00004000 -#define OPT_DISP_CHAT_BUTTON_TEXT 0x00008000 -/* #define OPT_DISP_CONV_BIG_ENTRY 0x00010000 -- no longer used */ -/* #define OPT_DISP_CHAT_BIG_ENTRY 0x00020000 -- no longer used */ -#define OPT_DISP_NO_MT_GRP 0x00040000 -#define OPT_DISP_CONV_BUTTON_XPM 0x00080000 -#define OPT_DISP_CHAT_BUTTON_XPM 0x00100000 -#define OPT_DISP_SHOW_WARN 0x00200000 -#define OPT_DISP_IGNORE_FONTS 0x00400000 -#define OPT_DISP_IGNORE_SIZES 0x00800000 -#define OPT_DISP_ONE_WINDOW 0x01000000 -#define OPT_DISP_ONE_CHAT_WINDOW 0x02000000 -#define OPT_DISP_CONV_SIDE_TAB 0x04000000 -#define OPT_DISP_CONV_BR_TAB 0x08000000 -#define OPT_DISP_CHAT_SIDE_TAB 0x10000000 -#define OPT_DISP_CHAT_BR_TAB 0x20000000 +extern guint im_options; +#define OPT_IM_POPUP 0x00000001 +#define OPT_IM_LOGON 0x00000002 +#define OPT_IM_BUTTON_TEXT 0x00000004 +#define OPT_IM_BUTTON_XPM 0x00000008 +#define OPT_IM_ONE_WINDOW 0x00000010 +#define OPT_IM_SIDE_TAB 0x00000020 +#define OPT_IM_BR_TAB 0x00000040 + +extern guint chat_options; +#define OPT_CHAT_ONE_WINDOW 0x00000001 +#define OPT_CHAT_BUTTON_TEXT 0x00000002 +#define OPT_CHAT_BUTTON_XPM 0x00000004 +#define OPT_CHAT_LOGON 0x00000008 +#define OPT_CHAT_POPUP 0x00000010 +#define OPT_CHAT_SIDE_TAB 0x00000020 +#define OPT_CHAT_BR_TAB 0x00000040 -extern int sound_options; -#define OPT_SOUND_LOGIN 0x00000001 -#define OPT_SOUND_LOGOUT 0x00000002 -#define OPT_SOUND_RECV 0x00000004 -#define OPT_SOUND_SEND 0x00000008 -#define OPT_SOUND_FIRST_RCV 0x00000010 -#define OPT_SOUND_WHEN_AWAY 0x00000020 -#define OPT_SOUND_SILENT_SIGNON 0x00000040 -#define OPT_SOUND_THROUGH_GNOME 0x00000080 -#define OPT_SOUND_CHAT_JOIN 0x00000100 -#define OPT_SOUND_CHAT_SAY 0x00000200 -#define OPT_SOUND_BEEP 0x00000400 -#define OPT_SOUND_CHAT_PART 0x00000800 -#define OPT_SOUND_CHAT_YOU_SAY 0x00001000 +extern guint font_options; +#define OPT_FONT_BOLD 0x00000001 +#define OPT_FONT_ITALIC 0x00000002 +#define OPT_FONT_UNDERLINE 0x00000008 +#define OPT_FONT_STRIKE 0x00000010 +#define OPT_FONT_FACE 0x00000020 +#define OPT_FONT_FGCOL 0x00000040 +#define OPT_FONT_BGCOL 0x00000080 +#define OPT_FONT_SIZE 0x00000100 + +extern guint sound_options; +#define OPT_SOUND_LOGIN 0x00000001 +#define OPT_SOUND_LOGOUT 0x00000002 +#define OPT_SOUND_RECV 0x00000004 +#define OPT_SOUND_SEND 0x00000008 +#define OPT_SOUND_FIRST_RCV 0x00000010 +#define OPT_SOUND_WHEN_AWAY 0x00000020 +#define OPT_SOUND_SILENT_SIGNON 0x00000040 +#define OPT_SOUND_THROUGH_GNOME 0x00000080 +#define OPT_SOUND_CHAT_JOIN 0x00000100 +#define OPT_SOUND_CHAT_SAY 0x00000200 +#define OPT_SOUND_BEEP 0x00000400 +#define OPT_SOUND_CHAT_PART 0x00000800 +#define OPT_SOUND_CHAT_YOU_SAY 0x00001000 + +#define BUDDY_ARRIVE 0 +#define BUDDY_LEAVE 1 +#define RECEIVE 2 +#define FIRST_RECEIVE 3 +#define SEND 4 +#define CHAT_JOIN 5 +#define CHAT_LEAVE 6 +#define CHAT_YOU_SAY 7 +#define CHAT_SAY 8 +#define POUNCE_DEFAULT 9 +#define NUM_SOUNDS 10 extern char *sound_file[NUM_SOUNDS]; -extern int font_options; -#define OPT_FONT_BOLD 0x00000001 -#define OPT_FONT_ITALIC 0x00000002 -#define OPT_FONT_UNDERLINE 0x00000008 -#define OPT_FONT_STRIKE 0x00000010 -#define OPT_FONT_FACE 0x00000020 -#define OPT_FONT_FGCOL 0x00000040 -#define OPT_FONT_BGCOL 0x00000080 -#define OPT_FONT_SIZE 0x00000100 - -extern int logging_options; -#define OPT_LOG_ALL 0x00000001 -#define OPT_LOG_STRIP_HTML 0x00000002 -#define OPT_LOG_BUDDY_SIGNON 0x00000004 -#define OPT_LOG_BUDDY_IDLE 0x00000008 -#define OPT_LOG_BUDDY_AWAY 0x00000010 -#define OPT_LOG_MY_SIGNON 0x00000020 -#define OPT_LOG_INDIVIDUAL 0x00000040 - -#define OPT_USR_AUTO 0x00000001 -/*#define OPT_USR_KEEPALV 0x00000002 this shouldn't be optional */ -#define OPT_USR_REM_PASS 0x00000004 -#define OPT_USR_MAIL_CHECK 0x00000008 - -#define DEFAULT_INFO "Visit the GAIM website at <A HREF=\"http://gaim.sourceforge.net/\">http://gaim.sourceforge.net/</A>." - -#define IM_FLAG_AWAY 0x01 -#define IM_FLAG_CHECKBOX 0x02 -#define IM_FLAG_GAIMUSER 0x04 +extern guint away_options; +#define OPT_AWAY_DISCARD 0x00000001 +#define OPT_AWAY_BACK_ON_IM 0x00000002 +#define OPT_AWAY_TIK_HACK 0x00000004 +#define OPT_AWAY_AUTO 0x00000008 +#define OPT_AWAY_NO_AUTO_RESP 0x00000010 +#define OPT_AWAY_QUEUE 0x00000020 extern int report_idle; extern int web_browser; @@ -593,13 +580,11 @@ extern char web_command[2048]; extern struct save_pos blist_pos; extern struct window_size conv_size, buddy_chat_size; -extern char latest_ver[25]; /* Functions in about.c */ extern void show_about(GtkWidget *, void *); extern void gaim_help(GtkWidget *, void *); - /* Functions in buddy_chat.c */ extern void join_chat(); extern void chat_write(struct conversation *, char *, int, char *, time_t); @@ -830,10 +815,9 @@ /* Functions in prefs.c */ extern void debug_printf( char * fmt, ... ); #define debug_print(x) debug_printf(x); -extern void set_general_option(GtkWidget *, int *); extern void set_option(GtkWidget *, int *); extern void show_prefs(); -extern void show_debug(GtkObject *); +extern void show_debug(); extern void update_color(GtkWidget *, GtkWidget *); extern void set_default_away(GtkWidget *, gpointer); extern void default_away_menu_init(GtkWidget *); @@ -847,7 +831,6 @@ /* Functions in gaimrc.c */ -extern void set_defaults(int); extern void load_prefs(); extern void save_prefs(); extern gint sort_awaymsg_list(gconstpointer, gconstpointer);
--- a/src/gaimrc.c Wed Sep 19 20:38:07 2001 +0000 +++ b/src/gaimrc.c Thu Sep 20 01:23:04 2001 +0000 @@ -41,11 +41,15 @@ #define MAX_VALUES 10 GList *aim_users = NULL; -int general_options; -int display_options; -int sound_options; -int font_options; -int logging_options; +guint misc_options; +guint logging_options; +guint blist_options; +guint convo_options; +guint im_options; +guint chat_options; +guint font_options; +guint sound_options; +guint away_options; int report_idle, web_browser; struct save_pos blist_pos; @@ -567,14 +571,77 @@ fprintf(f, "}\n"); } +struct replace { + int old; + guint *val; + int new; +}; +static struct replace gen_replace[] = { +{ /* OPT_GEN_ENTER_SENDS */ 0x00000001, &convo_options, OPT_CONVO_ENTER_SENDS }, +{ /* OPT_GEN_APP_BUDDY_SHOW */ 0x00000010, &blist_options, OPT_BLIST_APP_BUDDY_SHOW }, +{ /* OPT_GEN_POPUP_WINDOWS */ 0x00000020, &im_options, OPT_IM_POPUP }, +{ /* OPT_GEN_SEND_LINKS */ 0x00000040, &convo_options, OPT_CONVO_SEND_LINKS }, +{ /* OPT_GEN_DEBUG */ 0x00000100, &misc_options, OPT_MISC_DEBUG }, +{ /* OPT_GEN_BROWSER_POPUP */ 0x00000800, &misc_options, OPT_MISC_BROWSER_POPUP }, +{ /* OPT_GEN_SAVED_WINDOWS */ 0x00001000, &blist_options, OPT_BLIST_SAVED_WINDOWS }, +{ /* OPT_GEN_DISCARD_WHEN_AWAY */ 0x00002000, &away_options, OPT_AWAY_DISCARD }, +{ /* OPT_GEN_NEAR_APPLET */ 0x00004000, &blist_options, OPT_BLIST_NEAR_APPLET }, +{ /* OPT_GEN_CHECK_SPELLING */ 0x00008000, &convo_options, OPT_CONVO_CHECK_SPELLING }, +{ /* OPT_GEN_POPUP_CHAT */ 0x00010000, &chat_options, OPT_CHAT_POPUP }, +{ /* OPT_GEN_BACK_ON_IM */ 0x00020000, &away_options, OPT_AWAY_BACK_ON_IM }, +{ /* OPT_GEN_CTL_CHARS */ 0x00080000, &convo_options, OPT_CONVO_CTL_CHARS }, +{ /* OPT_GEN_TIK_HACK */ 0x00100000, &away_options, OPT_AWAY_TIK_HACK }, +{ /* OPT_GEN_CTL_SMILEYS */ 0x00200000, &convo_options, OPT_CONVO_CTL_SMILEYS }, +{ /* OPT_GEN_AUTO_AWAY */ 0x00800000, &away_options, OPT_AWAY_AUTO }, +{ /* OPT_GEN_ESC_CAN_CLOSE */ 0x01000000, &convo_options, OPT_CONVO_ESC_CAN_CLOSE }, +{ /* OPT_GEN_CTL_ENTER */ 0x02000000, &convo_options, OPT_CONVO_CTL_ENTER }, +{ /* OPT_GEN_F2_TOGGLES */ 0x04000000, &convo_options, OPT_CONVO_F2_TOGGLES }, +{ /* OPT_GEN_NO_AUTO_RESP */ 0x08000000, &away_options, OPT_AWAY_NO_AUTO_RESP }, +{ /* OPT_GEN_QUEUE_WHEN_AWAY */ 0x10000000, &away_options, OPT_AWAY_QUEUE }, +{ 0,NULL,0 } +}; +#define OPT_GEN_LOG_ALL 0x00000004 +#define OPT_GEN_STRIP_HTML 0x00000008 + +static struct replace disp_replace[] = { +{ /* OPT_DISP_SHOW_TIME */ 0x00000001, &convo_options, OPT_CONVO_SHOW_TIME }, +{ /* OPT_DISP_SHOW_GRPNUM */ 0x00000002, &blist_options, OPT_BLIST_SHOW_GRPNUM }, +{ /* OPT_DISP_SHOW_PIXMAPS */ 0x00000004, &blist_options, OPT_BLIST_SHOW_PIXMAPS }, +{ /* OPT_DISP_SHOW_IDLETIME */ 0x00000008, &blist_options, OPT_BLIST_SHOW_IDLETIME }, +{ /* OPT_DISP_SHOW_BUTTON_XPM */ 0x00000010, &blist_options, OPT_BLIST_SHOW_BUTTON_XPM }, +{ /* OPT_DISP_IGNORE_COLOUR */ 0x00000020, &convo_options, OPT_CONVO_IGNORE_COLOUR }, +{ /* OPT_DISP_SHOW_LOGON */ 0x00000040, &im_options, OPT_IM_LOGON }, +{ /* OPT_DISP_SHOW_SMILEY */ 0x00000100, &convo_options, OPT_CONVO_SHOW_SMILEY }, +{ /* OPT_DISP_SHOW_BUDDYTICKER */ 0x00000200, &misc_options, OPT_MISC_BUDDY_TICKER }, +{ /* OPT_DISP_COOL_LOOK */ 0x00000400, &misc_options, OPT_MISC_COOL_LOOK }, +{ /* OPT_DISP_CHAT_LOGON */ 0x00000800, &chat_options, OPT_CHAT_LOGON }, +{ /* OPT_DISP_NO_BUTTONS */ 0x00002000, &blist_options, OPT_BLIST_NO_BUTTONS }, +{ /* OPT_DISP_CONV_BUTTON_TEXT */ 0x00004000, &im_options, OPT_IM_BUTTON_TEXT }, +{ /* OPT_DISP_CHAT_BUTTON_TEXT */ 0x00008000, &chat_options, OPT_CHAT_BUTTON_TEXT }, +{ /* OPT_DISP_NO_MT_GRP */ 0x00040000, &blist_options, OPT_BLIST_NO_MT_GRP }, +{ /* OPT_DISP_CONV_BUTTON_XPM */ 0x00080000, &im_options, OPT_IM_BUTTON_XPM }, +{ /* OPT_DISP_CHAT_BUTTON_XPM */ 0x00100000, &chat_options, OPT_CHAT_BUTTON_XPM }, +{ /* OPT_DISP_SHOW_WARN */ 0x00200000, &blist_options, OPT_BLIST_SHOW_WARN }, +{ /* OPT_DISP_IGNORE_FONTS */ 0x00400000, &convo_options, OPT_CONVO_IGNORE_FONTS }, +{ /* OPT_DISP_IGNORE_SIZES */ 0x00800000, &convo_options, OPT_CONVO_IGNORE_SIZES }, +{ /* OPT_DISP_ONE_WINDOW */ 0x01000000, &im_options, OPT_IM_ONE_WINDOW }, +{ /* OPT_DISP_ONE_CHAT_WINDOW */ 0x02000000, &chat_options, OPT_CHAT_ONE_WINDOW }, +{ /* OPT_DISP_CONV_SIDE_TAB */ 0x04000000, &im_options, OPT_IM_SIDE_TAB }, +{ /* OPT_DISP_CONV_BR_TAB */ 0x08000000, &im_options, OPT_IM_BR_TAB }, +{ /* OPT_DISP_CHAT_SIDE_TAB */ 0x10000000, &chat_options, OPT_CHAT_SIDE_TAB }, +{ /* OPT_DISP_CHAT_BR_TAB */ 0x20000000, &chat_options, OPT_CHAT_BR_TAB }, +{ 0,NULL,0 } +}; static void gaimrc_read_options(FILE *f) { char buf[2048]; struct parse *p; - gboolean read_logging = FALSE; + gboolean read_logging = FALSE, read_general = FALSE, read_display = FALSE; + int general_options = 0, display_options = 0; + int i; buf[0] = 0; @@ -589,15 +656,29 @@ if (!strcmp(p->option, "general_options")) { general_options = atoi(p->value[0]); + read_general = TRUE; } else if (!strcmp(p->option, "display_options")) { display_options = atoi(p->value[0]); - } else if (!strcmp(p->option, "sound_options")) { - sound_options = atoi(p->value[0]); - } else if (!strcmp(p->option, "font_options")) { - font_options = atoi(p->value[0]); + read_display = TRUE; + } else if (!strcmp(p->option, "misc_options")) { + misc_options = atoi(p->value[0]); } else if (!strcmp(p->option, "logging_options")) { logging_options = atoi(p->value[0]); read_logging = TRUE; + } else if (!strcmp(p->option, "blist_options")) { + blist_options = atoi(p->value[0]); + } else if (!strcmp(p->option, "convo_options")) { + convo_options = atoi(p->value[0]); + } else if (!strcmp(p->option, "im_options")) { + im_options = atoi(p->value[0]); + } else if (!strcmp(p->option, "chat_options")) { + chat_options = atoi(p->value[0]); + } else if (!strcmp(p->option, "font_options")) { + font_options = atoi(p->value[0]); + } else if (!strcmp(p->option, "sound_options")) { + sound_options = atoi(p->value[0]); + } else if (!strcmp(p->option, "away_options")) { + away_options = atoi(p->value[0]); } else if (!strcmp(p->option, "font_face")) { if (p->value[0] != NULL) g_snprintf(fontface, sizeof(fontface), "%s", p->value[0]); @@ -636,25 +717,40 @@ } - if (!read_logging) { - logging_options = 0; - if (general_options & OPT_GEN_LOG_ALL) - logging_options |= OPT_LOG_ALL; - if (general_options & OPT_GEN_STRIP_HTML) - logging_options |= OPT_LOG_STRIP_HTML; + if (read_general) { + if (!read_logging) { + logging_options = 0; + if (general_options & OPT_GEN_LOG_ALL) + logging_options |= OPT_LOG_ALL; + if (general_options & OPT_GEN_STRIP_HTML) + logging_options |= OPT_LOG_STRIP_HTML; + } + for (i = 0; gen_replace[i].val; i++) + if (general_options & gen_replace[i].old) + *gen_replace[i].val |= gen_replace[i].new; } + if (read_display) + for (i = 0; disp_replace[i].val; i++) + if (display_options & disp_replace[i].old) + *disp_replace[i].val |= disp_replace[i].new; } static void gaimrc_write_options(FILE *f) { fprintf(f, "options {\n"); - fprintf(f, "\tgeneral_options { %d }\n", general_options); - fprintf(f, "\tdisplay_options { %d }\n", display_options); - fprintf(f, "\tsound_options { %d }\n", sound_options); - fprintf(f, "\tfont_options { %d }\n", font_options); - fprintf(f, "\tlogging_options { %d }\n", logging_options); + + fprintf(f, "\tmisc_options { %u }\n", misc_options); + fprintf(f, "\tlogging_options { %u }\n", logging_options); + fprintf(f, "\tblist_options { %u }\n", blist_options); + fprintf(f, "\tconvo_options { %u }\n", convo_options); + fprintf(f, "\tim_options { %u }\n", im_options); + fprintf(f, "\tchat_options { %u }\n", chat_options); + fprintf(f, "\tfont_options { %u }\n", font_options); + fprintf(f, "\tsound_options { %u }\n", sound_options); + fprintf(f, "\taway_options { %u }\n", away_options); + if (fontface) fprintf(f, "\tfont_face { %s }\n", fontface); fprintf(f, "\tfont_size { %d }\n", fontsize); @@ -670,6 +766,7 @@ conv_size.width, conv_size.height, conv_size.entry_height); fprintf(f, "\tbuddy_chat_size { %d } { %d } { %d }\n", buddy_chat_size.width, buddy_chat_size.height, buddy_chat_size.entry_height); + fprintf(f, "}\n"); } @@ -794,74 +891,87 @@ } -void set_defaults(int saveinfo) +static void set_defaults() { - if (!saveinfo) { - if (aim_users) { - g_list_free(aim_users); - aim_users = NULL; - } - if (away_messages) { - g_slist_free(away_messages); - away_messages = NULL; - } + int i; + + if (aim_users) { + g_list_free(aim_users); + aim_users = NULL; + } + if (away_messages) { + g_slist_free(away_messages); + away_messages = NULL; } - general_options = - OPT_GEN_SEND_LINKS | - OPT_GEN_ENTER_SENDS | - OPT_GEN_SAVED_WINDOWS | - /* OPT_GEN_REMEMBER_PASS | */ - OPT_GEN_REGISTERED | - OPT_GEN_NEAR_APPLET | - OPT_GEN_CTL_SMILEYS | - OPT_GEN_CTL_CHARS; + misc_options = + OPT_MISC_BUDDY_TICKER | + OPT_MISC_COOL_LOOK; + + logging_options = 0; + + blist_options = + OPT_BLIST_APP_BUDDY_SHOW | + OPT_BLIST_SAVED_WINDOWS | + OPT_BLIST_NEAR_APPLET | + OPT_BLIST_SHOW_GRPNUM | + OPT_BLIST_SHOW_PIXMAPS | + OPT_BLIST_SHOW_IDLETIME | + OPT_BLIST_SHOW_BUTTON_XPM; - display_options = - OPT_DISP_SHOW_IDLETIME | - OPT_DISP_SHOW_TIME | - OPT_DISP_SHOW_PIXMAPS | - OPT_DISP_SHOW_BUDDYTICKER | - OPT_DISP_SHOW_BUTTON_XPM | - OPT_DISP_SHOW_SMILEY | - OPT_DISP_COOL_LOOK | - OPT_DISP_CONV_BUTTON_XPM | - OPT_DISP_CHAT_BUTTON_TEXT; + convo_options = + OPT_CONVO_ENTER_SENDS | + OPT_CONVO_SEND_LINKS | + OPT_CONVO_CTL_CHARS | + OPT_CONVO_CTL_SMILEYS | + OPT_CONVO_SHOW_TIME | + OPT_CONVO_SHOW_SMILEY; + + im_options = + OPT_IM_POPUP | + OPT_IM_LOGON | + OPT_IM_BUTTON_XPM; + + chat_options = + OPT_CHAT_LOGON | + OPT_CHAT_POPUP | + OPT_CHAT_BUTTON_XPM; - if (!saveinfo) { - int i; - for (i = 0; i < 7; i++) - sound_file[i] = NULL; - font_options = 0; - sound_options = - OPT_SOUND_LOGIN | - OPT_SOUND_LOGOUT | - OPT_SOUND_RECV | - OPT_SOUND_SEND | - OPT_SOUND_SILENT_SIGNON; - report_idle = IDLE_SCREENSAVER; - web_browser = BROWSER_NETSCAPE; - auto_away = 10; - default_away = NULL; + font_options = 0; + + away_options = + OPT_AWAY_BACK_ON_IM; - g_snprintf(web_command, sizeof(web_command), "xterm -e lynx %%s"); - - blist_pos.width = 0; - blist_pos.height = 0; - blist_pos.x = 0; - blist_pos.y = 0; + for (i = 0; i < 7; i++) + sound_file[i] = NULL; + font_options = 0; + sound_options = + OPT_SOUND_LOGIN | + OPT_SOUND_LOGOUT | + OPT_SOUND_RECV | + OPT_SOUND_SEND | + OPT_SOUND_SILENT_SIGNON; + report_idle = IDLE_SCREENSAVER; + web_browser = BROWSER_NETSCAPE; + auto_away = 10; + default_away = NULL; - conv_size.width = 320; - conv_size.height = 175; - conv_size.entry_height = 50; + g_snprintf(web_command, sizeof(web_command), "xterm -e lynx %%s"); + + blist_pos.width = 0; + blist_pos.height = 0; + blist_pos.x = 0; + blist_pos.y = 0; - buddy_chat_size.width = 320; - buddy_chat_size.height = 160; - buddy_chat_size.entry_height = 50; - } + conv_size.width = 320; + conv_size.height = 175; + conv_size.entry_height = 50; + + buddy_chat_size.width = 320; + buddy_chat_size.height = 160; + buddy_chat_size.entry_height = 50; } - void load_prefs() { FILE *f; @@ -873,18 +983,17 @@ else if (getenv("HOME")) g_snprintf(buf, sizeof(buf), "%s/.gaimrc", getenv("HOME")); else { - set_defaults(TRUE); + set_defaults(); return; } if ((f = fopen(buf, "r"))) { fgets(buf, sizeof(buf), f); sscanf(buf, "# .gaimrc v%d", &ver); - if ((ver <= 1) || (buf[0] != '#')) { + if ((ver <= 3) || (buf[0] != '#')) { fclose(f); - set_defaults(FALSE); + set_defaults(); save_prefs(); - load_prefs(); return; } @@ -926,10 +1035,6 @@ g_snprintf(buf, sizeof(buf), _("Could not open config file %s."), opt_rcfile_arg); do_error_dialog(buf, _("Preferences Error")); } - - if ((ver == 2) || (buf[0] != '#')) { - set_defaults(TRUE); - } } void save_prefs()
--- a/src/idle.c Wed Sep 19 20:38:07 2001 +0000 +++ b/src/idle.c Thu Sep 20 01:23:04 2001 +0000 @@ -69,7 +69,7 @@ #endif /* USE_SCREENSAVER */ idle_time = t - gc->lastsent; - if ((general_options & OPT_GEN_AUTO_AWAY) && (idle_time > (60 * auto_away)) && + if ((away_options & OPT_AWAY_AUTO) && (idle_time > (60 * auto_away)) && (!gc->is_auto_away)) { if (!gc->away) { debug_printf("making %s away automatically\n", gc->username);
--- a/src/prefs.c Wed Sep 19 20:38:07 2001 +0000 +++ b/src/prefs.c Thu Sep 20 01:23:04 2001 +0000 @@ -49,7 +49,7 @@ struct debug_window *dw = NULL; static GtkWidget *prefs = NULL; -static GtkWidget *gaim_button(const char *, int *, int, GtkWidget *); +static GtkWidget *gaim_button(const char *, guint *, int, GtkWidget *); static void prefs_build_general(); static void prefs_build_buddy(); static void prefs_build_convo(); @@ -59,7 +59,7 @@ static gint handle_delete(GtkWidget *, GdkEvent *, void *); static void delete_prefs(GtkWidget *, void *); void set_default_away(GtkWidget *, gpointer); -void set_font_option(GtkWidget *w, int *option); +static void set_font_option(GtkWidget *w, int option); static GtkWidget *sounddialog = NULL; static GtkWidget *prefdialog = NULL; @@ -215,19 +215,17 @@ gtk_container_add(GTK_CONTAINER(frame), mbox); gtk_widget_show(mbox); - gaim_button(_("Use borderless buttons"), &display_options, - OPT_DISP_COOL_LOOK, mbox); - - if (!tickerwindow && (display_options & OPT_DISP_SHOW_BUDDYTICKER)) - display_options = display_options ^ OPT_DISP_SHOW_BUDDYTICKER; - tickerbutton = gaim_button(_("Show Buddy Ticker"), &display_options, OPT_DISP_SHOW_BUDDYTICKER, mbox); - gtk_signal_connect_object(GTK_OBJECT(tickerbutton), "clicked", GTK_SIGNAL_FUNC(BuddyTickerShow), 0); + gaim_button(_("Use borderless buttons"), &misc_options, + OPT_MISC_COOL_LOOK, mbox); + + if (!tickerwindow && (misc_options & OPT_MISC_BUDDY_TICKER)) + misc_options ^= OPT_MISC_BUDDY_TICKER; + tickerbutton = gaim_button(_("Show Buddy Ticker"), &misc_options, OPT_MISC_BUDDY_TICKER, mbox); gtk_signal_connect(GTK_OBJECT(tickerbutton), "destroy", GTK_SIGNAL_FUNC(desttkr), 0); - if (!dw && (general_options & OPT_GEN_DEBUG)) - general_options = general_options ^ OPT_GEN_DEBUG; - debugbutton = gaim_button(_("Show Debug Window"), &general_options, OPT_GEN_DEBUG, mbox); - gtk_signal_connect_object(GTK_OBJECT(debugbutton), "clicked", GTK_SIGNAL_FUNC(show_debug), 0); + if (!dw && (misc_options & OPT_MISC_DEBUG)) + misc_options ^= OPT_MISC_DEBUG; + debugbutton = gaim_button(_("Show Debug Window"), &misc_options, OPT_MISC_DEBUG, mbox); gtk_signal_connect(GTK_OBJECT(debugbutton), "destroy", GTK_SIGNAL_FUNC(destdeb), 0); frame = gtk_frame_new(_("Report Idle Times")); @@ -281,7 +279,7 @@ opt = browser_radio(_("Netscape"), BROWSER_NETSCAPE, vbox, opt); new_window = - gaim_button(_("Pop up new window by default"), &general_options, OPT_GEN_BROWSER_POPUP, vbox); + gaim_button(_("Pop up new window by default"), &misc_options, OPT_MISC_BROWSER_POPUP, vbox); vbox = gtk_vbox_new(FALSE, 5); gtk_box_pack_start(GTK_BOX(hbox), vbox, TRUE, TRUE, 5); @@ -545,23 +543,23 @@ gtk_box_pack_start(GTK_BOX(hbox), vbox, TRUE, TRUE, 5); gtk_widget_show(vbox); - button = gaim_button(_("Hide IM/Info/Chat buttons"), &display_options, OPT_DISP_NO_BUTTONS, vbox); + button = gaim_button(_("Hide IM/Info/Chat buttons"), &blist_options, OPT_BLIST_NO_BUTTONS, vbox); #ifdef USE_APPLET - gaim_button(_("Automatically show buddy list on sign on"), &general_options, - OPT_GEN_APP_BUDDY_SHOW, vbox); + gaim_button(_("Automatically show buddy list on sign on"), &blist_options, + OPT_BLIST_APP_BUDDY_SHOW, vbox); #endif - gaim_button(_("Save Window Size/Position"), &general_options, OPT_GEN_SAVED_WINDOWS, vbox); + gaim_button(_("Save Window Size/Position"), &blist_options, OPT_BLIST_SAVED_WINDOWS, vbox); vbox = gtk_vbox_new(FALSE, 5); gtk_box_pack_start(GTK_BOX(hbox), vbox, TRUE, TRUE, 5); gtk_widget_show(vbox); - button2 = gaim_button(_("Show pictures on buttons"), &display_options, OPT_DISP_SHOW_BUTTON_XPM, vbox); - if (display_options & OPT_DISP_NO_BUTTONS) + button2 = gaim_button(_("Show pictures on buttons"), &blist_options, OPT_BLIST_SHOW_BUTTON_XPM, vbox); + if (blist_options & OPT_BLIST_NO_BUTTONS) gtk_widget_set_sensitive(button2, FALSE); gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(toggle_sensitive), button2); #ifdef USE_APPLET - gaim_button(_("Display Buddy List near applet"), &general_options, OPT_GEN_NEAR_APPLET, vbox); + gaim_button(_("Display Buddy List near applet"), &blist_options, OPT_BLSIT_NEAR_APPLET, vbox); #endif frame = gtk_frame_new(_("Group Displays")); @@ -576,13 +574,13 @@ gtk_box_pack_start(GTK_BOX(hbox), vbox, TRUE, TRUE, 5); gtk_widget_show(vbox); - gaim_button(_("Hide groups with no online buddies"), &display_options, OPT_DISP_NO_MT_GRP, vbox); + gaim_button(_("Hide groups with no online buddies"), &blist_options, OPT_BLIST_NO_MT_GRP, vbox); vbox = gtk_vbox_new(FALSE, 5); gtk_box_pack_start(GTK_BOX(hbox), vbox, TRUE, TRUE, 5); gtk_widget_show(vbox); - gaim_button(_("Show numbers in groups"), &display_options, OPT_DISP_SHOW_GRPNUM, vbox); + gaim_button(_("Show numbers in groups"), &blist_options, OPT_BLIST_SHOW_GRPNUM, vbox); frame = gtk_frame_new(_("Buddy Displays")); gtk_box_pack_start(GTK_BOX(box), frame, FALSE, FALSE, 5); @@ -596,14 +594,14 @@ gtk_box_pack_start(GTK_BOX(hbox), vbox, TRUE, TRUE, 5); gtk_widget_show(vbox); - gaim_button(_("Show buddy type icons"), &display_options, OPT_DISP_SHOW_PIXMAPS, vbox); - gaim_button(_("Show warning levels"), &display_options, OPT_DISP_SHOW_WARN, vbox); + gaim_button(_("Show buddy type icons"), &blist_options, OPT_BLIST_SHOW_PIXMAPS, vbox); + gaim_button(_("Show warning levels"), &blist_options, OPT_BLIST_SHOW_WARN, vbox); vbox = gtk_vbox_new(FALSE, 5); gtk_box_pack_start(GTK_BOX(hbox), vbox, TRUE, TRUE, 5); gtk_widget_show(vbox); - gaim_button(_("Show idle times"), &display_options, OPT_DISP_SHOW_IDLETIME, vbox); + gaim_button(_("Show idle times"), &blist_options, OPT_BLIST_SHOW_IDLETIME, vbox); gtk_widget_show(prefdialog); } @@ -644,17 +642,17 @@ gtk_box_pack_start(GTK_BOX(hbox), vbox, TRUE, TRUE, 5); gtk_widget_show(vbox); - gaim_button(_("Enter sends message"), &general_options, OPT_GEN_ENTER_SENDS, vbox); - gaim_button(_("Control-Enter sends message"), &general_options, OPT_GEN_CTL_ENTER, vbox); - gaim_button(_("Escape closes window"), &general_options, OPT_GEN_ESC_CAN_CLOSE, vbox); + gaim_button(_("Enter sends message"), &convo_options, OPT_CONVO_ENTER_SENDS, vbox); + gaim_button(_("Control-Enter sends message"), &convo_options, OPT_CONVO_CTL_ENTER, vbox); + gaim_button(_("Escape closes window"), &convo_options, OPT_CONVO_ESC_CAN_CLOSE, vbox); vbox = gtk_vbox_new(TRUE, 5); gtk_box_pack_start(GTK_BOX(hbox), vbox, TRUE, TRUE, 5); gtk_widget_show(vbox); - gaim_button(_("Control-{B/I/U/S} inserts HTML tags"), &general_options, OPT_GEN_CTL_CHARS, vbox); - gaim_button(_("Control-(number) inserts smileys"), &general_options, OPT_GEN_CTL_SMILEYS, vbox); - gaim_button(_("F2 toggles timestamp display"), &general_options, OPT_GEN_F2_TOGGLES, vbox); + gaim_button(_("Control-{B/I/U/S} inserts HTML tags"), &convo_options, OPT_CONVO_CTL_CHARS, vbox); + gaim_button(_("Control-(number) inserts smileys"), &convo_options, OPT_CONVO_CTL_SMILEYS, vbox); + gaim_button(_("F2 toggles timestamp display"), &convo_options, OPT_CONVO_F2_TOGGLES, vbox); frame = gtk_frame_new(_("Display and General Options")); gtk_box_pack_start(GTK_BOX(box), frame, FALSE, FALSE, 5); @@ -668,22 +666,22 @@ gtk_box_pack_start(GTK_BOX(hbox), vbox, TRUE, TRUE, 5); gtk_widget_show(vbox); - gaim_button(_("Show graphical smileys"), &display_options, OPT_DISP_SHOW_SMILEY, vbox); - gaim_button(_("Show timestamp on messages"), &display_options, OPT_DISP_SHOW_TIME, vbox); - gaim_button(_("Show URLs as links"), &general_options, OPT_GEN_SEND_LINKS, vbox); - gaim_button(_("Highlight misspelled words"), &general_options, OPT_GEN_CHECK_SPELLING, vbox); - gaim_button(_("Sending messages removes away status"), &general_options, OPT_GEN_BACK_ON_IM, vbox); - gaim_button(_("Queue new messages when away"), &general_options, OPT_GEN_QUEUE_WHEN_AWAY, vbox); + gaim_button(_("Show graphical smileys"), &convo_options, OPT_CONVO_SHOW_SMILEY, vbox); + gaim_button(_("Show timestamp on messages"), &convo_options, OPT_CONVO_SHOW_TIME, vbox); + gaim_button(_("Show URLs as links"), &convo_options, OPT_CONVO_SEND_LINKS, vbox); + gaim_button(_("Highlight misspelled words"), &convo_options, OPT_CONVO_CHECK_SPELLING, vbox); + gaim_button(_("Sending messages removes away status"), &away_options, OPT_AWAY_BACK_ON_IM, vbox); + gaim_button(_("Queue new messages when away"), &away_options, OPT_AWAY_QUEUE, vbox); vbox = gtk_vbox_new(FALSE, 5); gtk_box_pack_start(GTK_BOX(hbox), vbox, TRUE, TRUE, 5); gtk_widget_show(vbox); - gaim_button(_("Ignore colors"), &display_options, OPT_DISP_IGNORE_COLOUR, vbox); - gaim_button(_("Ignore font faces"), &display_options, OPT_DISP_IGNORE_FONTS, vbox); - gaim_button(_("Ignore font sizes"), &display_options, OPT_DISP_IGNORE_SIZES, vbox); - gaim_button(_("Ignore TiK Automated Messages"), &general_options, OPT_GEN_TIK_HACK, vbox); - gaim_button(_("Ignore new conversations when away"), &general_options, OPT_GEN_DISCARD_WHEN_AWAY, vbox); + gaim_button(_("Ignore colors"), &convo_options, OPT_CONVO_IGNORE_COLOUR, vbox); + gaim_button(_("Ignore font faces"), &convo_options, OPT_CONVO_IGNORE_FONTS, vbox); + gaim_button(_("Ignore font sizes"), &convo_options, OPT_CONVO_IGNORE_SIZES, vbox); + gaim_button(_("Ignore TiK Automated Messages"), &away_options, OPT_AWAY_TIK_HACK, vbox); + gaim_button(_("Ignore new conversations when away"), &away_options, OPT_AWAY_DISCARD, vbox); gtk_widget_show(prefdialog); } @@ -691,17 +689,17 @@ static void set_buttons_opt(GtkWidget *w, int data) { int mask; - if (data & 0x1) /* set the first bit if we're affecting chat buttons */ - mask = (OPT_DISP_CHAT_BUTTON_TEXT | OPT_DISP_CHAT_BUTTON_XPM); - else - mask = (OPT_DISP_CONV_BUTTON_TEXT | OPT_DISP_CONV_BUTTON_XPM); - display_options &= ~(mask); - display_options |= (data & mask); - - if (data & 0x1) + if (data & 0x1) { /* set the first bit if we're affecting chat buttons */ + mask = (OPT_CHAT_BUTTON_TEXT | OPT_CHAT_BUTTON_XPM); + chat_options &= ~(mask); + chat_options |= (data & mask); update_chat_button_pix(); - else + } else { + mask = (OPT_IM_BUTTON_TEXT | OPT_IM_BUTTON_XPM); + im_options &= ~(mask); + im_options |= (data & mask); update_im_button_pix(); + } save_prefs(); } @@ -721,35 +719,35 @@ gtk_signal_connect(GTK_OBJECT(opt), "clicked", GTK_SIGNAL_FUNC(set_buttons_opt), (void *)which); gtk_widget_show(opt); if (which & 1) { - if (which == (OPT_DISP_CHAT_BUTTON_TEXT | 1)) { - if ( (display_options & OPT_DISP_CHAT_BUTTON_TEXT) && - !(display_options & OPT_DISP_CHAT_BUTTON_XPM)) + if (which == (OPT_CHAT_BUTTON_TEXT | 1)) { + if ( (chat_options & OPT_CHAT_BUTTON_TEXT) && + !(chat_options & OPT_CHAT_BUTTON_XPM)) gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(opt), TRUE); - } else if (which == (OPT_DISP_CHAT_BUTTON_XPM | 1)) { - if (!(display_options & OPT_DISP_CHAT_BUTTON_TEXT) && - (display_options & OPT_DISP_CHAT_BUTTON_XPM)) + } else if (which == (OPT_CHAT_BUTTON_XPM | 1)) { + if (!(chat_options & OPT_CHAT_BUTTON_TEXT) && + (chat_options & OPT_CHAT_BUTTON_XPM)) gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(opt), TRUE); } else { - if (((display_options & OPT_DISP_CHAT_BUTTON_TEXT) && - (display_options & OPT_DISP_CHAT_BUTTON_XPM)) || - (!(display_options & OPT_DISP_CHAT_BUTTON_TEXT) && - !(display_options & OPT_DISP_CHAT_BUTTON_XPM))) + if (((chat_options & OPT_CHAT_BUTTON_TEXT) && + (chat_options & OPT_CHAT_BUTTON_XPM)) || + (!(chat_options & OPT_CHAT_BUTTON_TEXT) && + !(chat_options & OPT_CHAT_BUTTON_XPM))) gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(opt), TRUE); } } else { - if (which == OPT_DISP_CONV_BUTTON_TEXT) { - if ( (display_options & OPT_DISP_CONV_BUTTON_TEXT) && - !(display_options & OPT_DISP_CONV_BUTTON_XPM)) + if (which == OPT_IM_BUTTON_TEXT) { + if ( (im_options & OPT_IM_BUTTON_TEXT) && + !(im_options & OPT_IM_BUTTON_XPM)) gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(opt), TRUE); - } else if (which == OPT_DISP_CONV_BUTTON_XPM) { - if (!(display_options & OPT_DISP_CONV_BUTTON_TEXT) && - (display_options & OPT_DISP_CONV_BUTTON_XPM)) + } else if (which == OPT_IM_BUTTON_XPM) { + if (!(im_options & OPT_IM_BUTTON_TEXT) && + (im_options & OPT_IM_BUTTON_XPM)) gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(opt), TRUE); } else { - if (((display_options & OPT_DISP_CONV_BUTTON_TEXT) && - (display_options & OPT_DISP_CONV_BUTTON_XPM)) || - (!(display_options & OPT_DISP_CONV_BUTTON_TEXT) && - !(display_options & OPT_DISP_CONV_BUTTON_XPM))) + if (((im_options & OPT_IM_BUTTON_TEXT) && + (im_options & OPT_IM_BUTTON_XPM)) || + (!(im_options & OPT_IM_BUTTON_TEXT) && + !(im_options & OPT_IM_BUTTON_XPM))) gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(opt), TRUE); } } @@ -760,17 +758,17 @@ static void set_tab_opt(GtkWidget *w, int data) { int mask; - if (data & 0x1) /* set the first bit if we're affecting chat buttons */ - mask = (OPT_DISP_CHAT_SIDE_TAB | OPT_DISP_CHAT_BR_TAB); - else - mask = (OPT_DISP_CONV_SIDE_TAB | OPT_DISP_CONV_BR_TAB); - display_options &= ~(mask); - display_options |= (data & mask); - - if (data & 0x1) + if (data & 0x1) { /* set the first bit if we're affecting chat buttons */ + mask = (OPT_CHAT_SIDE_TAB | OPT_CHAT_BR_TAB); + chat_options &= ~(mask); + chat_options |= (data & mask); update_chat_tabs(); - else + } else { + mask = (OPT_IM_SIDE_TAB | OPT_IM_BR_TAB); + im_options &= ~(mask); + im_options |= (data & mask); update_im_tabs(); + } save_prefs(); } @@ -789,14 +787,14 @@ gtk_signal_connect(GTK_OBJECT(opt), "clicked", GTK_SIGNAL_FUNC(set_tab_opt), (void *)which); gtk_widget_show(opt); if (which & 1) { - if ((display_options & (OPT_DISP_CHAT_SIDE_TAB | OPT_DISP_CHAT_BR_TAB)) == (which ^ 1)) + if ((chat_options & (OPT_CHAT_SIDE_TAB | OPT_CHAT_BR_TAB)) == (which ^ 1)) gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(opt), TRUE); - if (!(display_options & OPT_DISP_ONE_CHAT_WINDOW)) + if (!(chat_options & OPT_CHAT_ONE_WINDOW)) gtk_widget_set_sensitive(opt, FALSE); } else { - if ((display_options & (OPT_DISP_CONV_SIDE_TAB | OPT_DISP_CONV_BR_TAB)) == which) + if ((im_options & (OPT_IM_SIDE_TAB | OPT_IM_BR_TAB)) == which) gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(opt), TRUE); - if (!(display_options & OPT_DISP_ONE_WINDOW)) + if (!(im_options & OPT_IM_ONE_WINDOW)) gtk_widget_set_sensitive(opt, FALSE); } @@ -884,9 +882,9 @@ gtk_box_pack_start(GTK_BOX(vbox2), label, FALSE, FALSE, 5); gtk_widget_show(label); - opt = am_radio(_("Pictures And Text"), OPT_DISP_CONV_BUTTON_TEXT | OPT_DISP_CONV_BUTTON_XPM, vbox2, NULL); - opt = am_radio(_("Pictures"), OPT_DISP_CONV_BUTTON_XPM, vbox2, opt); - opt = am_radio(_("Text"), OPT_DISP_CONV_BUTTON_TEXT, vbox2, opt); + opt = am_radio(_("Pictures And Text"), OPT_IM_BUTTON_TEXT | OPT_IM_BUTTON_XPM, vbox2, NULL); + opt = am_radio(_("Pictures"), OPT_IM_BUTTON_XPM, vbox2, opt); + opt = am_radio(_("Text"), OPT_IM_BUTTON_TEXT, vbox2, opt); sep = gtk_vseparator_new(); gtk_box_pack_start(GTK_BOX(hbox), sep, FALSE, FALSE, 5); @@ -896,9 +894,9 @@ gtk_box_pack_start(GTK_BOX(hbox), vbox2, TRUE, TRUE, 5); gtk_widget_show(vbox2); - button = gaim_button(_("Show all conversations in one tabbed window"), &display_options, OPT_DISP_ONE_WINDOW, vbox2); - gaim_button(_("Raise windows on events"), &general_options, OPT_GEN_POPUP_WINDOWS, vbox2); - gaim_button(_("Show logins in window"), &display_options, OPT_DISP_SHOW_LOGON, vbox2); + button = gaim_button(_("Show all conversations in one tabbed window"), &im_options, OPT_IM_ONE_WINDOW, vbox2); + gaim_button(_("Raise windows on events"), &im_options, OPT_IM_POPUP, vbox2); + gaim_button(_("Show logins in window"), &im_options, OPT_IM_LOGON, vbox2); frame = gtk_frame_new(_("Window Sizes")); gtk_box_pack_start(GTK_BOX(box), frame, FALSE, FALSE, 5); @@ -934,16 +932,16 @@ opt = tab_radio(_("Top"), 0, vbox3, NULL); gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(toggle_sensitive), opt); - opt = tab_radio(_("Bottom"), OPT_DISP_CONV_BR_TAB, vbox3, opt); + opt = tab_radio(_("Bottom"), OPT_IM_BR_TAB, vbox3, opt); gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(toggle_sensitive), opt); vbox3 = gtk_vbox_new(TRUE, 5); gtk_box_pack_start(GTK_BOX(hbox2), vbox3, TRUE, TRUE, 5); gtk_widget_show(vbox3); - opt = tab_radio(_("Left"), OPT_DISP_CONV_SIDE_TAB, vbox3, opt); + opt = tab_radio(_("Left"), OPT_IM_SIDE_TAB, vbox3, opt); gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(toggle_sensitive), opt); - opt = tab_radio(_("Right"), OPT_DISP_CONV_SIDE_TAB | OPT_DISP_CONV_BR_TAB, vbox3, opt); + opt = tab_radio(_("Right"), OPT_IM_SIDE_TAB | OPT_IM_BR_TAB, vbox3, opt); gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(toggle_sensitive), opt); gtk_widget_show(prefdialog); @@ -999,9 +997,9 @@ gtk_box_pack_start(GTK_BOX(vbox2), label, FALSE, FALSE, 5); gtk_widget_show(label); - opt = am_radio(_("Pictures And Text"), OPT_DISP_CHAT_BUTTON_TEXT | OPT_DISP_CHAT_BUTTON_XPM | 1, vbox2, NULL); - opt = am_radio(_("Pictures"), OPT_DISP_CHAT_BUTTON_XPM | 1, vbox2, opt); - opt = am_radio(_("Text"), OPT_DISP_CHAT_BUTTON_TEXT | 1, vbox2, opt); + opt = am_radio(_("Pictures And Text"), OPT_CHAT_BUTTON_TEXT | OPT_CHAT_BUTTON_XPM | 1, vbox2, NULL); + opt = am_radio(_("Pictures"), OPT_CHAT_BUTTON_XPM | 1, vbox2, opt); + opt = am_radio(_("Text"), OPT_CHAT_BUTTON_TEXT | 1, vbox2, opt); sep = gtk_vseparator_new(); gtk_box_pack_start(GTK_BOX(hbox), sep, FALSE, FALSE, 5); @@ -1011,9 +1009,9 @@ gtk_box_pack_start(GTK_BOX(hbox), vbox2, TRUE, TRUE, 5); gtk_widget_show(vbox2); - button = gaim_button(_("Show all chats in one tabbed window"), &display_options, OPT_DISP_ONE_CHAT_WINDOW, vbox2); - gaim_button(_("Raise windows on events"), &general_options, OPT_GEN_POPUP_CHAT, vbox2); - gaim_button(_("Show people joining/leaving in window"), &display_options, OPT_DISP_CHAT_LOGON, vbox2); + button = gaim_button(_("Show all chats in one tabbed window"), &chat_options, OPT_CHAT_ONE_WINDOW, vbox2); + gaim_button(_("Raise windows on events"), &chat_options, OPT_CHAT_POPUP, vbox2); + gaim_button(_("Show people joining/leaving in window"), &chat_options, OPT_CHAT_LOGON, vbox2); frame = gtk_frame_new(_("Window Sizes")); gtk_box_pack_start(GTK_BOX(box), frame, FALSE, FALSE, 5); @@ -1049,16 +1047,16 @@ opt = tab_radio(_("Top"), 1, vbox3, NULL); gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(toggle_sensitive), opt); - opt = tab_radio(_("Bottom"), OPT_DISP_CHAT_BR_TAB | 1, vbox3, opt); + opt = tab_radio(_("Bottom"), OPT_CHAT_BR_TAB | 1, vbox3, opt); gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(toggle_sensitive), opt); vbox3 = gtk_vbox_new(TRUE, 5); gtk_box_pack_start(GTK_BOX(hbox2), vbox3, TRUE, TRUE, 5); gtk_widget_show(vbox3); - opt = tab_radio(_("Left"), OPT_DISP_CHAT_SIDE_TAB | 1, vbox3, opt); + opt = tab_radio(_("Left"), OPT_CHAT_SIDE_TAB | 1, vbox3, opt); gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(toggle_sensitive), opt); - opt = tab_radio(_("Right"), OPT_DISP_CHAT_SIDE_TAB | OPT_DISP_CHAT_BR_TAB | 1, vbox3, opt); + opt = tab_radio(_("Right"), OPT_CHAT_SIDE_TAB | OPT_CHAT_BR_TAB | 1, vbox3, opt); gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(toggle_sensitive), opt); gtk_widget_show(prefdialog); @@ -1677,16 +1675,16 @@ gtk_box_pack_start(GTK_BOX(hbox), vbox2, TRUE, TRUE, 5); gtk_widget_show(vbox2); - gaim_button(_("Ignore new conversations when away"), &general_options, OPT_GEN_DISCARD_WHEN_AWAY, vbox2); + gaim_button(_("Ignore new conversations when away"), &away_options, OPT_AWAY_DISCARD, vbox2); gaim_button(_("Sounds while away"), &sound_options, OPT_SOUND_WHEN_AWAY, vbox2); - gaim_button(_("Sending messages removes away status"), &general_options, OPT_GEN_BACK_ON_IM, vbox2); + gaim_button(_("Sending messages removes away status"), &away_options, OPT_AWAY_BACK_ON_IM, vbox2); vbox2 = gtk_vbox_new(FALSE, 5); gtk_box_pack_start(GTK_BOX(hbox), vbox2, TRUE, TRUE, 5); gtk_widget_show(vbox2); - gaim_button(_("Don't send auto-response"), &general_options, OPT_GEN_NO_AUTO_RESP, vbox2); - gaim_button(_("Queue new messages when away"), &general_options, OPT_GEN_QUEUE_WHEN_AWAY, vbox2); + gaim_button(_("Don't send auto-response"), &away_options, OPT_AWAY_NO_AUTO_RESP, vbox2); + gaim_button(_("Queue new messages when away"), &away_options, OPT_AWAY_QUEUE, vbox2); sep = gtk_hseparator_new(); gtk_box_pack_start(GTK_BOX(vbox), sep, FALSE, FALSE, 0); @@ -1696,13 +1694,13 @@ gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); gtk_widget_show(hbox); - button = gaim_button(_("Auto Away after"), &general_options, OPT_GEN_AUTO_AWAY, hbox); + button = gaim_button(_("Auto Away after"), &away_options, OPT_AWAY_AUTO, hbox); adjust = gtk_adjustment_new(auto_away, 1, 1440, 1, 10, 10); spin = gtk_spin_button_new(GTK_ADJUSTMENT(adjust), 1, 0); gtk_widget_set_usize(spin, 50, -1); gtk_object_set_user_data(GTK_OBJECT(spin), &auto_away); - if (!(general_options & OPT_GEN_AUTO_AWAY)) + if (!(away_options & OPT_AWAY_AUTO)) gtk_widget_set_sensitive(GTK_WIDGET(spin), FALSE); gtk_box_pack_start(GTK_BOX(hbox), spin, FALSE, FALSE, 0); gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(toggle_sensitive), spin); @@ -1717,7 +1715,7 @@ prefs_away_menu = gtk_option_menu_new(); gtk_box_pack_start(GTK_BOX(hbox), prefs_away_menu, FALSE, FALSE, 0); default_away_menu_init(prefs_away_menu); - if (!(general_options & OPT_GEN_AUTO_AWAY)) + if (!(away_options & OPT_AWAY_AUTO)) gtk_widget_set_sensitive(GTK_WIDGET(prefs_away_menu), FALSE); gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(toggle_sensitive), prefs_away_menu); @@ -2285,8 +2283,8 @@ { if (debugbutton) gtk_button_clicked(GTK_BUTTON(debugbutton)); - if (general_options & OPT_GEN_DEBUG) { - general_options = general_options ^ (int)OPT_GEN_DEBUG; + if (misc_options & OPT_MISC_DEBUG) { + misc_options ^= OPT_MISC_DEBUG; save_prefs(); } g_free(dw); @@ -2325,9 +2323,9 @@ gtk_widget_show(dw->window); } -void show_debug(GtkObject * obj) +void show_debug() { - if ((general_options & OPT_GEN_DEBUG)) { + if ((misc_options & OPT_MISC_DEBUG)) { if (!dw || !dw->window) build_debug(); gtk_widget_show(dw->window); @@ -2348,7 +2346,7 @@ s = g_strdup_vprintf(fmt, ap); va_end(ap); - if (general_options & OPT_GEN_DEBUG && dw) { + if (misc_options & OPT_MISC_DEBUG && dw) { GtkAdjustment *adj = GTK_TEXT(dw->entry)->vadj; gboolean scroll = (adj->value == adj->upper - adj->lower - adj->page_size); @@ -2398,106 +2396,153 @@ *option = !(*option); } -void set_general_option(GtkWidget *w, int *option) +static void set_misc_option(GtkWidget *w, int option) { - general_options = general_options ^ (int)option; - - if ((int)option == OPT_GEN_CHECK_SPELLING) - toggle_spellchk(); - - if ((int)option == OPT_GEN_QUEUE_WHEN_AWAY) - toggle_away_queue(); + misc_options ^= option; + + if (option == OPT_MISC_DEBUG) + show_debug(); + + if (option == OPT_MISC_BUDDY_TICKER) + BuddyTickerShow(); + + save_prefs(); +} + +static void set_logging_option(GtkWidget *w, int option) +{ + logging_options ^= option; + + if (option == OPT_LOG_ALL) + update_log_convs(); save_prefs(); } -void set_display_option(GtkWidget *w, int *option) +static void set_blist_option(GtkWidget *w, int option) { - display_options = display_options ^ (int)option; - - if (blist && ((int)option == OPT_DISP_NO_BUTTONS)) { - build_imchat_box(!(display_options & OPT_DISP_NO_BUTTONS)); + blist_options ^= option; + + save_prefs(); + + if (!blist) + return; + + if (option == OPT_BLIST_NO_BUTTONS) { + build_imchat_box(!(blist_options & OPT_BLIST_NO_BUTTONS)); update_button_pix(); } - if (blist && ((int)option == OPT_DISP_SHOW_GRPNUM)) + if (option == OPT_BLIST_SHOW_GRPNUM) update_num_groups(); - if (blist && ((int)option == OPT_DISP_NO_MT_GRP)) + if (option == OPT_BLIST_NO_MT_GRP) toggle_show_empty_groups(); - if (blist && ((int)option == OPT_DISP_SHOW_BUTTON_XPM)) + if (option == OPT_BLIST_SHOW_BUTTON_XPM) update_button_pix(); - if ((int)option == OPT_DISP_SHOW_SMILEY) + if (option == OPT_BLIST_SHOW_PIXMAPS) + toggle_buddy_pixmaps(); +} + +static void set_convo_option(GtkWidget *w, int option) +{ + convo_options ^= option; + + if (option == OPT_CONVO_SHOW_SMILEY) toggle_smileys(); - if ((int)option == OPT_DISP_SHOW_TIME) + if (option == OPT_CONVO_SHOW_TIME) toggle_timestamps(); - if ((int)option == OPT_DISP_ONE_WINDOW) - tabize(); - - if ((int)option == OPT_DISP_ONE_CHAT_WINDOW) - chat_tabize(); - - if ((int)option == OPT_DISP_SHOW_PIXMAPS) - toggle_buddy_pixmaps(); - -#ifdef USE_APPLET - update_pixmaps(); -#endif + if (option == OPT_CONVO_CHECK_SPELLING) + toggle_spellchk(); save_prefs(); } -void set_sound_option(GtkWidget *w, int *option) +static void set_im_option(GtkWidget *w, int option) { - sound_options = sound_options ^ (int)option; + im_options ^= option; + + if (option == OPT_IM_ONE_WINDOW) + tabize(); + save_prefs(); } -void set_font_option(GtkWidget *w, int *option) +static void set_chat_option(GtkWidget *w, int option) { - font_options = font_options ^ (int)option; + chat_options ^= option; + + if (option == OPT_CHAT_ONE_WINDOW) + chat_tabize(); + + save_prefs(); +} + +void set_sound_option(GtkWidget *w, int option) +{ + sound_options ^= option; + + save_prefs(); +} + +static void set_font_option(GtkWidget *w, int option) +{ + font_options ^= option; update_font_buttons(); save_prefs(); } -void set_logging_option(GtkWidget *w, int *option) +static void set_away_option(GtkWidget *w, int option) { - logging_options = logging_options ^ (int)option; - - if ((int)option == OPT_LOG_ALL) - update_log_convs(); + away_options ^= option; + + if (option == OPT_AWAY_QUEUE) + toggle_away_queue(); save_prefs(); } -GtkWidget *gaim_button(const char *text, int *options, int option, GtkWidget *page) +GtkWidget *gaim_button(const char *text, guint *options, int option, GtkWidget *page) { GtkWidget *button; button = gtk_check_button_new_with_label(text); gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(button), (*options & option)); gtk_box_pack_start(GTK_BOX(page), button, FALSE, FALSE, 0); + if (options == &misc_options) + gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(set_misc_option), + (int *)option); + if (options == &logging_options) + gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(set_logging_option), + (int *)option); + if (options == &blist_options) + gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(set_blist_option), + (int *)option); + if (options == &convo_options) + gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(set_convo_option), + (int *)option); + if (options == &im_options) + gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(set_im_option), + (int *)option); + if (options == &chat_options) + gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(set_chat_option), + (int *)option); if (options == &font_options) gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(set_font_option), (int *)option); if (options == &sound_options) gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(set_sound_option), (int *)option); - if (options == &display_options) - gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(set_display_option), + if (options == &away_options) + gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(set_away_option), (int *)option); - if (options == &general_options) - gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(set_general_option), - (int *)option); - if (options == &logging_options) - gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(set_logging_option), - (int *)option); + gtk_widget_show(button); return button;
--- a/src/server.c Wed Sep 19 20:38:07 2001 +0000 +++ b/src/server.c Thu Sep 20 01:23:04 2001 +0000 @@ -424,7 +424,7 @@ /* TiK, using TOC, sends an automated message in order to get your away message. Now, * this is one of the biggest hacks I think I've seen. But, in order to be nice to * TiK, we're going to give users the option to ignore it. */ - if ((general_options & OPT_GEN_TIK_HACK) && gc->away && strlen(gc->away) && + if ((away_options & OPT_AWAY_TIK_HACK) && gc->away && strlen(gc->away) && !strcmp(message, ">>>Automated Message: Getting Away Message<<<")) { char *tmpmsg = stylize(awaymessage->message, MSG_LEN); serv_send_im(gc, name, tmpmsg, IM_FLAG_AWAY); @@ -436,7 +436,7 @@ /* if you can't figure this out, stop reading right now. * "we're not worthy! we're not worthy!" */ - if (general_options & OPT_GEN_SEND_LINKS) + if (convo_options & OPT_CONVO_SEND_LINKS) linkify_text(message); /* um. when we call write_to_conv with the message we received, it's nice to pass whether @@ -463,7 +463,7 @@ * imaway dialog being shown. in fact, it's possible for *all* the accounts to be * away without the imaway dialog being shown. so in order for this to be queued * properly, we have to make sure that the imaway dialog actually exists, first. */ - if (!cnv && clistqueue && (general_options & OPT_GEN_QUEUE_WHEN_AWAY)) { + if (!cnv && clistqueue && (away_options & OPT_AWAY_QUEUE)) { /* alright, so we're going to queue it. neat, eh? :) so first we create * something to store the message, and add it to our queue. Then we update * the away dialog to indicate that we've queued something. */ @@ -497,7 +497,7 @@ /* ok, so we're not queuing it. well then, we'll try to handle it normally. * Some people think that ignoring it is a perfectly acceptible way to handle * it. i think they're on crack, but hey, that's why it's optional. */ - if (general_options & OPT_GEN_DISCARD_WHEN_AWAY) { + if (away_options & OPT_AWAY_DISCARD) { g_free(name); g_free(message); return; @@ -521,7 +521,7 @@ /* regardless of whether we queue it or not, we should send an auto-response. That is, * of course, unless the horse.... no wait. */ - if ((general_options & OPT_GEN_NO_AUTO_RESP) || !strlen(gc->away)) { + if ((away_options & OPT_AWAY_NO_AUTO_RESP) || !strlen(gc->away)) { g_free(name); g_free(message); return; @@ -549,7 +549,7 @@ /* apply default fonts and colors */ tmpmsg = stylize(gc->away, MSG_LEN); serv_send_im(gc, name, away_subs(tmpmsg, alias), IM_FLAG_AWAY); - if (!cnv && clistqueue && (general_options & OPT_GEN_QUEUE_WHEN_AWAY)) { + if (!cnv && clistqueue && (away_options & OPT_AWAY_QUEUE)) { struct queued_message *qm; qm = g_new0(struct queued_message, 1); g_snprintf(qm->name, sizeof(qm->name), "%s", name); @@ -617,7 +617,7 @@ while (cnv) { cv = (struct conversation *)cnv->data; if (!g_strcasecmp(who, normalize(cv->name))) { - if (display_options & OPT_DISP_ONE_WINDOW) { + if (im_options & OPT_IM_ONE_WINDOW) { set_convo_tab_label(cv, b->name); } else { g_snprintf(cv->name, sizeof(cv->name), "%s", name); @@ -721,9 +721,7 @@ label = gtk_label_new(buf2); gtk_widget_show(label); - close = gtk_button_new_with_label("Close"); - if (display_options & OPT_DISP_COOL_LOOK) - gtk_button_set_relief(GTK_BUTTON(close), GTK_RELIEF_NONE); + close = picture_button(d, _("Close"), cancel_xpm); gtk_widget_show(close); gtk_box_pack_start(GTK_BOX(GTK_DIALOG(d)->vbox), label, FALSE, FALSE, 5); gtk_box_pack_start(GTK_BOX(GTK_DIALOG(d)->action_area), close, FALSE, FALSE, 5); @@ -915,9 +913,8 @@ buf = g_malloc(MAX(strlen(message) * 2, 8192)); strcpy(buf, message); - if (general_options & OPT_GEN_SEND_LINKS) { + if (convo_options & OPT_CONVO_SEND_LINKS) linkify_text(buf); - } if (whisper) w = WFLAG_WHISPER;
--- a/src/ticker.c Wed Sep 19 20:38:07 2001 +0000 +++ b/src/ticker.c Thu Sep 20 01:23:04 2001 +0000 @@ -56,8 +56,6 @@ extern void pressed_ticker(char *); void BuddyTickerShow(); -extern int display_options; - void BuddyTickerDestroyWindow( GtkWidget *window ) { @@ -278,9 +276,9 @@ GSList *gcons, *grps, *buds; char **xpm; - if( !(display_options & OPT_DISP_SHOW_BUDDYTICKER) ) { + if( !(misc_options & OPT_MISC_BUDDY_TICKER) ) { BuddyTickerSignoff(); - display_options &= ~OPT_DISP_SHOW_BUDDYTICKER; + misc_options &= ~OPT_MISC_BUDDY_TICKER; return; }
--- a/src/util.c Wed Sep 19 20:38:07 2001 +0000 +++ b/src/util.c Thu Sep 20 01:23:04 2001 +0000 @@ -856,7 +856,7 @@ GtkWidget *pixmap; button = gtk_button_new(); - if (display_options & OPT_DISP_COOL_LOOK) + if (misc_options & OPT_MISC_COOL_LOOK) gtk_button_set_relief(GTK_BUTTON(button), GTK_RELIEF_NONE); button_box = gtk_hbox_new(FALSE, 5); @@ -903,7 +903,7 @@ if (!button_tips) button_tips = gtk_tooltips_new(); button = gtk_button_new(); - if (display_options & OPT_DISP_COOL_LOOK) + if (misc_options & OPT_MISC_COOL_LOOK) gtk_button_set_relief(GTK_BUTTON(button), GTK_RELIEF_NONE); button_box = gtk_hbox_new(FALSE, 0); @@ -1123,11 +1123,11 @@ int dispstyle; if (chat) { - switch (display_options & (OPT_DISP_CHAT_BUTTON_TEXT | OPT_DISP_CHAT_BUTTON_XPM)) { - case OPT_DISP_CHAT_BUTTON_TEXT: + switch (chat_options & (OPT_CHAT_BUTTON_TEXT | OPT_CHAT_BUTTON_XPM)) { + case OPT_CHAT_BUTTON_TEXT: dispstyle = 1; break; - case OPT_DISP_CHAT_BUTTON_XPM: + case OPT_CHAT_BUTTON_XPM: dispstyle = 0; break; default: /* both or neither */ @@ -1135,11 +1135,11 @@ break; } } else { - switch (display_options & (OPT_DISP_CONV_BUTTON_TEXT | OPT_DISP_CONV_BUTTON_XPM)) { - case OPT_DISP_CONV_BUTTON_TEXT: + switch (im_options & (OPT_IM_BUTTON_TEXT | OPT_IM_BUTTON_XPM)) { + case OPT_IM_BUTTON_TEXT: dispstyle = 1; break; - case OPT_DISP_CONV_BUTTON_XPM: + case OPT_IM_BUTTON_XPM: dispstyle = 0; break; default: /* both or neither */