annotate src/rcfile.c @ 14:25335c62cd9b

##### Note: GQview CVS on sourceforge is not always up to date, please use ##### ##### an offical release when making enhancements and translation updates. ##### Thu Mar 3 01:16:23 2005 John Ellis <johne@verizon.net> * pan-view.c: Add 'dots' image size option, fix up border size at edge of grid, and make drag and drop work to/from the window. Wed Mar 2 23:34:30 2005 John Ellis <johne@verizon.net> * globals.c, gqview.h, rcfile.c: Add thumbnail_fast option variable. * image-load.c, typedefs.h: Add shrunk flag to determine if an image was scaled down using image_loader_set_requested_size. * image.c: Make panning with mouse scroll more when holding shift key. * preferences.c: Add option for 'Fast jpeg thumbnailing' and disabled xvpics option in the gui - now a hidden option. * thumb.c, thumb_standard.c: Add support for thumbnail_fast option..
author gqview
date Thu, 03 Mar 2005 06:32:53 +0000
parents d907d608745f
children 6281cc38e5ca
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
1 /*
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
2 * GQview
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
3 * (C) 2004 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"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
19
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
20
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
21 /*
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
22 *-----------------------------------------------------------------------------
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
23 * line write/parse routines (private)
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
24 *-----------------------------------------------------------------------------
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
25 */
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
26
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
27 gchar *quoted_value(const gchar *text)
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
28 {
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
29 const gchar *ptr;
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
30 gint c = 0;
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
31 gint l = strlen(text);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
32
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
33 if (l == 0) return NULL;
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
34
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
35 while (c < l && text[c] !='"') c++;
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
36 if (text[c] == '"')
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
37 {
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
38 gint e;
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
39 c++;
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
40 ptr = text + c;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
41 e = c;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
42 while (e < l && text[e] !='"') e++;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
43 if (text[e] == '"')
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
44 {
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
45 if (e - c > 0)
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
46 {
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
47 return g_strndup(ptr, e - c);
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
48 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
49 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
50 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
51 else
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
52 /* for compatibility with older formats (<0.3.7)
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
53 * read a line without quotes too */
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
54 {
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
55 c = 0;
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
56 while (c < l && text[c] !=' ' && text[c] !=8 && text[c] != '\n') c++;
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
57 if (c != 0)
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
58 {
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
59 return g_strndup(text, c);
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
60 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
61 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
62
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
63 return NULL;
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
64 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
65
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
66 static void write_char_option(FILE *f, gchar *label, gchar *text)
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
67 {
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
68 if (text)
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
69 fprintf(f,"%s: \"%s\"\n", label, text);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
70 else
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
71 fprintf(f,"%s: \n", label);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
72 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
73
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
74 static gchar *read_char_option(FILE *f, gchar *option, gchar *label, gchar *value, gchar *text)
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
75 {
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
76 if (strcasecmp(option, label) == 0)
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
77 {
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
78 g_free(text);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
79 text = quoted_value(value);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
80 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
81 return text;
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
82 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
83
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
84 static void write_int_option(FILE *f, gchar *label, gint n)
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
85 {
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
86 fprintf(f,"%s: %d\n\n", label, n);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
87 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
88
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
89 static gint read_int_option(FILE *f, gchar *option, gchar *label, gchar *value, gint n)
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
90 {
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
91 if (strcasecmp(option, label) == 0)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
92 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
93 n = strtol(value, NULL, 10);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
94 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
95 return n;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
96 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
97
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
98 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
99 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
100 gint l, r;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
101
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
102 if (subunits > 0)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
103 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
104 l = n / subunits;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
105 r = n % subunits;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
106 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
107 else
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
108 {
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
109 l = n;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
110 r = 0;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
111 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
112
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
113 fprintf(f,"%s: %d.%d\n\n", label, l, r);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
114 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
115
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
116 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
117 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
118 if (strcasecmp(option, label) == 0)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
119 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
120 gint l, r;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
121 gchar *ptr;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
122
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
123 ptr = value;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
124 while (*ptr != '\0' && *ptr != '.') ptr++;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
125 if (*ptr == '.')
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
126 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
127 *ptr = '\0';
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
128 l = strtol(value, NULL, 10);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
129 *ptr = '.';
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
130 ptr++;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
131 r = strtol(ptr, NULL, 10);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
132 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
133 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
134 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
135 l = strtol(value, NULL, 10);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
136 r = 0;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
137 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
138
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
139 n = l * subunits + r;
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
140 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
141 return n;
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
142 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
143
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
144 static void write_bool_option(FILE *f, gchar *label, gint n)
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
145 {
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
146 fprintf(f,"%s: ", label);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
147 if (n) fprintf(f,"true\n"); else fprintf(f,"false\n");
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
148 fprintf(f,"\n");
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
149 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
150
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
151 static gint read_bool_option(FILE *f, gchar *option, gchar *label, gchar *value, gint n)
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
152 {
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
153 if (strcasecmp(option, label) == 0)
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
154 {
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
155 if (strcasecmp(value, "true") == 0)
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
156 n = TRUE;
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
157 else
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
158 n = FALSE;
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
159 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
160 return n;
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
161 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
162
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
163 /*
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
164 *-----------------------------------------------------------------------------
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
165 * save configuration (public)
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
166 *-----------------------------------------------------------------------------
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
167 */
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
168
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
169 void save_options(void)
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
170 {
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
171 FILE *f;
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
172 gchar *rc_path;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
173 gchar *rc_pathl;
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
174 gint i;
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
175
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
176 rc_path = g_strconcat(homedir(), "/", GQVIEW_RC_DIR, "/", RC_FILE_NAME, NULL);
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
177
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
178 rc_pathl = path_from_utf8(rc_path);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
179 f = fopen(rc_pathl, "w");
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
180 g_free(rc_pathl);
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
181 if (!f)
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
182 {
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
183 gchar *buf;
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 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
186 print_term(buf);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
187 g_free(buf);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
188
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
189 g_free(rc_path);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
190 return;
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
191 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
192
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
193 fprintf(f,"######################################################################\n");
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
194 fprintf(f,"# GQview config file version %7s #\n", VERSION);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
195 fprintf(f,"######################################################################\n");
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
196 fprintf(f,"\n");
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
197 fprintf(f,"##### General Options #####\n\n");
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
198
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
199 write_int_option(f, "layout_style", layout_style);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
200 write_char_option(f, "layout_order", layout_order);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
201 fprintf(f,"\n");
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
202 write_bool_option(f, "layout_view_as_icons", layout_view_icons);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
203 write_bool_option(f, "layout_view_as_tree", layout_view_tree);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
204 write_bool_option(f, "show_icon_names", show_icon_names);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
205 fprintf(f,"\n");
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
206
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
207 write_bool_option(f, "tree_descend_folders", tree_descend_subdirs);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
208 write_bool_option(f, "lazy_image_sync", lazy_image_sync);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
209 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
210 write_bool_option(f, "exif_auto_rotate", exif_rotate_enable);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
211 fprintf(f,"\n");
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
212
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
213 write_bool_option(f, "enable_startup_path", startup_path_enable);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
214 write_char_option(f, "startup_path", startup_path);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
215 fprintf(f,"\n");
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
216
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
217 fprintf(f,"zoom_mode: ");
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
218 if (zoom_mode == ZOOM_RESET_ORIGINAL) fprintf(f,"original\n");
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
219 if (zoom_mode == ZOOM_RESET_FIT_WINDOW) fprintf(f,"fit\n");
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
220 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
221
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
222 write_bool_option(f, "two_pass_scaling", two_pass_zoom);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
223
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
224 write_bool_option(f, "zoom_to_fit_allow_expand", zoom_to_fit_expands);
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
225 fprintf(f,"\n");
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
226
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
227 write_bool_option(f, "fit_window_to_image", fit_window);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
228 write_bool_option(f, "limit_window_size", limit_window_size);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
229 write_int_option(f, "max_window_size", max_window_size);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
230 fprintf(f,"\n");
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
231
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
232 write_bool_option(f, "progressive_keyboard_scrolling", progressive_key_scrolling);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
233 write_int_option(f, "scroll_reset_method", scroll_reset_method);
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
234 fprintf(f,"\n");
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
235
3
gqview
parents: 1
diff changeset
236 write_bool_option(f, "enable_thumbnails", thumbnails_enabled);
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
237 write_int_option(f, "thumbnail_width", thumb_max_width);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
238 write_int_option(f, "thumbnail_height", thumb_max_height);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
239 write_bool_option(f, "cache_thumbnails", enable_thumb_caching);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
240 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
241 write_bool_option(f, "thumbnail_fast", thumbnail_fast);
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
242 write_bool_option(f, "use_xvpics_thumbnails", use_xvpics_thumbnails);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
243 write_bool_option(f, "thumbnail_spec_standard", thumbnail_spec_standard);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
244 fprintf(f,"\n");
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
245
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
246 write_bool_option(f, "local_metadata", enable_metadata_dirs);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
247 fprintf(f,"\n");
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
248
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
249 write_int_option(f, "sort_method", (gint)file_sort_method);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
250 write_bool_option(f, "sort_ascending", file_sort_ascending);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
251 write_bool_option(f, "sort_case_sensitive", file_sort_case_sensitive);
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
252 fprintf(f,"\n");
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
253
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
254 write_bool_option(f, "confirm_delete", confirm_delete);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
255 write_bool_option(f, "enable_delete_key", enable_delete_key);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
256 write_bool_option(f, "safe_delete", safe_delete_enable);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
257 write_char_option(f, "safe_delete_path", safe_delete_path);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
258 write_int_option(f, "safe_delete_size", safe_delete_size);
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
259 fprintf(f,"\n");
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
260 write_bool_option(f, "tools_float", tools_float);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
261 write_bool_option(f, "tools_hidden", tools_hidden);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
262 write_bool_option(f, "restore_tool_state", restore_tool);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
263
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
264 write_bool_option(f, "toolbar_hidden", toolbar_hidden);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
265
4
e149abcda4eb Syncing to 0.8.1
gqview
parents: 3
diff changeset
266 write_bool_option(f, "mouse_wheel_scrolls", mousewheel_scrolls);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
267 write_bool_option(f, "in_place_rename", enable_in_place_rename);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
268
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
269 write_int_option(f, "open_recent_max", recent_list_max);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
270
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
271 write_int_option(f, "image_cache_size_max", tile_cache_max);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
272
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
273 write_int_option(f, "thumbnail_quality", thumbnail_quality);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
274 write_int_option(f, "zoom_quality", zoom_quality);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
275 write_int_option(f, "dither_quality", dither_quality);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
276
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
277 write_int_option(f, "zoom_increment", zoom_increment);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
278
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
279 write_bool_option(f, "enable_read_ahead", enable_read_ahead);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
280
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
281 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
282
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
283 write_bool_option(f, "black_window_background", black_window_background);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
284
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
285 write_int_option(f, "fullscreen_screen", fullscreen_screen);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
286 write_bool_option(f, "fullscreen_clean_flip", fullscreen_clean_flip);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
287 write_bool_option(f, "fullscreen_disable_saver", fullscreen_disable_saver);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
288 write_bool_option(f, "fullscreen_above", fullscreen_above);
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_int_option(f, "custom_similarity_threshold", dupe_custom_threshold);
4
e149abcda4eb Syncing to 0.8.1
gqview
parents: 3
diff changeset
291
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
292 fprintf(f,"\n##### Slideshow Options #####\n\n");
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
293
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
294 write_int_unit_option(f, "slideshow_delay", slideshow_delay, SLIDESHOW_SUBSECOND_PRECISION);
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
295
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
296 write_bool_option(f, "slideshow_random", slideshow_random);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
297 write_bool_option(f, "slideshow_repeat", slideshow_repeat);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
298
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
299 fprintf(f,"\n##### Filtering Options #####\n\n");
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
300
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
301 write_bool_option(f, "show_dotfiles", show_dot_files);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
302 write_bool_option(f, "disable_filtering", file_filter_disable);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
303 filter_write_list(f);
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
304
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
305 fprintf(f,"\n##### External Programs #####\n");
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
306 fprintf(f,"# Maximum of 8 programs (external_1 through external 8)\n");
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
307 fprintf(f,"# format: external_n: \"menu name\" \"command line\"\n\n");
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
308
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
309 for (i = 0; i < GQVIEW_EDITOR_SLOTS; i++)
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
310 {
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
311 fprintf(f,"external_%d: \"", i+1);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
312 if (editor_name[i]) fprintf(f, "%s", editor_name[i]);
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
313 fprintf(f, "\" \"");
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
314 if (editor_command[i]) fprintf(f, "%s", editor_command[i]);
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
315 fprintf(f, "\"\n");
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
316 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
317
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
318 fprintf(f,"\n##### Collection Options #####\n\n");
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
319
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
320 write_bool_option(f, "rectangular_selections", collection_rectangular_selection);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
321
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
322 fprintf(f,"\n##### Window Positions #####\n\n");
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
323
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
324 write_bool_option(f, "restore_window_positions", save_window_positions);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
325 fprintf(f,"\n");
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
326 write_int_option(f, "main_window_x", main_window_x);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
327 write_int_option(f, "main_window_y", main_window_y);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
328 write_int_option(f, "main_window_width", main_window_w);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
329 write_int_option(f, "main_window_height", main_window_h);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
330 write_bool_option(f, "main_window_maximized", main_window_maximized);
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
331 write_int_option(f, "float_window_x", float_window_x);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
332 write_int_option(f, "float_window_y", float_window_y);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
333 write_int_option(f, "float_window_width", float_window_w);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
334 write_int_option(f, "float_window_height", float_window_h);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
335 write_int_option(f, "float_window_divider", float_window_divider);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
336 write_int_option(f, "divider_position_h", window_hdivider_pos);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
337 write_int_option(f, "divider_position_v", window_vdivider_pos);
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
338
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
339 fprintf(f,"######################################################################\n");
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
340 fprintf(f,"# end of GQview config file #\n");
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
341 fprintf(f,"######################################################################\n");
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
342
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
343 fclose(f);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
344
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
345 g_free(rc_path);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
346 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
347
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
348 /*
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
349 *-----------------------------------------------------------------------------
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
350 * load configuration (public)
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
351 *-----------------------------------------------------------------------------
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
352 */
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
353
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
354 void load_options(void)
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
355 {
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
356 FILE *f;
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
357 gchar *rc_path;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
358 gchar *rc_pathl;
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
359 gchar s_buf[1024];
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
360 gchar *s_buf_ptr;
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
361 gchar option[1024];
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
362 gchar value[1024];
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
363 gchar value_all[1024];
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
364 gint c,l,i;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
365
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
366 rc_path = g_strconcat(homedir(), "/", GQVIEW_RC_DIR, "/", RC_FILE_NAME, NULL);
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
367
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
368 rc_pathl = path_from_utf8(rc_path);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
369 f = fopen(rc_pathl,"r");
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
370 g_free(rc_pathl);
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
371 if (!f)
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
372 {
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
373 g_free(rc_path);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
374 return;
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
375 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
376
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
377 while (fgets(s_buf,1024,f))
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
378 {
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
379 if (s_buf[0]=='#') continue;
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
380 if (s_buf[0]=='\n') continue;
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
381 c = 0;
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
382 l = strlen(s_buf);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
383 while (s_buf[c] != ':' && c < l) c++;
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
384 if (c >= l) continue;
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
385 s_buf[c] = '\0';
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
386 c++;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
387 while ((s_buf[c] == ' ' || s_buf[c] == 8) && c < l) c++;
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
388 s_buf_ptr = s_buf + c;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
389 strncpy(value_all, s_buf_ptr, sizeof(value_all));
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
390 while (s_buf[c] != 8 && s_buf[c] != ' ' && s_buf[c] != '\n' && c < l) c++;
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
391 s_buf[c] = '\0';
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
392 strncpy(option, s_buf, sizeof(option));
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
393 strncpy(value, s_buf_ptr, sizeof(value));
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
394
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
395 /* general options */
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
396
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
397 layout_style = read_int_option(f, option,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
398 "layout_style", value, layout_style);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
399 layout_order = read_char_option(f, option,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
400 "layout_order", value, layout_order);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
401 layout_view_icons = read_bool_option(f, option,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
402 "layout_view_as_icons", value, layout_view_icons);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
403 layout_view_tree = read_bool_option(f, option,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
404 "layout_view_as_tree", value, layout_view_tree);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
405 show_icon_names = read_bool_option(f, option,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
406 "show_icon_names", value, show_icon_names);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
407
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
408 tree_descend_subdirs = read_bool_option(f, option,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
409 "tree_descend_folders", value, tree_descend_subdirs);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
410 lazy_image_sync = read_bool_option(f, option,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
411 "lazy_image_sync", value, lazy_image_sync);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
412 update_on_time_change = read_bool_option(f, option,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
413 "update_on_time_change", value, update_on_time_change);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
414 exif_rotate_enable = read_bool_option(f, option,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
415 "exif_auto_rotate", value, exif_rotate_enable);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
416
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
417 startup_path_enable = read_bool_option(f, option,
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
418 "enable_startup_path", value, startup_path_enable);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
419 startup_path = read_char_option(f, option,
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
420 "startup_path", value_all, startup_path);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
421
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
422 if (strcasecmp(option,"zoom_mode") == 0)
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
423 {
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
424 if (strcasecmp(value, "original") == 0) zoom_mode = ZOOM_RESET_ORIGINAL;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
425 if (strcasecmp(value, "fit") == 0) zoom_mode = ZOOM_RESET_FIT_WINDOW;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
426 if (strcasecmp(value, "dont_change") == 0) zoom_mode = ZOOM_RESET_NONE;
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
427 }
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
428 two_pass_zoom = read_bool_option(f, option,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
429 "two_pass_scaling", value, two_pass_zoom);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
430 zoom_to_fit_expands = read_bool_option(f, option,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
431 "zoom_to_fit_allow_expand", value, zoom_to_fit_expands);
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
432
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
433 fit_window = read_bool_option(f, option,
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
434 "fit_window_to_image", value, fit_window);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
435 limit_window_size = read_bool_option(f, option,
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
436 "limit_window_size", value, limit_window_size);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
437 max_window_size = read_int_option(f, option,
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
438 "max_window_size", value, max_window_size);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
439 progressive_key_scrolling = read_bool_option(f, option,
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
440 "progressive_keyboard_scrolling", value, progressive_key_scrolling);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
441 scroll_reset_method = read_int_option(f, option,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
442 "scroll_reset_method", value, scroll_reset_method);
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
443
3
gqview
parents: 1
diff changeset
444 thumbnails_enabled = read_bool_option(f, option,
gqview
parents: 1
diff changeset
445 "enable_thumbnails", value, thumbnails_enabled);
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
446 thumb_max_width = read_int_option(f, option,
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
447 "thumbnail_width", value, thumb_max_width);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
448 thumb_max_height = read_int_option(f, option,
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
449 "thumbnail_height", value, thumb_max_height);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
450 enable_thumb_caching = read_bool_option(f, option,
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
451 "cache_thumbnails", value, enable_thumb_caching);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
452 enable_thumb_dirs = read_bool_option(f, option,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
453 "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
454 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
455 "thumbnail_fast", value, thumbnail_fast);
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
456 use_xvpics_thumbnails = read_bool_option(f, option,
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
457 "use_xvpics_thumbnails", value, use_xvpics_thumbnails);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
458 thumbnail_spec_standard = read_bool_option(f, option,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
459 "thumbnail_spec_standard", value, thumbnail_spec_standard);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
460
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
461 enable_metadata_dirs = read_bool_option(f, option,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
462 "local_metadata", value, enable_metadata_dirs);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
463
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
464 file_sort_method = (SortType)read_int_option(f, option,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
465 "sort_method", value, (gint)file_sort_method);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
466 file_sort_ascending = read_bool_option(f, option,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
467 "sort_ascending", value, file_sort_ascending);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
468 file_sort_case_sensitive = read_bool_option(f, option,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
469 "sort_case_sensitive", value, file_sort_case_sensitive);
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
470
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
471 confirm_delete = read_bool_option(f, option,
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
472 "confirm_delete", value, confirm_delete);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
473 enable_delete_key = read_bool_option(f, option,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
474 "enable_delete_key", value, enable_delete_key);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
475 safe_delete_enable = read_bool_option(f, option,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
476 "safe_delete", value, safe_delete_enable);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
477 safe_delete_path = read_char_option(f, option,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
478 "safe_delete_path", value, safe_delete_path);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
479 safe_delete_size = read_int_option(f, option,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
480 "safe_delete_size", value, safe_delete_size);
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
481
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
482 tools_float = read_bool_option(f, option,
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
483 "tools_float", value, tools_float);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
484 tools_hidden = read_bool_option(f, option,
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
485 "tools_hidden", value, tools_hidden);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
486 restore_tool = read_bool_option(f, option,
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
487 "restore_tool_state", value, restore_tool);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
488
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
489 toolbar_hidden = read_bool_option(f, option,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
490 "toolbar_hidden", value, toolbar_hidden);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
491
4
e149abcda4eb Syncing to 0.8.1
gqview
parents: 3
diff changeset
492 mousewheel_scrolls = read_bool_option(f, option,
e149abcda4eb Syncing to 0.8.1
gqview
parents: 3
diff changeset
493 "mouse_wheel_scrolls", value, mousewheel_scrolls);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
494 enable_in_place_rename = read_bool_option(f, option,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
495 "in_place_rename", value, enable_in_place_rename);
4
e149abcda4eb Syncing to 0.8.1
gqview
parents: 3
diff changeset
496
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
497 recent_list_max = read_int_option(f, option,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
498 "open_recent_max", value, recent_list_max);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
499
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
500 tile_cache_max = read_int_option(f, option,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
501 "image_cache_size_max", value, tile_cache_max);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
502
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
503 thumbnail_quality = CLAMP(read_int_option(f, option,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
504 "thumbnail_quality", value, thumbnail_quality), GDK_INTERP_NEAREST, GDK_INTERP_HYPER);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
505 zoom_quality = CLAMP(read_int_option(f, option,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
506 "zoom_quality", value, zoom_quality), GDK_INTERP_NEAREST, GDK_INTERP_HYPER);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
507 dither_quality = CLAMP(read_int_option(f, option,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
508 "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
509
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
510 zoom_increment = read_int_option(f, option,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
511 "zoom_increment", value, zoom_increment);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
512
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
513 enable_read_ahead = read_bool_option(f, option,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
514 "enable_read_ahead", value, enable_read_ahead);
4
e149abcda4eb Syncing to 0.8.1
gqview
parents: 3
diff changeset
515
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
516 place_dialogs_under_mouse = read_bool_option(f, option,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
517 "display_dialogs_under_mouse", value, place_dialogs_under_mouse);
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 black_window_background = read_bool_option(f, option,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
520 "black_window_background", value, black_window_background);
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
521
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
522 fullscreen_screen = read_int_option(f, option,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
523 "fullscreen_screen", value, fullscreen_screen);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
524 fullscreen_clean_flip = read_bool_option(f, option,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
525 "fullscreen_clean_flip", value, fullscreen_clean_flip);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
526 fullscreen_disable_saver = read_bool_option(f, option,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
527 "fullscreen_disable_saver", value, fullscreen_disable_saver);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
528 fullscreen_above = read_bool_option(f, option,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
529 "fullscreen_above", value, fullscreen_above);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
530
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
531 dupe_custom_threshold = read_int_option(f, option,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
532 "custom_similarity_threshold", value, dupe_custom_threshold);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
533
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
534 /* slideshow options */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
535
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
536 slideshow_delay = read_int_unit_option(f, option,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
537 "slideshow_delay", value, slideshow_delay, SLIDESHOW_SUBSECOND_PRECISION);
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
538 slideshow_random = read_bool_option(f, option,
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
539 "slideshow_random", value, slideshow_random);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
540 slideshow_repeat = read_bool_option(f, option,
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
541 "slideshow_repeat", value, slideshow_repeat);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
542
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
543 /* filtering options */
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
544
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
545 show_dot_files = read_bool_option(f, option,
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
546 "show_dotfiles", value, show_dot_files);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
547 file_filter_disable = read_bool_option(f, option,
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
548 "disable_filtering", value, file_filter_disable);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
549
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
550 if (strcasecmp(option, "filter_ext") == 0)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
551 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
552 filter_parse(value_all);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
553 }
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
554
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
555 /* External Programs */
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
556
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
557 if (strncasecmp(option, "external_", 9) == 0)
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
558 {
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
559 i = strtol(option + 9, NULL, 0);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
560 if (i > 0 && i <= GQVIEW_EDITOR_SLOTS)
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
561 {
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
562 gchar *ptr1, *ptr2;
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
563 i--;
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
564 c = 0;
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
565 l = strlen(value_all);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
566 ptr1 = value_all;
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
567
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
568 g_free(editor_name[i]);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
569 editor_name[i] = NULL;
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
570 g_free(editor_command[i]);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
571 editor_command[i] = NULL;
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
572
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
573 while (c<l && value_all[c] !='"') c++;
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
574 if (ptr1[c] == '"')
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
575 {
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
576 c++;
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
577 ptr2 = ptr1 + c;
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
578 while (c<l && value_all[c] !='"') c++;
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
579 if (ptr1[c] == '"')
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
580 {
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
581 ptr1[c] = '\0';
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
582 if (ptr1 + c - 1 != ptr2)
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
583 editor_name[i] = g_strdup(ptr2);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
584 c++;
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
585 while (c<l && value_all[c] !='"') c++;
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
586 if (ptr1[c] == '"')
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
587 {
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
588 c++;
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
589 ptr2 = ptr1 + c;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
590 while (value_all[c] != '\0') c++;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
591 while (c > 0 && value_all[c] != '"') c--;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
592 if (ptr1[c] == '"' && ptr1 + c > ptr2)
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
593 {
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
594 ptr1[c] = '\0';
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
595 editor_command[i] = g_strdup(ptr2);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
596 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
597 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
598 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
599 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
600 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
601 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
602
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
603 /* colection options */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
604
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
605 collection_rectangular_selection = read_bool_option(f, option,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
606 "rectangular_selections", value, collection_rectangular_selection);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
607
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
608 /* window positions */
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
609
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
610 save_window_positions = read_bool_option(f, option,
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
611 "restore_window_positions", value, save_window_positions);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
612
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
613 main_window_x = read_int_option(f, option,
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
614 "main_window_x", value, main_window_x);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
615 main_window_y = read_int_option(f, option,
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
616 "main_window_y", value, main_window_y);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
617 main_window_w = read_int_option(f, option,
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
618 "main_window_width", value, main_window_w);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
619 main_window_h = read_int_option(f, option,
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
620 "main_window_height", value, main_window_h);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
621 main_window_maximized = read_bool_option(f, option,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
622 "main_window_maximized", value, main_window_maximized);
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
623 float_window_x = read_int_option(f, option,
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
624 "float_window_x", value, float_window_x);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
625 float_window_y = read_int_option(f, option,
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
626 "float_window_y", value, float_window_y);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
627 float_window_w = read_int_option(f, option,
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
628 "float_window_width", value, float_window_w);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
629 float_window_h = read_int_option(f, option,
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
630 "float_window_height", value, float_window_h);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
631 float_window_divider = read_int_option(f, option,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
632 "float_window_divider", value, float_window_divider);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
633 window_hdivider_pos = read_int_option(f, option,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
634 "divider_position_h", value, window_hdivider_pos);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
635 window_vdivider_pos = read_int_option(f, option,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
636 "divider_position_v", value, window_vdivider_pos);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
637
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
638 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
639
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
640 fclose(f);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
641 g_free(rc_path);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
642 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
643