Mercurial > geeqie
annotate src/options.c @ 1239:254b09942e68
metadata write mode (direct or sidecar) made configurable for each file
format
author | nadvornik |
---|---|
date | Sun, 11 Jan 2009 12:13:30 +0000 |
parents | 878718372aca |
children | b2d98b7c26c1 |
rev | line source |
---|---|
508 | 1 /* |
2 * Geeqie | |
3 * Copyright (C) 2008 The Geeqie Team | |
4 * | |
5 * Authors: Vladimir Nadvornik, Laurent Monin | |
6 * | |
7 * This software is released under the GNU General Public License (GNU GPL). | |
8 * Please read the included file COPYING for more information. | |
9 * This software comes with no warranty of any kind, use at your own risk! | |
10 */ | |
11 | |
12 #include "main.h" | |
13 #include "options.h" | |
14 | |
740
9b0ac8d58c89
Move setup_default_options() and sync_options_with_current_state() to options.[ch].
zas_
parents:
638
diff
changeset
|
15 #include "bar_exif.h" |
9b0ac8d58c89
Move setup_default_options() and sync_options_with_current_state() to options.[ch].
zas_
parents:
638
diff
changeset
|
16 #include "editors.h" |
9b0ac8d58c89
Move setup_default_options() and sync_options_with_current_state() to options.[ch].
zas_
parents:
638
diff
changeset
|
17 #include "filefilter.h" |
612 | 18 #include "histogram.h" /* HCHAN_RGB */ |
619
2ccc7d856d55
Initialize to correct value (OSD_SHOW_NOTHING instead of FALSE).
zas_
parents:
612
diff
changeset
|
19 #include "image-overlay.h" /* OSD_SHOW_NOTHING */ |
740
9b0ac8d58c89
Move setup_default_options() and sync_options_with_current_state() to options.[ch].
zas_
parents:
638
diff
changeset
|
20 #include "info.h" |
9b0ac8d58c89
Move setup_default_options() and sync_options_with_current_state() to options.[ch].
zas_
parents:
638
diff
changeset
|
21 #include "layout.h" |
9b0ac8d58c89
Move setup_default_options() and sync_options_with_current_state() to options.[ch].
zas_
parents:
638
diff
changeset
|
22 #include "layout_image.h" |
1019 | 23 #include "rcfile.h" |
740
9b0ac8d58c89
Move setup_default_options() and sync_options_with_current_state() to options.[ch].
zas_
parents:
638
diff
changeset
|
24 #include "ui_bookmark.h" |
9b0ac8d58c89
Move setup_default_options() and sync_options_with_current_state() to options.[ch].
zas_
parents:
638
diff
changeset
|
25 #include "ui_fileops.h" |
9b0ac8d58c89
Move setup_default_options() and sync_options_with_current_state() to options.[ch].
zas_
parents:
638
diff
changeset
|
26 #include "window.h" |
612 | 27 |
508 | 28 ConfOptions *init_options(ConfOptions *options) |
29 { | |
30 if (!options) options = g_new0(ConfOptions, 1); | |
31 | |
32 options->collections.rectangular_selection = FALSE; | |
33 | |
1034 | 34 options->color_profile.enabled = TRUE; |
508 | 35 options->color_profile.input_type = 0; |
36 options->color_profile.screen_file = NULL; | |
37 options->color_profile.screen_type = 0; | |
38 options->color_profile.use_image = TRUE; | |
39 | |
40 options->dnd_icon_size = 48; | |
1013
88ebc61e33ae
Allow to override documentation paths through options:
zas_
parents:
980
diff
changeset
|
41 options->documentation.htmldir = NULL; |
88ebc61e33ae
Allow to override documentation paths through options:
zas_
parents:
980
diff
changeset
|
42 options->documentation.helpdir = NULL; |
508 | 43 options->duplicates_similarity_threshold = 99; |
594
4cfce4ed35e0
Use a dedicated option to enable keywords and comment saving as XMP tags
zas_
parents:
556
diff
changeset
|
44 |
508 | 45 options->file_filter.disable = FALSE; |
46 options->file_filter.show_dot_directory = FALSE; | |
47 options->file_filter.show_hidden_files = FALSE; | |
48 | |
49 options->file_ops.confirm_delete = TRUE; | |
50 options->file_ops.enable_delete_key = TRUE; | |
51 options->file_ops.enable_in_place_rename = TRUE; | |
52 options->file_ops.safe_delete_enable = FALSE; | |
53 options->file_ops.safe_delete_folder_maxsize = 128; | |
54 options->file_ops.safe_delete_path = NULL; | |
55 | |
56 options->file_sort.ascending = TRUE; | |
57 options->file_sort.case_sensitive = FALSE; | |
58 options->file_sort.method = SORT_NAME; | |
59 | |
60 options->fullscreen.above = FALSE; | |
61 options->fullscreen.clean_flip = FALSE; | |
62 options->fullscreen.disable_saver = TRUE; | |
63 options->fullscreen.screen = -1; | |
64 | |
612 | 65 options->histogram.last_channel_mode = HCHAN_RGB; |
66 options->histogram.last_log_mode = 1; | |
67 | |
508 | 68 memset(&options->image.border_color, 0, sizeof(options->image.border_color)); |
870
3dd2cb78d0f9
Make better matching between options types in options.h and the rest of the code.
zas_
parents:
848
diff
changeset
|
69 options->image.dither_quality = GDK_RGB_DITHER_NORMAL; |
508 | 70 options->image.enable_read_ahead = TRUE; |
71 options->image.exif_rotate_enable = TRUE; | |
72 options->image.fit_window_to_image = FALSE; | |
73 options->image.idle_read_loop_count = IMAGE_LOADER_IDLE_READ_LOOP_COUNT_DEFAULT; | |
74 options->image.limit_autofit_size = FALSE; | |
1034 | 75 options->image.limit_window_size = TRUE; |
508 | 76 options->image.max_autofit_size = 100; |
1034 | 77 options->image.max_window_size = 90; |
508 | 78 options->image.read_buffer_size = IMAGE_LOADER_READ_BUFFER_SIZE_DEFAULT; |
1037
86148ec8a299
fixed various problems with preserving viewport on image change,
nadvornik
parents:
1034
diff
changeset
|
79 options->image.scroll_reset_method = SCROLL_RESET_NOCHANGE; |
508 | 80 options->image.tile_cache_max = 10; |
848 | 81 options->image.image_cache_max = 128; /* 4 x 10MPix */ |
508 | 82 options->image.use_custom_border_color = FALSE; |
83 options->image.zoom_2pass = TRUE; | |
84 options->image.zoom_increment = 5; | |
1034 | 85 options->image.zoom_mode = ZOOM_RESET_NONE; |
870
3dd2cb78d0f9
Make better matching between options types in options.h and the rest of the code.
zas_
parents:
848
diff
changeset
|
86 options->image.zoom_quality = GDK_INTERP_BILINEAR; |
1034 | 87 options->image.zoom_to_fit_allow_expand = FALSE; |
508 | 88 |
870
3dd2cb78d0f9
Make better matching between options types in options.h and the rest of the code.
zas_
parents:
848
diff
changeset
|
89 options->image_overlay.common.state = OSD_SHOW_NOTHING; |
508 | 90 options->image_overlay.common.show_at_startup = FALSE; |
91 options->image_overlay.common.template_string = NULL; | |
822
df541dc41707
Allow to set image overlay info position through options:
zas_
parents:
768
diff
changeset
|
92 options->image_overlay.common.x = 10; |
df541dc41707
Allow to set image overlay info position through options:
zas_
parents:
768
diff
changeset
|
93 options->image_overlay.common.y = -10; |
508 | 94 |
95 options->layout.dir_view_type = DIRVIEW_LIST; | |
556
fe675761d091
Replace Layout icon_view field by more generic file_view_type.
zas_
parents:
508
diff
changeset
|
96 options->layout.file_view_type = FILEVIEW_LIST; |
508 | 97 options->layout.float_window.h = 450; |
98 options->layout.float_window.vdivider_pos = -1; | |
99 options->layout.float_window.w = 260; | |
100 options->layout.float_window.x = 0; | |
101 options->layout.float_window.y = 0; | |
980
a4a38ea9fbaa
Add an option named layout.home_path which modifies the behavior of the Home button.
zas_
parents:
870
diff
changeset
|
102 options->layout.home_path = NULL; |
1034 | 103 options->layout.main_window.h = 540; |
508 | 104 options->layout.main_window.hdivider_pos = -1; |
105 options->layout.main_window.maximized = FALSE; | |
106 options->layout.main_window.vdivider_pos = 200; | |
1034 | 107 options->layout.main_window.w = 720; |
508 | 108 options->layout.main_window.x = 0; |
109 options->layout.main_window.y = 0; | |
110 options->layout.order = NULL; | |
764
ae618ebec3e9
Save properties window width and height to rc file and restore
zas_
parents:
740
diff
changeset
|
111 options->layout.properties_window.w = DEF_PROPERTY_WIDTH; |
ae618ebec3e9
Save properties window width and height to rc file and restore
zas_
parents:
740
diff
changeset
|
112 options->layout.properties_window.h = DEF_PROPERTY_HEIGHT; |
1034 | 113 options->layout.save_window_positions = TRUE; |
825 | 114 options->layout.show_directory_date = FALSE; |
508 | 115 options->layout.show_marks = FALSE; |
116 options->layout.show_thumbnails = FALSE; | |
117 options->layout.style = 0; | |
118 options->layout.toolbar_hidden = FALSE; | |
119 options->layout.tools_float = FALSE; | |
120 options->layout.tools_hidden = FALSE; | |
1034 | 121 options->layout.tools_restore_state = TRUE; |
508 | 122 |
123 options->lazy_image_sync = FALSE; | |
124 options->mousewheel_scrolls = FALSE; | |
125 options->open_recent_list_maxsize = 10; | |
126 options->place_dialogs_under_mouse = FALSE; | |
127 | |
128 options->panels.exif.enabled = FALSE; | |
129 options->panels.exif.width = PANEL_DEFAULT_WIDTH; | |
130 options->panels.info.enabled = FALSE; | |
131 options->panels.info.width = PANEL_DEFAULT_WIDTH; | |
132 options->panels.sort.action_state = 0; | |
133 options->panels.sort.enabled = FALSE; | |
134 options->panels.sort.mode_state = 0; | |
135 options->panels.sort.selection_state = 0; | |
136 | |
1034 | 137 options->progressive_key_scrolling = TRUE; |
594
4cfce4ed35e0
Use a dedicated option to enable keywords and comment saving as XMP tags
zas_
parents:
556
diff
changeset
|
138 |
1208 | 139 options->metadata.enable_metadata_dirs = FALSE; |
140 options->metadata.save_in_image_file = FALSE; | |
141 options->metadata.save_legacy_IPTC = FALSE; | |
142 options->metadata.warn_on_write_problems = TRUE; | |
143 options->metadata.save_legacy_format = FALSE; | |
144 options->metadata.sync_grouped_files = TRUE; | |
145 options->metadata.confirm_write = TRUE; | |
146 options->metadata.confirm_timeout = 0; | |
147 options->metadata.confirm_on_image_change = FALSE; | |
148 options->metadata.confirm_on_dir_change = TRUE; | |
594
4cfce4ed35e0
Use a dedicated option to enable keywords and comment saving as XMP tags
zas_
parents:
556
diff
changeset
|
149 |
1034 | 150 options->show_copy_path = TRUE; |
508 | 151 options->show_icon_names = TRUE; |
152 | |
1034 | 153 options->slideshow.delay = 50; |
508 | 154 options->slideshow.random = FALSE; |
155 options->slideshow.repeat = FALSE; | |
156 | |
630
83d3ded39e49
An option to save and restore the last path used was added.
zas_
parents:
629
diff
changeset
|
157 options->startup.path = NULL; |
629 | 158 options->startup.restore_path = FALSE; |
630
83d3ded39e49
An option to save and restore the last path used was added.
zas_
parents:
629
diff
changeset
|
159 options->startup.use_last_path = FALSE; |
508 | 160 |
161 options->thumbnails.cache_into_dirs = FALSE; | |
162 options->thumbnails.enable_caching = TRUE; | |
163 options->thumbnails.fast = TRUE; | |
164 options->thumbnails.max_height = DEFAULT_THUMB_HEIGHT; | |
165 options->thumbnails.max_width = DEFAULT_THUMB_WIDTH; | |
870
3dd2cb78d0f9
Make better matching between options types in options.h and the rest of the code.
zas_
parents:
848
diff
changeset
|
166 options->thumbnails.quality = GDK_INTERP_TILES; |
508 | 167 options->thumbnails.spec_standard = TRUE; |
168 options->thumbnails.use_xvpics = TRUE; | |
1060 | 169 options->thumbnails.use_exif = FALSE; |
508 | 170 |
171 options->tree_descend_subdirs = FALSE; | |
172 options->update_on_time_change = TRUE; | |
173 | |
174 return options; | |
175 } | |
740
9b0ac8d58c89
Move setup_default_options() and sync_options_with_current_state() to options.[ch].
zas_
parents:
638
diff
changeset
|
176 |
9b0ac8d58c89
Move setup_default_options() and sync_options_with_current_state() to options.[ch].
zas_
parents:
638
diff
changeset
|
177 void setup_default_options(ConfOptions *options) |
9b0ac8d58c89
Move setup_default_options() and sync_options_with_current_state() to options.[ch].
zas_
parents:
638
diff
changeset
|
178 { |
9b0ac8d58c89
Move setup_default_options() and sync_options_with_current_state() to options.[ch].
zas_
parents:
638
diff
changeset
|
179 gchar *path; |
9b0ac8d58c89
Move setup_default_options() and sync_options_with_current_state() to options.[ch].
zas_
parents:
638
diff
changeset
|
180 gint i; |
9b0ac8d58c89
Move setup_default_options() and sync_options_with_current_state() to options.[ch].
zas_
parents:
638
diff
changeset
|
181 |
9b0ac8d58c89
Move setup_default_options() and sync_options_with_current_state() to options.[ch].
zas_
parents:
638
diff
changeset
|
182 for (i = 0; i < GQ_EDITOR_SLOTS; i++) |
9b0ac8d58c89
Move setup_default_options() and sync_options_with_current_state() to options.[ch].
zas_
parents:
638
diff
changeset
|
183 { |
768
ff51413f098d
Use functions to set editors name and command and ensure they are
zas_
parents:
764
diff
changeset
|
184 editor_set_name(i, NULL); |
ff51413f098d
Use functions to set editors name and command and ensure they are
zas_
parents:
764
diff
changeset
|
185 editor_set_command(i, NULL); |
740
9b0ac8d58c89
Move setup_default_options() and sync_options_with_current_state() to options.[ch].
zas_
parents:
638
diff
changeset
|
186 } |
9b0ac8d58c89
Move setup_default_options() and sync_options_with_current_state() to options.[ch].
zas_
parents:
638
diff
changeset
|
187 |
9b0ac8d58c89
Move setup_default_options() and sync_options_with_current_state() to options.[ch].
zas_
parents:
638
diff
changeset
|
188 editor_reset_defaults(); |
9b0ac8d58c89
Move setup_default_options() and sync_options_with_current_state() to options.[ch].
zas_
parents:
638
diff
changeset
|
189 |
9b0ac8d58c89
Move setup_default_options() and sync_options_with_current_state() to options.[ch].
zas_
parents:
638
diff
changeset
|
190 bookmark_add_default(_("Home"), homedir()); |
9b0ac8d58c89
Move setup_default_options() and sync_options_with_current_state() to options.[ch].
zas_
parents:
638
diff
changeset
|
191 path = g_build_filename(homedir(), "Desktop", NULL); |
9b0ac8d58c89
Move setup_default_options() and sync_options_with_current_state() to options.[ch].
zas_
parents:
638
diff
changeset
|
192 bookmark_add_default(_("Desktop"), path); |
9b0ac8d58c89
Move setup_default_options() and sync_options_with_current_state() to options.[ch].
zas_
parents:
638
diff
changeset
|
193 g_free(path); |
1145
3a7af6a8cd5f
Use functions to return directories instead of constants.
zas_
parents:
1060
diff
changeset
|
194 bookmark_add_default(_("Collections"), get_collections_dir()); |
740
9b0ac8d58c89
Move setup_default_options() and sync_options_with_current_state() to options.[ch].
zas_
parents:
638
diff
changeset
|
195 |
9b0ac8d58c89
Move setup_default_options() and sync_options_with_current_state() to options.[ch].
zas_
parents:
638
diff
changeset
|
196 g_free(options->file_ops.safe_delete_path); |
1145
3a7af6a8cd5f
Use functions to return directories instead of constants.
zas_
parents:
1060
diff
changeset
|
197 options->file_ops.safe_delete_path = g_strdup(get_trash_dir()); |
740
9b0ac8d58c89
Move setup_default_options() and sync_options_with_current_state() to options.[ch].
zas_
parents:
638
diff
changeset
|
198 |
9b0ac8d58c89
Move setup_default_options() and sync_options_with_current_state() to options.[ch].
zas_
parents:
638
diff
changeset
|
199 for (i = 0; i < COLOR_PROFILE_INPUTS; i++) |
9b0ac8d58c89
Move setup_default_options() and sync_options_with_current_state() to options.[ch].
zas_
parents:
638
diff
changeset
|
200 { |
9b0ac8d58c89
Move setup_default_options() and sync_options_with_current_state() to options.[ch].
zas_
parents:
638
diff
changeset
|
201 options->color_profile.input_file[i] = NULL; |
9b0ac8d58c89
Move setup_default_options() and sync_options_with_current_state() to options.[ch].
zas_
parents:
638
diff
changeset
|
202 options->color_profile.input_name[i] = NULL; |
9b0ac8d58c89
Move setup_default_options() and sync_options_with_current_state() to options.[ch].
zas_
parents:
638
diff
changeset
|
203 } |
9b0ac8d58c89
Move setup_default_options() and sync_options_with_current_state() to options.[ch].
zas_
parents:
638
diff
changeset
|
204 |
9b0ac8d58c89
Move setup_default_options() and sync_options_with_current_state() to options.[ch].
zas_
parents:
638
diff
changeset
|
205 set_default_image_overlay_template_string(&options->image_overlay.common.template_string); |
1229
878718372aca
sidecar files grouping was made case-insensitive
nadvornik
parents:
1208
diff
changeset
|
206 options->sidecar.ext = g_strdup(".jpg;%raw;.xmp"); |
740
9b0ac8d58c89
Move setup_default_options() and sync_options_with_current_state() to options.[ch].
zas_
parents:
638
diff
changeset
|
207 options->layout.order = g_strdup("123"); |
9b0ac8d58c89
Move setup_default_options() and sync_options_with_current_state() to options.[ch].
zas_
parents:
638
diff
changeset
|
208 options->properties.tabs_order = g_strdup(info_tab_default_order()); |
9b0ac8d58c89
Move setup_default_options() and sync_options_with_current_state() to options.[ch].
zas_
parents:
638
diff
changeset
|
209 |
9b0ac8d58c89
Move setup_default_options() and sync_options_with_current_state() to options.[ch].
zas_
parents:
638
diff
changeset
|
210 options->shell.path = g_strdup(GQ_DEFAULT_SHELL_PATH); |
9b0ac8d58c89
Move setup_default_options() and sync_options_with_current_state() to options.[ch].
zas_
parents:
638
diff
changeset
|
211 options->shell.options = g_strdup(GQ_DEFAULT_SHELL_OPTIONS); |
1013
88ebc61e33ae
Allow to override documentation paths through options:
zas_
parents:
980
diff
changeset
|
212 |
88ebc61e33ae
Allow to override documentation paths through options:
zas_
parents:
980
diff
changeset
|
213 options->documentation.htmldir = g_strdup(GQ_HTMLDIR); |
88ebc61e33ae
Allow to override documentation paths through options:
zas_
parents:
980
diff
changeset
|
214 options->documentation.helpdir = g_strdup(GQ_HELPDIR); |
740
9b0ac8d58c89
Move setup_default_options() and sync_options_with_current_state() to options.[ch].
zas_
parents:
638
diff
changeset
|
215 |
9b0ac8d58c89
Move setup_default_options() and sync_options_with_current_state() to options.[ch].
zas_
parents:
638
diff
changeset
|
216 for (i = 0; ExifUIList[i].key; i++) |
9b0ac8d58c89
Move setup_default_options() and sync_options_with_current_state() to options.[ch].
zas_
parents:
638
diff
changeset
|
217 ExifUIList[i].current = ExifUIList[i].default_value; |
9b0ac8d58c89
Move setup_default_options() and sync_options_with_current_state() to options.[ch].
zas_
parents:
638
diff
changeset
|
218 } |
9b0ac8d58c89
Move setup_default_options() and sync_options_with_current_state() to options.[ch].
zas_
parents:
638
diff
changeset
|
219 |
1019 | 220 static void sync_options_with_current_state(ConfOptions *options) |
740
9b0ac8d58c89
Move setup_default_options() and sync_options_with_current_state() to options.[ch].
zas_
parents:
638
diff
changeset
|
221 { |
9b0ac8d58c89
Move setup_default_options() and sync_options_with_current_state() to options.[ch].
zas_
parents:
638
diff
changeset
|
222 LayoutWindow *lw = NULL; |
9b0ac8d58c89
Move setup_default_options() and sync_options_with_current_state() to options.[ch].
zas_
parents:
638
diff
changeset
|
223 |
9b0ac8d58c89
Move setup_default_options() and sync_options_with_current_state() to options.[ch].
zas_
parents:
638
diff
changeset
|
224 if (layout_valid(&lw)) |
9b0ac8d58c89
Move setup_default_options() and sync_options_with_current_state() to options.[ch].
zas_
parents:
638
diff
changeset
|
225 { |
9b0ac8d58c89
Move setup_default_options() and sync_options_with_current_state() to options.[ch].
zas_
parents:
638
diff
changeset
|
226 options->layout.main_window.maximized = window_maximized(lw->window); |
9b0ac8d58c89
Move setup_default_options() and sync_options_with_current_state() to options.[ch].
zas_
parents:
638
diff
changeset
|
227 if (!options->layout.main_window.maximized) |
9b0ac8d58c89
Move setup_default_options() and sync_options_with_current_state() to options.[ch].
zas_
parents:
638
diff
changeset
|
228 { |
9b0ac8d58c89
Move setup_default_options() and sync_options_with_current_state() to options.[ch].
zas_
parents:
638
diff
changeset
|
229 layout_geometry_get(NULL, &options->layout.main_window.x, &options->layout.main_window.y, |
9b0ac8d58c89
Move setup_default_options() and sync_options_with_current_state() to options.[ch].
zas_
parents:
638
diff
changeset
|
230 &options->layout.main_window.w, &options->layout.main_window.h); |
9b0ac8d58c89
Move setup_default_options() and sync_options_with_current_state() to options.[ch].
zas_
parents:
638
diff
changeset
|
231 } |
9b0ac8d58c89
Move setup_default_options() and sync_options_with_current_state() to options.[ch].
zas_
parents:
638
diff
changeset
|
232 |
9b0ac8d58c89
Move setup_default_options() and sync_options_with_current_state() to options.[ch].
zas_
parents:
638
diff
changeset
|
233 options->image_overlay.common.state = image_osd_get(lw->image); |
9b0ac8d58c89
Move setup_default_options() and sync_options_with_current_state() to options.[ch].
zas_
parents:
638
diff
changeset
|
234 } |
9b0ac8d58c89
Move setup_default_options() and sync_options_with_current_state() to options.[ch].
zas_
parents:
638
diff
changeset
|
235 |
9b0ac8d58c89
Move setup_default_options() and sync_options_with_current_state() to options.[ch].
zas_
parents:
638
diff
changeset
|
236 layout_geometry_get_dividers(NULL, &options->layout.main_window.hdivider_pos, &options->layout.main_window.vdivider_pos); |
9b0ac8d58c89
Move setup_default_options() and sync_options_with_current_state() to options.[ch].
zas_
parents:
638
diff
changeset
|
237 |
9b0ac8d58c89
Move setup_default_options() and sync_options_with_current_state() to options.[ch].
zas_
parents:
638
diff
changeset
|
238 layout_views_get(NULL, &options->layout.dir_view_type, &options->layout.file_view_type); |
9b0ac8d58c89
Move setup_default_options() and sync_options_with_current_state() to options.[ch].
zas_
parents:
638
diff
changeset
|
239 |
9b0ac8d58c89
Move setup_default_options() and sync_options_with_current_state() to options.[ch].
zas_
parents:
638
diff
changeset
|
240 options->layout.show_thumbnails = layout_thumb_get(NULL); |
9b0ac8d58c89
Move setup_default_options() and sync_options_with_current_state() to options.[ch].
zas_
parents:
638
diff
changeset
|
241 options->layout.show_marks = layout_marks_get(NULL); |
9b0ac8d58c89
Move setup_default_options() and sync_options_with_current_state() to options.[ch].
zas_
parents:
638
diff
changeset
|
242 |
9b0ac8d58c89
Move setup_default_options() and sync_options_with_current_state() to options.[ch].
zas_
parents:
638
diff
changeset
|
243 layout_sort_get(NULL, &options->file_sort.method, &options->file_sort.ascending); |
9b0ac8d58c89
Move setup_default_options() and sync_options_with_current_state() to options.[ch].
zas_
parents:
638
diff
changeset
|
244 |
9b0ac8d58c89
Move setup_default_options() and sync_options_with_current_state() to options.[ch].
zas_
parents:
638
diff
changeset
|
245 layout_geometry_get_tools(NULL, &options->layout.float_window.x, &options->layout.float_window.y, |
9b0ac8d58c89
Move setup_default_options() and sync_options_with_current_state() to options.[ch].
zas_
parents:
638
diff
changeset
|
246 &options->layout.float_window.w, &options->layout.float_window.h, &options->layout.float_window.vdivider_pos); |
9b0ac8d58c89
Move setup_default_options() and sync_options_with_current_state() to options.[ch].
zas_
parents:
638
diff
changeset
|
247 layout_tools_float_get(NULL, &options->layout.tools_float, &options->layout.tools_hidden); |
9b0ac8d58c89
Move setup_default_options() and sync_options_with_current_state() to options.[ch].
zas_
parents:
638
diff
changeset
|
248 options->layout.toolbar_hidden = layout_toolbar_hidden(NULL); |
9b0ac8d58c89
Move setup_default_options() and sync_options_with_current_state() to options.[ch].
zas_
parents:
638
diff
changeset
|
249 |
9b0ac8d58c89
Move setup_default_options() and sync_options_with_current_state() to options.[ch].
zas_
parents:
638
diff
changeset
|
250 options->color_profile.enabled = layout_image_color_profile_get_use(NULL); |
9b0ac8d58c89
Move setup_default_options() and sync_options_with_current_state() to options.[ch].
zas_
parents:
638
diff
changeset
|
251 layout_image_color_profile_get(NULL, |
9b0ac8d58c89
Move setup_default_options() and sync_options_with_current_state() to options.[ch].
zas_
parents:
638
diff
changeset
|
252 &options->color_profile.input_type, |
9b0ac8d58c89
Move setup_default_options() and sync_options_with_current_state() to options.[ch].
zas_
parents:
638
diff
changeset
|
253 &options->color_profile.screen_type, |
9b0ac8d58c89
Move setup_default_options() and sync_options_with_current_state() to options.[ch].
zas_
parents:
638
diff
changeset
|
254 &options->color_profile.use_image); |
9b0ac8d58c89
Move setup_default_options() and sync_options_with_current_state() to options.[ch].
zas_
parents:
638
diff
changeset
|
255 |
9b0ac8d58c89
Move setup_default_options() and sync_options_with_current_state() to options.[ch].
zas_
parents:
638
diff
changeset
|
256 if (options->startup.restore_path && options->startup.use_last_path) |
9b0ac8d58c89
Move setup_default_options() and sync_options_with_current_state() to options.[ch].
zas_
parents:
638
diff
changeset
|
257 { |
9b0ac8d58c89
Move setup_default_options() and sync_options_with_current_state() to options.[ch].
zas_
parents:
638
diff
changeset
|
258 g_free(options->startup.path); |
9b0ac8d58c89
Move setup_default_options() and sync_options_with_current_state() to options.[ch].
zas_
parents:
638
diff
changeset
|
259 options->startup.path = g_strdup(layout_get_path(NULL)); |
9b0ac8d58c89
Move setup_default_options() and sync_options_with_current_state() to options.[ch].
zas_
parents:
638
diff
changeset
|
260 } |
9b0ac8d58c89
Move setup_default_options() and sync_options_with_current_state() to options.[ch].
zas_
parents:
638
diff
changeset
|
261 } |
1019 | 262 |
263 void save_options(ConfOptions *options) | |
264 { | |
265 gchar *rc_path; | |
266 | |
267 sync_options_with_current_state(options); | |
268 | |
1145
3a7af6a8cd5f
Use functions to return directories instead of constants.
zas_
parents:
1060
diff
changeset
|
269 rc_path = g_build_filename(get_rc_dir(), RC_FILE_NAME, NULL); |
1019 | 270 save_options_to(rc_path, options); |
271 g_free(rc_path); | |
272 } | |
273 | |
274 void load_options(ConfOptions *options) | |
275 { | |
276 gboolean success; | |
277 gchar *rc_path; | |
278 | |
279 if (isdir(GQ_SYSTEM_WIDE_DIR)) | |
280 { | |
281 rc_path = g_build_filename(GQ_SYSTEM_WIDE_DIR, RC_FILE_NAME, NULL); | |
282 success = load_options_from(rc_path, options); | |
283 DEBUG_1("Loading options from %s ... %s", rc_path, success ? "done" : "failed"); | |
284 g_free(rc_path); | |
285 } | |
286 | |
1145
3a7af6a8cd5f
Use functions to return directories instead of constants.
zas_
parents:
1060
diff
changeset
|
287 rc_path = g_build_filename(get_rc_dir(), RC_FILE_NAME, NULL); |
1019 | 288 success = load_options_from(rc_path, options); |
289 DEBUG_1("Loading options from %s ... %s", rc_path, success ? "done" : "failed"); | |
290 g_free(rc_path); | |
291 } | |
1055
1646720364cf
Adding a vim modeline to all files - patch by Klaus Ethgen
nadvornik
parents:
1037
diff
changeset
|
292 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */ |