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