Mercurial > geeqie.yaz
annotate src/layout_util.c @ 1549:7302ff300a52
show color management status on statusbar
author | nadvornik |
---|---|
date | Mon, 13 Apr 2009 14:39:50 +0000 |
parents | b5608391f479 |
children | 3d9f5c078521 c3416996fd97 |
rev | line source |
---|---|
9 | 1 /* |
196 | 2 * Geeqie |
9 | 3 * (C) 2004 John Ellis |
1284 | 4 * Copyright (C) 2008 - 2009 The Geeqie Team |
9 | 5 * |
6 * Author: John Ellis | |
7 * | |
8 * This software is released under the GNU General Public License (GNU GPL). | |
9 * Please read the included file COPYING for more information. | |
10 * This software comes with no warranty of any kind, use at your own risk! | |
11 */ | |
12 | |
13 | |
281 | 14 #include "main.h" |
9 | 15 #include "layout_util.h" |
16 | |
1293
48e064b37ba6
separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents:
1292
diff
changeset
|
17 #include "advanced_exif.h" |
9 | 18 #include "bar_sort.h" |
1291
50ae02a4a675
replaced bar_info with an universal bar, restored the original
nadvornik
parents:
1285
diff
changeset
|
19 #include "bar.h" |
9 | 20 #include "cache_maint.h" |
21 #include "collect.h" | |
22 #include "collect-dlg.h" | |
457
5e9c24d3b3a8
Add a replacement for gtk_radio_action_set_current_value() which
zas_
parents:
454
diff
changeset
|
23 #include "compat.h" |
1547
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
24 #include "color-man.h" |
9 | 25 #include "dupe.h" |
26 #include "editors.h" | |
586 | 27 #include "filedata.h" |
902 | 28 #include "history_list.h" |
284 | 29 #include "image-overlay.h" |
94
50dc5a14d37b
Thu Nov 2 17:51:31 2006 John Ellis <johne@verizon.net>
gqview
parents:
86
diff
changeset
|
30 #include "img-view.h" |
9 | 31 #include "layout_image.h" |
678
6d6f042b8ca5
Add a log window that shows normal and debug messages. For now, it was added to Help menu.
zas_
parents:
654
diff
changeset
|
32 #include "logwindow.h" |
1022
9962b24b6b43
Move miscellaneous functions to their own files (new misc.[ch]).
zas_
parents:
1004
diff
changeset
|
33 #include "misc.h" |
12
147f4c4b9025
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
9
diff
changeset
|
34 #include "pan-view.h" |
9 | 35 #include "pixbuf_util.h" |
36 #include "preferences.h" | |
37 #include "print.h" | |
38 #include "search.h" | |
39 #include "ui_fileops.h" | |
40 #include "ui_menu.h" | |
41 #include "ui_misc.h" | |
42 #include "ui_tabcomp.h" | |
1022
9962b24b6b43
Move miscellaneous functions to their own files (new misc.[ch]).
zas_
parents:
1004
diff
changeset
|
43 #include "utilops.h" |
380
5afe77bb563a
Introduce a new struct ViewDir to handle directory views common
zas_
parents:
343
diff
changeset
|
44 #include "view_dir.h" |
648
e34c1002e553
Move some functions from main.[ch] to new window.[ch].
zas_
parents:
601
diff
changeset
|
45 #include "window.h" |
1214
31402ecb2aed
write metadata after timeout, image change or dir change
nadvornik
parents:
1176
diff
changeset
|
46 #include "metadata.h" |
1335 | 47 #include "rcfile.h" |
1479 | 48 #include "desktop_file.h" |
9 | 49 |
50 #include <gdk/gdkkeysyms.h> /* for keyboard values */ | |
51 | |
52 | |
53 #define MENU_EDIT_ACTION_OFFSET 16 | |
54 | |
1317 | 55 static gboolean layout_bar_enabled(LayoutWindow *lw); |
1320 | 56 static gboolean layout_bar_sort_enabled(LayoutWindow *lw); |
1547
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
57 static void layout_util_sync_color(LayoutWindow *lw); |
9 | 58 |
59 /* | |
60 *----------------------------------------------------------------------------- | |
61 * keyboard handler | |
62 *----------------------------------------------------------------------------- | |
63 */ | |
64 | |
65 static guint tree_key_overrides[] = { | |
66 GDK_Page_Up, GDK_KP_Page_Up, | |
67 GDK_Page_Down, GDK_KP_Page_Down, | |
68 GDK_Home, GDK_KP_Home, | |
69 GDK_End, GDK_KP_End | |
70 }; | |
71 | |
736 | 72 static gboolean layout_key_match(guint keyval) |
9 | 73 { |
736 | 74 guint i; |
9 | 75 |
76 for (i = 0; i < sizeof(tree_key_overrides) / sizeof(guint); i++) | |
77 { | |
78 if (keyval == tree_key_overrides[i]) return TRUE; | |
79 } | |
80 | |
81 return FALSE; | |
82 } | |
83 | |
1433
b4ad1d201279
Use gboolean where applicable, minor cleanup and indentations fixes.
zas_
parents:
1412
diff
changeset
|
84 gboolean layout_key_press_cb(GtkWidget *widget, GdkEventKey *event, gpointer data) |
9 | 85 { |
86 LayoutWindow *lw = data; | |
1433
b4ad1d201279
Use gboolean where applicable, minor cleanup and indentations fixes.
zas_
parents:
1412
diff
changeset
|
87 gboolean stop_signal = FALSE; |
9 | 88 gint x = 0; |
89 gint y = 0; | |
90 | |
91 if (lw->path_entry && GTK_WIDGET_HAS_FOCUS(lw->path_entry)) | |
92 { | |
783 | 93 if (event->keyval == GDK_Escape && lw->dir_fd) |
9 | 94 { |
783 | 95 gtk_entry_set_text(GTK_ENTRY(lw->path_entry), lw->dir_fd->path); |
9 | 96 } |
97 | |
98 /* the gtkaccelgroup of the window is stealing presses before they get to the entry (and more), | |
99 * so when the some widgets have focus, give them priority (HACK) | |
100 */ | |
101 if (gtk_widget_event(lw->path_entry, (GdkEvent *)event)) | |
102 { | |
103 return TRUE; | |
104 } | |
105 } | |
1309 | 106 if (lw->vd && lw->options.dir_view_type == DIRVIEW_TREE && GTK_WIDGET_HAS_FOCUS(lw->vd->view) && |
9 | 107 !layout_key_match(event->keyval) && |
380
5afe77bb563a
Introduce a new struct ViewDir to handle directory views common
zas_
parents:
343
diff
changeset
|
108 gtk_widget_event(lw->vd->view, (GdkEvent *)event)) |
9 | 109 { |
110 return TRUE; | |
111 } | |
1291
50ae02a4a675
replaced bar_info with an universal bar, restored the original
nadvornik
parents:
1285
diff
changeset
|
112 if (lw->bar && |
50ae02a4a675
replaced bar_info with an universal bar, restored the original
nadvornik
parents:
1285
diff
changeset
|
113 bar_event(lw->bar, (GdkEvent *)event)) |
9 | 114 { |
115 return TRUE; | |
116 } | |
117 | |
160 | 118 /* |
119 if (event->type == GDK_KEY_PRESS && lw->full_screen && | |
995 | 120 gtk_accel_groups_activate(G_OBJECT(lw->window), event->keyval, event->state)) |
160 | 121 return TRUE; |
122 */ | |
123 | |
9 | 124 if (lw->image && |
160 | 125 (GTK_WIDGET_HAS_FOCUS(lw->image->widget) || (lw->tools && widget == lw->window) || lw->full_screen) ) |
9 | 126 { |
84
ba3c39002a24
Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents:
82
diff
changeset
|
127 stop_signal = TRUE; |
9 | 128 switch (event->keyval) |
129 { | |
130 case GDK_Left: case GDK_KP_Left: | |
131 x -= 1; | |
132 break; | |
133 case GDK_Right: case GDK_KP_Right: | |
134 x += 1; | |
135 break; | |
136 case GDK_Up: case GDK_KP_Up: | |
137 y -= 1; | |
138 break; | |
139 case GDK_Down: case GDK_KP_Down: | |
140 y += 1; | |
141 break; | |
84
ba3c39002a24
Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents:
82
diff
changeset
|
142 default: |
ba3c39002a24
Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents:
82
diff
changeset
|
143 stop_signal = FALSE; |
9 | 144 break; |
145 } | |
94
50dc5a14d37b
Thu Nov 2 17:51:31 2006 John Ellis <johne@verizon.net>
gqview
parents:
86
diff
changeset
|
146 |
50dc5a14d37b
Thu Nov 2 17:51:31 2006 John Ellis <johne@verizon.net>
gqview
parents:
86
diff
changeset
|
147 if (!stop_signal && |
50dc5a14d37b
Thu Nov 2 17:51:31 2006 John Ellis <johne@verizon.net>
gqview
parents:
86
diff
changeset
|
148 !(event->state & GDK_CONTROL_MASK)) |
50dc5a14d37b
Thu Nov 2 17:51:31 2006 John Ellis <johne@verizon.net>
gqview
parents:
86
diff
changeset
|
149 { |
50dc5a14d37b
Thu Nov 2 17:51:31 2006 John Ellis <johne@verizon.net>
gqview
parents:
86
diff
changeset
|
150 stop_signal = TRUE; |
50dc5a14d37b
Thu Nov 2 17:51:31 2006 John Ellis <johne@verizon.net>
gqview
parents:
86
diff
changeset
|
151 switch (event->keyval) |
50dc5a14d37b
Thu Nov 2 17:51:31 2006 John Ellis <johne@verizon.net>
gqview
parents:
86
diff
changeset
|
152 { |
50dc5a14d37b
Thu Nov 2 17:51:31 2006 John Ellis <johne@verizon.net>
gqview
parents:
86
diff
changeset
|
153 case GDK_Menu: |
50dc5a14d37b
Thu Nov 2 17:51:31 2006 John Ellis <johne@verizon.net>
gqview
parents:
86
diff
changeset
|
154 layout_image_menu_popup(lw); |
50dc5a14d37b
Thu Nov 2 17:51:31 2006 John Ellis <johne@verizon.net>
gqview
parents:
86
diff
changeset
|
155 break; |
50dc5a14d37b
Thu Nov 2 17:51:31 2006 John Ellis <johne@verizon.net>
gqview
parents:
86
diff
changeset
|
156 default: |
50dc5a14d37b
Thu Nov 2 17:51:31 2006 John Ellis <johne@verizon.net>
gqview
parents:
86
diff
changeset
|
157 stop_signal = FALSE; |
50dc5a14d37b
Thu Nov 2 17:51:31 2006 John Ellis <johne@verizon.net>
gqview
parents:
86
diff
changeset
|
158 break; |
50dc5a14d37b
Thu Nov 2 17:51:31 2006 John Ellis <johne@verizon.net>
gqview
parents:
86
diff
changeset
|
159 } |
50dc5a14d37b
Thu Nov 2 17:51:31 2006 John Ellis <johne@verizon.net>
gqview
parents:
86
diff
changeset
|
160 } |
9 | 161 } |
162 | |
163 if (x != 0 || y!= 0) | |
164 { | |
165 keyboard_scroll_calc(&x, &y, event); | |
1047 | 166 layout_image_scroll(lw, x, y, (event->state & GDK_SHIFT_MASK)); |
9 | 167 } |
168 | |
169 return stop_signal; | |
170 } | |
171 | |
172 void layout_keyboard_init(LayoutWindow *lw, GtkWidget *window) | |
173 { | |
174 g_signal_connect(G_OBJECT(window), "key_press_event", | |
175 G_CALLBACK(layout_key_press_cb), lw); | |
176 } | |
177 | |
178 /* | |
179 *----------------------------------------------------------------------------- | |
180 * menu callbacks | |
181 *----------------------------------------------------------------------------- | |
182 */ | |
442 | 183 |
184 | |
160 | 185 static GtkWidget *layout_window(LayoutWindow *lw) |
186 { | |
187 return lw->full_screen ? lw->full_screen->window : lw->window; | |
188 } | |
9 | 189 |
894 | 190 static void layout_exit_fullscreen(LayoutWindow *lw) |
191 { | |
192 if (!lw->full_screen) return; | |
193 layout_image_full_screen_stop(lw); | |
194 } | |
195 | |
9 | 196 static void layout_menu_new_window_cb(GtkAction *action, gpointer data) |
197 { | |
198 LayoutWindow *lw = data; | |
199 LayoutWindow *nw; | |
1472 | 200 LayoutOptions lop; |
1436
d7a6fb7a90dd
completely separated global and layout window options
nadvornik
parents:
1433
diff
changeset
|
201 gboolean tmp = options->save_window_positions; |
d7a6fb7a90dd
completely separated global and layout window options
nadvornik
parents:
1433
diff
changeset
|
202 options->save_window_positions = FALSE; /* let the windowmanager decide for the first time */ |
1472 | 203 |
894 | 204 layout_exit_fullscreen(lw); |
160 | 205 |
1436
d7a6fb7a90dd
completely separated global and layout window options
nadvornik
parents:
1433
diff
changeset
|
206 layout_sync_options_with_current_state(lw); |
1472 | 207 lop = lw->options; /* we can copy it directly, no strings are modified */ |
208 | |
209 lop.id = NULL; /* get a new id */ | |
210 nw = layout_new(NULL, &lop); | |
329 | 211 layout_sort_set(nw, options->file_sort.method, options->file_sort.ascending); |
783 | 212 layout_set_fd(nw, lw->dir_fd); |
1436
d7a6fb7a90dd
completely separated global and layout window options
nadvornik
parents:
1433
diff
changeset
|
213 options->save_window_positions = tmp; |
9 | 214 } |
215 | |
216 static void layout_menu_new_cb(GtkAction *action, gpointer data) | |
217 { | |
160 | 218 LayoutWindow *lw = data; |
894 | 219 |
220 layout_exit_fullscreen(lw); | |
9 | 221 collection_window_new(NULL); |
222 } | |
223 | |
224 static void layout_menu_open_cb(GtkAction *action, gpointer data) | |
225 { | |
160 | 226 LayoutWindow *lw = data; |
894 | 227 |
228 layout_exit_fullscreen(lw); | |
9 | 229 collection_dialog_load(NULL); |
230 } | |
231 | |
232 static void layout_menu_search_cb(GtkAction *action, gpointer data) | |
233 { | |
234 LayoutWindow *lw = data; | |
235 | |
894 | 236 layout_exit_fullscreen(lw); |
783 | 237 search_new(lw->dir_fd, layout_image_get_fd(lw)); |
9 | 238 } |
239 | |
240 static void layout_menu_dupes_cb(GtkAction *action, gpointer data) | |
241 { | |
160 | 242 LayoutWindow *lw = data; |
243 | |
894 | 244 layout_exit_fullscreen(lw); |
9 | 245 dupe_window_new(DUPE_MATCH_NAME); |
246 } | |
247 | |
12
147f4c4b9025
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
9
diff
changeset
|
248 static void layout_menu_pan_cb(GtkAction *action, gpointer data) |
147f4c4b9025
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
9
diff
changeset
|
249 { |
147f4c4b9025
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
9
diff
changeset
|
250 LayoutWindow *lw = data; |
147f4c4b9025
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
9
diff
changeset
|
251 |
894 | 252 layout_exit_fullscreen(lw); |
783 | 253 pan_window_new(lw->dir_fd); |
12
147f4c4b9025
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
9
diff
changeset
|
254 } |
147f4c4b9025
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
9
diff
changeset
|
255 |
9 | 256 static void layout_menu_print_cb(GtkAction *action, gpointer data) |
257 { | |
258 LayoutWindow *lw = data; | |
259 | |
160 | 260 print_window_new(layout_image_get_fd(lw), layout_selection_list(lw), layout_list(lw), layout_window(lw)); |
9 | 261 } |
262 | |
263 static void layout_menu_dir_cb(GtkAction *action, gpointer data) | |
264 { | |
265 LayoutWindow *lw = data; | |
266 | |
1231 | 267 file_util_create_dir(lw->dir_fd, layout_window(lw), NULL, NULL); |
9 | 268 } |
269 | |
270 static void layout_menu_copy_cb(GtkAction *action, gpointer data) | |
271 { | |
272 LayoutWindow *lw = data; | |
273 | |
160 | 274 file_util_copy(NULL, layout_selection_list(lw), NULL, layout_window(lw)); |
9 | 275 } |
276 | |
497 | 277 static void layout_menu_copy_path_cb(GtkAction *action, gpointer data) |
278 { | |
279 LayoutWindow *lw = data; | |
280 | |
281 file_util_copy_path_list_to_clipboard(layout_selection_list(lw)); | |
282 } | |
283 | |
9 | 284 static void layout_menu_move_cb(GtkAction *action, gpointer data) |
285 { | |
286 LayoutWindow *lw = data; | |
287 | |
160 | 288 file_util_move(NULL, layout_selection_list(lw), NULL, layout_window(lw)); |
9 | 289 } |
290 | |
291 static void layout_menu_rename_cb(GtkAction *action, gpointer data) | |
292 { | |
293 LayoutWindow *lw = data; | |
294 | |
160 | 295 file_util_rename(NULL, layout_selection_list(lw), layout_window(lw)); |
9 | 296 } |
297 | |
298 static void layout_menu_delete_cb(GtkAction *action, gpointer data) | |
299 { | |
300 LayoutWindow *lw = data; | |
301 | |
160 | 302 file_util_delete(NULL, layout_selection_list(lw), layout_window(lw)); |
9 | 303 } |
304 | |
305 static void layout_menu_close_cb(GtkAction *action, gpointer data) | |
306 { | |
307 LayoutWindow *lw = data; | |
308 | |
894 | 309 layout_exit_fullscreen(lw); |
9 | 310 layout_close(lw); |
311 } | |
312 | |
313 static void layout_menu_exit_cb(GtkAction *action, gpointer data) | |
314 { | |
278 | 315 exit_program(); |
9 | 316 } |
317 | |
318 static void layout_menu_alter_90_cb(GtkAction *action, gpointer data) | |
319 { | |
320 LayoutWindow *lw = data; | |
321 | |
322 layout_image_alter(lw, ALTER_ROTATE_90); | |
323 } | |
324 | |
325 static void layout_menu_alter_90cc_cb(GtkAction *action, gpointer data) | |
326 { | |
327 LayoutWindow *lw = data; | |
328 | |
329 layout_image_alter(lw, ALTER_ROTATE_90_CC); | |
330 } | |
331 | |
332 static void layout_menu_alter_180_cb(GtkAction *action, gpointer data) | |
333 { | |
334 LayoutWindow *lw = data; | |
335 | |
336 layout_image_alter(lw, ALTER_ROTATE_180); | |
337 } | |
338 | |
339 static void layout_menu_alter_mirror_cb(GtkAction *action, gpointer data) | |
340 { | |
341 LayoutWindow *lw = data; | |
342 | |
343 layout_image_alter(lw, ALTER_MIRROR); | |
344 } | |
345 | |
346 static void layout_menu_alter_flip_cb(GtkAction *action, gpointer data) | |
347 { | |
348 LayoutWindow *lw = data; | |
349 | |
350 layout_image_alter(lw, ALTER_FLIP); | |
351 } | |
352 | |
82
a4c1b7014e6e
Thu Oct 19 15:20:51 2006 John Ellis <johne@verizon.net>
gqview
parents:
41
diff
changeset
|
353 static void layout_menu_alter_desaturate_cb(GtkAction *action, gpointer data) |
a4c1b7014e6e
Thu Oct 19 15:20:51 2006 John Ellis <johne@verizon.net>
gqview
parents:
41
diff
changeset
|
354 { |
a4c1b7014e6e
Thu Oct 19 15:20:51 2006 John Ellis <johne@verizon.net>
gqview
parents:
41
diff
changeset
|
355 LayoutWindow *lw = data; |
a4c1b7014e6e
Thu Oct 19 15:20:51 2006 John Ellis <johne@verizon.net>
gqview
parents:
41
diff
changeset
|
356 |
a4c1b7014e6e
Thu Oct 19 15:20:51 2006 John Ellis <johne@verizon.net>
gqview
parents:
41
diff
changeset
|
357 layout_image_alter(lw, ALTER_DESATURATE); |
a4c1b7014e6e
Thu Oct 19 15:20:51 2006 John Ellis <johne@verizon.net>
gqview
parents:
41
diff
changeset
|
358 } |
a4c1b7014e6e
Thu Oct 19 15:20:51 2006 John Ellis <johne@verizon.net>
gqview
parents:
41
diff
changeset
|
359 |
439 | 360 static void layout_menu_alter_none_cb(GtkAction *action, gpointer data) |
361 { | |
362 LayoutWindow *lw = data; | |
363 | |
364 layout_image_alter(lw, ALTER_NONE); | |
365 } | |
366 | |
9 | 367 static void layout_menu_config_cb(GtkAction *action, gpointer data) |
368 { | |
160 | 369 LayoutWindow *lw = data; |
370 | |
894 | 371 layout_exit_fullscreen(lw); |
9 | 372 show_config_window(); |
373 } | |
374 | |
1479 | 375 static void layout_menu_editors_cb(GtkAction *action, gpointer data) |
376 { | |
377 LayoutWindow *lw = data; | |
378 | |
379 layout_exit_fullscreen(lw); | |
380 show_editor_list_window(); | |
381 } | |
382 | |
1436
d7a6fb7a90dd
completely separated global and layout window options
nadvornik
parents:
1433
diff
changeset
|
383 static void layout_menu_layout_config_cb(GtkAction *action, gpointer data) |
d7a6fb7a90dd
completely separated global and layout window options
nadvornik
parents:
1433
diff
changeset
|
384 { |
d7a6fb7a90dd
completely separated global and layout window options
nadvornik
parents:
1433
diff
changeset
|
385 LayoutWindow *lw = data; |
d7a6fb7a90dd
completely separated global and layout window options
nadvornik
parents:
1433
diff
changeset
|
386 |
d7a6fb7a90dd
completely separated global and layout window options
nadvornik
parents:
1433
diff
changeset
|
387 layout_exit_fullscreen(lw); |
d7a6fb7a90dd
completely separated global and layout window options
nadvornik
parents:
1433
diff
changeset
|
388 layout_show_config_window(lw); |
d7a6fb7a90dd
completely separated global and layout window options
nadvornik
parents:
1433
diff
changeset
|
389 } |
d7a6fb7a90dd
completely separated global and layout window options
nadvornik
parents:
1433
diff
changeset
|
390 |
9 | 391 static void layout_menu_remove_thumb_cb(GtkAction *action, gpointer data) |
392 { | |
160 | 393 LayoutWindow *lw = data; |
394 | |
894 | 395 layout_exit_fullscreen(lw); |
9 | 396 cache_manager_show(); |
397 } | |
398 | |
399 static void layout_menu_wallpaper_cb(GtkAction *action, gpointer data) | |
400 { | |
401 LayoutWindow *lw = data; | |
402 | |
403 layout_image_to_root(lw); | |
404 } | |
405 | |
1047 | 406 /* single window zoom */ |
9 | 407 static void layout_menu_zoom_in_cb(GtkAction *action, gpointer data) |
408 { | |
409 LayoutWindow *lw = data; | |
410 | |
1047 | 411 layout_image_zoom_adjust(lw, get_zoom_increment(), FALSE); |
9 | 412 } |
413 | |
414 static void layout_menu_zoom_out_cb(GtkAction *action, gpointer data) | |
415 { | |
416 LayoutWindow *lw = data; | |
417 | |
1047 | 418 layout_image_zoom_adjust(lw, -get_zoom_increment(), FALSE); |
9 | 419 } |
420 | |
421 static void layout_menu_zoom_1_1_cb(GtkAction *action, gpointer data) | |
422 { | |
423 LayoutWindow *lw = data; | |
424 | |
1047 | 425 layout_image_zoom_set(lw, 1.0, FALSE); |
9 | 426 } |
427 | |
428 static void layout_menu_zoom_fit_cb(GtkAction *action, gpointer data) | |
429 { | |
430 LayoutWindow *lw = data; | |
431 | |
1047 | 432 layout_image_zoom_set(lw, 0.0, FALSE); |
9 | 433 } |
434 | |
159 | 435 static void layout_menu_zoom_fit_hor_cb(GtkAction *action, gpointer data) |
436 { | |
437 LayoutWindow *lw = data; | |
438 | |
1268
8c39e0bd7e08
Invert Horizontally vs vertically zoom fit, it was a TRUE/FALSE mismatch, reported by Christopher Beland.
zas_
parents:
1231
diff
changeset
|
439 layout_image_zoom_set_fill_geometry(lw, FALSE, FALSE); |
159 | 440 } |
441 | |
442 static void layout_menu_zoom_fit_vert_cb(GtkAction *action, gpointer data) | |
443 { | |
444 LayoutWindow *lw = data; | |
445 | |
1268
8c39e0bd7e08
Invert Horizontally vs vertically zoom fit, it was a TRUE/FALSE mismatch, reported by Christopher Beland.
zas_
parents:
1231
diff
changeset
|
446 layout_image_zoom_set_fill_geometry(lw, TRUE, FALSE); |
159 | 447 } |
448 | |
449 static void layout_menu_zoom_2_1_cb(GtkAction *action, gpointer data) | |
450 { | |
451 LayoutWindow *lw = data; | |
452 | |
1047 | 453 layout_image_zoom_set(lw, 2.0, FALSE); |
159 | 454 } |
455 | |
456 static void layout_menu_zoom_3_1_cb(GtkAction *action, gpointer data) | |
457 { | |
458 LayoutWindow *lw = data; | |
459 | |
1047 | 460 layout_image_zoom_set(lw, 3.0, FALSE); |
159 | 461 } |
462 static void layout_menu_zoom_4_1_cb(GtkAction *action, gpointer data) | |
463 { | |
464 LayoutWindow *lw = data; | |
465 | |
1047 | 466 layout_image_zoom_set(lw, 4.0, FALSE); |
159 | 467 } |
468 | |
469 static void layout_menu_zoom_1_2_cb(GtkAction *action, gpointer data) | |
470 { | |
471 LayoutWindow *lw = data; | |
472 | |
1047 | 473 layout_image_zoom_set(lw, -2.0, FALSE); |
159 | 474 } |
475 | |
476 static void layout_menu_zoom_1_3_cb(GtkAction *action, gpointer data) | |
477 { | |
478 LayoutWindow *lw = data; | |
479 | |
1047 | 480 layout_image_zoom_set(lw, -3.0, FALSE); |
159 | 481 } |
482 | |
483 static void layout_menu_zoom_1_4_cb(GtkAction *action, gpointer data) | |
484 { | |
485 LayoutWindow *lw = data; | |
486 | |
1047 | 487 layout_image_zoom_set(lw, -4.0, FALSE); |
488 } | |
489 | |
490 /* connected zoom */ | |
491 static void layout_menu_connect_zoom_in_cb(GtkAction *action, gpointer data) | |
492 { | |
493 LayoutWindow *lw = data; | |
494 | |
495 layout_image_zoom_adjust(lw, get_zoom_increment(), TRUE); | |
496 } | |
497 | |
498 static void layout_menu_connect_zoom_out_cb(GtkAction *action, gpointer data) | |
499 { | |
500 LayoutWindow *lw = data; | |
501 | |
502 layout_image_zoom_adjust(lw, -get_zoom_increment(), TRUE); | |
503 } | |
504 | |
505 static void layout_menu_connect_zoom_1_1_cb(GtkAction *action, gpointer data) | |
506 { | |
507 LayoutWindow *lw = data; | |
508 | |
509 layout_image_zoom_set(lw, 1.0, TRUE); | |
510 } | |
511 | |
512 static void layout_menu_connect_zoom_fit_cb(GtkAction *action, gpointer data) | |
513 { | |
514 LayoutWindow *lw = data; | |
515 | |
516 layout_image_zoom_set(lw, 0.0, TRUE); | |
517 } | |
518 | |
519 static void layout_menu_connect_zoom_fit_hor_cb(GtkAction *action, gpointer data) | |
520 { | |
521 LayoutWindow *lw = data; | |
522 | |
1268
8c39e0bd7e08
Invert Horizontally vs vertically zoom fit, it was a TRUE/FALSE mismatch, reported by Christopher Beland.
zas_
parents:
1231
diff
changeset
|
523 layout_image_zoom_set_fill_geometry(lw, FALSE, TRUE); |
1047 | 524 } |
525 | |
526 static void layout_menu_connect_zoom_fit_vert_cb(GtkAction *action, gpointer data) | |
527 { | |
528 LayoutWindow *lw = data; | |
529 | |
1268
8c39e0bd7e08
Invert Horizontally vs vertically zoom fit, it was a TRUE/FALSE mismatch, reported by Christopher Beland.
zas_
parents:
1231
diff
changeset
|
530 layout_image_zoom_set_fill_geometry(lw, TRUE, TRUE); |
1047 | 531 } |
532 | |
533 static void layout_menu_connect_zoom_2_1_cb(GtkAction *action, gpointer data) | |
534 { | |
535 LayoutWindow *lw = data; | |
536 | |
537 layout_image_zoom_set(lw, 2.0, TRUE); | |
538 } | |
539 | |
540 static void layout_menu_connect_zoom_3_1_cb(GtkAction *action, gpointer data) | |
541 { | |
542 LayoutWindow *lw = data; | |
543 | |
544 layout_image_zoom_set(lw, 3.0, TRUE); | |
545 } | |
546 static void layout_menu_connect_zoom_4_1_cb(GtkAction *action, gpointer data) | |
547 { | |
548 LayoutWindow *lw = data; | |
549 | |
550 layout_image_zoom_set(lw, 4.0, TRUE); | |
551 } | |
552 | |
553 static void layout_menu_connect_zoom_1_2_cb(GtkAction *action, gpointer data) | |
554 { | |
555 LayoutWindow *lw = data; | |
556 | |
557 layout_image_zoom_set(lw, -2.0, TRUE); | |
558 } | |
559 | |
560 static void layout_menu_connect_zoom_1_3_cb(GtkAction *action, gpointer data) | |
561 { | |
562 LayoutWindow *lw = data; | |
563 | |
564 layout_image_zoom_set(lw, -3.0, TRUE); | |
565 } | |
566 | |
567 static void layout_menu_connect_zoom_1_4_cb(GtkAction *action, gpointer data) | |
568 { | |
569 LayoutWindow *lw = data; | |
570 | |
571 layout_image_zoom_set(lw, -4.0, TRUE); | |
159 | 572 } |
573 | |
574 | |
156
dd6dc0a55d3d
better integration of split image functions into menu
nadvornik
parents:
138
diff
changeset
|
575 static void layout_menu_split_cb(GtkRadioAction *action, GtkRadioAction *current, gpointer data) |
dd6dc0a55d3d
better integration of split image functions into menu
nadvornik
parents:
138
diff
changeset
|
576 { |
dd6dc0a55d3d
better integration of split image functions into menu
nadvornik
parents:
138
diff
changeset
|
577 LayoutWindow *lw = data; |
894 | 578 ImageSplitMode mode; |
160 | 579 |
894 | 580 layout_exit_fullscreen(lw); |
581 mode = gtk_radio_action_get_current_value(action); | |
156
dd6dc0a55d3d
better integration of split image functions into menu
nadvornik
parents:
138
diff
changeset
|
582 layout_split_change(lw, mode); |
dd6dc0a55d3d
better integration of split image functions into menu
nadvornik
parents:
138
diff
changeset
|
583 } |
dd6dc0a55d3d
better integration of split image functions into menu
nadvornik
parents:
138
diff
changeset
|
584 |
dd6dc0a55d3d
better integration of split image functions into menu
nadvornik
parents:
138
diff
changeset
|
585 |
9 | 586 static void layout_menu_thumb_cb(GtkToggleAction *action, gpointer data) |
587 { | |
588 LayoutWindow *lw = data; | |
589 | |
590 layout_thumb_set(lw, gtk_toggle_action_get_active(action)); | |
591 } | |
592 | |
132 | 593 |
9 | 594 static void layout_menu_list_cb(GtkRadioAction *action, GtkRadioAction *current, gpointer data) |
595 { | |
596 LayoutWindow *lw = data; | |
894 | 597 |
598 layout_exit_fullscreen(lw); | |
1309 | 599 layout_views_set(lw, lw->options.dir_view_type, (gtk_radio_action_get_current_value(action) == 1) ? FILEVIEW_ICON : FILEVIEW_LIST); |
9 | 600 } |
601 | |
380
5afe77bb563a
Introduce a new struct ViewDir to handle directory views common
zas_
parents:
343
diff
changeset
|
602 static void layout_menu_view_dir_as_cb(GtkRadioAction *action, GtkRadioAction *current, gpointer data) |
9 | 603 { |
604 LayoutWindow *lw = data; | |
605 | |
894 | 606 layout_exit_fullscreen(lw); |
1412 | 607 layout_views_set(lw, (DirViewType) gtk_radio_action_get_current_value(action), lw->options.file_view_type); |
9 | 608 } |
609 | |
159 | 610 static void layout_menu_view_in_new_window_cb(GtkAction *action, gpointer data) |
611 { | |
612 LayoutWindow *lw = data; | |
613 | |
894 | 614 layout_exit_fullscreen(lw); |
159 | 615 view_window_new(layout_image_get_fd(lw)); |
616 } | |
617 | |
9 | 618 static void layout_menu_fullscreen_cb(GtkAction *action, gpointer data) |
619 { | |
620 LayoutWindow *lw = data; | |
621 | |
622 layout_image_full_screen_toggle(lw); | |
623 } | |
624 | |
428
af843364b3ea
I have finally found how to add alternative hotkeys
nadvornik
parents:
398
diff
changeset
|
625 static void layout_menu_escape_cb(GtkAction *action, gpointer data) |
af843364b3ea
I have finally found how to add alternative hotkeys
nadvornik
parents:
398
diff
changeset
|
626 { |
af843364b3ea
I have finally found how to add alternative hotkeys
nadvornik
parents:
398
diff
changeset
|
627 LayoutWindow *lw = data; |
af843364b3ea
I have finally found how to add alternative hotkeys
nadvornik
parents:
398
diff
changeset
|
628 |
894 | 629 layout_exit_fullscreen(lw); |
630 | |
631 /* FIXME:interrupting thumbs no longer allowed */ | |
428
af843364b3ea
I have finally found how to add alternative hotkeys
nadvornik
parents:
398
diff
changeset
|
632 #if 0 |
894 | 633 interrupt_thumbs(); |
428
af843364b3ea
I have finally found how to add alternative hotkeys
nadvornik
parents:
398
diff
changeset
|
634 #endif |
af843364b3ea
I have finally found how to add alternative hotkeys
nadvornik
parents:
398
diff
changeset
|
635 } |
af843364b3ea
I have finally found how to add alternative hotkeys
nadvornik
parents:
398
diff
changeset
|
636 |
159 | 637 static void layout_menu_overlay_cb(GtkAction *action, gpointer data) |
638 { | |
639 LayoutWindow *lw = data; | |
640 | |
482 | 641 image_osd_toggle(lw->image); |
273
e0e2c2b72c5a
reworked the histogram patch by Uwe Ohse, most of the code is in
nadvornik
parents:
249
diff
changeset
|
642 } |
e0e2c2b72c5a
reworked the histogram patch by Uwe Ohse, most of the code is in
nadvornik
parents:
249
diff
changeset
|
643 |
e0e2c2b72c5a
reworked the histogram patch by Uwe Ohse, most of the code is in
nadvornik
parents:
249
diff
changeset
|
644 static void layout_menu_histogram_chan_cb(GtkAction *action, gpointer data) |
e0e2c2b72c5a
reworked the histogram patch by Uwe Ohse, most of the code is in
nadvornik
parents:
249
diff
changeset
|
645 { |
e0e2c2b72c5a
reworked the histogram patch by Uwe Ohse, most of the code is in
nadvornik
parents:
249
diff
changeset
|
646 LayoutWindow *lw = data; |
e0e2c2b72c5a
reworked the histogram patch by Uwe Ohse, most of the code is in
nadvornik
parents:
249
diff
changeset
|
647 |
e0e2c2b72c5a
reworked the histogram patch by Uwe Ohse, most of the code is in
nadvornik
parents:
249
diff
changeset
|
648 image_osd_histogram_chan_toggle(lw->image); |
e0e2c2b72c5a
reworked the histogram patch by Uwe Ohse, most of the code is in
nadvornik
parents:
249
diff
changeset
|
649 } |
e0e2c2b72c5a
reworked the histogram patch by Uwe Ohse, most of the code is in
nadvornik
parents:
249
diff
changeset
|
650 |
e0e2c2b72c5a
reworked the histogram patch by Uwe Ohse, most of the code is in
nadvornik
parents:
249
diff
changeset
|
651 static void layout_menu_histogram_log_cb(GtkAction *action, gpointer data) |
e0e2c2b72c5a
reworked the histogram patch by Uwe Ohse, most of the code is in
nadvornik
parents:
249
diff
changeset
|
652 { |
e0e2c2b72c5a
reworked the histogram patch by Uwe Ohse, most of the code is in
nadvornik
parents:
249
diff
changeset
|
653 LayoutWindow *lw = data; |
e0e2c2b72c5a
reworked the histogram patch by Uwe Ohse, most of the code is in
nadvornik
parents:
249
diff
changeset
|
654 |
e0e2c2b72c5a
reworked the histogram patch by Uwe Ohse, most of the code is in
nadvornik
parents:
249
diff
changeset
|
655 image_osd_histogram_log_toggle(lw->image); |
159 | 656 } |
657 | |
9 | 658 static void layout_menu_refresh_cb(GtkAction *action, gpointer data) |
659 { | |
660 LayoutWindow *lw = data; | |
661 | |
662 layout_refresh(lw); | |
663 } | |
664 | |
1410 | 665 static void layout_menu_bar_exif_cb(GtkAction *action, gpointer data) |
666 { | |
667 LayoutWindow *lw = data; | |
668 | |
669 layout_exit_fullscreen(lw); | |
670 layout_exif_window_new(lw); | |
671 } | |
672 | |
9 | 673 static void layout_menu_float_cb(GtkToggleAction *action, gpointer data) |
674 { | |
675 LayoutWindow *lw = data; | |
676 | |
1309 | 677 if (lw->options.tools_float == gtk_toggle_action_get_active(action)) return; |
1318
fb76c291b00f
fixed --fullscreen option together with enabled bar
nadvornik
parents:
1317
diff
changeset
|
678 |
fb76c291b00f
fixed --fullscreen option together with enabled bar
nadvornik
parents:
1317
diff
changeset
|
679 layout_exit_fullscreen(lw); |
894 | 680 layout_tools_float_toggle(lw); |
9 | 681 } |
682 | |
683 static void layout_menu_hide_cb(GtkAction *action, gpointer data) | |
684 { | |
685 LayoutWindow *lw = data; | |
686 | |
894 | 687 layout_exit_fullscreen(lw); |
9 | 688 layout_tools_hide_toggle(lw); |
689 } | |
690 | |
691 static void layout_menu_toolbar_cb(GtkToggleAction *action, gpointer data) | |
692 { | |
693 LayoutWindow *lw = data; | |
894 | 694 |
1318
fb76c291b00f
fixed --fullscreen option together with enabled bar
nadvornik
parents:
1317
diff
changeset
|
695 if (lw->options.toolbar_hidden == gtk_toggle_action_get_active(action)) return; |
9 | 696 |
1318
fb76c291b00f
fixed --fullscreen option together with enabled bar
nadvornik
parents:
1317
diff
changeset
|
697 layout_exit_fullscreen(lw); |
894 | 698 layout_toolbar_toggle(lw); |
9 | 699 } |
700 | |
1375
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1348
diff
changeset
|
701 static void layout_menu_info_pixel_cb(GtkToggleAction *action, gpointer data) |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1348
diff
changeset
|
702 { |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1348
diff
changeset
|
703 LayoutWindow *lw = data; |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1348
diff
changeset
|
704 |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1348
diff
changeset
|
705 if (lw->options.info_pixel_hidden == gtk_toggle_action_get_active(action)) return; |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1348
diff
changeset
|
706 |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1348
diff
changeset
|
707 layout_exit_fullscreen(lw); |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1348
diff
changeset
|
708 layout_info_pixel_toggle(lw); |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1348
diff
changeset
|
709 } |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1348
diff
changeset
|
710 |
1318
fb76c291b00f
fixed --fullscreen option together with enabled bar
nadvornik
parents:
1317
diff
changeset
|
711 /* NOTE: these callbacks are called also from layout_util_sync_views */ |
1291
50ae02a4a675
replaced bar_info with an universal bar, restored the original
nadvornik
parents:
1285
diff
changeset
|
712 static void layout_menu_bar_cb(GtkToggleAction *action, gpointer data) |
9 | 713 { |
714 LayoutWindow *lw = data; | |
894 | 715 |
1318
fb76c291b00f
fixed --fullscreen option together with enabled bar
nadvornik
parents:
1317
diff
changeset
|
716 if (layout_bar_enabled(lw) == gtk_toggle_action_get_active(action)) return; |
9 | 717 |
1318
fb76c291b00f
fixed --fullscreen option together with enabled bar
nadvornik
parents:
1317
diff
changeset
|
718 layout_exit_fullscreen(lw); |
1291
50ae02a4a675
replaced bar_info with an universal bar, restored the original
nadvornik
parents:
1285
diff
changeset
|
719 layout_bar_toggle(lw); |
9 | 720 } |
721 | |
722 static void layout_menu_bar_sort_cb(GtkToggleAction *action, gpointer data) | |
723 { | |
724 LayoutWindow *lw = data; | |
894 | 725 |
1320 | 726 if (layout_bar_sort_enabled(lw) == gtk_toggle_action_get_active(action)) return; |
9 | 727 |
1318
fb76c291b00f
fixed --fullscreen option together with enabled bar
nadvornik
parents:
1317
diff
changeset
|
728 layout_exit_fullscreen(lw); |
894 | 729 layout_bar_sort_toggle(lw); |
9 | 730 } |
731 | |
732 static void layout_menu_slideshow_cb(GtkAction *action, gpointer data) | |
733 { | |
734 LayoutWindow *lw = data; | |
735 | |
736 layout_image_slideshow_toggle(lw); | |
737 } | |
738 | |
428
af843364b3ea
I have finally found how to add alternative hotkeys
nadvornik
parents:
398
diff
changeset
|
739 static void layout_menu_slideshow_pause_cb(GtkAction *action, gpointer data) |
af843364b3ea
I have finally found how to add alternative hotkeys
nadvornik
parents:
398
diff
changeset
|
740 { |
af843364b3ea
I have finally found how to add alternative hotkeys
nadvornik
parents:
398
diff
changeset
|
741 LayoutWindow *lw = data; |
af843364b3ea
I have finally found how to add alternative hotkeys
nadvornik
parents:
398
diff
changeset
|
742 |
af843364b3ea
I have finally found how to add alternative hotkeys
nadvornik
parents:
398
diff
changeset
|
743 layout_image_slideshow_pause_toggle(lw); |
af843364b3ea
I have finally found how to add alternative hotkeys
nadvornik
parents:
398
diff
changeset
|
744 } |
af843364b3ea
I have finally found how to add alternative hotkeys
nadvornik
parents:
398
diff
changeset
|
745 |
9 | 746 static void layout_menu_help_cb(GtkAction *action, gpointer data) |
747 { | |
160 | 748 LayoutWindow *lw = data; |
894 | 749 |
750 layout_exit_fullscreen(lw); | |
9 | 751 help_window_show("html_contents"); |
752 } | |
753 | |
754 static void layout_menu_help_keys_cb(GtkAction *action, gpointer data) | |
755 { | |
160 | 756 LayoutWindow *lw = data; |
894 | 757 |
758 layout_exit_fullscreen(lw); | |
9 | 759 help_window_show("documentation"); |
760 } | |
761 | |
762 static void layout_menu_notes_cb(GtkAction *action, gpointer data) | |
763 { | |
160 | 764 LayoutWindow *lw = data; |
894 | 765 |
766 layout_exit_fullscreen(lw); | |
9 | 767 help_window_show("release_notes"); |
768 } | |
769 | |
770 static void layout_menu_about_cb(GtkAction *action, gpointer data) | |
771 { | |
160 | 772 LayoutWindow *lw = data; |
894 | 773 |
774 layout_exit_fullscreen(lw); | |
9 | 775 show_about_window(); |
776 } | |
777 | |
678
6d6f042b8ca5
Add a log window that shows normal and debug messages. For now, it was added to Help menu.
zas_
parents:
654
diff
changeset
|
778 static void layout_menu_log_window_cb(GtkAction *action, gpointer data) |
6d6f042b8ca5
Add a log window that shows normal and debug messages. For now, it was added to Help menu.
zas_
parents:
654
diff
changeset
|
779 { |
6d6f042b8ca5
Add a log window that shows normal and debug messages. For now, it was added to Help menu.
zas_
parents:
654
diff
changeset
|
780 LayoutWindow *lw = data; |
894 | 781 |
782 layout_exit_fullscreen(lw); | |
678
6d6f042b8ca5
Add a log window that shows normal and debug messages. For now, it was added to Help menu.
zas_
parents:
654
diff
changeset
|
783 log_window_new(); |
6d6f042b8ca5
Add a log window that shows normal and debug messages. For now, it was added to Help menu.
zas_
parents:
654
diff
changeset
|
784 } |
6d6f042b8ca5
Add a log window that shows normal and debug messages. For now, it was added to Help menu.
zas_
parents:
654
diff
changeset
|
785 |
162
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
786 |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
787 /* |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
788 *----------------------------------------------------------------------------- |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
789 * select menu |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
790 *----------------------------------------------------------------------------- |
442 | 791 */ |
162
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
792 |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
793 static void layout_menu_select_all_cb(GtkAction *action, gpointer data) |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
794 { |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
795 LayoutWindow *lw = data; |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
796 |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
797 layout_select_all(lw); |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
798 } |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
799 |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
800 static void layout_menu_unselect_all_cb(GtkAction *action, gpointer data) |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
801 { |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
802 LayoutWindow *lw = data; |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
803 |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
804 layout_select_none(lw); |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
805 } |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
806 |
601 | 807 static void layout_menu_invert_selection_cb(GtkAction *action, gpointer data) |
808 { | |
809 LayoutWindow *lw = data; | |
810 | |
811 layout_select_invert(lw); | |
812 } | |
813 | |
162
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
814 static void layout_menu_marks_cb(GtkToggleAction *action, gpointer data) |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
815 { |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
816 LayoutWindow *lw = data; |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
817 |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
818 layout_marks_set(lw, gtk_toggle_action_get_active(action)); |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
819 } |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
820 |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
821 |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
822 static void layout_menu_set_mark_sel_cb(GtkAction *action, gpointer data) |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
823 { |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
824 LayoutWindow *lw = data; |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
825 gint mark = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(action), "mark_num")); |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
826 g_assert(mark >= 1 && mark <= FILEDATA_MARKS_SIZE); |
442 | 827 |
162
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
828 layout_selection_to_mark(lw, mark, STM_MODE_SET); |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
829 } |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
830 |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
831 static void layout_menu_res_mark_sel_cb(GtkAction *action, gpointer data) |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
832 { |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
833 LayoutWindow *lw = data; |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
834 gint mark = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(action), "mark_num")); |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
835 g_assert(mark >= 1 && mark <= FILEDATA_MARKS_SIZE); |
442 | 836 |
162
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
837 layout_selection_to_mark(lw, mark, STM_MODE_RESET); |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
838 } |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
839 |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
840 static void layout_menu_toggle_mark_sel_cb(GtkAction *action, gpointer data) |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
841 { |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
842 LayoutWindow *lw = data; |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
843 gint mark = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(action), "mark_num")); |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
844 g_assert(mark >= 1 && mark <= FILEDATA_MARKS_SIZE); |
442 | 845 |
162
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
846 layout_selection_to_mark(lw, mark, STM_MODE_TOGGLE); |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
847 } |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
848 |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
849 static void layout_menu_sel_mark_cb(GtkAction *action, gpointer data) |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
850 { |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
851 LayoutWindow *lw = data; |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
852 gint mark = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(action), "mark_num")); |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
853 g_assert(mark >= 1 && mark <= FILEDATA_MARKS_SIZE); |
442 | 854 |
162
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
855 layout_mark_to_selection(lw, mark, MTS_MODE_SET); |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
856 } |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
857 |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
858 static void layout_menu_sel_mark_or_cb(GtkAction *action, gpointer data) |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
859 { |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
860 LayoutWindow *lw = data; |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
861 gint mark = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(action), "mark_num")); |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
862 g_assert(mark >= 1 && mark <= FILEDATA_MARKS_SIZE); |
442 | 863 |
162
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
864 layout_mark_to_selection(lw, mark, MTS_MODE_OR); |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
865 } |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
866 |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
867 static void layout_menu_sel_mark_and_cb(GtkAction *action, gpointer data) |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
868 { |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
869 LayoutWindow *lw = data; |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
870 gint mark = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(action), "mark_num")); |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
871 g_assert(mark >= 1 && mark <= FILEDATA_MARKS_SIZE); |
442 | 872 |
162
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
873 layout_mark_to_selection(lw, mark, MTS_MODE_AND); |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
874 } |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
875 |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
876 static void layout_menu_sel_mark_minus_cb(GtkAction *action, gpointer data) |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
877 { |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
878 LayoutWindow *lw = data; |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
879 gint mark = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(action), "mark_num")); |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
880 g_assert(mark >= 1 && mark <= FILEDATA_MARKS_SIZE); |
442 | 881 |
162
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
882 layout_mark_to_selection(lw, mark, MTS_MODE_MINUS); |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
883 } |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
884 |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
885 |
9 | 886 /* |
887 *----------------------------------------------------------------------------- | |
159 | 888 * go menu |
889 *----------------------------------------------------------------------------- | |
442 | 890 */ |
159 | 891 |
892 static void layout_menu_image_first_cb(GtkAction *action, gpointer data) | |
893 { | |
894 LayoutWindow *lw = data; | |
895 layout_image_first(lw); | |
896 } | |
897 | |
898 static void layout_menu_image_prev_cb(GtkAction *action, gpointer data) | |
899 { | |
900 LayoutWindow *lw = data; | |
901 layout_image_prev(lw); | |
902 } | |
903 | |
904 static void layout_menu_image_next_cb(GtkAction *action, gpointer data) | |
905 { | |
906 LayoutWindow *lw = data; | |
907 layout_image_next(lw); | |
908 } | |
909 | |
910 static void layout_menu_image_last_cb(GtkAction *action, gpointer data) | |
911 { | |
912 LayoutWindow *lw = data; | |
913 layout_image_last(lw); | |
914 } | |
915 | |
1334 | 916 static void layout_menu_back_cb(GtkAction *action, gpointer data) |
917 { | |
918 LayoutWindow *lw = data; | |
919 FileData *dir_fd; | |
920 gchar *path = NULL; | |
921 GList *list = history_list_get_by_key("path_list"); | |
922 gint n = 0; | |
923 | |
924 while (list) | |
925 { | |
926 if (n == 1) { | |
927 /* Previous path from history */ | |
928 path = (gchar *)list->data; | |
929 break; | |
930 } | |
931 list = list->next; | |
932 n++; | |
933 } | |
934 | |
935 if (!path) return; | |
936 | |
937 /* Open previous path */ | |
938 dir_fd = file_data_new_simple(path); | |
939 layout_set_fd(lw, dir_fd); | |
940 file_data_unref(dir_fd); | |
941 } | |
942 | |
943 static void layout_menu_home_cb(GtkAction *action, gpointer data) | |
944 { | |
1436
d7a6fb7a90dd
completely separated global and layout window options
nadvornik
parents:
1433
diff
changeset
|
945 LayoutWindow *lw = data; |
1334 | 946 const gchar *path; |
947 | |
1436
d7a6fb7a90dd
completely separated global and layout window options
nadvornik
parents:
1433
diff
changeset
|
948 if (lw->options.home_path && *lw->options.home_path) |
d7a6fb7a90dd
completely separated global and layout window options
nadvornik
parents:
1433
diff
changeset
|
949 path = lw->options.home_path; |
1334 | 950 else |
951 path = homedir(); | |
952 | |
953 if (path) | |
954 { | |
955 FileData *dir_fd = file_data_new_simple(path); | |
956 layout_set_fd(lw, dir_fd); | |
957 file_data_unref(dir_fd); | |
958 } | |
959 } | |
960 | |
159 | 961 |
962 /* | |
963 *----------------------------------------------------------------------------- | |
9 | 964 * edit menu |
965 *----------------------------------------------------------------------------- | |
442 | 966 */ |
9 | 967 |
968 static void layout_menu_edit_cb(GtkAction *action, gpointer data) | |
969 { | |
970 LayoutWindow *lw = data; | |
971 GList *list; | |
1272 | 972 const gchar *key = gtk_action_get_name(action); |
973 | |
974 if (!editor_window_flag_set(key)) | |
894 | 975 layout_exit_fullscreen(lw); |
160 | 976 |
9 | 977 list = layout_selection_list(lw); |
1272 | 978 file_util_start_editor_from_filelist(key, list, lw->window); |
138 | 979 filelist_free(list); |
9 | 980 } |
981 | |
1272 | 982 #if 0 |
9 | 983 static void layout_menu_edit_update(LayoutWindow *lw) |
984 { | |
985 gint i; | |
986 | |
987 /* main edit menu */ | |
988 | |
989 if (!lw->action_group) return; | |
990 | |
569
fd51eac09ead
Use GQ_EDITOR_GENERIC_SLOTS instead of hardcoded value.
zas_
parents:
556
diff
changeset
|
991 for (i = 0; i < GQ_EDITOR_GENERIC_SLOTS; i++) |
9 | 992 { |
993 gchar *key; | |
994 GtkAction *action; | |
731
fa8f7d7396cf
Introduce an helper function that returns the name of an editor.
zas_
parents:
730
diff
changeset
|
995 const gchar *name; |
fa8f7d7396cf
Introduce an helper function that returns the name of an editor.
zas_
parents:
730
diff
changeset
|
996 |
9 | 997 key = g_strdup_printf("Editor%d", i); |
998 | |
999 action = gtk_action_group_get_action(lw->action_group, key); | |
1000 g_object_set_data(G_OBJECT(action), "edit_index", GINT_TO_POINTER(i)); | |
1001 | |
731
fa8f7d7396cf
Introduce an helper function that returns the name of an editor.
zas_
parents:
730
diff
changeset
|
1002 name = editor_get_name(i); |
fa8f7d7396cf
Introduce an helper function that returns the name of an editor.
zas_
parents:
730
diff
changeset
|
1003 if (name) |
9 | 1004 { |
731
fa8f7d7396cf
Introduce an helper function that returns the name of an editor.
zas_
parents:
730
diff
changeset
|
1005 gchar *text = g_strdup_printf(_("_%d %s..."), i, name); |
9 | 1006 |
1007 g_object_set(action, "label", text, | |
1008 "sensitive", TRUE, NULL); | |
1009 g_free(text); | |
1010 } | |
1011 else | |
1012 { | |
454 | 1013 gchar *text; |
1014 | |
1015 text = g_strdup_printf(_("_%d empty"), i); | |
1016 g_object_set(action, "label", text, "sensitive", FALSE, NULL); | |
1017 g_free(text); | |
9 | 1018 } |
1019 | |
1020 g_free(key); | |
1021 } | |
1022 } | |
1023 | |
1024 void layout_edit_update_all(void) | |
1025 { | |
1026 GList *work; | |
1027 | |
1028 work = layout_window_list; | |
1029 while (work) | |
1030 { | |
1031 LayoutWindow *lw = work->data; | |
1032 work = work->next; | |
1033 | |
1034 layout_menu_edit_update(lw); | |
1035 } | |
1036 } | |
1037 | |
1272 | 1038 #endif |
1039 | |
1547
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1040 |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1041 /* |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1042 *----------------------------------------------------------------------------- |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1043 * color profile button (and menu) |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1044 *----------------------------------------------------------------------------- |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1045 */ |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1046 |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1047 static void layout_color_menu_enable_cb(GtkToggleAction *action, gpointer data) |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1048 { |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1049 #ifdef HAVE_LCMS |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1050 LayoutWindow *lw = data; |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1051 |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1052 layout_image_color_profile_set_use(lw, gtk_toggle_action_get_active(action)); |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1053 layout_util_sync_color(lw); |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1054 layout_image_refresh(lw); |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1055 #endif |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1056 } |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1057 |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1058 static void layout_color_menu_use_image_cb(GtkToggleAction *action, gpointer data) |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1059 { |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1060 #ifdef HAVE_LCMS |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1061 LayoutWindow *lw = data; |
1548 | 1062 gint input; |
1547
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1063 gboolean use_image; |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1064 |
1548 | 1065 if (!layout_image_color_profile_get(lw, &input, &use_image)) return; |
1066 layout_image_color_profile_set(lw, input, gtk_toggle_action_get_active(action)); | |
1547
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1067 layout_util_sync_color(lw); |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1068 layout_image_refresh(lw); |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1069 #endif |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1070 } |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1071 |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1072 static void layout_color_menu_input_cb(GtkRadioAction *action, GtkRadioAction *current, gpointer data) |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1073 { |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1074 #ifdef HAVE_LCMS |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1075 LayoutWindow *lw = data; |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1076 gint type; |
1548 | 1077 gint input; |
1547
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1078 gboolean use_image; |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1079 |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1080 type = gtk_radio_action_get_current_value(action); |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1081 if (type < 0 || type >= COLOR_PROFILE_FILE + COLOR_PROFILE_INPUTS) return; |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1082 |
1548 | 1083 if (!layout_image_color_profile_get(lw, &input, &use_image)) return; |
1547
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1084 if (type == input) return; |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1085 |
1548 | 1086 layout_image_color_profile_set(lw, type, use_image); |
1547
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1087 layout_image_refresh(lw); |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1088 #endif |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1089 } |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1090 |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1091 #if 0 |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1092 static gchar *layout_color_name_parse(const gchar *name) |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1093 { |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1094 if (!name || !*name) return g_strdup(_("Empty")); |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1095 return g_strdelimit(g_strdup(name), "_", '-'); |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1096 } |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1097 |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1098 |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1099 static void layout_color_button_press_cb(GtkWidget *widget, gpointer data) |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1100 { |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1101 #ifndef HAVE_LCMS |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1102 gchar *msg = g_strdup_printf(_("This installation of %s was not built with support for color profiles."), GQ_APPNAME); |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1103 file_util_warning_dialog(_("Color profiles not supported"), |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1104 msg, |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1105 GTK_STOCK_DIALOG_INFO, widget); |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1106 g_free(msg); |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1107 return; |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1108 #else |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1109 LayoutWindow *lw = data; |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1110 GtkWidget *menu; |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1111 GtkWidget *item; |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1112 gchar *buf; |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1113 gboolean active; |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1114 gint input = 0; |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1115 gint screen = 0; |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1116 gboolean use_image = FALSE; |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1117 gboolean from_image; |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1118 gint image_profile; |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1119 gint i; |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1120 |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1121 if (!layout_image_color_profile_get(lw, &input, &screen, &use_image)) return; |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1122 |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1123 image_profile = layout_image_color_profile_get_from_image(lw); |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1124 from_image = use_image && (image_profile != COLOR_PROFILE_NONE); |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1125 menu = popup_menu_short_lived(); |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1126 |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1127 active = layout_image_color_profile_get_use(lw); |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1128 menu_item_add_check(menu, _("Use _color profiles"), active, |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1129 G_CALLBACK(layout_color_menu_enable_cb), lw); |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1130 |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1131 menu_item_add_divider(menu); |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1132 |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1133 item = menu_item_add_check(menu, _("Use profile from _image"), use_image, |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1134 G_CALLBACK(layout_color_menu_use_image_cb), lw); |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1135 gtk_widget_set_sensitive(item, image_profile == COLOR_PROFILE_MEM || (image_profile > COLOR_PROFILE_NONE && image_profile < COLOR_PROFILE_FILE)); |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1136 |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1137 for (i = COLOR_PROFILE_SRGB; i < COLOR_PROFILE_FILE; i++) |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1138 { |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1139 const gchar *label; |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1140 |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1141 switch (i) |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1142 { |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1143 case COLOR_PROFILE_SRGB: label = _("sRGB"); break; |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1144 case COLOR_PROFILE_ADOBERGB: label = _("AdobeRGB compatible"); break; |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1145 default: label = "fixme"; break; |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1146 } |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1147 buf = g_strdup_printf(_("Input _%d: %s%s"), i, label, (i == image_profile) ? " *" : ""); |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1148 item = menu_item_add_radio(menu, (i == COLOR_PROFILE_SRGB) ? NULL : item, |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1149 buf, (input == i), |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1150 G_CALLBACK(layout_color_menu_input_cb), lw); |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1151 g_free(buf); |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1152 g_object_set_data(G_OBJECT(item), COLOR_MENU_KEY, GINT_TO_POINTER(i)); |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1153 gtk_widget_set_sensitive(item, active && !from_image); |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1154 } |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1155 |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1156 for (i = 0; i < COLOR_PROFILE_INPUTS; i++) |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1157 { |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1158 const gchar *name = options->color_profile.input_name[i]; |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1159 const gchar *file = options->color_profile.input_file[i]; |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1160 gchar *end; |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1161 |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1162 if (!name || !name[0]) name = filename_from_path(file); |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1163 |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1164 end = layout_color_name_parse(name); |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1165 buf = g_strdup_printf(_("Input _%d: %s"), i + COLOR_PROFILE_FILE, end); |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1166 g_free(end); |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1167 |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1168 item = menu_item_add_radio(menu, item, |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1169 buf, (i + COLOR_PROFILE_FILE == input), |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1170 G_CALLBACK(layout_color_menu_input_cb), lw); |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1171 g_free(buf); |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1172 g_object_set_data(G_OBJECT(item), COLOR_MENU_KEY, GINT_TO_POINTER(i + COLOR_PROFILE_FILE)); |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1173 gtk_widget_set_sensitive(item, active && !from_image && is_readable_file(file)); |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1174 } |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1175 |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1176 menu_item_add_divider(menu); |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1177 |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1178 item = menu_item_add_radio(menu, NULL, |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1179 _("Screen sRGB"), (screen == 0), |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1180 G_CALLBACK(layout_color_menu_screen_cb), lw); |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1181 |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1182 g_object_set_data(G_OBJECT(item), COLOR_MENU_KEY, GINT_TO_POINTER(0)); |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1183 gtk_widget_set_sensitive(item, active); |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1184 |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1185 item = menu_item_add_radio(menu, item, |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1186 _("_Screen profile"), (screen == 1), |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1187 G_CALLBACK(layout_color_menu_screen_cb), lw); |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1188 g_object_set_data(G_OBJECT(item), COLOR_MENU_KEY, GINT_TO_POINTER(1)); |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1189 gtk_widget_set_sensitive(item, active && is_readable_file(options->color_profile.screen_file)); |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1190 |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1191 gtk_menu_popup(GTK_MENU(menu), NULL, NULL, NULL, NULL, 0, GDK_CURRENT_TIME); |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1192 #endif /* HAVE_LCMS */ |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1193 } |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1194 |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1195 #endif |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1196 |
9 | 1197 /* |
1198 *----------------------------------------------------------------------------- | |
1199 * recent menu | |
1200 *----------------------------------------------------------------------------- | |
1201 */ | |
1202 | |
1203 static void layout_menu_recent_cb(GtkWidget *widget, gpointer data) | |
1204 { | |
1205 gint n; | |
1206 gchar *path; | |
1207 | |
1208 n = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(widget), "recent_index")); | |
1209 | |
1210 path = g_list_nth_data(history_list_get_by_key("recent"), n); | |
1211 | |
1212 if (!path) return; | |
1213 | |
1214 /* make a copy of it */ | |
1215 path = g_strdup(path); | |
1216 collection_window_new(path); | |
1217 g_free(path); | |
1218 } | |
1219 | |
1220 static void layout_menu_recent_update(LayoutWindow *lw) | |
1221 { | |
1222 GtkWidget *menu; | |
1223 GtkWidget *recent; | |
1224 GtkWidget *item; | |
1225 GList *list; | |
1226 gint n; | |
1227 | |
1228 if (!lw->ui_manager) return; | |
1229 | |
1230 list = history_list_get_by_key("recent"); | |
1231 n = 0; | |
1232 | |
1233 menu = gtk_menu_new(); | |
1234 | |
1235 while (list) | |
1236 { | |
1176
d3e51e1a02f8
Hide .gqv extension from collection name in collection window title and recent menu list.
zas_
parents:
1167
diff
changeset
|
1237 const gchar *filename = filename_from_path((gchar *)list->data); |
d3e51e1a02f8
Hide .gqv extension from collection name in collection window title and recent menu list.
zas_
parents:
1167
diff
changeset
|
1238 gchar *name; |
d3e51e1a02f8
Hide .gqv extension from collection name in collection window title and recent menu list.
zas_
parents:
1167
diff
changeset
|
1239 gboolean free_name = FALSE; |
d3e51e1a02f8
Hide .gqv extension from collection name in collection window title and recent menu list.
zas_
parents:
1167
diff
changeset
|
1240 |
d3e51e1a02f8
Hide .gqv extension from collection name in collection window title and recent menu list.
zas_
parents:
1167
diff
changeset
|
1241 if (file_extension_match(filename, GQ_COLLECTION_EXT)) |
d3e51e1a02f8
Hide .gqv extension from collection name in collection window title and recent menu list.
zas_
parents:
1167
diff
changeset
|
1242 { |
d3e51e1a02f8
Hide .gqv extension from collection name in collection window title and recent menu list.
zas_
parents:
1167
diff
changeset
|
1243 name = remove_extension_from_path(filename); |
d3e51e1a02f8
Hide .gqv extension from collection name in collection window title and recent menu list.
zas_
parents:
1167
diff
changeset
|
1244 free_name = TRUE; |
d3e51e1a02f8
Hide .gqv extension from collection name in collection window title and recent menu list.
zas_
parents:
1167
diff
changeset
|
1245 } |
d3e51e1a02f8
Hide .gqv extension from collection name in collection window title and recent menu list.
zas_
parents:
1167
diff
changeset
|
1246 else |
d3e51e1a02f8
Hide .gqv extension from collection name in collection window title and recent menu list.
zas_
parents:
1167
diff
changeset
|
1247 { |
d3e51e1a02f8
Hide .gqv extension from collection name in collection window title and recent menu list.
zas_
parents:
1167
diff
changeset
|
1248 name = (gchar *) filename; |
d3e51e1a02f8
Hide .gqv extension from collection name in collection window title and recent menu list.
zas_
parents:
1167
diff
changeset
|
1249 } |
d3e51e1a02f8
Hide .gqv extension from collection name in collection window title and recent menu list.
zas_
parents:
1167
diff
changeset
|
1250 |
d3e51e1a02f8
Hide .gqv extension from collection name in collection window title and recent menu list.
zas_
parents:
1167
diff
changeset
|
1251 item = menu_item_add_simple(menu, name, G_CALLBACK(layout_menu_recent_cb), lw); |
d3e51e1a02f8
Hide .gqv extension from collection name in collection window title and recent menu list.
zas_
parents:
1167
diff
changeset
|
1252 if (free_name) g_free(name); |
9 | 1253 g_object_set_data(G_OBJECT(item), "recent_index", GINT_TO_POINTER(n)); |
1254 list = list->next; | |
1255 n++; | |
1256 } | |
1257 | |
1258 if (n == 0) | |
1259 { | |
1260 menu_item_add(menu, _("Empty"), NULL, NULL); | |
1261 } | |
1262 | |
1263 recent = gtk_ui_manager_get_widget(lw->ui_manager, "/MainMenu/FileMenu/OpenRecent"); | |
1264 gtk_menu_item_set_submenu(GTK_MENU_ITEM(recent), menu); | |
1265 gtk_widget_set_sensitive(recent, (n != 0)); | |
1266 } | |
1267 | |
1268 void layout_recent_update_all(void) | |
1269 { | |
1270 GList *work; | |
1271 | |
1272 work = layout_window_list; | |
1273 while (work) | |
1274 { | |
1275 LayoutWindow *lw = work->data; | |
1276 work = work->next; | |
1277 | |
1278 layout_menu_recent_update(lw); | |
1279 } | |
1280 } | |
1281 | |
1282 void layout_recent_add_path(const gchar *path) | |
1283 { | |
1284 if (!path) return; | |
1285 | |
343
63380ea3e65d
Rename recent_list_max/open_recent_max to open_recent_list_maxsize.
zas_
parents:
341
diff
changeset
|
1286 history_list_add_to_key("recent", path, options->open_recent_list_maxsize); |
9 | 1287 |
1288 layout_recent_update_all(); | |
1289 } | |
1290 | |
1291 /* | |
1292 *----------------------------------------------------------------------------- | |
1293 * menu | |
1294 *----------------------------------------------------------------------------- | |
442 | 1295 */ |
9 | 1296 |
1297 #define CB G_CALLBACK | |
1298 | |
1299 static GtkActionEntry menu_entries[] = { | |
691 | 1300 { "FileMenu", NULL, N_("_File"), NULL, NULL, NULL }, |
1301 { "GoMenu", NULL, N_("_Go"), NULL, NULL, NULL }, | |
1302 { "EditMenu", NULL, N_("_Edit"), NULL, NULL, NULL }, | |
1303 { "SelectMenu", NULL, N_("_Select"), NULL, NULL, NULL }, | |
1304 { "AdjustMenu", NULL, N_("_Adjust"), NULL, NULL, NULL }, | |
1272 | 1305 { "ExternalMenu", NULL, N_("E_xternal Editors"), NULL, NULL, NULL }, |
691 | 1306 { "ViewMenu", NULL, N_("_View"), NULL, NULL, NULL }, |
1307 { "DirMenu", NULL, N_("_View Directory as"), NULL, NULL, NULL }, | |
1308 { "ZoomMenu", NULL, N_("_Zoom"), NULL, NULL, NULL }, | |
1547
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1309 { "ColorMenu", NULL, N_("Color _Management"), NULL, NULL, NULL }, |
1047 | 1310 { "ConnectZoomMenu", NULL, N_("_Connected Zoom"), NULL, NULL, NULL }, |
691 | 1311 { "SplitMenu", NULL, N_("_Split"), NULL, NULL, NULL }, |
1312 { "HelpMenu", NULL, N_("_Help"), NULL, NULL, NULL }, | |
9 | 1313 |
159 | 1314 { "FirstImage", GTK_STOCK_GOTO_TOP, N_("_First Image"), "Home", NULL, CB(layout_menu_image_first_cb) }, |
1315 { "PrevImage", GTK_STOCK_GO_UP, N_("_Previous Image"), "BackSpace", NULL, CB(layout_menu_image_prev_cb) }, | |
428
af843364b3ea
I have finally found how to add alternative hotkeys
nadvornik
parents:
398
diff
changeset
|
1316 { "PrevImageAlt1", GTK_STOCK_GO_UP, N_("_Previous Image"), "Page_Up", NULL, CB(layout_menu_image_prev_cb) }, |
af843364b3ea
I have finally found how to add alternative hotkeys
nadvornik
parents:
398
diff
changeset
|
1317 { "PrevImageAlt2", GTK_STOCK_GO_UP, N_("_Previous Image"), "KP_Page_Up", NULL, CB(layout_menu_image_prev_cb) }, |
159 | 1318 { "NextImage", GTK_STOCK_GO_DOWN, N_("_Next Image"), "space", NULL, CB(layout_menu_image_next_cb) }, |
428
af843364b3ea
I have finally found how to add alternative hotkeys
nadvornik
parents:
398
diff
changeset
|
1319 { "NextImageAlt1", GTK_STOCK_GO_DOWN, N_("_Next Image"), "Page_Down", NULL, CB(layout_menu_image_next_cb) }, |
af843364b3ea
I have finally found how to add alternative hotkeys
nadvornik
parents:
398
diff
changeset
|
1320 { "NextImageAlt2", GTK_STOCK_GO_DOWN, N_("_Next Image"), "KP_Page_Down", NULL, CB(layout_menu_image_next_cb) }, |
159 | 1321 { "LastImage", GTK_STOCK_GOTO_BOTTOM, N_("_Last Image"), "End", NULL, CB(layout_menu_image_last_cb) }, |
1334 | 1322 { "Back", GTK_STOCK_GO_BACK, N_("_Back"), NULL, N_("Back"), CB(layout_menu_back_cb) }, |
1323 { "Home", GTK_STOCK_HOME, N_("_Home"), NULL, N_("Home"), CB(layout_menu_home_cb) }, | |
159 | 1324 |
1325 | |
9 | 1326 { "NewWindow", GTK_STOCK_NEW, N_("New _window"), NULL, NULL, CB(layout_menu_new_window_cb) }, |
1327 { "NewCollection", GTK_STOCK_INDEX,N_("_New collection"), "C", NULL, CB(layout_menu_new_cb) }, | |
1328 { "OpenCollection", GTK_STOCK_OPEN, N_("_Open collection..."),"O", NULL, CB(layout_menu_open_cb) }, | |
691 | 1329 { "OpenRecent", NULL, N_("Open _recent"), NULL, NULL, NULL }, |
9 | 1330 { "Search", GTK_STOCK_FIND, N_("_Search..."), "F3", NULL, CB(layout_menu_search_cb) }, |
1331 { "FindDupes", GTK_STOCK_FIND, N_("_Find duplicates..."),"D", NULL, CB(layout_menu_dupes_cb) }, | |
12
147f4c4b9025
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
9
diff
changeset
|
1332 { "PanView", NULL, N_("Pan _view"), "<control>J", NULL, CB(layout_menu_pan_cb) }, |
9 | 1333 { "Print", GTK_STOCK_PRINT,N_("_Print..."), "<shift>P", NULL, CB(layout_menu_print_cb) }, |
1334 { "NewFolder", NULL, N_("N_ew folder..."), "<control>F", NULL, CB(layout_menu_dir_cb) }, | |
1335 { "Copy", NULL, N_("_Copy..."), "<control>C", NULL, CB(layout_menu_copy_cb) }, | |
1336 { "Move", NULL, N_("_Move..."), "<control>M", NULL, CB(layout_menu_move_cb) }, | |
1337 { "Rename", NULL, N_("_Rename..."), "<control>R", NULL, CB(layout_menu_rename_cb) }, | |
1338 { "Delete", GTK_STOCK_DELETE, N_("_Delete..."), "<control>D", NULL, CB(layout_menu_delete_cb) }, | |
428
af843364b3ea
I have finally found how to add alternative hotkeys
nadvornik
parents:
398
diff
changeset
|
1339 { "DeleteAlt1",GTK_STOCK_DELETE, N_("_Delete..."), "Delete", NULL, CB(layout_menu_delete_cb) }, |
af843364b3ea
I have finally found how to add alternative hotkeys
nadvornik
parents:
398
diff
changeset
|
1340 { "DeleteAlt2",GTK_STOCK_DELETE, N_("_Delete..."), "KP_Delete", NULL, CB(layout_menu_delete_cb) }, |
1285 | 1341 { "CopyPath", NULL, N_("_Copy path to clipboard"), NULL, NULL, CB(layout_menu_copy_path_cb) }, |
9 | 1342 { "CloseWindow", GTK_STOCK_CLOSE,N_("C_lose window"), "<control>W", NULL, CB(layout_menu_close_cb) }, |
1343 { "Quit", GTK_STOCK_QUIT, N_("_Quit"), "<control>Q", NULL, CB(layout_menu_exit_cb) }, | |
1344 | |
1345 { "RotateCW", NULL, N_("_Rotate clockwise"), "bracketright", NULL, CB(layout_menu_alter_90_cb) }, | |
1346 { "RotateCCW", NULL, N_("Rotate _counterclockwise"), "bracketleft", NULL, CB(layout_menu_alter_90cc_cb) }, | |
1347 { "Rotate180", NULL, N_("Rotate 1_80"), "<shift>R", NULL, CB(layout_menu_alter_180_cb) }, | |
1348 { "Mirror", NULL, N_("_Mirror"), "<shift>M", NULL, CB(layout_menu_alter_mirror_cb) }, | |
1349 { "Flip", NULL, N_("_Flip"), "<shift>F", NULL, CB(layout_menu_alter_flip_cb) }, | |
398
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
380
diff
changeset
|
1350 { "Grayscale", NULL, N_("Toggle _grayscale"),"<shift>G", NULL, CB(layout_menu_alter_desaturate_cb) }, |
439 | 1351 { "AlterNone", NULL, N_("_Original state"), "<shift>O", NULL, CB(layout_menu_alter_none_cb) }, |
1352 | |
9 | 1353 { "SelectAll", NULL, N_("Select _all"), "<control>A", NULL, CB(layout_menu_select_all_cb) }, |
1354 { "SelectNone", NULL, N_("Select _none"), "<control><shift>A",NULL, CB(layout_menu_unselect_all_cb) }, | |
601 | 1355 { "SelectInvert", NULL, N_("_Invert Selection"), "<control><shift>I", NULL, CB(layout_menu_invert_selection_cb) }, |
1356 | |
9 | 1357 { "Preferences",GTK_STOCK_PREFERENCES,N_("P_references..."), "<control>O", NULL, CB(layout_menu_config_cb) }, |
1479 | 1358 { "Editors",GTK_STOCK_PREFERENCES,N_("Configure _Editors..."), NULL, NULL, CB(layout_menu_editors_cb) }, |
1436
d7a6fb7a90dd
completely separated global and layout window options
nadvornik
parents:
1433
diff
changeset
|
1359 { "LayoutConfig",GTK_STOCK_PREFERENCES,N_("_Configure this window..."), NULL, NULL, CB(layout_menu_layout_config_cb) }, |
9 | 1360 { "Maintenance", NULL, N_("_Thumbnail maintenance..."),NULL, NULL, CB(layout_menu_remove_thumb_cb) }, |
1361 { "Wallpaper", NULL, N_("Set as _wallpaper"),NULL, NULL, CB(layout_menu_wallpaper_cb) }, | |
1362 | |
1334 | 1363 { "ZoomIn", GTK_STOCK_ZOOM_IN, N_("Zoom _in"), "equal", N_("Zoom in"), CB(layout_menu_zoom_in_cb) }, |
1364 { "ZoomInAlt1",GTK_STOCK_ZOOM_IN, N_("Zoom _in"), "KP_Add", N_("Zoom in"), CB(layout_menu_zoom_in_cb) }, | |
1365 { "ZoomOut", GTK_STOCK_ZOOM_OUT, N_("Zoom _out"), "minus", N_("Zoom out"), CB(layout_menu_zoom_out_cb) }, | |
1366 { "ZoomOutAlt1",GTK_STOCK_ZOOM_OUT, N_("Zoom _out"), "KP_Subtract", N_("Zoom out"), CB(layout_menu_zoom_out_cb) }, | |
1367 { "Zoom100", GTK_STOCK_ZOOM_100, N_("Zoom _1:1"), "Z", N_("Zoom 1:1"), CB(layout_menu_zoom_1_1_cb) }, | |
1368 { "Zoom100Alt1",GTK_STOCK_ZOOM_100, N_("Zoom _1:1"), "KP_Divide", N_("Zoom 1:1"), CB(layout_menu_zoom_1_1_cb) }, | |
1369 { "ZoomFit", GTK_STOCK_ZOOM_FIT, N_("_Zoom to fit"), "X", N_("Zoom to fit"), CB(layout_menu_zoom_fit_cb) }, | |
1370 { "ZoomFitAlt1",GTK_STOCK_ZOOM_FIT, N_("_Zoom to fit"), "KP_Multiply", N_("Zoom to fit"), CB(layout_menu_zoom_fit_cb) }, | |
159 | 1371 { "ZoomFillHor", NULL, N_("Fit _Horizontally"),"H", NULL, CB(layout_menu_zoom_fit_hor_cb) }, |
1047 | 1372 { "ZoomFillVert", NULL, N_("Fit _Vertically"), "W", NULL, CB(layout_menu_zoom_fit_vert_cb) }, |
159 | 1373 { "Zoom200", NULL, N_("Zoom _2:1"), NULL, NULL, CB(layout_menu_zoom_2_1_cb) }, |
1374 { "Zoom300", NULL, N_("Zoom _3:1"), NULL, NULL, CB(layout_menu_zoom_3_1_cb) }, | |
1375 { "Zoom400", NULL, N_("Zoom _4:1"), NULL, NULL, CB(layout_menu_zoom_4_1_cb) }, | |
1376 { "Zoom50", NULL, N_("Zoom 1:2"), NULL, NULL, CB(layout_menu_zoom_1_2_cb) }, | |
1377 { "Zoom33", NULL, N_("Zoom 1:3"), NULL, NULL, CB(layout_menu_zoom_1_3_cb) }, | |
1378 { "Zoom25", NULL, N_("Zoom 1:4"), NULL, NULL, CB(layout_menu_zoom_1_4_cb) }, | |
156
dd6dc0a55d3d
better integration of split image functions into menu
nadvornik
parents:
138
diff
changeset
|
1379 |
1047 | 1380 { "ConnectZoomIn", GTK_STOCK_ZOOM_IN, N_("Zoom _in"), "plus", NULL, CB(layout_menu_connect_zoom_in_cb) }, |
1381 { "ConnectZoomInAlt1",GTK_STOCK_ZOOM_IN, N_("Zoom _in"), "<shift>KP_Add", NULL, CB(layout_menu_connect_zoom_in_cb) }, | |
1382 { "ConnectZoomOut", GTK_STOCK_ZOOM_OUT, N_("Zoom _out"), "underscore", NULL, CB(layout_menu_connect_zoom_out_cb) }, | |
1383 { "ConnectZoomOutAlt1",GTK_STOCK_ZOOM_OUT, N_("Zoom _out"), "<shift>KP_Subtract", NULL, CB(layout_menu_connect_zoom_out_cb) }, | |
1384 { "ConnectZoom100", GTK_STOCK_ZOOM_100, N_("Zoom _1:1"), "<shift>Z", NULL, CB(layout_menu_connect_zoom_1_1_cb) }, | |
1385 { "ConnectZoom100Alt1",GTK_STOCK_ZOOM_100, N_("Zoom _1:1"), "<shift>KP_Divide", NULL, CB(layout_menu_connect_zoom_1_1_cb) }, | |
1386 { "ConnectZoomFit", GTK_STOCK_ZOOM_FIT, N_("_Zoom to fit"), "<shift>X", NULL, CB(layout_menu_connect_zoom_fit_cb) }, | |
1387 { "ConnectZoomFitAlt1",GTK_STOCK_ZOOM_FIT, N_("_Zoom to fit"), "<shift>KP_Multiply", NULL, CB(layout_menu_connect_zoom_fit_cb) }, | |
1388 { "ConnectZoomFillHor", NULL, N_("Fit _Horizontally"),"<shift>H", NULL, CB(layout_menu_connect_zoom_fit_hor_cb) }, | |
1389 { "ConnectZoomFillVert", NULL, N_("Fit _Vertically"), "<shift>W", NULL, CB(layout_menu_connect_zoom_fit_vert_cb) }, | |
1390 { "ConnectZoom200", NULL, N_("Zoom _2:1"), NULL, NULL, CB(layout_menu_connect_zoom_2_1_cb) }, | |
1391 { "ConnectZoom300", NULL, N_("Zoom _3:1"), NULL, NULL, CB(layout_menu_connect_zoom_3_1_cb) }, | |
1392 { "ConnectZoom400", NULL, N_("Zoom _4:1"), NULL, NULL, CB(layout_menu_connect_zoom_4_1_cb) }, | |
1393 { "ConnectZoom50", NULL, N_("Zoom 1:2"), NULL, NULL, CB(layout_menu_connect_zoom_1_2_cb) }, | |
1394 { "ConnectZoom33", NULL, N_("Zoom 1:3"), NULL, NULL, CB(layout_menu_connect_zoom_1_3_cb) }, | |
1395 { "ConnectZoom25", NULL, N_("Zoom 1:4"), NULL, NULL, CB(layout_menu_connect_zoom_1_4_cb) }, | |
1396 | |
156
dd6dc0a55d3d
better integration of split image functions into menu
nadvornik
parents:
138
diff
changeset
|
1397 |
159 | 1398 { "ViewInNewWindow", NULL, N_("_View in new window"), "<control>V", NULL, CB(layout_menu_view_in_new_window_cb) }, |
156
dd6dc0a55d3d
better integration of split image functions into menu
nadvornik
parents:
138
diff
changeset
|
1399 |
9 | 1400 { "FullScreen", NULL, N_("F_ull screen"), "F", NULL, CB(layout_menu_fullscreen_cb) }, |
428
af843364b3ea
I have finally found how to add alternative hotkeys
nadvornik
parents:
398
diff
changeset
|
1401 { "FullScreenAlt1", NULL, N_("F_ull screen"), "V", NULL, CB(layout_menu_fullscreen_cb) }, |
af843364b3ea
I have finally found how to add alternative hotkeys
nadvornik
parents:
398
diff
changeset
|
1402 { "FullScreenAlt2", NULL, N_("F_ull screen"), "F11", NULL, CB(layout_menu_fullscreen_cb) }, |
af843364b3ea
I have finally found how to add alternative hotkeys
nadvornik
parents:
398
diff
changeset
|
1403 { "Escape", NULL, N_("Escape"), "Escape", NULL, CB(layout_menu_escape_cb) }, |
af843364b3ea
I have finally found how to add alternative hotkeys
nadvornik
parents:
398
diff
changeset
|
1404 { "EscapeAlt1", NULL, N_("Escape"), "Q", NULL, CB(layout_menu_escape_cb) }, |
159 | 1405 { "ImageOverlay", NULL, N_("_Image Overlay"), "I", NULL, CB(layout_menu_overlay_cb) }, |
273
e0e2c2b72c5a
reworked the histogram patch by Uwe Ohse, most of the code is in
nadvornik
parents:
249
diff
changeset
|
1406 { "HistogramChan", NULL, N_("Histogram _channels"), "K", NULL, CB(layout_menu_histogram_chan_cb) }, |
e0e2c2b72c5a
reworked the histogram patch by Uwe Ohse, most of the code is in
nadvornik
parents:
249
diff
changeset
|
1407 { "HistogramLog", NULL, N_("Histogram _log mode"), "J", NULL, CB(layout_menu_histogram_log_cb) }, |
9 | 1408 { "HideTools", NULL, N_("_Hide file list"), "<control>H", NULL, CB(layout_menu_hide_cb) }, |
450 | 1409 { "SlideShowPause", NULL, N_("_Pause slideshow"), "P", NULL, CB(layout_menu_slideshow_pause_cb) }, |
9 | 1410 { "Refresh", GTK_STOCK_REFRESH, N_("_Refresh"), "R", NULL, CB(layout_menu_refresh_cb) }, |
1411 | |
1412 { "HelpContents", GTK_STOCK_HELP, N_("_Contents"), "F1", NULL, CB(layout_menu_help_cb) }, | |
1413 { "HelpShortcuts", NULL, N_("_Keyboard shortcuts"),NULL, NULL, CB(layout_menu_help_keys_cb) }, | |
1414 { "HelpNotes", NULL, N_("_Release notes"), NULL, NULL, CB(layout_menu_notes_cb) }, | |
678
6d6f042b8ca5
Add a log window that shows normal and debug messages. For now, it was added to Help menu.
zas_
parents:
654
diff
changeset
|
1415 { "About", NULL, N_("_About"), NULL, NULL, CB(layout_menu_about_cb) }, |
1410 | 1416 { "LogWindow", NULL, N_("_Log Window"), NULL, NULL, CB(layout_menu_log_window_cb) }, |
1417 | |
1411 | 1418 { "ExifWin", NULL, N_("E_xif window"), "<control>E", NULL, CB(layout_menu_bar_exif_cb) }, |
1410 | 1419 |
9 | 1420 }; |
1421 | |
1422 static GtkToggleActionEntry menu_toggle_entries[] = { | |
1334 | 1423 { "Thumbnails", PIXBUF_INLINE_ICON_THUMB, N_("Show _Thumbnails"), "T", N_("Show Thumbnails"), CB(layout_menu_thumb_cb), FALSE }, |
691 | 1424 { "ShowMarks", NULL, N_("Show _Marks"), "M", NULL, CB(layout_menu_marks_cb), FALSE }, |
1334 | 1425 { "FloatTools", PIXBUF_INLINE_ICON_FLOAT, N_("_Float file list"), "L", NULL, CB(layout_menu_float_cb), FALSE }, |
691 | 1426 { "HideToolbar", NULL, N_("Hide tool_bar"), NULL, NULL, CB(layout_menu_toolbar_cb), FALSE }, |
1375
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1348
diff
changeset
|
1427 { "HideInfoPixel", NULL, N_("Hide Pi_xel Info"), NULL, NULL, CB(layout_menu_info_pixel_cb), FALSE }, |
1291
50ae02a4a675
replaced bar_info with an universal bar, restored the original
nadvornik
parents:
1285
diff
changeset
|
1428 { "SBar", NULL, N_("_Info"), "<control>K", NULL, CB(layout_menu_bar_cb), FALSE }, |
691 | 1429 { "SBarSort", NULL, N_("Sort _manager"), "<control>S", NULL, CB(layout_menu_bar_sort_cb), FALSE }, |
1430 { "SlideShow", NULL, N_("Toggle _slideshow"),"S", NULL, CB(layout_menu_slideshow_cb), FALSE }, | |
1547
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1431 { "UseColorProfiles", NULL, N_("Use _color profiles"), NULL, NULL, CB(layout_color_menu_enable_cb), FALSE}, |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1432 { "UseImageProfile", NULL, N_("Use profile from _image"), NULL, NULL, CB(layout_color_menu_use_image_cb), FALSE}, |
9 | 1433 }; |
1434 | |
1435 static GtkRadioActionEntry menu_radio_entries[] = { | |
1285 | 1436 { "ViewList", NULL, N_("View Images as _List"), "<control>L", NULL, 0 }, |
1437 { "ViewIcons", NULL, N_("View Images as I_cons"), "<control>I", NULL, 1 } | |
9 | 1438 }; |
1439 | |
156
dd6dc0a55d3d
better integration of split image functions into menu
nadvornik
parents:
138
diff
changeset
|
1440 static GtkRadioActionEntry menu_split_radio_entries[] = { |
dd6dc0a55d3d
better integration of split image functions into menu
nadvornik
parents:
138
diff
changeset
|
1441 { "SplitHorizontal", NULL, N_("Horizontal"), "E", NULL, SPLIT_HOR }, |
dd6dc0a55d3d
better integration of split image functions into menu
nadvornik
parents:
138
diff
changeset
|
1442 { "SplitVertical", NULL, N_("Vertical"), "U", NULL, SPLIT_VERT }, |
428
af843364b3ea
I have finally found how to add alternative hotkeys
nadvornik
parents:
398
diff
changeset
|
1443 { "SplitQuad", NULL, N_("Quad"), NULL, NULL, SPLIT_QUAD }, |
156
dd6dc0a55d3d
better integration of split image functions into menu
nadvornik
parents:
138
diff
changeset
|
1444 { "SplitSingle", NULL, N_("Single"), "Y", NULL, SPLIT_NONE } |
dd6dc0a55d3d
better integration of split image functions into menu
nadvornik
parents:
138
diff
changeset
|
1445 }; |
dd6dc0a55d3d
better integration of split image functions into menu
nadvornik
parents:
138
diff
changeset
|
1446 |
1547
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1447 static GtkRadioActionEntry menu_color_radio_entries[] = { |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1448 { "ColorProfile0", NULL, N_("Input _0: sRGB"), NULL, NULL, COLOR_PROFILE_SRGB }, |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1449 { "ColorProfile1", NULL, N_("Input _1: AdobeRGB compatible"), NULL, NULL, COLOR_PROFILE_ADOBERGB }, |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1450 { "ColorProfile2", NULL, N_("Input _2"), NULL, NULL, COLOR_PROFILE_FILE }, |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1451 { "ColorProfile3", NULL, N_("Input _3"), NULL, NULL, COLOR_PROFILE_FILE + 1 }, |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1452 { "ColorProfile4", NULL, N_("Input _4"), NULL, NULL, COLOR_PROFILE_FILE + 2 }, |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1453 { "ColorProfile5", NULL, N_("Input _5"), NULL, NULL, COLOR_PROFILE_FILE + 3 } |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1454 }; |
380
5afe77bb563a
Introduce a new struct ViewDir to handle directory views common
zas_
parents:
343
diff
changeset
|
1455 |
9 | 1456 #undef CB |
1457 | |
1000
4fe8f9656107
For the sake of consistency, use glib basic types everywhere.
zas_
parents:
995
diff
changeset
|
1458 static const gchar *menu_ui_description = |
9 | 1459 "<ui>" |
1460 " <menubar name='MainMenu'>" | |
1461 " <menu action='FileMenu'>" | |
1462 " <menuitem action='NewWindow'/>" | |
1463 " <menuitem action='NewCollection'/>" | |
1464 " <menuitem action='OpenCollection'/>" | |
1465 " <menuitem action='OpenRecent'/>" | |
1275 | 1466 " <placeholder name='OpenSection'/>" |
9 | 1467 " <separator/>" |
1468 " <menuitem action='Search'/>" | |
1469 " <menuitem action='FindDupes'/>" | |
1275 | 1470 " <placeholder name='SearchSection'/>" |
9 | 1471 " <separator/>" |
1472 " <menuitem action='Print'/>" | |
1275 | 1473 " <placeholder name='PrintSection'/>" |
1474 " <separator/>" | |
9 | 1475 " <menuitem action='NewFolder'/>" |
1476 " <menuitem action='Copy'/>" | |
1477 " <menuitem action='Move'/>" | |
1478 " <menuitem action='Rename'/>" | |
1479 " <menuitem action='Delete'/>" | |
1275 | 1480 " <placeholder name='FileOpsSection'/>" |
9 | 1481 " <separator/>" |
1275 | 1482 " <placeholder name='QuitSection'/>" |
9 | 1483 " <menuitem action='CloseWindow'/>" |
1484 " <menuitem action='Quit'/>" | |
1272 | 1485 " <separator/>" |
9 | 1486 " </menu>" |
159 | 1487 " <menu action='GoMenu'>" |
1488 " <menuitem action='FirstImage'/>" | |
1489 " <menuitem action='PrevImage'/>" | |
1490 " <menuitem action='NextImage'/>" | |
1491 " <menuitem action='LastImage'/>" | |
1272 | 1492 " <separator/>" |
1334 | 1493 " <menuitem action='Back'/>" |
1494 " <menuitem action='Home'/>" | |
1495 " <separator/>" | |
159 | 1496 " </menu>" |
162
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
1497 " <menu action='SelectMenu'>" |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
1498 " <menuitem action='SelectAll'/>" |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
1499 " <menuitem action='SelectNone'/>" |
601 | 1500 " <menuitem action='SelectInvert'/>" |
1275 | 1501 " <placeholder name='SelectSection'/>" |
1502 " <separator/>" | |
1503 " <menuitem action='CopyPath'/>" | |
1504 " <placeholder name='ClipboardSection'/>" | |
162
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
1505 " <separator/>" |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
1506 " <menuitem action='ShowMarks'/>" |
1275 | 1507 " <placeholder name='MarksSection'/>" |
162
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
1508 " <separator/>" |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
1509 " </menu>" |
9 | 1510 " <menu action='EditMenu'>" |
1275 | 1511 " <menu action='ExternalMenu'>" |
1512 " </menu>" | |
1513 " <placeholder name='EditSection'/>" | |
1514 " <separator/>" | |
9 | 1515 " <menu action='AdjustMenu'>" |
1516 " <menuitem action='RotateCW'/>" | |
1517 " <menuitem action='RotateCCW'/>" | |
1518 " <menuitem action='Rotate180'/>" | |
1519 " <menuitem action='Mirror'/>" | |
1520 " <menuitem action='Flip'/>" | |
82
a4c1b7014e6e
Thu Oct 19 15:20:51 2006 John Ellis <johne@verizon.net>
gqview
parents:
41
diff
changeset
|
1521 " <menuitem action='Grayscale'/>" |
439 | 1522 " <menuitem action='AlterNone'/>" |
9 | 1523 " </menu>" |
1275 | 1524 " <placeholder name='PropertiesSection'/>" |
9 | 1525 " <separator/>" |
1526 " <menuitem action='Preferences'/>" | |
1479 | 1527 " <menuitem action='Editors'/>" |
1436
d7a6fb7a90dd
completely separated global and layout window options
nadvornik
parents:
1433
diff
changeset
|
1528 " <menuitem action='LayoutConfig'/>" |
9 | 1529 " <menuitem action='Maintenance'/>" |
1275 | 1530 " <placeholder name='PreferencesSection'/>" |
9 | 1531 " <separator/>" |
1532 " <menuitem action='Wallpaper'/>" | |
1272 | 1533 " <separator/>" |
9 | 1534 " </menu>" |
1535 " <menu action='ViewMenu'>" | |
159 | 1536 " <menuitem action='ViewInNewWindow'/>" |
1285 | 1537 " <menuitem action='PanView'/>" |
1275 | 1538 " <placeholder name='WindowSection'/>" |
9 | 1539 " <separator/>" |
1547
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1540 " <menu action='ColorMenu'>" |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1541 " <menuitem action='UseColorProfiles'/>" |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1542 " <menuitem action='UseImageProfile'/>" |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1543 " <menuitem action='ColorProfile0'/>" |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1544 " <menuitem action='ColorProfile1'/>" |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1545 " <menuitem action='ColorProfile2'/>" |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1546 " <menuitem action='ColorProfile3'/>" |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1547 " <menuitem action='ColorProfile4'/>" |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1548 " <menuitem action='ColorProfile5'/>" |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1549 " </menu>" |
159 | 1550 " <menu action='ZoomMenu'>" |
1551 " <menuitem action='ZoomIn'/>" | |
1552 " <menuitem action='ZoomOut'/>" | |
1553 " <menuitem action='ZoomFit'/>" | |
1554 " <menuitem action='ZoomFillHor'/>" | |
1555 " <menuitem action='ZoomFillVert'/>" | |
1556 " <menuitem action='Zoom100'/>" | |
1557 " <menuitem action='Zoom200'/>" | |
1558 " <menuitem action='Zoom300'/>" | |
1559 " <menuitem action='Zoom400'/>" | |
1560 " <menuitem action='Zoom50'/>" | |
1561 " <menuitem action='Zoom33'/>" | |
1562 " <menuitem action='Zoom25'/>" | |
1563 " </menu>" | |
1047 | 1564 " <menu action='ConnectZoomMenu'>" |
1565 " <menuitem action='ConnectZoomIn'/>" | |
1566 " <menuitem action='ConnectZoomOut'/>" | |
1567 " <menuitem action='ConnectZoomFit'/>" | |
1568 " <menuitem action='ConnectZoomFillHor'/>" | |
1569 " <menuitem action='ConnectZoomFillVert'/>" | |
1570 " <menuitem action='ConnectZoom100'/>" | |
1571 " <menuitem action='ConnectZoom200'/>" | |
1572 " <menuitem action='ConnectZoom300'/>" | |
1573 " <menuitem action='ConnectZoom400'/>" | |
1574 " <menuitem action='ConnectZoom50'/>" | |
1575 " <menuitem action='ConnectZoom33'/>" | |
1576 " <menuitem action='ConnectZoom25'/>" | |
1577 " </menu>" | |
1275 | 1578 " <placeholder name='ZoomSection'/>" |
9 | 1579 " <separator/>" |
156
dd6dc0a55d3d
better integration of split image functions into menu
nadvornik
parents:
138
diff
changeset
|
1580 " <menu action='SplitMenu'>" |
dd6dc0a55d3d
better integration of split image functions into menu
nadvornik
parents:
138
diff
changeset
|
1581 " <menuitem action='SplitHorizontal'/>" |
dd6dc0a55d3d
better integration of split image functions into menu
nadvornik
parents:
138
diff
changeset
|
1582 " <menuitem action='SplitVertical'/>" |
dd6dc0a55d3d
better integration of split image functions into menu
nadvornik
parents:
138
diff
changeset
|
1583 " <menuitem action='SplitQuad'/>" |
dd6dc0a55d3d
better integration of split image functions into menu
nadvornik
parents:
138
diff
changeset
|
1584 " <menuitem action='SplitSingle'/>" |
dd6dc0a55d3d
better integration of split image functions into menu
nadvornik
parents:
138
diff
changeset
|
1585 " </menu>" |
dd6dc0a55d3d
better integration of split image functions into menu
nadvornik
parents:
138
diff
changeset
|
1586 " <separator/>" |
9 | 1587 " <menuitem action='ViewList'/>" |
1588 " <menuitem action='ViewIcons'/>" | |
1275 | 1589 " <menuitem action='Thumbnails'/>" |
1590 " <placeholder name='ListSection'/>" | |
9 | 1591 " <separator/>" |
380
5afe77bb563a
Introduce a new struct ViewDir to handle directory views common
zas_
parents:
343
diff
changeset
|
1592 " <menu action='DirMenu'>" |
5afe77bb563a
Introduce a new struct ViewDir to handle directory views common
zas_
parents:
343
diff
changeset
|
1593 " <menuitem action='FolderList'/>" |
5afe77bb563a
Introduce a new struct ViewDir to handle directory views common
zas_
parents:
343
diff
changeset
|
1594 " <menuitem action='FolderTree'/>" |
5afe77bb563a
Introduce a new struct ViewDir to handle directory views common
zas_
parents:
343
diff
changeset
|
1595 " </menu>" |
1275 | 1596 " <placeholder name='DirSection'/>" |
380
5afe77bb563a
Introduce a new struct ViewDir to handle directory views common
zas_
parents:
343
diff
changeset
|
1597 " <separator/>" |
159 | 1598 " <menuitem action='ImageOverlay'/>" |
273
e0e2c2b72c5a
reworked the histogram patch by Uwe Ohse, most of the code is in
nadvornik
parents:
249
diff
changeset
|
1599 " <menuitem action='HistogramChan'/>" |
e0e2c2b72c5a
reworked the histogram patch by Uwe Ohse, most of the code is in
nadvornik
parents:
249
diff
changeset
|
1600 " <menuitem action='HistogramLog'/>" |
9 | 1601 " <menuitem action='FullScreen'/>" |
1275 | 1602 " <placeholder name='OverlaySection'/>" |
9 | 1603 " <separator/>" |
1604 " <menuitem action='FloatTools'/>" | |
1605 " <menuitem action='HideTools'/>" | |
1606 " <menuitem action='HideToolbar'/>" | |
1375
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1348
diff
changeset
|
1607 " <menuitem action='HideInfoPixel'/>" |
1275 | 1608 " <placeholder name='ToolsSection'/>" |
9 | 1609 " <separator/>" |
1291
50ae02a4a675
replaced bar_info with an universal bar, restored the original
nadvornik
parents:
1285
diff
changeset
|
1610 " <menuitem action='SBar'/>" |
1293
48e064b37ba6
separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents:
1292
diff
changeset
|
1611 " <menuitem action='ExifWin'/>" |
9 | 1612 " <menuitem action='SBarSort'/>" |
1275 | 1613 " <placeholder name='SideBarSection'/>" |
9 | 1614 " <separator/>" |
1615 " <menuitem action='SlideShow'/>" | |
428
af843364b3ea
I have finally found how to add alternative hotkeys
nadvornik
parents:
398
diff
changeset
|
1616 " <menuitem action='SlideShowPause'/>" |
9 | 1617 " <menuitem action='Refresh'/>" |
1275 | 1618 " <placeholder name='SlideShowSection'/>" |
1272 | 1619 " <separator/>" |
9 | 1620 " </menu>" |
1621 " <menu action='HelpMenu'>" | |
1622 " <separator/>" | |
1623 " <menuitem action='HelpContents'/>" | |
1624 " <menuitem action='HelpShortcuts'/>" | |
1625 " <menuitem action='HelpNotes'/>" | |
1275 | 1626 " <placeholder name='HelpSection'/>" |
9 | 1627 " <separator/>" |
1628 " <menuitem action='About'/>" | |
678
6d6f042b8ca5
Add a log window that shows normal and debug messages. For now, it was added to Help menu.
zas_
parents:
654
diff
changeset
|
1629 " <separator/>" |
6d6f042b8ca5
Add a log window that shows normal and debug messages. For now, it was added to Help menu.
zas_
parents:
654
diff
changeset
|
1630 " <menuitem action='LogWindow'/>" |
1272 | 1631 " <separator/>" |
9 | 1632 " </menu>" |
1633 " </menubar>" | |
1334 | 1634 " <toolbar name='ToolBar'>" |
1635 " </toolbar>" | |
428
af843364b3ea
I have finally found how to add alternative hotkeys
nadvornik
parents:
398
diff
changeset
|
1636 "<accelerator action='PrevImageAlt1'/>" |
af843364b3ea
I have finally found how to add alternative hotkeys
nadvornik
parents:
398
diff
changeset
|
1637 "<accelerator action='PrevImageAlt2'/>" |
af843364b3ea
I have finally found how to add alternative hotkeys
nadvornik
parents:
398
diff
changeset
|
1638 "<accelerator action='NextImageAlt1'/>" |
af843364b3ea
I have finally found how to add alternative hotkeys
nadvornik
parents:
398
diff
changeset
|
1639 "<accelerator action='NextImageAlt2'/>" |
af843364b3ea
I have finally found how to add alternative hotkeys
nadvornik
parents:
398
diff
changeset
|
1640 "<accelerator action='DeleteAlt1'/>" |
af843364b3ea
I have finally found how to add alternative hotkeys
nadvornik
parents:
398
diff
changeset
|
1641 "<accelerator action='DeleteAlt2'/>" |
af843364b3ea
I have finally found how to add alternative hotkeys
nadvornik
parents:
398
diff
changeset
|
1642 "<accelerator action='FullScreenAlt1'/>" |
af843364b3ea
I have finally found how to add alternative hotkeys
nadvornik
parents:
398
diff
changeset
|
1643 "<accelerator action='FullScreenAlt2'/>" |
af843364b3ea
I have finally found how to add alternative hotkeys
nadvornik
parents:
398
diff
changeset
|
1644 "<accelerator action='Escape'/>" |
af843364b3ea
I have finally found how to add alternative hotkeys
nadvornik
parents:
398
diff
changeset
|
1645 "<accelerator action='EscapeAlt1'/>" |
1047 | 1646 |
1647 "<accelerator action='ZoomInAlt1'/>" | |
1648 "<accelerator action='ZoomOutAlt1'/>" | |
1649 "<accelerator action='Zoom100Alt1'/>" | |
1650 "<accelerator action='ZoomFitAlt1'/>" | |
1651 | |
1652 "<accelerator action='ConnectZoomInAlt1'/>" | |
1653 "<accelerator action='ConnectZoomOutAlt1'/>" | |
1654 "<accelerator action='ConnectZoom100Alt1'/>" | |
1655 "<accelerator action='ConnectZoomFitAlt1'/>" | |
9 | 1656 "</ui>"; |
1657 | |
1658 static gchar *menu_translate(const gchar *path, gpointer data) | |
1659 { | |
1004 | 1660 return (gchar *)(_(path)); |
9 | 1661 } |
1662 | |
1433
b4ad1d201279
Use gboolean where applicable, minor cleanup and indentations fixes.
zas_
parents:
1412
diff
changeset
|
1663 static void layout_actions_setup_mark(LayoutWindow *lw, gint mark, gchar *name_tmpl, |
b4ad1d201279
Use gboolean where applicable, minor cleanup and indentations fixes.
zas_
parents:
1412
diff
changeset
|
1664 gchar *label_tmpl, gchar *accel_tmpl, GCallback cb) |
162
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
1665 { |
894 | 1666 gchar name[50]; |
1667 gchar label[100]; | |
1668 gchar accel[50]; | |
162
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
1669 GtkActionEntry entry = { name, NULL, label, accel, NULL, cb }; |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
1670 GtkAction *action; |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
1671 |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
1672 g_snprintf(name, sizeof(name), name_tmpl, mark); |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
1673 g_snprintf(label, sizeof(label), label_tmpl, mark); |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
1674 if (accel_tmpl) |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
1675 g_snprintf(accel, sizeof(accel), accel_tmpl, mark % 10); |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
1676 else |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
1677 accel[0] = 0; |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
1678 gtk_action_group_add_actions(lw->action_group, &entry, 1, lw); |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
1679 action = gtk_action_group_get_action(lw->action_group, name); |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
1680 g_object_set_data(G_OBJECT(action), "mark_num", GINT_TO_POINTER(mark)); |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
1681 } |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
1682 |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
1683 static void layout_actions_setup_marks(LayoutWindow *lw) |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
1684 { |
894 | 1685 gint mark; |
162
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
1686 GError *error; |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
1687 GString *desc = g_string_new( |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
1688 "<ui>" |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
1689 " <menubar name='MainMenu'>" |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
1690 " <menu action='SelectMenu'>"); |
442 | 1691 |
162
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
1692 for (mark = 1; mark <= FILEDATA_MARKS_SIZE; mark++) |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
1693 { |
163 | 1694 layout_actions_setup_mark(lw, mark, "Mark%d", _("Mark _%d"), NULL, NULL); |
1695 layout_actions_setup_mark(lw, mark, "SetMark%d", _("_Set mark %d"), NULL, G_CALLBACK(layout_menu_set_mark_sel_cb)); | |
1696 layout_actions_setup_mark(lw, mark, "ResetMark%d", _("_Reset mark %d"), NULL, G_CALLBACK(layout_menu_res_mark_sel_cb)); | |
1697 layout_actions_setup_mark(lw, mark, "ToggleMark%d", _("_Toggle mark %d"), "%d", G_CALLBACK(layout_menu_toggle_mark_sel_cb)); | |
429 | 1698 layout_actions_setup_mark(lw, mark, "ToggleMark%dAlt1", _("_Toggle mark %d"), "KP_%d", G_CALLBACK(layout_menu_toggle_mark_sel_cb)); |
163 | 1699 layout_actions_setup_mark(lw, mark, "SelectMark%d", _("_Select mark %d"), "<control>%d", G_CALLBACK(layout_menu_sel_mark_cb)); |
429 | 1700 layout_actions_setup_mark(lw, mark, "SelectMark%dAlt1", _("_Select mark %d"), "<control>KP_%d", G_CALLBACK(layout_menu_sel_mark_cb)); |
163 | 1701 layout_actions_setup_mark(lw, mark, "AddMark%d", _("_Add mark %d"), NULL, G_CALLBACK(layout_menu_sel_mark_or_cb)); |
1702 layout_actions_setup_mark(lw, mark, "IntMark%d", _("_Intersection with mark %d"), NULL, G_CALLBACK(layout_menu_sel_mark_and_cb)); | |
1703 layout_actions_setup_mark(lw, mark, "UnselMark%d", _("_Unselect mark %d"), NULL, G_CALLBACK(layout_menu_sel_mark_minus_cb)); | |
162
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
1704 |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
1705 g_string_append_printf(desc, |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
1706 " <menu action='Mark%d'>" |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
1707 " <menuitem action='ToggleMark%d'/>" |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
1708 " <menuitem action='SetMark%d'/>" |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
1709 " <menuitem action='ResetMark%d'/>" |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
1710 " <separator/>" |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
1711 " <menuitem action='SelectMark%d'/>" |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
1712 " <menuitem action='AddMark%d'/>" |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
1713 " <menuitem action='IntMark%d'/>" |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
1714 " <menuitem action='UnselMark%d'/>" |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
1715 " </menu>", |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
1716 mark, mark, mark, mark, mark, mark, mark, mark); |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
1717 } |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
1718 |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
1719 g_string_append(desc, |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
1720 " </menu>" |
429 | 1721 " </menubar>"); |
1722 for (mark = 1; mark <= FILEDATA_MARKS_SIZE; mark++) | |
1723 { | |
1724 g_string_append_printf(desc, | |
1725 "<accelerator action='ToggleMark%dAlt1'/>" | |
1726 "<accelerator action='SelectMark%dAlt1'/>", | |
1727 mark, mark); | |
1728 } | |
1729 g_string_append(desc, "</ui>" ); | |
162
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
1730 |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
1731 error = NULL; |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
1732 if (!gtk_ui_manager_add_ui_from_string(lw->ui_manager, desc->str, -1, &error)) |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
1733 { |
512
f9bf33be53ff
Remove whitespace between function name and first parenthesis for the sake of consistency.
zas_
parents:
497
diff
changeset
|
1734 g_message("building menus failed: %s", error->message); |
f9bf33be53ff
Remove whitespace between function name and first parenthesis for the sake of consistency.
zas_
parents:
497
diff
changeset
|
1735 g_error_free(error); |
f9bf33be53ff
Remove whitespace between function name and first parenthesis for the sake of consistency.
zas_
parents:
497
diff
changeset
|
1736 exit(EXIT_FAILURE); |
162
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
1737 } |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
1738 g_string_free(desc, TRUE); |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
1739 } |
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
1740 |
1272 | 1741 static GList *layout_actions_editor_menu_path(EditorDescription *editor) |
1742 { | |
1743 gchar **split = g_strsplit(editor->menu_path, "/", 0); | |
1744 gint i = 0; | |
1745 GList *ret = NULL; | |
1746 | |
1747 if (split[0] == NULL) | |
1748 { | |
1749 g_strfreev(split); | |
1750 return NULL; | |
1751 } | |
1752 | |
1348
acf1797b74c7
Add missing space between while and first parenthesis.
zas_
parents:
1345
diff
changeset
|
1753 while (split[i]) |
1272 | 1754 { |
1755 ret = g_list_prepend(ret, g_strdup(split[i])); | |
1756 i++; | |
1757 } | |
1758 | |
1759 g_strfreev(split); | |
1760 | |
1761 ret = g_list_prepend(ret, g_strdup(editor->key)); | |
1762 | |
1763 return g_list_reverse(ret); | |
1764 } | |
1765 | |
1766 static void layout_actions_editor_add(GString *desc, GList *path, GList *old_path) | |
1767 { | |
1768 gint to_open, to_close, i; | |
1769 while (path && old_path && strcmp((gchar *)path->data, (gchar *)old_path->data) == 0) | |
1770 { | |
1771 path = path->next; | |
1772 old_path = old_path->next; | |
1773 } | |
1774 to_open = g_list_length(path) - 1; | |
1775 to_close = g_list_length(old_path) - 1; | |
1776 | |
1275 | 1777 if (to_close > 0) |
1778 { | |
1779 old_path = g_list_last(old_path); | |
1780 old_path = old_path->prev; | |
1781 } | |
1782 | |
1272 | 1783 for (i = 0; i < to_close; i++) |
1784 { | |
1275 | 1785 gchar *name = old_path->data; |
1786 if (g_str_has_suffix(name, "Section")) | |
1787 { | |
1788 g_string_append(desc, " </placeholder>"); | |
1789 } | |
1790 else if (g_str_has_suffix(name, "Menu")) | |
1791 { | |
1792 g_string_append(desc, " </menu>"); | |
1793 } | |
1794 else | |
1795 { | |
1796 g_warning("invalid menu path item %s", name); | |
1797 } | |
1798 old_path = old_path->prev; | |
1272 | 1799 } |
1800 | |
1801 for (i = 0; i < to_open; i++) | |
1802 { | |
1275 | 1803 gchar *name = path->data; |
1804 if (g_str_has_suffix(name, "Section")) | |
1805 { | |
1806 g_string_append_printf(desc, " <placeholder name='%s'>", name); | |
1807 } | |
1808 else if (g_str_has_suffix(name, "Menu")) | |
1809 { | |
1810 g_string_append_printf(desc, " <menu action='%s'>", name); | |
1811 } | |
1812 else | |
1813 { | |
1814 g_warning("invalid menu path item %s", name); | |
1815 } | |
1272 | 1816 path = path->next; |
1817 } | |
1818 | |
1819 if (path) | |
1820 g_string_append_printf(desc, " <menuitem action='%s'/>", (gchar *)path->data); | |
1821 } | |
1822 | |
1823 static void layout_actions_setup_editors(LayoutWindow *lw) | |
1824 { | |
1825 GError *error; | |
1826 GList *editors_list; | |
1827 GList *work; | |
1828 GList *old_path; | |
1463
25168240a247
added function to reload external editors at any time
nadvornik
parents:
1461
diff
changeset
|
1829 GString *desc; |
25168240a247
added function to reload external editors at any time
nadvornik
parents:
1461
diff
changeset
|
1830 |
25168240a247
added function to reload external editors at any time
nadvornik
parents:
1461
diff
changeset
|
1831 lw->action_group_editors = gtk_action_group_new("MenuActionsExternal"); |
25168240a247
added function to reload external editors at any time
nadvornik
parents:
1461
diff
changeset
|
1832 gtk_ui_manager_insert_action_group(lw->ui_manager, lw->action_group_editors, 1); |
25168240a247
added function to reload external editors at any time
nadvornik
parents:
1461
diff
changeset
|
1833 |
25168240a247
added function to reload external editors at any time
nadvornik
parents:
1461
diff
changeset
|
1834 /* lw->action_group_editors contains translated entries, no translate func is required */ |
25168240a247
added function to reload external editors at any time
nadvornik
parents:
1461
diff
changeset
|
1835 desc = g_string_new( |
1272 | 1836 "<ui>" |
1837 " <menubar name='MainMenu'>"); | |
1838 | |
1839 editors_list = editor_list_get(); | |
1840 | |
1841 old_path = NULL; | |
1842 work = editors_list; | |
1348
acf1797b74c7
Add missing space between while and first parenthesis.
zas_
parents:
1345
diff
changeset
|
1843 while (work) |
1272 | 1844 { |
1845 GList *path; | |
1846 EditorDescription *editor = work->data; | |
1468 | 1847 GtkActionEntry entry = { editor->key, NULL, editor->name, editor->hotkey, editor->comment, G_CALLBACK(layout_menu_edit_cb) }; |
1341 | 1848 |
1345 | 1849 if (editor->icon && register_theme_icon_as_stock(editor->key, editor->icon)) |
1341 | 1850 { |
1851 entry.stock_id = editor->key; | |
1852 } | |
1463
25168240a247
added function to reload external editors at any time
nadvornik
parents:
1461
diff
changeset
|
1853 gtk_action_group_add_actions(lw->action_group_editors, &entry, 1, lw); |
1272 | 1854 |
1855 path = layout_actions_editor_menu_path(editor); | |
1856 layout_actions_editor_add(desc, path, old_path); | |
1857 | |
1858 string_list_free(old_path); | |
1859 old_path = path; | |
1860 work = work->next; | |
1861 } | |
1862 | |
1863 layout_actions_editor_add(desc, NULL, old_path); | |
1864 string_list_free(old_path); | |
1865 | |
1866 g_string_append(desc, " </menubar>" | |
1867 "</ui>" ); | |
1868 | |
1869 error = NULL; | |
1463
25168240a247
added function to reload external editors at any time
nadvornik
parents:
1461
diff
changeset
|
1870 |
25168240a247
added function to reload external editors at any time
nadvornik
parents:
1461
diff
changeset
|
1871 lw->ui_editors_id = gtk_ui_manager_add_ui_from_string(lw->ui_manager, desc->str, -1, &error); |
25168240a247
added function to reload external editors at any time
nadvornik
parents:
1461
diff
changeset
|
1872 if (!lw->ui_editors_id) |
1272 | 1873 { |
1874 g_message("building menus failed: %s", error->message); | |
1875 g_error_free(error); | |
1876 exit(EXIT_FAILURE); | |
1877 } | |
1878 g_string_free(desc, TRUE); | |
1879 g_list_free(editors_list); | |
1880 } | |
1881 | |
9 | 1882 void layout_actions_setup(LayoutWindow *lw) |
1883 { | |
1884 GError *error; | |
1885 | |
1886 if (lw->ui_manager) return; | |
1887 | |
513
985fdfebd89e
Remove whitespace between function name and first parenthesis for the sake of consistency. (pass 2)
zas_
parents:
512
diff
changeset
|
1888 lw->action_group = gtk_action_group_new("MenuActions"); |
9 | 1889 gtk_action_group_set_translate_func(lw->action_group, menu_translate, NULL, NULL); |
1890 | |
1891 gtk_action_group_add_actions(lw->action_group, | |
1892 menu_entries, G_N_ELEMENTS(menu_entries), lw); | |
1893 gtk_action_group_add_toggle_actions(lw->action_group, | |
1894 menu_toggle_entries, G_N_ELEMENTS(menu_toggle_entries), lw); | |
1895 gtk_action_group_add_radio_actions(lw->action_group, | |
1896 menu_radio_entries, G_N_ELEMENTS(menu_radio_entries), | |
1897 0, G_CALLBACK(layout_menu_list_cb), lw); | |
156
dd6dc0a55d3d
better integration of split image functions into menu
nadvornik
parents:
138
diff
changeset
|
1898 gtk_action_group_add_radio_actions(lw->action_group, |
dd6dc0a55d3d
better integration of split image functions into menu
nadvornik
parents:
138
diff
changeset
|
1899 menu_split_radio_entries, G_N_ELEMENTS(menu_split_radio_entries), |
dd6dc0a55d3d
better integration of split image functions into menu
nadvornik
parents:
138
diff
changeset
|
1900 0, G_CALLBACK(layout_menu_split_cb), lw); |
380
5afe77bb563a
Introduce a new struct ViewDir to handle directory views common
zas_
parents:
343
diff
changeset
|
1901 gtk_action_group_add_radio_actions(lw->action_group, |
523
0717bcc4f2b7
Handle the case of reduction of the number of view directory types.
zas_
parents:
513
diff
changeset
|
1902 menu_view_dir_radio_entries, VIEW_DIR_TYPES_COUNT, |
380
5afe77bb563a
Introduce a new struct ViewDir to handle directory views common
zas_
parents:
343
diff
changeset
|
1903 0, G_CALLBACK(layout_menu_view_dir_as_cb), lw); |
1547
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1904 gtk_action_group_add_radio_actions(lw->action_group, |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1905 menu_color_radio_entries, COLOR_PROFILE_FILE + COLOR_PROFILE_INPUTS, |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1906 0, G_CALLBACK(layout_color_menu_input_cb), lw); |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
1907 |
9 | 1908 |
1909 lw->ui_manager = gtk_ui_manager_new(); | |
1910 gtk_ui_manager_set_add_tearoffs(lw->ui_manager, TRUE); | |
1911 gtk_ui_manager_insert_action_group(lw->ui_manager, lw->action_group, 0); | |
1912 | |
1913 error = NULL; | |
1914 if (!gtk_ui_manager_add_ui_from_string(lw->ui_manager, menu_ui_description, -1, &error)) | |
1915 { | |
512
f9bf33be53ff
Remove whitespace between function name and first parenthesis for the sake of consistency.
zas_
parents:
497
diff
changeset
|
1916 g_message("building menus failed: %s", error->message); |
f9bf33be53ff
Remove whitespace between function name and first parenthesis for the sake of consistency.
zas_
parents:
497
diff
changeset
|
1917 g_error_free(error); |
f9bf33be53ff
Remove whitespace between function name and first parenthesis for the sake of consistency.
zas_
parents:
497
diff
changeset
|
1918 exit(EXIT_FAILURE); |
9 | 1919 } |
497 | 1920 |
1335 | 1921 layout_toolbar_clear(lw); |
1922 layout_toolbar_add_default(lw); | |
1923 | |
162
1a42a2451575
created menu "Select" with selection and marks operations
nadvornik
parents:
160
diff
changeset
|
1924 layout_actions_setup_marks(lw); |
1272 | 1925 layout_actions_setup_editors(lw); |
1470 | 1926 |
1927 layout_actions_add_window(lw, lw->window); | |
9 | 1928 } |
1929 | |
1463
25168240a247
added function to reload external editors at any time
nadvornik
parents:
1461
diff
changeset
|
1930 void layout_editors_reload_all(void) |
25168240a247
added function to reload external editors at any time
nadvornik
parents:
1461
diff
changeset
|
1931 { |
25168240a247
added function to reload external editors at any time
nadvornik
parents:
1461
diff
changeset
|
1932 GList *work; |
25168240a247
added function to reload external editors at any time
nadvornik
parents:
1461
diff
changeset
|
1933 |
25168240a247
added function to reload external editors at any time
nadvornik
parents:
1461
diff
changeset
|
1934 work = layout_window_list; |
25168240a247
added function to reload external editors at any time
nadvornik
parents:
1461
diff
changeset
|
1935 while (work) |
25168240a247
added function to reload external editors at any time
nadvornik
parents:
1461
diff
changeset
|
1936 { |
25168240a247
added function to reload external editors at any time
nadvornik
parents:
1461
diff
changeset
|
1937 LayoutWindow *lw = work->data; |
25168240a247
added function to reload external editors at any time
nadvornik
parents:
1461
diff
changeset
|
1938 work = work->next; |
25168240a247
added function to reload external editors at any time
nadvornik
parents:
1461
diff
changeset
|
1939 |
25168240a247
added function to reload external editors at any time
nadvornik
parents:
1461
diff
changeset
|
1940 gtk_ui_manager_remove_ui(lw->ui_manager, lw->ui_editors_id); |
25168240a247
added function to reload external editors at any time
nadvornik
parents:
1461
diff
changeset
|
1941 gtk_ui_manager_remove_action_group(lw->ui_manager, lw->action_group_editors); |
25168240a247
added function to reload external editors at any time
nadvornik
parents:
1461
diff
changeset
|
1942 g_object_unref(lw->action_group_editors); |
25168240a247
added function to reload external editors at any time
nadvornik
parents:
1461
diff
changeset
|
1943 } |
25168240a247
added function to reload external editors at any time
nadvornik
parents:
1461
diff
changeset
|
1944 |
25168240a247
added function to reload external editors at any time
nadvornik
parents:
1461
diff
changeset
|
1945 editor_load_descriptions(); |
25168240a247
added function to reload external editors at any time
nadvornik
parents:
1461
diff
changeset
|
1946 |
25168240a247
added function to reload external editors at any time
nadvornik
parents:
1461
diff
changeset
|
1947 work = layout_window_list; |
25168240a247
added function to reload external editors at any time
nadvornik
parents:
1461
diff
changeset
|
1948 while (work) |
25168240a247
added function to reload external editors at any time
nadvornik
parents:
1461
diff
changeset
|
1949 { |
25168240a247
added function to reload external editors at any time
nadvornik
parents:
1461
diff
changeset
|
1950 LayoutWindow *lw = work->data; |
25168240a247
added function to reload external editors at any time
nadvornik
parents:
1461
diff
changeset
|
1951 work = work->next; |
25168240a247
added function to reload external editors at any time
nadvornik
parents:
1461
diff
changeset
|
1952 layout_actions_setup_editors(lw); |
25168240a247
added function to reload external editors at any time
nadvornik
parents:
1461
diff
changeset
|
1953 } |
25168240a247
added function to reload external editors at any time
nadvornik
parents:
1461
diff
changeset
|
1954 } |
25168240a247
added function to reload external editors at any time
nadvornik
parents:
1461
diff
changeset
|
1955 |
9 | 1956 void layout_actions_add_window(LayoutWindow *lw, GtkWidget *window) |
1957 { | |
1958 GtkAccelGroup *group; | |
1959 | |
1960 if (!lw->ui_manager) return; | |
1961 | |
1962 group = gtk_ui_manager_get_accel_group(lw->ui_manager); | |
1963 gtk_window_add_accel_group(GTK_WINDOW(window), group); | |
1964 } | |
1965 | |
1966 GtkWidget *layout_actions_menu_bar(LayoutWindow *lw) | |
1967 { | |
1470 | 1968 if (lw->menu_bar) return lw->menu_bar; |
1969 lw->menu_bar = gtk_ui_manager_get_widget(lw->ui_manager, "/MainMenu"); | |
1970 g_object_ref(lw->menu_bar); | |
1971 return lw->menu_bar; | |
9 | 1972 } |
1973 | |
1335 | 1974 GtkWidget *layout_actions_toolbar(LayoutWindow *lw) |
9 | 1975 { |
1470 | 1976 if (lw->toolbar) return lw->toolbar; |
1977 lw->toolbar = gtk_ui_manager_get_widget(lw->ui_manager, "/ToolBar"); | |
1978 g_object_ref(lw->toolbar); | |
1979 gtk_toolbar_set_icon_size(GTK_TOOLBAR(lw->toolbar), GTK_ICON_SIZE_SMALL_TOOLBAR); | |
1980 gtk_toolbar_set_style(GTK_TOOLBAR(lw->toolbar), GTK_TOOLBAR_ICONS); | |
1981 return lw->toolbar; | |
9 | 1982 } |
1983 | |
1335 | 1984 void layout_toolbar_clear(LayoutWindow *lw) |
1985 { | |
1986 if (lw->toolbar_merge_id) | |
1987 { | |
1988 gtk_ui_manager_remove_ui(lw->ui_manager, lw->toolbar_merge_id); | |
1989 gtk_ui_manager_ensure_update(lw->ui_manager); | |
1990 } | |
1991 string_list_free(lw->toolbar_actions); | |
1992 lw->toolbar_actions = NULL; | |
1993 | |
1994 lw->toolbar_merge_id = gtk_ui_manager_new_merge_id(lw->ui_manager); | |
1995 } | |
1996 | |
1997 | |
1998 void layout_toolbar_add(LayoutWindow *lw, const gchar *action) | |
1999 { | |
2000 if (!action || !lw->ui_manager) return; | |
1469
607c60506863
added a possibility to update existing bars from config
nadvornik
parents:
1468
diff
changeset
|
2001 |
607c60506863
added a possibility to update existing bars from config
nadvornik
parents:
1468
diff
changeset
|
2002 if (g_list_find_custom(lw->toolbar_actions, action, (GCompareFunc)strcmp)) return; |
607c60506863
added a possibility to update existing bars from config
nadvornik
parents:
1468
diff
changeset
|
2003 |
1335 | 2004 gtk_ui_manager_add_ui(lw->ui_manager, lw->toolbar_merge_id, "/ToolBar", action, action, GTK_UI_MANAGER_TOOLITEM, FALSE); |
2005 lw->toolbar_actions = g_list_append(lw->toolbar_actions, g_strdup(action)); | |
2006 } | |
2007 | |
2008 | |
2009 void layout_toolbar_add_default(LayoutWindow *lw) | |
2010 { | |
2011 layout_toolbar_add(lw, "Thumbnails"); | |
2012 layout_toolbar_add(lw, "Back"); | |
2013 layout_toolbar_add(lw, "Home"); | |
2014 layout_toolbar_add(lw, "Refresh"); | |
2015 layout_toolbar_add(lw, "ZoomIn"); | |
2016 layout_toolbar_add(lw, "ZoomOut"); | |
2017 layout_toolbar_add(lw, "ZoomFit"); | |
2018 layout_toolbar_add(lw, "Zoom100"); | |
2019 layout_toolbar_add(lw, "Preferences"); | |
2020 layout_toolbar_add(lw, "FloatTools"); | |
2021 } | |
2022 | |
2023 void layout_toolbar_write_config(LayoutWindow *lw, GString *outstr, gint indent) | |
2024 { | |
2025 GList *work = lw->toolbar_actions; | |
1461 | 2026 WRITE_NL(); WRITE_STRING("<toolbar>"); |
1335 | 2027 indent++; |
1469
607c60506863
added a possibility to update existing bars from config
nadvornik
parents:
1468
diff
changeset
|
2028 WRITE_NL(); WRITE_STRING("<clear/>"); |
1335 | 2029 while (work) |
2030 { | |
2031 gchar *action = work->data; | |
2032 work = work->next; | |
1461 | 2033 WRITE_NL(); WRITE_STRING("<toolitem "); |
1335 | 2034 write_char_option(outstr, indent + 1, "action", action); |
1461 | 2035 WRITE_STRING("/>"); |
1335 | 2036 } |
2037 indent--; | |
1461 | 2038 WRITE_NL(); WRITE_STRING("</toolbar>"); |
1335 | 2039 } |
2040 | |
2041 void layout_toolbar_add_from_config(LayoutWindow *lw, const gchar **attribute_names, const gchar **attribute_values) | |
2042 { | |
2043 gchar *action = NULL; | |
2044 | |
2045 while (*attribute_names) | |
2046 { | |
2047 const gchar *option = *attribute_names++; | |
2048 const gchar *value = *attribute_values++; | |
2049 | |
2050 if (READ_CHAR_FULL("action", action)) continue; | |
2051 | |
1464 | 2052 log_printf("unknown attribute %s = %s\n", option, value); |
1335 | 2053 } |
2054 | |
2055 layout_toolbar_add(lw, action); | |
2056 g_free(action); | |
2057 } | |
2058 | |
9 | 2059 /* |
2060 *----------------------------------------------------------------------------- | |
2061 * misc | |
2062 *----------------------------------------------------------------------------- | |
2063 */ | |
1547
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
2064 static gchar *layout_color_name_parse(const gchar *name) |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
2065 { |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
2066 if (!name || !*name) return g_strdup(_("Empty")); |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
2067 return g_strdelimit(g_strdup(name), "_", '-'); |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
2068 } |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
2069 |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
2070 static void layout_util_sync_color(LayoutWindow *lw) |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
2071 { |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
2072 GtkAction *action; |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
2073 gint input = 0; |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
2074 gboolean use_color; |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
2075 gboolean use_image = FALSE; |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
2076 gint i; |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
2077 gchar action_name[15]; |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
2078 |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
2079 if (!lw->action_group) return; |
1548 | 2080 if (!layout_image_color_profile_get(lw, &input, &use_image)) return; |
1547
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
2081 |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
2082 use_color = layout_image_color_profile_get_use(lw); |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
2083 |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
2084 action = gtk_action_group_get_action(lw->action_group, "UseColorProfiles"); |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
2085 gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(action), use_color); |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
2086 |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
2087 action = gtk_action_group_get_action(lw->action_group, "UseImageProfile"); |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
2088 gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(action), use_image); |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
2089 gtk_action_set_sensitive(action, use_color); |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
2090 |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
2091 for (i = 0; i < COLOR_PROFILE_FILE + COLOR_PROFILE_INPUTS; i++) |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
2092 { |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
2093 sprintf(action_name, "ColorProfile%d", i); |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
2094 action = gtk_action_group_get_action(lw->action_group, action_name); |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
2095 |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
2096 if (i >= COLOR_PROFILE_FILE) |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
2097 { |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
2098 const gchar *name = options->color_profile.input_name[i - COLOR_PROFILE_FILE]; |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
2099 const gchar *file = options->color_profile.input_file[i - COLOR_PROFILE_FILE]; |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
2100 gchar *end; |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
2101 gchar *buf; |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
2102 |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
2103 if (!name || !name[0]) name = filename_from_path(file); |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
2104 |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
2105 end = layout_color_name_parse(name); |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
2106 buf = g_strdup_printf(_("Input _%d: %s"), i, end); |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
2107 g_free(end); |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
2108 |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
2109 g_object_set(G_OBJECT(action), "label", buf, NULL); |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
2110 g_free(buf); |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
2111 |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
2112 gtk_action_set_visible(action, file && file[0]); |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
2113 } |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
2114 |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
2115 gtk_action_set_sensitive(action, !use_image); |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
2116 gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(action), (i == input)); |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
2117 } |
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
2118 } |
9 | 2119 |
2120 static void layout_util_sync_views(LayoutWindow *lw) | |
2121 { | |
2122 GtkAction *action; | |
2123 | |
2124 if (!lw->action_group) return; | |
2125 | |
2126 action = gtk_action_group_get_action(lw->action_group, "FolderTree"); | |
1309 | 2127 radio_action_set_current_value(GTK_RADIO_ACTION(action), lw->options.dir_view_type); |
9 | 2128 |
1480 | 2129 action = gtk_action_group_get_action(lw->action_group, "SplitSingle"); |
2130 radio_action_set_current_value(GTK_RADIO_ACTION(action), lw->split_mode); | |
2131 | |
9 | 2132 action = gtk_action_group_get_action(lw->action_group, "ViewIcons"); |
1412 | 2133 gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(action), lw->options.file_view_type); |
9 | 2134 |
2135 action = gtk_action_group_get_action(lw->action_group, "FloatTools"); | |
1309 | 2136 gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(action), lw->options.tools_float); |
9 | 2137 |
1291
50ae02a4a675
replaced bar_info with an universal bar, restored the original
nadvornik
parents:
1285
diff
changeset
|
2138 action = gtk_action_group_get_action(lw->action_group, "SBar"); |
1317 | 2139 gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(action), layout_bar_enabled(lw)); |
9 | 2140 |
2141 action = gtk_action_group_get_action(lw->action_group, "SBarSort"); | |
1320 | 2142 gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(action), layout_bar_sort_enabled(lw)); |
9 | 2143 |
2144 action = gtk_action_group_get_action(lw->action_group, "HideToolbar"); | |
1309 | 2145 gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(action), lw->options.toolbar_hidden); |
1375
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1348
diff
changeset
|
2146 |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1348
diff
changeset
|
2147 action = gtk_action_group_get_action(lw->action_group, "HideInfoPixel"); |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1348
diff
changeset
|
2148 gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(action), lw->options.info_pixel_hidden); |
433
5ddcf93278c7
Save Show Marks state to rc file and display current state in menu.
zas_
parents:
429
diff
changeset
|
2149 |
5ddcf93278c7
Save Show Marks state to rc file and display current state in menu.
zas_
parents:
429
diff
changeset
|
2150 action = gtk_action_group_get_action(lw->action_group, "ShowMarks"); |
1309 | 2151 gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(action), lw->options.show_marks); |
451 | 2152 |
2153 action = gtk_action_group_get_action(lw->action_group, "SlideShow"); | |
2154 gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(action), layout_image_slideshow_active(lw)); | |
1293
48e064b37ba6
separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents:
1292
diff
changeset
|
2155 |
1547
2a3efbdf73b0
moved color profiles from statusbar to View menu
nadvornik
parents:
1520
diff
changeset
|
2156 layout_util_sync_color(lw); |
9 | 2157 } |
2158 | |
2159 void layout_util_sync_thumb(LayoutWindow *lw) | |
2160 { | |
2161 GtkAction *action; | |
2162 | |
2163 if (!lw->action_group) return; | |
2164 | |
2165 action = gtk_action_group_get_action(lw->action_group, "Thumbnails"); | |
1309 | 2166 gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(action), lw->options.show_thumbnails); |
1412 | 2167 g_object_set(action, "sensitive", (lw->options.file_view_type == FILEVIEW_LIST), NULL); |
9 | 2168 } |
2169 | |
2170 void layout_util_sync(LayoutWindow *lw) | |
2171 { | |
2172 layout_util_sync_views(lw); | |
2173 layout_util_sync_thumb(lw); | |
2174 layout_menu_recent_update(lw); | |
1272 | 2175 // layout_menu_edit_update(lw); |
9 | 2176 } |
2177 | |
2178 /* | |
2179 *----------------------------------------------------------------------------- | |
2180 * icons (since all the toolbar icons are included here, best place as any) | |
2181 *----------------------------------------------------------------------------- | |
2182 */ | |
2183 | |
2184 PixmapFolders *folder_icons_new(void) | |
2185 { | |
2186 PixmapFolders *pf; | |
2187 | |
2188 pf = g_new0(PixmapFolders, 1); | |
2189 | |
2190 pf->close = pixbuf_inline(PIXBUF_INLINE_FOLDER_CLOSED); | |
2191 pf->open = pixbuf_inline(PIXBUF_INLINE_FOLDER_OPEN); | |
2192 pf->deny = pixbuf_inline(PIXBUF_INLINE_FOLDER_LOCKED); | |
2193 pf->parent = pixbuf_inline(PIXBUF_INLINE_FOLDER_UP); | |
2194 | |
2195 return pf; | |
2196 } | |
2197 | |
2198 void folder_icons_free(PixmapFolders *pf) | |
2199 { | |
2200 if (!pf) return; | |
2201 | |
2202 g_object_unref(pf->close); | |
2203 g_object_unref(pf->open); | |
2204 g_object_unref(pf->deny); | |
2205 g_object_unref(pf->parent); | |
2206 | |
2207 g_free(pf); | |
2208 } | |
2209 | |
2210 /* | |
2211 *----------------------------------------------------------------------------- | |
2212 * sidebars | |
2213 *----------------------------------------------------------------------------- | |
2214 */ | |
2215 | |
1317 | 2216 static gboolean layout_bar_enabled(LayoutWindow *lw) |
2217 { | |
2218 return lw->bar && GTK_WIDGET_VISIBLE(lw->bar); | |
2219 } | |
2220 | |
1291
50ae02a4a675
replaced bar_info with an universal bar, restored the original
nadvornik
parents:
1285
diff
changeset
|
2221 static void layout_bar_destroyed(GtkWidget *widget, gpointer data) |
9 | 2222 { |
2223 LayoutWindow *lw = data; | |
2224 | |
1291
50ae02a4a675
replaced bar_info with an universal bar, restored the original
nadvornik
parents:
1285
diff
changeset
|
2225 lw->bar = NULL; |
1317 | 2226 /* |
2227 do not call layout_util_sync_views(lw) here | |
2228 this is called either when whole layout is destroyed - no need for update | |
2229 or when the bar is replaced - sync is called by upper function at the end of whole operation | |
9 | 2230 |
1317 | 2231 */ |
9 | 2232 } |
2233 | |
1317 | 2234 static void layout_bar_set_default(LayoutWindow *lw) |
489
3809ffa3567b
Save state and width of exif, info and sort panels to rc file.
zas_
parents:
482
diff
changeset
|
2235 { |
1317 | 2236 GtkWidget *bar; |
489
3809ffa3567b
Save state and width of exif, info and sort panels to rc file.
zas_
parents:
482
diff
changeset
|
2237 |
9 | 2238 if (!lw->utility_box) return; |
442 | 2239 |
1484 | 2240 bar = bar_new(lw); |
1317 | 2241 |
2242 layout_bar_set(lw, bar); | |
1484 | 2243 |
2244 bar_populate_default(bar); | |
9 | 2245 } |
442 | 2246 |
1317 | 2247 static void layout_bar_close(LayoutWindow *lw) |
9 | 2248 { |
1291
50ae02a4a675
replaced bar_info with an universal bar, restored the original
nadvornik
parents:
1285
diff
changeset
|
2249 if (lw->bar) |
9 | 2250 { |
1291
50ae02a4a675
replaced bar_info with an universal bar, restored the original
nadvornik
parents:
1285
diff
changeset
|
2251 bar_close(lw->bar); |
50ae02a4a675
replaced bar_info with an universal bar, restored the original
nadvornik
parents:
1285
diff
changeset
|
2252 lw->bar = NULL; |
9 | 2253 } |
1309 | 2254 } |
2255 | |
1317 | 2256 |
2257 void layout_bar_set(LayoutWindow *lw, GtkWidget *bar) | |
1309 | 2258 { |
1317 | 2259 if (!lw->utility_box) return; |
2260 | |
2261 layout_bar_close(lw); /* if any */ | |
2262 | |
2263 if (!bar) return; | |
2264 lw->bar = bar; | |
2265 | |
2266 g_signal_connect(G_OBJECT(lw->bar), "destroy", | |
2267 G_CALLBACK(layout_bar_destroyed), lw); | |
2268 | |
2269 | |
1383 | 2270 // gtk_box_pack_start(GTK_BOX(lw->utility_box), lw->bar, FALSE, FALSE, 0); |
2271 gtk_paned_pack2(GTK_PANED(lw->utility_paned), lw->bar, FALSE, TRUE); | |
1317 | 2272 |
2273 bar_set_fd(lw->bar, layout_image_get_fd(lw)); | |
2274 } | |
2275 | |
2276 | |
2277 void layout_bar_toggle(LayoutWindow *lw) | |
2278 { | |
2279 if (layout_bar_enabled(lw)) | |
1309 | 2280 { |
2281 gtk_widget_hide(lw->bar); | |
2282 } | |
9 | 2283 else |
2284 { | |
1317 | 2285 if (!lw->bar) |
2286 { | |
2287 layout_bar_set_default(lw); | |
2288 } | |
2289 gtk_widget_show(lw->bar); | |
1508 | 2290 bar_set_fd(lw->bar, layout_image_get_fd(lw)); |
9 | 2291 } |
1317 | 2292 layout_util_sync_views(lw); |
9 | 2293 } |
2294 | |
1291
50ae02a4a675
replaced bar_info with an universal bar, restored the original
nadvornik
parents:
1285
diff
changeset
|
2295 static void layout_bar_new_image(LayoutWindow *lw) |
9 | 2296 { |
1317 | 2297 if (!layout_bar_enabled(lw)) return; |
9 | 2298 |
1291
50ae02a4a675
replaced bar_info with an universal bar, restored the original
nadvornik
parents:
1285
diff
changeset
|
2299 bar_set_fd(lw->bar, layout_image_get_fd(lw)); |
9 | 2300 } |
2301 | |
1291
50ae02a4a675
replaced bar_info with an universal bar, restored the original
nadvornik
parents:
1285
diff
changeset
|
2302 static void layout_bar_new_selection(LayoutWindow *lw, gint count) |
9 | 2303 { |
1317 | 2304 if (!layout_bar_enabled(lw)) return; |
9 | 2305 |
1520 | 2306 bar_notify_selection(lw->bar, count); |
9 | 2307 } |
2308 | |
1320 | 2309 static gboolean layout_bar_sort_enabled(LayoutWindow *lw) |
2310 { | |
2311 return lw->bar_sort && GTK_WIDGET_VISIBLE(lw->bar_sort); | |
2312 } | |
2313 | |
2314 | |
9 | 2315 static void layout_bar_sort_destroyed(GtkWidget *widget, gpointer data) |
2316 { | |
2317 LayoutWindow *lw = data; | |
2318 | |
2319 lw->bar_sort = NULL; | |
2320 | |
1320 | 2321 /* |
2322 do not call layout_util_sync_views(lw) here | |
2323 this is called either when whole layout is destroyed - no need for update | |
2324 or when the bar is replaced - sync is called by upper function at the end of whole operation | |
9 | 2325 |
1320 | 2326 */ |
9 | 2327 } |
2328 | |
1320 | 2329 static void layout_bar_sort_set_default(LayoutWindow *lw) |
9 | 2330 { |
1320 | 2331 GtkWidget *bar; |
2332 | |
9 | 2333 if (!lw->utility_box) return; |
2334 | |
1320 | 2335 bar = bar_sort_new_default(lw); |
2336 | |
2337 layout_bar_sort_set(lw, bar); | |
9 | 2338 } |
2339 | |
2340 static void layout_bar_sort_close(LayoutWindow *lw) | |
2341 { | |
2342 if (lw->bar_sort) | |
2343 { | |
2344 bar_sort_close(lw->bar_sort); | |
2345 lw->bar_sort = NULL; | |
2346 } | |
1320 | 2347 } |
2348 | |
2349 void layout_bar_sort_set(LayoutWindow *lw, GtkWidget *bar) | |
2350 { | |
2351 if (!lw->utility_box) return; | |
2352 | |
2353 layout_bar_sort_close(lw); /* if any */ | |
2354 | |
2355 if (!bar) return; | |
2356 lw->bar_sort = bar; | |
2357 | |
2358 g_signal_connect(G_OBJECT(lw->bar_sort), "destroy", | |
2359 G_CALLBACK(layout_bar_sort_destroyed), lw); | |
2360 | |
2361 gtk_box_pack_end(GTK_BOX(lw->utility_box), lw->bar_sort, FALSE, FALSE, 0); | |
9 | 2362 } |
2363 | |
2364 void layout_bar_sort_toggle(LayoutWindow *lw) | |
2365 { | |
1320 | 2366 if (layout_bar_sort_enabled(lw)) |
9 | 2367 { |
1320 | 2368 gtk_widget_hide(lw->bar_sort); |
9 | 2369 } |
2370 else | |
2371 { | |
1320 | 2372 if (!lw->bar_sort) |
2373 { | |
2374 layout_bar_sort_set_default(lw); | |
2375 } | |
2376 gtk_widget_show(lw->bar_sort); | |
9 | 2377 } |
1320 | 2378 layout_util_sync_views(lw); |
9 | 2379 } |
2380 | |
2381 void layout_bars_new_image(LayoutWindow *lw) | |
2382 { | |
1291
50ae02a4a675
replaced bar_info with an universal bar, restored the original
nadvornik
parents:
1285
diff
changeset
|
2383 layout_bar_new_image(lw); |
1293
48e064b37ba6
separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents:
1292
diff
changeset
|
2384 |
48e064b37ba6
separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents:
1292
diff
changeset
|
2385 if (lw->exif_window) advanced_exif_set_fd(lw->exif_window, layout_image_get_fd(lw)); |
1214
31402ecb2aed
write metadata after timeout, image change or dir change
nadvornik
parents:
1176
diff
changeset
|
2386 |
31402ecb2aed
write metadata after timeout, image change or dir change
nadvornik
parents:
1176
diff
changeset
|
2387 /* this should be called here to handle the metadata edited in bars */ |
31402ecb2aed
write metadata after timeout, image change or dir change
nadvornik
parents:
1176
diff
changeset
|
2388 if (options->metadata.confirm_on_image_change) |
1231 | 2389 metadata_write_queue_confirm(NULL, NULL); |
9 | 2390 } |
2391 | |
2392 void layout_bars_new_selection(LayoutWindow *lw, gint count) | |
2393 { | |
1291
50ae02a4a675
replaced bar_info with an universal bar, restored the original
nadvornik
parents:
1285
diff
changeset
|
2394 layout_bar_new_selection(lw, count); |
9 | 2395 } |
2396 | |
2397 GtkWidget *layout_bars_prepare(LayoutWindow *lw, GtkWidget *image) | |
2398 { | |
1470 | 2399 if (lw->utility_box) return lw->utility_box; |
9 | 2400 lw->utility_box = gtk_hbox_new(FALSE, PREF_PAD_GAP); |
1383 | 2401 lw->utility_paned = gtk_hpaned_new(); |
2402 gtk_box_pack_start(GTK_BOX(lw->utility_box), lw->utility_paned, TRUE, TRUE, 0); | |
2403 | |
2404 gtk_paned_pack1(GTK_PANED(lw->utility_paned), image, TRUE, FALSE); | |
2405 gtk_widget_show(lw->utility_paned); | |
2406 | |
9 | 2407 gtk_widget_show(image); |
2408 | |
1470 | 2409 g_object_ref(lw->utility_box); |
9 | 2410 return lw->utility_box; |
2411 } | |
2412 | |
2413 void layout_bars_close(LayoutWindow *lw) | |
2414 { | |
2415 layout_bar_sort_close(lw); | |
1291
50ae02a4a675
replaced bar_info with an universal bar, restored the original
nadvornik
parents:
1285
diff
changeset
|
2416 layout_bar_close(lw); |
9 | 2417 } |
2418 | |
1293
48e064b37ba6
separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents:
1292
diff
changeset
|
2419 static void layout_exif_window_destroy(GtkWidget *widget, gpointer data) |
48e064b37ba6
separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents:
1292
diff
changeset
|
2420 { |
48e064b37ba6
separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents:
1292
diff
changeset
|
2421 LayoutWindow *lw = data; |
48e064b37ba6
separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents:
1292
diff
changeset
|
2422 lw->exif_window = NULL; |
48e064b37ba6
separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents:
1292
diff
changeset
|
2423 } |
48e064b37ba6
separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents:
1292
diff
changeset
|
2424 |
48e064b37ba6
separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents:
1292
diff
changeset
|
2425 void layout_exif_window_new(LayoutWindow *lw) |
48e064b37ba6
separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents:
1292
diff
changeset
|
2426 { |
1433
b4ad1d201279
Use gboolean where applicable, minor cleanup and indentations fixes.
zas_
parents:
1412
diff
changeset
|
2427 if (lw->exif_window) return; |
b4ad1d201279
Use gboolean where applicable, minor cleanup and indentations fixes.
zas_
parents:
1412
diff
changeset
|
2428 |
b4ad1d201279
Use gboolean where applicable, minor cleanup and indentations fixes.
zas_
parents:
1412
diff
changeset
|
2429 lw->exif_window = advanced_exif_new(); |
b4ad1d201279
Use gboolean where applicable, minor cleanup and indentations fixes.
zas_
parents:
1412
diff
changeset
|
2430 if (!lw->exif_window) return; |
b4ad1d201279
Use gboolean where applicable, minor cleanup and indentations fixes.
zas_
parents:
1412
diff
changeset
|
2431 g_signal_connect(G_OBJECT(lw->exif_window), "destroy", |
b4ad1d201279
Use gboolean where applicable, minor cleanup and indentations fixes.
zas_
parents:
1412
diff
changeset
|
2432 G_CALLBACK(layout_exif_window_destroy), lw); |
b4ad1d201279
Use gboolean where applicable, minor cleanup and indentations fixes.
zas_
parents:
1412
diff
changeset
|
2433 advanced_exif_set_fd(lw->exif_window, layout_image_get_fd(lw)); |
1293
48e064b37ba6
separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents:
1292
diff
changeset
|
2434 } |
48e064b37ba6
separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents:
1292
diff
changeset
|
2435 |
1055
1646720364cf
Adding a vim modeline to all files - patch by Klaus Ethgen
nadvornik
parents:
1047
diff
changeset
|
2436 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */ |