Mercurial > pidgin
comparison src/gaimrc.c @ 4026:a997156437b6
[gaim-migrate @ 4230]
Win prefs page w/ transparency option added
committer: Tailor Script <tailor@pidgin.im>
author | Herman Bloggs <hermanator12002@yahoo.com> |
---|---|
date | Sun, 01 Dec 2002 03:08:27 +0000 |
parents | a1708fada890 |
children | a3ec0146c73e |
comparison
equal
deleted
inserted
replaced
4025:0d8b71d0d8f8 | 4026:a997156437b6 |
---|---|
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 | |
60 | 63 |
61 int report_idle; | 64 int report_idle; |
62 int web_browser; | 65 int web_browser; |
63 struct save_pos blist_pos; | 66 struct save_pos blist_pos; |
64 struct window_size conv_size, buddy_chat_size; | 67 struct window_size conv_size, buddy_chat_size; |
168 return 4; | 171 return 4; |
169 } else if (!strcmp(tag, "sound_files")) { | 172 } else if (!strcmp(tag, "sound_files")) { |
170 return 6; | 173 return 6; |
171 } else if (!strcmp(tag, "proxy")) { | 174 } else if (!strcmp(tag, "proxy")) { |
172 return 7; | 175 return 7; |
173 } | 176 } else if (!strcmp(tag, "wgaim")) { |
174 | 177 return 8; |
178 } | |
175 return -1; | 179 return -1; |
176 } | 180 } |
177 | 181 |
178 static void filter_break(char *msg) | 182 static void filter_break(char *msg) |
179 { | 183 { |
763 } else if (!strcmp(p->option, "sound_options")) { | 767 } else if (!strcmp(p->option, "sound_options")) { |
764 sound_options = atoi(p->value[0]); | 768 sound_options = atoi(p->value[0]); |
765 } else if (!strcmp(p->option, "away_options")) { | 769 } else if (!strcmp(p->option, "away_options")) { |
766 away_options = atoi(p->value[0]); | 770 away_options = atoi(p->value[0]); |
767 away_resend = atoi(p->value[1]); | 771 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 | |
768 } else if (!strcmp(p->option, "font_face")) { | 776 } else if (!strcmp(p->option, "font_face")) { |
769 g_snprintf(fontface, sizeof(fontface), "%s", p->value[0]); | 777 g_snprintf(fontface, sizeof(fontface), "%s", p->value[0]); |
770 } else if (!strcmp(p->option, "font_size")) { | 778 } else if (!strcmp(p->option, "font_size")) { |
771 fontsize = atoi(p->value[0]); | 779 fontsize = atoi(p->value[0]); |
772 } else if (!strcmp(p->option, "foreground")) { | 780 } else if (!strcmp(p->option, "foreground")) { |
871 fprintf(f, "\tim_options { %u }\n", im_options); | 879 fprintf(f, "\tim_options { %u }\n", im_options); |
872 fprintf(f, "\tchat_options { %u }\n", chat_options); | 880 fprintf(f, "\tchat_options { %u }\n", chat_options); |
873 fprintf(f, "\tfont_options { %u }\n", font_options); | 881 fprintf(f, "\tfont_options { %u }\n", font_options); |
874 fprintf(f, "\tsound_options { %u }\n", sound_options); | 882 fprintf(f, "\tsound_options { %u }\n", sound_options); |
875 fprintf(f, "\taway_options { %u } { %u }\n", away_options, away_resend); | 883 fprintf(f, "\taway_options { %u } { %u }\n", away_options, away_resend); |
876 | 884 #ifdef _WIN32 |
885 fprintf(f, "\twgaim_options { %u }\n", wgaim_options); | |
886 #endif | |
877 fprintf(f, "\tfont_face { %s }\n", fontface); | 887 fprintf(f, "\tfont_face { %s }\n", fontface); |
878 fprintf(f, "\tfont_size { %d }\n", fontsize); | 888 fprintf(f, "\tfont_size { %d }\n", fontsize); |
879 fprintf(f, "\tforeground { %d } { %d } { %d }\n", fgcolor.red, fgcolor.green, fgcolor.blue); | 889 fprintf(f, "\tforeground { %d } { %d } { %d }\n", fgcolor.red, fgcolor.green, fgcolor.blue); |
880 fprintf(f, "\tbackground { %d } { %d } { %d }\n", bgcolor.red, bgcolor.green, bgcolor.blue); | 890 fprintf(f, "\tbackground { %d } { %d } { %d }\n", bgcolor.red, bgcolor.green, bgcolor.blue); |
881 fprintf(f, "\treport_idle { %d }\n", report_idle); | 891 fprintf(f, "\treport_idle { %d }\n", report_idle); |
1118 fprintf(f, "\tpass { %s }\n", (str = escape_text2(proxypass))); | 1128 fprintf(f, "\tpass { %s }\n", (str = escape_text2(proxypass))); |
1119 free(str); | 1129 free(str); |
1120 fprintf(f, "}\n"); | 1130 fprintf(f, "}\n"); |
1121 } | 1131 } |
1122 | 1132 |
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 | |
1123 | 1164 |
1124 static void set_defaults() | 1165 static void set_defaults() |
1125 { | 1166 { |
1126 int i; | 1167 int i; |
1127 struct away_message *a; | 1168 struct away_message *a; |
1162 | 1203 |
1163 font_options = 0; | 1204 font_options = 0; |
1164 | 1205 |
1165 away_options = | 1206 away_options = |
1166 OPT_AWAY_BACK_ON_IM; | 1207 OPT_AWAY_BACK_ON_IM; |
1208 | |
1209 #ifdef _WIN32 | |
1210 wgaim_options = 0; | |
1211 #endif | |
1167 | 1212 |
1168 for (i = 0; i < NUM_SOUNDS; i++) | 1213 for (i = 0; i < NUM_SOUNDS; i++) |
1169 sound_file[i] = NULL; | 1214 sound_file[i] = NULL; |
1170 font_options = 0; | 1215 font_options = 0; |
1171 /* Enable all of the sound players that might be available. The first | 1216 /* Enable all of the sound players that might be available. The first |
1257 gaimrc_read_sounds(f); | 1302 gaimrc_read_sounds(f); |
1258 break; | 1303 break; |
1259 case 7: | 1304 case 7: |
1260 gaimrc_read_proxy(f); | 1305 gaimrc_read_proxy(f); |
1261 break; | 1306 break; |
1307 #ifdef _WIN32 | |
1308 case 8: | |
1309 gaimrc_read_wgaim(f); | |
1310 break; | |
1311 #endif | |
1262 default: | 1312 default: |
1263 /* NOOP */ | 1313 /* NOOP */ |
1264 break; | 1314 break; |
1265 } | 1315 } |
1266 } | 1316 } |
1298 gaimrc_write_pounce(f); | 1348 gaimrc_write_pounce(f); |
1299 #ifdef GAIM_PLUGINS | 1349 #ifdef GAIM_PLUGINS |
1300 gaimrc_write_plugins(f); | 1350 gaimrc_write_plugins(f); |
1301 #endif | 1351 #endif |
1302 gaimrc_write_proxy(f); | 1352 gaimrc_write_proxy(f); |
1353 #ifdef _WIN32 | |
1354 gaimrc_write_wgaim(f); | |
1355 #endif | |
1303 fclose(f); | 1356 fclose(f); |
1304 | 1357 |
1305 chmod(buf, S_IRUSR | S_IWUSR); | 1358 chmod(buf, S_IRUSR | S_IWUSR); |
1306 } | 1359 } |
1307 else | 1360 else |