Merge lp:~junrrein/pantheon-files/fix-903920 into lp:~elementary-apps/pantheon-files/trunk

Proposed by Julián Unrrein
Status: Merged
Merged at revision: 1073
Proposed branch: lp:~junrrein/pantheon-files/fix-903920
Merge into: lp:~elementary-apps/pantheon-files/trunk
Diff against target: 39 lines (+11/-0)
2 files modified
libwidgets/LocationBar.vala (+2/-0)
src/View/LocationBar.vala (+9/-0)
To merge this branch: bzr merge lp:~junrrein/pantheon-files/fix-903920
Reviewer Review Type Date Requested Status
Cody Garver (community) Approve
David Gomes (community) Needs Fixing
Review via email: mp+143033@code.launchpad.net

Description of the change

Show an "Open in New Tab" menu item when right clicking a breadcrumb. Fixes bug #903920.

To post a comment you must log in.
Revision history for this message
David Gomes (davidgomes) wrote :

Fix that coding style. Only spaces. Mixing tabs and spaces is awful.

review: Needs Fixing
1074. By Julián Unrrein

Minor modification to a variable name.
Remove some debug output that wasn't meant to stay.

Revision history for this message
Julián Unrrein (junrrein) wrote :

What do you mean? To use 4 spaces instead of a tab?

Revision history for this message
Julián Unrrein (junrrein) wrote :

This is my first code contribution ever. Feel free to give me any indications.

1075. By Julián Unrrein

Replace tabs with spaces.

Revision history for this message
David Gomes (davidgomes) wrote :

Indeed, 4 spaces instead of tabs. That's how we indent our code.

Revision history for this message
David Gomes (davidgomes) wrote :

menuitem_newtab.activate.connect ( () => {

menuitem_newtab.activate.connect (() => {

Other than that, teh code looks fine. Fix that, I'll test it and if it works, I'll merge it.

1076. By Julián Unrrein

Clean the code a bit. Fix the coding style.

Revision history for this message
Julián Unrrein (junrrein) wrote :

Notice that this time I also modified the code a bit.

Revision history for this message
Cody Garver (codygarver) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'libwidgets/LocationBar.vala'
2--- libwidgets/LocationBar.vala 2012-11-25 04:12:30 +0000
3+++ libwidgets/LocationBar.vala 2013-01-12 22:28:21 +0000
4@@ -39,6 +39,7 @@
5
6 public abstract class Marlin.View.Chrome.BasePathBar : EventBox
7 {
8+ public string current_right_click_path;
9 public string current_right_click_root;
10 //double right_click_root;
11
12@@ -391,6 +392,7 @@
13 var el = get_element_from_coordinates ((int) event.x, (int) event.y);
14 if (el != null) {
15 var newpath = get_path_from_element (el);
16+ current_right_click_path = newpath;
17 current_right_click_root = Marlin.Utils.get_parent(newpath);
18 double menu_x_root;
19 if (el.x - space_breads < 0)
20
21=== modified file 'src/View/LocationBar.vala'
22--- src/View/LocationBar.vala 2012-06-11 09:25:17 +0000
23+++ src/View/LocationBar.vala 2013-01-12 22:28:21 +0000
24@@ -282,6 +282,15 @@
25
26 private void on_files_loaded_menu()
27 {
28+ // First the "Open in new tab" menuitem is added to the menu.
29+ var menuitem_newtab = new Gtk.MenuItem.with_label (_("Open in New Tab"));
30+ menu.append (menuitem_newtab);
31+ menuitem_newtab.activate.connect (() => {
32+ win.add_tab (File.new_for_uri (current_right_click_path));
33+ });
34+
35+ menu.append (new Gtk.SeparatorMenuItem ());
36+
37 unowned List<GOF.File>? sorted_dirs = files_menu.get_sorted_dirs ();
38 foreach (var gof in sorted_dirs) {
39 var menuitem = new Gtk.MenuItem.with_label(gof.get_display_name ());

Subscribers

People subscribed via source and target branches

to all changes: