Merge lp:~elementary-dev-community/pantheon-files/fix-1086929 into lp:~elementary-apps/pantheon-files/trunk
- fix-1086929
- Merge into trunk
Status: | Rejected | ||||
---|---|---|---|---|---|
Rejected by: | Cody Garver | ||||
Proposed branch: | lp:~elementary-dev-community/pantheon-files/fix-1086929 | ||||
Merge into: | lp:~elementary-apps/pantheon-files/trunk | ||||
Diff against target: |
2284 lines (+496/-373) 8 files modified
libcore/gof-directory-async.vala (+76/-46) src/View/ViewContainer.vala (+2/-0) src/fm-columns-view.c (+119/-119) src/fm-directory-view.c (+132/-123) src/fm-directory-view.h (+57/-57) src/gof-window-slot.c (+101/-26) src/gof-window-slot.h (+5/-2) src/marlin-window-columns.c (+4/-0) |
||||
To merge this branch: | bzr merge lp:~elementary-dev-community/pantheon-files/fix-1086929 | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
David Gomes (community) | Needs Fixing | ||
Review via email: mp+183370@code.launchpad.net |
Commit message
Make columns automatically size themselves to fit the longest item contained. Fixes bug #1086929.
Description of the change
By Jeremy Wootten
Make columns automatically size themselves to fit the longest item contained. Fixes bug #1086929.
The first column can't be downsized, for now.
Cody Garver (codygarver) wrote : | # |
Cody Garver (codygarver) wrote : | # |
Trunk is now prepared to receive this branch, pending David "Munchor" Gomes' code review.
David Gomes (davidgomes) wrote : | # |
Diff line 116 - wrong brace opening style.
Add newline after diff line 135, 164.
Diff lines 983-985 - fix alignent, that is, the '"', the '_', the other '"' and 'N' should be in the same column.
Same thing for diff lines 1549 and after, 2022 and after, 2038 and after, 2121 and 2122.
Remove diff line 2151
Cody Garver (codygarver) wrote : | # |
Rejected because it was submitted as a newer branch that did get merged.
Unmerged revisions
- 1270. By Jeremy Wootten
-
Correct some formatting and merge latest trunk
- 1269. By Jeremy Wootten
-
Allow manual shrinking of miller columns (except first)
- 1268. By Jeremy Wootten
-
escape markup text longest filename
- 1267. By Jeremy Wootten
-
Properly autosize cached directories and empty directories, remove unnecessary changes
- 1266. By Jeremy Wootten
-
Merged changes from trunk up to rev 1306
- 1265. By Jeremy Wootten
-
Check in Miller view before calling autosize_slot
- 1264. By Jeremy Wootten
-
Alternative fix 1086929 - for comment
- 1263. By Jeremy Wootten
-
Address issues raised in first review
- 1262. By Jeremy Wootten
-
Merge from trunk
- 1261. By Jeremy Wootten
-
track longest name as required
Preview Diff
1 | === modified file 'libcore/gof-directory-async.vala' | |||
2 | --- libcore/gof-directory-async.vala 2013-06-30 15:49:02 +0000 | |||
3 | +++ libcore/gof-directory-async.vala 2013-09-01 22:36:03 +0000 | |||
4 | @@ -1,16 +1,16 @@ | |||
6 | 1 | /* | 1 | /* |
7 | 2 | * Copyright (C) 2011 Marlin Developers | 2 | * Copyright (C) 2011 Marlin Developers |
9 | 3 | * | 3 | * |
10 | 4 | * This program is free software: you can redistribute it and/or modify | 4 | * This program is free software: you can redistribute it and/or modify |
11 | 5 | * it under the terms of the GNU General Public License as published by | 5 | * it under the terms of the GNU General Public License as published by |
12 | 6 | * the Free Software Foundation, either version 3 of the License, or | 6 | * the Free Software Foundation, either version 3 of the License, or |
13 | 7 | * (at your option) any later version. | 7 | * (at your option) any later version. |
15 | 8 | * | 8 | * |
16 | 9 | * This program is distributed in the hope that it will be useful, | 9 | * This program is distributed in the hope that it will be useful, |
17 | 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
18 | 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
19 | 12 | * GNU General Public License for more details. | 12 | * GNU General Public License for more details. |
21 | 13 | * | 13 | * |
22 | 14 | * You should have received a copy of the GNU General Public License | 14 | * You should have received a copy of the GNU General Public License |
23 | 15 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 15 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
24 | 16 | * | 16 | * |
25 | @@ -29,7 +29,9 @@ | |||
26 | 29 | /* we're looking for particular path keywords like *\/icons* .icons ... */ | 29 | /* we're looking for particular path keywords like *\/icons* .icons ... */ |
27 | 30 | public bool uri_contain_keypath_icons; | 30 | public bool uri_contain_keypath_icons; |
28 | 31 | public int uri_keypath_size = 0; | 31 | public int uri_keypath_size = 0; |
30 | 32 | 32 | public string longest_file_name = ""; //for auto-sizing Miller columns | |
31 | 33 | public bool track_longest_name; | ||
32 | 34 | |||
33 | 33 | public enum State { | 35 | public enum State { |
34 | 34 | NOT_LOADED, | 36 | NOT_LOADED, |
35 | 35 | LOADING, | 37 | LOADING, |
36 | @@ -38,14 +40,14 @@ | |||
37 | 38 | public State state = State.NOT_LOADED; | 40 | public State state = State.NOT_LOADED; |
38 | 39 | 41 | ||
39 | 40 | public HashTable<GLib.File,GOF.File> file_hash; | 42 | public HashTable<GLib.File,GOF.File> file_hash; |
41 | 41 | 43 | ||
42 | 42 | public uint files_count = 0; | 44 | public uint files_count = 0; |
44 | 43 | 45 | ||
45 | 44 | public bool permission_denied = false; | 46 | public bool permission_denied = false; |
46 | 45 | 47 | ||
47 | 46 | private Cancellable cancellable; | 48 | private Cancellable cancellable; |
48 | 47 | private FileMonitor? monitor = null; | 49 | private FileMonitor? monitor = null; |
50 | 48 | 50 | ||
51 | 49 | private List<GOF.File>? sorted_dirs = null; | 51 | private List<GOF.File>? sorted_dirs = null; |
52 | 50 | 52 | ||
53 | 51 | /* signals */ | 53 | /* signals */ |
54 | @@ -77,7 +79,7 @@ | |||
55 | 77 | file = GOF.File.get (location); | 79 | file = GOF.File.get (location); |
56 | 78 | file.exists = true; | 80 | file.exists = true; |
57 | 79 | cancellable = new Cancellable (); | 81 | cancellable = new Cancellable (); |
59 | 80 | 82 | track_longest_name = false; | |
60 | 81 | //query_info_async (file, file_info_available); | 83 | //query_info_async (file, file_info_available); |
61 | 82 | if (file.info == null) | 84 | if (file.info == null) |
62 | 83 | file.query_update (); | 85 | file.query_update (); |
63 | @@ -110,8 +112,8 @@ | |||
64 | 110 | if (is_last) { | 112 | if (is_last) { |
65 | 111 | Async dir = (Async) object; | 113 | Async dir = (Async) object; |
66 | 112 | debug ("Async toggle_ref_notify %s", dir.file.uri); | 114 | debug ("Async toggle_ref_notify %s", dir.file.uri); |
69 | 113 | 115 | ||
70 | 114 | if (!dir.removed_from_cache) | 116 | if (!dir.removed_from_cache) |
71 | 115 | dir.remove_dir_from_cache (); | 117 | dir.remove_dir_from_cache (); |
72 | 116 | dir.remove_toggle_ref ((ToggleNotify) toggle_ref_notify); | 118 | dir.remove_toggle_ref ((ToggleNotify) toggle_ref_notify); |
73 | 117 | } | 119 | } |
74 | @@ -145,9 +147,10 @@ | |||
75 | 145 | public void load () | 147 | public void load () |
76 | 146 | { | 148 | { |
77 | 147 | cancellable.reset (); | 149 | cancellable.reset (); |
78 | 150 | longest_file_name = ""; | ||
79 | 148 | if (state != State.LOADED) { | 151 | if (state != State.LOADED) { |
80 | 149 | /* clear directory info if it's not fully loaded */ | 152 | /* clear directory info if it's not fully loaded */ |
82 | 150 | if (state == State.LOADING) | 153 | if (state == State.LOADING) |
83 | 151 | clear_directory_info (); | 154 | clear_directory_info (); |
84 | 152 | if (!file.is_mounted) { | 155 | if (!file.is_mounted) { |
85 | 153 | mount_mountable.begin (); | 156 | mount_mountable.begin (); |
86 | @@ -160,7 +163,7 @@ | |||
87 | 160 | list_directory.begin (location); | 163 | list_directory.begin (location); |
88 | 161 | try { | 164 | try { |
89 | 162 | monitor = location.monitor_directory (0); | 165 | monitor = location.monitor_directory (0); |
91 | 163 | monitor.changed.connect (directory_changed); | 166 | monitor.changed.connect (directory_changed); |
92 | 164 | } catch (IOError e) { | 167 | } catch (IOError e) { |
93 | 165 | if (!(e is IOError.NOT_MOUNTED)) { | 168 | if (!(e is IOError.NOT_MOUNTED)) { |
94 | 166 | warning ("directory monitor failed: %s %s", e.message, file.uri); | 169 | warning ("directory monitor failed: %s %s", e.message, file.uri); |
95 | @@ -173,32 +176,45 @@ | |||
96 | 173 | /* send again the info_available signal for reused directories */ | 176 | /* send again the info_available signal for reused directories */ |
97 | 174 | if (file.info != null) | 177 | if (file.info != null) |
98 | 175 | file.info_available (); | 178 | file.info_available (); |
100 | 176 | 179 | ||
101 | 177 | bool show_hidden = Preferences.get_default ().pref_show_hidden_files; | 180 | bool show_hidden = Preferences.get_default ().pref_show_hidden_files; |
102 | 178 | foreach (GOF.File gof in file_hash.get_values ()) { | 181 | foreach (GOF.File gof in file_hash.get_values ()) { |
104 | 179 | if (gof.info != null && (!gof.is_hidden || show_hidden)) | 182 | if (gof.info != null && (!gof.is_hidden || show_hidden)) { |
105 | 183 | if (track_longest_name) | ||
106 | 184 | update_longest_file_name (gof); | ||
107 | 180 | file_loaded (gof); | 185 | file_loaded (gof); |
108 | 186 | } | ||
109 | 181 | } | 187 | } |
110 | 182 | done_loading (); | 188 | done_loading (); |
111 | 183 | } | 189 | } |
112 | 184 | } | 190 | } |
113 | 185 | 191 | ||
115 | 186 | public void load_hiddens () | 192 | private void update_longest_file_name (GOF.File gof) |
116 | 193 | { | ||
117 | 194 | if (longest_file_name.length < gof.basename.length) | ||
118 | 195 | longest_file_name = gof.basename; | ||
119 | 196 | } | ||
120 | 197 | |||
121 | 198 | public void load_hiddens () | ||
122 | 187 | { | 199 | { |
123 | 188 | if (state != State.LOADED) { | 200 | if (state != State.LOADED) { |
124 | 189 | load (); | 201 | load (); |
125 | 190 | } else { | 202 | } else { |
128 | 191 | foreach (GOF.File gof in file_hash.get_values ()) { | 203 | foreach (GOF.File gof in file_hash.get_values ()) { |
129 | 192 | if (gof != null && gof.info != null && gof.is_hidden) | 204 | if (gof != null && gof.info != null && gof.is_hidden) { |
130 | 205 | if (track_longest_name) | ||
131 | 206 | update_longest_file_name (gof); | ||
132 | 193 | file_loaded (gof); | 207 | file_loaded (gof); |
133 | 208 | } | ||
134 | 194 | } | 209 | } |
135 | 195 | } | 210 | } |
136 | 211 | done_loading (); | ||
137 | 196 | } | 212 | } |
138 | 197 | 213 | ||
140 | 198 | public void update_desktop_files () | 214 | public void update_desktop_files () |
141 | 199 | { | 215 | { |
142 | 200 | foreach (GOF.File gof in file_hash.get_values ()) { | 216 | foreach (GOF.File gof in file_hash.get_values ()) { |
144 | 201 | if (gof != null && gof.info != null | 217 | if (gof != null && gof.info != null |
145 | 202 | && (!gof.is_hidden || Preferences.get_default ().pref_show_hidden_files) | 218 | && (!gof.is_hidden || Preferences.get_default ().pref_show_hidden_files) |
146 | 203 | && gof.is_desktop) | 219 | && gof.is_desktop) |
147 | 204 | gof.update_desktop_file (); | 220 | gof.update_desktop_file (); |
148 | @@ -242,6 +258,7 @@ | |||
149 | 242 | if (files == null) | 258 | if (files == null) |
150 | 243 | break; | 259 | break; |
151 | 244 | 260 | ||
152 | 261 | bool show_hidden = Preferences.get_default ().pref_show_hidden_files; | ||
153 | 245 | foreach (var file_info in files) | 262 | foreach (var file_info in files) |
154 | 246 | { | 263 | { |
155 | 247 | GLib.File loc = location.get_child ((string) file_info.get_name()); | 264 | GLib.File loc = location.get_child ((string) file_info.get_name()); |
156 | @@ -255,14 +272,18 @@ | |||
157 | 255 | //debug ("file: %s", gof.name); | 272 | //debug ("file: %s", gof.name); |
158 | 256 | 273 | ||
159 | 257 | add_to_hash_cache (gof); | 274 | add_to_hash_cache (gof); |
161 | 258 | if (!gof.is_hidden || Preferences.get_default ().pref_show_hidden_files) | 275 | |
162 | 276 | if (!gof.is_hidden || show_hidden) { | ||
163 | 277 | if (track_longest_name) | ||
164 | 278 | update_longest_file_name (gof); | ||
165 | 259 | file_loaded (gof); | 279 | file_loaded (gof); |
167 | 260 | 280 | } | |
168 | 261 | //mutex.lock (); | 281 | //mutex.lock (); |
169 | 262 | files_count++; | 282 | files_count++; |
170 | 263 | //mutex.unlock (); | 283 | //mutex.unlock (); |
171 | 264 | } | 284 | } |
172 | 265 | } | 285 | } |
173 | 286 | |||
174 | 266 | file.exists = true; | 287 | file.exists = true; |
175 | 267 | state = State.LOADED; | 288 | state = State.LOADED; |
176 | 268 | } catch (Error err) { | 289 | } catch (Error err) { |
177 | @@ -294,8 +315,8 @@ | |||
178 | 294 | 315 | ||
179 | 295 | private async void query_info_async (GOF.File gof, func_query_info? f = null) { | 316 | private async void query_info_async (GOF.File gof, func_query_info? f = null) { |
180 | 296 | try { | 317 | try { |
183 | 297 | gof.info = yield gof.location.query_info_async (gio_attrs, | 318 | gof.info = yield gof.location.query_info_async (gio_attrs, |
184 | 298 | FileQueryInfoFlags.NONE, | 319 | FileQueryInfoFlags.NONE, |
185 | 299 | Priority.DEFAULT); | 320 | Priority.DEFAULT); |
186 | 300 | if (f != null) | 321 | if (f != null) |
187 | 301 | f (gof); | 322 | f (gof); |
188 | @@ -329,8 +350,13 @@ | |||
189 | 329 | /* add to sorted_dirs */ | 350 | /* add to sorted_dirs */ |
190 | 330 | sorted_dirs.insert_sorted (gof, GOF.File.compare_by_display_name); | 351 | sorted_dirs.insert_sorted (gof, GOF.File.compare_by_display_name); |
191 | 331 | } | 352 | } |
192 | 353 | |||
193 | 354 | if (track_longest_name && gof.basename.length > longest_file_name.length) { | ||
194 | 355 | longest_file_name = gof.basename; | ||
195 | 356 | done_loading (); | ||
196 | 357 | } | ||
197 | 332 | } | 358 | } |
199 | 333 | 359 | ||
200 | 334 | private void file_info_available (GOF.File gof) { | 360 | private void file_info_available (GOF.File gof) { |
201 | 335 | gof.update (); | 361 | gof.update (); |
202 | 336 | gof.info_available (); | 362 | gof.info_available (); |
203 | @@ -353,6 +379,9 @@ | |||
204 | 353 | sorted_dirs.remove (gof); | 379 | sorted_dirs.remove (gof); |
205 | 354 | } | 380 | } |
206 | 355 | gof.remove_from_caches (); | 381 | gof.remove_from_caches (); |
207 | 382 | if (track_longest_name && gof.basename.length == longest_file_name.length) { | ||
208 | 383 | load (); | ||
209 | 384 | } | ||
210 | 356 | } | 385 | } |
211 | 357 | 386 | ||
212 | 358 | private struct fchanges { | 387 | private struct fchanges { |
213 | @@ -362,7 +391,7 @@ | |||
214 | 362 | private List <fchanges?> list_fchanges = null; | 391 | private List <fchanges?> list_fchanges = null; |
215 | 363 | private uint list_fchanges_count = 0; | 392 | private uint list_fchanges_count = 0; |
216 | 364 | /* number of monitored changes to store after that simply reload the dir */ | 393 | /* number of monitored changes to store after that simply reload the dir */ |
218 | 365 | private const uint FCHANGES_MAX = 20; | 394 | private const uint FCHANGES_MAX = 20; |
219 | 366 | 395 | ||
220 | 367 | private void directory_changed (GLib.File _file, GLib.File? other_file, FileMonitorEvent event) | 396 | private void directory_changed (GLib.File _file, GLib.File? other_file, FileMonitorEvent event) |
221 | 368 | { | 397 | { |
222 | @@ -393,7 +422,7 @@ | |||
223 | 393 | //message ("file added %s", _file.get_uri ()); | 422 | //message ("file added %s", _file.get_uri ()); |
224 | 394 | //notify_file_added (gof); | 423 | //notify_file_added (gof); |
225 | 395 | MarlinFile.changes_queue_file_added (_file); | 424 | MarlinFile.changes_queue_file_added (_file); |
227 | 396 | break; | 425 | break; |
228 | 397 | case FileMonitorEvent.DELETED: | 426 | case FileMonitorEvent.DELETED: |
229 | 398 | //message ("file deleted %s", _file.get_uri ()); | 427 | //message ("file deleted %s", _file.get_uri ()); |
230 | 399 | //notify_file_removed (gof); | 428 | //notify_file_removed (gof); |
231 | @@ -424,7 +453,7 @@ | |||
232 | 424 | foreach (var fchange in list_fchanges) | 453 | foreach (var fchange in list_fchanges) |
233 | 425 | real_directory_changed (fchange.file, null, fchange.event); | 454 | real_directory_changed (fchange.file, null, fchange.event); |
234 | 426 | } | 455 | } |
236 | 427 | } | 456 | } |
237 | 428 | list_fchanges_count = 0; | 457 | list_fchanges_count = 0; |
238 | 429 | list_fchanges = null; | 458 | list_fchanges = null; |
239 | 430 | } | 459 | } |
240 | @@ -435,8 +464,8 @@ | |||
241 | 435 | foreach (var loc in files) { | 464 | foreach (var loc in files) { |
242 | 436 | GOF.File gof = GOF.File.get (loc); | 465 | GOF.File gof = GOF.File.get (loc); |
243 | 437 | Async? dir = cache_lookup (gof.directory); | 466 | Async? dir = cache_lookup (gof.directory); |
246 | 438 | 467 | ||
247 | 439 | if (dir != null) | 468 | if (dir != null) |
248 | 440 | dir.notify_file_changed (gof); | 469 | dir.notify_file_changed (gof); |
249 | 441 | } | 470 | } |
250 | 442 | } | 471 | } |
251 | @@ -446,8 +475,8 @@ | |||
252 | 446 | foreach (var loc in files) { | 475 | foreach (var loc in files) { |
253 | 447 | GOF.File gof = GOF.File.get (loc); | 476 | GOF.File gof = GOF.File.get (loc); |
254 | 448 | Async? dir = cache_lookup (gof.directory); | 477 | Async? dir = cache_lookup (gof.directory); |
257 | 449 | 478 | ||
258 | 450 | if (dir != null) | 479 | if (dir != null) |
259 | 451 | dir.notify_file_added (gof); | 480 | dir.notify_file_added (gof); |
260 | 452 | } | 481 | } |
261 | 453 | } | 482 | } |
262 | @@ -457,7 +486,7 @@ | |||
263 | 457 | foreach (var loc in files) { | 486 | foreach (var loc in files) { |
264 | 458 | GOF.File gof = GOF.File.get (loc); | 487 | GOF.File gof = GOF.File.get (loc); |
265 | 459 | Async? dir = cache_lookup (gof.directory); | 488 | Async? dir = cache_lookup (gof.directory); |
267 | 460 | 489 | ||
268 | 461 | if (dir != null) { | 490 | if (dir != null) { |
269 | 462 | //message ("notify removed %s", gof.uri); | 491 | //message ("notify removed %s", gof.uri); |
270 | 463 | dir.notify_file_removed (gof); | 492 | dir.notify_file_removed (gof); |
271 | @@ -480,7 +509,7 @@ | |||
272 | 480 | { | 509 | { |
273 | 481 | return from_gfile (gof.get_target_location ()); | 510 | return from_gfile (gof.get_target_location ()); |
274 | 482 | } | 511 | } |
276 | 483 | 512 | ||
277 | 484 | public static Async? cache_lookup (GLib.File *file) | 513 | public static Async? cache_lookup (GLib.File *file) |
278 | 485 | { | 514 | { |
279 | 486 | Async? cached_dir = null; | 515 | Async? cached_dir = null; |
280 | @@ -488,7 +517,7 @@ | |||
281 | 488 | if (directory_cache == null) { | 517 | if (directory_cache == null) { |
282 | 489 | directory_cache = new HashTable<GLib.File,GOF.Directory.Async> (GLib.file_hash, GLib.file_equal); | 518 | directory_cache = new HashTable<GLib.File,GOF.Directory.Async> (GLib.file_hash, GLib.file_equal); |
283 | 490 | } | 519 | } |
285 | 491 | 520 | ||
286 | 492 | if (directory_cache != null) | 521 | if (directory_cache != null) |
287 | 493 | cached_dir = directory_cache.lookup (file); | 522 | cached_dir = directory_cache.lookup (file); |
288 | 494 | if (cached_dir != null) { | 523 | if (cached_dir != null) { |
289 | @@ -513,14 +542,14 @@ | |||
290 | 513 | { | 542 | { |
291 | 514 | /* we got to increment the dir ref to remove the toggle_ref */ | 543 | /* we got to increment the dir ref to remove the toggle_ref */ |
292 | 515 | this.ref (); | 544 | this.ref (); |
294 | 516 | 545 | ||
295 | 517 | removed_from_cache = true; | 546 | removed_from_cache = true; |
296 | 518 | return directory_cache.remove (location); | 547 | return directory_cache.remove (location); |
297 | 519 | } | 548 | } |
299 | 520 | 549 | ||
300 | 521 | public bool purge_dir_from_cache () { | 550 | public bool purge_dir_from_cache () { |
301 | 522 | var removed = remove_dir_from_cache (); | 551 | var removed = remove_dir_from_cache (); |
303 | 523 | 552 | ||
304 | 524 | /* We have to remove the dir's subfolders from cache too */ | 553 | /* We have to remove the dir's subfolders from cache too */ |
305 | 525 | if (removed) { | 554 | if (removed) { |
306 | 526 | foreach (var gfile in file_hash.get_keys ()) { | 555 | foreach (var gfile in file_hash.get_keys ()) { |
307 | @@ -529,15 +558,15 @@ | |||
308 | 529 | dir.remove_dir_from_cache (); | 558 | dir.remove_dir_from_cache (); |
309 | 530 | } | 559 | } |
310 | 531 | } | 560 | } |
312 | 532 | 561 | ||
313 | 533 | return removed; | 562 | return removed; |
314 | 534 | } | 563 | } |
316 | 535 | 564 | ||
317 | 536 | public bool has_parent () | 565 | public bool has_parent () |
318 | 537 | { | 566 | { |
319 | 538 | return (file.directory != null); | 567 | return (file.directory != null); |
320 | 539 | } | 568 | } |
322 | 540 | 569 | ||
323 | 541 | public GLib.File get_parent () | 570 | public GLib.File get_parent () |
324 | 542 | { | 571 | { |
325 | 543 | return file.directory; | 572 | return file.directory; |
326 | @@ -549,7 +578,7 @@ | |||
327 | 549 | 578 | ||
328 | 550 | if (file_hash != null) | 579 | if (file_hash != null) |
329 | 551 | file_hash_count = file_hash.size (); | 580 | file_hash_count = file_hash.size (); |
331 | 552 | 581 | ||
332 | 553 | //debug ("is_empty hash sizes file: %u", file_hash_count); | 582 | //debug ("is_empty hash sizes file: %u", file_hash_count); |
333 | 554 | if (state == State.LOADED && file_hash_count == 0) | 583 | if (state == State.LOADED && file_hash_count == 0) |
334 | 555 | return true; | 584 | return true; |
335 | @@ -566,7 +595,7 @@ | |||
336 | 566 | 595 | ||
337 | 567 | foreach (var gof in file_hash.get_values()) { | 596 | foreach (var gof in file_hash.get_values()) { |
338 | 568 | if (gof.info != null && !gof.is_hidden && gof.is_folder ()) | 597 | if (gof.info != null && !gof.is_hidden && gof.is_folder ()) |
340 | 569 | sorted_dirs.prepend (gof); | 598 | sorted_dirs.prepend (gof); |
341 | 570 | } | 599 | } |
342 | 571 | sorted_dirs.sort (GOF.File.compare_by_display_name); | 600 | sorted_dirs.sort (GOF.File.compare_by_display_name); |
343 | 572 | 601 | ||
344 | @@ -600,12 +629,13 @@ | |||
345 | 600 | } | 629 | } |
346 | 601 | thumbs_loaded (); | 630 | thumbs_loaded (); |
347 | 602 | thumbs_thread_runing = false; | 631 | thumbs_thread_runing = false; |
349 | 603 | 632 | ||
350 | 604 | this.unref (); | 633 | this.unref (); |
351 | 605 | return null; | 634 | return null; |
352 | 606 | } | 635 | } |
353 | 607 | 636 | ||
355 | 608 | private int icon_size; | 637 | public int icon_size; |
356 | 638 | |||
357 | 609 | public void threaded_load_thumbnails (int size) | 639 | public void threaded_load_thumbnails (int size) |
358 | 610 | { | 640 | { |
359 | 611 | try { | 641 | try { |
360 | @@ -641,7 +671,7 @@ | |||
361 | 641 | timeout_thumbsq = Timeout.add (40, queue_thumbs_timeout_cb); | 671 | timeout_thumbsq = Timeout.add (40, queue_thumbs_timeout_cb); |
362 | 642 | } | 672 | } |
363 | 643 | } | 673 | } |
365 | 644 | 674 | ||
366 | 645 | private Regex regex_num_size = null; | 675 | private Regex regex_num_size = null; |
367 | 646 | 676 | ||
368 | 647 | private void get_keypath_size () | 677 | private void get_keypath_size () |
369 | 648 | 678 | ||
370 | === modified file 'src/View/ViewContainer.vala' | |||
371 | --- src/View/ViewContainer.vala 2013-06-14 23:37:29 +0000 | |||
372 | +++ src/View/ViewContainer.vala 2013-09-01 22:36:03 +0000 | |||
373 | @@ -204,8 +204,10 @@ | |||
374 | 204 | select_childs.prepend (slot.directory.file.location); | 204 | select_childs.prepend (slot.directory.file.location); |
375 | 205 | } | 205 | } |
376 | 206 | } | 206 | } |
377 | 207 | |||
378 | 207 | if (slot != null && slot.directory != null && slot.directory.file.exists) { | 208 | if (slot != null && slot.directory != null && slot.directory.file.exists) { |
379 | 208 | slot.directory.cancel(); | 209 | slot.directory.cancel(); |
380 | 210 | slot.directory.track_longest_name = false; | ||
381 | 209 | } | 211 | } |
382 | 210 | 212 | ||
383 | 211 | if (nview == ViewMode.MILLER) { | 213 | if (nview == ViewMode.MILLER) { |
384 | 212 | 214 | ||
385 | === modified file 'src/fm-columns-view.c' | |||
386 | --- src/fm-columns-view.c 2013-08-01 21:24:46 +0000 | |||
387 | +++ src/fm-columns-view.c 2013-09-01 22:36:03 +0000 | |||
388 | @@ -73,17 +73,17 @@ | |||
389 | 73 | static gboolean fm_columns_view_draw(GtkWidget* view_, cairo_t* cr, FMColumnsView* view) | 73 | static gboolean fm_columns_view_draw(GtkWidget* view_, cairo_t* cr, FMColumnsView* view) |
390 | 74 | { | 74 | { |
391 | 75 | g_return_val_if_fail(FM_IS_COLUMNS_VIEW(view), FALSE); | 75 | g_return_val_if_fail(FM_IS_COLUMNS_VIEW(view), FALSE); |
393 | 76 | 76 | ||
394 | 77 | GOFDirectoryAsync *dir = fm_directory_view_get_current_directory (FM_DIRECTORY_VIEW (view)); | 77 | GOFDirectoryAsync *dir = fm_directory_view_get_current_directory (FM_DIRECTORY_VIEW (view)); |
395 | 78 | 78 | ||
396 | 79 | if (gof_directory_async_is_empty (dir)) | 79 | if (gof_directory_async_is_empty (dir)) |
397 | 80 | { | 80 | { |
398 | 81 | PangoLayout* layout = gtk_widget_create_pango_layout(GTK_WIDGET(view), NULL); | 81 | PangoLayout* layout = gtk_widget_create_pango_layout(GTK_WIDGET(view), NULL); |
402 | 82 | gchar *str = g_strconcat("<span size='x-large'>", _("This folder is empty."), "</span>", NULL); | 82 | //gchar *str = g_strconcat("<span size='x-large'>", _("This folder is empty."), "</span>", NULL); |
403 | 83 | pango_layout_set_markup (layout, str, -1); | 83 | //const gchar *str = FM_DIRECTORY_VIEW (view)->empty_message; |
404 | 84 | 84 | pango_layout_set_markup (layout, FM_DIRECTORY_VIEW (view)->empty_message, -1); | |
405 | 85 | PangoRectangle extents; | 85 | PangoRectangle extents; |
407 | 86 | /* Get hayout height and width */ | 86 | /* Get layout height and width */ |
408 | 87 | pango_layout_get_extents(layout, NULL, &extents); | 87 | pango_layout_get_extents(layout, NULL, &extents); |
409 | 88 | gdouble width = pango_units_to_double(extents.width); | 88 | gdouble width = pango_units_to_double(extents.width); |
410 | 89 | gdouble height = pango_units_to_double(extents.height); | 89 | gdouble height = pango_units_to_double(extents.height); |
411 | @@ -118,7 +118,7 @@ | |||
412 | 118 | /* don't update column if we got a drag_begin started */ | 118 | /* don't update column if we got a drag_begin started */ |
413 | 119 | if (fm_directory_view_is_drag_pending (FM_DIRECTORY_VIEW (view))) | 119 | if (fm_directory_view_is_drag_pending (FM_DIRECTORY_VIEW (view))) |
414 | 120 | return; | 120 | return; |
416 | 121 | 121 | ||
417 | 122 | /* setup the current active slot */ | 122 | /* setup the current active slot */ |
418 | 123 | fm_directory_view_set_active_slot (FM_DIRECTORY_VIEW (view)); | 123 | fm_directory_view_set_active_slot (FM_DIRECTORY_VIEW (view)); |
419 | 124 | fm_directory_view_notify_selection_changed (FM_DIRECTORY_VIEW (view)); | 124 | fm_directory_view_notify_selection_changed (FM_DIRECTORY_VIEW (view)); |
420 | @@ -148,7 +148,7 @@ | |||
421 | 148 | static void | 148 | static void |
422 | 149 | row_activated_callback (GtkTreeView *treeview, GtkTreeIter *iter, GtkTreePath *path, FMColumnsView *view) | 149 | row_activated_callback (GtkTreeView *treeview, GtkTreeIter *iter, GtkTreePath *path, FMColumnsView *view) |
423 | 150 | { | 150 | { |
425 | 151 | g_message ("%s\n", G_STRFUNC); | 151 | g_debug ("%s\n", G_STRFUNC); |
426 | 152 | fm_directory_view_activate_selected_items (FM_DIRECTORY_VIEW (view), MARLIN_WINDOW_OPEN_FLAG_NEW_TAB); | 152 | fm_directory_view_activate_selected_items (FM_DIRECTORY_VIEW (view), MARLIN_WINDOW_OPEN_FLAG_NEW_TAB); |
427 | 153 | } | 153 | } |
428 | 154 | 154 | ||
429 | @@ -156,18 +156,18 @@ | |||
430 | 156 | fm_columns_view_freeze_updates (FMColumnsView *view) | 156 | fm_columns_view_freeze_updates (FMColumnsView *view) |
431 | 157 | { | 157 | { |
432 | 158 | /* Make filename-cells editable. */ | 158 | /* Make filename-cells editable. */ |
434 | 159 | g_object_set (G_OBJECT (view->details->file_name_cell), | 159 | g_object_set (G_OBJECT (view->details->file_name_cell), |
435 | 160 | "editable", TRUE, NULL); | 160 | "editable", TRUE, NULL); |
437 | 161 | fm_directory_view_freeze_updates (FM_DIRECTORY_VIEW (view)); | 161 | fm_directory_view_freeze_updates (FM_DIRECTORY_VIEW (view)); |
438 | 162 | } | 162 | } |
439 | 163 | 163 | ||
440 | 164 | static void | 164 | static void |
441 | 165 | fm_columns_view_unfreeze_updates (FMColumnsView *view) | 165 | fm_columns_view_unfreeze_updates (FMColumnsView *view) |
442 | 166 | { | 166 | { |
443 | 167 | /*We're done editing - make the filename-cells readonly again.*/ | 167 | /*We're done editing - make the filename-cells readonly again.*/ |
445 | 168 | g_object_set (G_OBJECT (view->details->file_name_cell), | 168 | g_object_set (G_OBJECT (view->details->file_name_cell), |
446 | 169 | "editable", FALSE, NULL); | 169 | "editable", FALSE, NULL); |
448 | 170 | fm_directory_view_unfreeze_updates (FM_DIRECTORY_VIEW (view)); | 170 | fm_directory_view_unfreeze_updates (FM_DIRECTORY_VIEW (view)); |
449 | 171 | } | 171 | } |
450 | 172 | 172 | ||
451 | 173 | static void | 173 | static void |
452 | @@ -176,32 +176,32 @@ | |||
453 | 176 | GError *error, | 176 | GError *error, |
454 | 177 | gpointer callback_data) | 177 | gpointer callback_data) |
455 | 178 | { | 178 | { |
457 | 179 | FMColumnsView *view = FM_COLUMNS_VIEW (callback_data); | 179 | FMColumnsView *view = FM_COLUMNS_VIEW (callback_data); |
458 | 180 | 180 | ||
459 | 181 | printf ("%s\n", G_STRFUNC); | 181 | printf ("%s\n", G_STRFUNC); |
464 | 182 | if (view->details->renaming_file) { | 182 | if (view->details->renaming_file) { |
465 | 183 | view->details->rename_done = TRUE; | 183 | view->details->rename_done = TRUE; |
466 | 184 | 184 | ||
467 | 185 | if (error != NULL) { | 185 | if (error != NULL) { |
468 | 186 | marlin_dialogs_show_error (GTK_WIDGET (view), error, _("Failed to rename %s to %s"), g_file_info_get_name (file->info), view->details->original_name); | 186 | marlin_dialogs_show_error (GTK_WIDGET (view), error, _("Failed to rename %s to %s"), g_file_info_get_name (file->info), view->details->original_name); |
473 | 187 | /* If the rename failed (or was cancelled), kill renaming_file. | 187 | /* If the rename failed (or was cancelled), kill renaming_file. |
474 | 188 | * We won't get a change event for the rename, so otherwise | 188 | * We won't get a change event for the rename, so otherwise |
475 | 189 | * it would stay around forever. | 189 | * it would stay around forever. |
476 | 190 | */ | 190 | */ |
477 | 191 | g_object_unref (view->details->renaming_file); | 191 | g_object_unref (view->details->renaming_file); |
482 | 192 | } | 192 | } |
483 | 193 | } | 193 | } |
484 | 194 | 194 | ||
485 | 195 | g_object_unref (view); | 195 | g_object_unref (view); |
486 | 196 | } | 196 | } |
487 | 197 | 197 | ||
488 | 198 | static void | 198 | static void |
489 | 199 | editable_focus_out_cb (GtkWidget *widget, GdkEvent *event, gpointer user_data) | 199 | editable_focus_out_cb (GtkWidget *widget, GdkEvent *event, gpointer user_data) |
490 | 200 | { | 200 | { |
492 | 201 | FMColumnsView *view = user_data; | 201 | FMColumnsView *view = user_data; |
493 | 202 | 202 | ||
496 | 203 | fm_columns_view_unfreeze_updates (view); | 203 | fm_columns_view_unfreeze_updates (view); |
497 | 204 | view->details->editable_widget = NULL; | 204 | view->details->editable_widget = NULL; |
498 | 205 | } | 205 | } |
499 | 206 | 206 | ||
500 | 207 | static void | 207 | static void |
501 | @@ -210,17 +210,17 @@ | |||
502 | 210 | const gchar *path_str, | 210 | const gchar *path_str, |
503 | 211 | FMColumnsView *col_view) | 211 | FMColumnsView *col_view) |
504 | 212 | { | 212 | { |
516 | 213 | GtkEntry *entry; | 213 | GtkEntry *entry; |
517 | 214 | 214 | ||
518 | 215 | entry = GTK_ENTRY (editable); | 215 | entry = GTK_ENTRY (editable); |
519 | 216 | col_view->details->editable_widget = editable; | 216 | col_view->details->editable_widget = editable; |
520 | 217 | 217 | ||
521 | 218 | /* Free a previously allocated original_name */ | 218 | /* Free a previously allocated original_name */ |
522 | 219 | g_free (col_view->details->original_name); | 219 | g_free (col_view->details->original_name); |
523 | 220 | 220 | ||
524 | 221 | col_view->details->original_name = g_strdup (gtk_entry_get_text (entry)); | 221 | col_view->details->original_name = g_strdup (gtk_entry_get_text (entry)); |
525 | 222 | 222 | ||
526 | 223 | g_signal_connect (entry, "focus-out-event", | 223 | g_signal_connect (entry, "focus-out-event", |
527 | 224 | G_CALLBACK (editable_focus_out_cb), col_view); | 224 | G_CALLBACK (editable_focus_out_cb), col_view); |
528 | 225 | } | 225 | } |
529 | 226 | 226 | ||
530 | @@ -228,8 +228,8 @@ | |||
531 | 228 | cell_renderer_editing_canceled (GtkCellRendererText *cell, | 228 | cell_renderer_editing_canceled (GtkCellRendererText *cell, |
532 | 229 | FMColumnsView *view) | 229 | FMColumnsView *view) |
533 | 230 | { | 230 | { |
536 | 231 | view->details->editable_widget = NULL; | 231 | view->details->editable_widget = NULL; |
537 | 232 | fm_columns_view_unfreeze_updates (view); | 232 | fm_columns_view_unfreeze_updates (view); |
538 | 233 | } | 233 | } |
539 | 234 | 234 | ||
540 | 235 | static void | 235 | static void |
541 | @@ -238,43 +238,43 @@ | |||
542 | 238 | const char *new_text, | 238 | const char *new_text, |
543 | 239 | FMColumnsView *view) | 239 | FMColumnsView *view) |
544 | 240 | { | 240 | { |
548 | 241 | GtkTreePath *path; | 241 | GtkTreePath *path; |
549 | 242 | GOFFile *file; | 242 | GOFFile *file; |
550 | 243 | GtkTreeIter iter; | 243 | GtkTreeIter iter; |
551 | 244 | 244 | ||
552 | 245 | printf ("%s\n", G_STRFUNC); | 245 | printf ("%s\n", G_STRFUNC); |
570 | 246 | view->details->editable_widget = NULL; | 246 | view->details->editable_widget = NULL; |
571 | 247 | 247 | ||
572 | 248 | /* Don't allow a rename with an empty string. Revert to original | 248 | /* Don't allow a rename with an empty string. Revert to original |
573 | 249 | * without notifying the user. | 249 | * without notifying the user. |
574 | 250 | */ | 250 | */ |
575 | 251 | if (new_text[0] == '\0') { | 251 | if (new_text[0] == '\0') { |
576 | 252 | fm_columns_view_unfreeze_updates (view); | 252 | fm_columns_view_unfreeze_updates (view); |
577 | 253 | return; | 253 | return; |
578 | 254 | } | 254 | } |
579 | 255 | 255 | ||
580 | 256 | path = gtk_tree_path_new_from_string (path_str); | 256 | path = gtk_tree_path_new_from_string (path_str); |
581 | 257 | 257 | ||
582 | 258 | gtk_tree_model_get_iter (GTK_TREE_MODEL (view->model), &iter, path); | 258 | gtk_tree_model_get_iter (GTK_TREE_MODEL (view->model), &iter, path); |
583 | 259 | 259 | ||
584 | 260 | gtk_tree_path_free (path); | 260 | gtk_tree_path_free (path); |
585 | 261 | 261 | ||
586 | 262 | gtk_tree_model_get (GTK_TREE_MODEL (view->model), &iter, | 262 | gtk_tree_model_get (GTK_TREE_MODEL (view->model), &iter, |
587 | 263 | FM_LIST_MODEL_FILE_COLUMN, &file, -1); | 263 | FM_LIST_MODEL_FILE_COLUMN, &file, -1); |
588 | 264 | 264 | ||
602 | 265 | /* Only rename if name actually changed */ | 265 | /* Only rename if name actually changed */ |
603 | 266 | if (strcmp (new_text, view->details->original_name) != 0) { | 266 | if (strcmp (new_text, view->details->original_name) != 0) { |
604 | 267 | view->details->renaming_file = gof_file_ref (file); | 267 | view->details->renaming_file = gof_file_ref (file); |
605 | 268 | view->details->rename_done = FALSE; | 268 | view->details->rename_done = FALSE; |
606 | 269 | gof_file_rename (file, new_text, fm_columns_view_rename_callback, g_object_ref (view)); | 269 | gof_file_rename (file, new_text, fm_columns_view_rename_callback, g_object_ref (view)); |
607 | 270 | 270 | ||
608 | 271 | g_free (view->details->original_name); | 271 | g_free (view->details->original_name); |
609 | 272 | view->details->original_name = g_strdup (new_text); | 272 | view->details->original_name = g_strdup (new_text); |
610 | 273 | } | 273 | } |
611 | 274 | 274 | ||
612 | 275 | gof_file_unref (file); | 275 | gof_file_unref (file); |
613 | 276 | 276 | ||
614 | 277 | fm_columns_view_unfreeze_updates (view); | 277 | fm_columns_view_unfreeze_updates (view); |
615 | 278 | } | 278 | } |
616 | 279 | 279 | ||
617 | 280 | static void | 280 | static void |
618 | @@ -282,35 +282,35 @@ | |||
619 | 282 | GOFFile *file, | 282 | GOFFile *file, |
620 | 283 | gboolean select_all) | 283 | gboolean select_all) |
621 | 284 | { | 284 | { |
633 | 285 | FMColumnsView *col_view; | 285 | FMColumnsView *col_view; |
634 | 286 | GtkTreeIter iter; | 286 | GtkTreeIter iter; |
635 | 287 | GtkTreePath *path; | 287 | GtkTreePath *path; |
636 | 288 | gint start_offset, end_offset; | 288 | gint start_offset, end_offset; |
637 | 289 | 289 | ||
638 | 290 | col_view = FM_COLUMNS_VIEW (view); | 290 | col_view = FM_COLUMNS_VIEW (view); |
639 | 291 | 291 | ||
640 | 292 | g_message ("%s", G_STRFUNC); | 292 | g_debug ("%s", G_STRFUNC); |
641 | 293 | /* Select all if we are in renaming mode already */ | 293 | /* Select all if we are in renaming mode already */ |
642 | 294 | if (col_view->details->file_name_column && col_view->details->editable_widget) { | 294 | if (col_view->details->file_name_column && col_view->details->editable_widget) { |
643 | 295 | gtk_editable_select_region (GTK_EDITABLE (col_view->details->editable_widget), | 295 | gtk_editable_select_region (GTK_EDITABLE (col_view->details->editable_widget), |
644 | 296 | 0, -1); | 296 | 0, -1); |
658 | 297 | return; | 297 | return; |
659 | 298 | } | 298 | } |
660 | 299 | 299 | ||
661 | 300 | if (!fm_list_model_get_first_iter_for_file (col_view->model, file, &iter)) { | 300 | if (!fm_list_model_get_first_iter_for_file (col_view->model, file, &iter)) { |
662 | 301 | return; | 301 | return; |
663 | 302 | } | 302 | } |
664 | 303 | 303 | ||
665 | 304 | /* Freeze updates to the view to prevent losing rename focus when the tree view updates */ | 304 | /* Freeze updates to the view to prevent losing rename focus when the tree view updates */ |
666 | 305 | fm_columns_view_freeze_updates (col_view); | 305 | fm_columns_view_freeze_updates (col_view); |
667 | 306 | 306 | ||
668 | 307 | path = gtk_tree_model_get_path (GTK_TREE_MODEL (col_view->model), &iter); | 307 | path = gtk_tree_model_get_path (GTK_TREE_MODEL (col_view->model), &iter); |
669 | 308 | 308 | ||
670 | 309 | gtk_tree_view_scroll_to_cell (col_view->tree, NULL, | 309 | gtk_tree_view_scroll_to_cell (col_view->tree, NULL, |
671 | 310 | col_view->details->file_name_column, | 310 | col_view->details->file_name_column, |
672 | 311 | TRUE, 0.0, 0.0); | 311 | TRUE, 0.0, 0.0); |
675 | 312 | /* set cursor also triggers editing-started, where we save the editable widget */ | 312 | /* set cursor also triggers editing-started, where we save the editable widget */ |
676 | 313 | /*gtk_tree_view_set_cursor (col_view->tree, path, | 313 | /*gtk_tree_view_set_cursor (col_view->tree, path, |
677 | 314 | col_view->details->file_name_column, TRUE);*/ | 314 | col_view->details->file_name_column, TRUE);*/ |
678 | 315 | /* sound like set_cursor is not enought to trigger editing-started, we use cursor_on_cell instead */ | 315 | /* sound like set_cursor is not enought to trigger editing-started, we use cursor_on_cell instead */ |
679 | 316 | gtk_tree_view_set_cursor_on_cell (col_view->tree, path, | 316 | gtk_tree_view_set_cursor_on_cell (col_view->tree, path, |
680 | @@ -318,15 +318,15 @@ | |||
681 | 318 | (GtkCellRenderer *) col_view->details->file_name_cell, | 318 | (GtkCellRenderer *) col_view->details->file_name_cell, |
682 | 319 | TRUE); | 319 | TRUE); |
683 | 320 | 320 | ||
686 | 321 | if (col_view->details->editable_widget != NULL) { | 321 | if (col_view->details->editable_widget != NULL) { |
687 | 322 | eel_filename_get_rename_region (col_view->details->original_name, | 322 | eel_filename_get_rename_region (col_view->details->original_name, |
688 | 323 | &start_offset, &end_offset); | 323 | &start_offset, &end_offset); |
689 | 324 | 324 | ||
691 | 325 | gtk_editable_select_region (GTK_EDITABLE (col_view->details->editable_widget), | 325 | gtk_editable_select_region (GTK_EDITABLE (col_view->details->editable_widget), |
692 | 326 | start_offset, end_offset); | 326 | start_offset, end_offset); |
694 | 327 | } | 327 | } |
695 | 328 | 328 | ||
697 | 329 | gtk_tree_path_free (path); | 329 | gtk_tree_path_free (path); |
698 | 330 | } | 330 | } |
699 | 331 | 331 | ||
700 | 332 | static void fm_columns_view_select_all(FMDirectoryView *view) | 332 | static void fm_columns_view_select_all(FMDirectoryView *view) |
701 | @@ -460,17 +460,17 @@ | |||
702 | 460 | GtkTreeSelection *selection; | 460 | GtkTreeSelection *selection; |
703 | 461 | GtkTreePath *path; | 461 | GtkTreePath *path; |
704 | 462 | 462 | ||
706 | 463 | g_message ("%s", G_STRFUNC); | 463 | g_debug ("%s", G_STRFUNC); |
707 | 464 | if (view->details->pressed_button == event->button && view->details->pressed_button != -1) | 464 | if (view->details->pressed_button == event->button && view->details->pressed_button != -1) |
708 | 465 | { | 465 | { |
709 | 466 | view->details->updates_frozen = FALSE; | 466 | view->details->updates_frozen = FALSE; |
710 | 467 | selection = gtk_tree_view_get_selection (tree_view); | 467 | selection = gtk_tree_view_get_selection (tree_view); |
711 | 468 | list_selection_changed_callback (selection, view); | 468 | list_selection_changed_callback (selection, view); |
713 | 469 | 469 | ||
714 | 470 | /* reset the pressed_button state */ | 470 | /* reset the pressed_button state */ |
715 | 471 | view->details->pressed_button = -1; | 471 | view->details->pressed_button = -1; |
716 | 472 | } | 472 | } |
718 | 473 | 473 | ||
719 | 474 | 474 | ||
720 | 475 | return TRUE; | 475 | return TRUE; |
721 | 476 | } | 476 | } |
722 | @@ -684,7 +684,7 @@ | |||
723 | 684 | } | 684 | } |
724 | 685 | 685 | ||
725 | 686 | static void | 686 | static void |
727 | 687 | fm_columns_view_set_cursor (FMDirectoryView *view, GtkTreePath *path, | 687 | fm_columns_view_set_cursor (FMDirectoryView *view, GtkTreePath *path, |
728 | 688 | gboolean start_editing, gboolean select) | 688 | gboolean start_editing, gboolean select) |
729 | 689 | { | 689 | { |
730 | 690 | FMColumnsView *cols_view = FM_COLUMNS_VIEW (view); | 690 | FMColumnsView *cols_view = FM_COLUMNS_VIEW (view); |
731 | @@ -692,12 +692,12 @@ | |||
732 | 692 | 692 | ||
733 | 693 | /* the treeview select the path by default. */ | 693 | /* the treeview select the path by default. */ |
734 | 694 | g_signal_handlers_block_by_func (selection, list_selection_changed_callback, cols_view); | 694 | g_signal_handlers_block_by_func (selection, list_selection_changed_callback, cols_view); |
736 | 695 | gtk_tree_view_set_cursor_on_cell (cols_view->tree, path, | 695 | gtk_tree_view_set_cursor_on_cell (cols_view->tree, path, |
737 | 696 | cols_view->details->file_name_column, | 696 | cols_view->details->file_name_column, |
738 | 697 | (GtkCellRenderer *) cols_view->details->file_name_cell, | 697 | (GtkCellRenderer *) cols_view->details->file_name_cell, |
739 | 698 | start_editing); | 698 | start_editing); |
740 | 699 | 699 | ||
742 | 700 | if (!select) | 700 | if (!select) |
743 | 701 | gtk_tree_selection_unselect_path (selection, path); | 701 | gtk_tree_selection_unselect_path (selection, path); |
744 | 702 | g_signal_handlers_unblock_by_func (selection, list_selection_changed_callback, cols_view); | 702 | g_signal_handlers_unblock_by_func (selection, list_selection_changed_callback, cols_view); |
745 | 703 | } | 703 | } |
746 | @@ -724,7 +724,7 @@ | |||
747 | 724 | } | 724 | } |
748 | 725 | 725 | ||
749 | 726 | static gboolean | 726 | static gboolean |
751 | 727 | fm_columns_view_get_visible_range (FMDirectoryView *view, | 727 | fm_columns_view_get_visible_range (FMDirectoryView *view, |
752 | 728 | GtkTreePath **start_path, | 728 | GtkTreePath **start_path, |
753 | 729 | GtkTreePath **end_path) | 729 | GtkTreePath **end_path) |
754 | 730 | 730 | ||
755 | @@ -738,7 +738,7 @@ | |||
756 | 738 | fm_columns_view_zoom_normal (FMDirectoryView *view) | 738 | fm_columns_view_zoom_normal (FMDirectoryView *view) |
757 | 739 | { | 739 | { |
758 | 740 | MarlinZoomLevel zoom; | 740 | MarlinZoomLevel zoom; |
760 | 741 | 741 | ||
761 | 742 | zoom = g_settings_get_enum (marlin_column_view_settings, "default-zoom-level"); | 742 | zoom = g_settings_get_enum (marlin_column_view_settings, "default-zoom-level"); |
762 | 743 | g_settings_set_enum (marlin_column_view_settings, "zoom-level", zoom); | 743 | g_settings_set_enum (marlin_column_view_settings, "zoom-level", zoom); |
763 | 744 | } | 744 | } |
764 | @@ -755,7 +755,7 @@ | |||
765 | 755 | gof_file_list_free (view->details->selection); | 755 | gof_file_list_free (view->details->selection); |
766 | 756 | 756 | ||
767 | 757 | g_free (view->details); | 757 | g_free (view->details); |
769 | 758 | G_OBJECT_CLASS (fm_columns_view_parent_class)->finalize (object); | 758 | G_OBJECT_CLASS (fm_columns_view_parent_class)->finalize (object); |
770 | 759 | } | 759 | } |
771 | 760 | 760 | ||
772 | 761 | static void | 761 | static void |
773 | @@ -767,8 +767,8 @@ | |||
774 | 767 | create_and_set_up_tree_view (view); | 767 | create_and_set_up_tree_view (view); |
775 | 768 | 768 | ||
776 | 769 | //fm_columns_view_click_policy_changed (FM_DIRECTORY_VIEW (view)); | 769 | //fm_columns_view_click_policy_changed (FM_DIRECTORY_VIEW (view)); |
779 | 770 | 770 | ||
780 | 771 | g_settings_bind (marlin_column_view_settings, "zoom-level", | 771 | g_settings_bind (marlin_column_view_settings, "zoom-level", |
781 | 772 | view, "zoom-level", 0); | 772 | view, "zoom-level", 0); |
782 | 773 | } | 773 | } |
783 | 774 | 774 | ||
784 | @@ -780,7 +780,7 @@ | |||
785 | 780 | gint xpad, ypad; | 780 | gint xpad, ypad; |
786 | 781 | 781 | ||
787 | 782 | gtk_cell_renderer_get_padding (view->icon_renderer, &xpad, &ypad); | 782 | gtk_cell_renderer_get_padding (view->icon_renderer, &xpad, &ypad); |
789 | 783 | gtk_cell_renderer_set_fixed_size (view->icon_renderer, | 783 | gtk_cell_renderer_set_fixed_size (view->icon_renderer, |
790 | 784 | marlin_zoom_level_to_icon_size (view->zoom_level) + 2 * xpad, | 784 | marlin_zoom_level_to_icon_size (view->zoom_level) + 2 * xpad, |
791 | 785 | marlin_zoom_level_to_icon_size (view->zoom_level) + 2 * ypad); | 785 | marlin_zoom_level_to_icon_size (view->zoom_level) + 2 * ypad); |
792 | 786 | gtk_tree_view_columns_autosize (FM_COLUMNS_VIEW (view)->tree); | 786 | gtk_tree_view_columns_autosize (FM_COLUMNS_VIEW (view)->tree); |
793 | @@ -801,7 +801,7 @@ | |||
794 | 801 | default: | 801 | default: |
795 | 802 | G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); | 802 | G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); |
796 | 803 | break; | 803 | break; |
798 | 804 | } | 804 | } |
799 | 805 | } | 805 | } |
800 | 806 | 806 | ||
801 | 807 | static void | 807 | static void |
802 | @@ -818,7 +818,7 @@ | |||
803 | 818 | default: | 818 | default: |
804 | 819 | G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); | 819 | G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); |
805 | 820 | break; | 820 | break; |
807 | 821 | } | 821 | } |
808 | 822 | } | 822 | } |
809 | 823 | #endif | 823 | #endif |
810 | 824 | 824 | ||
811 | @@ -835,7 +835,7 @@ | |||
812 | 835 | fm_directory_view_class = FM_DIRECTORY_VIEW_CLASS (klass); | 835 | fm_directory_view_class = FM_DIRECTORY_VIEW_CLASS (klass); |
813 | 836 | 836 | ||
814 | 837 | fm_directory_view_class->sync_selection = fm_columns_view_sync_selection; | 837 | fm_directory_view_class->sync_selection = fm_columns_view_sync_selection; |
816 | 838 | fm_directory_view_class->get_selection = fm_columns_view_get_selection; | 838 | fm_directory_view_class->get_selection = fm_columns_view_get_selection; |
817 | 839 | fm_directory_view_class->get_selection_for_file_transfer = fm_columns_view_get_selection_for_file_transfer; | 839 | fm_directory_view_class->get_selection_for_file_transfer = fm_columns_view_get_selection_for_file_transfer; |
818 | 840 | fm_directory_view_class->get_selected_paths = fm_columns_view_get_selected_paths; | 840 | fm_directory_view_class->get_selected_paths = fm_columns_view_get_selected_paths; |
819 | 841 | fm_directory_view_class->select_path = fm_columns_view_select_path; | 841 | fm_directory_view_class->select_path = fm_columns_view_select_path; |
820 | 842 | 842 | ||
821 | === modified file 'src/fm-directory-view.c' | |||
822 | --- src/fm-directory-view.c 2013-08-01 21:24:46 +0000 | |||
823 | +++ src/fm-directory-view.c 2013-09-01 22:36:03 +0000 | |||
824 | @@ -118,7 +118,7 @@ | |||
825 | 118 | guint thumbnail_source_id; | 118 | guint thumbnail_source_id; |
826 | 119 | gboolean thumbnailing_scheduled; | 119 | gboolean thumbnailing_scheduled; |
827 | 120 | 120 | ||
829 | 121 | /* Tree path for restoring the selection after selecting and | 121 | /* Tree path for restoring the selection after selecting and |
830 | 122 | * deleting an item */ | 122 | * deleting an item */ |
831 | 123 | GtkTreePath *selection_before_delete; | 123 | GtkTreePath *selection_before_delete; |
832 | 124 | GOFFile *newly_folder_added; | 124 | GOFFile *newly_folder_added; |
833 | @@ -229,15 +229,14 @@ | |||
834 | 229 | }; | 229 | }; |
835 | 230 | 230 | ||
836 | 231 | static gpointer _g_object_ref0 (gpointer self) { | 231 | static gpointer _g_object_ref0 (gpointer self) { |
838 | 232 | return self ? g_object_ref (self) : NULL; | 232 | return self ? g_object_ref (self) : NULL; |
839 | 233 | } | 233 | } |
840 | 234 | 234 | ||
841 | 235 | |||
842 | 236 | void fm_directory_view_colorize_selection (FMDirectoryView *view, int ncolor) | 235 | void fm_directory_view_colorize_selection (FMDirectoryView *view, int ncolor) |
843 | 237 | { | 236 | { |
844 | 238 | g_return_if_fail (FM_IS_DIRECTORY_VIEW (view)); | 237 | g_return_if_fail (FM_IS_DIRECTORY_VIEW (view)); |
845 | 239 | g_return_if_fail (tags != NULL); | 238 | g_return_if_fail (tags != NULL); |
847 | 240 | 239 | ||
848 | 241 | marlin_view_tags_set_color (tags, view, ncolor, NULL, NULL); | 240 | marlin_view_tags_set_color (tags, view, ncolor, NULL, NULL); |
849 | 242 | } | 241 | } |
850 | 243 | 242 | ||
851 | @@ -266,7 +265,7 @@ | |||
852 | 266 | static void | 265 | static void |
853 | 267 | file_changed_callback (GOFDirectoryAsync *directory, GOFFile *file, FMDirectoryView *view) | 266 | file_changed_callback (GOFDirectoryAsync *directory, GOFFile *file, FMDirectoryView *view) |
854 | 268 | { | 267 | { |
856 | 269 | /*if (!file->exists) | 268 | /*if (!file->exists) |
857 | 270 | return;*/ | 269 | return;*/ |
858 | 271 | g_return_if_fail (file != NULL); | 270 | g_return_if_fail (file != NULL); |
859 | 272 | g_return_if_fail (file->exists); | 271 | g_return_if_fail (file->exists); |
860 | @@ -280,7 +279,7 @@ | |||
861 | 280 | static void | 279 | static void |
862 | 281 | file_deleted_callback (GOFDirectoryAsync *directory, GOFFile *file, FMDirectoryView *view) | 280 | file_deleted_callback (GOFDirectoryAsync *directory, GOFFile *file, FMDirectoryView *view) |
863 | 282 | { | 281 | { |
865 | 283 | g_debug ("%s %s", G_STRFUNC, file->uri); | 282 | g_debug ("%s %s", G_STRFUNC, file->uri); |
866 | 284 | fm_list_model_remove_file (view->model, file, directory); | 283 | fm_list_model_remove_file (view->model, file, directory); |
867 | 285 | /* Remove from gof-directory-async cache */ | 284 | /* Remove from gof-directory-async cache */ |
868 | 286 | if (gof_file_is_folder (file)) { | 285 | if (gof_file_is_folder (file)) { |
869 | @@ -291,7 +290,7 @@ | |||
870 | 291 | g_debug ("Remove from gof-directory-async cache %s\n", file->uri); | 290 | g_debug ("Remove from gof-directory-async cache %s\n", file->uri); |
871 | 292 | g_object_unref (dir); | 291 | g_object_unref (dir); |
872 | 293 | } | 292 | } |
874 | 294 | 293 | ||
875 | 295 | if (view->details->slot->mwcols) { | 294 | if (view->details->slot->mwcols) { |
876 | 296 | /* if in miller view mode, remove any views of subdirectories of deleted directory */ | 295 | /* if in miller view mode, remove any views of subdirectories of deleted directory */ |
877 | 297 | gtk_container_foreach (GTK_CONTAINER (view->details->slot->mwcols->active_slot->colpane), (GtkCallback) gtk_widget_destroy, NULL); | 296 | gtk_container_foreach (GTK_CONTAINER (view->details->slot->mwcols->active_slot->colpane), (GtkCallback) gtk_widget_destroy, NULL); |
878 | @@ -312,12 +311,17 @@ | |||
879 | 312 | } | 311 | } |
880 | 313 | else | 312 | else |
881 | 314 | dir_action_set_sensitive (view, "Select All", TRUE); | 313 | dir_action_set_sensitive (view, "Select All", TRUE); |
883 | 315 | 314 | ||
884 | 316 | MarlinZoomLevel zoom; | 315 | MarlinZoomLevel zoom; |
885 | 317 | g_object_get (view, "zoom-level", &zoom, NULL); | 316 | g_object_get (view, "zoom-level", &zoom, NULL); |
886 | 318 | int size = marlin_zoom_level_to_icon_size (zoom); | 317 | int size = marlin_zoom_level_to_icon_size (zoom); |
887 | 319 | gof_directory_async_threaded_load_thumbnails (view->details->slot->directory, size); | 318 | gof_directory_async_threaded_load_thumbnails (view->details->slot->directory, size); |
888 | 320 | //g_signal_emit (view, signals[DIRECTORY_LOADED], 0, directory); | 319 | //g_signal_emit (view, signals[DIRECTORY_LOADED], 0, directory); |
889 | 320 | /* If in Miller view, autosize the column */ | ||
890 | 321 | if (view->details->slot->ready_to_autosize) | ||
891 | 322 | autosize_slot (view->details->slot); | ||
892 | 323 | else | ||
893 | 324 | view->details->slot->ready_to_autosize = TRUE; | ||
894 | 321 | } | 325 | } |
895 | 322 | 326 | ||
896 | 323 | static void | 327 | static void |
897 | @@ -352,11 +356,11 @@ | |||
898 | 352 | gof_directory_async_load_hiddens (directory); | 356 | gof_directory_async_load_hiddens (directory); |
899 | 353 | g_signal_handlers_disconnect_by_func (directory, file_loaded_callback, view); | 357 | g_signal_handlers_disconnect_by_func (directory, file_loaded_callback, view); |
900 | 354 | } else { | 358 | } else { |
902 | 355 | /* while the model is cleared and re-loaded we do not want the view to update */ | 359 | /* while the model is cleared and re-loaded we do not want the view to update */ |
903 | 356 | g_signal_handlers_block_by_func (view->model, fm_directory_view_row_deleted, view); | 360 | g_signal_handlers_block_by_func (view->model, fm_directory_view_row_deleted, view); |
904 | 357 | g_signal_handlers_block_by_func (view->model, fm_directory_view_restore_selection, view); | 361 | g_signal_handlers_block_by_func (view->model, fm_directory_view_restore_selection, view); |
905 | 358 | view->updates_frozen = TRUE; | 362 | view->updates_frozen = TRUE; |
907 | 359 | 363 | ||
908 | 360 | /* clear the model */ | 364 | /* clear the model */ |
909 | 361 | fm_list_model_clear (view->model); | 365 | fm_list_model_clear (view->model); |
910 | 362 | 366 | ||
911 | @@ -365,7 +369,7 @@ | |||
912 | 365 | gof_directory_async_load (directory); | 369 | gof_directory_async_load (directory); |
913 | 366 | g_signal_handlers_disconnect_by_func (directory, file_loaded_callback, view); | 370 | g_signal_handlers_disconnect_by_func (directory, file_loaded_callback, view); |
914 | 367 | 371 | ||
916 | 368 | /* re-instate signals and unfreeze view */ | 372 | /* re-instate signals and unfreeze view */ |
917 | 369 | g_signal_handlers_unblock_by_func (view->model, fm_directory_view_row_deleted, view); | 373 | g_signal_handlers_unblock_by_func (view->model, fm_directory_view_row_deleted, view); |
918 | 370 | g_signal_handlers_unblock_by_func (view->model, fm_directory_view_restore_selection, view); | 374 | g_signal_handlers_unblock_by_func (view->model, fm_directory_view_restore_selection, view); |
919 | 371 | view->updates_frozen = FALSE; | 375 | view->updates_frozen = FALSE; |
920 | @@ -384,24 +388,24 @@ | |||
921 | 384 | static void | 388 | static void |
922 | 385 | fm_directory_view_connect_directory_handlers (FMDirectoryView *view, GOFDirectoryAsync *directory) | 389 | fm_directory_view_connect_directory_handlers (FMDirectoryView *view, GOFDirectoryAsync *directory) |
923 | 386 | { | 390 | { |
925 | 387 | g_signal_connect (directory, "file_loaded", | 391 | g_signal_connect (directory, "file_loaded", |
926 | 388 | G_CALLBACK (file_loaded_callback), view); | 392 | G_CALLBACK (file_loaded_callback), view); |
928 | 389 | g_signal_connect (directory, "file_added", | 393 | g_signal_connect (directory, "file_added", |
929 | 390 | G_CALLBACK (file_added_callback), view); | 394 | G_CALLBACK (file_added_callback), view); |
931 | 391 | g_signal_connect (directory, "file_changed", | 395 | g_signal_connect (directory, "file_changed", |
932 | 392 | G_CALLBACK (file_changed_callback), view); | 396 | G_CALLBACK (file_changed_callback), view); |
934 | 393 | g_signal_connect (directory, "file_deleted", | 397 | g_signal_connect (directory, "file_deleted", |
935 | 394 | G_CALLBACK (file_deleted_callback), view); | 398 | G_CALLBACK (file_deleted_callback), view); |
937 | 395 | g_signal_connect (directory, "done_loading", | 399 | g_signal_connect (directory, "done_loading", |
938 | 396 | G_CALLBACK (directory_done_loading_callback), view); | 400 | G_CALLBACK (directory_done_loading_callback), view); |
940 | 397 | g_signal_connect (directory, "thumbs_loaded", | 401 | g_signal_connect (directory, "thumbs_loaded", |
941 | 398 | G_CALLBACK (directory_thumbs_loaded_callback), view); | 402 | G_CALLBACK (directory_thumbs_loaded_callback), view); |
943 | 399 | g_signal_connect (directory, "icon_changed", | 403 | g_signal_connect (directory, "icon_changed", |
944 | 400 | G_CALLBACK (icon_changed_callback), view); | 404 | G_CALLBACK (icon_changed_callback), view); |
945 | 401 | } | 405 | } |
946 | 402 | 406 | ||
947 | 403 | static void | 407 | static void |
949 | 404 | fm_directory_view_disconnect_directory_handlers (FMDirectoryView *view, | 408 | fm_directory_view_disconnect_directory_handlers (FMDirectoryView *view, |
950 | 405 | GOFDirectoryAsync *directory) | 409 | GOFDirectoryAsync *directory) |
951 | 406 | { | 410 | { |
952 | 407 | /*g_signal_handlers_disconnect_by_func (directory, file_loaded_callback, view);*/ | 411 | /*g_signal_handlers_disconnect_by_func (directory, file_loaded_callback, view);*/ |
953 | @@ -433,7 +437,7 @@ | |||
954 | 433 | 437 | ||
955 | 434 | if (!fm_directory_view_get_loading (view)) { | 438 | if (!fm_directory_view_get_loading (view)) { |
956 | 435 | g_object_get (view, "zoom-level", &zoom, NULL); | 439 | g_object_get (view, "zoom-level", &zoom, NULL); |
958 | 436 | gof_directory_async_queue_load_thumbnails (view->details->slot->directory, | 440 | gof_directory_async_queue_load_thumbnails (view->details->slot->directory, |
959 | 437 | marlin_zoom_level_to_icon_size (zoom)); | 441 | marlin_zoom_level_to_icon_size (zoom)); |
960 | 438 | } | 442 | } |
961 | 439 | } | 443 | } |
962 | @@ -488,20 +492,25 @@ | |||
963 | 488 | /* setup the list model */ | 492 | /* setup the list model */ |
964 | 489 | g_signal_connect (view->model, "row-deleted", G_CALLBACK (fm_directory_view_row_deleted), view); | 493 | g_signal_connect (view->model, "row-deleted", G_CALLBACK (fm_directory_view_row_deleted), view); |
965 | 490 | g_signal_connect_after (view->model, "row-deleted", G_CALLBACK (fm_directory_view_restore_selection), view); | 494 | g_signal_connect_after (view->model, "row-deleted", G_CALLBACK (fm_directory_view_restore_selection), view); |
967 | 491 | 495 | ||
968 | 492 | g_signal_connect (view->model, "sort_column_changed", G_CALLBACK (sort_column_changed_callback), view); | 496 | g_signal_connect (view->model, "sort_column_changed", G_CALLBACK (sort_column_changed_callback), view); |
969 | 493 | 497 | ||
970 | 494 | /* connect to size allocation signals for generating thumbnail requests */ | 498 | /* connect to size allocation signals for generating thumbnail requests */ |
971 | 495 | g_signal_connect_after (G_OBJECT (view), "size-allocate", | 499 | g_signal_connect_after (G_OBJECT (view), "size-allocate", |
972 | 496 | G_CALLBACK (fm_directory_view_size_allocate), NULL); | 500 | G_CALLBACK (fm_directory_view_size_allocate), NULL); |
973 | 497 | 501 | ||
975 | 498 | g_signal_connect (G_OBJECT (view), "notify::zoom-level", | 502 | g_signal_connect (G_OBJECT (view), "notify::zoom-level", |
976 | 499 | G_CALLBACK (zoom_level_changed), NULL); | 503 | G_CALLBACK (zoom_level_changed), NULL); |
977 | 500 | 504 | ||
978 | 501 | view->details->dir_action_group = NULL; | 505 | view->details->dir_action_group = NULL; |
979 | 502 | view->details->dir_merge_id = 0; | 506 | view->details->dir_merge_id = 0; |
980 | 503 | view->details->open_with_action_group = NULL; | 507 | view->details->open_with_action_group = NULL; |
981 | 504 | view->details->open_with_merge_id = 0; | 508 | view->details->open_with_merge_id = 0; |
982 | 509 | view->empty_message = g_strconcat ("<span size='x-large'>", | ||
983 | 510 | _("This folder is empty."), | ||
984 | 511 | "</span>", | ||
985 | 512 | NULL); | ||
986 | 513 | |||
987 | 505 | } | 514 | } |
988 | 506 | 515 | ||
989 | 507 | static GObject* | 516 | static GObject* |
990 | @@ -626,12 +635,12 @@ | |||
991 | 626 | /* release the context menu references */ | 635 | /* release the context menu references */ |
992 | 627 | if (view->details->menu_selection) { | 636 | if (view->details->menu_selection) { |
993 | 628 | gpointer old_menuitems = g_object_get_data(G_OBJECT (view->details->menu_selection), "other_selection"); | 637 | gpointer old_menuitems = g_object_get_data(G_OBJECT (view->details->menu_selection), "other_selection"); |
996 | 629 | g_list_free_full (old_menuitems, (GDestroyNotify) gtk_widget_destroy); | 638 | g_list_free_full (old_menuitems, (GDestroyNotify) gtk_widget_destroy); |
997 | 630 | g_object_set_data (G_OBJECT (view->details->menu_selection), "other_selection", NULL); | 639 | g_object_set_data (G_OBJECT (view->details->menu_selection), "other_selection", NULL); |
998 | 631 | } | 640 | } |
999 | 632 | 641 | ||
1000 | 633 | g_free (view->details->previewer); | 642 | g_free (view->details->previewer); |
1002 | 634 | 643 | ||
1003 | 635 | if (view->details->newly_folder_added) | 644 | if (view->details->newly_folder_added) |
1004 | 636 | g_object_unref (view->details->newly_folder_added); | 645 | g_object_unref (view->details->newly_folder_added); |
1005 | 637 | 646 | ||
1006 | @@ -672,12 +681,12 @@ | |||
1007 | 672 | g_signal_emit_by_name (slot->ctab, "path-changed", location); | 681 | g_signal_emit_by_name (slot->ctab, "path-changed", location); |
1008 | 673 | } | 682 | } |
1009 | 674 | 683 | ||
1011 | 675 | /* TODO remove screen if we don't create any new windows | 684 | /* TODO remove screen if we don't create any new windows |
1012 | 676 | ** (check if we have to) */ | 685 | ** (check if we have to) */ |
1013 | 677 | static void | 686 | static void |
1017 | 678 | fm_directory_view_activate_single_file (FMDirectoryView *view, | 687 | fm_directory_view_activate_single_file (FMDirectoryView *view, |
1018 | 679 | GOFFile *file, | 688 | GOFFile *file, |
1019 | 680 | GdkScreen *screen, | 689 | GdkScreen *screen, |
1020 | 681 | MarlinViewWindowOpenFlags flags) | 690 | MarlinViewWindowOpenFlags flags) |
1021 | 682 | { | 691 | { |
1022 | 683 | GFile *location; | 692 | GFile *location; |
1023 | @@ -686,7 +695,7 @@ | |||
1024 | 686 | location = gof_file_get_target_location (file); | 695 | location = gof_file_get_target_location (file); |
1025 | 687 | 696 | ||
1026 | 688 | //g_message ("%s %s %s", G_STRFUNC, file->uri, g_file_get_uri(location)); | 697 | //g_message ("%s %s %s", G_STRFUNC, file->uri, g_file_get_uri(location)); |
1028 | 689 | if (gof_file_is_folder (file)) | 698 | if (gof_file_is_folder (file)) |
1029 | 690 | { | 699 | { |
1030 | 691 | switch (flags) { | 700 | switch (flags) { |
1031 | 692 | case MARLIN_WINDOW_OPEN_FLAG_NEW_TAB: | 701 | case MARLIN_WINDOW_OPEN_FLAG_NEW_TAB: |
1032 | @@ -758,7 +767,7 @@ | |||
1033 | 758 | } | 767 | } |
1034 | 759 | 768 | ||
1035 | 760 | selection = fm_directory_view_get_selection (view); | 769 | selection = fm_directory_view_get_selection (view); |
1037 | 761 | /* FIXME only grab the first selection item as gloobus-preview is unable to handle | 770 | /* FIXME only grab the first selection item as gloobus-preview is unable to handle |
1038 | 762 | multiple selection */ | 771 | multiple selection */ |
1039 | 763 | if (selection != NULL) { | 772 | if (selection != NULL) { |
1040 | 764 | file = selection->data; | 773 | file = selection->data; |
1041 | @@ -777,34 +786,34 @@ | |||
1042 | 777 | } | 786 | } |
1043 | 778 | } | 787 | } |
1044 | 779 | 788 | ||
1046 | 780 | void | 789 | void |
1047 | 781 | fm_directory_view_zoom_normal (FMDirectoryView *view) | 790 | fm_directory_view_zoom_normal (FMDirectoryView *view) |
1048 | 782 | { | 791 | { |
1049 | 783 | (*FM_DIRECTORY_VIEW_GET_CLASS (view)->zoom_normal) (view); | 792 | (*FM_DIRECTORY_VIEW_GET_CLASS (view)->zoom_normal) (view); |
1050 | 784 | } | 793 | } |
1051 | 785 | 794 | ||
1053 | 786 | void | 795 | void |
1054 | 787 | fm_directory_view_zoom_in (FMDirectoryView *view) | 796 | fm_directory_view_zoom_in (FMDirectoryView *view) |
1055 | 788 | { | 797 | { |
1056 | 789 | MarlinZoomLevel zoom; | 798 | MarlinZoomLevel zoom; |
1057 | 790 | 799 | ||
1058 | 791 | g_object_get (view, "zoom-level", &zoom, NULL); | 800 | g_object_get (view, "zoom-level", &zoom, NULL); |
1059 | 792 | zoom++; | 801 | zoom++; |
1061 | 793 | if (zoom >= MARLIN_ZOOM_LEVEL_SMALLEST | 802 | if (zoom >= MARLIN_ZOOM_LEVEL_SMALLEST |
1062 | 794 | && zoom <= MARLIN_ZOOM_LEVEL_LARGEST) | 803 | && zoom <= MARLIN_ZOOM_LEVEL_LARGEST) |
1063 | 795 | { | 804 | { |
1064 | 796 | g_object_set (G_OBJECT (view), "zoom-level", zoom, NULL); | 805 | g_object_set (G_OBJECT (view), "zoom-level", zoom, NULL); |
1065 | 797 | } | 806 | } |
1066 | 798 | } | 807 | } |
1067 | 799 | 808 | ||
1069 | 800 | void | 809 | void |
1070 | 801 | fm_directory_view_zoom_out (FMDirectoryView *view) | 810 | fm_directory_view_zoom_out (FMDirectoryView *view) |
1071 | 802 | { | 811 | { |
1072 | 803 | MarlinZoomLevel zoom; | 812 | MarlinZoomLevel zoom; |
1073 | 804 | 813 | ||
1074 | 805 | g_object_get (view, "zoom-level", &zoom, NULL); | 814 | g_object_get (view, "zoom-level", &zoom, NULL); |
1075 | 806 | zoom--; | 815 | zoom--; |
1077 | 807 | if (zoom >= MARLIN_ZOOM_LEVEL_SMALLEST | 816 | if (zoom >= MARLIN_ZOOM_LEVEL_SMALLEST |
1078 | 808 | && zoom <= MARLIN_ZOOM_LEVEL_LARGEST) | 817 | && zoom <= MARLIN_ZOOM_LEVEL_LARGEST) |
1079 | 809 | { | 818 | { |
1080 | 810 | g_object_set (view, "zoom-level", zoom, NULL); | 819 | g_object_set (view, "zoom-level", zoom, NULL); |
1081 | @@ -816,7 +825,7 @@ | |||
1082 | 816 | GdkEventScroll *event) | 825 | GdkEventScroll *event) |
1083 | 817 | { | 826 | { |
1084 | 818 | gdouble total_delta_y = 0; | 827 | gdouble total_delta_y = 0; |
1086 | 819 | gdouble delta_x, delta_y; | 828 | gdouble delta_x, delta_y; |
1087 | 820 | 829 | ||
1088 | 821 | if (event->state & GDK_CONTROL_MASK) { | 830 | if (event->state & GDK_CONTROL_MASK) { |
1089 | 822 | switch (event->direction) { | 831 | switch (event->direction) { |
1090 | @@ -846,7 +855,7 @@ | |||
1091 | 846 | total_delta_y = 0; | 855 | total_delta_y = 0; |
1092 | 847 | /* emulate scroll up */ | 856 | /* emulate scroll up */ |
1093 | 848 | fm_directory_view_zoom_in (directory_view); | 857 | fm_directory_view_zoom_in (directory_view); |
1095 | 849 | return TRUE; | 858 | return TRUE; |
1096 | 850 | } else { | 859 | } else { |
1097 | 851 | /* eat event */ | 860 | /* eat event */ |
1098 | 852 | return TRUE; | 861 | return TRUE; |
1099 | @@ -1013,7 +1022,7 @@ | |||
1100 | 1013 | //printf ("%s path %s\n", G_STRFUNC, gtk_tree_path_to_string (path)); | 1022 | //printf ("%s path %s\n", G_STRFUNC, gtk_tree_path_to_string (path)); |
1101 | 1014 | /* determine the file for the path */ | 1023 | /* determine the file for the path */ |
1102 | 1015 | file = fm_list_model_file_for_path (view->model, path); | 1024 | file = fm_list_model_file_for_path (view->model, path); |
1104 | 1016 | 1025 | ||
1105 | 1017 | /* If file == NULL, it means that the path in question is a blank path, | 1026 | /* If file == NULL, it means that the path in question is a blank path, |
1106 | 1018 | * which can only exist under an expanded empty folder. | 1027 | * which can only exist under an expanded empty folder. |
1107 | 1019 | * In this case, we set the destination target to that folder. */ | 1028 | * In this case, we set the destination target to that folder. */ |
1108 | @@ -1143,13 +1152,13 @@ | |||
1109 | 1143 | /* determine the file for the drop position */ | 1152 | /* determine the file for the drop position */ |
1110 | 1144 | file = fm_directory_view_get_drop_file (view, x, y, NULL); | 1153 | file = fm_directory_view_get_drop_file (view, x, y, NULL); |
1111 | 1145 | g_debug ("%s XdndDirectSave0 %s", G_STRFUNC, file->uri); | 1154 | g_debug ("%s XdndDirectSave0 %s", G_STRFUNC, file->uri); |
1113 | 1146 | 1155 | ||
1114 | 1147 | if (G_LIKELY (file != NULL)) | 1156 | if (G_LIKELY (file != NULL)) |
1115 | 1148 | { | 1157 | { |
1116 | 1149 | /* determine the file name from the DnD source window */ | 1158 | /* determine the file name from the DnD source window */ |
1118 | 1150 | if (gdk_property_get (gdk_drag_context_get_source_window (context), | 1159 | if (gdk_property_get (gdk_drag_context_get_source_window (context), |
1119 | 1151 | gdk_atom_intern_static_string ("XdndDirectSave0"), | 1160 | gdk_atom_intern_static_string ("XdndDirectSave0"), |
1121 | 1152 | gdk_atom_intern_static_string ("text/plain"), | 1161 | gdk_atom_intern_static_string ("text/plain"), |
1122 | 1153 | 0, 1024, FALSE, NULL, NULL, | 1162 | 0, 1024, FALSE, NULL, NULL, |
1123 | 1154 | &prop_len, &prop_text) && prop_text != NULL) | 1163 | &prop_len, &prop_text) && prop_text != NULL) |
1124 | 1155 | { | 1164 | { |
1125 | @@ -1191,7 +1200,7 @@ | |||
1126 | 1191 | /* release the file reference */ | 1200 | /* release the file reference */ |
1127 | 1192 | g_object_unref (G_OBJECT (file)); | 1201 | g_object_unref (G_OBJECT (file)); |
1128 | 1193 | } | 1202 | } |
1130 | 1194 | 1203 | ||
1131 | 1195 | /* if uri == NULL, we didn't set the property */ | 1204 | /* if uri == NULL, we didn't set the property */ |
1132 | 1196 | if (G_UNLIKELY (uri == NULL)) | 1205 | if (G_UNLIKELY (uri == NULL)) |
1133 | 1197 | return FALSE; | 1206 | return FALSE; |
1134 | @@ -1650,7 +1659,7 @@ | |||
1135 | 1650 | return TRUE; | 1659 | return TRUE; |
1136 | 1651 | } | 1660 | } |
1137 | 1652 | 1661 | ||
1139 | 1653 | static gboolean | 1662 | static gboolean |
1140 | 1654 | is_selection_contain_only_folders (GList *selection) | 1663 | is_selection_contain_only_folders (GList *selection) |
1141 | 1655 | { | 1664 | { |
1142 | 1656 | GOFFile *file; | 1665 | GOFFile *file; |
1143 | @@ -1695,7 +1704,7 @@ | |||
1144 | 1695 | } | 1704 | } |
1145 | 1696 | 1705 | ||
1146 | 1697 | static void | 1706 | static void |
1148 | 1698 | dir_action_set_visible_sensitive (FMDirectoryView *view, const gchar *action_name, | 1707 | dir_action_set_visible_sensitive (FMDirectoryView *view, const gchar *action_name, |
1149 | 1699 | gboolean visible, gboolean sensitive) | 1708 | gboolean visible, gboolean sensitive) |
1150 | 1700 | { | 1709 | { |
1151 | 1701 | GtkAction *action; | 1710 | GtkAction *action; |
1152 | @@ -1802,7 +1811,7 @@ | |||
1153 | 1802 | 1811 | ||
1154 | 1803 | static void | 1812 | static void |
1155 | 1804 | add_application_to_open_with_menu (FMDirectoryView *view, | 1813 | add_application_to_open_with_menu (FMDirectoryView *view, |
1157 | 1805 | GAppInfo *application, | 1814 | GAppInfo *application, |
1158 | 1806 | GList *files, | 1815 | GList *files, |
1159 | 1807 | int index, | 1816 | int index, |
1160 | 1808 | const char *menu_placeholder, | 1817 | const char *menu_placeholder, |
1161 | @@ -1846,7 +1855,7 @@ | |||
1162 | 1846 | 1855 | ||
1163 | 1847 | g_signal_connect_data (action, "activate", | 1856 | g_signal_connect_data (action, "activate", |
1164 | 1848 | G_CALLBACK (open_with_launch_application_callback), | 1857 | G_CALLBACK (open_with_launch_application_callback), |
1166 | 1849 | launch_parameters, | 1858 | launch_parameters, |
1167 | 1850 | (GClosureNotify)application_launch_parameters_free, 0); | 1859 | (GClosureNotify)application_launch_parameters_free, 0); |
1168 | 1851 | 1860 | ||
1169 | 1852 | gtk_action_group_add_action (view->details->open_with_action_group, | 1861 | gtk_action_group_add_action (view->details->open_with_action_group, |
1170 | @@ -1895,11 +1904,11 @@ | |||
1171 | 1895 | for (l=apps; l != NULL; l=l->next) { | 1904 | for (l=apps; l != NULL; l=l->next) { |
1172 | 1896 | app = (GAppInfo *) l->data; | 1905 | app = (GAppInfo *) l->data; |
1173 | 1897 | id1 = g_app_info_get_id (app); | 1906 | id1 = g_app_info_get_id (app); |
1176 | 1898 | if (id1 != NULL && id2 != NULL | 1907 | if (id1 != NULL && id2 != NULL |
1177 | 1899 | && strcmp (id1, id2) == 0) | 1908 | && strcmp (id1, id2) == 0) |
1178 | 1900 | { | 1909 | { |
1181 | 1901 | g_object_unref (app); | 1910 | g_object_unref (app); |
1182 | 1902 | apps = g_list_delete_link (apps, l); | 1911 | apps = g_list_delete_link (apps, l); |
1183 | 1903 | } | 1912 | } |
1184 | 1904 | } | 1913 | } |
1185 | 1905 | 1914 | ||
1186 | @@ -1925,7 +1934,7 @@ | |||
1187 | 1925 | selection = fm_directory_view_get_selection (view); | 1934 | selection = fm_directory_view_get_selection (view); |
1188 | 1926 | selection_count = g_list_length (selection); | 1935 | selection_count = g_list_length (selection); |
1189 | 1927 | file = GOF_FILE (selection->data); | 1936 | file = GOF_FILE (selection->data); |
1191 | 1928 | 1937 | ||
1192 | 1929 | if (file == NULL) { | 1938 | if (file == NULL) { |
1193 | 1930 | update_menus_empty_selection (view); | 1939 | update_menus_empty_selection (view); |
1194 | 1931 | return; | 1940 | return; |
1195 | @@ -1988,7 +1997,7 @@ | |||
1196 | 1988 | /* Only force displaying the icon if it is an application icon */ | 1997 | /* Only force displaying the icon if it is an application icon */ |
1197 | 1989 | gtk_image_menu_item_set_always_show_image (GTK_IMAGE_MENU_ITEM (menuitem), app_icon != NULL); | 1998 | gtk_image_menu_item_set_always_show_image (GTK_IMAGE_MENU_ITEM (menuitem), app_icon != NULL); |
1198 | 1990 | 1999 | ||
1200 | 1991 | if (app_icon == NULL) | 2000 | if (app_icon == NULL) |
1201 | 1992 | app_icon = g_themed_icon_new (GTK_STOCK_OPEN); | 2001 | app_icon = g_themed_icon_new (GTK_STOCK_OPEN); |
1202 | 1993 | 2002 | ||
1203 | 1994 | gtk_action_set_gicon (action, app_icon); | 2003 | gtk_action_set_gicon (action, app_icon); |
1204 | @@ -2006,7 +2015,7 @@ | |||
1205 | 2006 | g_free (mnemonic); | 2015 | g_free (mnemonic); |
1206 | 2007 | 2016 | ||
1207 | 2008 | /* OpenAlternate label update */ | 2017 | /* OpenAlternate label update */ |
1209 | 2009 | if (selection_count > 1) | 2018 | if (selection_count > 1) |
1210 | 2010 | mnemonic = g_strdup_printf (_("Open in %'d New _Windows"), selection_count); | 2019 | mnemonic = g_strdup_printf (_("Open in %'d New _Windows"), selection_count); |
1211 | 2011 | else | 2020 | else |
1212 | 2012 | mnemonic = NULL; | 2021 | mnemonic = NULL; |
1213 | @@ -2022,8 +2031,8 @@ | |||
1214 | 2022 | 2031 | ||
1215 | 2023 | /* if there s no default app then there s no common possible type to get other applications. | 2032 | /* if there s no default app then there s no common possible type to get other applications. |
1216 | 2024 | checking the first file is enought to determine if we have a full directory selection | 2033 | checking the first file is enought to determine if we have a full directory selection |
1219 | 2025 | as the only possible common type for a directory is a directory. | 2034 | as the only possible common type for a directory is a directory. |
1220 | 2026 | We don't want File Managers applications list in the open with menu for a directory(ies) | 2035 | We don't want File Managers applications list in the open with menu for a directory(ies) |
1221 | 2027 | selection */ | 2036 | selection */ |
1222 | 2028 | if (view->details->open_with_apps != NULL) { | 2037 | if (view->details->open_with_apps != NULL) { |
1223 | 2029 | g_list_free_full (view->details->open_with_apps, g_object_unref); | 2038 | g_list_free_full (view->details->open_with_apps, g_object_unref); |
1224 | @@ -2032,16 +2041,16 @@ | |||
1225 | 2032 | if (view->details->default_app != NULL && !gof_file_is_folder (file)) | 2041 | if (view->details->default_app != NULL && !gof_file_is_folder (file)) |
1226 | 2033 | view->details->open_with_apps = marlin_mime_get_applications_for_files (selection); | 2042 | view->details->open_with_apps = marlin_mime_get_applications_for_files (selection); |
1227 | 2034 | /* we need to remove the default app from open with menu */ | 2043 | /* we need to remove the default app from open with menu */ |
1229 | 2035 | if (view->details->default_app != NULL && !gof_file_is_executable (file)) | 2044 | if (view->details->default_app != NULL && !gof_file_is_executable (file)) |
1230 | 2036 | view->details->open_with_apps = filter_default_app (view->details->open_with_apps, view->details->default_app); | 2045 | view->details->open_with_apps = filter_default_app (view->details->open_with_apps, view->details->default_app); |
1231 | 2037 | for (l = view->details->open_with_apps, index=0; l != NULL && index <10; l=l->next, index++) { | 2046 | for (l = view->details->open_with_apps, index=0; l != NULL && index <10; l=l->next, index++) { |
1234 | 2038 | add_application_to_open_with_menu (view, | 2047 | add_application_to_open_with_menu (view, |
1235 | 2039 | l->data, | 2048 | l->data, |
1236 | 2040 | selection, | 2049 | selection, |
1237 | 2041 | index, | 2050 | index, |
1238 | 2042 | menu_path, popup_path); | 2051 | menu_path, popup_path); |
1239 | 2043 | } | 2052 | } |
1241 | 2044 | 2053 | ||
1242 | 2045 | if (selection_count == 1 && !gof_file_is_folder (file)) | 2054 | if (selection_count == 1 && !gof_file_is_folder (file)) |
1243 | 2046 | dir_action_set_visible (view, "OtherApplication", TRUE); | 2055 | dir_action_set_visible (view, "OtherApplication", TRUE); |
1244 | 2047 | } | 2056 | } |
1245 | @@ -2203,7 +2212,7 @@ | |||
1246 | 2203 | g_return_if_fail (FM_IS_DIRECTORY_VIEW (view)); | 2212 | g_return_if_fail (FM_IS_DIRECTORY_VIEW (view)); |
1247 | 2204 | g_return_if_fail (view->model == model); | 2213 | g_return_if_fail (view->model == model); |
1248 | 2205 | 2214 | ||
1250 | 2206 | g_message ("%s", G_STRFUNC); | 2215 | g_debug ("%s", G_STRFUNC); |
1251 | 2207 | /* Get tree paths of selected files */ | 2216 | /* Get tree paths of selected files */ |
1252 | 2208 | selected_paths = (*FM_DIRECTORY_VIEW_GET_CLASS (view)->get_selected_paths) (view); | 2217 | selected_paths = (*FM_DIRECTORY_VIEW_GET_CLASS (view)->get_selected_paths) (view); |
1253 | 2209 | 2218 | ||
1254 | @@ -2220,7 +2229,7 @@ | |||
1255 | 2220 | /* Create a copy the path (we're not allowed to modify it in this handler) */ | 2229 | /* Create a copy the path (we're not allowed to modify it in this handler) */ |
1256 | 2221 | path_copy = gtk_tree_path_copy (path); | 2230 | path_copy = gtk_tree_path_copy (path); |
1257 | 2222 | 2231 | ||
1259 | 2223 | /* Remember the selected path so that it can be restored after the row has | 2232 | /* Remember the selected path so that it can be restored after the row has |
1260 | 2224 | * been removed. If the first row is removed, select the first row after the | 2233 | * been removed. If the first row is removed, select the first row after the |
1261 | 2225 | * removal, if any other row is removed, select the row before that one */ | 2234 | * removal, if any other row is removed, select the row before that one */ |
1262 | 2226 | gtk_tree_path_prev (path_copy); | 2235 | gtk_tree_path_prev (path_copy); |
1263 | @@ -2238,8 +2247,8 @@ | |||
1264 | 2238 | g_return_if_fail (FM_IS_DIRECTORY_VIEW (view)); | 2247 | g_return_if_fail (FM_IS_DIRECTORY_VIEW (view)); |
1265 | 2239 | g_return_if_fail (view->model == model); | 2248 | g_return_if_fail (view->model == model); |
1266 | 2240 | 2249 | ||
1269 | 2241 | g_message ("%s", G_STRFUNC); | 2250 | g_debug ("%s", G_STRFUNC); |
1270 | 2242 | /* Check if there was only one file selected before the row was deleted. The | 2251 | /* Check if there was only one file selected before the row was deleted. The |
1271 | 2243 | * path is set by thunar_standard_view_row_deleted() if this is the case */ | 2252 | * path is set by thunar_standard_view_row_deleted() if this is the case */ |
1272 | 2244 | if (G_LIKELY (view->details->selection_before_delete != NULL)) | 2253 | if (G_LIKELY (view->details->selection_before_delete != NULL)) |
1273 | 2245 | { | 2254 | { |
1274 | @@ -2257,11 +2266,11 @@ | |||
1275 | 2257 | } | 2266 | } |
1276 | 2258 | } | 2267 | } |
1277 | 2259 | 2268 | ||
1279 | 2260 | void | 2269 | void |
1280 | 2261 | fm_directory_view_select_first_for_empty_selection (FMDirectoryView *view) | 2270 | fm_directory_view_select_first_for_empty_selection (FMDirectoryView *view) |
1281 | 2262 | { | 2271 | { |
1282 | 2263 | g_return_if_fail (FM_IS_DIRECTORY_VIEW (view)); | 2272 | g_return_if_fail (FM_IS_DIRECTORY_VIEW (view)); |
1284 | 2264 | 2273 | ||
1285 | 2265 | GList *selection = fm_directory_view_get_selection (view); | 2274 | GList *selection = fm_directory_view_get_selection (view); |
1286 | 2266 | 2275 | ||
1287 | 2267 | if (!selection) { | 2276 | if (!selection) { |
1288 | @@ -2273,7 +2282,7 @@ | |||
1289 | 2273 | } | 2282 | } |
1290 | 2274 | 2283 | ||
1291 | 2275 | #if 0 | 2284 | #if 0 |
1293 | 2276 | void | 2285 | void |
1294 | 2277 | fm_directory_view_select_gof_file (FMDirectoryView *view, GOFFile *file) | 2286 | fm_directory_view_select_gof_file (FMDirectoryView *view, GOFFile *file) |
1295 | 2278 | { | 2287 | { |
1296 | 2279 | GtkTreeIter iter; | 2288 | GtkTreeIter iter; |
1297 | @@ -2282,7 +2291,7 @@ | |||
1298 | 2282 | g_return_if_fail (FM_IS_DIRECTORY_VIEW (view)); | 2291 | g_return_if_fail (FM_IS_DIRECTORY_VIEW (view)); |
1299 | 2283 | 2292 | ||
1300 | 2284 | if (!fm_list_model_get_first_iter_for_file (view->model, file, &iter)) | 2293 | if (!fm_list_model_get_first_iter_for_file (view->model, file, &iter)) |
1302 | 2285 | return; | 2294 | return; |
1303 | 2286 | 2295 | ||
1304 | 2287 | path = gtk_tree_model_get_path (GTK_TREE_MODEL (view->model), &iter); | 2296 | path = gtk_tree_model_get_path (GTK_TREE_MODEL (view->model), &iter); |
1305 | 2288 | (*FM_DIRECTORY_VIEW_GET_CLASS (view)->set_cursor) (view, path, FALSE, TRUE); | 2297 | (*FM_DIRECTORY_VIEW_GET_CLASS (view)->set_cursor) (view, path, FALSE, TRUE); |
1306 | @@ -2290,7 +2299,7 @@ | |||
1307 | 2290 | } | 2299 | } |
1308 | 2291 | #endif | 2300 | #endif |
1309 | 2292 | 2301 | ||
1311 | 2293 | void | 2302 | void |
1312 | 2294 | fm_directory_view_select_glib_files (FMDirectoryView *view, GList *files) | 2303 | fm_directory_view_select_glib_files (FMDirectoryView *view, GList *files) |
1313 | 2295 | { | 2304 | { |
1314 | 2296 | GList *l; | 2305 | GList *l; |
1315 | @@ -2326,10 +2335,10 @@ | |||
1316 | 2326 | error = NULL; | 2335 | error = NULL; |
1317 | 2327 | res = g_file_set_attributes_finish (G_FILE (source_object), result, NULL, &error); | 2336 | res = g_file_set_attributes_finish (G_FILE (source_object), result, NULL, &error); |
1318 | 2328 | 2337 | ||
1320 | 2329 | if (error != NULL) { | 2338 | if (error != NULL) { |
1321 | 2330 | g_critical ("%s error, %s", G_STRFUNC, error->message); | 2339 | g_critical ("%s error, %s", G_STRFUNC, error->message); |
1324 | 2331 | g_error_free (error); | 2340 | g_error_free (error); |
1325 | 2332 | } | 2341 | } |
1326 | 2333 | } | 2342 | } |
1327 | 2334 | 2343 | ||
1328 | 2335 | static void | 2344 | static void |
1329 | @@ -2354,7 +2363,7 @@ | |||
1330 | 2354 | current_dir->file->sort_column_id = sort_column_id; | 2363 | current_dir->file->sort_column_id = sort_column_id; |
1331 | 2355 | current_dir->file->sort_order = sort_order; | 2364 | current_dir->file->sort_order = sort_order; |
1332 | 2356 | location = g_object_ref (current_dir->location); | 2365 | location = g_object_ref (current_dir->location); |
1334 | 2357 | g_file_set_attributes_async (location, info, 0, G_PRIORITY_DEFAULT, NULL, | 2366 | g_file_set_attributes_async (location, info, 0, G_PRIORITY_DEFAULT, NULL, |
1335 | 2358 | set_metadata_callback, NULL); | 2367 | set_metadata_callback, NULL); |
1336 | 2359 | g_object_unref (location); | 2368 | g_object_unref (location); |
1337 | 2360 | g_object_unref (info); | 2369 | g_object_unref (info); |
1338 | @@ -2395,7 +2404,7 @@ | |||
1339 | 2395 | return view->details->slot->directory; | 2404 | return view->details->slot->directory; |
1340 | 2396 | } | 2405 | } |
1341 | 2397 | 2406 | ||
1343 | 2398 | static int | 2407 | static int |
1344 | 2399 | fm_directory_view_get_uri_keypath_size (FMDirectoryView *view) | 2408 | fm_directory_view_get_uri_keypath_size (FMDirectoryView *view) |
1345 | 2400 | { | 2409 | { |
1346 | 2401 | GOFDirectoryAsync *dir = fm_directory_view_get_current_directory (view); | 2410 | GOFDirectoryAsync *dir = fm_directory_view_get_current_directory (view); |
1347 | @@ -2436,8 +2445,8 @@ | |||
1348 | 2436 | fm_directory_view_cancel_thumbnailing (view); | 2445 | fm_directory_view_cancel_thumbnailing (view); |
1349 | 2437 | 2446 | ||
1350 | 2438 | /* schedule the timeout handler */ | 2447 | /* schedule the timeout handler */ |
1353 | 2439 | view->details->thumbnail_source_id = | 2448 | view->details->thumbnail_source_id = |
1354 | 2440 | g_timeout_add (175, (GSourceFunc) fm_directory_view_request_thumbnails, | 2449 | g_timeout_add (175, (GSourceFunc) fm_directory_view_request_thumbnails, |
1355 | 2441 | view); | 2450 | view); |
1356 | 2442 | } | 2451 | } |
1357 | 2443 | 2452 | ||
1358 | @@ -2481,7 +2490,7 @@ | |||
1359 | 2481 | /* only ask thumbnails once per file */ | 2490 | /* only ask thumbnails once per file */ |
1360 | 2482 | if (file->flags == 0) { | 2491 | if (file->flags == 0) { |
1361 | 2483 | files = g_list_prepend (files, g_object_ref (file)); | 2492 | files = g_list_prepend (files, g_object_ref (file)); |
1363 | 2484 | } | 2493 | } |
1364 | 2485 | 2494 | ||
1365 | 2486 | g_object_unref (file); | 2495 | g_object_unref (file); |
1366 | 2487 | } | 2496 | } |
1367 | @@ -2682,12 +2691,12 @@ | |||
1368 | 2682 | 2691 | ||
1369 | 2683 | locations = g_list_reverse (locations); | 2692 | locations = g_list_reverse (locations); |
1370 | 2684 | 2693 | ||
1372 | 2685 | if (locations != NULL) { | 2694 | if (locations != NULL) { |
1373 | 2686 | marlin_file_operations_trash_or_delete (locations, | 2695 | marlin_file_operations_trash_or_delete (locations, |
1374 | 2687 | GTK_WINDOW (view->details->window), | 2696 | GTK_WINDOW (view->details->window), |
1375 | 2688 | (MarlinDeleteCallback) trash_or_delete_done_cb, | 2697 | (MarlinDeleteCallback) trash_or_delete_done_cb, |
1376 | 2689 | view); | 2698 | view); |
1378 | 2690 | } | 2699 | } |
1379 | 2691 | else | 2700 | else |
1380 | 2692 | return; | 2701 | return; |
1381 | 2693 | 2702 | ||
1382 | @@ -2709,8 +2718,8 @@ | |||
1383 | 2709 | trash_or_delete_files (view, selection, TRUE); | 2718 | trash_or_delete_files (view, selection, TRUE); |
1384 | 2710 | gof_file_list_free (selection); | 2719 | gof_file_list_free (selection); |
1385 | 2711 | view->details->selection_was_removed = TRUE; | 2720 | view->details->selection_was_removed = TRUE; |
1388 | 2712 | } | 2721 | } |
1389 | 2713 | else | 2722 | else |
1390 | 2714 | return; | 2723 | return; |
1391 | 2715 | } | 2724 | } |
1392 | 2716 | } | 2725 | } |
1393 | @@ -2829,13 +2838,13 @@ | |||
1394 | 2829 | 2838 | ||
1395 | 2830 | slot = GOF_WINDOW_SLOT (g_value_get_object (value)); | 2839 | slot = GOF_WINDOW_SLOT (g_value_get_object (value)); |
1396 | 2831 | window = marlin_view_view_container_get_window (MARLIN_VIEW_VIEW_CONTAINER(slot->ctab)); | 2840 | window = marlin_view_view_container_get_window (MARLIN_VIEW_VIEW_CONTAINER(slot->ctab)); |
1398 | 2832 | 2841 | ||
1399 | 2833 | view->details->slot = g_object_ref(slot); | 2842 | view->details->slot = g_object_ref(slot); |
1400 | 2834 | view->details->window = window; | 2843 | view->details->window = window; |
1401 | 2835 | 2844 | ||
1402 | 2836 | g_signal_handlers_block_by_func (view->model, sort_column_changed_callback, view); | 2845 | g_signal_handlers_block_by_func (view->model, sort_column_changed_callback, view); |
1405 | 2837 | gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (view->model), | 2846 | gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (view->model), |
1406 | 2838 | slot->directory->file->sort_column_id, | 2847 | slot->directory->file->sort_column_id, |
1407 | 2839 | slot->directory->file->sort_order); | 2848 | slot->directory->file->sort_order); |
1408 | 2840 | g_signal_handlers_unblock_by_func (view->model, sort_column_changed_callback, view); | 2849 | g_signal_handlers_unblock_by_func (view->model, sort_column_changed_callback, view); |
1409 | 2841 | 2850 | ||
1410 | @@ -2844,15 +2853,15 @@ | |||
1411 | 2844 | G_CALLBACK (show_hidden_files_changed), view, 0); | 2853 | G_CALLBACK (show_hidden_files_changed), view, 0); |
1412 | 2845 | g_signal_connect_object (gof_preferences_get_default (), "notify::interpret-desktop-files", | 2854 | g_signal_connect_object (gof_preferences_get_default (), "notify::interpret-desktop-files", |
1413 | 2846 | G_CALLBACK (show_desktop_files_changed), view, 0); | 2855 | G_CALLBACK (show_desktop_files_changed), view, 0); |
1416 | 2847 | 2856 | ||
1417 | 2848 | 2857 | ||
1418 | 2849 | fm_directory_view_connect_directory_handlers (view, slot->directory); | 2858 | fm_directory_view_connect_directory_handlers (view, slot->directory); |
1421 | 2850 | 2859 | ||
1422 | 2851 | g_signal_connect_object (view->details->slot, "active", | 2860 | g_signal_connect_object (view->details->slot, "active", |
1423 | 2852 | G_CALLBACK (slot_active), view, 0); | 2861 | G_CALLBACK (slot_active), view, 0); |
1425 | 2853 | g_signal_connect_object (view->details->slot, "inactive", | 2862 | g_signal_connect_object (view->details->slot, "inactive", |
1426 | 2854 | G_CALLBACK (slot_inactive), view, 0); | 2863 | G_CALLBACK (slot_inactive), view, 0); |
1428 | 2855 | 2864 | ||
1429 | 2856 | 2865 | ||
1430 | 2857 | break; | 2866 | break; |
1431 | 2858 | case PROP_ZOOM_LEVEL: | 2867 | case PROP_ZOOM_LEVEL: |
1432 | @@ -2972,7 +2981,7 @@ | |||
1433 | 2972 | GtkUIManager * | 2981 | GtkUIManager * |
1434 | 2973 | fm_directory_view_get_ui_manager (FMDirectoryView *view) | 2982 | fm_directory_view_get_ui_manager (FMDirectoryView *view) |
1435 | 2974 | { | 2983 | { |
1437 | 2975 | if (view->details->window == NULL) | 2984 | if (view->details->window == NULL) |
1438 | 2976 | return NULL; | 2985 | return NULL; |
1439 | 2977 | 2986 | ||
1440 | 2978 | return MARLIN_VIEW_WINDOW (view->details->window)->ui; | 2987 | return MARLIN_VIEW_WINDOW (view->details->window)->ui; |
1441 | @@ -2998,14 +3007,14 @@ | |||
1442 | 2998 | } | 3007 | } |
1443 | 2999 | 3008 | ||
1444 | 3000 | void | 3009 | void |
1446 | 3001 | fm_directory_view_notify_item_hovered (FMDirectoryView *view, GtkTreePath *path) | 3010 | fm_directory_view_notify_item_hovered (FMDirectoryView *view, GtkTreePath *path) |
1447 | 3002 | { | 3011 | { |
1448 | 3003 | GOFFile *file = NULL; | 3012 | GOFFile *file = NULL; |
1449 | 3004 | 3013 | ||
1451 | 3005 | if (path != NULL) | 3014 | if (path != NULL) |
1452 | 3006 | file = fm_list_model_file_for_path (view->model, path); | 3015 | file = fm_list_model_file_for_path (view->model, path); |
1453 | 3007 | g_signal_emit_by_name (MARLIN_VIEW_WINDOW (view->details->window), "item_hovered", file); | 3016 | g_signal_emit_by_name (MARLIN_VIEW_WINDOW (view->details->window), "item_hovered", file); |
1455 | 3008 | if (file != NULL) | 3017 | if (file != NULL) |
1456 | 3009 | g_object_unref (file); | 3018 | g_object_unref (file); |
1457 | 3010 | } | 3019 | } |
1458 | 3011 | 3020 | ||
1459 | @@ -3018,12 +3027,12 @@ | |||
1460 | 3018 | view->details->selection_was_removed = FALSE; | 3027 | view->details->selection_was_removed = FALSE; |
1461 | 3019 | if (!gtk_widget_get_realized (GTK_WIDGET (view))) | 3028 | if (!gtk_widget_get_realized (GTK_WIDGET (view))) |
1462 | 3020 | return; | 3029 | return; |
1464 | 3021 | if (view->updates_frozen) | 3030 | if (view->updates_frozen) |
1465 | 3022 | return; | 3031 | return; |
1466 | 3023 | /* when we're in column view ignore selection changed from other slot than the active one */ | 3032 | /* when we're in column view ignore selection changed from other slot than the active one */ |
1468 | 3024 | if (view->details->slot->mwcols && | 3033 | if (view->details->slot->mwcols != NULL && |
1469 | 3025 | view->details->slot->mwcols->active_slot != view->details->slot) | 3034 | view->details->slot->mwcols->active_slot != view->details->slot) |
1471 | 3026 | return; | 3035 | return; |
1472 | 3027 | 3036 | ||
1473 | 3028 | //g_message ("%s %s", G_STRFUNC, view->details->slot->directory->file->uri); | 3037 | //g_message ("%s %s", G_STRFUNC, view->details->slot->directory->file->uri); |
1474 | 3029 | selection = fm_directory_view_get_selection (view); | 3038 | selection = fm_directory_view_get_selection (view); |
1475 | @@ -3036,9 +3045,9 @@ | |||
1476 | 3036 | { | 3045 | { |
1477 | 3037 | fm_directory_view_notify_selection_changed (view); | 3046 | fm_directory_view_notify_selection_changed (view); |
1478 | 3038 | 3047 | ||
1480 | 3039 | /* We could optimize this by redrawing only the old and the new | 3048 | /* We could optimize this by redrawing only the old and the new |
1481 | 3040 | * clipboard selection by emitting row-changed on the model but the icon view | 3049 | * clipboard selection by emitting row-changed on the model but the icon view |
1483 | 3041 | * handle this situation very badly by recomputing all the layout. | 3050 | * handle this situation very badly by recomputing all the layout. |
1484 | 3042 | */ | 3051 | */ |
1485 | 3043 | gtk_widget_queue_draw (GTK_WIDGET (view)); | 3052 | gtk_widget_queue_draw (GTK_WIDGET (view)); |
1486 | 3044 | } | 3053 | } |
1487 | @@ -3046,7 +3055,7 @@ | |||
1488 | 3046 | void | 3055 | void |
1489 | 3047 | fm_directory_view_set_active_slot (FMDirectoryView *view) | 3056 | fm_directory_view_set_active_slot (FMDirectoryView *view) |
1490 | 3048 | { | 3057 | { |
1492 | 3049 | g_warning ("%s %s %s", G_STRFUNC, | 3058 | g_warning ("%s %s %s", G_STRFUNC, |
1493 | 3050 | view->details->slot->mwcols->active_slot->directory->file->uri, | 3059 | view->details->slot->mwcols->active_slot->directory->file->uri, |
1494 | 3051 | view->details->slot->directory->file->uri | 3060 | view->details->slot->directory->file->uri |
1495 | 3052 | ); | 3061 | ); |
1496 | @@ -3108,7 +3117,7 @@ | |||
1497 | 3108 | g_return_if_fail (FM_IS_DIRECTORY_VIEW (view)); | 3117 | g_return_if_fail (FM_IS_DIRECTORY_VIEW (view)); |
1498 | 3109 | 3118 | ||
1499 | 3110 | view->updates_frozen = TRUE; | 3119 | view->updates_frozen = TRUE; |
1501 | 3111 | 3120 | ||
1502 | 3112 | /* disable clipboard actions */ | 3121 | /* disable clipboard actions */ |
1503 | 3113 | dir_action_set_sensitive (view, "Cut", FALSE); | 3122 | dir_action_set_sensitive (view, "Cut", FALSE); |
1504 | 3114 | dir_action_set_sensitive (view, "Copy", FALSE); | 3123 | dir_action_set_sensitive (view, "Copy", FALSE); |
1505 | @@ -3119,7 +3128,7 @@ | |||
1506 | 3119 | /* TODO remove this blocker */ | 3128 | /* TODO remove this blocker */ |
1507 | 3120 | /* block thumbnails request on size allocate */ | 3129 | /* block thumbnails request on size allocate */ |
1508 | 3121 | g_signal_handlers_block_by_func (view, fm_directory_view_size_allocate, NULL); | 3130 | g_signal_handlers_block_by_func (view, fm_directory_view_size_allocate, NULL); |
1510 | 3122 | 3131 | ||
1511 | 3123 | /* block clipboard change trigerring update_menus */ | 3132 | /* block clipboard change trigerring update_menus */ |
1512 | 3124 | g_signal_handlers_block_by_func (view, fm_directory_view_clipboard_changed, NULL); | 3133 | g_signal_handlers_block_by_func (view, fm_directory_view_clipboard_changed, NULL); |
1513 | 3125 | 3134 | ||
1514 | @@ -3139,7 +3148,7 @@ | |||
1515 | 3139 | 3148 | ||
1516 | 3140 | /* unblock thumbnails request on size allocate */ | 3149 | /* unblock thumbnails request on size allocate */ |
1517 | 3141 | g_signal_handlers_unblock_by_func (view, fm_directory_view_size_allocate, NULL); | 3150 | g_signal_handlers_unblock_by_func (view, fm_directory_view_size_allocate, NULL); |
1519 | 3142 | 3151 | ||
1520 | 3143 | /* unblock clipboard change trigerring update_menus */ | 3152 | /* unblock clipboard change trigerring update_menus */ |
1521 | 3144 | g_signal_handlers_unblock_by_func (view, fm_directory_view_clipboard_changed, NULL); | 3153 | g_signal_handlers_unblock_by_func (view, fm_directory_view_clipboard_changed, NULL); |
1522 | 3145 | 3154 | ||
1523 | @@ -3255,7 +3264,7 @@ | |||
1524 | 3255 | static void | 3264 | static void |
1525 | 3256 | check_newly_file_added_callback (GOFDirectoryAsync *directory, GOFFile *file, FMDirectoryView *view) | 3265 | check_newly_file_added_callback (GOFDirectoryAsync *directory, GOFFile *file, FMDirectoryView *view) |
1526 | 3257 | { | 3266 | { |
1528 | 3258 | if (file->is_directory && g_file_equal (file->location, view->details->newly_folder_added->location)) | 3267 | if (file->is_directory && g_file_equal (file->location, view->details->newly_folder_added->location)) |
1529 | 3259 | { | 3268 | { |
1530 | 3260 | g_signal_handlers_disconnect_by_func (directory, | 3269 | g_signal_handlers_disconnect_by_func (directory, |
1531 | 3261 | G_CALLBACK (check_newly_file_added_callback), | 3270 | G_CALLBACK (check_newly_file_added_callback), |
1532 | @@ -3267,7 +3276,7 @@ | |||
1533 | 3267 | #endif | 3276 | #endif |
1534 | 3268 | 3277 | ||
1535 | 3269 | static gboolean | 3278 | static gboolean |
1537 | 3270 | rename_file_callback (FMDirectoryView *view) | 3279 | rename_file_callback (FMDirectoryView *view) |
1538 | 3271 | { | 3280 | { |
1539 | 3272 | rename_file (view, view->details->newly_folder_added); | 3281 | rename_file (view, view->details->newly_folder_added); |
1540 | 3273 | g_object_unref (view->details->newly_folder_added); | 3282 | g_object_unref (view->details->newly_folder_added); |
1541 | @@ -3285,9 +3294,9 @@ | |||
1542 | 3285 | g_object_unref (view->details->newly_folder_added); | 3294 | g_object_unref (view->details->newly_folder_added); |
1543 | 3286 | view->details->newly_folder_added = gof_file_get (new_folder); | 3295 | view->details->newly_folder_added = gof_file_get (new_folder); |
1544 | 3287 | 3296 | ||
1548 | 3288 | /*g_signal_connect_data (view->details->slot->directory, | 3297 | /*g_signal_connect_data (view->details->slot->directory, |
1549 | 3289 | "file_added", | 3298 | "file_added", |
1550 | 3290 | G_CALLBACK (check_newly_file_added_callback), | 3299 | G_CALLBACK (check_newly_file_added_callback), |
1551 | 3291 | g_object_ref (view), | 3300 | g_object_ref (view), |
1552 | 3292 | (GClosureNotify)g_object_unref, | 3301 | (GClosureNotify)g_object_unref, |
1553 | 3293 | G_CONNECT_AFTER);*/ | 3302 | G_CONNECT_AFTER);*/ |
1554 | @@ -3326,7 +3335,7 @@ | |||
1555 | 3326 | GOFFile *source) | 3335 | GOFFile *source) |
1556 | 3327 | { | 3336 | { |
1557 | 3328 | //GdkPoint *pos; | 3337 | //GdkPoint *pos; |
1559 | 3329 | /*NewFolderData *data; | 3338 | /*NewFolderData *data; |
1560 | 3330 | char *source_uri;*/ | 3339 | char *source_uri;*/ |
1561 | 3331 | char *current_dir_uri; | 3340 | char *current_dir_uri; |
1562 | 3332 | 3341 | ||
1563 | @@ -3351,10 +3360,10 @@ | |||
1564 | 3351 | g_return_if_fail (nautilus_file_is_local (source)); | 3360 | g_return_if_fail (nautilus_file_is_local (source)); |
1565 | 3352 | g_return_if_fail (nautilus_file_is_local (source)); | 3361 | g_return_if_fail (nautilus_file_is_local (source)); |
1566 | 3353 | //pos = context_menu_to_file_operation_position (directory_view); | 3362 | //pos = context_menu_to_file_operation_position (directory_view); |
1569 | 3354 | data = setup_new_folder_data (directory_view); | 3363 | data = setup_new_folder_data (directory_view); |
1570 | 3355 | source_uri = nautilus_file_get_uri (source); | 3364 | source_uri = nautilus_file_get_uri (source); |
1571 | 3356 | 3365 | ||
1573 | 3357 | marlin_file_operations_new_file_from_template (GTK_WIDGET (directory_view), | 3366 | marlin_file_operations_new_file_from_template (GTK_WIDGET (directory_view), |
1574 | 3358 | pos, | 3367 | pos, |
1575 | 3359 | parent_uri != NULL ? parent_uri : container_uri, | 3368 | parent_uri != NULL ? parent_uri : container_uri, |
1576 | 3360 | NULL, | 3369 | NULL, |
1577 | @@ -3421,17 +3430,17 @@ | |||
1578 | 3421 | g_assert (selection != NULL); | 3430 | g_assert (selection != NULL); |
1579 | 3422 | 3431 | ||
1580 | 3423 | file = GOF_FILE (selection->data); | 3432 | file = GOF_FILE (selection->data); |
1582 | 3424 | gof_file_ref (file); | 3433 | gof_file_ref (file); |
1583 | 3425 | 3434 | ||
1585 | 3426 | dialog = gtk_app_chooser_dialog_new (GTK_WINDOW (view->details->window), 0, file->location); | 3435 | dialog = gtk_app_chooser_dialog_new (GTK_WINDOW (view->details->window), 0, file->location); |
1586 | 3427 | GtkWidget *check_default = gtk_check_button_new_with_label(_("Set as default")); | 3436 | GtkWidget *check_default = gtk_check_button_new_with_label(_("Set as default")); |
1587 | 3428 | gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), check_default, FALSE, FALSE, 0); | 3437 | gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), check_default, FALSE, FALSE, 0); |
1589 | 3429 | gtk_widget_show_all (dialog); | 3438 | gtk_widget_show_all (dialog); |
1590 | 3430 | 3439 | ||
1591 | 3431 | int response = gtk_dialog_run (GTK_DIALOG (dialog)); | 3440 | int response = gtk_dialog_run (GTK_DIALOG (dialog)); |
1592 | 3432 | if(response == GTK_RESPONSE_OK) | 3441 | if(response == GTK_RESPONSE_OK) |
1593 | 3433 | { | 3442 | { |
1595 | 3434 | app = gtk_app_chooser_get_app_info (GTK_APP_CHOOSER (GTK_DIALOG (dialog))); | 3443 | app = gtk_app_chooser_get_app_info (GTK_APP_CHOOSER (GTK_DIALOG (dialog))); |
1596 | 3435 | if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (check_default))) | 3444 | if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (check_default))) |
1597 | 3436 | { | 3445 | { |
1598 | 3437 | GError* error = NULL; | 3446 | GError* error = NULL; |
1599 | @@ -3441,14 +3450,14 @@ | |||
1600 | 3441 | g_clear_error (&error); | 3450 | g_clear_error (&error); |
1601 | 3442 | } | 3451 | } |
1602 | 3443 | } | 3452 | } |
1604 | 3444 | 3453 | ||
1605 | 3445 | gof_files_launch_with (selection, | 3454 | gof_files_launch_with (selection, |
1606 | 3446 | eel_gtk_widget_get_screen (GTK_WIDGET (view)), | 3455 | eel_gtk_widget_get_screen (GTK_WIDGET (view)), |
1607 | 3447 | app); | 3456 | app); |
1608 | 3448 | } | 3457 | } |
1609 | 3449 | 3458 | ||
1610 | 3450 | gtk_widget_destroy (GTK_WIDGET (dialog)); | 3459 | gtk_widget_destroy (GTK_WIDGET (dialog)); |
1612 | 3451 | gof_file_unref (file); | 3460 | gof_file_unref (file); |
1613 | 3452 | } | 3461 | } |
1614 | 3453 | 3462 | ||
1615 | 3454 | static void | 3463 | static void |
1616 | @@ -3457,7 +3466,7 @@ | |||
1617 | 3457 | g_assert (FM_IS_DIRECTORY_VIEW (view)); | 3466 | g_assert (FM_IS_DIRECTORY_VIEW (view)); |
1618 | 3458 | 3467 | ||
1619 | 3459 | GList *selection = fm_directory_view_get_selection (view); | 3468 | GList *selection = fm_directory_view_get_selection (view); |
1621 | 3460 | 3469 | ||
1622 | 3461 | if (selection != NULL) { | 3470 | if (selection != NULL) { |
1623 | 3462 | /* The reference counts of the selection list's members are incremented, | 3471 | /* The reference counts of the selection list's members are incremented, |
1624 | 3463 | * so that the members aren't freed by the properties window. */ | 3472 | * so that the members aren't freed by the properties window. */ |
1625 | @@ -3534,11 +3543,11 @@ | |||
1626 | 3534 | /* tooltip */ N_("Delete each selected item, without moving to the Trash"), | 3543 | /* tooltip */ N_("Delete each selected item, without moving to the Trash"), |
1627 | 3535 | G_CALLBACK (action_delete_callback) }, | 3544 | G_CALLBACK (action_delete_callback) }, |
1628 | 3536 | /* name, stock id */ { "Restore From Trash", NULL, | 3545 | /* name, stock id */ { "Restore From Trash", NULL, |
1630 | 3537 | /* label, accelerator */ N_("_Restore"), NULL, | 3546 | /* label, accelerator */ N_("_Restore"), NULL, |
1631 | 3538 | NULL, | 3547 | NULL, |
1632 | 3539 | G_CALLBACK (action_restore_from_trash_callback) }, | 3548 | G_CALLBACK (action_restore_from_trash_callback) }, |
1633 | 3540 | /* name, stock id */ { "Select All", NULL, | 3549 | /* name, stock id */ { "Select All", NULL, |
1635 | 3541 | /* label, accelerator */ N_("Select All"), "<control>A", | 3550 | /* label, accelerator */ N_("Select All"), "<control>A", |
1636 | 3542 | NULL, | 3551 | NULL, |
1637 | 3543 | G_CALLBACK (action_select_all) }, | 3552 | G_CALLBACK (action_select_all) }, |
1638 | 3544 | /* name, stock id */ { "Properties", GTK_STOCK_PROPERTIES, | 3553 | /* name, stock id */ { "Properties", GTK_STOCK_PROPERTIES, |
1639 | @@ -3554,7 +3563,7 @@ | |||
1640 | 3554 | { | 3563 | { |
1641 | 3555 | GtkUIManager *ui_manager; | 3564 | GtkUIManager *ui_manager; |
1642 | 3556 | 3565 | ||
1644 | 3557 | if (view->details->window == NULL) | 3566 | if (view->details->window == NULL) |
1645 | 3558 | return; | 3567 | return; |
1646 | 3559 | if (view->details->dir_action_group == NULL) | 3568 | if (view->details->dir_action_group == NULL) |
1647 | 3560 | return; | 3569 | return; |
1648 | @@ -3638,7 +3647,7 @@ | |||
1649 | 3638 | /* we have to make sure that we add our custom widget once in the menu */ | 3647 | /* we have to make sure that we add our custom widget once in the menu */ |
1650 | 3639 | static gboolean selection_menu_builded = FALSE; | 3648 | static gboolean selection_menu_builded = FALSE; |
1651 | 3640 | 3649 | ||
1653 | 3641 | if (!selection_menu_builded) | 3650 | if (!selection_menu_builded) |
1654 | 3642 | { | 3651 | { |
1655 | 3643 | GtkWidget *item; | 3652 | GtkWidget *item; |
1656 | 3644 | 3653 | ||
1657 | 3645 | 3654 | ||
1658 | === modified file 'src/fm-directory-view.h' | |||
1659 | --- src/fm-directory-view.h 2013-02-08 00:58:30 +0000 | |||
1660 | +++ src/fm-directory-view.h 2013-09-01 22:36:03 +0000 | |||
1661 | @@ -19,8 +19,8 @@ | |||
1662 | 19 | * Boston, MA 02111-1307, USA. | 19 | * Boston, MA 02111-1307, USA. |
1663 | 20 | * | 20 | * |
1664 | 21 | * Authors: Ettore Perazzoli | 21 | * Authors: Ettore Perazzoli |
1667 | 22 | * Darin Adler <darin@bentspoon.com> | 22 | * Darin Adler <darin@bentspoon.com> |
1668 | 23 | * John Sullivan <sullivan@eazel.com> | 23 | * John Sullivan <sullivan@eazel.com> |
1669 | 24 | * Pavel Cisler <pavel@eazel.com> | 24 | * Pavel Cisler <pavel@eazel.com> |
1670 | 25 | */ | 25 | */ |
1671 | 26 | 26 | ||
1672 | @@ -65,7 +65,7 @@ | |||
1673 | 65 | GtkCellRenderer *name_renderer; | 65 | GtkCellRenderer *name_renderer; |
1674 | 66 | MarlinZoomLevel zoom_level; | 66 | MarlinZoomLevel zoom_level; |
1675 | 67 | gboolean updates_frozen; | 67 | gboolean updates_frozen; |
1677 | 68 | 68 | const gchar* empty_message; | |
1678 | 69 | FMDirectoryViewDetails *details; | 69 | FMDirectoryViewDetails *details; |
1679 | 70 | }; | 70 | }; |
1680 | 71 | 71 | ||
1681 | @@ -75,24 +75,24 @@ | |||
1682 | 75 | /* The 'clear' signal is emitted to empty the view of its contents. | 75 | /* The 'clear' signal is emitted to empty the view of its contents. |
1683 | 76 | * It must be replaced by each subclass. | 76 | * It must be replaced by each subclass. |
1684 | 77 | */ | 77 | */ |
1686 | 78 | // void (* clear) (FMDirectoryView *view); | 78 | // void (* clear) (FMDirectoryView *view); |
1687 | 79 | 79 | ||
1688 | 80 | /* The 'begin_file_changes' signal is emitted before a set of files | 80 | /* The 'begin_file_changes' signal is emitted before a set of files |
1690 | 81 | * are added to the view. It can be replaced by a subclass to do any | 81 | * are added to the view. It can be replaced by a subclass to do any |
1691 | 82 | * necessary preparation for a set of new files. The default | 82 | * necessary preparation for a set of new files. The default |
1692 | 83 | * implementation does nothing. | 83 | * implementation does nothing. |
1693 | 84 | */ | 84 | */ |
1695 | 85 | //void (* begin_file_changes) (FMDirectoryView *view); | 85 | //void (* begin_file_changes) (FMDirectoryView *view); |
1696 | 86 | 86 | ||
1697 | 87 | /* The 'add_file' signal is emitted to add one file to the view. | 87 | /* The 'add_file' signal is emitted to add one file to the view. |
1698 | 88 | * It must be replaced by each subclass. | 88 | * It must be replaced by each subclass. |
1699 | 89 | */ | 89 | */ |
1701 | 90 | void (* add_file) (FMDirectoryView *view, | 90 | void (* add_file) (FMDirectoryView *view, |
1702 | 91 | GOFFile *file, | 91 | GOFFile *file, |
1703 | 92 | GOFDirectoryAsync *directory); | 92 | GOFDirectoryAsync *directory); |
1705 | 93 | void (* directory_loaded) (FMDirectoryView *view, | 93 | void (* directory_loaded) (FMDirectoryView *view, |
1706 | 94 | GOFDirectoryAsync *directory); | 94 | GOFDirectoryAsync *directory); |
1708 | 95 | void (* sync_selection) (FMDirectoryView *view); | 95 | void (* sync_selection) (FMDirectoryView *view); |
1709 | 96 | 96 | ||
1710 | 97 | 97 | ||
1711 | 98 | #if 0 | 98 | #if 0 |
1712 | @@ -100,29 +100,29 @@ | |||
1713 | 100 | * including the file being removed. | 100 | * including the file being removed. |
1714 | 101 | * It must be replaced by each subclass. | 101 | * It must be replaced by each subclass. |
1715 | 102 | */ | 102 | */ |
1717 | 103 | void (* file_changed) (FMDirectoryView *view, | 103 | void (* file_changed) (FMDirectoryView *view, |
1718 | 104 | GOFFile *file, | 104 | GOFFile *file, |
1719 | 105 | GOFDirectoryAsync *directory); | 105 | GOFDirectoryAsync *directory); |
1720 | 106 | 106 | ||
1721 | 107 | /* The 'end_file_changes' signal is emitted after a set of files | 107 | /* The 'end_file_changes' signal is emitted after a set of files |
1723 | 108 | * are added to the view. It can be replaced by a subclass to do any | 108 | * are added to the view. It can be replaced by a subclass to do any |
1724 | 109 | * necessary cleanup (typically, cleanup for code in begin_file_changes). | 109 | * necessary cleanup (typically, cleanup for code in begin_file_changes). |
1725 | 110 | * The default implementation does nothing. | 110 | * The default implementation does nothing. |
1726 | 111 | */ | 111 | */ |
1728 | 112 | //void (* end_file_changes) (FMDirectoryView *view); | 112 | //void (* end_file_changes) (FMDirectoryView *view); |
1729 | 113 | 113 | ||
1731 | 114 | //void (* flush_added_files) (FMDirectoryView *view); | 114 | //void (* flush_added_files) (FMDirectoryView *view); |
1732 | 115 | 115 | ||
1733 | 116 | /* The 'begin_loading' signal is emitted before any of the contents | 116 | /* The 'begin_loading' signal is emitted before any of the contents |
1735 | 117 | * of a directory are added to the view. It can be replaced by a | 117 | * of a directory are added to the view. It can be replaced by a |
1736 | 118 | * subclass to do any necessary preparation to start dealing with a | 118 | * subclass to do any necessary preparation to start dealing with a |
1737 | 119 | * new directory. The default implementation does nothing. | 119 | * new directory. The default implementation does nothing. |
1738 | 120 | */ | 120 | */ |
1740 | 121 | void (* begin_loading) (FMDirectoryView *view); | 121 | void (* begin_loading) (FMDirectoryView *view); |
1741 | 122 | 122 | ||
1742 | 123 | /* The 'end_loading' signal is emitted after all of the contents | 123 | /* The 'end_loading' signal is emitted after all of the contents |
1745 | 124 | * of a directory are added to the view. It can be replaced by a | 124 | * of a directory are added to the view. It can be replaced by a |
1746 | 125 | * subclass to do any necessary clean-up. The default implementation | 125 | * subclass to do any necessary clean-up. The default implementation |
1747 | 126 | * does nothing. | 126 | * does nothing. |
1748 | 127 | * | 127 | * |
1749 | 128 | * If all_files_seen is true, the handler may assume that | 128 | * If all_files_seen is true, the handler may assume that |
1750 | @@ -132,12 +132,12 @@ | |||
1751 | 132 | * Otherwise, end_loading was emitted due to cancellation, | 132 | * Otherwise, end_loading was emitted due to cancellation, |
1752 | 133 | * which usually means that not all files are available. | 133 | * which usually means that not all files are available. |
1753 | 134 | */ | 134 | */ |
1755 | 135 | void (* end_loading) (FMDirectoryView *view, | 135 | void (* end_loading) (FMDirectoryView *view, |
1756 | 136 | gboolean all_files_seen); | 136 | gboolean all_files_seen); |
1757 | 137 | 137 | ||
1758 | 138 | /* The 'load_error' signal is emitted when the directory model | 138 | /* The 'load_error' signal is emitted when the directory model |
1759 | 139 | * reports an error in the process of monitoring the directory's | 139 | * reports an error in the process of monitoring the directory's |
1761 | 140 | * contents. The load error indicates that the process of | 140 | * contents. The load error indicates that the process of |
1762 | 141 | * loading the contents has ended, but the directory is still | 141 | * loading the contents has ended, but the directory is still |
1763 | 142 | * being monitored. The default implementation handles common | 142 | * being monitored. The default implementation handles common |
1764 | 143 | * load failures like ACCESS_DENIED. | 143 | * load failures like ACCESS_DENIED. |
1765 | @@ -147,11 +147,11 @@ | |||
1766 | 147 | 147 | ||
1767 | 148 | /* Function pointers that don't have corresponding signals */ | 148 | /* Function pointers that don't have corresponding signals */ |
1768 | 149 | 149 | ||
1770 | 150 | /* reset_to_defaults is a function pointer that subclasses must | 150 | /* reset_to_defaults is a function pointer that subclasses must |
1771 | 151 | * override to set sort order, zoom level, etc to match default | 151 | * override to set sort order, zoom level, etc to match default |
1773 | 152 | * values. | 152 | * values. |
1774 | 153 | */ | 153 | */ |
1776 | 154 | void (* reset_to_defaults) (FMDirectoryView *view); | 154 | void (* reset_to_defaults) (FMDirectoryView *view); |
1777 | 155 | #endif | 155 | #endif |
1778 | 156 | 156 | ||
1779 | 157 | /* get_selection is not a signal; it is just a function pointer for | 157 | /* get_selection is not a signal; it is just a function pointer for |
1780 | @@ -159,7 +159,7 @@ | |||
1781 | 159 | * with a function that returns a newly-allocated GList of | 159 | * with a function that returns a newly-allocated GList of |
1782 | 160 | * GOFFile pointers. | 160 | * GOFFile pointers. |
1783 | 161 | */ | 161 | */ |
1785 | 162 | GList * (* get_selection) (FMDirectoryView *view); | 162 | GList * (* get_selection) (FMDirectoryView *view); |
1786 | 163 | 163 | ||
1787 | 164 | /* get_selection_for_file_transfer is a function pointer for | 164 | /* get_selection_for_file_transfer is a function pointer for |
1788 | 165 | * subclasses to replace (override). Subclasses must replace it | 165 | * subclasses to replace (override). Subclasses must replace it |
1789 | @@ -168,11 +168,11 @@ | |||
1790 | 168 | * that any files in the selection that also has a parent folder | 168 | * that any files in the selection that also has a parent folder |
1791 | 169 | * in the selection is not included. | 169 | * in the selection is not included. |
1792 | 170 | */ | 170 | */ |
1794 | 171 | GList * (* get_selection_for_file_transfer)(FMDirectoryView *view); | 171 | GList * (* get_selection_for_file_transfer)(FMDirectoryView *view); |
1795 | 172 | 172 | ||
1796 | 173 | /* Returns the list of currently selected GtkTreePath's, where | 173 | /* Returns the list of currently selected GtkTreePath's, where |
1797 | 174 | * both the list and the items are owned by the caller. */ | 174 | * both the list and the items are owned by the caller. */ |
1799 | 175 | GList * (* get_selected_paths) (FMDirectoryView *view); | 175 | GList * (* get_selected_paths) (FMDirectoryView *view); |
1800 | 176 | 176 | ||
1801 | 177 | /* Selects the given item */ | 177 | /* Selects the given item */ |
1802 | 178 | void (*select_path) (FMDirectoryView *view, GtkTreePath *path); | 178 | void (*select_path) (FMDirectoryView *view, GtkTreePath *path); |
1803 | @@ -192,19 +192,19 @@ | |||
1804 | 192 | #if 0 | 192 | #if 0 |
1805 | 193 | /* select_all is a function pointer that subclasses must override to | 193 | /* select_all is a function pointer that subclasses must override to |
1806 | 194 | * select all of the items in the view */ | 194 | * select all of the items in the view */ |
1808 | 195 | void (* select_all) (FMDirectoryView *view); | 195 | void (* select_all) (FMDirectoryView *view); |
1809 | 196 | 196 | ||
1810 | 197 | /* set_selection is a function pointer that subclasses must | 197 | /* set_selection is a function pointer that subclasses must |
1811 | 198 | * override to select the specified items (and unselect all | 198 | * override to select the specified items (and unselect all |
1812 | 199 | * others). The argument is a list of GOFFiles. */ | 199 | * others). The argument is a list of GOFFiles. */ |
1813 | 200 | 200 | ||
1815 | 201 | void (* set_selection) (FMDirectoryView *view, | 201 | void (* set_selection) (FMDirectoryView *view, |
1816 | 202 | GList *selection); | 202 | GList *selection); |
1818 | 203 | 203 | ||
1819 | 204 | /* invert_selection is a function pointer that subclasses must | 204 | /* invert_selection is a function pointer that subclasses must |
1820 | 205 | * override to invert selection. */ | 205 | * override to invert selection. */ |
1821 | 206 | 206 | ||
1823 | 207 | void (* invert_selection) (FMDirectoryView *view); | 207 | void (* invert_selection) (FMDirectoryView *view); |
1824 | 208 | 208 | ||
1825 | 209 | /* Return an array of locations of selected icons in their view. */ | 209 | /* Return an array of locations of selected icons in their view. */ |
1826 | 210 | //GArray * (* get_selected_icon_locations) (FMDirectoryView *view); | 210 | //GArray * (* get_selected_icon_locations) (FMDirectoryView *view); |
1827 | @@ -213,12 +213,12 @@ | |||
1828 | 213 | 213 | ||
1829 | 214 | /* bump_zoom_level is a function pointer that subclasses must override | 214 | /* bump_zoom_level is a function pointer that subclasses must override |
1830 | 215 | * to change the zoom level of an object. */ | 215 | * to change the zoom level of an object. */ |
1832 | 216 | /*void (* bump_zoom_level) (FMDirectoryView *view, | 216 | /*void (* bump_zoom_level) (FMDirectoryView *view, |
1833 | 217 | int zoom_increment);*/ | 217 | int zoom_increment);*/ |
1834 | 218 | 218 | ||
1835 | 219 | /* zoom_to_level is a function pointer that subclasses must override | 219 | /* zoom_to_level is a function pointer that subclasses must override |
1836 | 220 | * to set the zoom level of an object to the specified level. */ | 220 | * to set the zoom level of an object to the specified level. */ |
1838 | 221 | /*void (* zoom_to_level) (FMDirectoryView *view, | 221 | /*void (* zoom_to_level) (FMDirectoryView *view, |
1839 | 222 | NautilusZoomLevel level);*/ | 222 | NautilusZoomLevel level);*/ |
1840 | 223 | 223 | ||
1841 | 224 | //NautilusZoomLevel (* get_zoom_level) (FMDirectoryView *view); | 224 | //NautilusZoomLevel (* get_zoom_level) (FMDirectoryView *view); |
1842 | @@ -229,39 +229,39 @@ | |||
1843 | 229 | 229 | ||
1844 | 230 | /* can_zoom_in is a function pointer that subclasses must override to | 230 | /* can_zoom_in is a function pointer that subclasses must override to |
1845 | 231 | * return whether the view is at maximum size (furthest-in zoom level) */ | 231 | * return whether the view is at maximum size (furthest-in zoom level) */ |
1847 | 232 | //gboolean (* can_zoom_in) (FMDirectoryView *view); | 232 | //gboolean (* can_zoom_in) (FMDirectoryView *view); |
1848 | 233 | 233 | ||
1849 | 234 | /* can_zoom_out is a function pointer that subclasses must override to | 234 | /* can_zoom_out is a function pointer that subclasses must override to |
1850 | 235 | * return whether the view is at minimum size (furthest-out zoom level) */ | 235 | * return whether the view is at minimum size (furthest-out zoom level) */ |
1852 | 236 | //gboolean (* can_zoom_out) (FMDirectoryView *view); | 236 | //gboolean (* can_zoom_out) (FMDirectoryView *view); |
1853 | 237 | 237 | ||
1854 | 238 | /* reveal_selection is a function pointer that subclasses may | 238 | /* reveal_selection is a function pointer that subclasses may |
1855 | 239 | * override to make sure the selected items are sufficiently | 239 | * override to make sure the selected items are sufficiently |
1856 | 240 | * apparent to the user (e.g., scrolled into view). By default, | 240 | * apparent to the user (e.g., scrolled into view). By default, |
1857 | 241 | * this does nothing. | 241 | * this does nothing. |
1858 | 242 | */ | 242 | */ |
1860 | 243 | void (* reveal_selection) (FMDirectoryView *view); | 243 | void (* reveal_selection) (FMDirectoryView *view); |
1861 | 244 | 244 | ||
1862 | 245 | /* get_background is a function pointer that subclasses must | 245 | /* get_background is a function pointer that subclasses must |
1863 | 246 | * override to return the EelBackground for this view. | 246 | * override to return the EelBackground for this view. |
1864 | 247 | */ | 247 | */ |
1866 | 248 | //GtkWidget * (* get_background_widget) (FMDirectoryView *view); | 248 | //GtkWidget * (* get_background_widget) (FMDirectoryView *view); |
1867 | 249 | #endif | 249 | #endif |
1868 | 250 | 250 | ||
1869 | 251 | /* merge_menus is a function pointer that subclasses can override to | 251 | /* merge_menus is a function pointer that subclasses can override to |
1870 | 252 | * add their own menu items to the window's menu bar. | 252 | * add their own menu items to the window's menu bar. |
1871 | 253 | * If overridden, subclasses must call parent class's function. | 253 | * If overridden, subclasses must call parent class's function. |
1872 | 254 | */ | 254 | */ |
1875 | 255 | void (* merge_menus) (FMDirectoryView *view); | 255 | void (* merge_menus) (FMDirectoryView *view); |
1876 | 256 | void (* unmerge_menus) (FMDirectoryView *view); | 256 | void (* unmerge_menus) (FMDirectoryView *view); |
1877 | 257 | 257 | ||
1878 | 258 | #if 0 | 258 | #if 0 |
1879 | 259 | /* update_menus is a function pointer that subclasses can override to | 259 | /* update_menus is a function pointer that subclasses can override to |
1880 | 260 | * update the sensitivity or wording of menu items in the menu bar. | 260 | * update the sensitivity or wording of menu items in the menu bar. |
1882 | 261 | * It is called (at least) whenever the selection changes. If overridden, | 261 | * It is called (at least) whenever the selection changes. If overridden, |
1883 | 262 | * subclasses must call parent class's function. | 262 | * subclasses must call parent class's function. |
1884 | 263 | */ | 263 | */ |
1886 | 264 | //void (* update_menus) (FMDirectoryView *view); | 264 | //void (* update_menus) (FMDirectoryView *view); |
1887 | 265 | 265 | ||
1888 | 266 | /* sort_files is a function pointer that subclasses can override | 266 | /* sort_files is a function pointer that subclasses can override |
1889 | 267 | * to provide a sorting order to determine which files should be | 267 | * to provide a sorting order to determine which files should be |
1890 | @@ -276,7 +276,7 @@ | |||
1891 | 276 | * be displayed with each file. By default, all emblems returned by | 276 | * be displayed with each file. By default, all emblems returned by |
1892 | 277 | * GOFFile are displayed. | 277 | * GOFFile are displayed. |
1893 | 278 | */ | 278 | */ |
1895 | 279 | //char ** (* get_emblem_names_to_exclude) (FMDirectoryView *view); | 279 | //char ** (* get_emblem_names_to_exclude) (FMDirectoryView *view); |
1896 | 280 | 280 | ||
1897 | 281 | /* file_limit_reached is a function pointer that subclasses may | 281 | /* file_limit_reached is a function pointer that subclasses may |
1898 | 282 | * override to control what happens when a directory is loaded | 282 | * override to control what happens when a directory is loaded |
1899 | @@ -285,21 +285,21 @@ | |||
1900 | 285 | * display when the user explicitly tried to visit a location that | 285 | * display when the user explicitly tried to visit a location that |
1901 | 286 | * they would think of as a normal directory. | 286 | * they would think of as a normal directory. |
1902 | 287 | */ | 287 | */ |
1904 | 288 | //void (* file_limit_reached) (FMDirectoryView *view); | 288 | //void (* file_limit_reached) (FMDirectoryView *view); |
1905 | 289 | 289 | ||
1906 | 290 | /* supports_properties is a function pointer that subclasses may | 290 | /* supports_properties is a function pointer that subclasses may |
1907 | 291 | * override to control whether the "Show Properties" menu item | 291 | * override to control whether the "Show Properties" menu item |
1909 | 292 | * should be enabled for selected items. The default implementation | 292 | * should be enabled for selected items. The default implementation |
1910 | 293 | * returns TRUE. | 293 | * returns TRUE. |
1911 | 294 | */ | 294 | */ |
1913 | 295 | //gboolean (* supports_properties) (FMDirectoryView *view); | 295 | //gboolean (* supports_properties) (FMDirectoryView *view); |
1914 | 296 | 296 | ||
1915 | 297 | /* supports_zooming is a function pointer that subclasses may | 297 | /* supports_zooming is a function pointer that subclasses may |
1916 | 298 | * override to control whether or not the zooming control and | 298 | * override to control whether or not the zooming control and |
1917 | 299 | * menu items should be enabled. The default implementation | 299 | * menu items should be enabled. The default implementation |
1918 | 300 | * returns TRUE. | 300 | * returns TRUE. |
1919 | 301 | */ | 301 | */ |
1921 | 302 | //gboolean (* supports_zooming) (FMDirectoryView *view); | 302 | //gboolean (* supports_zooming) (FMDirectoryView *view); |
1922 | 303 | 303 | ||
1923 | 304 | /* using_manual_layout is a function pointer that subclasses may | 304 | /* using_manual_layout is a function pointer that subclasses may |
1924 | 305 | * override to control whether or not items can be freely positioned | 305 | * override to control whether or not items can be freely positioned |
1925 | @@ -314,7 +314,7 @@ | |||
1926 | 314 | * default implementation checks the permissions of the | 314 | * default implementation checks the permissions of the |
1927 | 315 | * directory. | 315 | * directory. |
1928 | 316 | */ | 316 | */ |
1930 | 317 | gboolean (* is_read_only) (FMDirectoryView *view); | 317 | gboolean (* is_read_only) (FMDirectoryView *view); |
1931 | 318 | 318 | ||
1932 | 319 | /* is_empty is a function pointer that subclasses must | 319 | /* is_empty is a function pointer that subclasses must |
1933 | 320 | * override to report whether the view contains any items. | 320 | * override to report whether the view contains any items. |
1934 | @@ -327,13 +327,13 @@ | |||
1935 | 327 | * user has write permissions for the viewed directory, and whether | 327 | * user has write permissions for the viewed directory, and whether |
1936 | 328 | * the viewed directory is in the trash. | 328 | * the viewed directory is in the trash. |
1937 | 329 | */ | 329 | */ |
1939 | 330 | gboolean (* supports_creating_files) (FMDirectoryView *view); | 330 | gboolean (* supports_creating_files) (FMDirectoryView *view); |
1940 | 331 | 331 | ||
1941 | 332 | /* accepts_dragged_files is a function pointer that subclasses may | 332 | /* accepts_dragged_files is a function pointer that subclasses may |
1942 | 333 | * override to control whether or not files can be dropped in this | 333 | * override to control whether or not files can be dropped in this |
1943 | 334 | * location. The default implementation returns TRUE. | 334 | * location. The default implementation returns TRUE. |
1944 | 335 | */ | 335 | */ |
1946 | 336 | //gboolean (* accepts_dragged_files) (FMDirectoryView *view); | 336 | //gboolean (* accepts_dragged_files) (FMDirectoryView *view); |
1947 | 337 | 337 | ||
1948 | 338 | /*gboolean (* can_rename_file) (FMDirectoryView *view, | 338 | /*gboolean (* can_rename_file) (FMDirectoryView *view, |
1949 | 339 | GOFFile *file);*/ | 339 | GOFFile *file);*/ |
1950 | @@ -341,12 +341,12 @@ | |||
1951 | 341 | /* select_all specifies whether the whole filename should be selected | 341 | /* select_all specifies whether the whole filename should be selected |
1952 | 342 | * or only its basename (i.e. everything except the extension) | 342 | * or only its basename (i.e. everything except the extension) |
1953 | 343 | * */ | 343 | * */ |
1955 | 344 | void (* start_renaming_file) (FMDirectoryView *view, | 344 | void (* start_renaming_file) (FMDirectoryView *view, |
1956 | 345 | GOFFile *file, | 345 | GOFFile *file, |
1957 | 346 | gboolean select_all); | 346 | gboolean select_all); |
1958 | 347 | #if 0 | 347 | #if 0 |
1961 | 348 | /*gboolean (* file_still_belongs) (FMDirectoryView *view, | 348 | /*gboolean (* file_still_belongs) (FMDirectoryView *view, |
1962 | 349 | GOFFile *file, | 349 | GOFFile *file, |
1963 | 350 | GOFDirectoryAsync *directory); | 350 | GOFDirectoryAsync *directory); |
1964 | 351 | */ | 351 | */ |
1965 | 352 | 352 | ||
1966 | @@ -360,17 +360,17 @@ | |||
1967 | 360 | GdkPoint | 360 | GdkPoint |
1968 | 361 | *position);*/ | 361 | *position);*/ |
1969 | 362 | 362 | ||
1971 | 363 | /* Preference change callbacks, overriden by icon and list views. | 363 | /* Preference change callbacks, overriden by icon and list views. |
1972 | 364 | * Icon and list views respond by synchronizing to the new preference | 364 | * Icon and list views respond by synchronizing to the new preference |
1973 | 365 | * values and forcing an update if appropriate. | 365 | * values and forcing an update if appropriate. |
1974 | 366 | */ | 366 | */ |
1980 | 367 | /*void (* text_attribute_names_changed) (FMDirectoryView *view); | 367 | /*void (* text_attribute_names_changed) (FMDirectoryView *view); |
1981 | 368 | void (* embedded_text_policy_changed) (FMDirectoryView *view); | 368 | void (* embedded_text_policy_changed) (FMDirectoryView *view); |
1982 | 369 | void (* image_display_policy_changed) (FMDirectoryView *view); | 369 | void (* image_display_policy_changed) (FMDirectoryView *view); |
1983 | 370 | void (* click_policy_changed) (FMDirectoryView *view); | 370 | void (* click_policy_changed) (FMDirectoryView *view); |
1984 | 371 | void (* sort_directories_first_changed) (FMDirectoryView *view); | 371 | void (* sort_directories_first_changed) (FMDirectoryView *view); |
1985 | 372 | 372 | ||
1987 | 373 | void (* emblems_changed) (FMDirectoryView *view); | 373 | void (* emblems_changed) (FMDirectoryView *view); |
1988 | 374 | 374 | ||
1989 | 375 | void (* set_is_active) (FMDirectoryView *view, | 375 | void (* set_is_active) (FMDirectoryView *view, |
1990 | 376 | gboolean | 376 | gboolean |
1991 | 377 | 377 | ||
1992 | === modified file 'src/gof-window-slot.c' | |||
1993 | --- src/gof-window-slot.c 2013-06-27 19:34:48 +0000 | |||
1994 | +++ src/gof-window-slot.c 2013-09-01 22:36:03 +0000 | |||
1995 | @@ -46,12 +46,13 @@ | |||
1996 | 46 | { | 46 | { |
1997 | 47 | slot->content_box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); | 47 | slot->content_box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); |
1998 | 48 | slot->width = 0; | 48 | slot->width = 0; |
1999 | 49 | slot->ready_to_autosize = FALSE; | ||
2000 | 49 | GOF_ABSTRACT_SLOT (slot)->extra_location_widgets = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); | 50 | GOF_ABSTRACT_SLOT (slot)->extra_location_widgets = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); |
2001 | 50 | gtk_box_pack_start (GTK_BOX (slot->content_box), GOF_ABSTRACT_SLOT(slot)->extra_location_widgets, FALSE, FALSE, 0); | 51 | gtk_box_pack_start (GTK_BOX (slot->content_box), GOF_ABSTRACT_SLOT(slot)->extra_location_widgets, FALSE, FALSE, 0); |
2002 | 51 | } | 52 | } |
2003 | 52 | 53 | ||
2004 | 53 | static void | 54 | static void |
2006 | 54 | real_active (GOFWindowSlot *slot) | 55 | real_active (GOFWindowSlot *slot) |
2007 | 55 | { | 56 | { |
2008 | 56 | marlin_view_view_container_refresh_slot_info (MARLIN_VIEW_VIEW_CONTAINER (slot->ctab)); | 57 | marlin_view_view_container_refresh_slot_info (MARLIN_VIEW_VIEW_CONTAINER (slot->ctab)); |
2009 | 57 | } | 58 | } |
2010 | @@ -60,22 +61,22 @@ | |||
2011 | 60 | gof_window_slot_class_init (GOFWindowSlotClass *class) | 61 | gof_window_slot_class_init (GOFWindowSlotClass *class) |
2012 | 61 | { | 62 | { |
2013 | 62 | signals[ACTIVE] = | 63 | signals[ACTIVE] = |
2021 | 63 | g_signal_new ("active", | 64 | g_signal_new ("active", |
2022 | 64 | G_TYPE_FROM_CLASS (class), | 65 | G_TYPE_FROM_CLASS (class), |
2023 | 65 | G_SIGNAL_RUN_LAST, | 66 | G_SIGNAL_RUN_LAST, |
2024 | 66 | G_STRUCT_OFFSET (GOFWindowSlotClass, active), | 67 | G_STRUCT_OFFSET (GOFWindowSlotClass, active), |
2025 | 67 | NULL, NULL, | 68 | NULL, NULL, |
2026 | 68 | g_cclosure_marshal_VOID__VOID, | 69 | g_cclosure_marshal_VOID__VOID, |
2027 | 69 | G_TYPE_NONE, 0); | 70 | G_TYPE_NONE, 0); |
2028 | 70 | 71 | ||
2029 | 71 | signals[INACTIVE] = | 72 | signals[INACTIVE] = |
2037 | 72 | g_signal_new ("inactive", | 73 | g_signal_new ("inactive", |
2038 | 73 | G_TYPE_FROM_CLASS (class), | 74 | G_TYPE_FROM_CLASS (class), |
2039 | 74 | G_SIGNAL_RUN_LAST, | 75 | G_SIGNAL_RUN_LAST, |
2040 | 75 | G_STRUCT_OFFSET (GOFWindowSlotClass, inactive), | 76 | G_STRUCT_OFFSET (GOFWindowSlotClass, inactive), |
2041 | 76 | NULL, NULL, | 77 | NULL, NULL, |
2042 | 77 | g_cclosure_marshal_VOID__VOID, | 78 | g_cclosure_marshal_VOID__VOID, |
2043 | 78 | G_TYPE_NONE, 0); | 79 | G_TYPE_NONE, 0); |
2044 | 79 | 80 | ||
2045 | 80 | G_OBJECT_CLASS (class)->finalize = gof_window_slot_finalize; | 81 | G_OBJECT_CLASS (class)->finalize = gof_window_slot_finalize; |
2046 | 81 | class->active = real_active; | 82 | class->active = real_active; |
2047 | @@ -87,10 +88,12 @@ | |||
2048 | 87 | GOFWindowSlot *slot = GOF_WINDOW_SLOT (object); | 88 | GOFWindowSlot *slot = GOF_WINDOW_SLOT (object); |
2049 | 88 | 89 | ||
2050 | 89 | //load_dir_async_cancel(slot->directory); | 90 | //load_dir_async_cancel(slot->directory); |
2052 | 90 | g_debug ("%s %s\n", G_STRFUNC, slot->directory->file->uri); | 91 | g_debug ("%s %s finalizing\n", G_STRFUNC, slot->directory->file->uri); |
2053 | 91 | //g_warning ("%s %s %u\n", G_STRFUNC, slot->directory->file->uri, G_OBJECT (slot->directory)->ref_count); | 92 | //g_warning ("%s %s %u\n", G_STRFUNC, slot->directory->file->uri, G_OBJECT (slot->directory)->ref_count); |
2054 | 93 | g_signal_handlers_disconnect_by_data (slot->directory, slot); | ||
2055 | 92 | g_object_unref(slot->directory); | 94 | g_object_unref(slot->directory); |
2056 | 93 | g_object_unref(slot->location); | 95 | g_object_unref(slot->location); |
2057 | 96 | |||
2058 | 94 | G_OBJECT_CLASS (parent_class)->finalize (object); | 97 | G_OBJECT_CLASS (parent_class)->finalize (object); |
2059 | 95 | /* avoid a warning in vala code: slot is freed in ViewContainer */ | 98 | /* avoid a warning in vala code: slot is freed in ViewContainer */ |
2060 | 96 | //slot = NULL; | 99 | //slot = NULL; |
2061 | @@ -100,7 +103,7 @@ | |||
2062 | 100 | update_total_width (GtkWidget *widget, GtkAllocation *allocation, void *data) | 103 | update_total_width (GtkWidget *widget, GtkAllocation *allocation, void *data) |
2063 | 101 | { | 104 | { |
2064 | 102 | GOFWindowSlot* slot = data; | 105 | GOFWindowSlot* slot = data; |
2066 | 103 | 106 | ||
2067 | 104 | if (slot->mwcols->total_width != 0 && slot->width != allocation->width) { | 107 | if (slot->mwcols->total_width != 0 && slot->width != allocation->width) { |
2068 | 105 | slot->mwcols->total_width += allocation->width - slot->width; | 108 | slot->mwcols->total_width += allocation->width - slot->width; |
2069 | 106 | slot->width = allocation->width; | 109 | slot->width = allocation->width; |
2070 | @@ -114,11 +117,11 @@ | |||
2071 | 114 | GtkWidget *hpane = GTK_WIDGET (granite_widgets_thin_paned_new (GTK_ORIENTATION_HORIZONTAL)); | 117 | GtkWidget *hpane = GTK_WIDGET (granite_widgets_thin_paned_new (GTK_ORIENTATION_HORIZONTAL)); |
2072 | 115 | gtk_widget_set_hexpand(hpane, TRUE); | 118 | gtk_widget_set_hexpand(hpane, TRUE); |
2073 | 116 | gtk_widget_show (hpane); | 119 | gtk_widget_show (hpane); |
2075 | 117 | 120 | ||
2076 | 118 | gtk_container_add(GTK_CONTAINER (slot->colpane), hpane); | 121 | gtk_container_add(GTK_CONTAINER (slot->colpane), hpane); |
2077 | 119 | gtk_widget_show_all(slot->colpane); | 122 | gtk_widget_show_all(slot->colpane); |
2080 | 120 | 123 | ||
2081 | 121 | GtkWidget *box1 = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); | 124 | GtkWidget *box1 = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); |
2082 | 122 | gtk_widget_show_all (box1); | 125 | gtk_widget_show_all (box1); |
2083 | 123 | 126 | ||
2084 | 124 | slot->colpane = box1; | 127 | slot->colpane = box1; |
2085 | @@ -131,6 +134,69 @@ | |||
2086 | 131 | 134 | ||
2087 | 132 | gtk_paned_pack1 (GTK_PANED (hpane), column, FALSE, FALSE); | 135 | gtk_paned_pack1 (GTK_PANED (hpane), column, FALSE, FALSE); |
2088 | 133 | gtk_paned_pack2 (GTK_PANED (hpane), box1, TRUE, FALSE); | 136 | gtk_paned_pack2 (GTK_PANED (hpane), box1, TRUE, FALSE); |
2089 | 137 | |||
2090 | 138 | /* If the directory finished loading before slot was ready then autosize the slot now. | ||
2091 | 139 | * Otherwise the slot will be autosized by the directory_done_loading callback | ||
2092 | 140 | * This is necessary because the directory loads faster from the cache than from disk | ||
2093 | 141 | * On first use the directory loads from disk and we reach here before the directory | ||
2094 | 142 | * has finished loading. | ||
2095 | 143 | * On subsequent uses, the directory loads from cache before the slot is ready. | ||
2096 | 144 | * Whichever finishes first sets slot->ready_to_autosize = TRUE | ||
2097 | 145 | * Whichever finds slot->ready_to_autosize = TRUE does the autosizing. | ||
2098 | 146 | */ | ||
2099 | 147 | |||
2100 | 148 | if (slot->ready_to_autosize) | ||
2101 | 149 | autosize_slot (slot); | ||
2102 | 150 | else { | ||
2103 | 151 | slot->ready_to_autosize = TRUE; | ||
2104 | 152 | } | ||
2105 | 153 | } | ||
2106 | 154 | |||
2107 | 155 | void autosize_slot (GOFWindowSlot *slot) | ||
2108 | 156 | { | ||
2109 | 157 | g_return_if_fail (GOF_IS_WINDOW_SLOT (slot)); | ||
2110 | 158 | g_return_if_fail (slot->view_box != NULL); | ||
2111 | 159 | g_return_if_fail (GTK_IS_WIDGET (slot->view_box)); | ||
2112 | 160 | g_return_if_fail (GOF_DIRECTORY_IS_ASYNC (slot->directory)); | ||
2113 | 161 | g_return_if_fail (slot->mwcols != NULL); | ||
2114 | 162 | |||
2115 | 163 | PangoLayout* layout = gtk_widget_create_pango_layout (GTK_WIDGET (slot->view_box), NULL); | ||
2116 | 164 | |||
2117 | 165 | if (gof_directory_async_is_empty (slot->directory)) | ||
2118 | 166 | pango_layout_set_markup (layout, FM_DIRECTORY_VIEW (slot->view_box)->empty_message, -1); | ||
2119 | 167 | else | ||
2120 | 168 | pango_layout_set_markup (layout, | ||
2121 | 169 | g_markup_escape_text (slot->directory->longest_file_name, -1), | ||
2122 | 170 | -1); | ||
2123 | 171 | |||
2124 | 172 | PangoRectangle extents; | ||
2125 | 173 | pango_layout_get_extents (layout, NULL, &extents); | ||
2126 | 174 | |||
2127 | 175 | gint column_width = (int) pango_units_to_double(extents.width) | ||
2128 | 176 | + 2 * slot->directory->icon_size | ||
2129 | 177 | + 2 * slot->mwcols->handle_size | ||
2130 | 178 | + 12; | ||
2131 | 179 | |||
2132 | 180 | gint min_width = slot->mwcols->preferred_column_width / 2; | ||
2133 | 181 | |||
2134 | 182 | if (column_width < min_width) | ||
2135 | 183 | column_width = min_width; | ||
2136 | 184 | else { | ||
2137 | 185 | //TODO make max_width a setting | ||
2138 | 186 | gint max_width = 2 * slot->mwcols->preferred_column_width; | ||
2139 | 187 | if (column_width > max_width) | ||
2140 | 188 | column_width = max_width; | ||
2141 | 189 | } | ||
2142 | 190 | |||
2143 | 191 | if (slot->slot_number == 0) | ||
2144 | 192 | gtk_widget_set_size_request (gtk_paned_get_child1 (GTK_PANED (slot->hpane)), column_width, -1); | ||
2145 | 193 | else | ||
2146 | 194 | gtk_paned_set_position (GTK_PANED (slot->hpane), column_width); | ||
2147 | 195 | slot->width = column_width; | ||
2148 | 196 | |||
2149 | 197 | gtk_widget_show_all (slot->mwcols->colpane); | ||
2150 | 198 | gtk_widget_queue_draw (slot->mwcols->colpane); | ||
2151 | 199 | |||
2152 | 134 | } | 200 | } |
2153 | 135 | 201 | ||
2154 | 136 | void | 202 | void |
2155 | @@ -139,10 +205,10 @@ | |||
2156 | 139 | gint current_slot_position = 0; | 205 | gint current_slot_position = 0; |
2157 | 140 | gint i; | 206 | gint i; |
2158 | 141 | GList* list_slot = slot->mwcols->slot; | 207 | GList* list_slot = slot->mwcols->slot; |
2160 | 142 | 208 | ||
2161 | 143 | g_return_if_fail (slot->colpane != NULL); | 209 | g_return_if_fail (slot->colpane != NULL); |
2162 | 144 | gtk_container_foreach (GTK_CONTAINER (slot->colpane), (GtkCallback)gtk_widget_destroy, NULL); | 210 | gtk_container_foreach (GTK_CONTAINER (slot->colpane), (GtkCallback)gtk_widget_destroy, NULL); |
2164 | 145 | 211 | ||
2165 | 146 | current_slot_position = g_list_index(slot->mwcols->slot, slot); | 212 | current_slot_position = g_list_index(slot->mwcols->slot, slot); |
2166 | 147 | if(current_slot_position == -1) { | 213 | if(current_slot_position == -1) { |
2167 | 148 | g_warning ("Can't find the slot you are viewing, this should *not* happen."); | 214 | g_warning ("Can't find the slot you are viewing, this should *not* happen."); |
2168 | @@ -157,9 +223,11 @@ | |||
2169 | 157 | g_list_free (slot->mwcols->slot); | 223 | g_list_free (slot->mwcols->slot); |
2170 | 158 | slot->mwcols->slot = l; | 224 | slot->mwcols->slot = l; |
2171 | 159 | } | 225 | } |
2174 | 160 | slot->mwcols->total_width += slot->mwcols->preferred_column_width + 100; | 226 | |
2173 | 161 | gtk_widget_set_size_request (slot->mwcols->colpane, slot->mwcols->total_width, -1); | ||
2175 | 162 | marlin_window_columns_add (slot->mwcols, location); | 227 | marlin_window_columns_add (slot->mwcols, location); |
2176 | 228 | |||
2177 | 229 | slot->mwcols->total_width += slot->width + 100; | ||
2178 | 230 | gtk_widget_set_size_request (slot->mwcols->colpane, slot->mwcols->total_width, -1); | ||
2179 | 163 | } | 231 | } |
2180 | 164 | 232 | ||
2181 | 165 | GOFWindowSlot * | 233 | GOFWindowSlot * |
2182 | @@ -191,8 +259,10 @@ | |||
2183 | 191 | slot->view_box = GTK_WIDGET (g_object_new (FM_TYPE_ICON_VIEW, | 259 | slot->view_box = GTK_WIDGET (g_object_new (FM_TYPE_ICON_VIEW, |
2184 | 192 | "window-slot", slot, NULL)); | 260 | "window-slot", slot, NULL)); |
2185 | 193 | gtk_box_pack_start(GTK_BOX (slot->content_box), slot->view_box, TRUE, TRUE, 0); | 261 | gtk_box_pack_start(GTK_BOX (slot->content_box), slot->view_box, TRUE, TRUE, 0); |
2187 | 194 | 262 | ||
2188 | 195 | marlin_view_view_container_set_content ((MarlinViewViewContainer *) slot->ctab, slot->content_box); | 263 | marlin_view_view_container_set_content ((MarlinViewViewContainer *) slot->ctab, slot->content_box); |
2189 | 264 | |||
2190 | 265 | slot->directory->track_longest_name = FALSE; | ||
2191 | 196 | gof_directory_async_load (slot->directory); | 266 | gof_directory_async_load (slot->directory); |
2192 | 197 | } | 267 | } |
2193 | 198 | 268 | ||
2194 | @@ -207,6 +277,8 @@ | |||
2195 | 207 | "window-slot", slot, NULL)); | 277 | "window-slot", slot, NULL)); |
2196 | 208 | gtk_box_pack_start (GTK_BOX (slot->content_box), slot->view_box, TRUE, TRUE, 0); | 278 | gtk_box_pack_start (GTK_BOX (slot->content_box), slot->view_box, TRUE, TRUE, 0); |
2197 | 209 | marlin_view_view_container_set_content ((MarlinViewViewContainer *) slot->ctab, slot->content_box); | 279 | marlin_view_view_container_set_content ((MarlinViewViewContainer *) slot->ctab, slot->content_box); |
2198 | 280 | |||
2199 | 281 | slot->directory->track_longest_name = FALSE; | ||
2200 | 210 | gof_directory_async_load (slot->directory); | 282 | gof_directory_async_load (slot->directory); |
2201 | 211 | } | 283 | } |
2202 | 212 | 284 | ||
2203 | @@ -224,6 +296,7 @@ | |||
2204 | 224 | { | 296 | { |
2205 | 225 | slot->view_box = GTK_WIDGET (g_object_new (FM_TYPE_COLUMNS_VIEW, | 297 | slot->view_box = GTK_WIDGET (g_object_new (FM_TYPE_COLUMNS_VIEW, |
2206 | 226 | "window-slot", slot, NULL)); | 298 | "window-slot", slot, NULL)); |
2207 | 299 | slot->directory->track_longest_name = TRUE; | ||
2208 | 227 | gof_directory_async_load (slot->directory); | 300 | gof_directory_async_load (slot->directory); |
2209 | 228 | } | 301 | } |
2210 | 229 | 302 | ||
2211 | @@ -233,8 +306,10 @@ | |||
2212 | 233 | { | 306 | { |
2213 | 234 | g_return_if_fail (GOF_IS_WINDOW_SLOT (slot)); | 307 | g_return_if_fail (GOF_IS_WINDOW_SLOT (slot)); |
2214 | 235 | 308 | ||
2216 | 236 | if (slot->mwcols) | 309 | if (slot->mwcols != NULL) { |
2217 | 237 | marlin_window_columns_active_slot (slot->mwcols, slot); | 310 | marlin_window_columns_active_slot (slot->mwcols, slot); |
2218 | 311 | autosize_slot (slot); | ||
2219 | 312 | } | ||
2220 | 238 | } | 313 | } |
2221 | 239 | 314 | ||
2222 | 240 | void | 315 | void |
2223 | 241 | 316 | ||
2224 | === modified file 'src/gof-window-slot.h' | |||
2225 | --- src/gof-window-slot.h 2013-06-27 19:34:48 +0000 | |||
2226 | +++ src/gof-window-slot.h 2013-09-01 22:36:03 +0000 | |||
2227 | @@ -25,9 +25,9 @@ | |||
2228 | 25 | #include "marlincore.h" | 25 | #include "marlincore.h" |
2229 | 26 | #include "marlin-window-columns.h" | 26 | #include "marlin-window-columns.h" |
2230 | 27 | 27 | ||
2232 | 28 | #define GOF_TYPE_WINDOW_SLOT (gof_window_slot_get_type()) | 28 | #define GOF_TYPE_WINDOW_SLOT (gof_window_slot_get_type()) |
2233 | 29 | #define GOF_WINDOW_SLOT_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GOF_TYPE_WINDOW_SLOT, GOFWindowSlotClass)) | 29 | #define GOF_WINDOW_SLOT_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GOF_TYPE_WINDOW_SLOT, GOFWindowSlotClass)) |
2235 | 30 | #define GOF_WINDOW_SLOT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GOF_TYPE_WINDOW_SLOT, GOFWindowSlot)) | 30 | #define GOF_WINDOW_SLOT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GOF_TYPE_WINDOW_SLOT, GOFWindowSlot)) |
2236 | 31 | #define GOF_IS_WINDOW_SLOT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GOF_TYPE_WINDOW_SLOT)) | 31 | #define GOF_IS_WINDOW_SLOT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GOF_TYPE_WINDOW_SLOT)) |
2237 | 32 | #define GOF_IS_WINDOW_SLOT_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GOF_TYPE_WINDOW_SLOT)) | 32 | #define GOF_IS_WINDOW_SLOT_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GOF_TYPE_WINDOW_SLOT)) |
2238 | 33 | #define GOF_WINDOW_SLOT_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GOF_TYPE_WINDOW_SLOT, GOFWindowSlotClass)) | 33 | #define GOF_WINDOW_SLOT_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GOF_TYPE_WINDOW_SLOT, GOFWindowSlotClass)) |
2239 | @@ -55,6 +55,8 @@ | |||
2240 | 55 | 55 | ||
2241 | 56 | MarlinWindowColumns *mwcols; | 56 | MarlinWindowColumns *mwcols; |
2242 | 57 | guint width; | 57 | guint width; |
2243 | 58 | guint slot_number; | ||
2244 | 59 | gboolean ready_to_autosize; | ||
2245 | 58 | }; | 60 | }; |
2246 | 59 | 61 | ||
2247 | 60 | struct GOFWindowSlotClass { | 62 | struct GOFWindowSlotClass { |
2248 | @@ -81,5 +83,6 @@ | |||
2249 | 81 | 83 | ||
2250 | 82 | void gof_window_slot_freeze_updates (GOFWindowSlot *slot); | 84 | void gof_window_slot_freeze_updates (GOFWindowSlot *slot); |
2251 | 83 | void gof_window_slot_unfreeze_updates (GOFWindowSlot *slot); | 85 | void gof_window_slot_unfreeze_updates (GOFWindowSlot *slot); |
2252 | 86 | void autosize_slot (GOFWindowSlot *slot); | ||
2253 | 84 | 87 | ||
2254 | 85 | #endif /* GOF_WINDOW_SLOT_H */ | 88 | #endif /* GOF_WINDOW_SLOT_H */ |
2255 | 86 | 89 | ||
2256 | === modified file 'src/marlin-window-columns.c' | |||
2257 | --- src/marlin-window-columns.c 2013-07-05 18:20:51 +0000 | |||
2258 | +++ src/marlin-window-columns.c 2013-09-01 22:36:03 +0000 | |||
2259 | @@ -110,6 +110,7 @@ | |||
2260 | 110 | GOFWindowSlot *slot = mwcols->active_slot; | 110 | GOFWindowSlot *slot = mwcols->active_slot; |
2261 | 111 | 111 | ||
2262 | 112 | gof_window_slot_make_column_view (slot); | 112 | gof_window_slot_make_column_view (slot); |
2263 | 113 | slot->slot_number = 0; | ||
2264 | 113 | 114 | ||
2265 | 114 | mwcols->colpane = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); | 115 | mwcols->colpane = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); |
2266 | 115 | slot->colpane = mwcols->colpane; | 116 | slot->colpane = mwcols->colpane; |
2267 | @@ -133,6 +134,7 @@ | |||
2268 | 133 | 134 | ||
2269 | 134 | marlin_view_view_container_set_content ((MarlinViewViewContainer *) mwcols->ctab, mwcols->content_box); | 135 | marlin_view_view_container_set_content ((MarlinViewViewContainer *) mwcols->ctab, mwcols->content_box); |
2270 | 135 | 136 | ||
2271 | 137 | |||
2272 | 136 | /* store pane handle size*/ | 138 | /* store pane handle size*/ |
2273 | 137 | gtk_widget_style_get (GTK_WIDGET (slot->hpane), "handle-size", &mwcols->handle_size, NULL); | 139 | gtk_widget_style_get (GTK_WIDGET (slot->hpane), "handle-size", &mwcols->handle_size, NULL); |
2274 | 138 | 140 | ||
2275 | @@ -156,7 +158,9 @@ | |||
2276 | 156 | marlin_window_columns_add (MarlinWindowColumns *mwcols, GFile *location) | 158 | marlin_window_columns_add (MarlinWindowColumns *mwcols, GFile *location) |
2277 | 157 | { | 159 | { |
2278 | 158 | GOFWindowSlot *slot = gof_window_slot_new (location, mwcols->ctab); | 160 | GOFWindowSlot *slot = gof_window_slot_new (location, mwcols->ctab); |
2279 | 161 | slot->width = mwcols->preferred_column_width; | ||
2280 | 159 | gof_window_slot_make_column_view (slot); | 162 | gof_window_slot_make_column_view (slot); |
2281 | 163 | slot->slot_number = mwcols->active_slot->slot_number +1; | ||
2282 | 160 | slot->mwcols = mwcols; | 164 | slot->mwcols = mwcols; |
2283 | 161 | slot->colpane = mwcols->active_slot->colpane; | 165 | slot->colpane = mwcols->active_slot->colpane; |
2284 | 162 | gof_window_column_add (slot, slot->view_box); | 166 | gof_window_column_add (slot, slot->view_box); |
Special notes:
Manually merge this and use --author flag to give Jeremy credit.
A stable release of Files should be made RIGHT BEFORE this is merged