Mercurial > hg > forks > geeqie
annotate src/layout.c @ 2909:2e7fd08bfbe4
DEBUG_NAME() function for use with GTKInspector
This debug function can be used with GTKInspector to provide a visual
indication of where a widget is declared.
This is a documentation facility to aid developers new to the project.
Sample call:
GTK_DEBUG=interactive src/geeqie
author | Colin Clark <colin.clark@cclark.uk> |
---|---|
date | Thu, 14 Feb 2019 12:05:04 +0000 |
parents | 4b92a65f8367 |
children |
rev | line source |
---|---|
9 | 1 /* |
2350
95507e596256
Update copyright in all files
Klaus Ethgen <Klaus@Ethgen.de>
parents:
2340
diff
changeset
|
2 * Copyright (C) 2006 John Ellis |
95507e596256
Update copyright in all files
Klaus Ethgen <Klaus@Ethgen.de>
parents:
2340
diff
changeset
|
3 * Copyright (C) 2008 - 2016 The Geeqie Team |
9 | 4 * |
5 * Author: John Ellis | |
6 * | |
2350
95507e596256
Update copyright in all files
Klaus Ethgen <Klaus@Ethgen.de>
parents:
2340
diff
changeset
|
7 * This program is free software; you can redistribute it and/or modify |
95507e596256
Update copyright in all files
Klaus Ethgen <Klaus@Ethgen.de>
parents:
2340
diff
changeset
|
8 * it under the terms of the GNU General Public License as published by |
95507e596256
Update copyright in all files
Klaus Ethgen <Klaus@Ethgen.de>
parents:
2340
diff
changeset
|
9 * the Free Software Foundation; either version 2 of the License, or |
95507e596256
Update copyright in all files
Klaus Ethgen <Klaus@Ethgen.de>
parents:
2340
diff
changeset
|
10 * (at your option) any later version. |
95507e596256
Update copyright in all files
Klaus Ethgen <Klaus@Ethgen.de>
parents:
2340
diff
changeset
|
11 * |
95507e596256
Update copyright in all files
Klaus Ethgen <Klaus@Ethgen.de>
parents:
2340
diff
changeset
|
12 * This program is distributed in the hope that it will be useful, |
95507e596256
Update copyright in all files
Klaus Ethgen <Klaus@Ethgen.de>
parents:
2340
diff
changeset
|
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
95507e596256
Update copyright in all files
Klaus Ethgen <Klaus@Ethgen.de>
parents:
2340
diff
changeset
|
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
95507e596256
Update copyright in all files
Klaus Ethgen <Klaus@Ethgen.de>
parents:
2340
diff
changeset
|
15 * GNU General Public License for more details. |
95507e596256
Update copyright in all files
Klaus Ethgen <Klaus@Ethgen.de>
parents:
2340
diff
changeset
|
16 * |
95507e596256
Update copyright in all files
Klaus Ethgen <Klaus@Ethgen.de>
parents:
2340
diff
changeset
|
17 * You should have received a copy of the GNU General Public License along |
95507e596256
Update copyright in all files
Klaus Ethgen <Klaus@Ethgen.de>
parents:
2340
diff
changeset
|
18 * with this program; if not, write to the Free Software Foundation, Inc., |
95507e596256
Update copyright in all files
Klaus Ethgen <Klaus@Ethgen.de>
parents:
2340
diff
changeset
|
19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
9 | 20 */ |
21 | |
281 | 22 #include "main.h" |
9 | 23 #include "layout.h" |
24 | |
507
7408e89b601d
Move debug macros from main.h to new debug.h.
Laurent Monin <geeqie@norz.org>
parents:
506
diff
changeset
|
25 #include "color-man.h" |
586
122fc2223b42
split filelist.c to filefilter.c and filedata.c
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
583
diff
changeset
|
26 #include "filedata.h" |
507
7408e89b601d
Move debug macros from main.h to new debug.h.
Laurent Monin <geeqie@norz.org>
parents:
506
diff
changeset
|
27 #include "histogram.h" |
2609
5beaa1da4f14
Fix #512: The "Back" button does not operate correctly
Colin Clark <colin.clark@cclark.uk>
parents:
2508
diff
changeset
|
28 #include "history_list.h" |
9 | 29 #include "image.h" |
482
b0194f65c239
Use image_osd_toggle() in layout_menu_overlay_cb().
Laurent Monin <geeqie@norz.org>
parents:
480
diff
changeset
|
30 #include "image-overlay.h" |
9 | 31 #include "layout_config.h" |
32 #include "layout_image.h" | |
33 #include "layout_util.h" | |
2508
a39331032807
Additional debug features
Colin Clark <colin.clark@cclark.uk>
parents:
2468
diff
changeset
|
34 #include "logwindow.h" |
9 | 35 #include "menu.h" |
23
9ff428db7772
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
John Ellis <johne@verizon.net>
parents:
9
diff
changeset
|
36 #include "pixbuf-renderer.h" |
9 | 37 #include "pixbuf_util.h" |
113
f2109493004f
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
91
diff
changeset
|
38 #include "utilops.h" |
380
41079d11eba7
Introduce a new struct ViewDir to handle directory views common
Laurent Monin <geeqie@norz.org>
parents:
368
diff
changeset
|
39 #include "view_dir.h" |
556
585f0de4f906
Replace Layout icon_view field by more generic file_view_type.
Laurent Monin <geeqie@norz.org>
parents:
555
diff
changeset
|
40 #include "view_file.h" |
9 | 41 #include "ui_fileops.h" |
42 #include "ui_menu.h" | |
43 #include "ui_misc.h" | |
44 #include "ui_tabcomp.h" | |
648
36e8da5a771d
Move some functions from main.[ch] to new window.[ch].
Laurent Monin <geeqie@norz.org>
parents:
632
diff
changeset
|
45 #include "window.h" |
1214
1e36edfd2a43
write metadata after timeout, image change or dir change
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1177
diff
changeset
|
46 #include "metadata.h" |
1309
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
47 #include "rcfile.h" |
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
48 #include "bar.h" |
1320
f1607e105298
improved bar_sort configuration
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1317
diff
changeset
|
49 #include "bar_sort.h" |
1436
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
50 #include "preferences.h" |
2450
361d89e79d74
Fix #431: Bookmarks (shortcuts) to folders
Colin Clark <cclark@mcb.net>
parents:
2444
diff
changeset
|
51 #include "shortcuts.h" |
528
c09da8b0fee9
Added LIRC patch written by Matteo Beniamino
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
523
diff
changeset
|
52 #ifdef HAVE_LIRC |
c09da8b0fee9
Added LIRC patch written by Matteo Beniamino
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
523
diff
changeset
|
53 #include "lirc.h" |
c09da8b0fee9
Added LIRC patch written by Matteo Beniamino
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
523
diff
changeset
|
54 #endif |
9 | 55 |
41
cac3a3efd1fd
Wed Apr 27 15:17:57 2005 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
23
diff
changeset
|
56 #define MAINWINDOW_DEF_WIDTH 700 |
cac3a3efd1fd
Wed Apr 27 15:17:57 2005 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
23
diff
changeset
|
57 #define MAINWINDOW_DEF_HEIGHT 500 |
9 | 58 |
553
20b3f221fcc5
Change default positions of dividers since width of the main menu
Laurent Monin <geeqie@norz.org>
parents:
531
diff
changeset
|
59 #define MAIN_WINDOW_DIV_HPOS (MAINWINDOW_DEF_WIDTH / 2) |
20b3f221fcc5
Change default positions of dividers since width of the main menu
Laurent Monin <geeqie@norz.org>
parents:
531
diff
changeset
|
60 #define MAIN_WINDOW_DIV_VPOS (MAINWINDOW_DEF_HEIGHT / 2) |
9 | 61 |
62 #define TOOLWINDOW_DEF_WIDTH 260 | |
63 #define TOOLWINDOW_DEF_HEIGHT 450 | |
553
20b3f221fcc5
Change default positions of dividers since width of the main menu
Laurent Monin <geeqie@norz.org>
parents:
531
diff
changeset
|
64 |
9 | 65 #define PROGRESS_WIDTH 150 |
66 #define ZOOM_LABEL_WIDTH 64 | |
67 | |
68 #define PANE_DIVIDER_SIZE 10 | |
69 | |
70 | |
71 GList *layout_window_list = NULL; | |
1473
0b75150d746c
layout id "_current_" matches the currently active layout window
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1470
diff
changeset
|
72 LayoutWindow *current_lw = NULL; |
9 | 73 |
74 static void layout_list_scroll_to_subpart(LayoutWindow *lw, const gchar *needle); | |
75 | |
76 | |
77 /* | |
78 *----------------------------------------------------------------------------- | |
79 * misc | |
80 *----------------------------------------------------------------------------- | |
81 */ | |
82 | |
1416
3ba63f325b08
Use gboolean pseudo type where applicable.
Laurent Monin <geeqie@norz.org>
parents:
1415
diff
changeset
|
83 gboolean layout_valid(LayoutWindow **lw) |
9 | 84 { |
85 if (*lw == NULL) | |
86 { | |
1473
0b75150d746c
layout id "_current_" matches the currently active layout window
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1470
diff
changeset
|
87 if (current_lw) *lw = current_lw; |
0b75150d746c
layout id "_current_" matches the currently active layout window
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1470
diff
changeset
|
88 else if (layout_window_list) *lw = layout_window_list->data; |
9 | 89 return (*lw != NULL); |
90 } | |
91 return (g_list_find(layout_window_list, *lw) != NULL); | |
92 } | |
93 | |
94 LayoutWindow *layout_find_by_image(ImageWindow *imd) | |
95 { | |
96 GList *work; | |
97 | |
98 work = layout_window_list; | |
99 while (work) | |
100 { | |
101 LayoutWindow *lw = work->data; | |
102 work = work->next; | |
103 | |
104 if (lw->image == imd) return lw; | |
105 } | |
106 | |
107 return NULL; | |
108 } | |
109 | |
368
515f8ef08cbe
New Go to directory view feature that permits to find and display the directory
Laurent Monin <geeqie@norz.org>
parents:
340
diff
changeset
|
110 LayoutWindow *layout_find_by_image_fd(ImageWindow *imd) |
515f8ef08cbe
New Go to directory view feature that permits to find and display the directory
Laurent Monin <geeqie@norz.org>
parents:
340
diff
changeset
|
111 { |
515f8ef08cbe
New Go to directory view feature that permits to find and display the directory
Laurent Monin <geeqie@norz.org>
parents:
340
diff
changeset
|
112 GList *work; |
515f8ef08cbe
New Go to directory view feature that permits to find and display the directory
Laurent Monin <geeqie@norz.org>
parents:
340
diff
changeset
|
113 |
515f8ef08cbe
New Go to directory view feature that permits to find and display the directory
Laurent Monin <geeqie@norz.org>
parents:
340
diff
changeset
|
114 work = layout_window_list; |
515f8ef08cbe
New Go to directory view feature that permits to find and display the directory
Laurent Monin <geeqie@norz.org>
parents:
340
diff
changeset
|
115 while (work) |
515f8ef08cbe
New Go to directory view feature that permits to find and display the directory
Laurent Monin <geeqie@norz.org>
parents:
340
diff
changeset
|
116 { |
515f8ef08cbe
New Go to directory view feature that permits to find and display the directory
Laurent Monin <geeqie@norz.org>
parents:
340
diff
changeset
|
117 LayoutWindow *lw = work->data; |
515f8ef08cbe
New Go to directory view feature that permits to find and display the directory
Laurent Monin <geeqie@norz.org>
parents:
340
diff
changeset
|
118 work = work->next; |
1372 | 119 |
368
515f8ef08cbe
New Go to directory view feature that permits to find and display the directory
Laurent Monin <geeqie@norz.org>
parents:
340
diff
changeset
|
120 if (lw->image->image_fd == imd->image_fd) |
515f8ef08cbe
New Go to directory view feature that permits to find and display the directory
Laurent Monin <geeqie@norz.org>
parents:
340
diff
changeset
|
121 return lw; |
515f8ef08cbe
New Go to directory view feature that permits to find and display the directory
Laurent Monin <geeqie@norz.org>
parents:
340
diff
changeset
|
122 } |
515f8ef08cbe
New Go to directory view feature that permits to find and display the directory
Laurent Monin <geeqie@norz.org>
parents:
340
diff
changeset
|
123 |
515f8ef08cbe
New Go to directory view feature that permits to find and display the directory
Laurent Monin <geeqie@norz.org>
parents:
340
diff
changeset
|
124 return NULL; |
515f8ef08cbe
New Go to directory view feature that permits to find and display the directory
Laurent Monin <geeqie@norz.org>
parents:
340
diff
changeset
|
125 } |
515f8ef08cbe
New Go to directory view feature that permits to find and display the directory
Laurent Monin <geeqie@norz.org>
parents:
340
diff
changeset
|
126 |
1466
a8a7e7feeefc
added possibility to update existing layout window from config
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1464
diff
changeset
|
127 LayoutWindow *layout_find_by_layout_id(const gchar *id) |
a8a7e7feeefc
added possibility to update existing layout window from config
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1464
diff
changeset
|
128 { |
a8a7e7feeefc
added possibility to update existing layout window from config
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1464
diff
changeset
|
129 GList *work; |
a8a7e7feeefc
added possibility to update existing layout window from config
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1464
diff
changeset
|
130 |
a8a7e7feeefc
added possibility to update existing layout window from config
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1464
diff
changeset
|
131 if (!id || !id[0]) return NULL; |
2185
c14a1d8e6aa4
Trim trailing white spaces on empty lines.
Laurent Monin <zas@norz.org>
parents:
2184
diff
changeset
|
132 |
1473
0b75150d746c
layout id "_current_" matches the currently active layout window
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1470
diff
changeset
|
133 if (strcmp(id, LAYOUT_ID_CURRENT) == 0) |
0b75150d746c
layout id "_current_" matches the currently active layout window
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1470
diff
changeset
|
134 { |
0b75150d746c
layout id "_current_" matches the currently active layout window
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1470
diff
changeset
|
135 if (current_lw) return current_lw; |
0b75150d746c
layout id "_current_" matches the currently active layout window
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1470
diff
changeset
|
136 if (layout_window_list) return layout_window_list->data; |
0b75150d746c
layout id "_current_" matches the currently active layout window
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1470
diff
changeset
|
137 return NULL; |
0b75150d746c
layout id "_current_" matches the currently active layout window
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1470
diff
changeset
|
138 } |
0b75150d746c
layout id "_current_" matches the currently active layout window
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1470
diff
changeset
|
139 |
1466
a8a7e7feeefc
added possibility to update existing layout window from config
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1464
diff
changeset
|
140 work = layout_window_list; |
a8a7e7feeefc
added possibility to update existing layout window from config
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1464
diff
changeset
|
141 while (work) |
a8a7e7feeefc
added possibility to update existing layout window from config
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1464
diff
changeset
|
142 { |
a8a7e7feeefc
added possibility to update existing layout window from config
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1464
diff
changeset
|
143 LayoutWindow *lw = work->data; |
a8a7e7feeefc
added possibility to update existing layout window from config
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1464
diff
changeset
|
144 work = work->next; |
a8a7e7feeefc
added possibility to update existing layout window from config
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1464
diff
changeset
|
145 |
a8a7e7feeefc
added possibility to update existing layout window from config
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1464
diff
changeset
|
146 if (lw->options.id && strcmp(id, lw->options.id) == 0) |
a8a7e7feeefc
added possibility to update existing layout window from config
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1464
diff
changeset
|
147 return lw; |
a8a7e7feeefc
added possibility to update existing layout window from config
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1464
diff
changeset
|
148 } |
a8a7e7feeefc
added possibility to update existing layout window from config
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1464
diff
changeset
|
149 |
a8a7e7feeefc
added possibility to update existing layout window from config
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1464
diff
changeset
|
150 return NULL; |
a8a7e7feeefc
added possibility to update existing layout window from config
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1464
diff
changeset
|
151 } |
a8a7e7feeefc
added possibility to update existing layout window from config
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1464
diff
changeset
|
152 |
a8a7e7feeefc
added possibility to update existing layout window from config
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1464
diff
changeset
|
153 static void layout_set_unique_id(LayoutWindow *lw) |
a8a7e7feeefc
added possibility to update existing layout window from config
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1464
diff
changeset
|
154 { |
a8a7e7feeefc
added possibility to update existing layout window from config
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1464
diff
changeset
|
155 char id[10]; |
a8a7e7feeefc
added possibility to update existing layout window from config
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1464
diff
changeset
|
156 gint i; |
a8a7e7feeefc
added possibility to update existing layout window from config
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1464
diff
changeset
|
157 if (lw->options.id && lw->options.id[0]) return; /* id is already set */ |
2185
c14a1d8e6aa4
Trim trailing white spaces on empty lines.
Laurent Monin <zas@norz.org>
parents:
2184
diff
changeset
|
158 |
1466
a8a7e7feeefc
added possibility to update existing layout window from config
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1464
diff
changeset
|
159 g_free(lw->options.id); |
a8a7e7feeefc
added possibility to update existing layout window from config
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1464
diff
changeset
|
160 lw->options.id = NULL; |
2185
c14a1d8e6aa4
Trim trailing white spaces on empty lines.
Laurent Monin <zas@norz.org>
parents:
2184
diff
changeset
|
161 |
1466
a8a7e7feeefc
added possibility to update existing layout window from config
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1464
diff
changeset
|
162 if (!layout_find_by_layout_id("main")) |
a8a7e7feeefc
added possibility to update existing layout window from config
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1464
diff
changeset
|
163 { |
a8a7e7feeefc
added possibility to update existing layout window from config
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1464
diff
changeset
|
164 lw->options.id = g_strdup("main"); |
a8a7e7feeefc
added possibility to update existing layout window from config
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1464
diff
changeset
|
165 return; |
a8a7e7feeefc
added possibility to update existing layout window from config
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1464
diff
changeset
|
166 } |
2185
c14a1d8e6aa4
Trim trailing white spaces on empty lines.
Laurent Monin <zas@norz.org>
parents:
2184
diff
changeset
|
167 |
1466
a8a7e7feeefc
added possibility to update existing layout window from config
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1464
diff
changeset
|
168 i = 1; |
a8a7e7feeefc
added possibility to update existing layout window from config
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1464
diff
changeset
|
169 while (TRUE) |
a8a7e7feeefc
added possibility to update existing layout window from config
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1464
diff
changeset
|
170 { |
a8a7e7feeefc
added possibility to update existing layout window from config
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1464
diff
changeset
|
171 g_snprintf(id, sizeof(id), "lw%d", i); |
a8a7e7feeefc
added possibility to update existing layout window from config
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1464
diff
changeset
|
172 if (!layout_find_by_layout_id(id)) |
a8a7e7feeefc
added possibility to update existing layout window from config
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1464
diff
changeset
|
173 { |
a8a7e7feeefc
added possibility to update existing layout window from config
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1464
diff
changeset
|
174 lw->options.id = g_strdup(id); |
a8a7e7feeefc
added possibility to update existing layout window from config
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1464
diff
changeset
|
175 return; |
a8a7e7feeefc
added possibility to update existing layout window from config
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1464
diff
changeset
|
176 } |
a8a7e7feeefc
added possibility to update existing layout window from config
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1464
diff
changeset
|
177 i++; |
a8a7e7feeefc
added possibility to update existing layout window from config
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1464
diff
changeset
|
178 } |
a8a7e7feeefc
added possibility to update existing layout window from config
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1464
diff
changeset
|
179 } |
a8a7e7feeefc
added possibility to update existing layout window from config
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1464
diff
changeset
|
180 |
1473
0b75150d746c
layout id "_current_" matches the currently active layout window
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1470
diff
changeset
|
181 static gboolean layout_set_current_cb(GtkWidget *widget, GdkEventFocus *event, gpointer data) |
0b75150d746c
layout id "_current_" matches the currently active layout window
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1470
diff
changeset
|
182 { |
0b75150d746c
layout id "_current_" matches the currently active layout window
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1470
diff
changeset
|
183 LayoutWindow *lw = data; |
0b75150d746c
layout id "_current_" matches the currently active layout window
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1470
diff
changeset
|
184 current_lw = lw; |
0b75150d746c
layout id "_current_" matches the currently active layout window
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1470
diff
changeset
|
185 return FALSE; |
0b75150d746c
layout id "_current_" matches the currently active layout window
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1470
diff
changeset
|
186 } |
0b75150d746c
layout id "_current_" matches the currently active layout window
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1470
diff
changeset
|
187 |
2450
361d89e79d74
Fix #431: Bookmarks (shortcuts) to folders
Colin Clark <cclark@mcb.net>
parents:
2444
diff
changeset
|
188 static void layout_box_folders_changed_cb(GtkWidget *widget, gpointer data) |
361d89e79d74
Fix #431: Bookmarks (shortcuts) to folders
Colin Clark <cclark@mcb.net>
parents:
2444
diff
changeset
|
189 { |
361d89e79d74
Fix #431: Bookmarks (shortcuts) to folders
Colin Clark <cclark@mcb.net>
parents:
2444
diff
changeset
|
190 LayoutWindow *lw; |
361d89e79d74
Fix #431: Bookmarks (shortcuts) to folders
Colin Clark <cclark@mcb.net>
parents:
2444
diff
changeset
|
191 GList *work; |
361d89e79d74
Fix #431: Bookmarks (shortcuts) to folders
Colin Clark <cclark@mcb.net>
parents:
2444
diff
changeset
|
192 |
361d89e79d74
Fix #431: Bookmarks (shortcuts) to folders
Colin Clark <cclark@mcb.net>
parents:
2444
diff
changeset
|
193 /* FIXME: this is probably not the correct way to implement this */ |
361d89e79d74
Fix #431: Bookmarks (shortcuts) to folders
Colin Clark <cclark@mcb.net>
parents:
2444
diff
changeset
|
194 work = layout_window_list; |
361d89e79d74
Fix #431: Bookmarks (shortcuts) to folders
Colin Clark <cclark@mcb.net>
parents:
2444
diff
changeset
|
195 while (work) |
361d89e79d74
Fix #431: Bookmarks (shortcuts) to folders
Colin Clark <cclark@mcb.net>
parents:
2444
diff
changeset
|
196 { |
361d89e79d74
Fix #431: Bookmarks (shortcuts) to folders
Colin Clark <cclark@mcb.net>
parents:
2444
diff
changeset
|
197 lw = work->data; |
361d89e79d74
Fix #431: Bookmarks (shortcuts) to folders
Colin Clark <cclark@mcb.net>
parents:
2444
diff
changeset
|
198 lw->options.folder_window.vdivider_pos = gtk_paned_get_position(GTK_PANED(widget)); |
361d89e79d74
Fix #431: Bookmarks (shortcuts) to folders
Colin Clark <cclark@mcb.net>
parents:
2444
diff
changeset
|
199 work = work->next; |
361d89e79d74
Fix #431: Bookmarks (shortcuts) to folders
Colin Clark <cclark@mcb.net>
parents:
2444
diff
changeset
|
200 } |
361d89e79d74
Fix #431: Bookmarks (shortcuts) to folders
Colin Clark <cclark@mcb.net>
parents:
2444
diff
changeset
|
201 } |
361d89e79d74
Fix #431: Bookmarks (shortcuts) to folders
Colin Clark <cclark@mcb.net>
parents:
2444
diff
changeset
|
202 |
9 | 203 /* |
204 *----------------------------------------------------------------------------- | |
205 * menu, toolbar, and dir view | |
206 *----------------------------------------------------------------------------- | |
207 */ | |
208 | |
209 static void layout_path_entry_changed_cb(GtkWidget *widget, gpointer data) | |
210 { | |
211 LayoutWindow *lw = data; | |
212 gchar *buf; | |
213 | |
214 if (gtk_combo_box_get_active(GTK_COMBO_BOX(widget)) < 0) return; | |
215 | |
216 buf = g_strdup(gtk_entry_get_text(GTK_ENTRY(lw->path_entry))); | |
1372 | 217 if (!lw->dir_fd || strcmp(buf, lw->dir_fd->path) != 0) |
9 | 218 { |
1372 | 219 layout_set_path(lw, buf); |
9 | 220 } |
221 | |
442 | 222 g_free(buf); |
9 | 223 } |
224 | |
225 static void layout_path_entry_tab_cb(const gchar *path, gpointer data) | |
226 { | |
227 LayoutWindow *lw = data; | |
228 gchar *buf; | |
229 | |
230 buf = g_strdup(path); | |
231 parse_out_relatives(buf); | |
2185
c14a1d8e6aa4
Trim trailing white spaces on empty lines.
Laurent Monin <zas@norz.org>
parents:
2184
diff
changeset
|
232 |
9 | 233 if (isdir(buf)) |
234 { | |
783
0e45ed008a1c
replaced directory path with FileData* dir_fd
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
774
diff
changeset
|
235 if ((!lw->dir_fd || strcmp(lw->dir_fd->path, buf) != 0) && layout_set_path(lw, buf)) |
9 | 236 { |
2732
cff064279094
Fix #592: Directory widget loses focus on tab completion
Colin Clark <colin.clark@cclark.uk>
parents:
2723
diff
changeset
|
237 gtk_widget_grab_focus(GTK_WIDGET(lw->path_entry)); |
9 | 238 gint pos = -1; |
726
5166ed61c537
Use G_DIR_SEPARATOR where applicable.
Laurent Monin <geeqie@norz.org>
parents:
725
diff
changeset
|
239 /* put the G_DIR_SEPARATOR back, if we are in tab completion for a dir and result was path change */ |
725
ee5f1f4fd7e7
Use G_DIR_SEPARATOR_S where applicable.
Laurent Monin <geeqie@norz.org>
parents:
694
diff
changeset
|
240 gtk_editable_insert_text(GTK_EDITABLE(lw->path_entry), G_DIR_SEPARATOR_S, -1, &pos); |
9 | 241 gtk_editable_set_position(GTK_EDITABLE(lw->path_entry), |
242 strlen(gtk_entry_get_text(GTK_ENTRY(lw->path_entry)))); | |
243 } | |
244 } | |
1372 | 245 else if (lw->dir_fd) |
9 | 246 { |
1372 | 247 gchar *base = remove_level_from_path(buf); |
248 | |
249 if (strcmp(lw->dir_fd->path, base) == 0) | |
250 { | |
251 layout_list_scroll_to_subpart(lw, filename_from_path(buf)); | |
252 } | |
253 g_free(base); | |
9 | 254 } |
2185
c14a1d8e6aa4
Trim trailing white spaces on empty lines.
Laurent Monin <zas@norz.org>
parents:
2184
diff
changeset
|
255 |
9 | 256 g_free(buf); |
257 } | |
258 | |
259 static void layout_path_entry_cb(const gchar *path, gpointer data) | |
260 { | |
261 LayoutWindow *lw = data; | |
262 gchar *buf; | |
263 | |
264 buf = g_strdup(path); | |
265 parse_out_relatives(buf); | |
266 | |
267 layout_set_path(lw, buf); | |
268 | |
269 g_free(buf); | |
270 } | |
271 | |
1628
ac33c60e405e
simplified the code around vd_select_row
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1627
diff
changeset
|
272 static void layout_vd_select_cb(ViewDir *vd, FileData *fd, gpointer data) |
9 | 273 { |
274 LayoutWindow *lw = data; | |
275 | |
1628
ac33c60e405e
simplified the code around vd_select_row
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1627
diff
changeset
|
276 layout_set_fd(lw, fd); |
9 | 277 } |
278 | |
1167
95a52f5d7100
Add a back button in the toolbar: it allows to go back and forth between two directories. Experimental, please test and comment on ml.
Laurent Monin <geeqie@norz.org>
parents:
1055
diff
changeset
|
279 static void layout_path_entry_tab_append_cb(const gchar *path, gpointer data, gint n) |
95a52f5d7100
Add a back button in the toolbar: it allows to go back and forth between two directories. Experimental, please test and comment on ml.
Laurent Monin <geeqie@norz.org>
parents:
1055
diff
changeset
|
280 { |
95a52f5d7100
Add a back button in the toolbar: it allows to go back and forth between two directories. Experimental, please test and comment on ml.
Laurent Monin <geeqie@norz.org>
parents:
1055
diff
changeset
|
281 LayoutWindow *lw = data; |
95a52f5d7100
Add a back button in the toolbar: it allows to go back and forth between two directories. Experimental, please test and comment on ml.
Laurent Monin <geeqie@norz.org>
parents:
1055
diff
changeset
|
282 |
95a52f5d7100
Add a back button in the toolbar: it allows to go back and forth between two directories. Experimental, please test and comment on ml.
Laurent Monin <geeqie@norz.org>
parents:
1055
diff
changeset
|
283 if (!lw || !lw->back_button) return; |
95a52f5d7100
Add a back button in the toolbar: it allows to go back and forth between two directories. Experimental, please test and comment on ml.
Laurent Monin <geeqie@norz.org>
parents:
1055
diff
changeset
|
284 if (!layout_valid(&lw)) return; |
95a52f5d7100
Add a back button in the toolbar: it allows to go back and forth between two directories. Experimental, please test and comment on ml.
Laurent Monin <geeqie@norz.org>
parents:
1055
diff
changeset
|
285 |
1372 | 286 /* Enable back button if it makes sense */ |
287 gtk_widget_set_sensitive(lw->back_button, (n > 1)); | |
1167
95a52f5d7100
Add a back button in the toolbar: it allows to go back and forth between two directories. Experimental, please test and comment on ml.
Laurent Monin <geeqie@norz.org>
parents:
1055
diff
changeset
|
288 } |
95a52f5d7100
Add a back button in the toolbar: it allows to go back and forth between two directories. Experimental, please test and comment on ml.
Laurent Monin <geeqie@norz.org>
parents:
1055
diff
changeset
|
289 |
2808
1d43d9582f36
Tooltip for path entry
Colin Clark <colin.clark@cclark.uk>
parents:
2806
diff
changeset
|
290 static gboolean path_entry_tooltip_cb(GtkWidget *widget, gpointer data) |
1d43d9582f36
Tooltip for path entry
Colin Clark <colin.clark@cclark.uk>
parents:
2806
diff
changeset
|
291 { |
1d43d9582f36
Tooltip for path entry
Colin Clark <colin.clark@cclark.uk>
parents:
2806
diff
changeset
|
292 LayoutWindow *lw = data; |
1d43d9582f36
Tooltip for path entry
Colin Clark <colin.clark@cclark.uk>
parents:
2806
diff
changeset
|
293 GList *box_child_list; |
1d43d9582f36
Tooltip for path entry
Colin Clark <colin.clark@cclark.uk>
parents:
2806
diff
changeset
|
294 GtkComboBox *path_entry; |
1d43d9582f36
Tooltip for path entry
Colin Clark <colin.clark@cclark.uk>
parents:
2806
diff
changeset
|
295 gchar *current_path; |
1d43d9582f36
Tooltip for path entry
Colin Clark <colin.clark@cclark.uk>
parents:
2806
diff
changeset
|
296 |
1d43d9582f36
Tooltip for path entry
Colin Clark <colin.clark@cclark.uk>
parents:
2806
diff
changeset
|
297 box_child_list = gtk_container_get_children(GTK_CONTAINER(widget)); |
1d43d9582f36
Tooltip for path entry
Colin Clark <colin.clark@cclark.uk>
parents:
2806
diff
changeset
|
298 path_entry = box_child_list->data; |
1d43d9582f36
Tooltip for path entry
Colin Clark <colin.clark@cclark.uk>
parents:
2806
diff
changeset
|
299 current_path = gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(path_entry)); |
1d43d9582f36
Tooltip for path entry
Colin Clark <colin.clark@cclark.uk>
parents:
2806
diff
changeset
|
300 gtk_widget_set_tooltip_text(GTK_WIDGET(widget), current_path); |
1d43d9582f36
Tooltip for path entry
Colin Clark <colin.clark@cclark.uk>
parents:
2806
diff
changeset
|
301 |
1d43d9582f36
Tooltip for path entry
Colin Clark <colin.clark@cclark.uk>
parents:
2806
diff
changeset
|
302 g_free(current_path); |
1d43d9582f36
Tooltip for path entry
Colin Clark <colin.clark@cclark.uk>
parents:
2806
diff
changeset
|
303 g_list_free(box_child_list); |
1d43d9582f36
Tooltip for path entry
Colin Clark <colin.clark@cclark.uk>
parents:
2806
diff
changeset
|
304 |
1d43d9582f36
Tooltip for path entry
Colin Clark <colin.clark@cclark.uk>
parents:
2806
diff
changeset
|
305 return FALSE; |
1d43d9582f36
Tooltip for path entry
Colin Clark <colin.clark@cclark.uk>
parents:
2806
diff
changeset
|
306 } |
1d43d9582f36
Tooltip for path entry
Colin Clark <colin.clark@cclark.uk>
parents:
2806
diff
changeset
|
307 |
9 | 308 static GtkWidget *layout_tool_setup(LayoutWindow *lw) |
309 { | |
310 GtkWidget *box; | |
2450
361d89e79d74
Fix #431: Bookmarks (shortcuts) to folders
Colin Clark <cclark@mcb.net>
parents:
2444
diff
changeset
|
311 GtkWidget *box_folders; |
361d89e79d74
Fix #431: Bookmarks (shortcuts) to folders
Colin Clark <cclark@mcb.net>
parents:
2444
diff
changeset
|
312 GtkWidget *scd; |
2813
e9e8e8b2afce
Move menu/toolbar to top of window
Colin Clark <colin.clark@cclark.uk>
parents:
2808
diff
changeset
|
313 GtkWidget *menu_tool_bar; |
9 | 314 GtkWidget *tabcomp; |
315 | |
316 box = gtk_vbox_new(FALSE, 0); | |
317 | |
2813
e9e8e8b2afce
Move menu/toolbar to top of window
Colin Clark <colin.clark@cclark.uk>
parents:
2808
diff
changeset
|
318 menu_tool_bar = layout_actions_menu_tool_bar(lw); |
2909
2e7fd08bfbe4
DEBUG_NAME() function for use with GTKInspector
Colin Clark <colin.clark@cclark.uk>
parents:
2863
diff
changeset
|
319 DEBUG_NAME(menu_tool_bar); |
2813
e9e8e8b2afce
Move menu/toolbar to top of window
Colin Clark <colin.clark@cclark.uk>
parents:
2808
diff
changeset
|
320 gtk_widget_show(menu_tool_bar); |
e9e8e8b2afce
Move menu/toolbar to top of window
Colin Clark <colin.clark@cclark.uk>
parents:
2808
diff
changeset
|
321 gtk_box_pack_start(GTK_BOX(lw->main_box), lw->menu_tool_bar, FALSE, FALSE, 0); |
e9e8e8b2afce
Move menu/toolbar to top of window
Colin Clark <colin.clark@cclark.uk>
parents:
2808
diff
changeset
|
322 if (lw->options.toolbar_hidden) gtk_widget_hide(lw->toolbar[TOOLBAR_MAIN]); |
9 | 323 |
324 tabcomp = tab_completion_new_with_history(&lw->path_entry, NULL, "path_list", -1, | |
325 layout_path_entry_cb, lw); | |
2909
2e7fd08bfbe4
DEBUG_NAME() function for use with GTKInspector
Colin Clark <colin.clark@cclark.uk>
parents:
2863
diff
changeset
|
326 DEBUG_NAME(tabcomp); |
9 | 327 tab_completion_add_tab_func(lw->path_entry, layout_path_entry_tab_cb, lw); |
1167
95a52f5d7100
Add a back button in the toolbar: it allows to go back and forth between two directories. Experimental, please test and comment on ml.
Laurent Monin <geeqie@norz.org>
parents:
1055
diff
changeset
|
328 tab_completion_add_append_func(lw->path_entry, layout_path_entry_tab_append_cb, lw); |
9 | 329 gtk_box_pack_start(GTK_BOX(box), tabcomp, FALSE, FALSE, 0); |
330 gtk_widget_show(tabcomp); | |
2808
1d43d9582f36
Tooltip for path entry
Colin Clark <colin.clark@cclark.uk>
parents:
2806
diff
changeset
|
331 gtk_widget_set_has_tooltip(GTK_WIDGET(tabcomp), TRUE); |
1d43d9582f36
Tooltip for path entry
Colin Clark <colin.clark@cclark.uk>
parents:
2806
diff
changeset
|
332 g_signal_connect(G_OBJECT(tabcomp), "query_tooltip", G_CALLBACK(path_entry_tooltip_cb), lw); |
9 | 333 |
2427
95afc4dda19f
Temporary fix #459: GTK 3.20 drop-down
Colin Clark <cclark@mcb.net>
parents:
2419
diff
changeset
|
334 #if GTK_CHECK_VERSION(3,20,0) |
95afc4dda19f
Temporary fix #459: GTK 3.20 drop-down
Colin Clark <cclark@mcb.net>
parents:
2419
diff
changeset
|
335 g_signal_connect(G_OBJECT(gtk_widget_get_parent(gtk_widget_get_parent(lw->path_entry))), "changed", |
95afc4dda19f
Temporary fix #459: GTK 3.20 drop-down
Colin Clark <cclark@mcb.net>
parents:
2419
diff
changeset
|
336 G_CALLBACK(layout_path_entry_changed_cb), lw); |
95afc4dda19f
Temporary fix #459: GTK 3.20 drop-down
Colin Clark <cclark@mcb.net>
parents:
2419
diff
changeset
|
337 #else |
2034
9297985567b5
use accessor functions
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
2021
diff
changeset
|
338 g_signal_connect(G_OBJECT(gtk_widget_get_parent(lw->path_entry)), "changed", |
9 | 339 G_CALLBACK(layout_path_entry_changed_cb), lw); |
2427
95afc4dda19f
Temporary fix #459: GTK 3.20 drop-down
Colin Clark <cclark@mcb.net>
parents:
2419
diff
changeset
|
340 #endif |
9 | 341 |
2450
361d89e79d74
Fix #431: Bookmarks (shortcuts) to folders
Colin Clark <cclark@mcb.net>
parents:
2444
diff
changeset
|
342 box_folders = GTK_WIDGET(gtk_hpaned_new()); |
2909
2e7fd08bfbe4
DEBUG_NAME() function for use with GTKInspector
Colin Clark <colin.clark@cclark.uk>
parents:
2863
diff
changeset
|
343 DEBUG_NAME(box_folders); |
2450
361d89e79d74
Fix #431: Bookmarks (shortcuts) to folders
Colin Clark <cclark@mcb.net>
parents:
2444
diff
changeset
|
344 gtk_box_pack_start(GTK_BOX(box), box_folders, TRUE, TRUE, 0); |
361d89e79d74
Fix #431: Bookmarks (shortcuts) to folders
Colin Clark <cclark@mcb.net>
parents:
2444
diff
changeset
|
345 |
1309
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
346 lw->vd = vd_new(lw->options.dir_view_type, lw->dir_fd); |
380
41079d11eba7
Introduce a new struct ViewDir to handle directory views common
Laurent Monin <geeqie@norz.org>
parents:
368
diff
changeset
|
347 vd_set_layout(lw->vd, lw); |
41079d11eba7
Introduce a new struct ViewDir to handle directory views common
Laurent Monin <geeqie@norz.org>
parents:
368
diff
changeset
|
348 vd_set_select_func(lw->vd, layout_vd_select_cb, lw); |
9 | 349 |
380
41079d11eba7
Introduce a new struct ViewDir to handle directory views common
Laurent Monin <geeqie@norz.org>
parents:
368
diff
changeset
|
350 lw->dir_view = lw->vd->widget; |
2909
2e7fd08bfbe4
DEBUG_NAME() function for use with GTKInspector
Colin Clark <colin.clark@cclark.uk>
parents:
2863
diff
changeset
|
351 DEBUG_NAME(lw->dir_view); |
2450
361d89e79d74
Fix #431: Bookmarks (shortcuts) to folders
Colin Clark <cclark@mcb.net>
parents:
2444
diff
changeset
|
352 gtk_paned_add2(GTK_PANED(box_folders), lw->dir_view); |
9 | 353 gtk_widget_show(lw->dir_view); |
354 | |
2450
361d89e79d74
Fix #431: Bookmarks (shortcuts) to folders
Colin Clark <cclark@mcb.net>
parents:
2444
diff
changeset
|
355 scd = shortcuts_new_default(lw); |
2909
2e7fd08bfbe4
DEBUG_NAME() function for use with GTKInspector
Colin Clark <colin.clark@cclark.uk>
parents:
2863
diff
changeset
|
356 DEBUG_NAME(scd); |
2450
361d89e79d74
Fix #431: Bookmarks (shortcuts) to folders
Colin Clark <cclark@mcb.net>
parents:
2444
diff
changeset
|
357 gtk_paned_add1(GTK_PANED(box_folders), scd); |
361d89e79d74
Fix #431: Bookmarks (shortcuts) to folders
Colin Clark <cclark@mcb.net>
parents:
2444
diff
changeset
|
358 gtk_paned_set_position(GTK_PANED(box_folders), lw->options.folder_window.vdivider_pos); |
361d89e79d74
Fix #431: Bookmarks (shortcuts) to folders
Colin Clark <cclark@mcb.net>
parents:
2444
diff
changeset
|
359 |
361d89e79d74
Fix #431: Bookmarks (shortcuts) to folders
Colin Clark <cclark@mcb.net>
parents:
2444
diff
changeset
|
360 gtk_widget_show(box_folders); |
361d89e79d74
Fix #431: Bookmarks (shortcuts) to folders
Colin Clark <cclark@mcb.net>
parents:
2444
diff
changeset
|
361 |
361d89e79d74
Fix #431: Bookmarks (shortcuts) to folders
Colin Clark <cclark@mcb.net>
parents:
2444
diff
changeset
|
362 g_signal_connect(G_OBJECT(box_folders), "notify::position", |
361d89e79d74
Fix #431: Bookmarks (shortcuts) to folders
Colin Clark <cclark@mcb.net>
parents:
2444
diff
changeset
|
363 G_CALLBACK(layout_box_folders_changed_cb), lw); |
361d89e79d74
Fix #431: Bookmarks (shortcuts) to folders
Colin Clark <cclark@mcb.net>
parents:
2444
diff
changeset
|
364 |
9 | 365 gtk_widget_show(box); |
366 | |
367 return box; | |
368 } | |
369 | |
370 /* | |
371 *----------------------------------------------------------------------------- | |
372 * sort button (and menu) | |
373 *----------------------------------------------------------------------------- | |
374 */ | |
375 | |
376 static void layout_sort_menu_cb(GtkWidget *widget, gpointer data) | |
377 { | |
378 LayoutWindow *lw; | |
379 SortType type; | |
380 | |
113
f2109493004f
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
91
diff
changeset
|
381 if (!gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(widget))) return; |
f2109493004f
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
91
diff
changeset
|
382 |
9 | 383 lw = submenu_item_get_data(widget); |
384 if (!lw) return; | |
385 | |
386 type = (SortType)GPOINTER_TO_INT(data); | |
387 | |
2770
2e819f4a7a41
Read metadata in the idle loop
Colin Clark <colin.clark@cclark.uk>
parents:
2732
diff
changeset
|
388 if (type == SORT_EXIFTIME || type == SORT_EXIFTIMEDIGITIZED || type == SORT_RATING) |
2e819f4a7a41
Read metadata in the idle loop
Colin Clark <colin.clark@cclark.uk>
parents:
2732
diff
changeset
|
389 { |
2e819f4a7a41
Read metadata in the idle loop
Colin Clark <colin.clark@cclark.uk>
parents:
2732
diff
changeset
|
390 vf_read_metadata_in_idle(lw->vf); |
2e819f4a7a41
Read metadata in the idle loop
Colin Clark <colin.clark@cclark.uk>
parents:
2732
diff
changeset
|
391 } |
9 | 392 layout_sort_set(lw, type, lw->sort_ascend); |
393 } | |
394 | |
395 static void layout_sort_menu_ascend_cb(GtkWidget *widget, gpointer data) | |
396 { | |
397 LayoutWindow *lw = data; | |
398 | |
399 layout_sort_set(lw, lw->sort_method, !lw->sort_ascend); | |
400 } | |
401 | |
402 static void layout_sort_menu_hide_cb(GtkWidget *widget, gpointer data) | |
403 { | |
404 /* destroy the menu */ | |
1043
718ab8111f48
Replaced gtk depreceated code.
Petr Ostadal <postadal@suse.cz>
parents:
1029
diff
changeset
|
405 g_object_unref(widget); |
9 | 406 } |
407 | |
408 static void layout_sort_button_press_cb(GtkWidget *widget, gpointer data) | |
409 { | |
410 LayoutWindow *lw = data; | |
411 GtkWidget *menu; | |
412 GdkEvent *event; | |
413 guint32 etime; | |
414 | |
415 menu = submenu_add_sort(NULL, G_CALLBACK(layout_sort_menu_cb), lw, FALSE, FALSE, TRUE, lw->sort_method); | |
416 | |
88
a0bfbfe60a73
Fri Oct 27 19:45:32 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
81
diff
changeset
|
417 /* take ownership of menu */ |
a0bfbfe60a73
Fri Oct 27 19:45:32 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
81
diff
changeset
|
418 #ifdef GTK_OBJECT_FLOATING |
a0bfbfe60a73
Fri Oct 27 19:45:32 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
81
diff
changeset
|
419 /* GTK+ < 2.10 */ |
9 | 420 g_object_ref(G_OBJECT(menu)); |
421 gtk_object_sink(GTK_OBJECT(menu)); | |
88
a0bfbfe60a73
Fri Oct 27 19:45:32 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
81
diff
changeset
|
422 #else |
a0bfbfe60a73
Fri Oct 27 19:45:32 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
81
diff
changeset
|
423 /* GTK+ >= 2.10 */ |
a0bfbfe60a73
Fri Oct 27 19:45:32 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
81
diff
changeset
|
424 g_object_ref_sink(G_OBJECT(menu)); |
a0bfbfe60a73
Fri Oct 27 19:45:32 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
81
diff
changeset
|
425 #endif |
9 | 426 |
442 | 427 /* ascending option */ |
9 | 428 menu_item_add_divider(menu); |
429 menu_item_add_check(menu, _("Ascending"), lw->sort_ascend, G_CALLBACK(layout_sort_menu_ascend_cb), lw); | |
430 | |
431 g_signal_connect(G_OBJECT(menu), "selection_done", | |
432 G_CALLBACK(layout_sort_menu_hide_cb), NULL); | |
433 | |
434 event = gtk_get_current_event(); | |
435 if (event) | |
436 { | |
437 etime = gdk_event_get_time(event); | |
438 gdk_event_free(event); | |
439 } | |
440 else | |
441 { | |
442 etime = 0; | |
443 } | |
444 | |
445 gtk_menu_popup(GTK_MENU(menu), NULL, NULL, NULL, NULL, 0, etime); | |
446 } | |
447 | |
448 static GtkWidget *layout_sort_button(LayoutWindow *lw) | |
449 { | |
450 GtkWidget *button; | |
451 | |
452 button = gtk_button_new_with_label(sort_type_get_text(lw->sort_method)); | |
2909
2e7fd08bfbe4
DEBUG_NAME() function for use with GTKInspector
Colin Clark <colin.clark@cclark.uk>
parents:
2863
diff
changeset
|
453 DEBUG_NAME(button); |
442 | 454 g_signal_connect(G_OBJECT(button), "clicked", |
9 | 455 G_CALLBACK(layout_sort_button_press_cb), lw); |
442 | 456 gtk_button_set_relief(GTK_BUTTON(button), GTK_RELIEF_NONE); |
9 | 457 |
442 | 458 return button; |
9 | 459 } |
460 | |
2462
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
461 static void layout_zoom_menu_cb(GtkWidget *widget, gpointer data) |
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
462 { |
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
463 ZoomMode mode; |
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
464 |
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
465 if (!gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(widget))) return; |
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
466 |
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
467 mode = (ZoomMode)GPOINTER_TO_INT(data); |
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
468 options->image.zoom_mode = mode; |
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
469 } |
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
470 |
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
471 static void layout_scroll_menu_cb(GtkWidget *widget, gpointer data) |
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
472 { |
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
473 guint scroll_type; |
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
474 |
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
475 if (!gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(widget))) return; |
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
476 |
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
477 scroll_type = GPOINTER_TO_UINT(data); |
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
478 options->image.scroll_reset_method = scroll_type; |
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
479 image_options_sync(); |
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
480 } |
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
481 |
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
482 static void layout_zoom_menu_hide_cb(GtkWidget *widget, gpointer data) |
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
483 { |
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
484 /* destroy the menu */ |
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
485 g_object_unref(widget); |
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
486 } |
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
487 |
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
488 static void layout_zoom_button_press_cb(GtkWidget *widget, gpointer data) |
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
489 { |
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
490 LayoutWindow *lw = data; |
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
491 GtkWidget *menu; |
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
492 GdkEvent *event; |
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
493 guint32 etime; |
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
494 |
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
495 menu = submenu_add_zoom(NULL, G_CALLBACK(layout_zoom_menu_cb), |
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
496 lw, FALSE, FALSE, TRUE, options->image.zoom_mode); |
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
497 |
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
498 /* take ownership of menu */ |
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
499 #ifdef GTK_OBJECT_FLOATING |
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
500 /* GTK+ < 2.10 */ |
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
501 g_object_ref(G_OBJECT(menu)); |
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
502 gtk_object_sink(GTK_OBJECT(menu)); |
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
503 #else |
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
504 /* GTK+ >= 2.10 */ |
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
505 g_object_ref_sink(G_OBJECT(menu)); |
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
506 #endif |
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
507 |
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
508 menu_item_add_divider(menu); |
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
509 |
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
510 menu_item_add_radio(menu, _("Scroll to top left corner"), |
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
511 GUINT_TO_POINTER(SCROLL_RESET_TOPLEFT), |
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
512 options->image.scroll_reset_method == SCROLL_RESET_TOPLEFT, |
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
513 G_CALLBACK(layout_scroll_menu_cb), |
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
514 GUINT_TO_POINTER(SCROLL_RESET_TOPLEFT)); |
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
515 menu_item_add_radio(menu, _("Scroll to image center"), |
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
516 GUINT_TO_POINTER(SCROLL_RESET_CENTER), |
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
517 options->image.scroll_reset_method == SCROLL_RESET_CENTER, |
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
518 G_CALLBACK(layout_scroll_menu_cb), |
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
519 GUINT_TO_POINTER(SCROLL_RESET_CENTER)); |
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
520 menu_item_add_radio(menu, _("Keep the region from previous image"), |
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
521 GUINT_TO_POINTER(SCROLL_RESET_NOCHANGE), |
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
522 options->image.scroll_reset_method == SCROLL_RESET_NOCHANGE, |
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
523 G_CALLBACK(layout_scroll_menu_cb), |
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
524 GUINT_TO_POINTER(SCROLL_RESET_NOCHANGE)); |
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
525 |
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
526 g_signal_connect(G_OBJECT(menu), "selection_done", |
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
527 G_CALLBACK(layout_zoom_menu_hide_cb), NULL); |
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
528 |
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
529 event = gtk_get_current_event(); |
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
530 if (event) |
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
531 { |
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
532 etime = gdk_event_get_time(event); |
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
533 gdk_event_free(event); |
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
534 } |
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
535 else |
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
536 { |
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
537 etime = 0; |
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
538 } |
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
539 |
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
540 gtk_menu_popup(GTK_MENU(menu), NULL, NULL, NULL, NULL, 0, etime); |
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
541 } |
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
542 |
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
543 static GtkWidget *layout_zoom_button(LayoutWindow *lw, GtkWidget *box, gint size, gboolean expand) |
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
544 { |
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
545 GtkWidget *button; |
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
546 GtkWidget *frame; |
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
547 |
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
548 |
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
549 frame = gtk_frame_new(NULL); |
2909
2e7fd08bfbe4
DEBUG_NAME() function for use with GTKInspector
Colin Clark <colin.clark@cclark.uk>
parents:
2863
diff
changeset
|
550 DEBUG_NAME(frame); |
2462
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
551 if (size) gtk_widget_set_size_request(frame, size, -1); |
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
552 gtk_frame_set_shadow_type(GTK_FRAME(frame), GTK_SHADOW_IN); |
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
553 |
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
554 gtk_box_pack_start(GTK_BOX(box), frame, FALSE, FALSE, 0); |
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
555 |
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
556 gtk_widget_show(frame); |
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
557 |
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
558 button = gtk_button_new_with_label("1:1"); |
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
559 g_signal_connect(G_OBJECT(button), "clicked", |
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
560 G_CALLBACK(layout_zoom_button_press_cb), lw); |
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
561 gtk_button_set_relief(GTK_BUTTON(button), GTK_RELIEF_NONE); |
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
562 |
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
563 gtk_container_add(GTK_CONTAINER(frame), button); |
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
564 gtk_widget_show(button); |
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
565 |
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
566 return button; |
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
567 } |
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
568 |
113
f2109493004f
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
91
diff
changeset
|
569 /* |
f2109493004f
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
91
diff
changeset
|
570 *----------------------------------------------------------------------------- |
9 | 571 * status bar |
572 *----------------------------------------------------------------------------- | |
573 */ | |
574 | |
1240
6a1f19764c63
added a status bar button for writting metadata immediately
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1231
diff
changeset
|
575 |
9 | 576 void layout_status_update_progress(LayoutWindow *lw, gdouble val, const gchar *text) |
577 { | |
2770
2e819f4a7a41
Read metadata in the idle loop
Colin Clark <colin.clark@cclark.uk>
parents:
2732
diff
changeset
|
578 static gdouble thumb = 0; |
2e819f4a7a41
Read metadata in the idle loop
Colin Clark <colin.clark@cclark.uk>
parents:
2732
diff
changeset
|
579 static gdouble meta = 0; |
2e819f4a7a41
Read metadata in the idle loop
Colin Clark <colin.clark@cclark.uk>
parents:
2732
diff
changeset
|
580 |
9 | 581 if (!layout_valid(&lw)) return; |
582 if (!lw->info_progress_bar) return; | |
583 | |
2770
2e819f4a7a41
Read metadata in the idle loop
Colin Clark <colin.clark@cclark.uk>
parents:
2732
diff
changeset
|
584 /* Give priority to the loading meta data message |
2e819f4a7a41
Read metadata in the idle loop
Colin Clark <colin.clark@cclark.uk>
parents:
2732
diff
changeset
|
585 */ |
2e819f4a7a41
Read metadata in the idle loop
Colin Clark <colin.clark@cclark.uk>
parents:
2732
diff
changeset
|
586 if(!g_strcmp0(text, "Loading thumbs...")) |
2e819f4a7a41
Read metadata in the idle loop
Colin Clark <colin.clark@cclark.uk>
parents:
2732
diff
changeset
|
587 { |
2e819f4a7a41
Read metadata in the idle loop
Colin Clark <colin.clark@cclark.uk>
parents:
2732
diff
changeset
|
588 thumb = val; |
2e819f4a7a41
Read metadata in the idle loop
Colin Clark <colin.clark@cclark.uk>
parents:
2732
diff
changeset
|
589 if (meta) |
2e819f4a7a41
Read metadata in the idle loop
Colin Clark <colin.clark@cclark.uk>
parents:
2732
diff
changeset
|
590 { |
2e819f4a7a41
Read metadata in the idle loop
Colin Clark <colin.clark@cclark.uk>
parents:
2732
diff
changeset
|
591 return; |
2e819f4a7a41
Read metadata in the idle loop
Colin Clark <colin.clark@cclark.uk>
parents:
2732
diff
changeset
|
592 } |
2e819f4a7a41
Read metadata in the idle loop
Colin Clark <colin.clark@cclark.uk>
parents:
2732
diff
changeset
|
593 } |
2e819f4a7a41
Read metadata in the idle loop
Colin Clark <colin.clark@cclark.uk>
parents:
2732
diff
changeset
|
594 else |
2e819f4a7a41
Read metadata in the idle loop
Colin Clark <colin.clark@cclark.uk>
parents:
2732
diff
changeset
|
595 { |
2e819f4a7a41
Read metadata in the idle loop
Colin Clark <colin.clark@cclark.uk>
parents:
2732
diff
changeset
|
596 meta = val; |
2e819f4a7a41
Read metadata in the idle loop
Colin Clark <colin.clark@cclark.uk>
parents:
2732
diff
changeset
|
597 } |
2e819f4a7a41
Read metadata in the idle loop
Colin Clark <colin.clark@cclark.uk>
parents:
2732
diff
changeset
|
598 |
9 | 599 gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(lw->info_progress_bar), val); |
2770
2e819f4a7a41
Read metadata in the idle loop
Colin Clark <colin.clark@cclark.uk>
parents:
2732
diff
changeset
|
600 gtk_progress_bar_set_text(GTK_PROGRESS_BAR(lw->info_progress_bar), |
2e819f4a7a41
Read metadata in the idle loop
Colin Clark <colin.clark@cclark.uk>
parents:
2732
diff
changeset
|
601 val ? ((text) ? text : " ") : " "); |
9 | 602 } |
603 | |
604 void layout_status_update_info(LayoutWindow *lw, const gchar *text) | |
605 { | |
606 gchar *buf = NULL; | |
607 | |
608 if (!layout_valid(&lw)) return; | |
609 | |
610 if (!text) | |
611 { | |
736
31d858f3272d
Fix signed vs unsigned warnings.
Laurent Monin <geeqie@norz.org>
parents:
726
diff
changeset
|
612 guint n; |
9 | 613 gint64 n_bytes = 0; |
2185
c14a1d8e6aa4
Trim trailing white spaces on empty lines.
Laurent Monin <zas@norz.org>
parents:
2184
diff
changeset
|
614 |
984
3d834c6040ab
Only display status if there is at least one file in the file list.
Laurent Monin <geeqie@norz.org>
parents:
960
diff
changeset
|
615 n = layout_list_count(lw, &n_bytes); |
2185
c14a1d8e6aa4
Trim trailing white spaces on empty lines.
Laurent Monin <zas@norz.org>
parents:
2184
diff
changeset
|
616 |
984
3d834c6040ab
Only display status if there is at least one file in the file list.
Laurent Monin <geeqie@norz.org>
parents:
960
diff
changeset
|
617 if (n) |
3d834c6040ab
Only display status if there is at least one file in the file list.
Laurent Monin <geeqie@norz.org>
parents:
960
diff
changeset
|
618 { |
3d834c6040ab
Only display status if there is at least one file in the file list.
Laurent Monin <geeqie@norz.org>
parents:
960
diff
changeset
|
619 guint s; |
3d834c6040ab
Only display status if there is at least one file in the file list.
Laurent Monin <geeqie@norz.org>
parents:
960
diff
changeset
|
620 gint64 s_bytes = 0; |
3d834c6040ab
Only display status if there is at least one file in the file list.
Laurent Monin <geeqie@norz.org>
parents:
960
diff
changeset
|
621 const gchar *ss; |
9 | 622 |
984
3d834c6040ab
Only display status if there is at least one file in the file list.
Laurent Monin <geeqie@norz.org>
parents:
960
diff
changeset
|
623 if (layout_image_slideshow_active(lw)) |
9 | 624 { |
984
3d834c6040ab
Only display status if there is at least one file in the file list.
Laurent Monin <geeqie@norz.org>
parents:
960
diff
changeset
|
625 if (!layout_image_slideshow_paused(lw)) |
3d834c6040ab
Only display status if there is at least one file in the file list.
Laurent Monin <geeqie@norz.org>
parents:
960
diff
changeset
|
626 { |
3d834c6040ab
Only display status if there is at least one file in the file list.
Laurent Monin <geeqie@norz.org>
parents:
960
diff
changeset
|
627 ss = _(" Slideshow"); |
3d834c6040ab
Only display status if there is at least one file in the file list.
Laurent Monin <geeqie@norz.org>
parents:
960
diff
changeset
|
628 } |
3d834c6040ab
Only display status if there is at least one file in the file list.
Laurent Monin <geeqie@norz.org>
parents:
960
diff
changeset
|
629 else |
3d834c6040ab
Only display status if there is at least one file in the file list.
Laurent Monin <geeqie@norz.org>
parents:
960
diff
changeset
|
630 { |
3d834c6040ab
Only display status if there is at least one file in the file list.
Laurent Monin <geeqie@norz.org>
parents:
960
diff
changeset
|
631 ss = _(" Paused"); |
3d834c6040ab
Only display status if there is at least one file in the file list.
Laurent Monin <geeqie@norz.org>
parents:
960
diff
changeset
|
632 } |
9 | 633 } |
634 else | |
635 { | |
984
3d834c6040ab
Only display status if there is at least one file in the file list.
Laurent Monin <geeqie@norz.org>
parents:
960
diff
changeset
|
636 ss = ""; |
3d834c6040ab
Only display status if there is at least one file in the file list.
Laurent Monin <geeqie@norz.org>
parents:
960
diff
changeset
|
637 } |
2185
c14a1d8e6aa4
Trim trailing white spaces on empty lines.
Laurent Monin <zas@norz.org>
parents:
2184
diff
changeset
|
638 |
984
3d834c6040ab
Only display status if there is at least one file in the file list.
Laurent Monin <geeqie@norz.org>
parents:
960
diff
changeset
|
639 s = layout_selection_count(lw, &s_bytes); |
2185
c14a1d8e6aa4
Trim trailing white spaces on empty lines.
Laurent Monin <zas@norz.org>
parents:
2184
diff
changeset
|
640 |
984
3d834c6040ab
Only display status if there is at least one file in the file list.
Laurent Monin <geeqie@norz.org>
parents:
960
diff
changeset
|
641 layout_bars_new_selection(lw, s); |
2185
c14a1d8e6aa4
Trim trailing white spaces on empty lines.
Laurent Monin <zas@norz.org>
parents:
2184
diff
changeset
|
642 |
984
3d834c6040ab
Only display status if there is at least one file in the file list.
Laurent Monin <geeqie@norz.org>
parents:
960
diff
changeset
|
643 if (s > 0) |
3d834c6040ab
Only display status if there is at least one file in the file list.
Laurent Monin <geeqie@norz.org>
parents:
960
diff
changeset
|
644 { |
3d834c6040ab
Only display status if there is at least one file in the file list.
Laurent Monin <geeqie@norz.org>
parents:
960
diff
changeset
|
645 gchar *b = text_from_size_abrev(n_bytes); |
3d834c6040ab
Only display status if there is at least one file in the file list.
Laurent Monin <geeqie@norz.org>
parents:
960
diff
changeset
|
646 gchar *sb = text_from_size_abrev(s_bytes); |
3d834c6040ab
Only display status if there is at least one file in the file list.
Laurent Monin <geeqie@norz.org>
parents:
960
diff
changeset
|
647 buf = g_strdup_printf(_("%s, %d files (%s, %d)%s"), b, n, sb, s, ss); |
3d834c6040ab
Only display status if there is at least one file in the file list.
Laurent Monin <geeqie@norz.org>
parents:
960
diff
changeset
|
648 g_free(b); |
3d834c6040ab
Only display status if there is at least one file in the file list.
Laurent Monin <geeqie@norz.org>
parents:
960
diff
changeset
|
649 g_free(sb); |
9 | 650 } |
984
3d834c6040ab
Only display status if there is at least one file in the file list.
Laurent Monin <geeqie@norz.org>
parents:
960
diff
changeset
|
651 else if (n > 0) |
3d834c6040ab
Only display status if there is at least one file in the file list.
Laurent Monin <geeqie@norz.org>
parents:
960
diff
changeset
|
652 { |
3d834c6040ab
Only display status if there is at least one file in the file list.
Laurent Monin <geeqie@norz.org>
parents:
960
diff
changeset
|
653 gchar *b = text_from_size_abrev(n_bytes); |
3d834c6040ab
Only display status if there is at least one file in the file list.
Laurent Monin <geeqie@norz.org>
parents:
960
diff
changeset
|
654 buf = g_strdup_printf(_("%s, %d files%s"), b, n, ss); |
3d834c6040ab
Only display status if there is at least one file in the file list.
Laurent Monin <geeqie@norz.org>
parents:
960
diff
changeset
|
655 g_free(b); |
3d834c6040ab
Only display status if there is at least one file in the file list.
Laurent Monin <geeqie@norz.org>
parents:
960
diff
changeset
|
656 } |
3d834c6040ab
Only display status if there is at least one file in the file list.
Laurent Monin <geeqie@norz.org>
parents:
960
diff
changeset
|
657 else |
3d834c6040ab
Only display status if there is at least one file in the file list.
Laurent Monin <geeqie@norz.org>
parents:
960
diff
changeset
|
658 { |
3d834c6040ab
Only display status if there is at least one file in the file list.
Laurent Monin <geeqie@norz.org>
parents:
960
diff
changeset
|
659 buf = g_strdup_printf(_("%d files%s"), n, ss); |
3d834c6040ab
Only display status if there is at least one file in the file list.
Laurent Monin <geeqie@norz.org>
parents:
960
diff
changeset
|
660 } |
2185
c14a1d8e6aa4
Trim trailing white spaces on empty lines.
Laurent Monin <zas@norz.org>
parents:
2184
diff
changeset
|
661 |
984
3d834c6040ab
Only display status if there is at least one file in the file list.
Laurent Monin <geeqie@norz.org>
parents:
960
diff
changeset
|
662 text = buf; |
2185
c14a1d8e6aa4
Trim trailing white spaces on empty lines.
Laurent Monin <zas@norz.org>
parents:
2184
diff
changeset
|
663 |
984
3d834c6040ab
Only display status if there is at least one file in the file list.
Laurent Monin <geeqie@norz.org>
parents:
960
diff
changeset
|
664 image_osd_update(lw->image); |
9 | 665 } |
666 else | |
667 { | |
984
3d834c6040ab
Only display status if there is at least one file in the file list.
Laurent Monin <geeqie@norz.org>
parents:
960
diff
changeset
|
668 text = ""; |
9 | 669 } |
984
3d834c6040ab
Only display status if there is at least one file in the file list.
Laurent Monin <geeqie@norz.org>
parents:
960
diff
changeset
|
670 } |
2185
c14a1d8e6aa4
Trim trailing white spaces on empty lines.
Laurent Monin <zas@norz.org>
parents:
2184
diff
changeset
|
671 |
583
4d89efff3fb0
Revert patch 675, and correctly fix gtk assertion failure.
Laurent Monin <geeqie@norz.org>
parents:
574
diff
changeset
|
672 if (lw->info_status) gtk_label_set_text(GTK_LABEL(lw->info_status), text); |
9 | 673 g_free(buf); |
674 } | |
675 | |
676 void layout_status_update_image(LayoutWindow *lw) | |
677 { | |
984
3d834c6040ab
Only display status if there is at least one file in the file list.
Laurent Monin <geeqie@norz.org>
parents:
960
diff
changeset
|
678 guint64 n; |
2185
c14a1d8e6aa4
Trim trailing white spaces on empty lines.
Laurent Monin <zas@norz.org>
parents:
2184
diff
changeset
|
679 |
9 | 680 if (!layout_valid(&lw) || !lw->image) return; |
2017 | 681 if (!lw->info_zoom || !lw->info_details) return; /*called from layout_style_set */ |
9 | 682 |
984
3d834c6040ab
Only display status if there is at least one file in the file list.
Laurent Monin <geeqie@norz.org>
parents:
960
diff
changeset
|
683 n = layout_list_count(lw, NULL); |
2185
c14a1d8e6aa4
Trim trailing white spaces on empty lines.
Laurent Monin <zas@norz.org>
parents:
2184
diff
changeset
|
684 |
984
3d834c6040ab
Only display status if there is at least one file in the file list.
Laurent Monin <geeqie@norz.org>
parents:
960
diff
changeset
|
685 if (!n) |
3d834c6040ab
Only display status if there is at least one file in the file list.
Laurent Monin <geeqie@norz.org>
parents:
960
diff
changeset
|
686 { |
2468
faf8f7e202f5
Additional Fix #245: Eliminate run-time error
Colin Clark <cclark@mcb.net>
parents:
2462
diff
changeset
|
687 gtk_button_set_label(GTK_BUTTON(lw->info_zoom), ""); |
984
3d834c6040ab
Only display status if there is at least one file in the file list.
Laurent Monin <geeqie@norz.org>
parents:
960
diff
changeset
|
688 gtk_label_set_text(GTK_LABEL(lw->info_details), ""); |
3d834c6040ab
Only display status if there is at least one file in the file list.
Laurent Monin <geeqie@norz.org>
parents:
960
diff
changeset
|
689 } |
3d834c6040ab
Only display status if there is at least one file in the file list.
Laurent Monin <geeqie@norz.org>
parents:
960
diff
changeset
|
690 else |
3d834c6040ab
Only display status if there is at least one file in the file list.
Laurent Monin <geeqie@norz.org>
parents:
960
diff
changeset
|
691 { |
3d834c6040ab
Only display status if there is at least one file in the file list.
Laurent Monin <geeqie@norz.org>
parents:
960
diff
changeset
|
692 gchar *text; |
3d834c6040ab
Only display status if there is at least one file in the file list.
Laurent Monin <geeqie@norz.org>
parents:
960
diff
changeset
|
693 gchar *b; |
9 | 694 |
984
3d834c6040ab
Only display status if there is at least one file in the file list.
Laurent Monin <geeqie@norz.org>
parents:
960
diff
changeset
|
695 text = image_zoom_get_as_text(lw->image); |
2462
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
696 gtk_button_set_label(GTK_BUTTON(lw->info_zoom), text); |
984
3d834c6040ab
Only display status if there is at least one file in the file list.
Laurent Monin <geeqie@norz.org>
parents:
960
diff
changeset
|
697 g_free(text); |
3d834c6040ab
Only display status if there is at least one file in the file list.
Laurent Monin <geeqie@norz.org>
parents:
960
diff
changeset
|
698 |
3d834c6040ab
Only display status if there is at least one file in the file list.
Laurent Monin <geeqie@norz.org>
parents:
960
diff
changeset
|
699 b = image_get_fd(lw->image) ? text_from_size(image_get_fd(lw->image)->size) : g_strdup("0"); |
3d834c6040ab
Only display status if there is at least one file in the file list.
Laurent Monin <geeqie@norz.org>
parents:
960
diff
changeset
|
700 |
3d834c6040ab
Only display status if there is at least one file in the file list.
Laurent Monin <geeqie@norz.org>
parents:
960
diff
changeset
|
701 if (lw->image->unknown) |
9 | 702 { |
984
3d834c6040ab
Only display status if there is at least one file in the file list.
Laurent Monin <geeqie@norz.org>
parents:
960
diff
changeset
|
703 if (image_get_path(lw->image) && !access_file(image_get_path(lw->image), R_OK)) |
3d834c6040ab
Only display status if there is at least one file in the file list.
Laurent Monin <geeqie@norz.org>
parents:
960
diff
changeset
|
704 { |
3d834c6040ab
Only display status if there is at least one file in the file list.
Laurent Monin <geeqie@norz.org>
parents:
960
diff
changeset
|
705 text = g_strdup_printf(_("(no read permission) %s bytes"), b); |
3d834c6040ab
Only display status if there is at least one file in the file list.
Laurent Monin <geeqie@norz.org>
parents:
960
diff
changeset
|
706 } |
3d834c6040ab
Only display status if there is at least one file in the file list.
Laurent Monin <geeqie@norz.org>
parents:
960
diff
changeset
|
707 else |
3d834c6040ab
Only display status if there is at least one file in the file list.
Laurent Monin <geeqie@norz.org>
parents:
960
diff
changeset
|
708 { |
3d834c6040ab
Only display status if there is at least one file in the file list.
Laurent Monin <geeqie@norz.org>
parents:
960
diff
changeset
|
709 text = g_strdup_printf(_("( ? x ? ) %s bytes"), b); |
3d834c6040ab
Only display status if there is at least one file in the file list.
Laurent Monin <geeqie@norz.org>
parents:
960
diff
changeset
|
710 } |
9 | 711 } |
712 else | |
713 { | |
984
3d834c6040ab
Only display status if there is at least one file in the file list.
Laurent Monin <geeqie@norz.org>
parents:
960
diff
changeset
|
714 gint width, height; |
2185
c14a1d8e6aa4
Trim trailing white spaces on empty lines.
Laurent Monin <zas@norz.org>
parents:
2184
diff
changeset
|
715 |
984
3d834c6040ab
Only display status if there is at least one file in the file list.
Laurent Monin <geeqie@norz.org>
parents:
960
diff
changeset
|
716 image_get_image_size(lw->image, &width, &height); |
3d834c6040ab
Only display status if there is at least one file in the file list.
Laurent Monin <geeqie@norz.org>
parents:
960
diff
changeset
|
717 text = g_strdup_printf(_("( %d x %d ) %s bytes"), |
3d834c6040ab
Only display status if there is at least one file in the file list.
Laurent Monin <geeqie@norz.org>
parents:
960
diff
changeset
|
718 width, height, b); |
9 | 719 } |
23
9ff428db7772
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
John Ellis <johne@verizon.net>
parents:
9
diff
changeset
|
720 |
1375
08db75ca4713
Display pixel coordinates and rgb - patch by Ruben Stein
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1372
diff
changeset
|
721 g_signal_emit_by_name (lw->image->pr, "update-pixel"); |
2185
c14a1d8e6aa4
Trim trailing white spaces on empty lines.
Laurent Monin <zas@norz.org>
parents:
2184
diff
changeset
|
722 |
984
3d834c6040ab
Only display status if there is at least one file in the file list.
Laurent Monin <geeqie@norz.org>
parents:
960
diff
changeset
|
723 g_free(b); |
2185
c14a1d8e6aa4
Trim trailing white spaces on empty lines.
Laurent Monin <zas@norz.org>
parents:
2184
diff
changeset
|
724 |
984
3d834c6040ab
Only display status if there is at least one file in the file list.
Laurent Monin <geeqie@norz.org>
parents:
960
diff
changeset
|
725 gtk_label_set_text(GTK_LABEL(lw->info_details), text); |
3d834c6040ab
Only display status if there is at least one file in the file list.
Laurent Monin <geeqie@norz.org>
parents:
960
diff
changeset
|
726 g_free(text); |
9 | 727 } |
1582
f137ec3fd85e
- handle color profile and write metadata buttons on statusbar by ui_manager
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1558
diff
changeset
|
728 layout_util_sync_color(lw); /* update color button */ |
9 | 729 } |
730 | |
731 void layout_status_update_all(LayoutWindow *lw) | |
732 { | |
733 layout_status_update_progress(lw, 0.0, NULL); | |
734 layout_status_update_info(lw, NULL); | |
735 layout_status_update_image(lw); | |
1582
f137ec3fd85e
- handle color profile and write metadata buttons on statusbar by ui_manager
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1558
diff
changeset
|
736 layout_util_status_update_write(lw); |
9 | 737 } |
738 | |
1433
12600de4b59a
Use gboolean where applicable, minor cleanup and indentations fixes.
Laurent Monin <geeqie@norz.org>
parents:
1431
diff
changeset
|
739 static GtkWidget *layout_status_label(gchar *text, GtkWidget *box, gboolean start, gint size, gboolean expand) |
9 | 740 { |
741 GtkWidget *label; | |
742 GtkWidget *frame; | |
743 | |
744 frame = gtk_frame_new(NULL); | |
2909
2e7fd08bfbe4
DEBUG_NAME() function for use with GTKInspector
Colin Clark <colin.clark@cclark.uk>
parents:
2863
diff
changeset
|
745 DEBUG_NAME(frame); |
9 | 746 if (size) gtk_widget_set_size_request(frame, size, -1); |
747 gtk_frame_set_shadow_type(GTK_FRAME(frame), GTK_SHADOW_IN); | |
748 if (start) | |
749 { | |
750 gtk_box_pack_start(GTK_BOX(box), frame, expand, expand, 0); | |
751 } | |
752 else | |
753 { | |
754 gtk_box_pack_end(GTK_BOX(box), frame, expand, expand, 0); | |
755 } | |
756 gtk_widget_show(frame); | |
757 | |
758 label = gtk_label_new(text ? text : ""); | |
759 gtk_container_add(GTK_CONTAINER(frame), label); | |
760 gtk_widget_show(label); | |
761 | |
762 return label; | |
763 } | |
764 | |
1433
12600de4b59a
Use gboolean where applicable, minor cleanup and indentations fixes.
Laurent Monin <geeqie@norz.org>
parents:
1431
diff
changeset
|
765 static void layout_status_setup(LayoutWindow *lw, GtkWidget *box, gboolean small_format) |
9 | 766 { |
767 GtkWidget *hbox; | |
1582
f137ec3fd85e
- handle color profile and write metadata buttons on statusbar by ui_manager
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1558
diff
changeset
|
768 GtkWidget *toolbar; |
f137ec3fd85e
- handle color profile and write metadata buttons on statusbar by ui_manager
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1558
diff
changeset
|
769 GtkWidget *toolbar_frame; |
9 | 770 |
771 if (lw->info_box) return; | |
772 | |
773 if (small_format) | |
774 { | |
775 lw->info_box = gtk_vbox_new(FALSE, 0); | |
2909
2e7fd08bfbe4
DEBUG_NAME() function for use with GTKInspector
Colin Clark <colin.clark@cclark.uk>
parents:
2863
diff
changeset
|
776 DEBUG_NAME(lw->info_box); |
9 | 777 } |
778 else | |
779 { | |
780 lw->info_box = gtk_hbox_new(FALSE, 0); | |
2909
2e7fd08bfbe4
DEBUG_NAME() function for use with GTKInspector
Colin Clark <colin.clark@cclark.uk>
parents:
2863
diff
changeset
|
781 DEBUG_NAME(lw->info_box); |
9 | 782 } |
783 gtk_box_pack_end(GTK_BOX(box), lw->info_box, FALSE, FALSE, 0); | |
784 gtk_widget_show(lw->info_box); | |
785 | |
786 if (small_format) | |
787 { | |
788 hbox = gtk_hbox_new(FALSE, 0); | |
2909
2e7fd08bfbe4
DEBUG_NAME() function for use with GTKInspector
Colin Clark <colin.clark@cclark.uk>
parents:
2863
diff
changeset
|
789 DEBUG_NAME(hbox); |
9 | 790 gtk_box_pack_start(GTK_BOX(lw->info_box), hbox, FALSE, FALSE, 0); |
791 gtk_widget_show(hbox); | |
792 } | |
793 else | |
794 { | |
795 hbox = lw->info_box; | |
796 } | |
797 lw->info_progress_bar = gtk_progress_bar_new(); | |
2909
2e7fd08bfbe4
DEBUG_NAME() function for use with GTKInspector
Colin Clark <colin.clark@cclark.uk>
parents:
2863
diff
changeset
|
798 DEBUG_NAME(lw->info_progress_bar); |
9 | 799 gtk_widget_set_size_request(lw->info_progress_bar, PROGRESS_WIDTH, -1); |
2439 | 800 #if GTK_CHECK_VERSION(3,0,0) |
801 gtk_progress_bar_set_text(GTK_PROGRESS_BAR(lw->info_progress_bar), ""); | |
802 gtk_progress_bar_set_show_text(GTK_PROGRESS_BAR(lw->info_progress_bar), TRUE); | |
803 #endif | |
9 | 804 gtk_box_pack_start(GTK_BOX(hbox), lw->info_progress_bar, FALSE, FALSE, 0); |
805 gtk_widget_show(lw->info_progress_bar); | |
806 | |
807 lw->info_sort = layout_sort_button(lw); | |
2419 | 808 gtk_widget_set_tooltip_text(GTK_WIDGET(lw->info_sort), _("Select sort order")); |
9 | 809 gtk_box_pack_start(GTK_BOX(hbox), lw->info_sort, FALSE, FALSE, 0); |
810 gtk_widget_show(lw->info_sort); | |
811 | |
812 lw->info_status = layout_status_label(NULL, lw->info_box, TRUE, 0, (!small_format)); | |
2909
2e7fd08bfbe4
DEBUG_NAME() function for use with GTKInspector
Colin Clark <colin.clark@cclark.uk>
parents:
2863
diff
changeset
|
813 DEBUG_NAME(lw->info_status); |
2419 | 814 gtk_widget_set_tooltip_text(GTK_WIDGET(lw->info_status), _("Folder contents (files selected)")); |
9 | 815 |
816 if (small_format) | |
817 { | |
818 hbox = gtk_hbox_new(FALSE, 0); | |
2909
2e7fd08bfbe4
DEBUG_NAME() function for use with GTKInspector
Colin Clark <colin.clark@cclark.uk>
parents:
2863
diff
changeset
|
819 DEBUG_NAME(hbox); |
9 | 820 gtk_box_pack_start(GTK_BOX(lw->info_box), hbox, FALSE, FALSE, 0); |
821 gtk_widget_show(hbox); | |
822 } | |
1584
c97dea5d82d7
improved pixel info, changed the menu entry from "Hide" to "Show",
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1582
diff
changeset
|
823 lw->info_details = layout_status_label(NULL, hbox, TRUE, 0, TRUE); |
2909
2e7fd08bfbe4
DEBUG_NAME() function for use with GTKInspector
Colin Clark <colin.clark@cclark.uk>
parents:
2863
diff
changeset
|
824 DEBUG_NAME(lw->info_details); |
2419 | 825 gtk_widget_set_tooltip_text(GTK_WIDGET(lw->info_details), _("(Image dimensions) Image size")); |
1584
c97dea5d82d7
improved pixel info, changed the menu entry from "Hide" to "Show",
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1582
diff
changeset
|
826 toolbar = layout_actions_toolbar(lw, TOOLBAR_STATUS); |
2185
c14a1d8e6aa4
Trim trailing white spaces on empty lines.
Laurent Monin <zas@norz.org>
parents:
2184
diff
changeset
|
827 |
1584
c97dea5d82d7
improved pixel info, changed the menu entry from "Hide" to "Show",
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1582
diff
changeset
|
828 toolbar_frame = gtk_frame_new(NULL); |
2909
2e7fd08bfbe4
DEBUG_NAME() function for use with GTKInspector
Colin Clark <colin.clark@cclark.uk>
parents:
2863
diff
changeset
|
829 DEBUG_NAME(toolbar_frame); |
1584
c97dea5d82d7
improved pixel info, changed the menu entry from "Hide" to "Show",
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1582
diff
changeset
|
830 gtk_frame_set_shadow_type(GTK_FRAME(toolbar_frame), GTK_SHADOW_IN); |
c97dea5d82d7
improved pixel info, changed the menu entry from "Hide" to "Show",
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1582
diff
changeset
|
831 gtk_container_add(GTK_CONTAINER(toolbar_frame), toolbar); |
c97dea5d82d7
improved pixel info, changed the menu entry from "Hide" to "Show",
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1582
diff
changeset
|
832 gtk_widget_show(toolbar_frame); |
c97dea5d82d7
improved pixel info, changed the menu entry from "Hide" to "Show",
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1582
diff
changeset
|
833 gtk_widget_show(toolbar); |
c97dea5d82d7
improved pixel info, changed the menu entry from "Hide" to "Show",
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1582
diff
changeset
|
834 gtk_box_pack_end(GTK_BOX(hbox), toolbar_frame, FALSE, FALSE, 0); |
2462
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
835 lw->info_zoom = layout_zoom_button(lw, hbox, ZOOM_LABEL_WIDTH, TRUE); |
2775
0c5bcd8248fb
Fix #616: Image Position settings missing in 1.4
Colin Clark <colin.clark@cclark.uk>
parents:
2770
diff
changeset
|
836 gtk_widget_set_tooltip_text(GTK_WIDGET(lw->info_zoom), _("Select zoom and scroll mode")); |
2462
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
837 gtk_widget_show(lw->info_zoom); |
e4c44411a090
Fix #245: Zoom settings on status bar
Colin Clark <cclark@mcb.net>
parents:
2451
diff
changeset
|
838 |
1584
c97dea5d82d7
improved pixel info, changed the menu entry from "Hide" to "Show",
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1582
diff
changeset
|
839 if (small_format) |
9 | 840 { |
1584
c97dea5d82d7
improved pixel info, changed the menu entry from "Hide" to "Show",
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1582
diff
changeset
|
841 hbox = gtk_hbox_new(FALSE, 0); |
2909
2e7fd08bfbe4
DEBUG_NAME() function for use with GTKInspector
Colin Clark <colin.clark@cclark.uk>
parents:
2863
diff
changeset
|
842 DEBUG_NAME(hbox); |
1584
c97dea5d82d7
improved pixel info, changed the menu entry from "Hide" to "Show",
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1582
diff
changeset
|
843 gtk_box_pack_start(GTK_BOX(lw->info_box), hbox, FALSE, FALSE, 0); |
c97dea5d82d7
improved pixel info, changed the menu entry from "Hide" to "Show",
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1582
diff
changeset
|
844 gtk_widget_show(hbox); |
9 | 845 } |
1584
c97dea5d82d7
improved pixel info, changed the menu entry from "Hide" to "Show",
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1582
diff
changeset
|
846 lw->info_pixel = layout_status_label(NULL, hbox, FALSE, 0, small_format); /* expand only in small format */ |
2909
2e7fd08bfbe4
DEBUG_NAME() function for use with GTKInspector
Colin Clark <colin.clark@cclark.uk>
parents:
2863
diff
changeset
|
847 DEBUG_NAME(lw->info_pixel); |
2419 | 848 gtk_widget_set_tooltip_text(GTK_WIDGET(lw->info_pixel), _("[Pixel x,y coord]: (Pixel R,G,B value)")); |
1584
c97dea5d82d7
improved pixel info, changed the menu entry from "Hide" to "Show",
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1582
diff
changeset
|
849 if (!lw->options.show_info_pixel) gtk_widget_hide(gtk_widget_get_parent(lw->info_pixel)); |
9 | 850 } |
851 | |
852 /* | |
853 *----------------------------------------------------------------------------- | |
854 * views | |
855 *----------------------------------------------------------------------------- | |
856 */ | |
857 | |
858 static GtkWidget *layout_tools_new(LayoutWindow *lw) | |
859 { | |
860 lw->dir_view = layout_tool_setup(lw); | |
861 return lw->dir_view; | |
862 } | |
863 | |
573
a10da32cacf2
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
Laurent Monin <geeqie@norz.org>
parents:
559
diff
changeset
|
864 static void layout_list_status_cb(ViewFile *vf, gpointer data) |
9 | 865 { |
866 LayoutWindow *lw = data; | |
867 | |
868 layout_status_update_info(lw, NULL); | |
869 } | |
870 | |
573
a10da32cacf2
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
Laurent Monin <geeqie@norz.org>
parents:
559
diff
changeset
|
871 static void layout_list_thumb_cb(ViewFile *vf, gdouble val, const gchar *text, gpointer data) |
9 | 872 { |
873 LayoutWindow *lw = data; | |
874 | |
875 layout_status_update_progress(lw, val, text); | |
876 } | |
877 | |
1506
6e235e3ba076
Force thumbnails refreshing when thumbnails dimensions are modified through Preferences.
Laurent Monin <geeqie@norz.org>
parents:
1503
diff
changeset
|
878 static void layout_list_sync_thumb(LayoutWindow *lw) |
6e235e3ba076
Force thumbnails refreshing when thumbnails dimensions are modified through Preferences.
Laurent Monin <geeqie@norz.org>
parents:
1503
diff
changeset
|
879 { |
6e235e3ba076
Force thumbnails refreshing when thumbnails dimensions are modified through Preferences.
Laurent Monin <geeqie@norz.org>
parents:
1503
diff
changeset
|
880 if (lw->vf) vf_thumb_set(lw->vf, lw->options.show_thumbnails); |
6e235e3ba076
Force thumbnails refreshing when thumbnails dimensions are modified through Preferences.
Laurent Monin <geeqie@norz.org>
parents:
1503
diff
changeset
|
881 } |
6e235e3ba076
Force thumbnails refreshing when thumbnails dimensions are modified through Preferences.
Laurent Monin <geeqie@norz.org>
parents:
1503
diff
changeset
|
882 |
2817
e6f95baec8b5
Fix #624: Filter files by shell or regular expression pattern
Colin Clark <colin.clark@cclark.uk>
parents:
2813
diff
changeset
|
883 static void layout_list_sync_file_filter(LayoutWindow *lw) |
e6f95baec8b5
Fix #624: Filter files by shell or regular expression pattern
Colin Clark <colin.clark@cclark.uk>
parents:
2813
diff
changeset
|
884 { |
e6f95baec8b5
Fix #624: Filter files by shell or regular expression pattern
Colin Clark <colin.clark@cclark.uk>
parents:
2813
diff
changeset
|
885 if (lw->vf) vf_file_filter_set(lw->vf, lw->options.show_file_filter); |
e6f95baec8b5
Fix #624: Filter files by shell or regular expression pattern
Colin Clark <colin.clark@cclark.uk>
parents:
2813
diff
changeset
|
886 } |
e6f95baec8b5
Fix #624: Filter files by shell or regular expression pattern
Colin Clark <colin.clark@cclark.uk>
parents:
2813
diff
changeset
|
887 |
9 | 888 static GtkWidget *layout_list_new(LayoutWindow *lw) |
889 { | |
1412
4e84054a1d7a
fixed saving of file_view_type
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1403
diff
changeset
|
890 lw->vf = vf_new(lw->options.file_view_type, NULL); |
574
b2b9c2ae04f8
Drop ViewFileIcon, use ViewFile and ViewFileInfoIcon instead.
Laurent Monin <geeqie@norz.org>
parents:
573
diff
changeset
|
891 vf_set_layout(lw->vf, lw); |
b2b9c2ae04f8
Drop ViewFileIcon, use ViewFile and ViewFileInfoIcon instead.
Laurent Monin <geeqie@norz.org>
parents:
573
diff
changeset
|
892 |
b2b9c2ae04f8
Drop ViewFileIcon, use ViewFile and ViewFileInfoIcon instead.
Laurent Monin <geeqie@norz.org>
parents:
573
diff
changeset
|
893 vf_set_status_func(lw->vf, layout_list_status_cb, lw); |
b2b9c2ae04f8
Drop ViewFileIcon, use ViewFile and ViewFileInfoIcon instead.
Laurent Monin <geeqie@norz.org>
parents:
573
diff
changeset
|
894 vf_set_thumb_status_func(lw->vf, layout_list_thumb_cb, lw); |
b2b9c2ae04f8
Drop ViewFileIcon, use ViewFile and ViewFileInfoIcon instead.
Laurent Monin <geeqie@norz.org>
parents:
573
diff
changeset
|
895 |
1309
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
896 vf_marks_set(lw->vf, lw->options.show_marks); |
2185
c14a1d8e6aa4
Trim trailing white spaces on empty lines.
Laurent Monin <zas@norz.org>
parents:
2184
diff
changeset
|
897 |
1506
6e235e3ba076
Force thumbnails refreshing when thumbnails dimensions are modified through Preferences.
Laurent Monin <geeqie@norz.org>
parents:
1503
diff
changeset
|
898 layout_list_sync_thumb(lw); |
2817
e6f95baec8b5
Fix #624: Filter files by shell or regular expression pattern
Colin Clark <colin.clark@cclark.uk>
parents:
2813
diff
changeset
|
899 layout_list_sync_file_filter(lw); |
442 | 900 |
574
b2b9c2ae04f8
Drop ViewFileIcon, use ViewFile and ViewFileInfoIcon instead.
Laurent Monin <geeqie@norz.org>
parents:
573
diff
changeset
|
901 return lw->vf->widget; |
9 | 902 } |
903 | |
132
b025afc3c92a
First implementation of marks for all photos.
Petr Ostadal <postadal@suse.cz>
parents:
127
diff
changeset
|
904 static void layout_list_sync_marks(LayoutWindow *lw) |
b025afc3c92a
First implementation of marks for all photos.
Petr Ostadal <postadal@suse.cz>
parents:
127
diff
changeset
|
905 { |
1309
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
906 if (lw->vf) vf_marks_set(lw->vf, lw->options.show_marks); |
132
b025afc3c92a
First implementation of marks for all photos.
Petr Ostadal <postadal@suse.cz>
parents:
127
diff
changeset
|
907 } |
b025afc3c92a
First implementation of marks for all photos.
Petr Ostadal <postadal@suse.cz>
parents:
127
diff
changeset
|
908 |
9 | 909 static void layout_list_scroll_to_subpart(LayoutWindow *lw, const gchar *needle) |
910 { | |
911 if (!lw) return; | |
912 } | |
913 | |
914 GList *layout_list(LayoutWindow *lw) | |
915 { | |
916 if (!layout_valid(&lw)) return NULL; | |
917 | |
573
a10da32cacf2
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
Laurent Monin <geeqie@norz.org>
parents:
559
diff
changeset
|
918 if (lw->vf) return vf_get_list(lw->vf); |
9 | 919 |
920 return NULL; | |
921 } | |
922 | |
736
31d858f3272d
Fix signed vs unsigned warnings.
Laurent Monin <geeqie@norz.org>
parents:
726
diff
changeset
|
923 guint layout_list_count(LayoutWindow *lw, gint64 *bytes) |
9 | 924 { |
925 if (!layout_valid(&lw)) return 0; | |
926 | |
573
a10da32cacf2
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
Laurent Monin <geeqie@norz.org>
parents:
559
diff
changeset
|
927 if (lw->vf) return vf_count(lw->vf, bytes); |
9 | 928 |
929 return 0; | |
930 } | |
931 | |
138
5be5d1c53016
replaced gchar* path with FileData *fd
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
132
diff
changeset
|
932 FileData *layout_list_get_fd(LayoutWindow *lw, gint index) |
5be5d1c53016
replaced gchar* path with FileData *fd
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
132
diff
changeset
|
933 { |
5be5d1c53016
replaced gchar* path with FileData *fd
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
132
diff
changeset
|
934 if (!layout_valid(&lw)) return NULL; |
5be5d1c53016
replaced gchar* path with FileData *fd
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
132
diff
changeset
|
935 |
573
a10da32cacf2
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
Laurent Monin <geeqie@norz.org>
parents:
559
diff
changeset
|
936 if (lw->vf) return vf_index_get_data(lw->vf, index); |
138
5be5d1c53016
replaced gchar* path with FileData *fd
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
132
diff
changeset
|
937 |
5be5d1c53016
replaced gchar* path with FileData *fd
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
132
diff
changeset
|
938 return NULL; |
5be5d1c53016
replaced gchar* path with FileData *fd
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
132
diff
changeset
|
939 } |
5be5d1c53016
replaced gchar* path with FileData *fd
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
132
diff
changeset
|
940 |
783
0e45ed008a1c
replaced directory path with FileData* dir_fd
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
774
diff
changeset
|
941 gint layout_list_get_index(LayoutWindow *lw, FileData *fd) |
9 | 942 { |
783
0e45ed008a1c
replaced directory path with FileData* dir_fd
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
774
diff
changeset
|
943 if (!layout_valid(&lw) || !fd) return -1; |
9 | 944 |
1503
edbe0e0d8046
improved next/prev operation on sidecar files
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1482
diff
changeset
|
945 if (lw->vf) return vf_index_by_fd(lw->vf, fd); |
9 | 946 |
947 return -1; | |
948 } | |
949 | |
138
5be5d1c53016
replaced gchar* path with FileData *fd
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
132
diff
changeset
|
950 void layout_list_sync_fd(LayoutWindow *lw, FileData *fd) |
9 | 951 { |
952 if (!layout_valid(&lw)) return; | |
953 | |
573
a10da32cacf2
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
Laurent Monin <geeqie@norz.org>
parents:
559
diff
changeset
|
954 if (lw->vf) vf_select_by_fd(lw->vf, fd); |
9 | 955 } |
956 | |
957 static void layout_list_sync_sort(LayoutWindow *lw) | |
958 { | |
959 if (!layout_valid(&lw)) return; | |
960 | |
573
a10da32cacf2
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
Laurent Monin <geeqie@norz.org>
parents:
559
diff
changeset
|
961 if (lw->vf) vf_sort_set(lw->vf, lw->sort_method, lw->sort_ascend); |
9 | 962 } |
963 | |
964 GList *layout_selection_list(LayoutWindow *lw) | |
965 { | |
966 if (!layout_valid(&lw)) return NULL; | |
967 | |
968 if (layout_image_get_collection(lw, NULL)) | |
969 { | |
138
5be5d1c53016
replaced gchar* path with FileData *fd
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
132
diff
changeset
|
970 FileData *fd; |
9 | 971 |
138
5be5d1c53016
replaced gchar* path with FileData *fd
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
132
diff
changeset
|
972 fd = layout_image_get_fd(lw); |
5be5d1c53016
replaced gchar* path with FileData *fd
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
132
diff
changeset
|
973 if (fd) return g_list_append(NULL, file_data_ref(fd)); |
9 | 974 return NULL; |
975 } | |
976 | |
573
a10da32cacf2
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
Laurent Monin <geeqie@norz.org>
parents:
559
diff
changeset
|
977 if (lw->vf) return vf_selection_get_list(lw->vf); |
9 | 978 |
979 return NULL; | |
980 } | |
981 | |
982 GList *layout_selection_list_by_index(LayoutWindow *lw) | |
983 { | |
984 if (!layout_valid(&lw)) return NULL; | |
985 | |
573
a10da32cacf2
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
Laurent Monin <geeqie@norz.org>
parents:
559
diff
changeset
|
986 if (lw->vf) return vf_selection_get_list_by_index(lw->vf); |
9 | 987 |
988 return NULL; | |
989 } | |
990 | |
736
31d858f3272d
Fix signed vs unsigned warnings.
Laurent Monin <geeqie@norz.org>
parents:
726
diff
changeset
|
991 guint layout_selection_count(LayoutWindow *lw, gint64 *bytes) |
9 | 992 { |
993 if (!layout_valid(&lw)) return 0; | |
994 | |
573
a10da32cacf2
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
Laurent Monin <geeqie@norz.org>
parents:
559
diff
changeset
|
995 if (lw->vf) return vf_selection_count(lw->vf, bytes); |
9 | 996 |
997 return 0; | |
998 } | |
999 | |
1000 void layout_select_all(LayoutWindow *lw) | |
1001 { | |
1002 if (!layout_valid(&lw)) return; | |
1003 | |
573
a10da32cacf2
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
Laurent Monin <geeqie@norz.org>
parents:
559
diff
changeset
|
1004 if (lw->vf) vf_select_all(lw->vf); |
9 | 1005 } |
1006 | |
1007 void layout_select_none(LayoutWindow *lw) | |
1008 { | |
1009 if (!layout_valid(&lw)) return; | |
1010 | |
573
a10da32cacf2
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
Laurent Monin <geeqie@norz.org>
parents:
559
diff
changeset
|
1011 if (lw->vf) vf_select_none(lw->vf); |
9 | 1012 } |
1013 | |
601
c15474962d16
Add a way to invert the current selection.
Laurent Monin <geeqie@norz.org>
parents:
586
diff
changeset
|
1014 void layout_select_invert(LayoutWindow *lw) |
c15474962d16
Add a way to invert the current selection.
Laurent Monin <geeqie@norz.org>
parents:
586
diff
changeset
|
1015 { |
c15474962d16
Add a way to invert the current selection.
Laurent Monin <geeqie@norz.org>
parents:
586
diff
changeset
|
1016 if (!layout_valid(&lw)) return; |
c15474962d16
Add a way to invert the current selection.
Laurent Monin <geeqie@norz.org>
parents:
586
diff
changeset
|
1017 |
c15474962d16
Add a way to invert the current selection.
Laurent Monin <geeqie@norz.org>
parents:
586
diff
changeset
|
1018 if (lw->vf) vf_select_invert(lw->vf); |
c15474962d16
Add a way to invert the current selection.
Laurent Monin <geeqie@norz.org>
parents:
586
diff
changeset
|
1019 } |
c15474962d16
Add a way to invert the current selection.
Laurent Monin <geeqie@norz.org>
parents:
586
diff
changeset
|
1020 |
162
6a5cc5a2bbe9
created menu "Select" with selection and marks operations
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
138
diff
changeset
|
1021 void layout_mark_to_selection(LayoutWindow *lw, gint mark, MarkToSelectionMode mode) |
6a5cc5a2bbe9
created menu "Select" with selection and marks operations
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
138
diff
changeset
|
1022 { |
6a5cc5a2bbe9
created menu "Select" with selection and marks operations
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
138
diff
changeset
|
1023 if (!layout_valid(&lw)) return; |
6a5cc5a2bbe9
created menu "Select" with selection and marks operations
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
138
diff
changeset
|
1024 |
573
a10da32cacf2
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
Laurent Monin <geeqie@norz.org>
parents:
559
diff
changeset
|
1025 if (lw->vf) vf_mark_to_selection(lw->vf, mark, mode); |
162
6a5cc5a2bbe9
created menu "Select" with selection and marks operations
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
138
diff
changeset
|
1026 } |
6a5cc5a2bbe9
created menu "Select" with selection and marks operations
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
138
diff
changeset
|
1027 |
6a5cc5a2bbe9
created menu "Select" with selection and marks operations
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
138
diff
changeset
|
1028 void layout_selection_to_mark(LayoutWindow *lw, gint mark, SelectionToMarkMode mode) |
6a5cc5a2bbe9
created menu "Select" with selection and marks operations
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
138
diff
changeset
|
1029 { |
6a5cc5a2bbe9
created menu "Select" with selection and marks operations
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
138
diff
changeset
|
1030 if (!layout_valid(&lw)) return; |
6a5cc5a2bbe9
created menu "Select" with selection and marks operations
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
138
diff
changeset
|
1031 |
573
a10da32cacf2
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
Laurent Monin <geeqie@norz.org>
parents:
559
diff
changeset
|
1032 if (lw->vf) vf_selection_to_mark(lw->vf, mark, mode); |
442 | 1033 |
162
6a5cc5a2bbe9
created menu "Select" with selection and marks operations
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
138
diff
changeset
|
1034 layout_status_update_info(lw, NULL); /* osd in fullscreen mode */ |
6a5cc5a2bbe9
created menu "Select" with selection and marks operations
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
138
diff
changeset
|
1035 } |
6a5cc5a2bbe9
created menu "Select" with selection and marks operations
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
138
diff
changeset
|
1036 |
1635
60012a2cc53b
added mark filter to menu - now it is possible to assign hotkeys
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1628
diff
changeset
|
1037 void layout_mark_filter_toggle(LayoutWindow *lw, gint mark) |
60012a2cc53b
added mark filter to menu - now it is possible to assign hotkeys
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1628
diff
changeset
|
1038 { |
60012a2cc53b
added mark filter to menu - now it is possible to assign hotkeys
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1628
diff
changeset
|
1039 if (!layout_valid(&lw)) return; |
60012a2cc53b
added mark filter to menu - now it is possible to assign hotkeys
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1628
diff
changeset
|
1040 |
60012a2cc53b
added mark filter to menu - now it is possible to assign hotkeys
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1628
diff
changeset
|
1041 if (lw->vf) vf_mark_filter_toggle(lw->vf, mark); |
60012a2cc53b
added mark filter to menu - now it is possible to assign hotkeys
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1628
diff
changeset
|
1042 } |
60012a2cc53b
added mark filter to menu - now it is possible to assign hotkeys
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1628
diff
changeset
|
1043 |
60012a2cc53b
added mark filter to menu - now it is possible to assign hotkeys
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1628
diff
changeset
|
1044 |
9 | 1045 /* |
1046 *----------------------------------------------------------------------------- | |
1047 * access | |
1048 *----------------------------------------------------------------------------- | |
1049 */ | |
1050 | |
1051 const gchar *layout_get_path(LayoutWindow *lw) | |
1052 { | |
1053 if (!layout_valid(&lw)) return NULL; | |
783
0e45ed008a1c
replaced directory path with FileData* dir_fd
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
774
diff
changeset
|
1054 return lw->dir_fd ? lw->dir_fd->path : NULL; |
9 | 1055 } |
1056 | |
1057 static void layout_sync_path(LayoutWindow *lw) | |
1058 { | |
783
0e45ed008a1c
replaced directory path with FileData* dir_fd
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
774
diff
changeset
|
1059 if (!lw->dir_fd) return; |
9 | 1060 |
783
0e45ed008a1c
replaced directory path with FileData* dir_fd
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
774
diff
changeset
|
1061 if (lw->path_entry) gtk_entry_set_text(GTK_ENTRY(lw->path_entry), lw->dir_fd->path); |
1372 | 1062 |
783
0e45ed008a1c
replaced directory path with FileData* dir_fd
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
774
diff
changeset
|
1063 if (lw->vd) vd_set_fd(lw->vd, lw->dir_fd); |
0e45ed008a1c
replaced directory path with FileData* dir_fd
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
774
diff
changeset
|
1064 if (lw->vf) vf_set_fd(lw->vf, lw->dir_fd); |
9 | 1065 } |
1066 | |
1416
3ba63f325b08
Use gboolean pseudo type where applicable.
Laurent Monin <geeqie@norz.org>
parents:
1415
diff
changeset
|
1067 gboolean layout_set_path(LayoutWindow *lw, const gchar *path) |
9 | 1068 { |
959
3ec42efa6958
fixed crash in geeqie --blank
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
902
diff
changeset
|
1069 FileData *fd; |
1416
3ba63f325b08
Use gboolean pseudo type where applicable.
Laurent Monin <geeqie@norz.org>
parents:
1415
diff
changeset
|
1070 gboolean ret; |
1372 | 1071 |
959
3ec42efa6958
fixed crash in geeqie --blank
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
902
diff
changeset
|
1072 if (!path) return FALSE; |
2185
c14a1d8e6aa4
Trim trailing white spaces on empty lines.
Laurent Monin <zas@norz.org>
parents:
2184
diff
changeset
|
1073 |
1936
ed6aa14b66c9
rename file_data_new_simple to file_data_new_group, filedata.c cleanup
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1927
diff
changeset
|
1074 fd = file_data_new_group(path); |
1372 | 1075 ret = layout_set_fd(lw, fd); |
783
0e45ed008a1c
replaced directory path with FileData* dir_fd
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
774
diff
changeset
|
1076 file_data_unref(fd); |
0e45ed008a1c
replaced directory path with FileData* dir_fd
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
774
diff
changeset
|
1077 return ret; |
0e45ed008a1c
replaced directory path with FileData* dir_fd
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
774
diff
changeset
|
1078 } |
0e45ed008a1c
replaced directory path with FileData* dir_fd
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
774
diff
changeset
|
1079 |
0e45ed008a1c
replaced directory path with FileData* dir_fd
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
774
diff
changeset
|
1080 |
1416
3ba63f325b08
Use gboolean pseudo type where applicable.
Laurent Monin <geeqie@norz.org>
parents:
1415
diff
changeset
|
1081 gboolean layout_set_fd(LayoutWindow *lw, FileData *fd) |
783
0e45ed008a1c
replaced directory path with FileData* dir_fd
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
774
diff
changeset
|
1082 { |
1416
3ba63f325b08
Use gboolean pseudo type where applicable.
Laurent Monin <geeqie@norz.org>
parents:
1415
diff
changeset
|
1083 gboolean have_file = FALSE; |
1558
0588c281322f
fixed metadata.confirm_on_dir_change
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1549
diff
changeset
|
1084 gboolean dir_changed = TRUE; |
9 | 1085 |
1086 if (!layout_valid(&lw)) return FALSE; | |
1087 | |
783
0e45ed008a1c
replaced directory path with FileData* dir_fd
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
774
diff
changeset
|
1088 if (!fd || !isname(fd->path)) return FALSE; |
0e45ed008a1c
replaced directory path with FileData* dir_fd
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
774
diff
changeset
|
1089 if (lw->dir_fd && fd == lw->dir_fd) |
9 | 1090 { |
1091 return TRUE; | |
1092 } | |
1093 | |
783
0e45ed008a1c
replaced directory path with FileData* dir_fd
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
774
diff
changeset
|
1094 if (isdir(fd->path)) |
9 | 1095 { |
791
9ac2f29b065e
realtime file monitor
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
787
diff
changeset
|
1096 if (lw->dir_fd) |
9ac2f29b065e
realtime file monitor
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
787
diff
changeset
|
1097 { |
9ac2f29b065e
realtime file monitor
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
787
diff
changeset
|
1098 file_data_unregister_real_time_monitor(lw->dir_fd); |
9ac2f29b065e
realtime file monitor
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
787
diff
changeset
|
1099 file_data_unref(lw->dir_fd); |
9ac2f29b065e
realtime file monitor
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
787
diff
changeset
|
1100 } |
783
0e45ed008a1c
replaced directory path with FileData* dir_fd
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
774
diff
changeset
|
1101 lw->dir_fd = file_data_ref(fd); |
791
9ac2f29b065e
realtime file monitor
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
787
diff
changeset
|
1102 file_data_register_real_time_monitor(fd); |
9 | 1103 } |
1104 else | |
1105 { | |
1106 gchar *base; | |
1107 | |
783
0e45ed008a1c
replaced directory path with FileData* dir_fd
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
774
diff
changeset
|
1108 base = remove_level_from_path(fd->path); |
0e45ed008a1c
replaced directory path with FileData* dir_fd
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
774
diff
changeset
|
1109 if (lw->dir_fd && strcmp(lw->dir_fd->path, base) == 0) |
9 | 1110 { |
1111 g_free(base); | |
1558
0588c281322f
fixed metadata.confirm_on_dir_change
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1549
diff
changeset
|
1112 dir_changed = FALSE; |
9 | 1113 } |
1114 else if (isdir(base)) | |
1115 { | |
791
9ac2f29b065e
realtime file monitor
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
787
diff
changeset
|
1116 if (lw->dir_fd) |
9ac2f29b065e
realtime file monitor
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
787
diff
changeset
|
1117 { |
9ac2f29b065e
realtime file monitor
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
787
diff
changeset
|
1118 file_data_unregister_real_time_monitor(lw->dir_fd); |
9ac2f29b065e
realtime file monitor
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
787
diff
changeset
|
1119 file_data_unref(lw->dir_fd); |
9ac2f29b065e
realtime file monitor
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
787
diff
changeset
|
1120 } |
1927
d1a5b8633919
always check for sidecars by readdir
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1810
diff
changeset
|
1121 lw->dir_fd = file_data_new_dir(base); |
791
9ac2f29b065e
realtime file monitor
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
787
diff
changeset
|
1122 file_data_register_real_time_monitor(lw->dir_fd); |
783
0e45ed008a1c
replaced directory path with FileData* dir_fd
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
774
diff
changeset
|
1123 g_free(base); |
9 | 1124 } |
1125 else | |
1126 { | |
1127 g_free(base); | |
1128 return FALSE; | |
1129 } | |
783
0e45ed008a1c
replaced directory path with FileData* dir_fd
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
774
diff
changeset
|
1130 if (isfile(fd->path)) have_file = TRUE; |
9 | 1131 } |
1132 | |
2609
5beaa1da4f14
Fix #512: The "Back" button does not operate correctly
Colin Clark <colin.clark@cclark.uk>
parents:
2508
diff
changeset
|
1133 if (lw->path_entry) |
5beaa1da4f14
Fix #512: The "Back" button does not operate correctly
Colin Clark <colin.clark@cclark.uk>
parents:
2508
diff
changeset
|
1134 { |
5beaa1da4f14
Fix #512: The "Back" button does not operate correctly
Colin Clark <colin.clark@cclark.uk>
parents:
2508
diff
changeset
|
1135 history_chain_append_end(lw->dir_fd->path); |
5beaa1da4f14
Fix #512: The "Back" button does not operate correctly
Colin Clark <colin.clark@cclark.uk>
parents:
2508
diff
changeset
|
1136 tab_completion_append_to_history(lw->path_entry, lw->dir_fd->path); |
5beaa1da4f14
Fix #512: The "Back" button does not operate correctly
Colin Clark <colin.clark@cclark.uk>
parents:
2508
diff
changeset
|
1137 } |
9 | 1138 layout_sync_path(lw); |
1301
d27744bf03ec
Fix bug 2599857: file list sort order was wrong in many cases.
Laurent Monin <geeqie@norz.org>
parents:
1296
diff
changeset
|
1139 layout_list_sync_sort(lw); |
2185
c14a1d8e6aa4
Trim trailing white spaces on empty lines.
Laurent Monin <zas@norz.org>
parents:
2184
diff
changeset
|
1140 |
9 | 1141 if (have_file) |
1142 { | |
1143 gint row; | |
1144 | |
783
0e45ed008a1c
replaced directory path with FileData* dir_fd
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
774
diff
changeset
|
1145 row = layout_list_get_index(lw, fd); |
9 | 1146 if (row >= 0) |
1147 { | |
1148 layout_image_set_index(lw, row); | |
1149 } | |
1150 else | |
1151 { | |
783
0e45ed008a1c
replaced directory path with FileData* dir_fd
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
774
diff
changeset
|
1152 layout_image_set_fd(lw, fd); |
9 | 1153 } |
1154 } | |
320
bd97f1e60100
Move more options to ConfOptions.
Laurent Monin <geeqie@norz.org>
parents:
318
diff
changeset
|
1155 else if (!options->lazy_image_sync) |
9 | 1156 { |
1157 layout_image_set_index(lw, 0); | |
1158 } | |
1159 | |
1558
0588c281322f
fixed metadata.confirm_on_dir_change
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1549
diff
changeset
|
1160 if (options->metadata.confirm_on_dir_change && dir_changed) |
1586
b8515ea34e58
force the metadata dialog if it was triggered by the menu or the button
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1584
diff
changeset
|
1161 metadata_write_queue_confirm(FALSE, NULL, NULL); |
1214
1e36edfd2a43
write metadata after timeout, image change or dir change
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1177
diff
changeset
|
1162 |
2770
2e819f4a7a41
Read metadata in the idle loop
Colin Clark <colin.clark@cclark.uk>
parents:
2732
diff
changeset
|
1163 if (lw->vf && (options->read_metadata_in_idle || (lw->sort_method == SORT_EXIFTIME || lw->sort_method == SORT_EXIFTIMEDIGITIZED || lw->sort_method == SORT_RATING))) |
2e819f4a7a41
Read metadata in the idle loop
Colin Clark <colin.clark@cclark.uk>
parents:
2732
diff
changeset
|
1164 { |
2e819f4a7a41
Read metadata in the idle loop
Colin Clark <colin.clark@cclark.uk>
parents:
2732
diff
changeset
|
1165 vf_read_metadata_in_idle(lw->vf); |
2e819f4a7a41
Read metadata in the idle loop
Colin Clark <colin.clark@cclark.uk>
parents:
2732
diff
changeset
|
1166 } |
2e819f4a7a41
Read metadata in the idle loop
Colin Clark <colin.clark@cclark.uk>
parents:
2732
diff
changeset
|
1167 |
9 | 1168 return TRUE; |
1169 } | |
1170 | |
1171 static void layout_refresh_lists(LayoutWindow *lw) | |
1172 { | |
390
09d8a9b71520
Fix two errors made in revision 473.
Laurent Monin <geeqie@norz.org>
parents:
380
diff
changeset
|
1173 if (lw->vd) vd_refresh(lw->vd); |
9 | 1174 |
1506
6e235e3ba076
Force thumbnails refreshing when thumbnails dimensions are modified through Preferences.
Laurent Monin <geeqie@norz.org>
parents:
1503
diff
changeset
|
1175 if (lw->vf) |
6e235e3ba076
Force thumbnails refreshing when thumbnails dimensions are modified through Preferences.
Laurent Monin <geeqie@norz.org>
parents:
1503
diff
changeset
|
1176 { |
6e235e3ba076
Force thumbnails refreshing when thumbnails dimensions are modified through Preferences.
Laurent Monin <geeqie@norz.org>
parents:
1503
diff
changeset
|
1177 vf_refresh(lw->vf); |
6e235e3ba076
Force thumbnails refreshing when thumbnails dimensions are modified through Preferences.
Laurent Monin <geeqie@norz.org>
parents:
1503
diff
changeset
|
1178 vf_thumb_update(lw->vf); |
6e235e3ba076
Force thumbnails refreshing when thumbnails dimensions are modified through Preferences.
Laurent Monin <geeqie@norz.org>
parents:
1503
diff
changeset
|
1179 } |
9 | 1180 } |
1181 | |
1182 void layout_refresh(LayoutWindow *lw) | |
1183 { | |
1184 if (!layout_valid(&lw)) return; | |
1185 | |
506
03d66738b225
Handle the newline in DEBUG_N() macro instead of adding one
Laurent Monin <geeqie@norz.org>
parents:
501
diff
changeset
|
1186 DEBUG_1("layout refresh"); |
9 | 1187 |
1188 layout_refresh_lists(lw); | |
1189 | |
1190 if (lw->image) layout_image_refresh(lw); | |
1191 } | |
1192 | |
1416
3ba63f325b08
Use gboolean pseudo type where applicable.
Laurent Monin <geeqie@norz.org>
parents:
1415
diff
changeset
|
1193 void layout_thumb_set(LayoutWindow *lw, gboolean enable) |
9 | 1194 { |
1195 if (!layout_valid(&lw)) return; | |
1196 | |
1309
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
1197 if (lw->options.show_thumbnails == enable) return; |
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
1198 |
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
1199 lw->options.show_thumbnails = enable; |
9 | 1200 |
1201 layout_util_sync_thumb(lw); | |
1202 layout_list_sync_thumb(lw); | |
1203 } | |
1204 | |
2817
e6f95baec8b5
Fix #624: Filter files by shell or regular expression pattern
Colin Clark <colin.clark@cclark.uk>
parents:
2813
diff
changeset
|
1205 void layout_file_filter_set(LayoutWindow *lw, gboolean enable) |
e6f95baec8b5
Fix #624: Filter files by shell or regular expression pattern
Colin Clark <colin.clark@cclark.uk>
parents:
2813
diff
changeset
|
1206 { |
e6f95baec8b5
Fix #624: Filter files by shell or regular expression pattern
Colin Clark <colin.clark@cclark.uk>
parents:
2813
diff
changeset
|
1207 if (!layout_valid(&lw)) return; |
e6f95baec8b5
Fix #624: Filter files by shell or regular expression pattern
Colin Clark <colin.clark@cclark.uk>
parents:
2813
diff
changeset
|
1208 |
e6f95baec8b5
Fix #624: Filter files by shell or regular expression pattern
Colin Clark <colin.clark@cclark.uk>
parents:
2813
diff
changeset
|
1209 if (lw->options.show_file_filter == enable) return; |
e6f95baec8b5
Fix #624: Filter files by shell or regular expression pattern
Colin Clark <colin.clark@cclark.uk>
parents:
2813
diff
changeset
|
1210 |
e6f95baec8b5
Fix #624: Filter files by shell or regular expression pattern
Colin Clark <colin.clark@cclark.uk>
parents:
2813
diff
changeset
|
1211 lw->options.show_file_filter = enable; |
e6f95baec8b5
Fix #624: Filter files by shell or regular expression pattern
Colin Clark <colin.clark@cclark.uk>
parents:
2813
diff
changeset
|
1212 |
e6f95baec8b5
Fix #624: Filter files by shell or regular expression pattern
Colin Clark <colin.clark@cclark.uk>
parents:
2813
diff
changeset
|
1213 layout_util_sync_file_filter(lw); |
e6f95baec8b5
Fix #624: Filter files by shell or regular expression pattern
Colin Clark <colin.clark@cclark.uk>
parents:
2813
diff
changeset
|
1214 layout_list_sync_file_filter(lw); |
e6f95baec8b5
Fix #624: Filter files by shell or regular expression pattern
Colin Clark <colin.clark@cclark.uk>
parents:
2813
diff
changeset
|
1215 } |
e6f95baec8b5
Fix #624: Filter files by shell or regular expression pattern
Colin Clark <colin.clark@cclark.uk>
parents:
2813
diff
changeset
|
1216 |
1416
3ba63f325b08
Use gboolean pseudo type where applicable.
Laurent Monin <geeqie@norz.org>
parents:
1415
diff
changeset
|
1217 void layout_marks_set(LayoutWindow *lw, gboolean enable) |
132
b025afc3c92a
First implementation of marks for all photos.
Petr Ostadal <postadal@suse.cz>
parents:
127
diff
changeset
|
1218 { |
b025afc3c92a
First implementation of marks for all photos.
Petr Ostadal <postadal@suse.cz>
parents:
127
diff
changeset
|
1219 if (!layout_valid(&lw)) return; |
b025afc3c92a
First implementation of marks for all photos.
Petr Ostadal <postadal@suse.cz>
parents:
127
diff
changeset
|
1220 |
1309
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
1221 if (lw->options.show_marks == enable) return; |
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
1222 |
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
1223 lw->options.show_marks = enable; |
132
b025afc3c92a
First implementation of marks for all photos.
Petr Ostadal <postadal@suse.cz>
parents:
127
diff
changeset
|
1224 |
2611 | 1225 layout_util_sync_marks(lw); |
268
c439ad915ade
Tidy up, whitespaces and indentation fix.
Laurent Monin <geeqie@norz.org>
parents:
254
diff
changeset
|
1226 layout_list_sync_marks(lw); |
132
b025afc3c92a
First implementation of marks for all photos.
Petr Ostadal <postadal@suse.cz>
parents:
127
diff
changeset
|
1227 } |
b025afc3c92a
First implementation of marks for all photos.
Petr Ostadal <postadal@suse.cz>
parents:
127
diff
changeset
|
1228 |
1416
3ba63f325b08
Use gboolean pseudo type where applicable.
Laurent Monin <geeqie@norz.org>
parents:
1415
diff
changeset
|
1229 gboolean layout_thumb_get(LayoutWindow *lw) |
9 | 1230 { |
1231 if (!layout_valid(&lw)) return FALSE; | |
1232 | |
1309
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
1233 return lw->options.show_thumbnails; |
9 | 1234 } |
1235 | |
1416
3ba63f325b08
Use gboolean pseudo type where applicable.
Laurent Monin <geeqie@norz.org>
parents:
1415
diff
changeset
|
1236 gboolean layout_marks_get(LayoutWindow *lw) |
433
a20940d54915
Save Show Marks state to rc file and display current state in menu.
Laurent Monin <geeqie@norz.org>
parents:
432
diff
changeset
|
1237 { |
a20940d54915
Save Show Marks state to rc file and display current state in menu.
Laurent Monin <geeqie@norz.org>
parents:
432
diff
changeset
|
1238 if (!layout_valid(&lw)) return FALSE; |
a20940d54915
Save Show Marks state to rc file and display current state in menu.
Laurent Monin <geeqie@norz.org>
parents:
432
diff
changeset
|
1239 |
1309
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
1240 return lw->options.show_marks; |
433
a20940d54915
Save Show Marks state to rc file and display current state in menu.
Laurent Monin <geeqie@norz.org>
parents:
432
diff
changeset
|
1241 } |
a20940d54915
Save Show Marks state to rc file and display current state in menu.
Laurent Monin <geeqie@norz.org>
parents:
432
diff
changeset
|
1242 |
1416
3ba63f325b08
Use gboolean pseudo type where applicable.
Laurent Monin <geeqie@norz.org>
parents:
1415
diff
changeset
|
1243 void layout_sort_set(LayoutWindow *lw, SortType type, gboolean ascend) |
9 | 1244 { |
1245 if (!layout_valid(&lw)) return; | |
1246 if (lw->sort_method == type && lw->sort_ascend == ascend) return; | |
1247 | |
1248 lw->sort_method = type; | |
1249 lw->sort_ascend = ascend; | |
1250 | |
2034
9297985567b5
use accessor functions
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
2021
diff
changeset
|
1251 if (lw->info_sort) gtk_label_set_text(GTK_LABEL(gtk_bin_get_child(GTK_BIN(lw->info_sort))), |
9 | 1252 sort_type_get_text(type)); |
1253 layout_list_sync_sort(lw); | |
1254 } | |
1255 | |
1416
3ba63f325b08
Use gboolean pseudo type where applicable.
Laurent Monin <geeqie@norz.org>
parents:
1415
diff
changeset
|
1256 gboolean layout_sort_get(LayoutWindow *lw, SortType *type, gboolean *ascend) |
9 | 1257 { |
1258 if (!layout_valid(&lw)) return FALSE; | |
1259 | |
1260 if (type) *type = lw->sort_method; | |
1261 if (ascend) *ascend = lw->sort_ascend; | |
1262 | |
1263 return TRUE; | |
1264 } | |
1265 | |
1416
3ba63f325b08
Use gboolean pseudo type where applicable.
Laurent Monin <geeqie@norz.org>
parents:
1415
diff
changeset
|
1266 gboolean layout_geometry_get(LayoutWindow *lw, gint *x, gint *y, gint *w, gint *h) |
9 | 1267 { |
2034
9297985567b5
use accessor functions
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
2021
diff
changeset
|
1268 GdkWindow *window; |
9 | 1269 if (!layout_valid(&lw)) return FALSE; |
2185
c14a1d8e6aa4
Trim trailing white spaces on empty lines.
Laurent Monin <zas@norz.org>
parents:
2184
diff
changeset
|
1270 |
2034
9297985567b5
use accessor functions
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
2021
diff
changeset
|
1271 window = gtk_widget_get_window(lw->window); |
9297985567b5
use accessor functions
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
2021
diff
changeset
|
1272 gdk_window_get_root_origin(window, x, y); |
9297985567b5
use accessor functions
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
2021
diff
changeset
|
1273 *w = gdk_window_get_width(window); |
9297985567b5
use accessor functions
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
2021
diff
changeset
|
1274 *h = gdk_window_get_height(window); |
9 | 1275 |
1276 return TRUE; | |
1277 } | |
1278 | |
1416
3ba63f325b08
Use gboolean pseudo type where applicable.
Laurent Monin <geeqie@norz.org>
parents:
1415
diff
changeset
|
1279 gboolean layout_geometry_get_dividers(LayoutWindow *lw, gint *h, gint *v) |
9 | 1280 { |
2035
4321c486aec7
use cairo for drawing
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
2034
diff
changeset
|
1281 GtkAllocation h_allocation; |
4321c486aec7
use cairo for drawing
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
2034
diff
changeset
|
1282 GtkAllocation v_allocation; |
2185
c14a1d8e6aa4
Trim trailing white spaces on empty lines.
Laurent Monin <zas@norz.org>
parents:
2184
diff
changeset
|
1283 |
9 | 1284 if (!layout_valid(&lw)) return FALSE; |
2185
c14a1d8e6aa4
Trim trailing white spaces on empty lines.
Laurent Monin <zas@norz.org>
parents:
2184
diff
changeset
|
1285 |
2035
4321c486aec7
use cairo for drawing
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
2034
diff
changeset
|
1286 if (lw->h_pane) |
9 | 1287 { |
2035
4321c486aec7
use cairo for drawing
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
2034
diff
changeset
|
1288 GtkWidget *child = gtk_paned_get_child1(GTK_PANED(lw->h_pane)); |
4321c486aec7
use cairo for drawing
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
2034
diff
changeset
|
1289 gtk_widget_get_allocation(child, &h_allocation); |
4321c486aec7
use cairo for drawing
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
2034
diff
changeset
|
1290 } |
4321c486aec7
use cairo for drawing
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
2034
diff
changeset
|
1291 |
4321c486aec7
use cairo for drawing
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
2034
diff
changeset
|
1292 if (lw->v_pane) |
4321c486aec7
use cairo for drawing
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
2034
diff
changeset
|
1293 { |
4321c486aec7
use cairo for drawing
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
2034
diff
changeset
|
1294 GtkWidget *child = gtk_paned_get_child1(GTK_PANED(lw->v_pane)); |
4321c486aec7
use cairo for drawing
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
2034
diff
changeset
|
1295 gtk_widget_get_allocation(child, &v_allocation); |
4321c486aec7
use cairo for drawing
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
2034
diff
changeset
|
1296 } |
4321c486aec7
use cairo for drawing
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
2034
diff
changeset
|
1297 |
4321c486aec7
use cairo for drawing
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
2034
diff
changeset
|
1298 if (lw->h_pane && h_allocation.x >= 0) |
4321c486aec7
use cairo for drawing
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
2034
diff
changeset
|
1299 { |
4321c486aec7
use cairo for drawing
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
2034
diff
changeset
|
1300 *h = h_allocation.width; |
9 | 1301 } |
1309
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
1302 else if (h != &lw->options.main_window.hdivider_pos) |
9 | 1303 { |
1309
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
1304 *h = lw->options.main_window.hdivider_pos; |
9 | 1305 } |
1306 | |
2035
4321c486aec7
use cairo for drawing
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
2034
diff
changeset
|
1307 if (lw->v_pane && v_allocation.x >= 0) |
9 | 1308 { |
2035
4321c486aec7
use cairo for drawing
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
2034
diff
changeset
|
1309 *v = v_allocation.height; |
9 | 1310 } |
1309
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
1311 else if (v != &lw->options.main_window.vdivider_pos) |
9 | 1312 { |
1309
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
1313 *v = lw->options.main_window.vdivider_pos; |
9 | 1314 } |
1315 | |
1316 return TRUE; | |
1317 } | |
1318 | |
556
585f0de4f906
Replace Layout icon_view field by more generic file_view_type.
Laurent Monin <geeqie@norz.org>
parents:
555
diff
changeset
|
1319 void layout_views_set(LayoutWindow *lw, DirViewType dir_view_type, FileViewType file_view_type) |
9 | 1320 { |
1321 if (!layout_valid(&lw)) return; | |
1322 | |
1412
4e84054a1d7a
fixed saving of file_view_type
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1403
diff
changeset
|
1323 if (lw->options.dir_view_type == dir_view_type && lw->options.file_view_type == file_view_type) return; |
1309
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
1324 |
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
1325 lw->options.dir_view_type = dir_view_type; |
1412
4e84054a1d7a
fixed saving of file_view_type
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1403
diff
changeset
|
1326 lw->options.file_view_type = file_view_type; |
9 | 1327 |
1328 layout_style_set(lw, -1, NULL); | |
1329 } | |
1330 | |
1416
3ba63f325b08
Use gboolean pseudo type where applicable.
Laurent Monin <geeqie@norz.org>
parents:
1415
diff
changeset
|
1331 gboolean layout_views_get(LayoutWindow *lw, DirViewType *dir_view_type, FileViewType *file_view_type) |
9 | 1332 { |
1333 if (!layout_valid(&lw)) return FALSE; | |
1334 | |
1309
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
1335 *dir_view_type = lw->options.dir_view_type; |
1412
4e84054a1d7a
fixed saving of file_view_type
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1403
diff
changeset
|
1336 *file_view_type = lw->options.file_view_type; |
9 | 1337 |
1338 return TRUE; | |
1339 } | |
1340 | |
1341 /* | |
1342 *----------------------------------------------------------------------------- | |
1343 * location utils | |
1344 *----------------------------------------------------------------------------- | |
1345 */ | |
1346 | |
1416
3ba63f325b08
Use gboolean pseudo type where applicable.
Laurent Monin <geeqie@norz.org>
parents:
1415
diff
changeset
|
1347 static gboolean layout_location_single(LayoutLocation l) |
9 | 1348 { |
1349 return (l == LAYOUT_LEFT || | |
1350 l == LAYOUT_RIGHT || | |
1351 l == LAYOUT_TOP || | |
1352 l == LAYOUT_BOTTOM); | |
1353 } | |
1354 | |
1416
3ba63f325b08
Use gboolean pseudo type where applicable.
Laurent Monin <geeqie@norz.org>
parents:
1415
diff
changeset
|
1355 static gboolean layout_location_vertical(LayoutLocation l) |
9 | 1356 { |
1357 return (l & LAYOUT_TOP || | |
1358 l & LAYOUT_BOTTOM); | |
1359 } | |
1360 | |
1416
3ba63f325b08
Use gboolean pseudo type where applicable.
Laurent Monin <geeqie@norz.org>
parents:
1415
diff
changeset
|
1361 static gboolean layout_location_first(LayoutLocation l) |
9 | 1362 { |
1363 return (l & LAYOUT_TOP || | |
1364 l & LAYOUT_LEFT); | |
1365 } | |
1366 | |
1367 static LayoutLocation layout_grid_compass(LayoutWindow *lw) | |
1368 { | |
1369 if (layout_location_single(lw->dir_location)) return lw->dir_location; | |
1370 if (layout_location_single(lw->file_location)) return lw->file_location; | |
1371 return lw->image_location; | |
1372 } | |
1373 | |
1374 static void layout_location_compute(LayoutLocation l1, LayoutLocation l2, | |
1375 GtkWidget *s1, GtkWidget *s2, | |
1376 GtkWidget **d1, GtkWidget **d2) | |
1377 { | |
1378 LayoutLocation l; | |
1379 | |
1380 l = l1 & l2; /* get common compass direction */ | |
1381 l = l1 - l; /* remove it */ | |
1382 | |
1383 if (layout_location_first(l)) | |
1384 { | |
1385 *d1 = s1; | |
1386 *d2 = s2; | |
1387 } | |
1388 else | |
1389 { | |
1390 *d1 = s2; | |
1391 *d2 = s1; | |
1392 } | |
1393 } | |
1394 | |
1395 /* | |
1396 *----------------------------------------------------------------------------- | |
1397 * tools window (for floating/hidden) | |
1398 *----------------------------------------------------------------------------- | |
1399 */ | |
1400 | |
1416
3ba63f325b08
Use gboolean pseudo type where applicable.
Laurent Monin <geeqie@norz.org>
parents:
1415
diff
changeset
|
1401 gboolean layout_geometry_get_tools(LayoutWindow *lw, gint *x, gint *y, gint *w, gint *h, gint *divider_pos) |
9 | 1402 { |
2034
9297985567b5
use accessor functions
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
2021
diff
changeset
|
1403 GdkWindow *window; |
2035
4321c486aec7
use cairo for drawing
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
2034
diff
changeset
|
1404 GtkAllocation allocation; |
9 | 1405 if (!layout_valid(&lw)) return FALSE; |
1406 | |
1810
c3a79dda8ea7
GTK marks several functions as deprecated
Klaus Ethgen <Klaus@Ethgen.de>
parents:
1802
diff
changeset
|
1407 if (!lw->tools || !gtk_widget_get_visible(lw->tools)) |
9 | 1408 { |
1409 /* use the stored values (sort of breaks success return value) */ | |
1410 | |
1309
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
1411 *divider_pos = lw->options.float_window.vdivider_pos; |
9 | 1412 |
1413 return FALSE; | |
1414 } | |
1415 | |
2436
8cd75e68e050
Save position of tools window
Colin Clark <cclark@mcb.net>
parents:
2433
diff
changeset
|
1416 window = gtk_widget_get_window(lw->tools); |
2034
9297985567b5
use accessor functions
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
2021
diff
changeset
|
1417 gdk_window_get_root_origin(window, x, y); |
9297985567b5
use accessor functions
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
2021
diff
changeset
|
1418 *w = gdk_window_get_width(window); |
9297985567b5
use accessor functions
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
2021
diff
changeset
|
1419 *h = gdk_window_get_height(window); |
2035
4321c486aec7
use cairo for drawing
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
2034
diff
changeset
|
1420 gtk_widget_get_allocation(gtk_paned_get_child1(GTK_PANED(lw->tools_pane)), &allocation); |
9 | 1421 |
2806
bcd52f7517c7
Bug Fix: Float file list layout not preserved in GTK3
Colin Clark <colin.clark@cclark.uk>
parents:
2775
diff
changeset
|
1422 if (gtk_orientable_get_orientation(GTK_ORIENTABLE(lw->tools_pane)) == GTK_ORIENTATION_VERTICAL) |
9 | 1423 { |
2035
4321c486aec7
use cairo for drawing
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
2034
diff
changeset
|
1424 *divider_pos = allocation.height; |
9 | 1425 } |
1426 else | |
1427 { | |
2035
4321c486aec7
use cairo for drawing
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
2034
diff
changeset
|
1428 *divider_pos = allocation.width; |
9 | 1429 } |
1430 | |
1431 return TRUE; | |
1432 } | |
1433 | |
2508
a39331032807
Additional debug features
Colin Clark <colin.clark@cclark.uk>
parents:
2468
diff
changeset
|
1434 gboolean layout_geometry_get_log_window(LayoutWindow *lw, gint *x, gint *y, |
a39331032807
Additional debug features
Colin Clark <colin.clark@cclark.uk>
parents:
2468
diff
changeset
|
1435 gint *w, gint *h) |
a39331032807
Additional debug features
Colin Clark <colin.clark@cclark.uk>
parents:
2468
diff
changeset
|
1436 { |
a39331032807
Additional debug features
Colin Clark <colin.clark@cclark.uk>
parents:
2468
diff
changeset
|
1437 GdkWindow *window; |
a39331032807
Additional debug features
Colin Clark <colin.clark@cclark.uk>
parents:
2468
diff
changeset
|
1438 |
a39331032807
Additional debug features
Colin Clark <colin.clark@cclark.uk>
parents:
2468
diff
changeset
|
1439 if (!layout_valid(&lw)) return FALSE; |
a39331032807
Additional debug features
Colin Clark <colin.clark@cclark.uk>
parents:
2468
diff
changeset
|
1440 |
a39331032807
Additional debug features
Colin Clark <colin.clark@cclark.uk>
parents:
2468
diff
changeset
|
1441 if (!lw->log_window) |
a39331032807
Additional debug features
Colin Clark <colin.clark@cclark.uk>
parents:
2468
diff
changeset
|
1442 { |
a39331032807
Additional debug features
Colin Clark <colin.clark@cclark.uk>
parents:
2468
diff
changeset
|
1443 return FALSE; |
a39331032807
Additional debug features
Colin Clark <colin.clark@cclark.uk>
parents:
2468
diff
changeset
|
1444 } |
a39331032807
Additional debug features
Colin Clark <colin.clark@cclark.uk>
parents:
2468
diff
changeset
|
1445 |
a39331032807
Additional debug features
Colin Clark <colin.clark@cclark.uk>
parents:
2468
diff
changeset
|
1446 window = gtk_widget_get_window(lw->log_window); |
a39331032807
Additional debug features
Colin Clark <colin.clark@cclark.uk>
parents:
2468
diff
changeset
|
1447 gdk_window_get_root_origin(window, x, y); |
a39331032807
Additional debug features
Colin Clark <colin.clark@cclark.uk>
parents:
2468
diff
changeset
|
1448 *w = gdk_window_get_width(window); |
a39331032807
Additional debug features
Colin Clark <colin.clark@cclark.uk>
parents:
2468
diff
changeset
|
1449 *h = gdk_window_get_height(window); |
a39331032807
Additional debug features
Colin Clark <colin.clark@cclark.uk>
parents:
2468
diff
changeset
|
1450 |
a39331032807
Additional debug features
Colin Clark <colin.clark@cclark.uk>
parents:
2468
diff
changeset
|
1451 return TRUE; |
a39331032807
Additional debug features
Colin Clark <colin.clark@cclark.uk>
parents:
2468
diff
changeset
|
1452 } |
a39331032807
Additional debug features
Colin Clark <colin.clark@cclark.uk>
parents:
2468
diff
changeset
|
1453 |
9 | 1454 static void layout_tools_geometry_sync(LayoutWindow *lw) |
1455 { | |
2451
4dcee0e5155a
Fix #326: Save position of float file list
Colin Clark <cclark@mcb.net>
parents:
2450
diff
changeset
|
1456 layout_geometry_get_tools(lw, &lw->options.float_window.x, &lw->options.float_window.y, |
1436
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
1457 &lw->options.float_window.w, &lw->options.float_window.h, &lw->options.float_window.vdivider_pos); |
9 | 1458 } |
1459 | |
1416
3ba63f325b08
Use gboolean pseudo type where applicable.
Laurent Monin <geeqie@norz.org>
parents:
1415
diff
changeset
|
1460 static void layout_tools_hide(LayoutWindow *lw, gboolean hide) |
9 | 1461 { |
1462 if (!lw->tools) return; | |
1463 | |
1464 if (hide) | |
1465 { | |
1810
c3a79dda8ea7
GTK marks several functions as deprecated
Klaus Ethgen <Klaus@Ethgen.de>
parents:
1802
diff
changeset
|
1466 if (gtk_widget_get_visible(lw->tools)) |
9 | 1467 { |
1468 layout_tools_geometry_sync(lw); | |
1469 gtk_widget_hide(lw->tools); | |
1470 } | |
1471 } | |
1472 else | |
1473 { | |
1810
c3a79dda8ea7
GTK marks several functions as deprecated
Klaus Ethgen <Klaus@Ethgen.de>
parents:
1802
diff
changeset
|
1474 if (!gtk_widget_get_visible(lw->tools)) |
9 | 1475 { |
1476 gtk_widget_show(lw->tools); | |
574
b2b9c2ae04f8
Drop ViewFileIcon, use ViewFile and ViewFileInfoIcon instead.
Laurent Monin <geeqie@norz.org>
parents:
573
diff
changeset
|
1477 if (lw->vf) vf_refresh(lw->vf); |
9 | 1478 } |
1479 } | |
1480 | |
1309
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
1481 lw->options.tools_hidden = hide; |
9 | 1482 } |
1483 | |
1433
12600de4b59a
Use gboolean where applicable, minor cleanup and indentations fixes.
Laurent Monin <geeqie@norz.org>
parents:
1431
diff
changeset
|
1484 static gboolean layout_tools_delete_cb(GtkWidget *widget, GdkEventAny *event, gpointer data) |
9 | 1485 { |
1486 LayoutWindow *lw = data; | |
1487 | |
1488 layout_tools_float_toggle(lw); | |
1489 | |
1490 return TRUE; | |
1491 } | |
1492 | |
1493 static void layout_tools_setup(LayoutWindow *lw, GtkWidget *tools, GtkWidget *files) | |
1494 { | |
1495 GtkWidget *vbox; | |
1496 GtkWidget *w1, *w2; | |
1433
12600de4b59a
Use gboolean where applicable, minor cleanup and indentations fixes.
Laurent Monin <geeqie@norz.org>
parents:
1431
diff
changeset
|
1497 gboolean vertical; |
1416
3ba63f325b08
Use gboolean pseudo type where applicable.
Laurent Monin <geeqie@norz.org>
parents:
1415
diff
changeset
|
1498 gboolean new_window = FALSE; |
9 | 1499 |
1500 vertical = (layout_location_single(lw->image_location) && !layout_location_vertical(lw->image_location)) || | |
1501 (!layout_location_single(lw->image_location) && layout_location_vertical(layout_grid_compass(lw))); | |
1502 /* for now, tools/dir are always first in order */ | |
1503 w1 = tools; | |
1504 w2 = files; | |
1505 | |
1506 if (!lw->tools) | |
1507 { | |
1508 GdkGeometry geometry; | |
1509 GdkWindowHints hints; | |
1510 | |
289
d4d7e7aa0d88
Simplify and unify gtk_window creation with the help of
Laurent Monin <geeqie@norz.org>
parents:
288
diff
changeset
|
1511 lw->tools = window_new(GTK_WINDOW_TOPLEVEL, "tools", PIXBUF_INLINE_ICON_TOOLS, NULL, _("Tools")); |
2909
2e7fd08bfbe4
DEBUG_NAME() function for use with GTKInspector
Colin Clark <colin.clark@cclark.uk>
parents:
2863
diff
changeset
|
1512 DEBUG_NAME(lw->tools); |
9 | 1513 g_signal_connect(G_OBJECT(lw->tools), "delete_event", |
1514 G_CALLBACK(layout_tools_delete_cb), lw); | |
1515 layout_keyboard_init(lw, lw->tools); | |
1516 | |
1436
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
1517 if (options->save_window_positions) |
9 | 1518 { |
41
cac3a3efd1fd
Wed Apr 27 15:17:57 2005 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
23
diff
changeset
|
1519 hints = GDK_HINT_USER_POS; |
9 | 1520 } |
1521 else | |
1522 { | |
1523 hints = 0; | |
1524 } | |
1525 | |
1029
b1a912dee214
Use a constant for minimal window size. Set it to 32 for all dialogs.
Laurent Monin <geeqie@norz.org>
parents:
1006
diff
changeset
|
1526 geometry.min_width = DEFAULT_MINIMAL_WINDOW_SIZE; |
b1a912dee214
Use a constant for minimal window size. Set it to 32 for all dialogs.
Laurent Monin <geeqie@norz.org>
parents:
1006
diff
changeset
|
1527 geometry.min_height = DEFAULT_MINIMAL_WINDOW_SIZE; |
9 | 1528 geometry.base_width = TOOLWINDOW_DEF_WIDTH; |
1529 geometry.base_height = TOOLWINDOW_DEF_HEIGHT; | |
1530 gtk_window_set_geometry_hints(GTK_WINDOW(lw->tools), NULL, &geometry, | |
1531 GDK_HINT_MIN_SIZE | GDK_HINT_BASE_SIZE | hints); | |
1532 | |
1533 | |
268
c439ad915ade
Tidy up, whitespaces and indentation fix.
Laurent Monin <geeqie@norz.org>
parents:
254
diff
changeset
|
1534 gtk_window_set_resizable(GTK_WINDOW(lw->tools), TRUE); |
c439ad915ade
Tidy up, whitespaces and indentation fix.
Laurent Monin <geeqie@norz.org>
parents:
254
diff
changeset
|
1535 gtk_container_set_border_width(GTK_CONTAINER(lw->tools), 0); |
2813
e9e8e8b2afce
Move menu/toolbar to top of window
Colin Clark <colin.clark@cclark.uk>
parents:
2808
diff
changeset
|
1536 gtk_container_remove(GTK_CONTAINER(lw->main_box), lw->menu_tool_bar); |
442 | 1537 |
9 | 1538 new_window = TRUE; |
1539 } | |
1540 else | |
1541 { | |
1542 layout_tools_geometry_sync(lw); | |
1543 /* dump the contents */ | |
2034
9297985567b5
use accessor functions
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
2021
diff
changeset
|
1544 gtk_widget_destroy(gtk_bin_get_child(GTK_BIN(lw->tools))); |
9 | 1545 } |
1546 | |
1547 layout_actions_add_window(lw, lw->tools); | |
1548 | |
1549 vbox = gtk_vbox_new(FALSE, 0); | |
2909
2e7fd08bfbe4
DEBUG_NAME() function for use with GTKInspector
Colin Clark <colin.clark@cclark.uk>
parents:
2863
diff
changeset
|
1550 DEBUG_NAME(vbox); |
9 | 1551 gtk_container_add(GTK_CONTAINER(lw->tools), vbox); |
2813
e9e8e8b2afce
Move menu/toolbar to top of window
Colin Clark <colin.clark@cclark.uk>
parents:
2808
diff
changeset
|
1552 gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(lw->menu_tool_bar), FALSE, FALSE, 0); |
9 | 1553 gtk_widget_show(vbox); |
1554 | |
1555 layout_status_setup(lw, vbox, TRUE); | |
1556 | |
1557 if (vertical) | |
1558 { | |
1559 lw->tools_pane = gtk_vpaned_new(); | |
2909
2e7fd08bfbe4
DEBUG_NAME() function for use with GTKInspector
Colin Clark <colin.clark@cclark.uk>
parents:
2863
diff
changeset
|
1560 DEBUG_NAME(lw->tools_pane); |
9 | 1561 } |
1562 else | |
1563 { | |
1564 lw->tools_pane = gtk_hpaned_new(); | |
2909
2e7fd08bfbe4
DEBUG_NAME() function for use with GTKInspector
Colin Clark <colin.clark@cclark.uk>
parents:
2863
diff
changeset
|
1565 DEBUG_NAME(lw->tools_pane); |
9 | 1566 } |
1567 gtk_box_pack_start(GTK_BOX(vbox), lw->tools_pane, TRUE, TRUE, 0); | |
1568 gtk_widget_show(lw->tools_pane); | |
1569 | |
1570 gtk_paned_pack1(GTK_PANED(lw->tools_pane), w1, FALSE, TRUE); | |
1571 gtk_paned_pack2(GTK_PANED(lw->tools_pane), w2, TRUE, TRUE); | |
1572 | |
1573 gtk_widget_show(tools); | |
1574 gtk_widget_show(files); | |
1575 | |
1576 if (new_window) | |
1577 { | |
1436
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
1578 if (options->save_window_positions) |
9 | 1579 { |
1436
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
1580 gtk_window_set_default_size(GTK_WINDOW(lw->tools), lw->options.float_window.w, lw->options.float_window.h); |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
1581 gtk_window_move(GTK_WINDOW(lw->tools), lw->options.float_window.x, lw->options.float_window.y); |
268
c439ad915ade
Tidy up, whitespaces and indentation fix.
Laurent Monin <geeqie@norz.org>
parents:
254
diff
changeset
|
1582 } |
9 | 1583 else |
1584 { | |
1585 if (vertical) | |
1586 { | |
1587 gtk_window_set_default_size(GTK_WINDOW(lw->tools), | |
1588 TOOLWINDOW_DEF_WIDTH, TOOLWINDOW_DEF_HEIGHT); | |
1589 } | |
1590 else | |
1591 { | |
1592 gtk_window_set_default_size(GTK_WINDOW(lw->tools), | |
1593 TOOLWINDOW_DEF_HEIGHT, TOOLWINDOW_DEF_WIDTH); | |
1594 } | |
1595 } | |
1596 } | |
1597 | |
1436
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
1598 if (!options->save_window_positions) |
9 | 1599 { |
1600 if (vertical) | |
1601 { | |
1309
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
1602 lw->options.float_window.vdivider_pos = MAIN_WINDOW_DIV_VPOS; |
9 | 1603 } |
1604 else | |
1605 { | |
1309
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
1606 lw->options.float_window.vdivider_pos = MAIN_WINDOW_DIV_HPOS; |
9 | 1607 } |
1608 } | |
1609 | |
1309
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
1610 gtk_paned_set_position(GTK_PANED(lw->tools_pane), lw->options.float_window.vdivider_pos); |
9 | 1611 } |
1612 | |
1613 /* | |
1614 *----------------------------------------------------------------------------- | |
1615 * glue (layout arrangement) | |
1616 *----------------------------------------------------------------------------- | |
1617 */ | |
1618 | |
1619 static void layout_grid_compute(LayoutWindow *lw, | |
1620 GtkWidget *image, GtkWidget *tools, GtkWidget *files, | |
1621 GtkWidget **w1, GtkWidget **w2, GtkWidget **w3) | |
1622 { | |
1623 /* heh, this was fun */ | |
1624 | |
1625 if (layout_location_single(lw->dir_location)) | |
1626 { | |
1627 if (layout_location_first(lw->dir_location)) | |
1628 { | |
1629 *w1 = tools; | |
1630 layout_location_compute(lw->file_location, lw->image_location, files, image, w2, w3); | |
1631 } | |
1632 else | |
1633 { | |
1634 *w3 = tools; | |
1635 layout_location_compute(lw->file_location, lw->image_location, files, image, w1, w2); | |
1636 } | |
1637 } | |
1638 else if (layout_location_single(lw->file_location)) | |
1639 { | |
1640 if (layout_location_first(lw->file_location)) | |
1641 { | |
1642 *w1 = files; | |
1643 layout_location_compute(lw->dir_location, lw->image_location, tools, image, w2, w3); | |
1644 } | |
1645 else | |
1646 { | |
1647 *w3 = files; | |
1648 layout_location_compute(lw->dir_location, lw->image_location, tools, image, w1, w2); | |
1649 } | |
1650 } | |
1651 else | |
1652 { | |
1653 /* image */ | |
1654 if (layout_location_first(lw->image_location)) | |
1655 { | |
1656 *w1 = image; | |
1657 layout_location_compute(lw->file_location, lw->dir_location, files, tools, w2, w3); | |
1658 } | |
1659 else | |
1660 { | |
1661 *w3 = image; | |
1662 layout_location_compute(lw->file_location, lw->dir_location, files, tools, w1, w2); | |
1663 } | |
1664 } | |
1665 } | |
1666 | |
127
996ccab9eab3
implemented split windows
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
122
diff
changeset
|
1667 void layout_split_change(LayoutWindow *lw, ImageSplitMode mode) |
996ccab9eab3
implemented split windows
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
122
diff
changeset
|
1668 { |
996ccab9eab3
implemented split windows
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
122
diff
changeset
|
1669 GtkWidget *image; |
996ccab9eab3
implemented split windows
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
122
diff
changeset
|
1670 gint i; |
268
c439ad915ade
Tidy up, whitespaces and indentation fix.
Laurent Monin <geeqie@norz.org>
parents:
254
diff
changeset
|
1671 |
c439ad915ade
Tidy up, whitespaces and indentation fix.
Laurent Monin <geeqie@norz.org>
parents:
254
diff
changeset
|
1672 for (i = 0; i < MAX_SPLIT_IMAGES; i++) |
127
996ccab9eab3
implemented split windows
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
122
diff
changeset
|
1673 { |
996ccab9eab3
implemented split windows
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
122
diff
changeset
|
1674 if (lw->split_images[i]) |
996ccab9eab3
implemented split windows
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
122
diff
changeset
|
1675 { |
996ccab9eab3
implemented split windows
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
122
diff
changeset
|
1676 gtk_widget_hide(lw->split_images[i]->widget); |
2034
9297985567b5
use accessor functions
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
2021
diff
changeset
|
1677 if (gtk_widget_get_parent(lw->split_images[i]->widget) != lw->utility_paned) |
9297985567b5
use accessor functions
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
2021
diff
changeset
|
1678 gtk_container_remove(GTK_CONTAINER(gtk_widget_get_parent(lw->split_images[i]->widget)), lw->split_images[i]->widget); |
127
996ccab9eab3
implemented split windows
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
122
diff
changeset
|
1679 } |
996ccab9eab3
implemented split windows
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
122
diff
changeset
|
1680 } |
1383
bdd15a0038dd
use standard GtkHPaned for sidebar width
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1375
diff
changeset
|
1681 gtk_container_remove(GTK_CONTAINER(lw->utility_paned), lw->split_image_widget); |
127
996ccab9eab3
implemented split windows
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
122
diff
changeset
|
1682 |
996ccab9eab3
implemented split windows
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
122
diff
changeset
|
1683 image = layout_image_setup_split(lw, mode); |
996ccab9eab3
implemented split windows
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
122
diff
changeset
|
1684 |
1383
bdd15a0038dd
use standard GtkHPaned for sidebar width
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1375
diff
changeset
|
1685 gtk_paned_pack1(GTK_PANED(lw->utility_paned), image, TRUE, FALSE); |
127
996ccab9eab3
implemented split windows
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
122
diff
changeset
|
1686 gtk_widget_show(image); |
1669
e8de419b42d4
reordered View menu
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1635
diff
changeset
|
1687 layout_util_sync(lw); |
127
996ccab9eab3
implemented split windows
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
122
diff
changeset
|
1688 } |
996ccab9eab3
implemented split windows
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
122
diff
changeset
|
1689 |
9 | 1690 static void layout_grid_setup(LayoutWindow *lw) |
1691 { | |
1692 gint priority_location; | |
1693 GtkWidget *h; | |
1694 GtkWidget *v; | |
1695 GtkWidget *w1, *w2, *w3; | |
1696 | |
1322
4e4ef96940b9
reuse original utility_box (image + sidebars) on layout change (switch
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1320
diff
changeset
|
1697 GtkWidget *image_sb; /* image together with sidebars in utility box */ |
9 | 1698 GtkWidget *tools; |
1699 GtkWidget *files; | |
1700 | |
1701 layout_actions_setup(lw); | |
1702 | |
1703 lw->group_box = gtk_vbox_new(FALSE, 0); | |
2909
2e7fd08bfbe4
DEBUG_NAME() function for use with GTKInspector
Colin Clark <colin.clark@cclark.uk>
parents:
2863
diff
changeset
|
1704 DEBUG_NAME(lw->group_box); |
2813
e9e8e8b2afce
Move menu/toolbar to top of window
Colin Clark <colin.clark@cclark.uk>
parents:
2808
diff
changeset
|
1705 gtk_box_pack_end(GTK_BOX(lw->main_box), lw->group_box, TRUE, TRUE, 0); |
9 | 1706 gtk_widget_show(lw->group_box); |
1707 | |
1708 priority_location = layout_grid_compass(lw); | |
1709 | |
1322
4e4ef96940b9
reuse original utility_box (image + sidebars) on layout change (switch
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1320
diff
changeset
|
1710 if (lw->utility_box) |
4e4ef96940b9
reuse original utility_box (image + sidebars) on layout change (switch
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1320
diff
changeset
|
1711 { |
1480
82915f832ec5
split-mode cleanup and improvements
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1473
diff
changeset
|
1712 layout_split_change(lw, lw->split_mode); /* this re-creates image frame for the new configuration */ |
1322
4e4ef96940b9
reuse original utility_box (image + sidebars) on layout change (switch
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1320
diff
changeset
|
1713 image_sb = lw->utility_box; |
2909
2e7fd08bfbe4
DEBUG_NAME() function for use with GTKInspector
Colin Clark <colin.clark@cclark.uk>
parents:
2863
diff
changeset
|
1714 DEBUG_NAME(image_sb); |
1322
4e4ef96940b9
reuse original utility_box (image + sidebars) on layout change (switch
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1320
diff
changeset
|
1715 } |
4e4ef96940b9
reuse original utility_box (image + sidebars) on layout change (switch
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1320
diff
changeset
|
1716 else |
4e4ef96940b9
reuse original utility_box (image + sidebars) on layout change (switch
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1320
diff
changeset
|
1717 { |
4e4ef96940b9
reuse original utility_box (image + sidebars) on layout change (switch
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1320
diff
changeset
|
1718 GtkWidget *image; /* image or split images together */ |
4e4ef96940b9
reuse original utility_box (image + sidebars) on layout change (switch
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1320
diff
changeset
|
1719 image = layout_image_setup_split(lw, lw->split_mode); |
4e4ef96940b9
reuse original utility_box (image + sidebars) on layout change (switch
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1320
diff
changeset
|
1720 image_sb = layout_bars_prepare(lw, image); |
2909
2e7fd08bfbe4
DEBUG_NAME() function for use with GTKInspector
Colin Clark <colin.clark@cclark.uk>
parents:
2863
diff
changeset
|
1721 DEBUG_NAME(image_sb); |
1322
4e4ef96940b9
reuse original utility_box (image + sidebars) on layout change (switch
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1320
diff
changeset
|
1722 } |
2185
c14a1d8e6aa4
Trim trailing white spaces on empty lines.
Laurent Monin <zas@norz.org>
parents:
2184
diff
changeset
|
1723 |
9 | 1724 tools = layout_tools_new(lw); |
2909
2e7fd08bfbe4
DEBUG_NAME() function for use with GTKInspector
Colin Clark <colin.clark@cclark.uk>
parents:
2863
diff
changeset
|
1725 DEBUG_NAME(tools); |
9 | 1726 files = layout_list_new(lw); |
2909
2e7fd08bfbe4
DEBUG_NAME() function for use with GTKInspector
Colin Clark <colin.clark@cclark.uk>
parents:
2863
diff
changeset
|
1727 DEBUG_NAME(files); |
9 | 1728 |
1729 | |
1309
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
1730 if (lw->options.tools_float || lw->options.tools_hidden) |
9 | 1731 { |
1322
4e4ef96940b9
reuse original utility_box (image + sidebars) on layout change (switch
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1320
diff
changeset
|
1732 gtk_box_pack_start(GTK_BOX(lw->group_box), image_sb, TRUE, TRUE, 0); |
4e4ef96940b9
reuse original utility_box (image + sidebars) on layout change (switch
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1320
diff
changeset
|
1733 gtk_widget_show(image_sb); |
9 | 1734 |
1735 layout_tools_setup(lw, tools, files); | |
1736 | |
1482
0fa0b9ba559c
fixed keyboard focus on start-up
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1480
diff
changeset
|
1737 image_grab_focus(lw->image); |
9 | 1738 |
1739 return; | |
1740 } | |
1741 else if (lw->tools) | |
1742 { | |
1743 layout_tools_geometry_sync(lw); | |
1744 gtk_widget_destroy(lw->tools); | |
1745 lw->tools = NULL; | |
1746 lw->tools_pane = NULL; | |
1747 } | |
1748 | |
1749 layout_status_setup(lw, lw->group_box, FALSE); | |
1750 | |
1322
4e4ef96940b9
reuse original utility_box (image + sidebars) on layout change (switch
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1320
diff
changeset
|
1751 layout_grid_compute(lw, image_sb, tools, files, &w1, &w2, &w3); |
9 | 1752 |
1753 v = lw->v_pane = gtk_vpaned_new(); | |
2909
2e7fd08bfbe4
DEBUG_NAME() function for use with GTKInspector
Colin Clark <colin.clark@cclark.uk>
parents:
2863
diff
changeset
|
1754 DEBUG_NAME(v); |
9 | 1755 |
1756 h = lw->h_pane = gtk_hpaned_new(); | |
2909
2e7fd08bfbe4
DEBUG_NAME() function for use with GTKInspector
Colin Clark <colin.clark@cclark.uk>
parents:
2863
diff
changeset
|
1757 DEBUG_NAME(h); |
9 | 1758 |
1759 if (!layout_location_vertical(priority_location)) | |
1760 { | |
1761 GtkWidget *tmp; | |
1762 | |
1763 tmp = v; | |
1764 v = h; | |
1765 h = tmp; | |
1766 } | |
1767 | |
1768 gtk_box_pack_start(GTK_BOX(lw->group_box), v, TRUE, TRUE, 0); | |
1769 | |
1770 if (!layout_location_first(priority_location)) | |
1771 { | |
1772 gtk_paned_pack1(GTK_PANED(v), h, FALSE, TRUE); | |
1773 gtk_paned_pack2(GTK_PANED(v), w3, TRUE, TRUE); | |
1774 | |
1775 gtk_paned_pack1(GTK_PANED(h), w1, FALSE, TRUE); | |
1776 gtk_paned_pack2(GTK_PANED(h), w2, TRUE, TRUE); | |
1777 } | |
1778 else | |
1779 { | |
1780 gtk_paned_pack1(GTK_PANED(v), w1, FALSE, TRUE); | |
1781 gtk_paned_pack2(GTK_PANED(v), h, TRUE, TRUE); | |
1782 | |
1783 gtk_paned_pack1(GTK_PANED(h), w2, FALSE, TRUE); | |
1784 gtk_paned_pack2(GTK_PANED(h), w3, TRUE, TRUE); | |
1785 } | |
1786 | |
1322
4e4ef96940b9
reuse original utility_box (image + sidebars) on layout change (switch
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1320
diff
changeset
|
1787 gtk_widget_show(image_sb); |
9 | 1788 gtk_widget_show(tools); |
1789 gtk_widget_show(files); | |
1790 | |
1791 gtk_widget_show(v); | |
1792 gtk_widget_show(h); | |
1793 | |
1794 /* fix to have image pane visible when it is left and priority widget */ | |
1309
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
1795 if (lw->options.main_window.hdivider_pos == -1 && |
1322
4e4ef96940b9
reuse original utility_box (image + sidebars) on layout change (switch
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1320
diff
changeset
|
1796 w1 == image_sb && |
9 | 1797 !layout_location_vertical(priority_location) && |
1798 layout_location_first(priority_location)) | |
1799 { | |
1322
4e4ef96940b9
reuse original utility_box (image + sidebars) on layout change (switch
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1320
diff
changeset
|
1800 gtk_widget_set_size_request(image_sb, 200, -1); |
9 | 1801 } |
1802 | |
1309
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
1803 gtk_paned_set_position(GTK_PANED(lw->h_pane), lw->options.main_window.hdivider_pos); |
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
1804 gtk_paned_set_position(GTK_PANED(lw->v_pane), lw->options.main_window.vdivider_pos); |
9 | 1805 |
1482
0fa0b9ba559c
fixed keyboard focus on start-up
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1480
diff
changeset
|
1806 image_grab_focus(lw->image); |
9 | 1807 } |
1808 | |
1809 void layout_style_set(LayoutWindow *lw, gint style, const gchar *order) | |
1810 { | |
783
0e45ed008a1c
replaced directory path with FileData* dir_fd
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
774
diff
changeset
|
1811 FileData *dir_fd; |
1582
f137ec3fd85e
- handle color profile and write metadata buttons on statusbar by ui_manager
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1558
diff
changeset
|
1812 gint i; |
9 | 1813 |
1814 if (!layout_valid(&lw)) return; | |
1815 | |
1816 if (style != -1) | |
1817 { | |
1818 LayoutLocation d, f, i; | |
1819 | |
1820 layout_config_parse(style, order, &d, &f, &i); | |
1821 | |
1822 if (lw->dir_location == d && | |
1823 lw->file_location == f && | |
1824 lw->image_location == i) return; | |
1825 | |
1826 lw->dir_location = d; | |
1827 lw->file_location = f; | |
1828 lw->image_location = i; | |
1829 } | |
1830 | |
1831 /* remember state */ | |
1832 | |
2184 | 1833 /* layout_image_slideshow_stop(lw); slideshow should survive */ |
9 | 1834 layout_image_full_screen_stop(lw); |
1835 | |
783
0e45ed008a1c
replaced directory path with FileData* dir_fd
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
774
diff
changeset
|
1836 dir_fd = lw->dir_fd; |
960
066f98cba001
fixed crash with float file list and geeqie --blank
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
959
diff
changeset
|
1837 if (dir_fd) file_data_unregister_real_time_monitor(dir_fd); |
783
0e45ed008a1c
replaced directory path with FileData* dir_fd
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
774
diff
changeset
|
1838 lw->dir_fd = NULL; |
1322
4e4ef96940b9
reuse original utility_box (image + sidebars) on layout change (switch
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1320
diff
changeset
|
1839 |
1403
b51f9365177b
fixed crash with certain layout configurations
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1383
diff
changeset
|
1840 layout_geometry_get_dividers(lw, &lw->options.main_window.hdivider_pos, &lw->options.main_window.vdivider_pos); |
b51f9365177b
fixed crash with certain layout configurations
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1383
diff
changeset
|
1841 |
1582
f137ec3fd85e
- handle color profile and write metadata buttons on statusbar by ui_manager
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1558
diff
changeset
|
1842 /* preserve utility_box (image + sidebars), menu_bar and toolbars to be reused later in layout_grid_setup */ |
1322
4e4ef96940b9
reuse original utility_box (image + sidebars) on layout change (switch
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1320
diff
changeset
|
1843 /* lw->image is preserved together with lw->utility_box */ |
2034
9297985567b5
use accessor functions
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
2021
diff
changeset
|
1844 if (lw->utility_box) gtk_container_remove(GTK_CONTAINER(gtk_widget_get_parent(lw->utility_box)), lw->utility_box); |
2813
e9e8e8b2afce
Move menu/toolbar to top of window
Colin Clark <colin.clark@cclark.uk>
parents:
2808
diff
changeset
|
1845 |
e9e8e8b2afce
Move menu/toolbar to top of window
Colin Clark <colin.clark@cclark.uk>
parents:
2808
diff
changeset
|
1846 if (lw->toolbar[TOOLBAR_STATUS]) gtk_container_remove(GTK_CONTAINER(gtk_widget_get_parent(lw->toolbar[TOOLBAR_STATUS])), lw->toolbar[TOOLBAR_STATUS]); |
e9e8e8b2afce
Move menu/toolbar to top of window
Colin Clark <colin.clark@cclark.uk>
parents:
2808
diff
changeset
|
1847 |
e9e8e8b2afce
Move menu/toolbar to top of window
Colin Clark <colin.clark@cclark.uk>
parents:
2808
diff
changeset
|
1848 if (lw->menu_tool_bar) gtk_container_remove(GTK_CONTAINER(gtk_widget_get_parent(lw->menu_tool_bar)), lw->menu_tool_bar); |
9 | 1849 |
1850 /* clear it all */ | |
1851 | |
1852 lw->h_pane = NULL; | |
1853 lw->v_pane = NULL; | |
1854 | |
1855 lw->path_entry = NULL; | |
1856 lw->dir_view = NULL; | |
380
41079d11eba7
Introduce a new struct ViewDir to handle directory views common
Laurent Monin <geeqie@norz.org>
parents:
368
diff
changeset
|
1857 lw->vd = NULL; |
9 | 1858 |
1859 lw->file_view = NULL; | |
573
a10da32cacf2
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
Laurent Monin <geeqie@norz.org>
parents:
559
diff
changeset
|
1860 lw->vf = NULL; |
9 | 1861 |
1862 lw->info_box = NULL; | |
1863 lw->info_progress_bar = NULL; | |
1864 lw->info_sort = NULL; | |
1865 lw->info_status = NULL; | |
1866 lw->info_details = NULL; | |
1375
08db75ca4713
Display pixel coordinates and rgb - patch by Ruben Stein
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1372
diff
changeset
|
1867 lw->info_pixel = NULL; |
9 | 1868 lw->info_zoom = NULL; |
1869 | |
1470
02f03330d589
do not re-create ui_manager at layout change
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1466
diff
changeset
|
1870 /* |
9 | 1871 if (lw->ui_manager) g_object_unref(lw->ui_manager); |
1872 lw->ui_manager = NULL; | |
1873 lw->action_group = NULL; | |
1463
7031da014d97
added function to reload external editors at any time
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1461
diff
changeset
|
1874 lw->action_group_editors = NULL; |
1470
02f03330d589
do not re-create ui_manager at layout change
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1466
diff
changeset
|
1875 */ |
9 | 1876 |
1877 gtk_container_remove(GTK_CONTAINER(lw->main_box), lw->group_box); | |
1878 lw->group_box = NULL; | |
1879 | |
1880 /* re-fill */ | |
1881 | |
1882 layout_grid_setup(lw); | |
1309
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
1883 layout_tools_hide(lw, lw->options.tools_hidden); |
9 | 1884 |
1885 layout_util_sync(lw); | |
1886 layout_status_update_all(lw); | |
1887 | |
1470
02f03330d589
do not re-create ui_manager at layout change
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1466
diff
changeset
|
1888 |
02f03330d589
do not re-create ui_manager at layout change
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1466
diff
changeset
|
1889 // printf("%d %d %d \n", G_OBJECT(lw->utility_box)->ref_count, G_OBJECT(lw->menu_bar)->ref_count, G_OBJECT(lw->toolbar)->ref_count); |
02f03330d589
do not re-create ui_manager at layout change
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1466
diff
changeset
|
1890 |
9 | 1891 /* sync */ |
1892 | |
783
0e45ed008a1c
replaced directory path with FileData* dir_fd
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
774
diff
changeset
|
1893 if (image_get_fd(lw->image)) |
9 | 1894 { |
783
0e45ed008a1c
replaced directory path with FileData* dir_fd
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
774
diff
changeset
|
1895 layout_set_fd(lw, image_get_fd(lw->image)); |
9 | 1896 } |
1897 else | |
1898 { | |
783
0e45ed008a1c
replaced directory path with FileData* dir_fd
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
774
diff
changeset
|
1899 layout_set_fd(lw, dir_fd); |
9 | 1900 } |
1309
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
1901 image_top_window_set_sync(lw->image, (lw->options.tools_float || lw->options.tools_hidden)); |
9 | 1902 |
1903 /* clean up */ | |
1904 | |
783
0e45ed008a1c
replaced directory path with FileData* dir_fd
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
774
diff
changeset
|
1905 file_data_unref(dir_fd); |
9 | 1906 } |
1907 | |
1908 void layout_colors_update(void) | |
1909 { | |
1910 GList *work; | |
1911 | |
1912 work = layout_window_list; | |
1913 while (work) | |
1914 { | |
1626
63527696d61c
Add an option to Image preferences to restrict custom border to fullscreen mode only. Bug 2798062.
Laurent Monin <geeqie@norz.org>
parents:
1586
diff
changeset
|
1915 gint i; |
9 | 1916 LayoutWindow *lw = work->data; |
1917 work = work->next; | |
2185
c14a1d8e6aa4
Trim trailing white spaces on empty lines.
Laurent Monin <zas@norz.org>
parents:
2184
diff
changeset
|
1918 |
208
d74cfaa3d146
set user-defined color as image background - patch by Laurent MONIN
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
196
diff
changeset
|
1919 if (!lw->image) continue; |
1626
63527696d61c
Add an option to Image preferences to restrict custom border to fullscreen mode only. Bug 2798062.
Laurent Monin <geeqie@norz.org>
parents:
1586
diff
changeset
|
1920 |
63527696d61c
Add an option to Image preferences to restrict custom border to fullscreen mode only. Bug 2798062.
Laurent Monin <geeqie@norz.org>
parents:
1586
diff
changeset
|
1921 for (i = 0; i < MAX_SPLIT_IMAGES; i++) |
63527696d61c
Add an option to Image preferences to restrict custom border to fullscreen mode only. Bug 2798062.
Laurent Monin <geeqie@norz.org>
parents:
1586
diff
changeset
|
1922 { |
63527696d61c
Add an option to Image preferences to restrict custom border to fullscreen mode only. Bug 2798062.
Laurent Monin <geeqie@norz.org>
parents:
1586
diff
changeset
|
1923 if (!lw->split_images[i]) continue; |
63527696d61c
Add an option to Image preferences to restrict custom border to fullscreen mode only. Bug 2798062.
Laurent Monin <geeqie@norz.org>
parents:
1586
diff
changeset
|
1924 image_background_set_color_from_options(lw->split_images[i], !!lw->full_screen); |
63527696d61c
Add an option to Image preferences to restrict custom border to fullscreen mode only. Bug 2798062.
Laurent Monin <geeqie@norz.org>
parents:
1586
diff
changeset
|
1925 } |
2185
c14a1d8e6aa4
Trim trailing white spaces on empty lines.
Laurent Monin <zas@norz.org>
parents:
2184
diff
changeset
|
1926 |
1626
63527696d61c
Add an option to Image preferences to restrict custom border to fullscreen mode only. Bug 2798062.
Laurent Monin <geeqie@norz.org>
parents:
1586
diff
changeset
|
1927 image_background_set_color_from_options(lw->image, !!lw->full_screen); |
9 | 1928 } |
1929 } | |
1930 | |
1931 void layout_tools_float_toggle(LayoutWindow *lw) | |
1932 { | |
1416
3ba63f325b08
Use gboolean pseudo type where applicable.
Laurent Monin <geeqie@norz.org>
parents:
1415
diff
changeset
|
1933 gboolean popped; |
9 | 1934 |
1935 if (!lw) return; | |
1936 | |
1309
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
1937 if (!lw->options.tools_hidden) |
9 | 1938 { |
1309
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
1939 popped = !lw->options.tools_float; |
9 | 1940 } |
1941 else | |
1942 { | |
1943 popped = TRUE; | |
1944 } | |
1945 | |
1309
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
1946 if (lw->options.tools_float == popped) |
9 | 1947 { |
1309
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
1948 if (popped && lw->options.tools_hidden) |
9 | 1949 { |
1950 layout_tools_float_set(lw, popped, FALSE); | |
1951 } | |
1952 } | |
1953 else | |
1954 { | |
1309
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
1955 if (lw->options.tools_float) |
9 | 1956 { |
1957 layout_tools_float_set(lw, FALSE, FALSE); | |
1958 } | |
1959 else | |
1960 { | |
1961 layout_tools_float_set(lw, TRUE, FALSE); | |
1962 } | |
1963 } | |
1964 } | |
1965 | |
1966 void layout_tools_hide_toggle(LayoutWindow *lw) | |
1967 { | |
1968 if (!lw) return; | |
1969 | |
1309
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
1970 layout_tools_float_set(lw, lw->options.tools_float, !lw->options.tools_hidden); |
9 | 1971 } |
1972 | |
1416
3ba63f325b08
Use gboolean pseudo type where applicable.
Laurent Monin <geeqie@norz.org>
parents:
1415
diff
changeset
|
1973 void layout_tools_float_set(LayoutWindow *lw, gboolean popped, gboolean hidden) |
9 | 1974 { |
1975 if (!layout_valid(&lw)) return; | |
1976 | |
1309
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
1977 if (lw->options.tools_float == popped && lw->options.tools_hidden == hidden) return; |
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
1978 |
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
1979 if (lw->options.tools_float == popped && lw->options.tools_float && lw->tools) |
9 | 1980 { |
1981 layout_tools_hide(lw, hidden); | |
1982 return; | |
1983 } | |
1984 | |
1309
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
1985 lw->options.tools_float = popped; |
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
1986 lw->options.tools_hidden = hidden; |
9 | 1987 |
1988 layout_style_set(lw, -1, NULL); | |
1989 } | |
1990 | |
1416
3ba63f325b08
Use gboolean pseudo type where applicable.
Laurent Monin <geeqie@norz.org>
parents:
1415
diff
changeset
|
1991 gboolean layout_tools_float_get(LayoutWindow *lw, gboolean *popped, gboolean *hidden) |
9 | 1992 { |
1993 if (!layout_valid(&lw)) return FALSE; | |
1994 | |
1309
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
1995 *popped = lw->options.tools_float; |
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
1996 *hidden = lw->options.tools_hidden; |
9 | 1997 |
1998 return TRUE; | |
1999 } | |
2000 | |
2001 void layout_toolbar_toggle(LayoutWindow *lw) | |
2002 { | |
2003 if (!layout_valid(&lw)) return; | |
2441
a2d4729a3b2d
Fix GCC and Clang compile warnings.
Omari Stephens <xsdg@google.com>
parents:
2412
diff
changeset
|
2004 if (!lw->toolbar[TOOLBAR_MAIN]) return; |
9 | 2005 |
1309
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
2006 lw->options.toolbar_hidden = !lw->options.toolbar_hidden; |
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
2007 |
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
2008 if (lw->options.toolbar_hidden) |
9 | 2009 { |
1810
c3a79dda8ea7
GTK marks several functions as deprecated
Klaus Ethgen <Klaus@Ethgen.de>
parents:
1802
diff
changeset
|
2010 if (gtk_widget_get_visible(lw->toolbar[TOOLBAR_MAIN])) gtk_widget_hide(lw->toolbar[TOOLBAR_MAIN]); |
9 | 2011 } |
2012 else | |
2013 { | |
1810
c3a79dda8ea7
GTK marks several functions as deprecated
Klaus Ethgen <Klaus@Ethgen.de>
parents:
1802
diff
changeset
|
2014 if (!gtk_widget_get_visible(lw->toolbar[TOOLBAR_MAIN])) gtk_widget_show(lw->toolbar[TOOLBAR_MAIN]); |
9 | 2015 } |
2016 } | |
2017 | |
1584
c97dea5d82d7
improved pixel info, changed the menu entry from "Hide" to "Show",
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1582
diff
changeset
|
2018 void layout_info_pixel_set(LayoutWindow *lw, gboolean show) |
1375
08db75ca4713
Display pixel coordinates and rgb - patch by Ruben Stein
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1372
diff
changeset
|
2019 { |
08db75ca4713
Display pixel coordinates and rgb - patch by Ruben Stein
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1372
diff
changeset
|
2020 GtkWidget *frame; |
2185
c14a1d8e6aa4
Trim trailing white spaces on empty lines.
Laurent Monin <zas@norz.org>
parents:
2184
diff
changeset
|
2021 |
1375
08db75ca4713
Display pixel coordinates and rgb - patch by Ruben Stein
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1372
diff
changeset
|
2022 if (!layout_valid(&lw)) return; |
08db75ca4713
Display pixel coordinates and rgb - patch by Ruben Stein
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1372
diff
changeset
|
2023 if (!lw->info_pixel) return; |
08db75ca4713
Display pixel coordinates and rgb - patch by Ruben Stein
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1372
diff
changeset
|
2024 |
1584
c97dea5d82d7
improved pixel info, changed the menu entry from "Hide" to "Show",
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1582
diff
changeset
|
2025 lw->options.show_info_pixel = show; |
1375
08db75ca4713
Display pixel coordinates and rgb - patch by Ruben Stein
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1372
diff
changeset
|
2026 |
08db75ca4713
Display pixel coordinates and rgb - patch by Ruben Stein
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1372
diff
changeset
|
2027 frame = gtk_widget_get_parent(lw->info_pixel); |
1584
c97dea5d82d7
improved pixel info, changed the menu entry from "Hide" to "Show",
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1582
diff
changeset
|
2028 if (!lw->options.show_info_pixel) |
1375
08db75ca4713
Display pixel coordinates and rgb - patch by Ruben Stein
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1372
diff
changeset
|
2029 { |
1584
c97dea5d82d7
improved pixel info, changed the menu entry from "Hide" to "Show",
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1582
diff
changeset
|
2030 gtk_widget_hide(frame); |
1375
08db75ca4713
Display pixel coordinates and rgb - patch by Ruben Stein
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1372
diff
changeset
|
2031 } |
08db75ca4713
Display pixel coordinates and rgb - patch by Ruben Stein
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1372
diff
changeset
|
2032 else |
08db75ca4713
Display pixel coordinates and rgb - patch by Ruben Stein
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1372
diff
changeset
|
2033 { |
1584
c97dea5d82d7
improved pixel info, changed the menu entry from "Hide" to "Show",
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1582
diff
changeset
|
2034 gtk_widget_show(frame); |
1375
08db75ca4713
Display pixel coordinates and rgb - patch by Ruben Stein
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1372
diff
changeset
|
2035 } |
2185
c14a1d8e6aa4
Trim trailing white spaces on empty lines.
Laurent Monin <zas@norz.org>
parents:
2184
diff
changeset
|
2036 |
1584
c97dea5d82d7
improved pixel info, changed the menu entry from "Hide" to "Show",
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1582
diff
changeset
|
2037 g_signal_emit_by_name (lw->image->pr, "update-pixel"); |
1375
08db75ca4713
Display pixel coordinates and rgb - patch by Ruben Stein
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1372
diff
changeset
|
2038 } |
08db75ca4713
Display pixel coordinates and rgb - patch by Ruben Stein
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1372
diff
changeset
|
2039 |
9 | 2040 /* |
2041 *----------------------------------------------------------------------------- | |
1436
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2042 * configuration |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2043 *----------------------------------------------------------------------------- |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2044 */ |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2045 |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2046 #define CONFIG_WINDOW_DEF_WIDTH 600 |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2047 #define CONFIG_WINDOW_DEF_HEIGHT 400 |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2048 |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2049 typedef struct _LayoutConfig LayoutConfig; |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2050 struct _LayoutConfig |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2051 { |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2052 LayoutWindow *lw; |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2053 |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2054 GtkWidget *configwindow; |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2055 GtkWidget *home_path_entry; |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2056 GtkWidget *layout_widget; |
2185
c14a1d8e6aa4
Trim trailing white spaces on empty lines.
Laurent Monin <zas@norz.org>
parents:
2184
diff
changeset
|
2057 |
1436
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2058 LayoutOptions options; |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2059 }; |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2060 |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2061 static gint layout_config_delete_cb(GtkWidget *w, GdkEventAny *event, gpointer data); |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2062 |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2063 static void layout_config_close_cb(GtkWidget *widget, gpointer data) |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2064 { |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2065 LayoutConfig *lc = data; |
2185
c14a1d8e6aa4
Trim trailing white spaces on empty lines.
Laurent Monin <zas@norz.org>
parents:
2184
diff
changeset
|
2066 |
1436
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2067 gtk_widget_destroy(lc->configwindow); |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2068 free_layout_options_content(&lc->options); |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2069 g_free(lc); |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2070 } |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2071 |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2072 static gint layout_config_delete_cb(GtkWidget *w, GdkEventAny *event, gpointer data) |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2073 { |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2074 layout_config_close_cb(w, data); |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2075 return TRUE; |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2076 } |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2077 |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2078 static void layout_config_apply_cb(GtkWidget *widget, gpointer data) |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2079 { |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2080 LayoutConfig *lc = data; |
2185
c14a1d8e6aa4
Trim trailing white spaces on empty lines.
Laurent Monin <zas@norz.org>
parents:
2184
diff
changeset
|
2081 |
1436
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2082 g_free(lc->options.order); |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2083 lc->options.order = layout_config_get(lc->layout_widget, &lc->options.style); |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2084 |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2085 config_entry_to_option(lc->home_path_entry, &lc->options.home_path, remove_trailing_slash); |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2086 |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2087 layout_apply_options(lc->lw, &lc->options); |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2088 } |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2089 |
2412 | 2090 static void layout_config_help_cb(GtkWidget *widget, gpointer data) |
2091 { | |
2092 help_window_show("GuideOptionsLayout.html"); | |
2093 } | |
2094 | |
1436
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2095 static void layout_config_ok_cb(GtkWidget *widget, gpointer data) |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2096 { |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2097 LayoutConfig *lc = data; |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2098 layout_config_apply_cb(widget, lc); |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2099 layout_config_close_cb(widget, lc); |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2100 } |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2101 |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2102 static void home_path_set_current_cb(GtkWidget *widget, gpointer data) |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2103 { |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2104 LayoutConfig *lc = data; |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2105 gtk_entry_set_text(GTK_ENTRY(lc->home_path_entry), layout_get_path(lc->lw)); |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2106 } |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2107 |
1511
ce48bdc8350d
startup path options simplified and moved to layout options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1506
diff
changeset
|
2108 static void startup_path_set_current_cb(GtkWidget *widget, gpointer data) |
ce48bdc8350d
startup path options simplified and moved to layout options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1506
diff
changeset
|
2109 { |
ce48bdc8350d
startup path options simplified and moved to layout options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1506
diff
changeset
|
2110 LayoutConfig *lc = data; |
ce48bdc8350d
startup path options simplified and moved to layout options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1506
diff
changeset
|
2111 lc->options.startup_path = STARTUP_PATH_CURRENT; |
ce48bdc8350d
startup path options simplified and moved to layout options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1506
diff
changeset
|
2112 } |
ce48bdc8350d
startup path options simplified and moved to layout options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1506
diff
changeset
|
2113 |
ce48bdc8350d
startup path options simplified and moved to layout options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1506
diff
changeset
|
2114 static void startup_path_set_last_cb(GtkWidget *widget, gpointer data) |
ce48bdc8350d
startup path options simplified and moved to layout options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1506
diff
changeset
|
2115 { |
ce48bdc8350d
startup path options simplified and moved to layout options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1506
diff
changeset
|
2116 LayoutConfig *lc = data; |
ce48bdc8350d
startup path options simplified and moved to layout options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1506
diff
changeset
|
2117 lc->options.startup_path = STARTUP_PATH_LAST; |
ce48bdc8350d
startup path options simplified and moved to layout options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1506
diff
changeset
|
2118 } |
ce48bdc8350d
startup path options simplified and moved to layout options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1506
diff
changeset
|
2119 |
ce48bdc8350d
startup path options simplified and moved to layout options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1506
diff
changeset
|
2120 static void startup_path_set_home_cb(GtkWidget *widget, gpointer data) |
ce48bdc8350d
startup path options simplified and moved to layout options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1506
diff
changeset
|
2121 { |
ce48bdc8350d
startup path options simplified and moved to layout options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1506
diff
changeset
|
2122 LayoutConfig *lc = data; |
ce48bdc8350d
startup path options simplified and moved to layout options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1506
diff
changeset
|
2123 lc->options.startup_path = STARTUP_PATH_HOME; |
ce48bdc8350d
startup path options simplified and moved to layout options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1506
diff
changeset
|
2124 } |
ce48bdc8350d
startup path options simplified and moved to layout options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1506
diff
changeset
|
2125 |
ce48bdc8350d
startup path options simplified and moved to layout options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1506
diff
changeset
|
2126 |
1436
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2127 /* |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2128 static void layout_config_save_cb(GtkWidget *widget, gpointer data) |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2129 { |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2130 layout_config_apply(); |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2131 save_options(options); |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2132 } |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2133 */ |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2134 |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2135 void layout_show_config_window(LayoutWindow *lw) |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2136 { |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2137 LayoutConfig *lc; |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2138 GtkWidget *win_vbox; |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2139 GtkWidget *hbox; |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2140 GtkWidget *vbox; |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2141 GtkWidget *button; |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2142 GtkWidget *ct_button; |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2143 GtkWidget *group; |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2144 GtkWidget *frame; |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2145 GtkWidget *tabcomp; |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2146 |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2147 lc = g_new0(LayoutConfig, 1); |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2148 lc->lw = lw; |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2149 layout_sync_options_with_current_state(lw); |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2150 copy_layout_options(&lc->options, &lw->options); |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2151 |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2152 lc->configwindow = window_new(GTK_WINDOW_TOPLEVEL, "Layout", PIXBUF_INLINE_ICON_CONFIG, NULL, _("Window options and layout")); |
2909
2e7fd08bfbe4
DEBUG_NAME() function for use with GTKInspector
Colin Clark <colin.clark@cclark.uk>
parents:
2863
diff
changeset
|
2153 DEBUG_NAME(lc->configwindow); |
1436
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2154 gtk_window_set_type_hint(GTK_WINDOW(lc->configwindow), GDK_WINDOW_TYPE_HINT_DIALOG); |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2155 |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2156 g_signal_connect(G_OBJECT(lc->configwindow), "delete_event", |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2157 G_CALLBACK(layout_config_delete_cb), lc); |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2158 |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2159 gtk_window_set_default_size(GTK_WINDOW(lc->configwindow), CONFIG_WINDOW_DEF_WIDTH, CONFIG_WINDOW_DEF_HEIGHT); |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2160 gtk_window_set_resizable(GTK_WINDOW(lc->configwindow), TRUE); |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2161 gtk_container_set_border_width(GTK_CONTAINER(lc->configwindow), PREF_PAD_BORDER); |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2162 |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2163 win_vbox = gtk_vbox_new(FALSE, PREF_PAD_SPACE); |
2909
2e7fd08bfbe4
DEBUG_NAME() function for use with GTKInspector
Colin Clark <colin.clark@cclark.uk>
parents:
2863
diff
changeset
|
2164 DEBUG_NAME(win_vbox); |
1436
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2165 gtk_container_add(GTK_CONTAINER(lc->configwindow), win_vbox); |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2166 gtk_widget_show(win_vbox); |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2167 |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2168 hbox = gtk_hbutton_box_new(); |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2169 gtk_button_box_set_layout(GTK_BUTTON_BOX(hbox), GTK_BUTTONBOX_END); |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2170 gtk_box_set_spacing(GTK_BOX(hbox), PREF_PAD_BUTTON_GAP); |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2171 gtk_box_pack_end(GTK_BOX(win_vbox), hbox, FALSE, FALSE, 0); |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2172 gtk_widget_show(hbox); |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2173 |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2174 button = pref_button_new(NULL, GTK_STOCK_OK, NULL, FALSE, |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2175 G_CALLBACK(layout_config_ok_cb), lc); |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2176 gtk_container_add(GTK_CONTAINER(hbox), button); |
2034
9297985567b5
use accessor functions
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
2021
diff
changeset
|
2177 gtk_widget_set_can_default(button, TRUE); |
1436
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2178 gtk_widget_grab_default(button); |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2179 gtk_widget_show(button); |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2180 |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2181 ct_button = button; |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2182 /* |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2183 button = pref_button_new(NULL, GTK_STOCK_SAVE, NULL, FALSE, |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2184 G_CALLBACK(layout_config_save_cb), NULL); |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2185 gtk_container_add(GTK_CONTAINER(hbox), button); |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2186 GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT); |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2187 gtk_widget_show(button); |
2184 | 2188 */ |
2412 | 2189 button = pref_button_new(NULL, GTK_STOCK_HELP, NULL, FALSE, |
2190 G_CALLBACK(layout_config_help_cb), lc); | |
2191 gtk_container_add(GTK_CONTAINER(hbox), button); | |
2192 gtk_widget_set_can_default(button, TRUE); | |
2193 gtk_widget_show(button); | |
2194 | |
1436
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2195 button = pref_button_new(NULL, GTK_STOCK_APPLY, NULL, FALSE, |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2196 G_CALLBACK(layout_config_apply_cb), lc); |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2197 gtk_container_add(GTK_CONTAINER(hbox), button); |
2034
9297985567b5
use accessor functions
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
2021
diff
changeset
|
2198 gtk_widget_set_can_default(button, TRUE); |
1436
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2199 gtk_widget_show(button); |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2200 |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2201 button = pref_button_new(NULL, GTK_STOCK_CANCEL, NULL, FALSE, |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2202 G_CALLBACK(layout_config_close_cb), lc); |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2203 gtk_container_add(GTK_CONTAINER(hbox), button); |
2034
9297985567b5
use accessor functions
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
2021
diff
changeset
|
2204 gtk_widget_set_can_default(button, TRUE); |
1436
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2205 gtk_widget_show(button); |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2206 |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2207 if (!generic_dialog_get_alternative_button_order(lc->configwindow)) |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2208 { |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2209 gtk_box_reorder_child(GTK_BOX(hbox), ct_button, -1); |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2210 } |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2211 |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2212 frame = pref_frame_new(win_vbox, TRUE, NULL, GTK_ORIENTATION_VERTICAL, PREF_PAD_GAP); |
2909
2e7fd08bfbe4
DEBUG_NAME() function for use with GTKInspector
Colin Clark <colin.clark@cclark.uk>
parents:
2863
diff
changeset
|
2213 DEBUG_NAME(frame); |
2185
c14a1d8e6aa4
Trim trailing white spaces on empty lines.
Laurent Monin <zas@norz.org>
parents:
2184
diff
changeset
|
2214 |
1436
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2215 vbox = gtk_vbox_new(FALSE, PREF_PAD_SPACE); |
2909
2e7fd08bfbe4
DEBUG_NAME() function for use with GTKInspector
Colin Clark <colin.clark@cclark.uk>
parents:
2863
diff
changeset
|
2216 DEBUG_NAME(vbox); |
1436
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2217 gtk_container_add(GTK_CONTAINER(frame), vbox); |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2218 gtk_widget_show(vbox); |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2219 |
1511
ce48bdc8350d
startup path options simplified and moved to layout options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1506
diff
changeset
|
2220 |
1436
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2221 group = pref_group_new(vbox, FALSE, _("General options"), GTK_ORIENTATION_VERTICAL); |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2222 |
1511
ce48bdc8350d
startup path options simplified and moved to layout options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1506
diff
changeset
|
2223 pref_label_new(group, _("Home path (empty to use your home directory)")); |
1436
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2224 hbox = pref_box_new(group, FALSE, GTK_ORIENTATION_HORIZONTAL, PREF_PAD_SPACE); |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2225 |
2723
c3417ff92722
Show .icc files when selecting color profiles
Colin Clark <colin.clark@cclark.uk>
parents:
2670
diff
changeset
|
2226 tabcomp = tab_completion_new(&lc->home_path_entry, lc->options.home_path, NULL, NULL, NULL, NULL); |
1436
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2227 tab_completion_add_select_button(lc->home_path_entry, NULL, TRUE); |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2228 gtk_box_pack_start(GTK_BOX(hbox), tabcomp, TRUE, TRUE, 0); |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2229 gtk_widget_show(tabcomp); |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2230 |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2231 button = pref_button_new(hbox, NULL, _("Use current"), FALSE, |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2232 G_CALLBACK(home_path_set_current_cb), lc); |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2233 |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2234 pref_checkbox_new_int(group, _("Show date in directories list view"), |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2235 lc->options.show_directory_date, &lc->options.show_directory_date); |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2236 |
1514
dc14cd399465
added option that simplifies saving of multi-window configurations
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1511
diff
changeset
|
2237 pref_checkbox_new_int(group, _("Exit program when this window is closed"), |
dc14cd399465
added option that simplifies saving of multi-window configurations
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1511
diff
changeset
|
2238 lc->options.exit_on_close, &lc->options.exit_on_close); |
dc14cd399465
added option that simplifies saving of multi-window configurations
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1511
diff
changeset
|
2239 |
1511
ce48bdc8350d
startup path options simplified and moved to layout options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1506
diff
changeset
|
2240 group = pref_group_new(vbox, FALSE, _("Start-up directory:"), GTK_ORIENTATION_VERTICAL); |
ce48bdc8350d
startup path options simplified and moved to layout options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1506
diff
changeset
|
2241 |
ce48bdc8350d
startup path options simplified and moved to layout options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1506
diff
changeset
|
2242 button = pref_radiobutton_new(group, NULL, _("No change"), |
ce48bdc8350d
startup path options simplified and moved to layout options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1506
diff
changeset
|
2243 (lc->options.startup_path == STARTUP_PATH_CURRENT), |
ce48bdc8350d
startup path options simplified and moved to layout options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1506
diff
changeset
|
2244 G_CALLBACK(startup_path_set_current_cb), lc); |
ce48bdc8350d
startup path options simplified and moved to layout options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1506
diff
changeset
|
2245 button = pref_radiobutton_new(group, button, _("Restore last path"), |
ce48bdc8350d
startup path options simplified and moved to layout options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1506
diff
changeset
|
2246 (lc->options.startup_path == STARTUP_PATH_LAST), |
ce48bdc8350d
startup path options simplified and moved to layout options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1506
diff
changeset
|
2247 G_CALLBACK(startup_path_set_last_cb), lc); |
ce48bdc8350d
startup path options simplified and moved to layout options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1506
diff
changeset
|
2248 button = pref_radiobutton_new(group, button, _("Home path"), |
ce48bdc8350d
startup path options simplified and moved to layout options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1506
diff
changeset
|
2249 (lc->options.startup_path == STARTUP_PATH_HOME), |
ce48bdc8350d
startup path options simplified and moved to layout options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1506
diff
changeset
|
2250 G_CALLBACK(startup_path_set_home_cb), lc); |
ce48bdc8350d
startup path options simplified and moved to layout options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1506
diff
changeset
|
2251 |
1436
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2252 group = pref_group_new(vbox, FALSE, _("Layout"), GTK_ORIENTATION_VERTICAL); |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2253 |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2254 lc->layout_widget = layout_config_new(); |
2909
2e7fd08bfbe4
DEBUG_NAME() function for use with GTKInspector
Colin Clark <colin.clark@cclark.uk>
parents:
2863
diff
changeset
|
2255 DEBUG_NAME(lc->layout_widget); |
1436
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2256 layout_config_set(lc->layout_widget, lw->options.style, lw->options.order); |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2257 gtk_box_pack_start(GTK_BOX(group), lc->layout_widget, TRUE, TRUE, 0); |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2258 |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2259 gtk_widget_show(lc->layout_widget); |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2260 gtk_widget_show(lc->configwindow); |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2261 } |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2262 |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2263 /* |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2264 *----------------------------------------------------------------------------- |
9 | 2265 * base |
2266 *----------------------------------------------------------------------------- | |
2267 */ | |
2268 | |
1309
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
2269 void layout_sync_options_with_current_state(LayoutWindow *lw) |
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
2270 { |
1336
7fe7536f02e1
fixed overlay configuration
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1335
diff
changeset
|
2271 Histogram *histogram; |
1309
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
2272 if (!layout_valid(&lw)) return; |
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
2273 |
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
2274 lw->options.main_window.maximized = window_maximized(lw->window); |
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
2275 if (!lw->options.main_window.maximized) |
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
2276 { |
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
2277 layout_geometry_get(lw, &lw->options.main_window.x, &lw->options.main_window.y, |
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
2278 &lw->options.main_window.w, &lw->options.main_window.h); |
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
2279 } |
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
2280 |
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
2281 layout_geometry_get_dividers(lw, &lw->options.main_window.hdivider_pos, &lw->options.main_window.vdivider_pos); |
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
2282 |
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
2283 // layout_sort_get(NULL, &options->file_sort.method, &options->file_sort.ascending); |
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
2284 |
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
2285 layout_geometry_get_tools(lw, &lw->options.float_window.x, &lw->options.float_window.y, |
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
2286 &lw->options.float_window.w, &lw->options.float_window.h, &lw->options.float_window.vdivider_pos); |
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
2287 |
1336
7fe7536f02e1
fixed overlay configuration
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1335
diff
changeset
|
2288 lw->options.image_overlay.state = image_osd_get(lw->image); |
7fe7536f02e1
fixed overlay configuration
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1335
diff
changeset
|
2289 histogram = image_osd_get_histogram(lw->image); |
2185
c14a1d8e6aa4
Trim trailing white spaces on empty lines.
Laurent Monin <zas@norz.org>
parents:
2184
diff
changeset
|
2290 |
1336
7fe7536f02e1
fixed overlay configuration
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1335
diff
changeset
|
2291 lw->options.image_overlay.histogram_channel = histogram->histogram_channel; |
7fe7536f02e1
fixed overlay configuration
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1335
diff
changeset
|
2292 lw->options.image_overlay.histogram_mode = histogram->histogram_mode; |
7fe7536f02e1
fixed overlay configuration
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1335
diff
changeset
|
2293 |
1511
ce48bdc8350d
startup path options simplified and moved to layout options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1506
diff
changeset
|
2294 g_free(lw->options.last_path); |
ce48bdc8350d
startup path options simplified and moved to layout options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1506
diff
changeset
|
2295 lw->options.last_path = g_strdup(layout_get_path(lw)); |
2508
a39331032807
Additional debug features
Colin Clark <colin.clark@cclark.uk>
parents:
2468
diff
changeset
|
2296 |
a39331032807
Additional debug features
Colin Clark <colin.clark@cclark.uk>
parents:
2468
diff
changeset
|
2297 layout_geometry_get_log_window(lw, &lw->options.log_window.x, &lw->options.log_window.y, |
a39331032807
Additional debug features
Colin Clark <colin.clark@cclark.uk>
parents:
2468
diff
changeset
|
2298 &lw->options.log_window.w, &lw->options.log_window.h); |
a39331032807
Additional debug features
Colin Clark <colin.clark@cclark.uk>
parents:
2468
diff
changeset
|
2299 |
1309
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
2300 } |
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
2301 |
1436
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2302 void layout_apply_options(LayoutWindow *lw, LayoutOptions *lop) |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2303 { |
1437 | 2304 gboolean refresh_style; |
2305 gboolean refresh_lists; | |
1436
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2306 |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2307 if (!layout_valid(&lw)) return; |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2308 /* FIXME: add other options too */ |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2309 |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2310 refresh_style = (lop->style != lw->options.style || strcmp(lop->order, lw->options.order) != 0); |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2311 refresh_lists = (lop->show_directory_date != lw->options.show_directory_date); |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2312 |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2313 copy_layout_options(&lw->options, lop); |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2314 |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2315 if (refresh_style) layout_style_set(lw, lw->options.style, lw->options.order); |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2316 if (refresh_lists) layout_refresh(lw); |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2317 } |
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2318 |
1309
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
2319 |
9 | 2320 void layout_close(LayoutWindow *lw) |
2321 { | |
1514
dc14cd399465
added option that simplifies saving of multi-window configurations
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1511
diff
changeset
|
2322 if (!lw->options.exit_on_close && layout_window_list && layout_window_list->next) |
9 | 2323 { |
2324 layout_free(lw); | |
2325 } | |
2326 else | |
2327 { | |
278
79fed35f1650
exit_gqview() renamed to exit_program().
Laurent Monin <geeqie@norz.org>
parents:
273
diff
changeset
|
2328 exit_program(); |
9 | 2329 } |
2330 } | |
2331 | |
2332 void layout_free(LayoutWindow *lw) | |
2333 { | |
1582
f137ec3fd85e
- handle color profile and write metadata buttons on statusbar by ui_manager
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1558
diff
changeset
|
2334 gint i; |
9 | 2335 if (!lw) return; |
2336 | |
2337 layout_window_list = g_list_remove(layout_window_list, lw); | |
1473
0b75150d746c
layout id "_current_" matches the currently active layout window
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1470
diff
changeset
|
2338 if (current_lw == lw) current_lw = NULL; |
9 | 2339 |
1293
6546ca1fea07
separated "normal" and advanced exif, "Normal" exif is now in the
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1291
diff
changeset
|
2340 if (lw->exif_window) g_signal_handlers_disconnect_matched(G_OBJECT(lw->exif_window), G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, lw); |
2185
c14a1d8e6aa4
Trim trailing white spaces on empty lines.
Laurent Monin <zas@norz.org>
parents:
2184
diff
changeset
|
2341 |
9 | 2342 layout_bars_close(lw); |
2343 | |
1470
02f03330d589
do not re-create ui_manager at layout change
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1466
diff
changeset
|
2344 g_object_unref(lw->menu_bar); |
02f03330d589
do not re-create ui_manager at layout change
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1466
diff
changeset
|
2345 g_object_unref(lw->utility_box); |
1582
f137ec3fd85e
- handle color profile and write metadata buttons on statusbar by ui_manager
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1558
diff
changeset
|
2346 |
f137ec3fd85e
- handle color profile and write metadata buttons on statusbar by ui_manager
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1558
diff
changeset
|
2347 for (i = 0; i < TOOLBAR_COUNT; i++) |
f137ec3fd85e
- handle color profile and write metadata buttons on statusbar by ui_manager
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1558
diff
changeset
|
2348 { |
f137ec3fd85e
- handle color profile and write metadata buttons on statusbar by ui_manager
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1558
diff
changeset
|
2349 if (lw->toolbar[i]) g_object_unref(lw->toolbar[i]); |
f137ec3fd85e
- handle color profile and write metadata buttons on statusbar by ui_manager
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1558
diff
changeset
|
2350 } |
2185
c14a1d8e6aa4
Trim trailing white spaces on empty lines.
Laurent Monin <zas@norz.org>
parents:
2184
diff
changeset
|
2351 |
9 | 2352 gtk_widget_destroy(lw->window); |
2185
c14a1d8e6aa4
Trim trailing white spaces on empty lines.
Laurent Monin <zas@norz.org>
parents:
2184
diff
changeset
|
2353 |
837
69915f769f3a
use GtkSizeGroup to control initial size of split images
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
820
diff
changeset
|
2354 if (lw->split_image_sizegroup) g_object_unref(lw->split_image_sizegroup); |
442 | 2355 |
796
d381f4e9e26d
use new notification in layout and layout_image
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
791
diff
changeset
|
2356 file_data_unregister_notify_func(layout_image_notify_cb, lw); |
d381f4e9e26d
use new notification in layout and layout_image
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
791
diff
changeset
|
2357 |
995 | 2358 if (lw->dir_fd) |
791
9ac2f29b065e
realtime file monitor
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
787
diff
changeset
|
2359 { |
9ac2f29b065e
realtime file monitor
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
787
diff
changeset
|
2360 file_data_unregister_real_time_monitor(lw->dir_fd); |
9ac2f29b065e
realtime file monitor
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
787
diff
changeset
|
2361 file_data_unref(lw->dir_fd); |
9ac2f29b065e
realtime file monitor
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
787
diff
changeset
|
2362 } |
9 | 2363 |
1309
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
2364 free_layout_options_content(&lw->options); |
9 | 2365 g_free(lw); |
2366 } | |
2367 | |
1433
12600de4b59a
Use gboolean where applicable, minor cleanup and indentations fixes.
Laurent Monin <geeqie@norz.org>
parents:
1431
diff
changeset
|
2368 static gboolean layout_delete_cb(GtkWidget *widget, GdkEventAny *event, gpointer data) |
9 | 2369 { |
2370 LayoutWindow *lw = data; | |
2371 | |
2372 layout_close(lw); | |
2373 return TRUE; | |
2374 } | |
2375 | |
1309
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
2376 LayoutWindow *layout_new(FileData *dir_fd, LayoutOptions *lop) |
9 | 2377 { |
1309
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
2378 return layout_new_with_geometry(dir_fd, lop, NULL); |
81
e2c85104c1eb
Thu Oct 19 09:35:18 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
41
diff
changeset
|
2379 } |
e2c85104c1eb
Thu Oct 19 09:35:18 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
41
diff
changeset
|
2380 |
1309
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
2381 LayoutWindow *layout_new_with_geometry(FileData *dir_fd, LayoutOptions *lop, |
81
e2c85104c1eb
Thu Oct 19 09:35:18 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
41
diff
changeset
|
2382 const gchar *geometry) |
e2c85104c1eb
Thu Oct 19 09:35:18 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
41
diff
changeset
|
2383 { |
9 | 2384 LayoutWindow *lw; |
81
e2c85104c1eb
Thu Oct 19 09:35:18 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
41
diff
changeset
|
2385 GdkGeometry hint; |
e2c85104c1eb
Thu Oct 19 09:35:18 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
41
diff
changeset
|
2386 GdkWindowHints hint_mask; |
1336
7fe7536f02e1
fixed overlay configuration
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1335
diff
changeset
|
2387 Histogram *histogram; |
9 | 2388 |
1735
d60ff6f78f81
added messages for debugging startup time
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1669
diff
changeset
|
2389 DEBUG_1("%s layout_new: start", get_exec_time()); |
9 | 2390 lw = g_new0(LayoutWindow, 1); |
2391 | |
1309
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
2392 if (lop) |
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
2393 copy_layout_options(&lw->options, lop); |
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
2394 else |
1436
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2395 init_layout_options(&lw->options); |
1309
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
2396 |
9 | 2397 lw->sort_method = SORT_NAME; |
2398 lw->sort_ascend = TRUE; | |
2399 | |
1466
a8a7e7feeefc
added possibility to update existing layout window from config
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1464
diff
changeset
|
2400 layout_set_unique_id(lw); |
1309
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
2401 // lw->options.tools_float = popped; |
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
2402 // lw->options.tools_hidden = hidden; |
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
2403 // lw->bar_sort_enabled = options->panels.sort.enabled; |
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
2404 // lw->bar_enabled = options->panels.info.enabled; |
9 | 2405 |
2406 /* default layout */ | |
2407 | |
1309
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
2408 layout_config_parse(lw->options.style, lw->options.order, |
9 | 2409 &lw->dir_location, &lw->file_location, &lw->image_location); |
2441
a2d4729a3b2d
Fix GCC and Clang compile warnings.
Omari Stephens <xsdg@google.com>
parents:
2412
diff
changeset
|
2410 if (lw->options.dir_view_type > DIRVIEW_LAST) lw->options.dir_view_type = 0; |
a2d4729a3b2d
Fix GCC and Clang compile warnings.
Omari Stephens <xsdg@google.com>
parents:
2412
diff
changeset
|
2411 if (lw->options.file_view_type > FILEVIEW_LAST) lw->options.file_view_type = 0; |
9 | 2412 |
2413 /* divider positions */ | |
2414 | |
1436
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2415 if (!options->save_window_positions) |
9 | 2416 { |
1309
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
2417 lw->options.main_window.hdivider_pos = MAIN_WINDOW_DIV_HPOS; |
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
2418 lw->options.main_window.vdivider_pos = MAIN_WINDOW_DIV_VPOS; |
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
2419 lw->options.float_window.vdivider_pos = MAIN_WINDOW_DIV_VPOS; |
9 | 2420 } |
2421 | |
2422 /* window */ | |
2423 | |
1174
f809d57aed0c
Drop useless wmclass stuff. Gtk will take care of it and as said in the documentation using gtk_window_set_wmclass() is sort of pointless.
Laurent Monin <geeqie@norz.org>
parents:
1167
diff
changeset
|
2424 lw->window = window_new(GTK_WINDOW_TOPLEVEL, GQ_APPNAME_LC, NULL, NULL, NULL); |
2909
2e7fd08bfbe4
DEBUG_NAME() function for use with GTKInspector
Colin Clark <colin.clark@cclark.uk>
parents:
2863
diff
changeset
|
2425 DEBUG_NAME(lw->window); |
9 | 2426 gtk_window_set_resizable(GTK_WINDOW(lw->window), TRUE); |
2427 gtk_container_set_border_width(GTK_CONTAINER(lw->window), 0); | |
2428 | |
1436
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2429 if (options->save_window_positions) |
9 | 2430 { |
81
e2c85104c1eb
Thu Oct 19 09:35:18 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
41
diff
changeset
|
2431 hint_mask = GDK_HINT_USER_POS; |
9 | 2432 } |
2433 else | |
2434 { | |
81
e2c85104c1eb
Thu Oct 19 09:35:18 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
41
diff
changeset
|
2435 hint_mask = 0; |
9 | 2436 } |
2437 | |
81
e2c85104c1eb
Thu Oct 19 09:35:18 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
41
diff
changeset
|
2438 hint.min_width = 32; |
e2c85104c1eb
Thu Oct 19 09:35:18 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
41
diff
changeset
|
2439 hint.min_height = 32; |
e2c85104c1eb
Thu Oct 19 09:35:18 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
41
diff
changeset
|
2440 hint.base_width = 0; |
e2c85104c1eb
Thu Oct 19 09:35:18 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
41
diff
changeset
|
2441 hint.base_height = 0; |
e2c85104c1eb
Thu Oct 19 09:35:18 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
41
diff
changeset
|
2442 gtk_window_set_geometry_hints(GTK_WINDOW(lw->window), NULL, &hint, |
e2c85104c1eb
Thu Oct 19 09:35:18 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
41
diff
changeset
|
2443 GDK_HINT_MIN_SIZE | GDK_HINT_BASE_SIZE | hint_mask); |
9 | 2444 |
1436
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2445 if (options->save_window_positions) |
9 | 2446 { |
1309
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
2447 gtk_window_set_default_size(GTK_WINDOW(lw->window), lw->options.main_window.w, lw->options.main_window.h); |
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
2448 // if (!layout_window_list) |
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
2449 // { |
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
2450 gtk_window_move(GTK_WINDOW(lw->window), lw->options.main_window.x, lw->options.main_window.y); |
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
2451 if (lw->options.main_window.maximized) gtk_window_maximize(GTK_WINDOW(lw->window)); |
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
2452 // } |
9 | 2453 } |
2454 else | |
2455 { | |
2456 gtk_window_set_default_size(GTK_WINDOW(lw->window), MAINWINDOW_DEF_WIDTH, MAINWINDOW_DEF_HEIGHT); | |
2457 } | |
2458 | |
2459 g_signal_connect(G_OBJECT(lw->window), "delete_event", | |
2460 G_CALLBACK(layout_delete_cb), lw); | |
2461 | |
1473
0b75150d746c
layout id "_current_" matches the currently active layout window
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1470
diff
changeset
|
2462 g_signal_connect(G_OBJECT(lw->window), "focus-in-event", |
0b75150d746c
layout id "_current_" matches the currently active layout window
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1470
diff
changeset
|
2463 G_CALLBACK(layout_set_current_cb), lw); |
0b75150d746c
layout id "_current_" matches the currently active layout window
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1470
diff
changeset
|
2464 |
9 | 2465 layout_keyboard_init(lw, lw->window); |
2466 | |
528
c09da8b0fee9
Added LIRC patch written by Matteo Beniamino
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
523
diff
changeset
|
2467 #ifdef HAVE_LIRC |
c09da8b0fee9
Added LIRC patch written by Matteo Beniamino
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
523
diff
changeset
|
2468 layout_image_lirc_init(lw); |
c09da8b0fee9
Added LIRC patch written by Matteo Beniamino
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
523
diff
changeset
|
2469 #endif |
c09da8b0fee9
Added LIRC patch written by Matteo Beniamino
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
523
diff
changeset
|
2470 |
9 | 2471 lw->main_box = gtk_vbox_new(FALSE, 0); |
2909
2e7fd08bfbe4
DEBUG_NAME() function for use with GTKInspector
Colin Clark <colin.clark@cclark.uk>
parents:
2863
diff
changeset
|
2472 DEBUG_NAME(lw->main_box); |
9 | 2473 gtk_container_add(GTK_CONTAINER(lw->window), lw->main_box); |
2474 gtk_widget_show(lw->main_box); | |
2475 | |
2476 layout_grid_setup(lw); | |
1309
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
2477 image_top_window_set_sync(lw->image, (lw->options.tools_float || lw->options.tools_hidden)); |
9 | 2478 |
2479 layout_util_sync(lw); | |
2480 layout_status_update_all(lw); | |
2481 | |
783
0e45ed008a1c
replaced directory path with FileData* dir_fd
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
774
diff
changeset
|
2482 if (dir_fd) |
9 | 2483 { |
783
0e45ed008a1c
replaced directory path with FileData* dir_fd
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
774
diff
changeset
|
2484 layout_set_fd(lw, dir_fd); |
9 | 2485 } |
2486 else | |
2487 { | |
2488 GdkPixbuf *pixbuf; | |
2489 | |
2490 pixbuf = pixbuf_inline(PIXBUF_INLINE_LOGO); | |
2185
c14a1d8e6aa4
Trim trailing white spaces on empty lines.
Laurent Monin <zas@norz.org>
parents:
2184
diff
changeset
|
2491 |
1287
c5be18d985a6
Start with "Fit to window" in "Leave Zoom at previous setting" mode
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1284
diff
changeset
|
2492 /* FIXME: the zoom value set here is the value, which is then copied again and again |
c5be18d985a6
Start with "Fit to window" in "Leave Zoom at previous setting" mode
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1284
diff
changeset
|
2493 in "Leave Zoom at previous setting" mode. This is not ideal. */ |
c5be18d985a6
Start with "Fit to window" in "Leave Zoom at previous setting" mode
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1284
diff
changeset
|
2494 image_change_pixbuf(lw->image, pixbuf, 0.0, FALSE); |
1043
718ab8111f48
Replaced gtk depreceated code.
Petr Ostadal <postadal@suse.cz>
parents:
1029
diff
changeset
|
2495 g_object_unref(pixbuf); |
9 | 2496 } |
2497 | |
81
e2c85104c1eb
Thu Oct 19 09:35:18 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
41
diff
changeset
|
2498 if (geometry) |
e2c85104c1eb
Thu Oct 19 09:35:18 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
41
diff
changeset
|
2499 { |
e2c85104c1eb
Thu Oct 19 09:35:18 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
41
diff
changeset
|
2500 if (!gtk_window_parse_geometry(GTK_WINDOW(lw->window), geometry)) |
e2c85104c1eb
Thu Oct 19 09:35:18 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
41
diff
changeset
|
2501 { |
694
547663d27a70
Sort out log_printf() vs printf_term() mix up.
Laurent Monin <geeqie@norz.org>
parents:
671
diff
changeset
|
2502 log_printf("%s", _("Invalid geometry\n")); |
81
e2c85104c1eb
Thu Oct 19 09:35:18 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
41
diff
changeset
|
2503 } |
e2c85104c1eb
Thu Oct 19 09:35:18 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
41
diff
changeset
|
2504 } |
e2c85104c1eb
Thu Oct 19 09:35:18 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
41
diff
changeset
|
2505 |
9 | 2506 gtk_widget_show(lw->window); |
1309
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
2507 layout_tools_hide(lw, lw->options.tools_hidden); |
9 | 2508 |
1336
7fe7536f02e1
fixed overlay configuration
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1335
diff
changeset
|
2509 image_osd_set(lw->image, lw->options.image_overlay.state); |
7fe7536f02e1
fixed overlay configuration
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1335
diff
changeset
|
2510 histogram = image_osd_get_histogram(lw->image); |
2185
c14a1d8e6aa4
Trim trailing white spaces on empty lines.
Laurent Monin <zas@norz.org>
parents:
2184
diff
changeset
|
2511 |
1336
7fe7536f02e1
fixed overlay configuration
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1335
diff
changeset
|
2512 histogram->histogram_channel = lw->options.image_overlay.histogram_channel; |
7fe7536f02e1
fixed overlay configuration
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1335
diff
changeset
|
2513 histogram->histogram_mode = lw->options.image_overlay.histogram_mode; |
1313
29ff0de0a67e
enabled commandline again
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1309
diff
changeset
|
2514 |
9 | 2515 layout_window_list = g_list_append(layout_window_list, lw); |
2516 | |
796
d381f4e9e26d
use new notification in layout and layout_image
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
791
diff
changeset
|
2517 file_data_register_notify_func(layout_image_notify_cb, lw, NOTIFY_PRIORITY_LOW); |
d381f4e9e26d
use new notification in layout and layout_image
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
791
diff
changeset
|
2518 |
1735
d60ff6f78f81
added messages for debugging startup time
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1669
diff
changeset
|
2519 DEBUG_1("%s layout_new: end", get_exec_time()); |
d60ff6f78f81
added messages for debugging startup time
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1669
diff
changeset
|
2520 |
9 | 2521 return lw; |
2522 } | |
2523 | |
1309
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
2524 void layout_write_attributes(LayoutOptions *layout, GString *outstr, gint indent) |
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
2525 { |
1466
a8a7e7feeefc
added possibility to update existing layout window from config
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1464
diff
changeset
|
2526 WRITE_NL(); WRITE_CHAR(*layout, id); |
a8a7e7feeefc
added possibility to update existing layout window from config
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1464
diff
changeset
|
2527 |
1461
8f4df7710af8
improved config file formatting
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1437
diff
changeset
|
2528 WRITE_NL(); WRITE_INT(*layout, style); |
8f4df7710af8
improved config file formatting
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1437
diff
changeset
|
2529 WRITE_NL(); WRITE_CHAR(*layout, order); |
8f4df7710af8
improved config file formatting
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1437
diff
changeset
|
2530 WRITE_NL(); WRITE_UINT(*layout, dir_view_type); |
8f4df7710af8
improved config file formatting
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1437
diff
changeset
|
2531 WRITE_NL(); WRITE_UINT(*layout, file_view_type); |
8f4df7710af8
improved config file formatting
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1437
diff
changeset
|
2532 WRITE_NL(); WRITE_BOOL(*layout, show_marks); |
2817
e6f95baec8b5
Fix #624: Filter files by shell or regular expression pattern
Colin Clark <colin.clark@cclark.uk>
parents:
2813
diff
changeset
|
2533 WRITE_NL(); WRITE_BOOL(*layout, show_file_filter); |
1461
8f4df7710af8
improved config file formatting
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1437
diff
changeset
|
2534 WRITE_NL(); WRITE_BOOL(*layout, show_thumbnails); |
8f4df7710af8
improved config file formatting
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1437
diff
changeset
|
2535 WRITE_NL(); WRITE_BOOL(*layout, show_directory_date); |
8f4df7710af8
improved config file formatting
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1437
diff
changeset
|
2536 WRITE_NL(); WRITE_CHAR(*layout, home_path); |
1511
ce48bdc8350d
startup path options simplified and moved to layout options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1506
diff
changeset
|
2537 WRITE_NL(); WRITE_CHAR(*layout, last_path); |
ce48bdc8350d
startup path options simplified and moved to layout options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1506
diff
changeset
|
2538 WRITE_NL(); WRITE_UINT(*layout, startup_path); |
1514
dc14cd399465
added option that simplifies saving of multi-window configurations
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1511
diff
changeset
|
2539 WRITE_NL(); WRITE_BOOL(*layout, exit_on_close); |
1309
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
2540 WRITE_SEPARATOR(); |
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
2541 |
1461
8f4df7710af8
improved config file formatting
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1437
diff
changeset
|
2542 WRITE_NL(); WRITE_INT(*layout, main_window.x); |
8f4df7710af8
improved config file formatting
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1437
diff
changeset
|
2543 WRITE_NL(); WRITE_INT(*layout, main_window.y); |
8f4df7710af8
improved config file formatting
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1437
diff
changeset
|
2544 WRITE_NL(); WRITE_INT(*layout, main_window.w); |
8f4df7710af8
improved config file formatting
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1437
diff
changeset
|
2545 WRITE_NL(); WRITE_INT(*layout, main_window.h); |
8f4df7710af8
improved config file formatting
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1437
diff
changeset
|
2546 WRITE_NL(); WRITE_BOOL(*layout, main_window.maximized); |
8f4df7710af8
improved config file formatting
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1437
diff
changeset
|
2547 WRITE_NL(); WRITE_INT(*layout, main_window.hdivider_pos); |
8f4df7710af8
improved config file formatting
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1437
diff
changeset
|
2548 WRITE_NL(); WRITE_INT(*layout, main_window.vdivider_pos); |
1309
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
2549 WRITE_SEPARATOR(); |
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
2550 |
2450
361d89e79d74
Fix #431: Bookmarks (shortcuts) to folders
Colin Clark <cclark@mcb.net>
parents:
2444
diff
changeset
|
2551 WRITE_NL(); WRITE_INT(*layout, folder_window.vdivider_pos); |
361d89e79d74
Fix #431: Bookmarks (shortcuts) to folders
Colin Clark <cclark@mcb.net>
parents:
2444
diff
changeset
|
2552 WRITE_SEPARATOR(); |
361d89e79d74
Fix #431: Bookmarks (shortcuts) to folders
Colin Clark <cclark@mcb.net>
parents:
2444
diff
changeset
|
2553 |
1461
8f4df7710af8
improved config file formatting
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1437
diff
changeset
|
2554 WRITE_NL(); WRITE_INT(*layout, float_window.x); |
8f4df7710af8
improved config file formatting
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1437
diff
changeset
|
2555 WRITE_NL(); WRITE_INT(*layout, float_window.y); |
8f4df7710af8
improved config file formatting
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1437
diff
changeset
|
2556 WRITE_NL(); WRITE_INT(*layout, float_window.w); |
8f4df7710af8
improved config file formatting
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1437
diff
changeset
|
2557 WRITE_NL(); WRITE_INT(*layout, float_window.h); |
8f4df7710af8
improved config file formatting
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1437
diff
changeset
|
2558 WRITE_NL(); WRITE_INT(*layout, float_window.vdivider_pos); |
1309
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
2559 WRITE_SEPARATOR(); |
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
2560 |
1461
8f4df7710af8
improved config file formatting
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1437
diff
changeset
|
2561 WRITE_NL(); WRITE_INT(*layout, properties_window.w); |
8f4df7710af8
improved config file formatting
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1437
diff
changeset
|
2562 WRITE_NL(); WRITE_INT(*layout, properties_window.h); |
1309
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
2563 WRITE_SEPARATOR(); |
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
2564 |
1461
8f4df7710af8
improved config file formatting
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1437
diff
changeset
|
2565 WRITE_NL(); WRITE_BOOL(*layout, tools_float); |
8f4df7710af8
improved config file formatting
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1437
diff
changeset
|
2566 WRITE_NL(); WRITE_BOOL(*layout, tools_hidden); |
1309
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
2567 WRITE_SEPARATOR(); |
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
2568 |
1461
8f4df7710af8
improved config file formatting
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1437
diff
changeset
|
2569 WRITE_NL(); WRITE_BOOL(*layout, toolbar_hidden); |
1584
c97dea5d82d7
improved pixel info, changed the menu entry from "Hide" to "Show",
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1582
diff
changeset
|
2570 WRITE_NL(); WRITE_BOOL(*layout, show_info_pixel); |
2863
4b92a65f8367
Fix #645: Hide Bars cannot be toggled after Geeqie restart
Colin Clark <colin.clark@cclark.uk>
parents:
2817
diff
changeset
|
2571 WRITE_SEPARATOR(); |
4b92a65f8367
Fix #645: Hide Bars cannot be toggled after Geeqie restart
Colin Clark <colin.clark@cclark.uk>
parents:
2817
diff
changeset
|
2572 |
4b92a65f8367
Fix #645: Hide Bars cannot be toggled after Geeqie restart
Colin Clark <colin.clark@cclark.uk>
parents:
2817
diff
changeset
|
2573 WRITE_NL(); WRITE_BOOL(*layout, bars_state.info); |
4b92a65f8367
Fix #645: Hide Bars cannot be toggled after Geeqie restart
Colin Clark <colin.clark@cclark.uk>
parents:
2817
diff
changeset
|
2574 WRITE_NL(); WRITE_BOOL(*layout, bars_state.sort); |
4b92a65f8367
Fix #645: Hide Bars cannot be toggled after Geeqie restart
Colin Clark <colin.clark@cclark.uk>
parents:
2817
diff
changeset
|
2575 WRITE_NL(); WRITE_BOOL(*layout, bars_state.tools_float); |
4b92a65f8367
Fix #645: Hide Bars cannot be toggled after Geeqie restart
Colin Clark <colin.clark@cclark.uk>
parents:
2817
diff
changeset
|
2576 WRITE_NL(); WRITE_BOOL(*layout, bars_state.tools_hidden); |
4b92a65f8367
Fix #645: Hide Bars cannot be toggled after Geeqie restart
Colin Clark <colin.clark@cclark.uk>
parents:
2817
diff
changeset
|
2577 WRITE_NL(); WRITE_BOOL(*layout, bars_state.hidden); |
4b92a65f8367
Fix #645: Hide Bars cannot be toggled after Geeqie restart
Colin Clark <colin.clark@cclark.uk>
parents:
2817
diff
changeset
|
2578 WRITE_SEPARATOR(); |
1461
8f4df7710af8
improved config file formatting
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1437
diff
changeset
|
2579 |
8f4df7710af8
improved config file formatting
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1437
diff
changeset
|
2580 WRITE_NL(); WRITE_UINT(*layout, image_overlay.state); |
8f4df7710af8
improved config file formatting
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1437
diff
changeset
|
2581 WRITE_NL(); WRITE_INT(*layout, image_overlay.histogram_channel); |
8f4df7710af8
improved config file formatting
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1437
diff
changeset
|
2582 WRITE_NL(); WRITE_INT(*layout, image_overlay.histogram_mode); |
2433 | 2583 |
2508
a39331032807
Additional debug features
Colin Clark <colin.clark@cclark.uk>
parents:
2468
diff
changeset
|
2584 WRITE_NL(); WRITE_INT(*layout, log_window.x); |
a39331032807
Additional debug features
Colin Clark <colin.clark@cclark.uk>
parents:
2468
diff
changeset
|
2585 WRITE_NL(); WRITE_INT(*layout, log_window.y); |
a39331032807
Additional debug features
Colin Clark <colin.clark@cclark.uk>
parents:
2468
diff
changeset
|
2586 WRITE_NL(); WRITE_INT(*layout, log_window.w); |
a39331032807
Additional debug features
Colin Clark <colin.clark@cclark.uk>
parents:
2468
diff
changeset
|
2587 WRITE_NL(); WRITE_INT(*layout, log_window.h); |
a39331032807
Additional debug features
Colin Clark <colin.clark@cclark.uk>
parents:
2468
diff
changeset
|
2588 WRITE_SEPARATOR(); |
a39331032807
Additional debug features
Colin Clark <colin.clark@cclark.uk>
parents:
2468
diff
changeset
|
2589 |
2433 | 2590 WRITE_NL(); WRITE_BOOL(*layout, animate); |
1309
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
2591 } |
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
2592 |
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
2593 |
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
2594 void layout_write_config(LayoutWindow *lw, GString *outstr, gint indent) |
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
2595 { |
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
2596 layout_sync_options_with_current_state(lw); |
1461
8f4df7710af8
improved config file formatting
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1437
diff
changeset
|
2597 WRITE_NL(); WRITE_STRING("<layout"); |
1309
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
2598 layout_write_attributes(&lw->options, outstr, indent + 1); |
1461
8f4df7710af8
improved config file formatting
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1437
diff
changeset
|
2599 WRITE_STRING(">"); |
1309
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
2600 |
1320
f1607e105298
improved bar_sort configuration
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1317
diff
changeset
|
2601 bar_sort_write_config(lw->bar_sort, outstr, indent + 1); |
1309
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
2602 bar_write_config(lw->bar, outstr, indent + 1); |
2185
c14a1d8e6aa4
Trim trailing white spaces on empty lines.
Laurent Monin <zas@norz.org>
parents:
2184
diff
changeset
|
2603 |
2670
ec21b78a088c
Fix #543: Size of dialog windows in the GTK3 version is too small
Colin Clark <colin.clark@cclark.uk>
parents:
2623
diff
changeset
|
2604 WRITE_SEPARATOR(); |
ec21b78a088c
Fix #543: Size of dialog windows in the GTK3 version is too small
Colin Clark <colin.clark@cclark.uk>
parents:
2623
diff
changeset
|
2605 generic_dialog_windows_write_config(outstr, indent + 1); |
ec21b78a088c
Fix #543: Size of dialog windows in the GTK3 version is too small
Colin Clark <colin.clark@cclark.uk>
parents:
2623
diff
changeset
|
2606 |
ec21b78a088c
Fix #543: Size of dialog windows in the GTK3 version is too small
Colin Clark <colin.clark@cclark.uk>
parents:
2623
diff
changeset
|
2607 WRITE_SEPARATOR(); |
2623
f5886b8e1968
Fix #444: User-definable toolbar
Colin Clark <colin.clark@cclark.uk>
parents:
2611
diff
changeset
|
2608 layout_toolbar_write_config(lw, TOOLBAR_MAIN, outstr, indent + 1); |
f5886b8e1968
Fix #444: User-definable toolbar
Colin Clark <colin.clark@cclark.uk>
parents:
2611
diff
changeset
|
2609 |
1461
8f4df7710af8
improved config file formatting
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1437
diff
changeset
|
2610 WRITE_NL(); WRITE_STRING("</layout>"); |
1309
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
2611 } |
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
2612 |
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
2613 void layout_load_attributes(LayoutOptions *layout, const gchar **attribute_names, const gchar **attribute_values) |
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
2614 { |
1473
0b75150d746c
layout id "_current_" matches the currently active layout window
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1470
diff
changeset
|
2615 gchar *id = NULL; |
2185
c14a1d8e6aa4
Trim trailing white spaces on empty lines.
Laurent Monin <zas@norz.org>
parents:
2184
diff
changeset
|
2616 |
1309
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
2617 while (*attribute_names) |
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
2618 { |
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
2619 const gchar *option = *attribute_names++; |
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
2620 const gchar *value = *attribute_values++; |
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
2621 |
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
2622 /* layout options */ |
1473
0b75150d746c
layout id "_current_" matches the currently active layout window
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1470
diff
changeset
|
2623 if (READ_CHAR_FULL("id", id)) continue; |
1309
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
2624 |
1315
4f8f11de5c36
Since READ_*() macros are now exported, do not hide
Laurent Monin <geeqie@norz.org>
parents:
1314
diff
changeset
|
2625 if (READ_INT(*layout, style)) continue; |
4f8f11de5c36
Since READ_*() macros are now exported, do not hide
Laurent Monin <geeqie@norz.org>
parents:
1314
diff
changeset
|
2626 if (READ_CHAR(*layout, order)) continue; |
2185
c14a1d8e6aa4
Trim trailing white spaces on empty lines.
Laurent Monin <zas@norz.org>
parents:
2184
diff
changeset
|
2627 |
1315
4f8f11de5c36
Since READ_*() macros are now exported, do not hide
Laurent Monin <geeqie@norz.org>
parents:
1314
diff
changeset
|
2628 if (READ_UINT(*layout, dir_view_type)) continue; |
4f8f11de5c36
Since READ_*() macros are now exported, do not hide
Laurent Monin <geeqie@norz.org>
parents:
1314
diff
changeset
|
2629 if (READ_UINT(*layout, file_view_type)) continue; |
4f8f11de5c36
Since READ_*() macros are now exported, do not hide
Laurent Monin <geeqie@norz.org>
parents:
1314
diff
changeset
|
2630 if (READ_BOOL(*layout, show_marks)) continue; |
2817
e6f95baec8b5
Fix #624: Filter files by shell or regular expression pattern
Colin Clark <colin.clark@cclark.uk>
parents:
2813
diff
changeset
|
2631 if (READ_BOOL(*layout, show_file_filter)) continue; |
1315
4f8f11de5c36
Since READ_*() macros are now exported, do not hide
Laurent Monin <geeqie@norz.org>
parents:
1314
diff
changeset
|
2632 if (READ_BOOL(*layout, show_thumbnails)) continue; |
4f8f11de5c36
Since READ_*() macros are now exported, do not hide
Laurent Monin <geeqie@norz.org>
parents:
1314
diff
changeset
|
2633 if (READ_BOOL(*layout, show_directory_date)) continue; |
4f8f11de5c36
Since READ_*() macros are now exported, do not hide
Laurent Monin <geeqie@norz.org>
parents:
1314
diff
changeset
|
2634 if (READ_CHAR(*layout, home_path)) continue; |
1511
ce48bdc8350d
startup path options simplified and moved to layout options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1506
diff
changeset
|
2635 if (READ_CHAR(*layout, last_path)) continue; |
ce48bdc8350d
startup path options simplified and moved to layout options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1506
diff
changeset
|
2636 if (READ_UINT_CLAMP(*layout, startup_path, 0, STARTUP_PATH_HOME)) continue; |
1514
dc14cd399465
added option that simplifies saving of multi-window configurations
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1511
diff
changeset
|
2637 if (READ_BOOL(*layout, exit_on_close)) continue; |
1309
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
2638 |
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
2639 /* window positions */ |
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
2640 |
1315
4f8f11de5c36
Since READ_*() macros are now exported, do not hide
Laurent Monin <geeqie@norz.org>
parents:
1314
diff
changeset
|
2641 if (READ_INT(*layout, main_window.x)) continue; |
4f8f11de5c36
Since READ_*() macros are now exported, do not hide
Laurent Monin <geeqie@norz.org>
parents:
1314
diff
changeset
|
2642 if (READ_INT(*layout, main_window.y)) continue; |
4f8f11de5c36
Since READ_*() macros are now exported, do not hide
Laurent Monin <geeqie@norz.org>
parents:
1314
diff
changeset
|
2643 if (READ_INT(*layout, main_window.w)) continue; |
4f8f11de5c36
Since READ_*() macros are now exported, do not hide
Laurent Monin <geeqie@norz.org>
parents:
1314
diff
changeset
|
2644 if (READ_INT(*layout, main_window.h)) continue; |
4f8f11de5c36
Since READ_*() macros are now exported, do not hide
Laurent Monin <geeqie@norz.org>
parents:
1314
diff
changeset
|
2645 if (READ_BOOL(*layout, main_window.maximized)) continue; |
4f8f11de5c36
Since READ_*() macros are now exported, do not hide
Laurent Monin <geeqie@norz.org>
parents:
1314
diff
changeset
|
2646 if (READ_INT(*layout, main_window.hdivider_pos)) continue; |
4f8f11de5c36
Since READ_*() macros are now exported, do not hide
Laurent Monin <geeqie@norz.org>
parents:
1314
diff
changeset
|
2647 if (READ_INT(*layout, main_window.vdivider_pos)) continue; |
4f8f11de5c36
Since READ_*() macros are now exported, do not hide
Laurent Monin <geeqie@norz.org>
parents:
1314
diff
changeset
|
2648 |
2450
361d89e79d74
Fix #431: Bookmarks (shortcuts) to folders
Colin Clark <cclark@mcb.net>
parents:
2444
diff
changeset
|
2649 if (READ_INT_CLAMP(*layout, folder_window.vdivider_pos, 1, 1000)) continue; |
361d89e79d74
Fix #431: Bookmarks (shortcuts) to folders
Colin Clark <cclark@mcb.net>
parents:
2444
diff
changeset
|
2650 |
1315
4f8f11de5c36
Since READ_*() macros are now exported, do not hide
Laurent Monin <geeqie@norz.org>
parents:
1314
diff
changeset
|
2651 if (READ_INT(*layout, float_window.x)) continue; |
4f8f11de5c36
Since READ_*() macros are now exported, do not hide
Laurent Monin <geeqie@norz.org>
parents:
1314
diff
changeset
|
2652 if (READ_INT(*layout, float_window.y)) continue; |
4f8f11de5c36
Since READ_*() macros are now exported, do not hide
Laurent Monin <geeqie@norz.org>
parents:
1314
diff
changeset
|
2653 if (READ_INT(*layout, float_window.w)) continue; |
4f8f11de5c36
Since READ_*() macros are now exported, do not hide
Laurent Monin <geeqie@norz.org>
parents:
1314
diff
changeset
|
2654 if (READ_INT(*layout, float_window.h)) continue; |
4f8f11de5c36
Since READ_*() macros are now exported, do not hide
Laurent Monin <geeqie@norz.org>
parents:
1314
diff
changeset
|
2655 if (READ_INT(*layout, float_window.vdivider_pos)) continue; |
2185
c14a1d8e6aa4
Trim trailing white spaces on empty lines.
Laurent Monin <zas@norz.org>
parents:
2184
diff
changeset
|
2656 |
1315
4f8f11de5c36
Since READ_*() macros are now exported, do not hide
Laurent Monin <geeqie@norz.org>
parents:
1314
diff
changeset
|
2657 if (READ_INT(*layout, properties_window.w)) continue; |
4f8f11de5c36
Since READ_*() macros are now exported, do not hide
Laurent Monin <geeqie@norz.org>
parents:
1314
diff
changeset
|
2658 if (READ_INT(*layout, properties_window.h)) continue; |
4f8f11de5c36
Since READ_*() macros are now exported, do not hide
Laurent Monin <geeqie@norz.org>
parents:
1314
diff
changeset
|
2659 |
4f8f11de5c36
Since READ_*() macros are now exported, do not hide
Laurent Monin <geeqie@norz.org>
parents:
1314
diff
changeset
|
2660 if (READ_BOOL(*layout, tools_float)) continue; |
4f8f11de5c36
Since READ_*() macros are now exported, do not hide
Laurent Monin <geeqie@norz.org>
parents:
1314
diff
changeset
|
2661 if (READ_BOOL(*layout, tools_hidden)) continue; |
4f8f11de5c36
Since READ_*() macros are now exported, do not hide
Laurent Monin <geeqie@norz.org>
parents:
1314
diff
changeset
|
2662 if (READ_BOOL(*layout, toolbar_hidden)) continue; |
1584
c97dea5d82d7
improved pixel info, changed the menu entry from "Hide" to "Show",
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1582
diff
changeset
|
2663 if (READ_BOOL(*layout, show_info_pixel)) continue; |
1309
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
2664 |
2863
4b92a65f8367
Fix #645: Hide Bars cannot be toggled after Geeqie restart
Colin Clark <colin.clark@cclark.uk>
parents:
2817
diff
changeset
|
2665 if (READ_BOOL(*layout, bars_state.info)) continue; |
4b92a65f8367
Fix #645: Hide Bars cannot be toggled after Geeqie restart
Colin Clark <colin.clark@cclark.uk>
parents:
2817
diff
changeset
|
2666 if (READ_BOOL(*layout, bars_state.sort)) continue; |
4b92a65f8367
Fix #645: Hide Bars cannot be toggled after Geeqie restart
Colin Clark <colin.clark@cclark.uk>
parents:
2817
diff
changeset
|
2667 if (READ_BOOL(*layout, bars_state.tools_float)) continue; |
4b92a65f8367
Fix #645: Hide Bars cannot be toggled after Geeqie restart
Colin Clark <colin.clark@cclark.uk>
parents:
2817
diff
changeset
|
2668 if (READ_BOOL(*layout, bars_state.tools_hidden)) continue; |
4b92a65f8367
Fix #645: Hide Bars cannot be toggled after Geeqie restart
Colin Clark <colin.clark@cclark.uk>
parents:
2817
diff
changeset
|
2669 if (READ_BOOL(*layout, bars_state.hidden)) continue; |
4b92a65f8367
Fix #645: Hide Bars cannot be toggled after Geeqie restart
Colin Clark <colin.clark@cclark.uk>
parents:
2817
diff
changeset
|
2670 |
1336
7fe7536f02e1
fixed overlay configuration
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1335
diff
changeset
|
2671 if (READ_UINT(*layout, image_overlay.state)) continue; |
7fe7536f02e1
fixed overlay configuration
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1335
diff
changeset
|
2672 if (READ_INT(*layout, image_overlay.histogram_channel)) continue; |
7fe7536f02e1
fixed overlay configuration
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1335
diff
changeset
|
2673 if (READ_INT(*layout, image_overlay.histogram_mode)) continue; |
7fe7536f02e1
fixed overlay configuration
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1335
diff
changeset
|
2674 |
2508
a39331032807
Additional debug features
Colin Clark <colin.clark@cclark.uk>
parents:
2468
diff
changeset
|
2675 if (READ_INT(*layout, log_window.x)) continue; |
a39331032807
Additional debug features
Colin Clark <colin.clark@cclark.uk>
parents:
2468
diff
changeset
|
2676 if (READ_INT(*layout, log_window.y)) continue; |
a39331032807
Additional debug features
Colin Clark <colin.clark@cclark.uk>
parents:
2468
diff
changeset
|
2677 if (READ_INT(*layout, log_window.w)) continue; |
a39331032807
Additional debug features
Colin Clark <colin.clark@cclark.uk>
parents:
2468
diff
changeset
|
2678 if (READ_INT(*layout, log_window.h)) continue; |
a39331032807
Additional debug features
Colin Clark <colin.clark@cclark.uk>
parents:
2468
diff
changeset
|
2679 |
2433 | 2680 if (READ_BOOL(*layout, animate)) continue; |
2681 | |
1464
6c71e4a9d06a
be more verbose on parse errors
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1463
diff
changeset
|
2682 log_printf("unknown attribute %s = %s\n", option, value); |
1309
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
2683 } |
1473
0b75150d746c
layout id "_current_" matches the currently active layout window
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1470
diff
changeset
|
2684 if (id && strcmp(id, LAYOUT_ID_CURRENT) != 0) |
0b75150d746c
layout id "_current_" matches the currently active layout window
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1470
diff
changeset
|
2685 { |
0b75150d746c
layout id "_current_" matches the currently active layout window
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1470
diff
changeset
|
2686 g_free(layout->id); |
0b75150d746c
layout id "_current_" matches the currently active layout window
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1470
diff
changeset
|
2687 layout->id = id; |
0b75150d746c
layout id "_current_" matches the currently active layout window
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1470
diff
changeset
|
2688 } |
0b75150d746c
layout id "_current_" matches the currently active layout window
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1470
diff
changeset
|
2689 else |
0b75150d746c
layout id "_current_" matches the currently active layout window
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1470
diff
changeset
|
2690 { |
0b75150d746c
layout id "_current_" matches the currently active layout window
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1470
diff
changeset
|
2691 g_free(id); |
0b75150d746c
layout id "_current_" matches the currently active layout window
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1470
diff
changeset
|
2692 } |
1309
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
2693 } |
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
2694 |
1511
ce48bdc8350d
startup path options simplified and moved to layout options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1506
diff
changeset
|
2695 static void layout_config_startup_path(LayoutOptions *lop, gchar **path) |
ce48bdc8350d
startup path options simplified and moved to layout options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1506
diff
changeset
|
2696 { |
ce48bdc8350d
startup path options simplified and moved to layout options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1506
diff
changeset
|
2697 switch (lop->startup_path) |
ce48bdc8350d
startup path options simplified and moved to layout options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1506
diff
changeset
|
2698 { |
ce48bdc8350d
startup path options simplified and moved to layout options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1506
diff
changeset
|
2699 case STARTUP_PATH_LAST: |
ce48bdc8350d
startup path options simplified and moved to layout options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1506
diff
changeset
|
2700 *path = (lop->last_path && isdir(lop->last_path)) ? g_strdup(lop->last_path) : get_current_dir(); |
ce48bdc8350d
startup path options simplified and moved to layout options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1506
diff
changeset
|
2701 break; |
ce48bdc8350d
startup path options simplified and moved to layout options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1506
diff
changeset
|
2702 case STARTUP_PATH_HOME: |
ce48bdc8350d
startup path options simplified and moved to layout options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1506
diff
changeset
|
2703 *path = (lop->home_path && isdir(lop->home_path)) ? g_strdup(lop->home_path) : g_strdup(homedir()); |
ce48bdc8350d
startup path options simplified and moved to layout options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1506
diff
changeset
|
2704 break; |
ce48bdc8350d
startup path options simplified and moved to layout options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1506
diff
changeset
|
2705 default: |
ce48bdc8350d
startup path options simplified and moved to layout options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1506
diff
changeset
|
2706 *path = get_current_dir(); |
ce48bdc8350d
startup path options simplified and moved to layout options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1506
diff
changeset
|
2707 break; |
ce48bdc8350d
startup path options simplified and moved to layout options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1506
diff
changeset
|
2708 } |
2184 | 2709 } |
1511
ce48bdc8350d
startup path options simplified and moved to layout options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1506
diff
changeset
|
2710 |
ce48bdc8350d
startup path options simplified and moved to layout options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1506
diff
changeset
|
2711 |
1313
29ff0de0a67e
enabled commandline again
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1309
diff
changeset
|
2712 static void layout_config_commandline(LayoutOptions *lop, gchar **path) |
29ff0de0a67e
enabled commandline again
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1309
diff
changeset
|
2713 { |
29ff0de0a67e
enabled commandline again
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1309
diff
changeset
|
2714 if (command_line->startup_blank) |
29ff0de0a67e
enabled commandline again
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1309
diff
changeset
|
2715 { |
29ff0de0a67e
enabled commandline again
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1309
diff
changeset
|
2716 *path = NULL; |
29ff0de0a67e
enabled commandline again
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1309
diff
changeset
|
2717 } |
29ff0de0a67e
enabled commandline again
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1309
diff
changeset
|
2718 else if (command_line->file) |
29ff0de0a67e
enabled commandline again
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1309
diff
changeset
|
2719 { |
29ff0de0a67e
enabled commandline again
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1309
diff
changeset
|
2720 *path = g_strdup(command_line->file); |
29ff0de0a67e
enabled commandline again
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1309
diff
changeset
|
2721 } |
29ff0de0a67e
enabled commandline again
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1309
diff
changeset
|
2722 else if (command_line->path) |
29ff0de0a67e
enabled commandline again
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1309
diff
changeset
|
2723 { |
29ff0de0a67e
enabled commandline again
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1309
diff
changeset
|
2724 *path = g_strdup(command_line->path); |
29ff0de0a67e
enabled commandline again
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1309
diff
changeset
|
2725 } |
1511
ce48bdc8350d
startup path options simplified and moved to layout options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1506
diff
changeset
|
2726 else layout_config_startup_path(lop, path); |
2185
c14a1d8e6aa4
Trim trailing white spaces on empty lines.
Laurent Monin <zas@norz.org>
parents:
2184
diff
changeset
|
2727 |
1313
29ff0de0a67e
enabled commandline again
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1309
diff
changeset
|
2728 if (command_line->tools_show) |
29ff0de0a67e
enabled commandline again
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1309
diff
changeset
|
2729 { |
29ff0de0a67e
enabled commandline again
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1309
diff
changeset
|
2730 lop->tools_float = FALSE; |
29ff0de0a67e
enabled commandline again
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1309
diff
changeset
|
2731 lop->tools_hidden = FALSE; |
29ff0de0a67e
enabled commandline again
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1309
diff
changeset
|
2732 } |
29ff0de0a67e
enabled commandline again
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1309
diff
changeset
|
2733 else if (command_line->tools_hide) |
29ff0de0a67e
enabled commandline again
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1309
diff
changeset
|
2734 { |
29ff0de0a67e
enabled commandline again
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1309
diff
changeset
|
2735 lop->tools_hidden = TRUE; |
29ff0de0a67e
enabled commandline again
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1309
diff
changeset
|
2736 } |
29ff0de0a67e
enabled commandline again
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1309
diff
changeset
|
2737 } |
29ff0de0a67e
enabled commandline again
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1309
diff
changeset
|
2738 |
29ff0de0a67e
enabled commandline again
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1309
diff
changeset
|
2739 LayoutWindow *layout_new_from_config(const gchar **attribute_names, const gchar **attribute_values, gboolean use_commandline) |
1309
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
2740 { |
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
2741 LayoutOptions lop; |
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
2742 LayoutWindow *lw; |
1313
29ff0de0a67e
enabled commandline again
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1309
diff
changeset
|
2743 gchar *path = NULL; |
2185
c14a1d8e6aa4
Trim trailing white spaces on empty lines.
Laurent Monin <zas@norz.org>
parents:
2184
diff
changeset
|
2744 |
1436
13d61fe760fb
completely separated global and layout window options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
2745 init_layout_options(&lop); |
1309
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
2746 |
1313
29ff0de0a67e
enabled commandline again
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1309
diff
changeset
|
2747 if (attribute_names) layout_load_attributes(&lop, attribute_names, attribute_values); |
2185
c14a1d8e6aa4
Trim trailing white spaces on empty lines.
Laurent Monin <zas@norz.org>
parents:
2184
diff
changeset
|
2748 |
1313
29ff0de0a67e
enabled commandline again
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1309
diff
changeset
|
2749 if (use_commandline) |
29ff0de0a67e
enabled commandline again
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1309
diff
changeset
|
2750 { |
29ff0de0a67e
enabled commandline again
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1309
diff
changeset
|
2751 layout_config_commandline(&lop, &path); |
29ff0de0a67e
enabled commandline again
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1309
diff
changeset
|
2752 } |
2184 | 2753 else |
1313
29ff0de0a67e
enabled commandline again
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1309
diff
changeset
|
2754 { |
1511
ce48bdc8350d
startup path options simplified and moved to layout options
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1506
diff
changeset
|
2755 layout_config_startup_path(&lop, &path); |
1313
29ff0de0a67e
enabled commandline again
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1309
diff
changeset
|
2756 } |
29ff0de0a67e
enabled commandline again
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1309
diff
changeset
|
2757 |
29ff0de0a67e
enabled commandline again
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1309
diff
changeset
|
2758 lw = layout_new_with_geometry(NULL, &lop, use_commandline ? command_line->geometry : NULL); |
1309
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
2759 layout_sort_set(lw, options->file_sort.method, options->file_sort.ascending); |
1313
29ff0de0a67e
enabled commandline again
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1309
diff
changeset
|
2760 layout_set_path(lw, path); |
29ff0de0a67e
enabled commandline again
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1309
diff
changeset
|
2761 |
29ff0de0a67e
enabled commandline again
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1309
diff
changeset
|
2762 if (use_commandline && command_line->startup_full_screen) layout_image_full_screen_start(lw); |
29ff0de0a67e
enabled commandline again
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1309
diff
changeset
|
2763 if (use_commandline && command_line->startup_in_slideshow) layout_image_slideshow_start(lw); |
2508
a39331032807
Additional debug features
Colin Clark <colin.clark@cclark.uk>
parents:
2468
diff
changeset
|
2764 if (use_commandline && command_line->log_window_show) log_window_new(lw); |
1313
29ff0de0a67e
enabled commandline again
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1309
diff
changeset
|
2765 |
29ff0de0a67e
enabled commandline again
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1309
diff
changeset
|
2766 g_free(path); |
1309
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
2767 free_layout_options_content(&lop); |
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
2768 return lw; |
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
2769 } |
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
2770 |
1466
a8a7e7feeefc
added possibility to update existing layout window from config
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1464
diff
changeset
|
2771 void layout_update_from_config(LayoutWindow *lw, const gchar **attribute_names, const gchar **attribute_values) |
a8a7e7feeefc
added possibility to update existing layout window from config
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1464
diff
changeset
|
2772 { |
a8a7e7feeefc
added possibility to update existing layout window from config
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1464
diff
changeset
|
2773 LayoutOptions lop; |
2185
c14a1d8e6aa4
Trim trailing white spaces on empty lines.
Laurent Monin <zas@norz.org>
parents:
2184
diff
changeset
|
2774 |
1466
a8a7e7feeefc
added possibility to update existing layout window from config
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1464
diff
changeset
|
2775 init_layout_options(&lop); |
a8a7e7feeefc
added possibility to update existing layout window from config
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1464
diff
changeset
|
2776 |
a8a7e7feeefc
added possibility to update existing layout window from config
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1464
diff
changeset
|
2777 if (attribute_names) layout_load_attributes(&lop, attribute_names, attribute_values); |
a8a7e7feeefc
added possibility to update existing layout window from config
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1464
diff
changeset
|
2778 |
a8a7e7feeefc
added possibility to update existing layout window from config
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1464
diff
changeset
|
2779 layout_apply_options(lw, &lop); |
2185
c14a1d8e6aa4
Trim trailing white spaces on empty lines.
Laurent Monin <zas@norz.org>
parents:
2184
diff
changeset
|
2780 |
1466
a8a7e7feeefc
added possibility to update existing layout window from config
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1464
diff
changeset
|
2781 free_layout_options_content(&lop); |
a8a7e7feeefc
added possibility to update existing layout window from config
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1464
diff
changeset
|
2782 } |
a8a7e7feeefc
added possibility to update existing layout window from config
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1464
diff
changeset
|
2783 |
1309
d89f8c4d593b
config file format changed to XML
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1301
diff
changeset
|
2784 |
1055
4bbdfab3c89a
Adding a vim modeline to all files - patch by Klaus Ethgen
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1045
diff
changeset
|
2785 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */ |