Mercurial > ~mikael > mcabber > hg
comparison mcabber/src/screen.c @ 279:f5dd437c057b
Rewrite the settings system
Settings now use glibc library, and can be used for aliases and bindings.
author | Mikael Berthe <mikael@lilotux.net> |
---|---|
date | Tue, 05 Jul 2005 23:50:50 +0100 |
parents | 627925d885de |
children | f562b9af2de7 |
comparison
equal
deleted
inserted
replaced
278:a7af5517b453 | 279:f5dd437c057b |
---|---|
12 #include "hbuf.h" | 12 #include "hbuf.h" |
13 #include "commands.h" | 13 #include "commands.h" |
14 #include "compl.h" | 14 #include "compl.h" |
15 #include "roster.h" | 15 #include "roster.h" |
16 #include "histolog.h" | 16 #include "histolog.h" |
17 #include "parsecfg.h" | 17 #include "settings.h" |
18 #include "utils.h" | 18 #include "utils.h" |
19 #include "list.h" | 19 #include "list.h" |
20 | 20 |
21 #define window_entry(n) list_entry(n, window_entry_t, list) | 21 #define window_entry(n) list_entry(n, window_entry_t, list) |
22 | 22 |
143 NULL | 143 NULL |
144 }; | 144 }; |
145 | 145 |
146 char *tmp = malloc(1024); | 146 char *tmp = malloc(1024); |
147 char *color; | 147 char *color; |
148 char *background = cfg_read("color_background"); | 148 char *background = settings_opt_get("color_background"); |
149 char *backselected = cfg_read("color_backselected"); | 149 char *backselected = settings_opt_get("color_backselected"); |
150 int i = 0; | 150 int i = 0; |
151 | 151 |
152 // Default values | 152 // Default values |
153 if (!background) background = "blue"; | 153 if (!background) background = "blue"; |
154 if (!backselected) backselected = "cyan"; | 154 if (!backselected) backselected = "cyan"; |
155 | 155 |
156 while (colors[i]) { | 156 while (colors[i]) { |
157 sprintf(tmp, "color_%s", colors[i]); | 157 sprintf(tmp, "color_%s", colors[i]); |
158 color = cfg_read(tmp); | 158 color = settings_opt_get(tmp); |
159 | 159 |
160 switch (i + 1) { | 160 switch (i + 1) { |
161 case 1: | 161 case 1: |
162 init_pair(1, COLOR_BLACK, COLOR_WHITE); | 162 init_pair(1, COLOR_BLACK, COLOR_WHITE); |
163 break; | 163 break; |