Merge lp:~artem-anufrij/scratch/Bugfix-1200522 into lp:~elementary-apps/scratch/scratch

Proposed by Artem Anufrij
Status: Superseded
Proposed branch: lp:~artem-anufrij/scratch/Bugfix-1200522
Merge into: lp:~elementary-apps/scratch/scratch
Diff against target: 149 lines (+27/-17)
3 files modified
plugins/filemanager/FileManagerPlugin.vala (+13/-13)
plugins/filemanager/FileView.vala (+13/-3)
plugins/terminal/terminal.vala (+1/-1)
To merge this branch: bzr merge lp:~artem-anufrij/scratch/Bugfix-1200522
Reviewer Review Type Date Requested Status
Artem Anufrij (community) Approve
Danielle Foré Needs Fixing
Review via email: mp+240185@code.launchpad.net

Description of the change

'save as' opens automatically location highlighted in the File Browser plugin

To post a comment you must log in.
Revision history for this message
Danielle Foré (danrabbit) wrote :

This doesn't seem to work as expected. I'm still getting the folder Scratch was launched from in the Save dialog regardless of the expanded folders or selected file in the file manager plugin

review: Needs Fixing
Revision history for this message
Artem Anufrij (artem-anufrij) wrote :

@Dan:
Have you tested it with file manager, or folder manager? File manager works fine....

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

File manager. I tried running from the directory and installed.

1402. By artem-anufrij

commit

Revision history for this message
Artem Anufrij (artem-anufrij) wrote :

Mysterious.

I pushed once again the code...

This is the workflow on my system:

https://launchpadlibrarian.net/188886936/Screencast%202014-11-01%2022%3A20%3A38.mp4

Revision history for this message
Artem Anufrij (artem-anufrij) wrote :

Dan, could you try again?

Revision history for this message
Artem Anufrij (artem-anufrij) wrote :

Please review

review: Needs Resubmitting
Revision history for this message
Artem Anufrij (artem-anufrij) :
review: Approve
Revision history for this message
Artem Anufrij (artem-anufrij) :
review: Approve

Unmerged revisions

1402. By artem-anufrij

commit

1401. By artem-anufrij

'save as' opens automatically location highlighted in the File Browser plugin

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'plugins/filemanager/FileManagerPlugin.vala'
--- plugins/filemanager/FileManagerPlugin.vala 2014-04-13 16:15:35 +0000
+++ plugins/filemanager/FileManagerPlugin.vala 2014-11-01 21:23:31 +0000
@@ -22,10 +22,10 @@
22public const string DESCRIPTION = N_("Basic folder manager with file browsing");22public const string DESCRIPTION = N_("Basic folder manager with file browsing");
2323
24namespace Scratch.Plugins {24namespace Scratch.Plugins {
25 25
26 public class FileManagerPlugin : Peas.ExtensionBase, Peas.Activatable {26 public class FileManagerPlugin : Peas.ExtensionBase, Peas.Activatable {
27 public Scratch.Services.Interface plugins;27 public Scratch.Services.Interface plugins;
28 28
29 Gtk.Box box;29 Gtk.Box box;
30 FileManager.FileView view;30 FileManager.FileView view;
3131
@@ -51,9 +51,9 @@
51 void on_hook_sidebar (Gtk.Notebook notebook) {51 void on_hook_sidebar (Gtk.Notebook notebook) {
52 if (view != null)52 if (view != null)
53 return;53 return;
54 54
55 box = new Gtk.Box (Gtk.Orientation.VERTICAL, 0);55 box = new Gtk.Box (Gtk.Orientation.VERTICAL, 0);
56 56
57 // File View57 // File View
58 view = new FileManager.FileView ();58 view = new FileManager.FileView ();
5959
@@ -61,12 +61,12 @@
61 var file = GLib.File.new_for_path (a);61 var file = GLib.File.new_for_path (a);
62 plugins.open_file (file);62 plugins.open_file (file);
63 });63 });
64 64
65 // Toolbar65 // Toolbar
66 var toolbar = new Gtk.Toolbar ();66 var toolbar = new Gtk.Toolbar ();
67 toolbar.set_icon_size (Gtk.IconSize.SMALL_TOOLBAR);67 toolbar.set_icon_size (Gtk.IconSize.SMALL_TOOLBAR);
68 toolbar.get_style_context ().add_class ("inline-toolbar");68 toolbar.get_style_context ().add_class ("inline-toolbar");
69 69
70 var parent = new Gtk.ToolButton (null, null);70 var parent = new Gtk.ToolButton (null, null);
71 parent.tooltip_text = _("Go to parent");71 parent.tooltip_text = _("Go to parent");
72 parent.icon_name = "go-up-symbolic";72 parent.icon_name = "go-up-symbolic";
@@ -74,33 +74,33 @@
74 view.open_parent ();74 view.open_parent ();
75 parent.sensitive = !(view.folder.file.file.get_path () == "/");75 parent.sensitive = !(view.folder.file.file.get_path () == "/");
76 });76 });
77 77
78 var spacer = new Gtk.ToolItem ();78 var spacer = new Gtk.ToolItem ();
79 spacer.set_expand (true);79 spacer.set_expand (true);
80 80
81 var add = new Gtk.ToolButton (null, null);81 var add = new Gtk.ToolButton (null, null);
82 add.tooltip_text = _("Add file");82 add.tooltip_text = _("Add file");
83 add.icon_name = "list-add-symbolic";83 add.icon_name = "list-add-symbolic";
84 add.clicked.connect (() => {84 add.clicked.connect (() => {
85 view.add_file ();85 view.add_file ();
86 });86 });
87 87
88 var remove = new Gtk.ToolButton (null, null);88 var remove = new Gtk.ToolButton (null, null);
89 remove.tooltip_text = _("Remove file");89 remove.tooltip_text = _("Remove file");
90 remove.icon_name = "edit-delete-symbolic";90 remove.icon_name = "edit-delete-symbolic";
91 remove.clicked.connect (() => {91 remove.clicked.connect (() => {
92 view.remove_file ();92 view.remove_file ();
93 });93 });
94 94
95 toolbar.insert (parent, -1);95 toolbar.insert (parent, -1);
96 toolbar.insert (spacer, -1);96 toolbar.insert (spacer, -1);
97 toolbar.insert (add, -1);97 toolbar.insert (add, -1);
98 toolbar.insert (remove, -1);98 toolbar.insert (remove, -1);
99 99
100 box.pack_start (view, true, true, 0);100 box.pack_start (view, true, true, 0);
101 box.pack_start (toolbar, false, false, 0);101 box.pack_start (toolbar, false, false, 0);
102 box.show_all ();102 box.show_all ();
103 103
104 notebook.append_page (box, new Gtk.Label (_("File Manager")));104 notebook.append_page (box, new Gtk.Label (_("File Manager")));
105105
106 }106 }
@@ -111,4 +111,4 @@
111public void peas_register_types (GLib.TypeModule module) {111public void peas_register_types (GLib.TypeModule module) {
112 var objmodule = module as Peas.ObjectModule;112 var objmodule = module as Peas.ObjectModule;
113 objmodule.register_extension_type (typeof (Peas.Activatable), typeof (Scratch.Plugins.FileManagerPlugin));113 objmodule.register_extension_type (typeof (Peas.Activatable), typeof (Scratch.Plugins.FileManagerPlugin));
114}114}
115\ No newline at end of file115\ No newline at end of file
116116
=== modified file 'plugins/filemanager/FileView.vala'
--- plugins/filemanager/FileView.vala 2014-07-21 03:36:57 +0000
+++ plugins/filemanager/FileView.vala 2014-11-01 21:23:31 +0000
@@ -35,7 +35,13 @@
35 this.width_request = 180;35 this.width_request = 180;
3636
37 this.item_selected.connect ((item) => {37 this.item_selected.connect ((item) => {
38 select ((item as FileItem).path);38 if (item is FileItem) {
39 select ((item as FileItem).path);
40 Utils.last_path = (item as FileItem).file.file.get_parent ().get_uri ();
41 } else if (item is FolderItem) {
42 Utils.last_path = (item as FolderItem).file.file.get_uri ();
43 }
44
39 });45 });
40 this.root.child_removed.connect (() => {46 this.root.child_removed.connect (() => {
41 this.selected = null;47 this.selected = null;
@@ -73,7 +79,7 @@
73 warning ("Cannot open invalid directory.");79 warning ("Cannot open invalid directory.");
74 return;80 return;
75 }81 }
76 82
77 // Clean the SourceList before start adding something83 // Clean the SourceList before start adding something
78 if (this.folder != null)84 if (this.folder != null)
79 this.root.remove (this.folder);85 this.root.remove (this.folder);
@@ -251,7 +257,7 @@
251 view: view);257 view: view);
252258
253 this.editable = false;259 this.editable = false;
254 this.selectable = false;260 this.selectable = true;
255 this.name = file.name;261 this.name = file.name;
256 this.icon = IconLoader.get_default ().get_rendered_icon (file.icon);262 this.icon = IconLoader.get_default ().get_rendered_icon (file.icon);
257263
@@ -263,6 +269,10 @@
263 children_loaded = true;269 children_loaded = true;
264 }270 }
265 });271 });
272
273 this.activated.connect (() => {
274 this.expanded = !this.expanded;
275 });
266 276
267 try {277 try {
268 monitor = file.file.monitor_directory (GLib.FileMonitorFlags.NONE);278 monitor = file.file.monitor_directory (GLib.FileMonitorFlags.NONE);
269279
=== modified file 'plugins/terminal/terminal.vala'
--- plugins/terminal/terminal.vala 2014-08-07 00:33:31 +0000
+++ plugins/terminal/terminal.vala 2014-11-01 21:23:31 +0000
@@ -167,4 +167,4 @@
167 var objmodule = module as Peas.ObjectModule;167 var objmodule = module as Peas.ObjectModule;
168 objmodule.register_extension_type (typeof (Peas.Activatable),168 objmodule.register_extension_type (typeof (Peas.Activatable),
169 typeof (Scratch.Plugins.Terminal));169 typeof (Scratch.Plugins.Terminal));
170}170}
171\ No newline at end of file171\ No newline at end of file

Subscribers

People subscribed via source and target branches