Mercurial > geeqie
annotate src/rcfile.c @ 223:73efc1ba150f
Setting no limit size to trash directory is now possible using zero as value.
A tooltip was added to the spinner to inform the user of this possibility.
When 0 is set, no remaining/free space check occurs.
Default size of the trash was set to a 128M and maximum size is now 2048MB, which
is more conform to today's standards.
The delete dialog now displays more information:
- if external command will be used
- if safe delete is on, max size and path to the trash
- if safe delete is off
author | zas_ |
---|---|
date | Thu, 03 Apr 2008 08:51:32 +0000 |
parents | 77f1bcc6c161 |
children | 3c89da4aef95 |
rev | line source |
---|---|
1 | 1 /* |
196 | 2 * Geeqie |
113
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
41
diff
changeset
|
3 * (C) 2006 John Ellis |
1 | 4 * |
5 * Author: John Ellis | |
6 * | |
9 | 7 * This software is released under the GNU General Public License (GNU GPL). |
8 * Please read the included file COPYING for more information. | |
9 * This software comes with no warranty of any kind, use at your own risk! | |
1 | 10 */ |
11 | |
9 | 12 |
1 | 13 #include "gqview.h" |
9 | 14 #include "rcfile.h" |
1 | 15 |
9 | 16 #include "filelist.h" |
17 #include "slideshow.h" | |
18 #include "ui_fileops.h" | |
222
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
218
diff
changeset
|
19 #include "bar_exif.h" |
9 | 20 |
1 | 21 |
22 /* | |
23 *----------------------------------------------------------------------------- | |
24 * line write/parse routines (private) | |
25 *----------------------------------------------------------------------------- | |
26 */ | |
217 | 27 |
28 /* | |
29 returns text without quotes or NULL for empty or broken string | |
30 any text up to first '"' is skipped | |
31 tail is set to point at the char after the second '"' | |
32 or at the ending \0 | |
33 | |
34 */ | |
1 | 35 |
217 | 36 gchar *quoted_value(const gchar *text, const gchar **tail) |
1 | 37 { |
9 | 38 const gchar *ptr; |
1 | 39 gint c = 0; |
40 gint l = strlen(text); | |
210
3fa93ab9b119
Improve escaping and quoting of strings saved in rc files.
zas_
parents:
209
diff
changeset
|
41 gchar *retval = NULL; |
3fa93ab9b119
Improve escaping and quoting of strings saved in rc files.
zas_
parents:
209
diff
changeset
|
42 |
217 | 43 if (tail) *tail = text; |
44 | |
210
3fa93ab9b119
Improve escaping and quoting of strings saved in rc files.
zas_
parents:
209
diff
changeset
|
45 if (l == 0) return retval; |
1 | 46 |
47 while (c < l && text[c] !='"') c++; | |
48 if (text[c] == '"') | |
49 { | |
9 | 50 gint e; |
1 | 51 c++; |
52 ptr = text + c; | |
9 | 53 e = c; |
210
3fa93ab9b119
Improve escaping and quoting of strings saved in rc files.
zas_
parents:
209
diff
changeset
|
54 while (e < l) |
3fa93ab9b119
Improve escaping and quoting of strings saved in rc files.
zas_
parents:
209
diff
changeset
|
55 { |
3fa93ab9b119
Improve escaping and quoting of strings saved in rc files.
zas_
parents:
209
diff
changeset
|
56 if (text[e-1] != '\\' && text[e] == '"') break; |
3fa93ab9b119
Improve escaping and quoting of strings saved in rc files.
zas_
parents:
209
diff
changeset
|
57 e++; |
3fa93ab9b119
Improve escaping and quoting of strings saved in rc files.
zas_
parents:
209
diff
changeset
|
58 } |
9 | 59 if (text[e] == '"') |
1 | 60 { |
9 | 61 if (e - c > 0) |
1 | 62 { |
210
3fa93ab9b119
Improve escaping and quoting of strings saved in rc files.
zas_
parents:
209
diff
changeset
|
63 gchar *substring = g_strndup(ptr, e - c); |
3fa93ab9b119
Improve escaping and quoting of strings saved in rc files.
zas_
parents:
209
diff
changeset
|
64 |
3fa93ab9b119
Improve escaping and quoting of strings saved in rc files.
zas_
parents:
209
diff
changeset
|
65 if (substring) |
3fa93ab9b119
Improve escaping and quoting of strings saved in rc files.
zas_
parents:
209
diff
changeset
|
66 { |
3fa93ab9b119
Improve escaping and quoting of strings saved in rc files.
zas_
parents:
209
diff
changeset
|
67 retval = g_strcompress(substring); |
3fa93ab9b119
Improve escaping and quoting of strings saved in rc files.
zas_
parents:
209
diff
changeset
|
68 g_free(substring); |
3fa93ab9b119
Improve escaping and quoting of strings saved in rc files.
zas_
parents:
209
diff
changeset
|
69 } |
1 | 70 } |
71 } | |
217 | 72 if (tail) *tail = text + e + 1; |
1 | 73 } |
74 else | |
75 /* for compatibility with older formats (<0.3.7) | |
76 * read a line without quotes too */ | |
77 { | |
78 c = 0; | |
79 while (c < l && text[c] !=' ' && text[c] !=8 && text[c] != '\n') c++; | |
80 if (c != 0) | |
81 { | |
210
3fa93ab9b119
Improve escaping and quoting of strings saved in rc files.
zas_
parents:
209
diff
changeset
|
82 retval = g_strndup(text, c); |
1 | 83 } |
217 | 84 if (tail) *tail = text + c; |
1 | 85 } |
86 | |
210
3fa93ab9b119
Improve escaping and quoting of strings saved in rc files.
zas_
parents:
209
diff
changeset
|
87 return retval; |
3fa93ab9b119
Improve escaping and quoting of strings saved in rc files.
zas_
parents:
209
diff
changeset
|
88 } |
3fa93ab9b119
Improve escaping and quoting of strings saved in rc files.
zas_
parents:
209
diff
changeset
|
89 |
3fa93ab9b119
Improve escaping and quoting of strings saved in rc files.
zas_
parents:
209
diff
changeset
|
90 gchar *escquote_value(const gchar *text) |
3fa93ab9b119
Improve escaping and quoting of strings saved in rc files.
zas_
parents:
209
diff
changeset
|
91 { |
3fa93ab9b119
Improve escaping and quoting of strings saved in rc files.
zas_
parents:
209
diff
changeset
|
92 gchar *e; |
3fa93ab9b119
Improve escaping and quoting of strings saved in rc files.
zas_
parents:
209
diff
changeset
|
93 gchar *retval; |
3fa93ab9b119
Improve escaping and quoting of strings saved in rc files.
zas_
parents:
209
diff
changeset
|
94 |
217 | 95 if (!text) return g_strdup("\"\""); |
210
3fa93ab9b119
Improve escaping and quoting of strings saved in rc files.
zas_
parents:
209
diff
changeset
|
96 |
3fa93ab9b119
Improve escaping and quoting of strings saved in rc files.
zas_
parents:
209
diff
changeset
|
97 e = g_strescape(text, ""); |
3fa93ab9b119
Improve escaping and quoting of strings saved in rc files.
zas_
parents:
209
diff
changeset
|
98 if (e) |
3fa93ab9b119
Improve escaping and quoting of strings saved in rc files.
zas_
parents:
209
diff
changeset
|
99 { |
3fa93ab9b119
Improve escaping and quoting of strings saved in rc files.
zas_
parents:
209
diff
changeset
|
100 gchar *retval = g_strdup_printf("\"%s\"", e); |
3fa93ab9b119
Improve escaping and quoting of strings saved in rc files.
zas_
parents:
209
diff
changeset
|
101 g_free(e); |
3fa93ab9b119
Improve escaping and quoting of strings saved in rc files.
zas_
parents:
209
diff
changeset
|
102 return retval; |
3fa93ab9b119
Improve escaping and quoting of strings saved in rc files.
zas_
parents:
209
diff
changeset
|
103 } |
217 | 104 return g_strdup("\"\""); |
1 | 105 } |
106 | |
107 static void write_char_option(FILE *f, gchar *label, gchar *text) | |
108 { | |
210
3fa93ab9b119
Improve escaping and quoting of strings saved in rc files.
zas_
parents:
209
diff
changeset
|
109 gchar *escval = escquote_value(text); |
3fa93ab9b119
Improve escaping and quoting of strings saved in rc files.
zas_
parents:
209
diff
changeset
|
110 |
217 | 111 fprintf(f,"%s: %s\n", label, escval); |
112 g_free(escval); | |
1 | 113 } |
114 | |
115 static gchar *read_char_option(FILE *f, gchar *option, gchar *label, gchar *value, gchar *text) | |
116 { | |
9 | 117 if (strcasecmp(option, label) == 0) |
1 | 118 { |
119 g_free(text); | |
217 | 120 text = quoted_value(value, NULL); |
1 | 121 } |
122 return text; | |
123 } | |
124 | |
208
fa0e05f985c3
set user-defined color as image background - patch by Laurent MONIN
nadvornik
parents:
196
diff
changeset
|
125 static void write_color_option(FILE *f, gchar *label, GdkColor *color) |
fa0e05f985c3
set user-defined color as image background - patch by Laurent MONIN
nadvornik
parents:
196
diff
changeset
|
126 { |
fa0e05f985c3
set user-defined color as image background - patch by Laurent MONIN
nadvornik
parents:
196
diff
changeset
|
127 if (color) |
fa0e05f985c3
set user-defined color as image background - patch by Laurent MONIN
nadvornik
parents:
196
diff
changeset
|
128 { |
fa0e05f985c3
set user-defined color as image background - patch by Laurent MONIN
nadvornik
parents:
196
diff
changeset
|
129 gchar *colorstring = gdk_color_to_string (color); |
fa0e05f985c3
set user-defined color as image background - patch by Laurent MONIN
nadvornik
parents:
196
diff
changeset
|
130 |
217 | 131 write_char_option(f, label, colorstring); |
208
fa0e05f985c3
set user-defined color as image background - patch by Laurent MONIN
nadvornik
parents:
196
diff
changeset
|
132 g_free(colorstring); |
fa0e05f985c3
set user-defined color as image background - patch by Laurent MONIN
nadvornik
parents:
196
diff
changeset
|
133 } |
fa0e05f985c3
set user-defined color as image background - patch by Laurent MONIN
nadvornik
parents:
196
diff
changeset
|
134 else |
fa0e05f985c3
set user-defined color as image background - patch by Laurent MONIN
nadvornik
parents:
196
diff
changeset
|
135 fprintf(f,"%s: \n", label); |
fa0e05f985c3
set user-defined color as image background - patch by Laurent MONIN
nadvornik
parents:
196
diff
changeset
|
136 } |
fa0e05f985c3
set user-defined color as image background - patch by Laurent MONIN
nadvornik
parents:
196
diff
changeset
|
137 |
fa0e05f985c3
set user-defined color as image background - patch by Laurent MONIN
nadvornik
parents:
196
diff
changeset
|
138 static GdkColor *read_color_option(FILE *f, gchar *option, gchar *label, gchar *value, GdkColor *color) |
fa0e05f985c3
set user-defined color as image background - patch by Laurent MONIN
nadvornik
parents:
196
diff
changeset
|
139 { |
fa0e05f985c3
set user-defined color as image background - patch by Laurent MONIN
nadvornik
parents:
196
diff
changeset
|
140 if (strcasecmp(option, label) == 0) |
fa0e05f985c3
set user-defined color as image background - patch by Laurent MONIN
nadvornik
parents:
196
diff
changeset
|
141 { |
217 | 142 gchar *colorstr = quoted_value(value, NULL); |
143 if (colorstr) gdk_color_parse(colorstr, color); | |
144 g_free(colorstr); | |
208
fa0e05f985c3
set user-defined color as image background - patch by Laurent MONIN
nadvornik
parents:
196
diff
changeset
|
145 } |
fa0e05f985c3
set user-defined color as image background - patch by Laurent MONIN
nadvornik
parents:
196
diff
changeset
|
146 return color; |
fa0e05f985c3
set user-defined color as image background - patch by Laurent MONIN
nadvornik
parents:
196
diff
changeset
|
147 } |
fa0e05f985c3
set user-defined color as image background - patch by Laurent MONIN
nadvornik
parents:
196
diff
changeset
|
148 |
fa0e05f985c3
set user-defined color as image background - patch by Laurent MONIN
nadvornik
parents:
196
diff
changeset
|
149 |
1 | 150 static void write_int_option(FILE *f, gchar *label, gint n) |
151 { | |
152 fprintf(f,"%s: %d\n\n", label, n); | |
153 } | |
154 | |
155 static gint read_int_option(FILE *f, gchar *option, gchar *label, gchar *value, gint n) | |
156 { | |
9 | 157 if (strcasecmp(option, label) == 0) |
158 { | |
159 n = strtol(value, NULL, 10); | |
160 } | |
161 return n; | |
162 } | |
163 | |
164 static void write_int_unit_option(FILE *f, gchar *label, gint n, gint subunits) | |
165 { | |
166 gint l, r; | |
167 | |
168 if (subunits > 0) | |
169 { | |
170 l = n / subunits; | |
171 r = n % subunits; | |
172 } | |
173 else | |
1 | 174 { |
9 | 175 l = n; |
176 r = 0; | |
177 } | |
178 | |
179 fprintf(f,"%s: %d.%d\n\n", label, l, r); | |
180 } | |
181 | |
182 static gint read_int_unit_option(FILE *f, gchar *option, gchar *label, gchar *value, gint n, gint subunits) | |
183 { | |
184 if (strcasecmp(option, label) == 0) | |
185 { | |
186 gint l, r; | |
187 gchar *ptr; | |
188 | |
189 ptr = value; | |
190 while (*ptr != '\0' && *ptr != '.') ptr++; | |
191 if (*ptr == '.') | |
192 { | |
193 *ptr = '\0'; | |
194 l = strtol(value, NULL, 10); | |
195 *ptr = '.'; | |
196 ptr++; | |
197 r = strtol(ptr, NULL, 10); | |
198 } | |
199 else | |
200 { | |
201 l = strtol(value, NULL, 10); | |
202 r = 0; | |
203 } | |
204 | |
205 n = l * subunits + r; | |
1 | 206 } |
207 return n; | |
208 } | |
209 | |
210 static void write_bool_option(FILE *f, gchar *label, gint n) | |
211 { | |
212 fprintf(f,"%s: ", label); | |
213 if (n) fprintf(f,"true\n"); else fprintf(f,"false\n"); | |
214 fprintf(f,"\n"); | |
215 } | |
216 | |
217 static gint read_bool_option(FILE *f, gchar *option, gchar *label, gchar *value, gint n) | |
218 { | |
9 | 219 if (strcasecmp(option, label) == 0) |
1 | 220 { |
9 | 221 if (strcasecmp(value, "true") == 0) |
1 | 222 n = TRUE; |
223 else | |
224 n = FALSE; | |
225 } | |
226 return n; | |
227 } | |
228 | |
229 /* | |
230 *----------------------------------------------------------------------------- | |
231 * save configuration (public) | |
232 *----------------------------------------------------------------------------- | |
233 */ | |
234 | |
9 | 235 void save_options(void) |
1 | 236 { |
237 FILE *f; | |
238 gchar *rc_path; | |
9 | 239 gchar *rc_pathl; |
1 | 240 gint i; |
241 | |
9 | 242 rc_path = g_strconcat(homedir(), "/", GQVIEW_RC_DIR, "/", RC_FILE_NAME, NULL); |
1 | 243 |
9 | 244 rc_pathl = path_from_utf8(rc_path); |
245 f = fopen(rc_pathl, "w"); | |
246 g_free(rc_pathl); | |
1 | 247 if (!f) |
248 { | |
9 | 249 gchar *buf; |
250 | |
251 buf = g_strdup_printf(_("error saving config file: %s\n"), rc_path); | |
252 print_term(buf); | |
253 g_free(buf); | |
254 | |
1 | 255 g_free(rc_path); |
256 return; | |
257 } | |
258 | |
259 fprintf(f,"######################################################################\n"); | |
196 | 260 fprintf(f,"# Geeqie config file version %7s #\n", VERSION); |
1 | 261 fprintf(f,"######################################################################\n"); |
262 fprintf(f,"\n"); | |
41
6281cc38e5ca
Wed Apr 27 15:17:57 2005 John Ellis <johne@verizon.net>
gqview
parents:
14
diff
changeset
|
263 fprintf(f,"# Note: This file is autogenerated. Options can be changed here,\n"); |
6281cc38e5ca
Wed Apr 27 15:17:57 2005 John Ellis <johne@verizon.net>
gqview
parents:
14
diff
changeset
|
264 fprintf(f,"# but user comments and formatting will be lost.\n"); |
6281cc38e5ca
Wed Apr 27 15:17:57 2005 John Ellis <johne@verizon.net>
gqview
parents:
14
diff
changeset
|
265 fprintf(f,"\n"); |
1 | 266 fprintf(f,"##### General Options #####\n\n"); |
267 | |
9 | 268 write_int_option(f, "layout_style", layout_style); |
269 write_char_option(f, "layout_order", layout_order); | |
270 fprintf(f,"\n"); | |
271 write_bool_option(f, "layout_view_as_icons", layout_view_icons); | |
272 write_bool_option(f, "layout_view_as_tree", layout_view_tree); | |
273 write_bool_option(f, "show_icon_names", show_icon_names); | |
274 fprintf(f,"\n"); | |
275 | |
276 write_bool_option(f, "tree_descend_folders", tree_descend_subdirs); | |
277 write_bool_option(f, "lazy_image_sync", lazy_image_sync); | |
278 write_bool_option(f, "update_on_time_change", update_on_time_change); | |
279 write_bool_option(f, "exif_auto_rotate", exif_rotate_enable); | |
280 fprintf(f,"\n"); | |
281 | |
1 | 282 write_bool_option(f, "enable_startup_path", startup_path_enable); |
283 write_char_option(f, "startup_path", startup_path); | |
284 fprintf(f,"\n"); | |
285 | |
286 fprintf(f,"zoom_mode: "); | |
287 if (zoom_mode == ZOOM_RESET_ORIGINAL) fprintf(f,"original\n"); | |
288 if (zoom_mode == ZOOM_RESET_FIT_WINDOW) fprintf(f,"fit\n"); | |
289 if (zoom_mode == ZOOM_RESET_NONE) fprintf(f,"dont_change\n"); | |
9 | 290 |
291 write_bool_option(f, "two_pass_scaling", two_pass_zoom); | |
292 | |
293 write_bool_option(f, "zoom_to_fit_allow_expand", zoom_to_fit_expands); | |
1 | 294 fprintf(f,"\n"); |
295 | |
296 write_bool_option(f, "fit_window_to_image", fit_window); | |
297 write_bool_option(f, "limit_window_size", limit_window_size); | |
298 write_int_option(f, "max_window_size", max_window_size); | |
209
ad78ad18523a
configurable frame around image - geeqie_autofit_maxsize.patch by Laurent MONIN
nadvornik
parents:
208
diff
changeset
|
299 write_bool_option(f, "limit_autofit_size", limit_autofit_size); |
ad78ad18523a
configurable frame around image - geeqie_autofit_maxsize.patch by Laurent MONIN
nadvornik
parents:
208
diff
changeset
|
300 write_int_option(f, "max_autofit_size", max_autofit_size); |
1 | 301 fprintf(f,"\n"); |
302 | |
303 write_bool_option(f, "progressive_keyboard_scrolling", progressive_key_scrolling); | |
9 | 304 write_int_option(f, "scroll_reset_method", scroll_reset_method); |
1 | 305 fprintf(f,"\n"); |
306 | |
3 | 307 write_bool_option(f, "enable_thumbnails", thumbnails_enabled); |
1 | 308 write_int_option(f, "thumbnail_width", thumb_max_width); |
309 write_int_option(f, "thumbnail_height", thumb_max_height); | |
310 write_bool_option(f, "cache_thumbnails", enable_thumb_caching); | |
9 | 311 write_bool_option(f, "cache_thumbnails_into_dirs", enable_thumb_dirs); |
14
25335c62cd9b
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
9
diff
changeset
|
312 write_bool_option(f, "thumbnail_fast", thumbnail_fast); |
1 | 313 write_bool_option(f, "use_xvpics_thumbnails", use_xvpics_thumbnails); |
9 | 314 write_bool_option(f, "thumbnail_spec_standard", thumbnail_spec_standard); |
315 fprintf(f,"\n"); | |
316 | |
317 write_bool_option(f, "local_metadata", enable_metadata_dirs); | |
318 fprintf(f,"\n"); | |
319 | |
320 write_int_option(f, "sort_method", (gint)file_sort_method); | |
321 write_bool_option(f, "sort_ascending", file_sort_ascending); | |
322 write_bool_option(f, "sort_case_sensitive", file_sort_case_sensitive); | |
1 | 323 fprintf(f,"\n"); |
324 | |
325 write_bool_option(f, "confirm_delete", confirm_delete); | |
9 | 326 write_bool_option(f, "enable_delete_key", enable_delete_key); |
327 write_bool_option(f, "safe_delete", safe_delete_enable); | |
328 write_char_option(f, "safe_delete_path", safe_delete_path); | |
329 write_int_option(f, "safe_delete_size", safe_delete_size); | |
1 | 330 fprintf(f,"\n"); |
331 write_bool_option(f, "tools_float", tools_float); | |
332 write_bool_option(f, "tools_hidden", tools_hidden); | |
333 write_bool_option(f, "restore_tool_state", restore_tool); | |
334 | |
9 | 335 write_bool_option(f, "toolbar_hidden", toolbar_hidden); |
336 | |
4 | 337 write_bool_option(f, "mouse_wheel_scrolls", mousewheel_scrolls); |
9 | 338 write_bool_option(f, "in_place_rename", enable_in_place_rename); |
339 | |
340 write_int_option(f, "open_recent_max", recent_list_max); | |
341 | |
342 write_int_option(f, "image_cache_size_max", tile_cache_max); | |
343 | |
344 write_int_option(f, "thumbnail_quality", thumbnail_quality); | |
345 write_int_option(f, "zoom_quality", zoom_quality); | |
346 write_int_option(f, "dither_quality", dither_quality); | |
347 | |
348 write_int_option(f, "zoom_increment", zoom_increment); | |
349 | |
350 write_bool_option(f, "enable_read_ahead", enable_read_ahead); | |
351 | |
352 write_bool_option(f, "display_dialogs_under_mouse", place_dialogs_under_mouse); | |
353 | |
208
fa0e05f985c3
set user-defined color as image background - patch by Laurent MONIN
nadvornik
parents:
196
diff
changeset
|
354 write_bool_option(f, "user_specified_window_background", user_specified_window_background); |
fa0e05f985c3
set user-defined color as image background - patch by Laurent MONIN
nadvornik
parents:
196
diff
changeset
|
355 write_color_option(f, "window_background_color", &window_background_color); |
9 | 356 |
357 write_int_option(f, "fullscreen_screen", fullscreen_screen); | |
358 write_bool_option(f, "fullscreen_clean_flip", fullscreen_clean_flip); | |
359 write_bool_option(f, "fullscreen_disable_saver", fullscreen_disable_saver); | |
360 write_bool_option(f, "fullscreen_above", fullscreen_above); | |
218
f4a0555794a9
Customizable info overlay in fullscreen, based on the patch posted to gqview-devel list by Timo on 2007-09-10.
zas_
parents:
217
diff
changeset
|
361 write_bool_option(f, "show_fullscreen_info", show_fullscreen_info); |
f4a0555794a9
Customizable info overlay in fullscreen, based on the patch posted to gqview-devel list by Timo on 2007-09-10.
zas_
parents:
217
diff
changeset
|
362 write_char_option(f, "fullscreen_info", fullscreen_info); |
9 | 363 |
364 write_int_option(f, "custom_similarity_threshold", dupe_custom_threshold); | |
4 | 365 |
1 | 366 fprintf(f,"\n##### Slideshow Options #####\n\n"); |
367 | |
9 | 368 write_int_unit_option(f, "slideshow_delay", slideshow_delay, SLIDESHOW_SUBSECOND_PRECISION); |
1 | 369 |
370 write_bool_option(f, "slideshow_random", slideshow_random); | |
371 write_bool_option(f, "slideshow_repeat", slideshow_repeat); | |
372 | |
373 fprintf(f,"\n##### Filtering Options #####\n\n"); | |
374 | |
375 write_bool_option(f, "show_dotfiles", show_dot_files); | |
376 write_bool_option(f, "disable_filtering", file_filter_disable); | |
9 | 377 filter_write_list(f); |
145
8be2cc687304
fixed grouping sidecar files and made it configurable via config file
nadvornik
parents:
113
diff
changeset
|
378 |
8be2cc687304
fixed grouping sidecar files and made it configurable via config file
nadvornik
parents:
113
diff
changeset
|
379 sidecar_ext_write(f); |
1 | 380 |
113
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
41
diff
changeset
|
381 fprintf(f,"\n##### Color Profiles #####\n\n"); |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
41
diff
changeset
|
382 |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
41
diff
changeset
|
383 #ifndef HAVE_LCMS |
196 | 384 fprintf(f,"# NOTICE: Geeqie was not built with support for color profiles,\n" |
113
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
41
diff
changeset
|
385 "# color profile options will have no effect.\n\n"); |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
41
diff
changeset
|
386 #endif |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
41
diff
changeset
|
387 |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
41
diff
changeset
|
388 write_bool_option(f, "color_profile_enabled", color_profile_enabled); |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
41
diff
changeset
|
389 write_bool_option(f, "color_profile_use_image", color_profile_use_image); |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
41
diff
changeset
|
390 write_int_option(f, "color_profile_input_type", color_profile_input_type); |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
41
diff
changeset
|
391 for (i = 0; i < COLOR_PROFILE_INPUTS; i++) |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
41
diff
changeset
|
392 { |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
41
diff
changeset
|
393 gchar *buf; |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
41
diff
changeset
|
394 |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
41
diff
changeset
|
395 buf = g_strdup_printf("color_profile_input_file_%d", i + 1); |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
41
diff
changeset
|
396 write_char_option(f, buf, color_profile_input_file[i]); |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
41
diff
changeset
|
397 g_free(buf); |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
41
diff
changeset
|
398 |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
41
diff
changeset
|
399 buf = g_strdup_printf("color_profile_input_name_%d", i + 1); |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
41
diff
changeset
|
400 write_char_option(f, buf, color_profile_input_name[i]); |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
41
diff
changeset
|
401 g_free(buf); |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
41
diff
changeset
|
402 } |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
41
diff
changeset
|
403 fprintf(f,"\n"); |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
41
diff
changeset
|
404 write_int_option(f, "color_profile_screen_type", color_profile_screen_type); |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
41
diff
changeset
|
405 write_char_option(f, "color_profile_screen_file_1", color_profile_screen_file); |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
41
diff
changeset
|
406 |
1 | 407 fprintf(f,"\n##### External Programs #####\n"); |
41
6281cc38e5ca
Wed Apr 27 15:17:57 2005 John Ellis <johne@verizon.net>
gqview
parents:
14
diff
changeset
|
408 fprintf(f,"# Maximum of 10 programs (external_1 through external_10)\n"); |
1 | 409 fprintf(f,"# format: external_n: \"menu name\" \"command line\"\n\n"); |
410 | |
9 | 411 for (i = 0; i < GQVIEW_EDITOR_SLOTS; i++) |
1 | 412 { |
217 | 413 char *qname = escquote_value(editor_name[i]); |
414 char *qcommand = escquote_value(editor_command[i]); | |
415 fprintf(f,"external_%d: %s %s\n", i+1, qname, qcommand); | |
416 g_free(qname); | |
417 g_free(qcommand); | |
1 | 418 } |
419 | |
9 | 420 fprintf(f,"\n##### Collection Options #####\n\n"); |
421 | |
422 write_bool_option(f, "rectangular_selections", collection_rectangular_selection); | |
423 | |
1 | 424 fprintf(f,"\n##### Window Positions #####\n\n"); |
425 | |
426 write_bool_option(f, "restore_window_positions", save_window_positions); | |
427 fprintf(f,"\n"); | |
428 write_int_option(f, "main_window_x", main_window_x); | |
429 write_int_option(f, "main_window_y", main_window_y); | |
430 write_int_option(f, "main_window_width", main_window_w); | |
431 write_int_option(f, "main_window_height", main_window_h); | |
9 | 432 write_bool_option(f, "main_window_maximized", main_window_maximized); |
1 | 433 write_int_option(f, "float_window_x", float_window_x); |
434 write_int_option(f, "float_window_y", float_window_y); | |
435 write_int_option(f, "float_window_width", float_window_w); | |
436 write_int_option(f, "float_window_height", float_window_h); | |
9 | 437 write_int_option(f, "float_window_divider", float_window_divider); |
438 write_int_option(f, "divider_position_h", window_hdivider_pos); | |
439 write_int_option(f, "divider_position_v", window_vdivider_pos); | |
1 | 440 |
222
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
218
diff
changeset
|
441 fprintf(f,"\n##### Exif #####\n# 0: never\n# 1: if set\n# 2: always\n"); |
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
218
diff
changeset
|
442 for (i = 0; ExifUIList[i].key; i++) |
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
218
diff
changeset
|
443 { |
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
218
diff
changeset
|
444 fprintf(f,"exif_"); |
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
218
diff
changeset
|
445 write_int_option(f, (gchar *)ExifUIList[i].key, ExifUIList[i].current); |
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
218
diff
changeset
|
446 } |
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
218
diff
changeset
|
447 |
1 | 448 fprintf(f,"######################################################################\n"); |
196 | 449 fprintf(f,"# end of Geeqie config file #\n"); |
1 | 450 fprintf(f,"######################################################################\n"); |
451 | |
452 fclose(f); | |
453 | |
454 g_free(rc_path); | |
455 } | |
456 | |
457 /* | |
458 *----------------------------------------------------------------------------- | |
459 * load configuration (public) | |
460 *----------------------------------------------------------------------------- | |
461 */ | |
462 | |
9 | 463 void load_options(void) |
1 | 464 { |
465 FILE *f; | |
466 gchar *rc_path; | |
9 | 467 gchar *rc_pathl; |
1 | 468 gchar s_buf[1024]; |
469 gchar *s_buf_ptr; | |
470 gchar option[1024]; | |
471 gchar value[1024]; | |
472 gchar value_all[1024]; | |
473 gint c,l,i; | |
9 | 474 |
222
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
218
diff
changeset
|
475 for (i = 0; ExifUIList[i].key; i++) |
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
218
diff
changeset
|
476 ExifUIList[i].current = ExifUIList[i].default_value; |
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
218
diff
changeset
|
477 |
9 | 478 rc_path = g_strconcat(homedir(), "/", GQVIEW_RC_DIR, "/", RC_FILE_NAME, NULL); |
1 | 479 |
9 | 480 rc_pathl = path_from_utf8(rc_path); |
481 f = fopen(rc_pathl,"r"); | |
482 g_free(rc_pathl); | |
1 | 483 if (!f) |
484 { | |
485 g_free(rc_path); | |
486 return; | |
487 } | |
488 | |
489 while (fgets(s_buf,1024,f)) | |
490 { | |
491 if (s_buf[0]=='#') continue; | |
492 if (s_buf[0]=='\n') continue; | |
493 c = 0; | |
494 l = strlen(s_buf); | |
495 while (s_buf[c] != ':' && c < l) c++; | |
496 if (c >= l) continue; | |
497 s_buf[c] = '\0'; | |
498 c++; | |
9 | 499 while ((s_buf[c] == ' ' || s_buf[c] == 8) && c < l) c++; |
1 | 500 s_buf_ptr = s_buf + c; |
9 | 501 strncpy(value_all, s_buf_ptr, sizeof(value_all)); |
1 | 502 while (s_buf[c] != 8 && s_buf[c] != ' ' && s_buf[c] != '\n' && c < l) c++; |
503 s_buf[c] = '\0'; | |
9 | 504 strncpy(option, s_buf, sizeof(option)); |
505 strncpy(value, s_buf_ptr, sizeof(value)); | |
1 | 506 |
507 /* general options */ | |
508 | |
9 | 509 layout_style = read_int_option(f, option, |
510 "layout_style", value, layout_style); | |
511 layout_order = read_char_option(f, option, | |
512 "layout_order", value, layout_order); | |
513 layout_view_icons = read_bool_option(f, option, | |
514 "layout_view_as_icons", value, layout_view_icons); | |
515 layout_view_tree = read_bool_option(f, option, | |
516 "layout_view_as_tree", value, layout_view_tree); | |
517 show_icon_names = read_bool_option(f, option, | |
518 "show_icon_names", value, show_icon_names); | |
519 | |
520 tree_descend_subdirs = read_bool_option(f, option, | |
521 "tree_descend_folders", value, tree_descend_subdirs); | |
522 lazy_image_sync = read_bool_option(f, option, | |
523 "lazy_image_sync", value, lazy_image_sync); | |
524 update_on_time_change = read_bool_option(f, option, | |
525 "update_on_time_change", value, update_on_time_change); | |
526 exif_rotate_enable = read_bool_option(f, option, | |
527 "exif_auto_rotate", value, exif_rotate_enable); | |
528 | |
1 | 529 startup_path_enable = read_bool_option(f, option, |
530 "enable_startup_path", value, startup_path_enable); | |
531 startup_path = read_char_option(f, option, | |
532 "startup_path", value_all, startup_path); | |
533 | |
9 | 534 if (strcasecmp(option,"zoom_mode") == 0) |
1 | 535 { |
9 | 536 if (strcasecmp(value, "original") == 0) zoom_mode = ZOOM_RESET_ORIGINAL; |
537 if (strcasecmp(value, "fit") == 0) zoom_mode = ZOOM_RESET_FIT_WINDOW; | |
538 if (strcasecmp(value, "dont_change") == 0) zoom_mode = ZOOM_RESET_NONE; | |
1 | 539 } |
9 | 540 two_pass_zoom = read_bool_option(f, option, |
541 "two_pass_scaling", value, two_pass_zoom); | |
542 zoom_to_fit_expands = read_bool_option(f, option, | |
543 "zoom_to_fit_allow_expand", value, zoom_to_fit_expands); | |
1 | 544 |
545 fit_window = read_bool_option(f, option, | |
546 "fit_window_to_image", value, fit_window); | |
547 limit_window_size = read_bool_option(f, option, | |
548 "limit_window_size", value, limit_window_size); | |
549 max_window_size = read_int_option(f, option, | |
550 "max_window_size", value, max_window_size); | |
209
ad78ad18523a
configurable frame around image - geeqie_autofit_maxsize.patch by Laurent MONIN
nadvornik
parents:
208
diff
changeset
|
551 limit_autofit_size = read_bool_option(f, option, |
ad78ad18523a
configurable frame around image - geeqie_autofit_maxsize.patch by Laurent MONIN
nadvornik
parents:
208
diff
changeset
|
552 "limit_autofit_size", value, limit_autofit_size); |
ad78ad18523a
configurable frame around image - geeqie_autofit_maxsize.patch by Laurent MONIN
nadvornik
parents:
208
diff
changeset
|
553 max_autofit_size = read_int_option(f, option, |
ad78ad18523a
configurable frame around image - geeqie_autofit_maxsize.patch by Laurent MONIN
nadvornik
parents:
208
diff
changeset
|
554 "max_autofit_size", value, max_autofit_size); |
1 | 555 progressive_key_scrolling = read_bool_option(f, option, |
556 "progressive_keyboard_scrolling", value, progressive_key_scrolling); | |
9 | 557 scroll_reset_method = read_int_option(f, option, |
558 "scroll_reset_method", value, scroll_reset_method); | |
1 | 559 |
3 | 560 thumbnails_enabled = read_bool_option(f, option, |
561 "enable_thumbnails", value, thumbnails_enabled); | |
1 | 562 thumb_max_width = read_int_option(f, option, |
563 "thumbnail_width", value, thumb_max_width); | |
564 thumb_max_height = read_int_option(f, option, | |
565 "thumbnail_height", value, thumb_max_height); | |
566 enable_thumb_caching = read_bool_option(f, option, | |
567 "cache_thumbnails", value, enable_thumb_caching); | |
9 | 568 enable_thumb_dirs = read_bool_option(f, option, |
569 "cache_thumbnails_into_dirs", value, enable_thumb_dirs); | |
14
25335c62cd9b
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
9
diff
changeset
|
570 thumbnail_fast = read_bool_option(f, option, |
25335c62cd9b
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
9
diff
changeset
|
571 "thumbnail_fast", value, thumbnail_fast); |
1 | 572 use_xvpics_thumbnails = read_bool_option(f, option, |
573 "use_xvpics_thumbnails", value, use_xvpics_thumbnails); | |
9 | 574 thumbnail_spec_standard = read_bool_option(f, option, |
575 "thumbnail_spec_standard", value, thumbnail_spec_standard); | |
576 | |
577 enable_metadata_dirs = read_bool_option(f, option, | |
578 "local_metadata", value, enable_metadata_dirs); | |
579 | |
580 file_sort_method = (SortType)read_int_option(f, option, | |
581 "sort_method", value, (gint)file_sort_method); | |
582 file_sort_ascending = read_bool_option(f, option, | |
583 "sort_ascending", value, file_sort_ascending); | |
584 file_sort_case_sensitive = read_bool_option(f, option, | |
585 "sort_case_sensitive", value, file_sort_case_sensitive); | |
1 | 586 |
587 confirm_delete = read_bool_option(f, option, | |
588 "confirm_delete", value, confirm_delete); | |
9 | 589 enable_delete_key = read_bool_option(f, option, |
590 "enable_delete_key", value, enable_delete_key); | |
591 safe_delete_enable = read_bool_option(f, option, | |
592 "safe_delete", value, safe_delete_enable); | |
593 safe_delete_path = read_char_option(f, option, | |
594 "safe_delete_path", value, safe_delete_path); | |
595 safe_delete_size = read_int_option(f, option, | |
596 "safe_delete_size", value, safe_delete_size); | |
1 | 597 |
598 tools_float = read_bool_option(f, option, | |
599 "tools_float", value, tools_float); | |
600 tools_hidden = read_bool_option(f, option, | |
601 "tools_hidden", value, tools_hidden); | |
602 restore_tool = read_bool_option(f, option, | |
603 "restore_tool_state", value, restore_tool); | |
604 | |
9 | 605 toolbar_hidden = read_bool_option(f, option, |
606 "toolbar_hidden", value, toolbar_hidden); | |
607 | |
4 | 608 mousewheel_scrolls = read_bool_option(f, option, |
609 "mouse_wheel_scrolls", value, mousewheel_scrolls); | |
9 | 610 enable_in_place_rename = read_bool_option(f, option, |
611 "in_place_rename", value, enable_in_place_rename); | |
4 | 612 |
9 | 613 recent_list_max = read_int_option(f, option, |
614 "open_recent_max", value, recent_list_max); | |
615 | |
616 tile_cache_max = read_int_option(f, option, | |
617 "image_cache_size_max", value, tile_cache_max); | |
618 | |
619 thumbnail_quality = CLAMP(read_int_option(f, option, | |
620 "thumbnail_quality", value, thumbnail_quality), GDK_INTERP_NEAREST, GDK_INTERP_HYPER); | |
621 zoom_quality = CLAMP(read_int_option(f, option, | |
622 "zoom_quality", value, zoom_quality), GDK_INTERP_NEAREST, GDK_INTERP_HYPER); | |
623 dither_quality = CLAMP(read_int_option(f, option, | |
624 "dither_quality", value, dither_quality), GDK_RGB_DITHER_NONE, GDK_RGB_DITHER_MAX); | |
625 | |
626 zoom_increment = read_int_option(f, option, | |
627 "zoom_increment", value, zoom_increment); | |
628 | |
629 enable_read_ahead = read_bool_option(f, option, | |
630 "enable_read_ahead", value, enable_read_ahead); | |
4 | 631 |
9 | 632 place_dialogs_under_mouse = read_bool_option(f, option, |
633 "display_dialogs_under_mouse", value, place_dialogs_under_mouse); | |
634 | |
208
fa0e05f985c3
set user-defined color as image background - patch by Laurent MONIN
nadvornik
parents:
196
diff
changeset
|
635 user_specified_window_background = read_bool_option(f, option, |
fa0e05f985c3
set user-defined color as image background - patch by Laurent MONIN
nadvornik
parents:
196
diff
changeset
|
636 "user_specified_window_background", value, user_specified_window_background); |
fa0e05f985c3
set user-defined color as image background - patch by Laurent MONIN
nadvornik
parents:
196
diff
changeset
|
637 read_color_option(f, option, |
fa0e05f985c3
set user-defined color as image background - patch by Laurent MONIN
nadvornik
parents:
196
diff
changeset
|
638 "window_background_color", value, &window_background_color); |
1 | 639 |
9 | 640 fullscreen_screen = read_int_option(f, option, |
641 "fullscreen_screen", value, fullscreen_screen); | |
642 fullscreen_clean_flip = read_bool_option(f, option, | |
643 "fullscreen_clean_flip", value, fullscreen_clean_flip); | |
644 fullscreen_disable_saver = read_bool_option(f, option, | |
645 "fullscreen_disable_saver", value, fullscreen_disable_saver); | |
646 fullscreen_above = read_bool_option(f, option, | |
647 "fullscreen_above", value, fullscreen_above); | |
218
f4a0555794a9
Customizable info overlay in fullscreen, based on the patch posted to gqview-devel list by Timo on 2007-09-10.
zas_
parents:
217
diff
changeset
|
648 show_fullscreen_info = read_bool_option(f, option, |
f4a0555794a9
Customizable info overlay in fullscreen, based on the patch posted to gqview-devel list by Timo on 2007-09-10.
zas_
parents:
217
diff
changeset
|
649 "show_fullscreen_info", value, show_fullscreen_info); |
f4a0555794a9
Customizable info overlay in fullscreen, based on the patch posted to gqview-devel list by Timo on 2007-09-10.
zas_
parents:
217
diff
changeset
|
650 fullscreen_info = read_char_option(f, option, |
f4a0555794a9
Customizable info overlay in fullscreen, based on the patch posted to gqview-devel list by Timo on 2007-09-10.
zas_
parents:
217
diff
changeset
|
651 "fullscreen_info", value_all, fullscreen_info); |
9 | 652 |
653 dupe_custom_threshold = read_int_option(f, option, | |
654 "custom_similarity_threshold", value, dupe_custom_threshold); | |
655 | |
656 /* slideshow options */ | |
657 | |
658 slideshow_delay = read_int_unit_option(f, option, | |
659 "slideshow_delay", value, slideshow_delay, SLIDESHOW_SUBSECOND_PRECISION); | |
1 | 660 slideshow_random = read_bool_option(f, option, |
661 "slideshow_random", value, slideshow_random); | |
662 slideshow_repeat = read_bool_option(f, option, | |
663 "slideshow_repeat", value, slideshow_repeat); | |
664 | |
665 /* filtering options */ | |
666 | |
667 show_dot_files = read_bool_option(f, option, | |
668 "show_dotfiles", value, show_dot_files); | |
669 file_filter_disable = read_bool_option(f, option, | |
670 "disable_filtering", value, file_filter_disable); | |
671 | |
9 | 672 if (strcasecmp(option, "filter_ext") == 0) |
673 { | |
674 filter_parse(value_all); | |
675 } | |
1 | 676 |
145
8be2cc687304
fixed grouping sidecar files and made it configurable via config file
nadvornik
parents:
113
diff
changeset
|
677 if (strcasecmp(option, "sidecar_ext") == 0) |
8be2cc687304
fixed grouping sidecar files and made it configurable via config file
nadvornik
parents:
113
diff
changeset
|
678 { |
170
9a56e3d13e67
basic sidecar files configuration via preferences dialog
nadvornik
parents:
145
diff
changeset
|
679 sidecar_ext_parse(value_all, TRUE); |
145
8be2cc687304
fixed grouping sidecar files and made it configurable via config file
nadvornik
parents:
113
diff
changeset
|
680 } |
8be2cc687304
fixed grouping sidecar files and made it configurable via config file
nadvornik
parents:
113
diff
changeset
|
681 |
113
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
41
diff
changeset
|
682 /* Color Profiles */ |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
41
diff
changeset
|
683 |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
41
diff
changeset
|
684 color_profile_enabled = read_bool_option(f, option, |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
41
diff
changeset
|
685 "color_profile_enabled", value, color_profile_enabled); |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
41
diff
changeset
|
686 color_profile_use_image = read_bool_option(f, option, |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
41
diff
changeset
|
687 "color_profile_use_image", value, color_profile_use_image); |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
41
diff
changeset
|
688 color_profile_input_type = read_int_option(f, option, |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
41
diff
changeset
|
689 "color_profile_input_type", value, color_profile_input_type); |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
41
diff
changeset
|
690 |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
41
diff
changeset
|
691 if (strncasecmp(option, "color_profile_input_file_", 25) == 0) |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
41
diff
changeset
|
692 { |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
41
diff
changeset
|
693 i = strtol(option + 25, NULL, 0) - 1; |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
41
diff
changeset
|
694 if (i >= 0 && i < COLOR_PROFILE_INPUTS) |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
41
diff
changeset
|
695 { |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
41
diff
changeset
|
696 color_profile_input_file[i] = read_char_option(f, option, |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
41
diff
changeset
|
697 option, value, color_profile_input_file[i]); |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
41
diff
changeset
|
698 } |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
41
diff
changeset
|
699 } |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
41
diff
changeset
|
700 if (strncasecmp(option, "color_profile_input_name_", 25) == 0) |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
41
diff
changeset
|
701 { |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
41
diff
changeset
|
702 i = strtol(option + 25, NULL, 0) - 1; |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
41
diff
changeset
|
703 if (i >= 0 && i < COLOR_PROFILE_INPUTS) |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
41
diff
changeset
|
704 { |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
41
diff
changeset
|
705 color_profile_input_name[i] = read_char_option(f, option, |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
41
diff
changeset
|
706 option, value, color_profile_input_name[i]); |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
41
diff
changeset
|
707 } |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
41
diff
changeset
|
708 } |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
41
diff
changeset
|
709 |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
41
diff
changeset
|
710 color_profile_screen_type = read_int_option(f, option, |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
41
diff
changeset
|
711 "color_profile_screen_type", value, color_profile_screen_type); |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
41
diff
changeset
|
712 color_profile_screen_file = read_char_option(f, option, |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
41
diff
changeset
|
713 "color_profile_screen_file_1", value, color_profile_screen_file); |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
41
diff
changeset
|
714 |
1 | 715 /* External Programs */ |
716 | |
9 | 717 if (strncasecmp(option, "external_", 9) == 0) |
1 | 718 { |
719 i = strtol(option + 9, NULL, 0); | |
9 | 720 if (i > 0 && i <= GQVIEW_EDITOR_SLOTS) |
1 | 721 { |
217 | 722 const gchar *ptr; |
1 | 723 i--; |
724 g_free(editor_name[i]); | |
725 g_free(editor_command[i]); | |
217 | 726 |
727 editor_name[i] = quoted_value(value_all, &ptr); | |
728 editor_command[i] = quoted_value(ptr, NULL); | |
1 | 729 } |
730 } | |
731 | |
9 | 732 /* colection options */ |
733 | |
734 collection_rectangular_selection = read_bool_option(f, option, | |
735 "rectangular_selections", value, collection_rectangular_selection); | |
736 | |
1 | 737 /* window positions */ |
738 | |
739 save_window_positions = read_bool_option(f, option, | |
740 "restore_window_positions", value, save_window_positions); | |
741 | |
742 main_window_x = read_int_option(f, option, | |
743 "main_window_x", value, main_window_x); | |
744 main_window_y = read_int_option(f, option, | |
745 "main_window_y", value, main_window_y); | |
746 main_window_w = read_int_option(f, option, | |
747 "main_window_width", value, main_window_w); | |
748 main_window_h = read_int_option(f, option, | |
749 "main_window_height", value, main_window_h); | |
9 | 750 main_window_maximized = read_bool_option(f, option, |
751 "main_window_maximized", value, main_window_maximized); | |
1 | 752 float_window_x = read_int_option(f, option, |
753 "float_window_x", value, float_window_x); | |
754 float_window_y = read_int_option(f, option, | |
755 "float_window_y", value, float_window_y); | |
756 float_window_w = read_int_option(f, option, | |
757 "float_window_width", value, float_window_w); | |
758 float_window_h = read_int_option(f, option, | |
759 "float_window_height", value, float_window_h); | |
9 | 760 float_window_divider = read_int_option(f, option, |
761 "float_window_divider", value, float_window_divider); | |
762 window_hdivider_pos = read_int_option(f, option, | |
763 "divider_position_h", value, window_hdivider_pos); | |
764 window_vdivider_pos = read_int_option(f, option, | |
765 "divider_position_v", value, window_vdivider_pos); | |
766 | |
222
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
218
diff
changeset
|
767 if (0 == strncasecmp(option, "exif_", 5)) |
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
218
diff
changeset
|
768 { |
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
218
diff
changeset
|
769 for (i = 0; ExifUIList[i].key; i++) |
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
218
diff
changeset
|
770 if (0 == strcasecmp(option+5, ExifUIList[i].key)) |
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
218
diff
changeset
|
771 ExifUIList[i].current = strtol(value, NULL, 10); |
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
218
diff
changeset
|
772 } |
1 | 773 } |
774 | |
775 fclose(f); | |
776 g_free(rc_path); | |
777 } | |
778 |