comparison src/gaimrc.c @ 5671:d43a00b81d2a

[gaim-migrate @ 6088] color conversion and setting now works correctly. now maybe my eyes will stop bleeding. committer: Tailor Script <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Mon, 02 Jun 2003 17:04:46 +0000
parents 18f7a2abc3fc
children 5c5678c7b900
comparison
equal deleted inserted replaced
5670:f67742956a28 5671:d43a00b81d2a
188 static guint request_load_prefs = 0; 188 static guint request_load_prefs = 0;
189 static guint prefs_initial_load = 0; 189 static guint prefs_initial_load = 0;
190 guint proxy_info_is_from_gaimrc = 1; /* Only save proxy info if it 190 guint proxy_info_is_from_gaimrc = 1; /* Only save proxy info if it
191 * was loaded from the file 191 * was loaded from the file
192 * or otherwise explicitly requested */ 192 * or otherwise explicitly requested */
193
194 static GdkColor fgcolor;
195 static GdkColor bgcolor;
196 193
197 struct parse { 194 struct parse {
198 char option[256]; 195 char option[256];
199 char value[MAX_VALUES][4096]; 196 char value[MAX_VALUES][4096];
200 }; 197 };
927 gaim_prefs_set_string("/gaim/gtk/conversations/font_face", 924 gaim_prefs_set_string("/gaim/gtk/conversations/font_face",
928 p->value[0]); 925 p->value[0]);
929 } else if (!strcmp(p->option, "font_size")) { 926 } else if (!strcmp(p->option, "font_size")) {
930 gaim_prefs_set_int("/gaim/gtk/conversations/font_size", atoi(p->value[0])); 927 gaim_prefs_set_int("/gaim/gtk/conversations/font_size", atoi(p->value[0]));
931 } else if (!strcmp(p->option, "foreground")) { 928 } else if (!strcmp(p->option, "foreground")) {
932 char buf[8]; 929 char buf[14];
933 930
934 /*this is totally counter intuitive. why would you read in 2 before 1? 931 g_snprintf(buf, sizeof(buf), "#%04x%04x%04x",
935 *because gaim 0.6x stored it badly, and to get the intended color 932 atoi(p->value[0]), atoi(p->value[1]), atoi(p->value[2]));
936 *we have to read it in equally oddly.
937 * --luke
938 */
939
940 fgcolor.red = atoi(p->value[0]);
941 fgcolor.blue = atoi(p->value[2]);
942 fgcolor.green = atoi(p->value[1]);
943
944 g_snprintf(buf, sizeof(buf), "#%03x%03x%03x",
945 atoi(p->value[0]), atoi(p->value[2]), atoi(p->value[1]));
946 gaim_prefs_set_string("/gaim/gtk/conversations/fgcolor", buf); 933 gaim_prefs_set_string("/gaim/gtk/conversations/fgcolor", buf);
947 934
948 } else if (!strcmp(p->option, "background")) { 935 } else if (!strcmp(p->option, "background")) {
949 char buf[8]; 936 char buf[14];
950 937
951 bgcolor.red = atoi(p->value[0]); 938 g_snprintf(buf, sizeof(buf), "#%04x%04x%04x",
952 bgcolor.blue = atoi(p->value[2]); 939 atoi(p->value[0]), atoi(p->value[1]), atoi(p->value[2]));
953 bgcolor.green = atoi(p->value[1]);
954
955 g_snprintf(buf, sizeof(buf), "#%03x%03x%03x",
956 atoi(p->value[0]), atoi(p->value[2]), atoi(p->value[1]));
957 gaim_prefs_set_string("/gaim/gtk/conversations/bgcolor", buf); 940 gaim_prefs_set_string("/gaim/gtk/conversations/bgcolor", buf);
958 printf("\n\n%s\n\n",buf);
959 941
960 } else if (!strcmp(p->option, "report_idle")) { 942 } else if (!strcmp(p->option, "report_idle")) {
961 switch(atoi(p->value[0])) { 943 switch(atoi(p->value[0])) {
962 case IDLE_SCREENSAVER: 944 case IDLE_SCREENSAVER:
963 gaim_prefs_set_string("/gaim/gtk/idle/reporting_method", 945 gaim_prefs_set_string("/gaim/gtk/idle/reporting_method",