Mercurial > pidgin
comparison src/gaimrc.c @ 4042:a3ec0146c73e
[gaim-migrate @ 4250]
undo winprefs/transparency
committer: Tailor Script <tailor@pidgin.im>
author | Herman Bloggs <hermanator12002@yahoo.com> |
---|---|
date | Wed, 04 Dec 2002 00:07:11 +0000 |
parents | a997156437b6 |
children | 198a5edcb1c5 |
comparison
equal
deleted
inserted
replaced
4041:3a36ec242415 | 4042:a3ec0146c73e |
---|---|
55 guint chat_options; | 55 guint chat_options; |
56 guint font_options; | 56 guint font_options; |
57 guint sound_options; | 57 guint sound_options; |
58 guint away_options; | 58 guint away_options; |
59 guint away_resend; | 59 guint away_resend; |
60 #ifdef _WIN32 | |
61 guint wgaim_options; | |
62 #endif | |
63 | 60 |
64 int report_idle; | 61 int report_idle; |
65 int web_browser; | 62 int web_browser; |
66 struct save_pos blist_pos; | 63 struct save_pos blist_pos; |
67 struct window_size conv_size, buddy_chat_size; | 64 struct window_size conv_size, buddy_chat_size; |
767 } else if (!strcmp(p->option, "sound_options")) { | 764 } else if (!strcmp(p->option, "sound_options")) { |
768 sound_options = atoi(p->value[0]); | 765 sound_options = atoi(p->value[0]); |
769 } else if (!strcmp(p->option, "away_options")) { | 766 } else if (!strcmp(p->option, "away_options")) { |
770 away_options = atoi(p->value[0]); | 767 away_options = atoi(p->value[0]); |
771 away_resend = atoi(p->value[1]); | 768 away_resend = atoi(p->value[1]); |
772 #ifdef _WIN32 | |
773 } else if(!strcmp(p->option, "wgaim_options")) { | |
774 wgaim_options = atoi(p->value[0]); | |
775 #endif | |
776 } else if (!strcmp(p->option, "font_face")) { | 769 } else if (!strcmp(p->option, "font_face")) { |
777 g_snprintf(fontface, sizeof(fontface), "%s", p->value[0]); | 770 g_snprintf(fontface, sizeof(fontface), "%s", p->value[0]); |
778 } else if (!strcmp(p->option, "font_size")) { | 771 } else if (!strcmp(p->option, "font_size")) { |
779 fontsize = atoi(p->value[0]); | 772 fontsize = atoi(p->value[0]); |
780 } else if (!strcmp(p->option, "foreground")) { | 773 } else if (!strcmp(p->option, "foreground")) { |
879 fprintf(f, "\tim_options { %u }\n", im_options); | 872 fprintf(f, "\tim_options { %u }\n", im_options); |
880 fprintf(f, "\tchat_options { %u }\n", chat_options); | 873 fprintf(f, "\tchat_options { %u }\n", chat_options); |
881 fprintf(f, "\tfont_options { %u }\n", font_options); | 874 fprintf(f, "\tfont_options { %u }\n", font_options); |
882 fprintf(f, "\tsound_options { %u }\n", sound_options); | 875 fprintf(f, "\tsound_options { %u }\n", sound_options); |
883 fprintf(f, "\taway_options { %u } { %u }\n", away_options, away_resend); | 876 fprintf(f, "\taway_options { %u } { %u }\n", away_options, away_resend); |
884 #ifdef _WIN32 | |
885 fprintf(f, "\twgaim_options { %u }\n", wgaim_options); | |
886 #endif | |
887 fprintf(f, "\tfont_face { %s }\n", fontface); | 877 fprintf(f, "\tfont_face { %s }\n", fontface); |
888 fprintf(f, "\tfont_size { %d }\n", fontsize); | 878 fprintf(f, "\tfont_size { %d }\n", fontsize); |
889 fprintf(f, "\tforeground { %d } { %d } { %d }\n", fgcolor.red, fgcolor.green, fgcolor.blue); | 879 fprintf(f, "\tforeground { %d } { %d } { %d }\n", fgcolor.red, fgcolor.green, fgcolor.blue); |
890 fprintf(f, "\tbackground { %d } { %d } { %d }\n", bgcolor.red, bgcolor.green, bgcolor.blue); | 880 fprintf(f, "\tbackground { %d } { %d } { %d }\n", bgcolor.red, bgcolor.green, bgcolor.blue); |
891 fprintf(f, "\treport_idle { %d }\n", report_idle); | 881 fprintf(f, "\treport_idle { %d }\n", report_idle); |
1128 fprintf(f, "\tpass { %s }\n", (str = escape_text2(proxypass))); | 1118 fprintf(f, "\tpass { %s }\n", (str = escape_text2(proxypass))); |
1129 free(str); | 1119 free(str); |
1130 fprintf(f, "}\n"); | 1120 fprintf(f, "}\n"); |
1131 } | 1121 } |
1132 | 1122 |
1133 #ifdef _WIN32 | |
1134 static void gaimrc_read_wgaim(FILE *f) | |
1135 { | |
1136 char buf[2048]; | |
1137 struct parse parse_buffer; | |
1138 struct parse *p; | |
1139 | |
1140 buf[0] = 0; | |
1141 | |
1142 while (buf[0] != '}') { | |
1143 if (buf[0] == '#') | |
1144 continue; | |
1145 | |
1146 if (!fgets(buf, sizeof(buf), f)) | |
1147 return; | |
1148 | |
1149 p = parse_line(buf, &parse_buffer); | |
1150 | |
1151 if (!strcmp(p->option, "imalpha")) { | |
1152 wgaim_set_imalpha(atoi(p->value[0])); | |
1153 } | |
1154 } | |
1155 } | |
1156 | |
1157 static void gaimrc_write_wgaim(FILE *f) | |
1158 { | |
1159 fprintf(f, "wgaim {\n"); | |
1160 fprintf(f, "\timalpha { %d }\n", wgaim_get_imalpha()); | |
1161 fprintf(f, "}\n"); | |
1162 } | |
1163 #endif | |
1164 | |
1165 static void set_defaults() | 1123 static void set_defaults() |
1166 { | 1124 { |
1167 int i; | 1125 int i; |
1168 struct away_message *a; | 1126 struct away_message *a; |
1169 | 1127 |
1203 | 1161 |
1204 font_options = 0; | 1162 font_options = 0; |
1205 | 1163 |
1206 away_options = | 1164 away_options = |
1207 OPT_AWAY_BACK_ON_IM; | 1165 OPT_AWAY_BACK_ON_IM; |
1208 | |
1209 #ifdef _WIN32 | |
1210 wgaim_options = 0; | |
1211 #endif | |
1212 | 1166 |
1213 for (i = 0; i < NUM_SOUNDS; i++) | 1167 for (i = 0; i < NUM_SOUNDS; i++) |
1214 sound_file[i] = NULL; | 1168 sound_file[i] = NULL; |
1215 font_options = 0; | 1169 font_options = 0; |
1216 /* Enable all of the sound players that might be available. The first | 1170 /* Enable all of the sound players that might be available. The first |
1302 gaimrc_read_sounds(f); | 1256 gaimrc_read_sounds(f); |
1303 break; | 1257 break; |
1304 case 7: | 1258 case 7: |
1305 gaimrc_read_proxy(f); | 1259 gaimrc_read_proxy(f); |
1306 break; | 1260 break; |
1307 #ifdef _WIN32 | |
1308 case 8: | |
1309 gaimrc_read_wgaim(f); | |
1310 break; | |
1311 #endif | |
1312 default: | 1261 default: |
1313 /* NOOP */ | 1262 /* NOOP */ |
1314 break; | 1263 break; |
1315 } | 1264 } |
1316 } | 1265 } |
1348 gaimrc_write_pounce(f); | 1297 gaimrc_write_pounce(f); |
1349 #ifdef GAIM_PLUGINS | 1298 #ifdef GAIM_PLUGINS |
1350 gaimrc_write_plugins(f); | 1299 gaimrc_write_plugins(f); |
1351 #endif | 1300 #endif |
1352 gaimrc_write_proxy(f); | 1301 gaimrc_write_proxy(f); |
1353 #ifdef _WIN32 | |
1354 gaimrc_write_wgaim(f); | |
1355 #endif | |
1356 fclose(f); | 1302 fclose(f); |
1357 | 1303 |
1358 chmod(buf, S_IRUSR | S_IWUSR); | 1304 chmod(buf, S_IRUSR | S_IWUSR); |
1359 } | 1305 } |
1360 else | 1306 else |