Mercurial > pidgin.yaz
changeset 5560:b7319c094153
[gaim-migrate @ 5961]
It compiles now, but if you use it, you won't have any accounts.
committer: Tailor Script <tailor@pidgin.im>
author | Christian Hammond <chipx86@chipx86.com> |
---|---|
date | Fri, 30 May 2003 03:25:39 +0000 |
parents | f8f1586e8bc3 |
children | d67b5b4e1323 |
files | src/away.c src/browser.c src/dialogs.c src/gaim.h src/gaimrc.c src/gtkprefs.c src/idle.c src/log.c src/multi.c src/server.c src/ui.h |
diffstat | 11 files changed, 115 insertions(+), 543 deletions(-) [+] |
line wrap: on
line diff
--- a/src/away.c Fri May 30 03:17:13 2003 +0000 +++ b/src/away.c Fri May 30 03:25:39 2003 +0000 @@ -339,6 +339,10 @@ serv_set_away(gc, awy, NULL); } +/* XXX This needs to be fixed, NOW! */ +extern GtkListStore *prefs_away_store; +extern GtkWidget *prefs_away_menu; + void do_away_menu() { GtkWidget *menuitem; @@ -622,6 +626,7 @@ } } } + if (prefs_away_menu) { l = gtk_container_get_children(GTK_CONTAINER(prefs_away_menu)); while (l) {
--- a/src/browser.c Fri May 30 03:17:13 2003 +0000 +++ b/src/browser.c Fri May 30 03:25:39 2003 +0000 @@ -540,67 +540,69 @@ { char *command = NULL; GError *error = NULL; - - switch (web_browser) { - case BROWSER_NETSCAPE: { - char *args = NULL; + const char *web_browser; + + web_browser = gaim_prefs_get_string("/gaim/gtk/browsers/browser"); - if (gaim_prefs_get_bool("/gaim/gtk/browsers/new_window")) - args = g_strdup_printf("OpenURL(%s, new-window)", url); - else - args = g_strdup_printf("OpenURL(%s)", url); + if (!strcmp(web_browser, "netscape")) { + char *args = NULL; - if (netscape_command(args)) { - g_free(args); - return; - } - - /* if netscape is running ... - command = g_strdup_printf("netscape -remote %s", args); */ + if (gaim_prefs_get_bool("/gaim/gtk/browsers/new_window")) + args = g_strdup_printf("OpenURL(%s, new-window)", url); + else + args = g_strdup_printf("OpenURL(%s)", url); - command = g_strdup_printf("netscape \"%s\"", url); + if (netscape_command(args)) { g_free(args); - } break; + return; + } - case BROWSER_OPERA: - if (gaim_prefs_get_bool("/gaim/gtk/browsers/new_window")) - command = g_strdup_printf("opera -newwindow \"%s\"", url); - else - command = g_strdup_printf("opera \"%s\"", url); - break; + /* if netscape is running ... + command = g_strdup_printf("netscape -remote %s", args); */ - case BROWSER_KONQ: - command = g_strdup_printf("kfmclient openURL \"%s\"", url); - break; - - case BROWSER_GALEON: - if (gaim_prefs_get_bool("/gaim/gtk/browsers/new_window")) - command = g_strdup_printf("galeon -w \"%s\"", url); - else - command = g_strdup_printf("galeon \"%s\"", url); - break; - - case BROWSER_MOZILLA: - command = g_strdup_printf("mozilla \"%s\"", url); - break; + command = g_strdup_printf("netscape \"%s\"", url); + g_free(args); + } + else if (!strcmp(web_browser, "opera")) { + if (gaim_prefs_get_bool("/gaim/gtk/browsers/new_window")) + command = g_strdup_printf("opera -newwindow \"%s\"", url); + else + command = g_strdup_printf("opera \"%s\"", url); + } + else if (!strcmp(web_browser, "kfmclient")) { + command = g_strdup_printf("kfmclient openURL \"%s\"", url); + } + else if (!strcmp(web_browser, "galeon")) { + if (gaim_prefs_get_bool("/gaim/gtk/browsers/new_window")) + command = g_strdup_printf("galeon -w \"%s\"", url); + else + command = g_strdup_printf("galeon \"%s\"", url); + } + else if (!strcmp(web_browser, "mozilla")) { + command = g_strdup_printf("mozilla \"%s\"", url); + } + else if (!strcmp(web_browser, "custom")) { + const char *web_command; - case BROWSER_MANUAL: { - if (!web_command[0]) { - gaim_notify_error(NULL, NULL, - _("Unable to launch your browser because " - "the 'Manual' browser command has been " - "chosen, but no command has been set."), - NULL); - return; - } + + web_command = gaim_prefs_get_string("/gaim/gtk/browsers/command"); - if (strstr(web_command, "%s")) - command = gaim_strreplace(web_command, "%s", url); - else - /* There is no "%s" in the browser command. Assume the user - * wanted the URL tacked on to the end of the command. */ - command = g_strdup_printf("%s %s", web_command, url); - } break; + if (web_command == NULL || *web_command == '\0') { + gaim_notify_error(NULL, NULL, + _("Unable to launch your browser because " + "the 'Manual' browser command has been " + "chosen, but no command has been set."), + NULL); + return; + } + + if (strstr(web_command, "%s")) + command = gaim_strreplace(web_command, "%s", url); + else { + /* There is no "%s" in the browser command. Assume the user + * wanted the URL tacked on to the end of the command. */ + command = g_strdup_printf("%s %s", web_command, url); + } } if (g_spawn_command_line_async(command, &error) == FALSE) { @@ -615,7 +617,11 @@ void add_bookmark(GtkWidget *w, char *url) { - if (web_browser == BROWSER_NETSCAPE) { + const char *web_browser; + + web_browser = gaim_prefs_get_string("/gaim/gtk/browsers/browser"); + + if (!strcmp(web_browser, "netscape")) { char *command = g_strdup_printf("AddBookmark(%s)", url); netscape_command(command); @@ -623,7 +629,7 @@ } } -#else +#else /* _WIN32 */ /* Sooner or later, I shall support Windows clicking! */ @@ -635,5 +641,4 @@ ShellExecute(NULL, NULL, url, NULL, ".\\", 0); } - #endif /* _WIN32 */
--- a/src/dialogs.c Fri May 30 03:17:13 2003 +0000 +++ b/src/dialogs.c Fri May 30 03:25:39 2003 +0000 @@ -66,6 +66,7 @@ static GtkWidget *alias_dialog = NULL; static GtkWidget *rename_dialog = NULL; static GtkWidget *rename_bud_dialog = NULL; +static GtkWidget *fontseld = NULL; struct confirm_del { @@ -3279,7 +3280,7 @@ } save_prefs(); - do_away_menu(); + do_away_menu(NULL); return am; }
--- a/src/gaim.h Fri May 30 03:17:13 2003 +0000 +++ b/src/gaim.h Fri May 30 03:25:39 2003 +0000 @@ -198,17 +198,10 @@ extern char *opt_rcfile_arg; extern int opt_debug; -extern guint away_resend; -extern int report_idle; -extern int web_browser; extern GSList *gaim_accounts; extern GSList *message_queue; extern GSList *unread_message_queue; extern GSList *away_time_queue; -extern char web_command[2048]; -extern char sort_method[64]; -extern struct save_pos blist_pos; -extern struct window_size conv_size, buddy_chat_size; /* Functions in main.c */ extern void do_quit();
--- a/src/gaimrc.c Fri May 30 03:17:13 2003 +0000 +++ b/src/gaimrc.c Fri May 30 03:25:39 2003 +0000 @@ -72,9 +72,6 @@ #define OPT_LOG_INDIVIDUAL 0x00000040 #define OPT_LOG_CHATS 0x00000100 -/* #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 @@ -83,7 +80,6 @@ #define OPT_BLIST_NO_MT_GRP 0x00000100 #define OPT_BLIST_SHOW_WARN 0x00000200 #define OPT_BLIST_GREY_IDLERS 0x00000400 -/* define OPT_BLIST_TOMBSTONE 0x00000800 */ #define OPT_BLIST_POPUP 0x00001000 #define OPT_BLIST_SHOW_ICONS 0x00002000 #define OPT_BLIST_SHOW_OFFLINE 0x00004000 @@ -149,7 +145,6 @@ #define OPT_SOUND_CHAT_NICK 0x00040000 #define OPT_AWAY_BACK_ON_IM 0x00000002 -/* #define OPT_AWAY_TOMBSTONE 0x00000004 */ #define OPT_AWAY_AUTO 0x00000008 #define OPT_AWAY_NO_AUTO_RESP 0x00000010 #define OPT_AWAY_QUEUE 0x00000020 @@ -334,41 +329,6 @@ return -1; } -static char *escape_text2(const char *msg) -{ - char *c, *cpy; - char *woo; - int cnt = 0; - /* Assumes you have a buffer able to cary at least BUF_LEN * 2 bytes */ - - woo = malloc(strlen(msg) * 4 + 1); - cpy = g_strndup(msg, 2048); - c = cpy; - while (*c) { - switch (*c) { - case '\n': - woo[cnt++] = '<'; - woo[cnt++] = 'B'; - woo[cnt++] = 'R'; - woo[cnt++] = '>'; - break; - case '{': - case '}': - case '\\': - case '"': - woo[cnt++] = '\\'; - /* Fall through */ - default: - woo[cnt++] = *c; - } - c++; - } - woo[cnt] = '\0'; - - g_free(cpy); - return woo; -} - static void gaimrc_read_away(FILE *f) { struct parse parse_buffer; @@ -407,40 +367,6 @@ } } -static void gaimrc_write_away(FILE *f) -{ - GSList *awy = away_messages; - struct away_message *a; - - fprintf(f, "away {\n"); - - if (awy) { - while (awy) { - char *str1, *str2; - - a = (struct away_message *)awy->data; - - str1 = escape_text2(a->name); - str2 = escape_text2(a->message); - - fprintf(f, "\tmessage { %s } { %s }\n", str1, str2); - - /* escape_text2 uses malloc(), so we don't want to g_free these */ - free(str1); - free(str2); - - awy = g_slist_next(awy); - } - fprintf(f, "\tauto { %d } { %d }\n", auto_away, - g_slist_index(away_messages, default_away)); - } else { - fprintf(f, "\tmessage { %s } { %s }\n", _("boring default"), BORING_DEFAULT_AWAY_MSG); - fprintf(f, "\tauto { 0 } { 0 }\n"); - } - - fprintf(f, "}\n"); -} - /* * This is temporary, and we're using it to translate the new event * and action values into the old ones. We're also adding entries for @@ -478,39 +404,6 @@ static int pounce_act_trans_table_size = (sizeof(pounce_act_trans_table) / sizeof(*pounce_act_trans_table)); -static int -new_pounce_opts_to_old(struct gaim_pounce *pounce) -{ - struct gaim_gtkpounce_data *gtkpounce; - - int opts = 0; - int i; - - gtkpounce = GAIM_GTKPOUNCE(pounce); - - /* First, convert events */ - for (i = 0; i < pounce_evt_trans_table_size; i += 2) - { - GaimPounceEvent evt = pounce_evt_trans_table[i + 1]; - - if ((gaim_pounce_get_events(pounce) & evt) == evt) - opts |= pounce_evt_trans_table[i]; - } - - for (i = 0; i < pounce_act_trans_table_size; i += 2) - { - GaimGtkPounceAction act = pounce_act_trans_table[i + 1]; - - if ((gtkpounce->actions & act) == act) - opts |= pounce_act_trans_table[i]; - } - - if (gtkpounce->save) - opts |= 0x100; - - return opts; -} - static void old_pounce_opts_to_new(int opts, GaimPounceEvent *events, GaimGtkPounceAction *actions) @@ -576,97 +469,6 @@ } } -static void -gaimrc_write_pounce(FILE *f) -{ - GList *pnc; - struct gaim_pounce *pounce; - struct gaim_gtkpounce_data *pounce_data; - - fprintf(f, "pounce {\n"); - - for (pnc = gaim_get_pounces(); pnc != NULL; pnc = pnc->next) { - char *str1, *str2, *str3, *str4; - struct gaim_account *account; - - pounce = (struct gaim_pounce *)pnc->data; - pounce_data = GAIM_GTKPOUNCE(pounce); - account = gaim_pounce_get_pouncer(pounce); - - /* Pouncee name */ - str1 = escape_text2(gaim_pounce_get_pouncee(pounce)); - - if (pounce_data == NULL) - { - fprintf(f, "\tentry { %s } { } { } { %d } { %s } { %d } { }\n", - str1, new_pounce_opts_to_old(pounce), - account->username, account->protocol); - - free(str1); - - continue; - } - - /* Message */ - if (pounce_data->message != NULL) - str2 = escape_text2(pounce_data->message); - else { - str2 = malloc(1); - *str2 = '\0'; - } - - /* Command */ - if (pounce_data->command != NULL) - str3 = escape_text2(pounce_data->command); - else { - str3 = malloc(1); - *str3 = '\0'; - } - - /* Sound file */ - if (pounce_data->sound != NULL) - str4 = escape_text2(pounce_data->sound); - else { - str4 = malloc(1); - *str4 = '\0'; - } - - fprintf(f, "\tentry { %s } { %s } { %s } { %d } { %s } { %d } { %s }\n", - str1, str2, str3, new_pounce_opts_to_old(pounce), - account->username, account->protocol, str4); - - /* escape_text2 uses malloc(), so we don't want to g_free these */ - free(str1); - free(str2); - free(str3); - free(str4); - } - - fprintf(f, "}\n"); -} - -static void gaimrc_write_plugins(FILE *f) -{ - GList *pl; - GaimPlugin *p; - - fprintf(f, "plugins {\n"); - - for (pl = gaim_plugins_get_loaded(); pl != NULL; pl = pl->next) { - char *path; - - p = (GaimPlugin *)pl->data; - - if (p->info->type != GAIM_PLUGIN_PROTOCOL) { - path = escape_text2(p->path); - fprintf(f, "\tplugin { %s }\n", path); - free(path); - } - } - - fprintf(f, "}\n"); -} - static void gaimrc_read_plugins(FILE *f) { struct parse parse_buffer; @@ -821,66 +623,6 @@ } -static void gaimrc_write_user(FILE *f, struct gaim_account *account) -{ - char *c, *d; - int nl = 1, i; - - if (account->options & OPT_ACCT_REM_PASS) { - fprintf(f, "\t\tident { %s } { %s }\n", (d = escape_text2(account->username)), (c = escape_text2(account->password))); - free(c); - free(d); - } else { - fprintf(f, "\t\tident { %s } { }\n", (d = escape_text2(account->username))); - free(d); - } - fprintf(f, "\t\tuser_info {"); - c = account->user_info; - while (*c) { - /* This is not as silly as it looks. */ - if (*c == '\n') { - nl++; - } else { - if (nl) { - while (nl) { - fprintf(f, "\n\t\t\t"); - nl--; - } - } - fprintf(f, "%c", *c); - } - c++; - } - fprintf(f, "\n\t\t}\n"); - fprintf(f, "\t\tuser_opts { %d } { %d }\n", account->options, account->protocol); - fprintf(f, "\t\tproto_opts"); - for (i = 0; i < 7; i++) - fprintf(f, " { %s }", account->proto_opt[i]); - fprintf(f, "\n"); -#ifndef _WIN32 - fprintf(f, "\t\ticonfile { %s }\n", account->iconfile); -#else - { - /* Make sure windows dir speparators arn't swallowed up when - path is read back in from resource file */ - char* tmp=wgaim_escape_dirsep(account->iconfile); - fprintf(f, "\t\ticonfile { %s }\n", tmp); - g_free(tmp); - } -#endif - fprintf(f, "\t\talias { %s }\n", account->alias); - fprintf(f, "\t\tproxy_opts "); - if(account->gpi) { - fprintf(f, "{ %d } { %s } { %d } { %s } { %s }\n", - account->gpi->proxytype, account->gpi->proxyhost, - account->gpi->proxyport, account->gpi->proxyuser, - (c = escape_text2(account->gpi->proxypass))); - free(c); - } else { - fprintf(f, "{ %d }\n", PROXY_USE_GLOBAL); - } -} - static void gaimrc_read_users(FILE *f) { char buf[2048]; @@ -911,26 +653,6 @@ } } -static void gaimrc_write_users(FILE *f) -{ - GSList *usr = gaim_accounts; - struct gaim_account *account; - - fprintf(f, "users {\n"); - - while (usr) { - account = (struct gaim_account *)usr->data; - fprintf(f, "\tuser {\n"); - gaimrc_write_user(f, account); - - fprintf(f, "\t}\n"); - - usr = usr->next; - } - - fprintf(f, "}\n"); -} - struct replace { int old; guint *val; @@ -939,13 +661,10 @@ 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_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 }, @@ -1114,7 +833,7 @@ blist_pos.width = atoi(p->value[2]); blist_pos.height = atoi(p->value[3]); } else if (!strcmp(p->option, "sort_method")) { - strcpy(sort_method, p->value[0]); + gaim_prefs_set_string("/gaim/gtk/blist/sort_type", p->value[0]); } } @@ -1183,49 +902,6 @@ } } -static void gaimrc_write_options(FILE *f) -{ - - fprintf(f, "options {\n"); - - 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, "\tconv_placement { %u }\n", conv_placement_option); - 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 } { %u }\n", away_options, away_resend); - fprintf(f, "\tfont_face { %s }\n", gaim_prefs_get_string("/gaim/gtk/conversations/font_face")); - fprintf(f, "\tfont_size { %d }\n", gaim_prefs_get_int("/gaim/gtk/conversations/font_size")); - fprintf(f, "\tforeground { %d } { %d } { %d }\n", fgcolor.red, fgcolor.green, fgcolor.blue); - fprintf(f, "\tbackground { %d } { %d } { %d }\n", bgcolor.red, bgcolor.green, bgcolor.blue); - fprintf(f, "\treport_idle { %d }\n", report_idle); - fprintf(f, "\tweb_browser { %d }\n", web_browser); - fprintf(f, "\tweb_command { %s }\n", web_command); - fprintf(f, "\tsort_method { %s }\n", sort_method); - if (current_smiley_theme) { -#ifndef _WIN32 - fprintf(f, "\tsmiley_theme { %s }\n", current_smiley_theme->path); -#else - char* tmp=wgaim_escape_dirsep(current_smiley_theme->path); - fprintf(f, "\tsmiley_theme { %s }\n", tmp); - g_free(tmp); -#endif - } - fprintf(f, "\tblist_pos { %d } { %d } { %d } { %d }\n", - blist_pos.x, blist_pos.y, blist_pos.width, blist_pos.height); - fprintf(f, "\tconv_size { %d } { %d } { %d }\n", - 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"); -} - - static void gaimrc_read_sounds(FILE *f) { int i; @@ -1260,39 +936,6 @@ } } -static void gaimrc_write_sounds(FILE *f) -{ - int i; -#ifndef _WIN32 - char *cmd; -#endif - fprintf(f, "sound_files {\n"); - for (i = 0; i < GAIM_NUM_SOUNDS; i++) { - char *file = gaim_sound_get_event_file(i); - if (file) { -#ifndef _WIN32 - fprintf(f, "\tsound%c { %s }\n", i + 'A', file); -#else - /* Make sure windows dir speparators arn't swallowed up when - path is read back in from resource file */ - char* tmp=wgaim_escape_dirsep(file); - fprintf(f, "\tsound%c { %s }\n", i + 'A', tmp); - g_free(tmp); -#endif - } - else - fprintf(f, "\tsound%c { }\n", i + 'A'); - } -#ifndef _WIN32 - cmd = gaim_sound_get_command(); - if(cmd) - fprintf(f, "\tsound_cmd { %s }\n", cmd); - else - fprintf(f, "\tsound_cmd { }\n"); -#endif - fprintf(f, "}\n"); -} - static gboolean gaimrc_parse_proxy_uri(const char *proxy) { char *c, *d; @@ -1494,29 +1137,6 @@ } } -static void gaimrc_write_proxy(FILE *f) -{ - char *str; - - fprintf(f, "proxy {\n"); - if (proxy_info_is_from_gaimrc) { - fprintf(f, "\thost { %s }\n", global_proxy_info.proxyhost); - fprintf(f, "\tport { %d }\n", global_proxy_info.proxyport); - fprintf(f, "\ttype { %d }\n", global_proxy_info.proxytype); - fprintf(f, "\tuser { %s }\n", global_proxy_info.proxyuser); - fprintf(f, "\tpass { %s }\n", - (str = escape_text2(global_proxy_info.proxypass))); - free(str); - } else { - fprintf(f, "\thost { %s }\n", ""); - fprintf(f, "\tport { %d }\n", 0); - fprintf(f, "\ttype { %d }\n", 0); - fprintf(f, "\tuser { %s }\n", ""); - fprintf(f, "\tpass { %s }\n", ""); - } - fprintf(f, "}\n"); -} - static void set_defaults() { int i; @@ -1528,9 +1148,6 @@ 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 | @@ -1701,72 +1318,7 @@ void save_prefs() { - FILE *f; - gchar *filename; - gchar *filename_temp; - - gaim_debug(GAIM_DEBUG_INFO, "gaimrc", "Entering save_prefs\n"); - if (!prefs_initial_load) - return; - - if (is_loading_prefs) { - request_save_prefs = 1; - gaim_debug(GAIM_DEBUG_INFO, "gaimrc", - "Currently loading. Will request save.\n"); - return; - } - - if (opt_rcfile_arg) - filename = g_build_filename(opt_rcfile_arg, NULL); - else if (gaim_home_dir()) - filename = g_build_filename(gaim_home_dir(), ".gaimrc", NULL); - else - return; - filename_temp = g_strdup_printf("%s.save", filename); - - if ((f = fopen(filename_temp, "w"))) { - chmod(filename_temp, S_IRUSR | S_IWUSR); - is_saving_prefs = 1; - fprintf(f, "# .gaimrc v%d\n", 4); - gaimrc_write_users(f); - gaimrc_write_options(f); - gaimrc_write_sounds(f); - gaimrc_write_away(f); - gaimrc_write_pounce(f); - - if (gaim_plugins_enabled()) - gaimrc_write_plugins(f); - - gaimrc_write_proxy(f); - if (fprintf(f, "\n") == 1) { - fclose(f); - if (rename(filename_temp, filename) < 0) - gaim_debug(GAIM_DEBUG_ERROR, "gaimrc", - "Error renaming %s to %s\n", filename_temp, filename); - } else { - fclose(f); - gaim_notify_error(NULL, NULL, - _("Unable to Save Preferences"), - _("Gaim was unable to save your preferences. " - "Please verify that you have enough " - "free space.")); - } - is_saving_prefs = 0; - } else - gaim_debug(GAIM_DEBUG_ERROR, "gaimrc", - "Error opening %s\n", filename_temp); - - if (request_load_prefs) { - gaim_debug(GAIM_DEBUG_INFO, "gaimrc", - "Loading preferences on request.\n"); - load_prefs(); - request_load_prefs = 0; - } - - g_free(filename); - g_free(filename_temp); - - gaim_debug(GAIM_DEBUG_INFO, "gaimrc", "Exiting save_prefs\n"); + gaim_debug(GAIM_DEBUG_INFO, "gaimrc", "save_prefs() called. Rejected!\n"); }
--- a/src/gtkprefs.c Fri May 30 03:17:13 2003 +0000 +++ b/src/gtkprefs.c Fri May 30 03:25:39 2003 +0000 @@ -59,10 +59,12 @@ #define PROXYUSER 3 #define PROXYPASS 4 +/* XXX This needs to be made static after we solve the away.c mess. */ +GtkListStore *prefs_away_store = NULL; +GtkWidget *prefs_away_menu = NULL; + static GtkWidget *tree_v = NULL; -static GtkWidget *prefs_away_menu = NULL; - -static GtkListStore *prefs_away_store = NULL; + static int sound_row_sel = 0; static char *last_sound_dir = NULL; @@ -866,7 +868,6 @@ GtkWidget *ret; GtkWidget *vbox; GtkWidget *button, *warn_checkbox, *idle_checkbox; - gboolean fnd = FALSE; GList *l= NULL; GSList *sl = gaim_gtk_blist_sort_methods; ret = gtk_vbox_new(FALSE, 18); @@ -875,11 +876,10 @@ vbox = gaim_gtk_make_frame (ret, _("Buddy List Sorting")); while (sl) { - l = g_list_append(l, ((struct gaim_gtk_blist_sort_method*)sl->data)->name); - l = g_list_append(l, ((struct gaim_gtk_blist_sort_method*)sl->data)->name); - if (!fnd && !gaim_utf8_strcasecmp(((struct gaim_gtk_blist_sort_method*)sl->data)->name, sort_method)) - fnd = TRUE; - sl = sl->next; + char *name = ((struct gaim_gtk_blist_sort_method*)sl->data)->name; + + l = g_list_append(l, name); + l = g_list_append(l, name); } prefs_dropdown_from_list(vbox, _("Sorting:"), GAIM_PREF_STRING, @@ -1198,7 +1198,7 @@ gaim_notify_warning(NULL, NULL, error, NULL); } - g_strlcpy(web_command, program, sizeof(web_command)); + gaim_prefs_set_string("/gaim/gtk/browsers/command", program); /* carry on normally */ return FALSE; @@ -1270,12 +1270,16 @@ browser_entry = gtk_entry_new(); gtk_label_set_mnemonic_widget(GTK_LABEL(label), browser_entry); - if (web_browser != BROWSER_MANUAL) + + if (strcmp(gaim_prefs_get_string("/gaim/gtk/browsers/browser"), "custom")) gtk_widget_set_sensitive(hbox, FALSE); + gtk_box_pack_start (GTK_BOX (hbox), browser_entry, FALSE, FALSE, 0); - gtk_entry_set_text(GTK_ENTRY(browser_entry), web_command); - g_signal_connect(G_OBJECT(browser_entry), "focus-out-event", G_CALLBACK(manual_browser_set), NULL); + gtk_entry_set_text(GTK_ENTRY(browser_entry), + gaim_prefs_get_string("/gaim/gtk/browsers/command")); + g_signal_connect(G_OBJECT(browser_entry), "focus-out-event", + G_CALLBACK(manual_browser_set), NULL); if (browsers != NULL) { vbox = gaim_gtk_make_frame (ret, _("Browser Options")); @@ -2671,6 +2675,7 @@ /* Browsers */ gaim_prefs_add_none("/gaim/gtk/browsers"); gaim_prefs_add_bool("/gaim/gtk/browsers/new_window", FALSE); + gaim_prefs_add_string("/gaim/gtk/browsers/command", ""); gaim_prefs_add_string("/gaim/gtk/browsers/browser", "mozilla"); /* Buddy List */ @@ -2686,6 +2691,10 @@ gaim_prefs_add_bool("/gaim/gtk/blist/show_offline_buddies", FALSE); gaim_prefs_add_bool("/gaim/gtk/blist/show_warning_level", TRUE); gaim_prefs_add_string("/gaim/gtk/blist/sort_type", ""); + gaim_prefs_add_int("/gaim/gtk/blist/x", 0); + gaim_prefs_add_int("/gaim/gtk/blist/y", 0); + gaim_prefs_add_int("/gaim/gtk/blist/width", 0); + gaim_prefs_add_int("/gaim/gtk/blist/height", 0); /* Conversations */ gaim_prefs_add_none("/gaim/gtk/conversations");
--- a/src/idle.c Fri May 30 03:17:13 2003 +0000 +++ b/src/idle.c Fri May 30 03:25:39 2003 +0000 @@ -25,6 +25,7 @@ #include <time.h> #include <stdio.h> #include <unistd.h> +#include <string.h> #ifdef USE_SCREENSAVER #ifndef _WIN32 @@ -46,6 +47,7 @@ gint check_idle(gpointer data) { + const char *report_idle; struct gaim_connection *gc = data; time_t t; #ifdef USE_SCREENSAVER @@ -59,9 +61,10 @@ time(&t); + report_idle = gaim_prefs_get_string("/gaim/gtk/idle/reporting_method"); #ifdef USE_SCREENSAVER - if (report_idle == IDLE_SCREENSAVER) { + if (!strcmp(report_idle, "system")) { #ifndef _WIN32 int event_base, error_base; if (XScreenSaverQueryExtension(GDK_DISPLAY(), &event_base, &error_base)) { @@ -79,7 +82,9 @@ #endif /* USE_SCREENSAVER */ idle_time = t - gc->lastsent; - if (gaim_prefs_get_bool("/core/away/away_when_idle") && (idle_time > (60 * auto_away)) && (!gc->is_auto_away)) { + if (gaim_prefs_get_bool("/core/away/away_when_idle") && + (idle_time > (60 * auto_away)) && (!gc->is_auto_away)) { + if (!gc->away) { gaim_debug(GAIM_DEBUG_INFO, "idle", "Making %s away automatically\n", gc->username); @@ -117,9 +122,9 @@ /* If we're not reporting idle times to the server, still use Gaim usage for auto-away, but quit here so we don't report to the server */ - if (report_idle == IDLE_NONE) { + + if (!strcmp(report_idle, "none")) return TRUE; - } if (idle_time >= IDLEMARK && !gc->is_idle) { gaim_debug(GAIM_DEBUG_INFO, "idle", "Setting %s idle %d seconds\n",
--- a/src/log.c Fri May 30 03:17:13 2003 +0000 +++ b/src/log.c Fri May 30 03:25:39 2003 +0000 @@ -289,10 +289,13 @@ FILE *fd; char text[256], html[256]; - if ((logging_options & why) != why) + if (((why & OPT_LOG_MY_SIGNON) && + !gaim_prefs_get_bool("/gaim/gtk/logging/log_own_states"))) { + return; + } - if (logging_options & OPT_LOG_INDIVIDUAL) { + if (gaim_prefs_get_bool("/gaim/gtk/logging/individual_logs")) { if (why & OPT_LOG_MY_SIGNON) fd = open_system_log_file(gc ? gc->username : NULL); else @@ -418,14 +421,12 @@ } } - if (gaim_prefs_get_bool("/gaim/gtk/logging/strip_html")) { + if (gaim_prefs_get_bool("/gaim/gtk/logging/strip_html")) fprintf(fd, "---- %s ----\n", text); - } else { - if (logging_options & OPT_LOG_INDIVIDUAL) - fprintf(fd, "<HR>%s<BR><HR><BR>\n", html); - else - fprintf(fd, "%s<BR>\n", html); - } + else if (gaim_prefs_get_bool("/gaim/gtk/logging/individual_logs")) + fprintf(fd, "<HR>%s<BR><HR><BR>\n", html); + else + fprintf(fd, "%s<BR>\n", html); fclose(fd); }
--- a/src/multi.c Fri May 30 03:17:13 2003 +0000 +++ b/src/multi.c Fri May 30 03:25:39 2003 +0000 @@ -1732,7 +1732,7 @@ gaim_blist_show(); update_privacy_connections(); - do_away_menu(); + do_away_menu(NULL); do_proto_menu(); gaim_blist_add_account(gc->account);
--- a/src/server.c Fri May 30 03:17:13 2003 +0000 +++ b/src/server.c Fri May 30 03:25:39 2003 +0000 @@ -952,7 +952,9 @@ qar->sent_away = 0; away_time_queue = g_slist_append(away_time_queue, qar); } - if ((t - qar->sent_away) < away_resend) { + if ((t - qar->sent_away) < + gaim_prefs_get_int("/core/away/auto_response/sec_before_resend")) { + g_free(name); g_free(message); return;