Merge lp:~jeremywootten/pantheon-files/reload-icon-in-pathbar into lp:~elementary-apps/pantheon-files/trunk

Proposed by Jeremy Wootten
Status: Merged
Approved by: Cody Garver
Approved revision: 1689
Merged at revision: 1730
Proposed branch: lp:~jeremywootten/pantheon-files/reload-icon-in-pathbar
Merge into: lp:~elementary-apps/pantheon-files/trunk
Diff against target: 532 lines (+148/-80)
6 files modified
libcore/gof-directory-async.vala (+32/-15)
libcore/tests/marlincore-tests-file.c (+3/-3)
libwidgets/LocationBar.vala (+88/-41)
src/View/LocationBar.vala (+12/-13)
src/View/ViewContainer.vala (+5/-1)
src/View/Window.vala (+8/-7)
To merge this branch: bzr merge lp:~jeremywootten/pantheon-files/reload-icon-in-pathbar
Reviewer Review Type Date Requested Status
Danielle Foré Approve
PerfectCarl (community) Needs Fixing
Cody Garver (community) Needs Fixing
Review via email: mp+246055@code.launchpad.net

Commit message

Add a refresh icon to the pathbar

Description of the change

This branch places a refresh icon at the right hand end of the pathbar while in browsing mode. Clicking on the icon refreshes the current view.

To test:

FOR FUNCTION
1) Click on the refresh icon (either button) at the right-hand end of the pathbar. The current view refreshes (reloads). In Miller view, the active slot refreshes.

2) Hover over the icon - a tooltip appears (review wording).

3) Enter edit mode - the icon changes to the Navigate to icon.

4) Enter search mode - the icon disappears

FOR POSSIBLE REGRESSIONS
1) All pathbar functions work as normal.

2) All other ways of refreshing the view work as normal

3) Nothing bad happens if the icon is clicked when the view is not displaying a normal accessible folder.

To post a comment you must log in.
Revision history for this message
Cody Garver (codygarver) wrote :

Icon should probably be view-refresh-symbolic

String should probably be "Reload the current folder" if we want to match the wording of Midori's reload tooltip

Revision history for this message
Cody Garver (codygarver) wrote :

UX Team confirms that the icon should be "view-refresh-symbolic"

And the tooltip should be "Reload this folder"

review: Needs Fixing
1683. By Jeremy Wootten

Use 'view-refresh-symblic' icon and amend tooltip to 'Reload this folder'

1684. By Jeremy Wootten

Correct spelling mistake

Revision history for this message
Jeremy Wootten (jeremywootten) wrote :

The icon is now "view-refresh-symbolic" and the tooltip is "Reload this folder".

Revision history for this message
Danielle Foré (danrabbit) wrote :

Okay so if you do this:

this.set_icon_from_icon_name (Gtk.EntryIconPosition.SECONDARY, "go-jump-symbolic");

Instead of this:

secondary_icon_pixbuf = arrow_img;

It doesn't get that weird screwed up hover effect

1685. By Jeremy Wootten

Do not use pixbufs for secondary icon, fix disappearing tooltip on secondary icon

Revision history for this message
Jeremy Wootten (jeremywootten) wrote :

Thanks Dan, I have implemented your fix for both secondary icons and removed unused code. Also fixed a bug I noticed where the tooltip on the secondary icon did not appear if you first hovered over the blank part of the pathbar. It appears calling set_tooltip_text ("") has the effect of turning off ALL the tooltips. Not sure if this is expected or a Gtk.Entry bug.

Revision history for this message
Danielle Foré (danrabbit) wrote :

* We shouldn't offer reload while the directory is currently reloading.

* There is a minor regression where the "go" arrow shows immediately instead of only after you've made a change to the path

review: Needs Fixing
1686. By Jeremy Wootten

Fix enter key press, hide reload icon if path unchanged, fix keyboard reload while in edit mode, fix regression in completion

1687. By Jeremy Wootten

Fix error message re atk_object, remove unneeded entry icon code

Revision history for this message
PerfectCarl (name-is-carl) wrote :

Is this branch related/touching code pertaining to https://code.launchpad.net/~jeremywootten/pantheon-files/fix-enter-in-pathbar ?

Also there is MERGE strings in the code: bzr merge failed it seems.

Please add a comment when hiding inherited methods (instead of overriding) as it is unusual and could be viewed as an error.

review: Needs Fixing
1688. By Jeremy Wootten

Merge trunk to rev 1723

1689. By Jeremy Wootten

Avoid hiding Gtk.Widget.key_press_event

Revision history for this message
Jeremy Wootten (jeremywootten) wrote :

1) Trunk merged and conflict resolved
2) Code refactored to avoid hiding Gtk Widget method.

Revision history for this message
Danielle Foré (danrabbit) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'libcore/gof-directory-async.vala'
--- libcore/gof-directory-async.vala 2014-12-26 12:01:20 +0000
+++ libcore/gof-directory-async.vala 2015-01-26 10:59:47 +0000
@@ -129,7 +129,16 @@
129 state = State.NOT_LOADED;129 state = State.NOT_LOADED;
130 }130 }
131131
132 public void load () {132 public delegate void GOFFileLoadedFunc (GOF.File file);
133
134 /** Views call the following function with null parameter - file_loaded and done_loading
135 * signals are emitted and cause the view and view container to update.
136 *
137 * LocationBar calls this function, with a callback, on its own Async instances in order
138 * to perform filename completion.- Emitting a done_loaded signal in that case would cause
139 * the premature ending of text entry.
140 **/
141 public void load (GOFFileLoadedFunc? file_loaded_func = null) {
133 cancellable.reset ();142 cancellable.reset ();
134 longest_file_name = "";143 longest_file_name = "";
135144
@@ -141,15 +150,17 @@
141 if (state == State.LOADING)150 if (state == State.LOADING)
142 clear_directory_info ();151 clear_directory_info ();
143152
144 list_directory.begin ();153 list_directory.begin (file_loaded_func);
145154
146 try {155 if (file_loaded_func == null) {
147 monitor = location.monitor_directory (0);156 try {
148 monitor.rate_limit = 100;157 monitor = location.monitor_directory (0);
149 monitor.changed.connect (directory_changed);158 monitor.rate_limit = 100;
150 } catch (IOError e) {159 monitor.changed.connect (directory_changed);
151 if (!(e is IOError.NOT_MOUNTED)) {160 } catch (IOError e) {
152 warning ("directory monitor failed: %s %s", e.message, file.uri);161 if (!(e is IOError.NOT_MOUNTED)) {
162 warning ("directory monitor failed: %s %s", e.message, file.uri);
163 }
153 }164 }
154 }165 }
155 } else {166 } else {
@@ -164,12 +175,15 @@
164 if (track_longest_name)175 if (track_longest_name)
165 update_longest_file_name (gof);176 update_longest_file_name (gof);
166177
167 file_loaded (gof);178 if (file_loaded_func == null)
179 file_loaded (gof);
180 else
181 file_loaded_func (gof);
168 }182 }
169 }183 }
170 }184 }
171185
172 if (!cancellable.is_cancelled ())186 if (file_loaded_func == null && !cancellable.is_cancelled ())
173 done_loading ();187 done_loading ();
174 }188 }
175 }189 }
@@ -234,7 +248,7 @@
234 yield query_info_async (file, file_info_available);248 yield query_info_async (file, file_info_available);
235 }249 }
236250
237 private async void list_directory () {251 private async void list_directory (GOFFileLoadedFunc? file_loaded_func = null) {
238 file.exists = true;252 file.exists = true;
239 files_count = 0;253 files_count = 0;
240 state = State.LOADING;254 state = State.LOADING;
@@ -267,12 +281,16 @@
267 if (track_longest_name)281 if (track_longest_name)
268 update_longest_file_name (gof);282 update_longest_file_name (gof);
269283
270 file_loaded (gof);284 if (file_loaded_func == null)
285 file_loaded (gof);
286 else
287 file_loaded_func (gof);
271 }288 }
272289
273 files_count++;290 files_count++;
274 }291 }
275 }292 }
293
276 if (state == State.LOADING) {294 if (state == State.LOADING) {
277 file.exists = true;295 file.exists = true;
278 state = State.LOADED;296 state = State.LOADED;
@@ -293,8 +311,7 @@
293 else if (err is IOError.NOT_MOUNTED)311 else if (err is IOError.NOT_MOUNTED)
294 file.is_mounted = false;312 file.is_mounted = false;
295 }313 }
296314 if (file_loaded_func == null && !cancellable.is_cancelled ())
297 if (!cancellable.is_cancelled ())
298 done_loading ();315 done_loading ();
299 }316 }
300317
301318
=== modified file 'libcore/tests/marlincore-tests-file.c'
--- libcore/tests/marlincore-tests-file.c 2014-08-05 22:40:12 +0000
+++ libcore/tests/marlincore-tests-file.c 2015-01-26 10:59:47 +0000
@@ -89,7 +89,7 @@
89 GOFDirectoryAsync *dir2;89 GOFDirectoryAsync *dir2;
90 dir2 = gof_directory_async_from_file(dir->file);90 dir2 = gof_directory_async_from_file(dir->file);
91 g_signal_connect(dir2, "done_loading", (GCallback) second_load_done, NULL);91 g_signal_connect(dir2, "done_loading", (GCallback) second_load_done, NULL);
92 gof_directory_async_load(dir2);92 gof_directory_async_load(dir2, NULL, NULL);
9393
94 /* free previously allocated dir */94 /* free previously allocated dir */
95 g_object_unref (dir);95 g_object_unref (dir);
@@ -107,11 +107,11 @@
107107
108 dir = gof_directory_async_from_gfile(g_file_new_for_path("/tmp/marlin-test"));108 dir = gof_directory_async_from_gfile(g_file_new_for_path("/tmp/marlin-test"));
109 g_signal_connect(dir, "done_loading", (GCallback) first_load_done, NULL);109 g_signal_connect(dir, "done_loading", (GCallback) first_load_done, NULL);
110 gof_directory_async_load(dir);110 gof_directory_async_load(dir, NULL, NULL);
111111
112 /*dir2 = gof_directory_async_from_gfile(g_file_new_for_path("/tmp/marlin-test"));112 /*dir2 = gof_directory_async_from_gfile(g_file_new_for_path("/tmp/marlin-test"));
113 g_signal_connect(dir2, "done_loading", (GCallback) second_load_done, NULL);113 g_signal_connect(dir2, "done_loading", (GCallback) second_load_done, NULL);
114 gof_directory_async_load(dir2);*/114 gof_directory_async_load(dir2, NULL, NULL);*/
115115
116 //GOFFile *f1 = gof_file_get (g_file_new_for_path("/tmp/marlin-test/a"));116 //GOFFile *f1 = gof_file_get (g_file_new_for_path("/tmp/marlin-test/a"));
117117
118118
=== modified file 'libwidgets/LocationBar.vala'
--- libwidgets/LocationBar.vala 2014-11-21 10:02:45 +0000
+++ libwidgets/LocationBar.vala 2015-01-26 10:59:47 +0000
@@ -57,7 +57,11 @@
5757
58 _search_mode = value;58 _search_mode = value;
5959
60 primary_icon_name = _search_mode ? "edit-find-symbolic" : null;60 if (_search_mode) {
61 primary_icon_name = "edit-find-symbolic";
62 show_refresh_icon (false);
63 } else
64 primary_icon_name = null;
6165
62 grab_focus ();66 grab_focus ();
63 }67 }
@@ -66,10 +70,8 @@
66 protected string text_completion = "";70 protected string text_completion = "";
67 protected bool multiple_completions = false;71 protected bool multiple_completions = false;
68 protected bool text_changed = false;72 protected bool text_changed = false;
69 protected bool arrow_hovered = false;
70 protected bool ignore_focus_in = false;73 protected bool ignore_focus_in = false;
71 protected bool ignore_change = false;74 protected bool ignore_change = false;
72 private Gdk.Pixbuf arrow_img;
7375
74 /* if we must display the BreadcrumbsElement which are in newbreads. */76 /* if we must display the BreadcrumbsElement which are in newbreads. */
75 bool view_old = false;77 bool view_old = false;
@@ -97,10 +99,12 @@
97 public signal void path_changed (File file);99 public signal void path_changed (File file);
98 public signal void need_completion ();100 public signal void need_completion ();
99 public signal void search_changed (string text);101 public signal void search_changed (string text);
102 public signal void reload ();
100103
101 List<IconDirectory?> icons;104 List<IconDirectory?> icons;
102105
103 string current_path = "";106 string current_path = "";
107 string refresh_tip = _("Reload this folder");
104108
105 int selected = -1;109 int selected = -1;
106 int space_breads = 12;110 int space_breads = 12;
@@ -123,13 +127,6 @@
123 construct {127 construct {
124 icon_factory = Granite.Services.IconFactory.get_default ();128 icon_factory = Granite.Services.IconFactory.get_default ();
125 icons = new List<IconDirectory?> ();129 icons = new List<IconDirectory?> ();
126
127 /* Load arrow image */
128 try {
129 arrow_img = Gtk.IconTheme.get_default ().load_icon ("go-jump-symbolic", 16, Gtk.IconLookupFlags.GENERIC_FALLBACK);
130 } catch (Error err) {
131 stderr.printf ("Unable to load home icon: %s", err.message);
132 }
133130
134 button_context = get_style_context ();131 button_context = get_style_context ();
135 button_context.add_class ("button");132 button_context.add_class ("button");
@@ -155,8 +152,10 @@
155 secondary_icon_sensitive = true;152 secondary_icon_sensitive = true;
156 truncate_multiline = true;153 truncate_multiline = true;
157 activate.connect (on_activate);154 activate.connect (on_activate);
158 icon_press.connect (on_activate);155 button_press_event.connect (on_button_press_event);
159 motion_notify_event.connect (on_motion_notify);156 button_release_event.connect (on_button_release_event);
157 icon_press.connect (on_icon_press);
158 motion_notify_event.connect_after (after_motion_notify);
160 focus_in_event.connect (on_focus_in);159 focus_in_event.connect (on_focus_in);
161 focus_out_event.connect (on_focus_out);160 focus_out_event.connect (on_focus_out);
162 grab_focus.connect_after (on_grab_focus);161 grab_focus.connect_after (on_grab_focus);
@@ -170,8 +169,8 @@
170 drag_data_received.connect (on_drag_data_received);169 drag_data_received.connect (on_drag_data_received);
171 drag_drop.connect (on_drag_drop);170 drag_drop.connect (on_drag_drop);
172 }171 }
173 172
174 public override bool key_press_event (Gdk.EventKey event) {173 public bool on_key_press_event (Gdk.EventKey event) {
175 switch (event.keyval) {174 switch (event.keyval) {
176 case Gdk.Key.KP_Tab:175 case Gdk.Key.KP_Tab:
177 case Gdk.Key.Tab:176 case Gdk.Key.Tab:
@@ -195,7 +194,12 @@
195 return base.key_press_event (event);194 return base.key_press_event (event);
196 }195 }
197196
198 public override bool button_press_event (Gdk.EventButton event) {197 public bool on_button_press_event (Gdk.EventButton event) {
198 /* We need to distinguish whether the event comes from one of the icons.
199 * There doesn't seem to be a way of doing this directly so we check the window width */
200 if (event.window.get_width () < 24)
201 return false;
202
199 if (is_focus) 203 if (is_focus)
200 return base.button_press_event (event);204 return base.button_press_event (event);
201205
@@ -233,7 +237,12 @@
233 return true;237 return true;
234 }238 }
235239
236 public override bool button_release_event (Gdk.EventButton event) {240 public bool on_button_release_event (Gdk.EventButton event) {
241 /* We need to distinguish whether the event comes from one of the icons.
242 * There doesn't seem to be a way of doing this directly so we check the window width */
243 if (event.window.get_width () < 24)
244 return false;
245
237 reset_elements_states ();246 reset_elements_states ();
238247
239 if (timeout != -1) {248 if (timeout != -1) {
@@ -244,6 +253,7 @@
244 if (is_focus)253 if (is_focus)
245 return base.button_release_event (event);254 return base.button_release_event (event);
246255
256
247 if (event.button == 1) {257 if (event.button == 1) {
248 var el = get_element_from_coordinates ((int) event.x, (int) event.y);258 var el = get_element_from_coordinates ((int) event.x, (int) event.y);
249 if (el != null) {259 if (el != null) {
@@ -256,7 +266,16 @@
256 266
257 return base.button_release_event (event);267 return base.button_release_event (event);
258 }268 }
259 269
270 public void on_icon_press (Gtk.EntryIconPosition pos, Gdk.Event event) {
271 if (pos == Gtk.EntryIconPosition.SECONDARY) {
272 if (is_focus)
273 on_activate ();
274 else
275 reload ();
276 }
277 }
278
260 void on_change () {279 void on_change () {
261 if (search_mode) {280 if (search_mode) {
262 search_changed (text);281 search_changed (text);
@@ -268,19 +287,24 @@
268 return;287 return;
269 }288 }
270289
271 set_entry_icon (true, (text.length > 0) ? "Navigate to: " + text : "");290 show_navigate_icon ();
272 text_completion = "";291 text_completion = "";
273 need_completion ();292 need_completion ();
274 }293 }
275 294
276 bool on_motion_notify (Gdk.EventMotion event) {295 bool after_motion_notify (Gdk.EventMotion event) {
296
297 if (is_focus)
298 return false;
299
277 int x = (int) event.x;300 int x = (int) event.x;
278 double x_render = 0;301 double x_render = 0;
279 double x_previous = -10;302 double x_previous = -10;
280 set_tooltip_text ("");303 set_tooltip_text ("");
281 304 /* We must reset the icon tooltip as the above line turns all tooltips off */
282 if (is_focus)305 set_icon_tooltip_text (Gtk.EntryIconPosition.SECONDARY, refresh_tip);
283 return base.motion_notify_event (event);306
307
284308
285 foreach (BreadcrumbsElement element in elements) {309 foreach (BreadcrumbsElement element in elements) {
286 if (element.display) {310 if (element.display) {
@@ -299,22 +323,25 @@
299 set_entry_cursor (new Gdk.Cursor (Gdk.CursorType.ARROW));323 set_entry_cursor (new Gdk.Cursor (Gdk.CursorType.ARROW));
300 else324 else
301 set_entry_cursor (null);325 set_entry_cursor (null);
302 326
303 return base.motion_notify_event (event);327 return false;
304 }328 }
305329
306 bool on_focus_out (Gdk.EventFocus event) {330 bool on_focus_out (Gdk.EventFocus event) {
307 if (is_focus) {331 if (is_focus)
308 ignore_focus_in = true;332 ignore_focus_in = true;
309 return base.focus_out_event (event);333 else {
334 reset ();
335 show_refresh_icon (true);
310 }336 }
311 337
338 return base.focus_out_event (event);
339 }
340
341 void reset () {
312 ignore_focus_in = false;342 ignore_focus_in = false;
313 set_entry_icon (false);
314 set_entry_text ("");343 set_entry_text ("");
315 search_mode = false;344 search_mode = false;
316
317 return base.focus_out_event (event);
318 }345 }
319346
320 bool on_focus_in (Gdk.EventFocus event) {347 bool on_focus_in (Gdk.EventFocus event) {
@@ -323,10 +350,11 @@
323350
324 if (search_mode)351 if (search_mode)
325 set_entry_text ("");352 set_entry_text ("");
326 else353 else {
327 set_entry_text (sanitise_path (GLib.Uri.unescape_string (get_elements_path ())));354 current_path = sanitise_path (GLib.Uri.unescape_string (get_elements_path ()));
328 355 set_entry_text (current_path);
329 356 show_navigate_icon ();
357 }
330 return base.focus_in_event (event);358 return base.focus_in_event (event);
331 }359 }
332360
@@ -343,10 +371,25 @@
343 }371 }
344372
345 void on_activate () {373 void on_activate () {
346 path_changed (get_file_for_path (text + text_completion));374 string path = text + text_completion;
375 path_changed (get_file_for_path (path));
347 text_completion = "";376 text_completion = "";
348 }377 }
349378
379 public void show_refresh_icon (bool show = true) {
380 /* Cancel any editing or search if refresh icon is to be shown */
381 if (show) {
382 reset ();
383 escape ();
384 }
385
386 set_entry_secondary_icon (false, show);
387 }
388
389 public void show_navigate_icon (bool show = true) {
390 set_entry_secondary_icon (true, show && text != current_path);
391 }
392
350 protected abstract void on_drag_leave (Gdk.DragContext drag_context, uint time);393 protected abstract void on_drag_leave (Gdk.DragContext drag_context, uint time);
351394
352 protected abstract void on_drag_data_received (Gdk.DragContext context,395 protected abstract void on_drag_data_received (Gdk.DragContext context,
@@ -406,12 +449,16 @@
406 get_window ().get_children ().nth_data (13).set_cursor (cursor ?? new Gdk.Cursor (Gdk.CursorType.XTERM));449 get_window ().get_children ().nth_data (13).set_cursor (cursor ?? new Gdk.Cursor (Gdk.CursorType.XTERM));
407 }450 }
408 451
409 public void set_entry_icon (bool active, string? tooltip = null) {452 public void set_entry_secondary_icon (bool active, bool visible) {
410 if (!active)453 if (!visible)
411 secondary_icon_pixbuf = null;454 secondary_icon_pixbuf = null;
412 else {455 else if (!active) {
413 secondary_icon_pixbuf = arrow_img;456 set_icon_from_icon_name (Gtk.EntryIconPosition.SECONDARY, "view-refresh-symbolic");
414 secondary_icon_tooltip_text = tooltip;457 set_icon_tooltip_text (Gtk.EntryIconPosition.SECONDARY, refresh_tip);
458 } else {
459 set_icon_from_icon_name (Gtk.EntryIconPosition.SECONDARY, "go-jump-symbolic");
460 var tooltip = (text.length > 0) ? (_("Navigate to %s")).printf (text) : "";
461 set_icon_tooltip_text (Gtk.EntryIconPosition.SECONDARY, tooltip);
415 }462 }
416 }463 }
417464
@@ -809,7 +856,7 @@
809 Pango.cairo_show_layout (cr, layout);856 Pango.cairo_show_layout (cr, layout);
810 }857 }
811 }858 }
812 859
813 return true;860 return true;
814 }861 }
815862
816863
=== modified file 'src/View/LocationBar.vala'
--- src/View/LocationBar.vala 2014-12-01 12:20:37 +0000
+++ src/View/LocationBar.vala 2015-01-26 10:59:47 +0000
@@ -62,8 +62,12 @@
62 this.win = win;62 this.win = win;
63 bread = new Breadcrumbs (win);63 bread = new Breadcrumbs (win);
64 bread.escape.connect (() => { escape(); });64 bread.escape.connect (() => { escape(); });
65
66 bread.path_changed.connect (on_path_changed);65 bread.path_changed.connect (on_path_changed);
66
67 bread.reload.connect (() => {
68 win.win_actions.activate_action ("refresh", null);
69 });
70
67 bread.activate_alternate.connect ((file) => { activate_alternate(file); });71 bread.activate_alternate.connect ((file) => { activate_alternate(file); });
68 bread.notify["search-mode"].connect (() => {72 bread.notify["search-mode"].connect (() => {
69 if (!bread.search_mode) {73 if (!bread.search_mode) {
@@ -78,6 +82,7 @@
78 margin_bottom = 4;82 margin_bottom = 4;
79 margin_left = 3;83 margin_left = 3;
8084
85 bread.set_entry_secondary_icon (false, true);
81 pack_start (bread, true, true, 0);86 pack_start (bread, true, true, 0);
82 }87 }
8388
@@ -331,17 +336,10 @@
331 file = file.get_parent ();336 file = file.get_parent ();
332 else337 else
333 return;338 return;
334
335 var directory = file;
336 var files_cache = files;
337 339
338 files = GOF.Directory.Async.from_gfile (directory);340 files = GOF.Directory.Async.from_gfile (file);
339 if (files.file.exists) {341 if (files.file.exists) {
340 /* Verify that we got a new instance of files so we do not double up events */342 files.load (on_file_loaded);
341 if (files_cache != files)
342 files.file_loaded.connect (on_file_loaded);
343
344 files.load ();
345 }343 }
346 }344 }
347345
@@ -406,7 +404,6 @@
406 menu_open_with.set_submenu (submenu_open_with);404 menu_open_with.set_submenu (submenu_open_with);
407 menu.append (new Gtk.SeparatorMenuItem ());405 menu.append (new Gtk.SeparatorMenuItem ());
408406
409
410 unowned List<GOF.File>? sorted_dirs = files_menu.get_sorted_dirs ();407 unowned List<GOF.File>? sorted_dirs = files_menu.get_sorted_dirs ();
411 foreach (var gof in sorted_dirs) {408 foreach (var gof in sorted_dirs) {
412 var menuitem = new Gtk.MenuItem.with_label(gof.get_display_name ());409 var menuitem = new Gtk.MenuItem.with_label(gof.get_display_name ());
@@ -418,6 +415,9 @@
418 });415 });
419 }416 }
420 menu.show_all ();417 menu.show_all ();
418 /* Release the Async directory as soon as possible */
419 files_menu.done_loading.disconnect (on_files_loaded_menu);
420 files_menu = null;
421 }421 }
422422
423 private void launch_uri_with_app (AppInfo app, string uri) {423 private void launch_uri_with_app (AppInfo app, string uri) {
@@ -437,9 +437,8 @@
437 menu = new Gtk.Menu ();437 menu = new Gtk.Menu ();
438 menu.cancel.connect (() => { reset_elements_states (); });438 menu.cancel.connect (() => { reset_elements_states (); });
439 menu.deactivate.connect (() => { reset_elements_states (); });439 menu.deactivate.connect (() => { reset_elements_states (); });
440 /* current_right_click_root is parent of the directory named on the breadcrumb. */
440 var directory = File.new_for_uri (current_right_click_root);441 var directory = File.new_for_uri (current_right_click_root);
441 if (files_menu != null)
442 files_menu.done_loading.disconnect (on_files_loaded_menu);
443 files_menu = GOF.Directory.Async.from_gfile (directory);442 files_menu = GOF.Directory.Async.from_gfile (directory);
444 files_menu.done_loading.connect (on_files_loaded_menu);443 files_menu.done_loading.connect (on_files_loaded_menu);
445 files_menu.load ();444 files_menu.load ();
446445
=== modified file 'src/View/ViewContainer.vala'
--- src/View/ViewContainer.vala 2014-12-28 09:23:52 +0000
+++ src/View/ViewContainer.vala 2015-01-26 10:59:47 +0000
@@ -331,6 +331,10 @@
331 if (file == null || location.equal (file))331 if (file == null || location.equal (file))
332 return;332 return;
333333
334 var filetype = file.query_file_type (0);
335 if (filetype == FileType.UNKNOWN)
336 return;
337
334 GLib.File? loc = null;338 GLib.File? loc = null;
335 File? parent = file.get_parent ();339 File? parent = file.get_parent ();
336 if (parent != null && location.equal (file.get_parent ())) {340 if (parent != null && location.equal (file.get_parent ())) {
@@ -341,7 +345,7 @@
341 } else345 } else
342 loc = file;346 loc = file;
343 } else if (!select_in_current_only) {347 } else if (!select_in_current_only) {
344 if (file.query_file_type (0) == FileType.DIRECTORY)348 if (filetype == FileType.DIRECTORY)
345 loc = file;349 loc = file;
346 else if (parent != null) {350 else if (parent != null) {
347 loc = parent;351 loc = parent;
348352
=== modified file 'src/View/Window.vala'
--- src/View/Window.vala 2015-01-17 18:42:21 +0000
+++ src/View/Window.vala 2015-01-26 10:59:47 +0000
@@ -214,13 +214,6 @@
214214
215 undo_manager.request_menu_update.connect (undo_redo_menu_update_callback);215 undo_manager.request_menu_update.connect (undo_redo_menu_update_callback);
216216
217 key_press_event.connect ((event) => {
218 if (top_menu.location_bar.bread.is_focus)
219 return top_menu.location_bar.bread.key_press_event (event);
220
221 return false;
222 });
223
224 button_press_event.connect (on_button_press_event);217 button_press_event.connect (on_button_press_event);
225218
226 window_state_event.connect ((event) => {219 window_state_event.connect ((event) => {
@@ -375,6 +368,14 @@
375368
376 content.loading.connect ((is_loading) => {369 content.loading.connect ((is_loading) => {
377 tab.working = is_loading;370 tab.working = is_loading;
371 top_menu.location_bar.bread.show_refresh_icon (!is_loading);
372 });
373
374 key_press_event.connect ((event) => {
375 if (top_menu.location_bar.bread.is_focus)
376 return top_menu.location_bar.bread.on_key_press_event (event);
377
378 return false;
378 });379 });
379380
380 change_tab ((int)tabs.insert_tab (tab, -1));381 change_tab ((int)tabs.insert_tab (tab, -1));

Subscribers

People subscribed via source and target branches

to all changes: