annotate src/rcfile.c @ 257:c5422b69b40e

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