Merge lp:~jeremywootten/pantheon-files/connect-server-plugin-in-sidebar into lp:~elementary-apps/pantheon-files/trunk

Proposed by Jeremy Wootten
Status: Merged
Merged at revision: 1604
Proposed branch: lp:~jeremywootten/pantheon-files/connect-server-plugin-in-sidebar
Merge into: lp:~elementary-apps/pantheon-files/trunk
Diff against target: 611 lines (+127/-93)
7 files modified
CMakeLists.txt (+1/-1)
libcore/AbstractSidebar.vala (+53/-10)
libcore/Plugin.vala (+1/-1)
libcore/PluginManager.vala (+2/-2)
plugins/network-places/plugin.vala (+7/-0)
src/View/LocationBar.vala (+2/-2)
src/View/Sidebar.vala (+61/-77)
To merge this branch: bzr merge lp:~jeremywootten/pantheon-files/connect-server-plugin-in-sidebar
Reviewer Review Type Date Requested Status
Cody Garver (community) Needs Fixing
Jeremy Wootten Needs Resubmitting
Danielle Foré Needs Fixing
xapantu Pending
Review via email: mp+233477@code.launchpad.net

Description of the change

Use network-places plugin to insert extra network category item "Connect server".
Adds infra-structure for adding plugin items with callbacks into the sidebar network category (and potentially other categories).
Removes the "Connect Server" item from the sidebar context menu.

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

"Connect server" should be "Connect to Server"

I think a better icon might be "network-server" or "network-workgroup"

Also Cody's screenshot shows that there has been some kind of theme issue introduced. The widget no longer expands to fill the height of the pane

review: Needs Fixing
1594. By Jeremy Wootten

change icon, change text, make sidebar content expand

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

> "Connect server" should be "Connect to Server"
>
> I think a better icon might be "network-server" or "network-workgroup"
>
> Also Cody's screenshot shows that there has been some kind of theme issue
> introduced. The widget no longer expands to fill the height of the pane

OK, I have fixed these issues, using the "network-server" icon. Note that the "network-server" and "network-workgroup" icons appear the same as the one already used for "Entire Network" item (on my system).

Instead of the string "network-server", Marlin.ICON_NETWORK_SERVER should really have been used (defined in /src/View/Resources.vala) but I need the advice of a cmake expert how to make this visible to /plugins/network-places/plugin.vala

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

You did not entirely correct "Connect to Server"

I would not bother trying to access that icon variable

Dan, are you sure there should be no ellipsis in the string? There's no such exception stated in the HIG http://elementaryos.org/docs/human-interface-guidelines/using-ellipses

review: Needs Fixing
1595. By Jeremy Wootten

Fix label text, hide irrelevant context menu items, more generic plugin interface to sidebar, upgrade to valac 0.25.4

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

I have now used an ellipsis in the label text as the button leads to a dialog and there is no other indication.
I have now upgraded to valac 0.25.4 so the branch lp:~jeremywootten/pantheon-files/upgrade_to_vala_0.25.4 should be merged before this one.
It is questionable whether the infobar is now needed in the network view since the same functionality is present in the sidebar.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'CMakeLists.txt'
2--- CMakeLists.txt 2014-08-05 18:18:49 +0000
3+++ CMakeLists.txt 2014-09-24 07:03:43 +0000
4@@ -22,7 +22,7 @@
5
6 find_package (Vala REQUIRED)
7 include (ValaVersion)
8-ensure_vala_version ("0.16.0" MINIMUM)
9+ensure_vala_version ("0.25.0" MINIMUM)
10 include (ValaPrecompile)
11
12 IF (LIB_ONLY)
13
14=== modified file 'libcore/AbstractSidebar.vala'
15--- libcore/AbstractSidebar.vala 2014-07-12 23:39:32 +0000
16+++ libcore/AbstractSidebar.vala 2014-09-24 07:03:43 +0000
17@@ -18,6 +18,18 @@
18 ***/
19
20 namespace Marlin {
21+
22+ public delegate void PluginCallbackFunc (Gtk.Widget widget);
23+ public enum PlaceType {
24+ BUILT_IN,
25+ MOUNTED_VOLUME,
26+ BOOKMARK,
27+ BOOKMARKS_CATEGORY,
28+ PERSONAL_CATEGORY,
29+ STORAGE_CATEGORY,
30+ PLUGIN_ITEM
31+ }
32+
33 public abstract class AbstractSidebar : Gtk.ScrolledWindow {
34 public enum Column {
35 NAME,
36@@ -37,10 +49,13 @@
37 SPINNER_PULSE,
38 FREE_SPACE,
39 DISK_SIZE,
40+ PLUGIN_CALLBACK,
41 COUNT
42 }
43
44 protected Gtk.TreeStore store;
45+ protected Gtk.TreeRowReference network_category_reference;
46+ protected Gtk.Box content_box;
47
48 protected void init () {
49 store = new Gtk.TreeStore (((int)Column.COUNT),
50@@ -60,18 +75,46 @@
51 typeof (bool), /* Show spinner */
52 typeof (uint), /* Spinner pulse */
53 typeof (uint64), /* Free space */
54- typeof (uint64) /* For disks, total size */
55+ typeof (uint64), /* For disks, total size */
56+ typeof (Marlin.PluginCallbackFunc)
57 );
58- }
59-
60- public void add_extra_item (string text) {
61+
62+ content_box = new Gtk.Box (Gtk.Orientation.VERTICAL, 0);
63+ this.add (content_box);
64+ content_box.show_all ();
65+ }
66+
67+ public void add_extra_network_item (string text, string tooltip, Icon? icon, Marlin.PluginCallbackFunc? cb) {
68+ add_extra_item (network_category_reference, text, tooltip, icon, cb);
69+ }
70+
71+ public void add_extra_item (Gtk.TreeRowReference category, string text, string tooltip, Icon? icon, Marlin.PluginCallbackFunc? cb) {
72 Gtk.TreeIter iter;
73- store.append (out iter, null);
74- store.set (iter,
75- Column.ICON, null,
76- Column.NAME, text,
77- Column.URI, "test://",
78- -1);
79+ store.get_iter (out iter, category.get_path ());
80+ iter = add_place (PlaceType.PLUGIN_ITEM,
81+ iter,
82+ text,
83+ icon,
84+ null,
85+ null,
86+ null,
87+ null,
88+ 0,
89+ tooltip);
90+ if (cb != null)
91+ store.@set (iter, Column.PLUGIN_CALLBACK, cb);
92+
93 }
94+
95+ protected abstract Gtk.TreeIter add_place (Marlin.PlaceType place_type,
96+ Gtk.TreeIter? parent,
97+ string name,
98+ Icon? icon,
99+ string? uri,
100+ Drive? drive,
101+ Volume? volume,
102+ Mount? mount,
103+ uint index,
104+ string tooltip) ;
105 }
106 }
107
108=== modified file 'libcore/Plugin.vala'
109--- libcore/Plugin.vala 2013-07-21 04:44:33 +0000
110+++ libcore/Plugin.vala 2014-09-24 07:03:43 +0000
111@@ -2,7 +2,7 @@
112 public virtual void directory_loaded (void* data) { }
113 public virtual void context_menu (Gtk.Widget? widget, List<GOF.File> files) { }
114 public virtual void ui (Gtk.UIManager? widget) { }
115- public virtual void update_sidebar (Gtk.Widget sidebar) { }
116+ public virtual void update_sidebar (Gtk.Widget widget) { }
117 public virtual void update_file_info (GOF.File file) { }
118
119 public Gtk.Widget window;
120
121=== modified file 'libcore/PluginManager.vala'
122--- libcore/PluginManager.vala 2014-05-17 10:37:01 +0000
123+++ libcore/PluginManager.vala 2014-09-24 07:03:43 +0000
124@@ -216,9 +216,9 @@
125 plugin.interface_loaded (win);
126 }
127
128- public void update_sidebar (Gtk.Widget win) {
129+ public void update_sidebar (Gtk.Widget widget) {
130 foreach (var plugin in plugin_hash.values)
131- plugin.update_sidebar (win);
132+ plugin.update_sidebar (widget);
133 }
134
135 public void update_file_info (GOF.File file) {
136
137=== modified file 'plugins/network-places/plugin.vala'
138--- plugins/network-places/plugin.vala 2013-05-27 10:54:46 +0000
139+++ plugins/network-places/plugin.vala 2014-09-24 07:03:43 +0000
140@@ -42,6 +42,13 @@
141 infobar.show_all ();
142 }
143 }
144+
145+ public override void update_sidebar (Gtk.Widget widget) {
146+ var sidebar = widget as Marlin.AbstractSidebar;
147+ sidebar.add_extra_network_item (_("Connect to Server…"), _("Connect to a network file server"),
148+ new ThemedIcon.with_default_fallbacks ("network-server"),
149+ marlin_connect_server_dialog_show);
150+ }
151 }
152
153 public Marlin.Plugins.Base module_init () {
154
155=== modified file 'src/View/LocationBar.vala'
156--- src/View/LocationBar.vala 2014-09-19 10:37:21 +0000
157+++ src/View/LocationBar.vala 2014-09-24 07:03:43 +0000
158@@ -354,7 +354,7 @@
159 menu_item.set_image (new Gtk.Image.from_gicon (icon, Gtk.IconSize.MENU));
160 menu_item.always_show_image = true;
161 menu_item.activate.connect (() => {
162- unowned AppInfo app = submenu_open_with.get_active ().get_data ("appinfo");
163+ AppInfo app = submenu_open_with.get_active ().get_data ("appinfo");
164 launch_uri_with_app (app, current_right_click_path);
165 });
166 submenu_open_with.append (menu_item);
167@@ -374,7 +374,7 @@
168
169 var response = dialog.run ();
170 if (response == Gtk.ResponseType.OK) {
171- unowned AppInfo app = dialog.get_app_info ();
172+ AppInfo app = dialog.get_app_info ();
173 launch_uri_with_app (app, current_right_click_path);
174 }
175
176
177=== modified file 'src/View/Sidebar.vala'
178--- src/View/Sidebar.vala 2014-08-09 23:33:45 +0000
179+++ src/View/Sidebar.vala 2014-09-24 07:03:43 +0000
180@@ -22,15 +22,6 @@
181 namespace Marlin.Places {
182 public class Sidebar : Marlin.AbstractSidebar {
183
184- enum PlaceType {
185- BUILT_IN,
186- MOUNTED_VOLUME,
187- BOOKMARK,
188- BOOKMARKS_CATEGORY,
189- PERSONAL_CATEGORY,
190- STORAGE_CATEGORY
191- }
192-
193 enum ViewWindowOpenFlags {
194 DEFAULT,
195 NEW_TAB,
196@@ -105,6 +96,7 @@
197
198 Gtk.Menu popupmenu;
199 Gtk.MenuItem popupmenu_open_in_new_tab_item;
200+ Gtk.MenuItem popupmenu_open_in_new_window_item;
201 Gtk.MenuItem popupmenu_remove_item;
202 Gtk.MenuItem popupmenu_rename_item;
203 Gtk.MenuItem popupmenu_separator_item1;
204@@ -115,7 +107,6 @@
205 Gtk.MenuItem popupmenu_rescan_item;
206 Gtk.MenuItem popupmenu_format_item;
207 Gtk.MenuItem popupmenu_empty_trash_item;
208- Gtk.MenuItem popupmenu_connect_server_item;
209 Gtk.MenuItem popupmenu_start_item;
210 Gtk.MenuItem popupmenu_stop_item;
211
212@@ -139,7 +130,7 @@
213 construct_tree_view ();
214 configure_tree_view ();
215 connect_tree_view_signals ();
216- this.add (this.tree_view);
217+ this.content_box.pack_start (this.tree_view, true);
218
219 this.bookmarks = Marlin.BookmarkList.get_instance ();
220 bookmarks.contents_changed.connect (update_places);
221@@ -301,16 +292,16 @@
222 eject_icon = new ThemedIcon.with_default_fallbacks ("media-eject-symbolic");
223 }
224
225- private Gtk.TreeIter add_place (PlaceType place_type,
226- Gtk.TreeIter parent,
227- string name,
228- Icon? icon,
229- string? uri,
230- Drive? drive,
231- Volume? volume,
232- Mount? mount,
233- uint index,
234- string tooltip) {
235+ protected override Gtk.TreeIter add_place (Marlin.PlaceType place_type,
236+ Gtk.TreeIter? parent,
237+ string name,
238+ Icon? icon,
239+ string? uri,
240+ Drive? drive,
241+ Volume? volume,
242+ Mount? mount,
243+ uint index,
244+ string tooltip) {
245 Gtk.IconSize stock_size = Marlin.zoom_level_to_stock_icon_size (zoom_level);
246 eject_spinner_cell_renderer.icon_size = stock_size;
247
248@@ -324,7 +315,7 @@
249 bool show_eject, show_unmount;
250 check_unmount_and_eject (mount, volume, drive, out show_unmount, out show_eject);
251 if (show_unmount || show_eject)
252- assert (place_type != PlaceType.BOOKMARK);
253+ assert (place_type != Marlin.PlaceType.BOOKMARK);
254
255 bool show_eject_button = false;
256 if (mount != null)
257@@ -356,7 +347,7 @@
258 Column.INDEX, index,
259 Column.EJECT, show_eject_button,
260 Column.NO_EJECT, !show_eject_button,
261- Column.BOOKMARK, place_type == PlaceType.BOOKMARK,
262+ Column.BOOKMARK, place_type == Marlin.PlaceType.BOOKMARK,
263 Column.TOOLTIP, tooltip,
264 Column.EJECT_ICON, eject,
265 Column.SHOW_SPINNER, false,
266@@ -386,14 +377,13 @@
267 last_selected_uri = null;
268
269 store.clear ();
270- plugins.update_sidebar ((Gtk.Widget)this);
271
272 /* ADD BOOKMARKS CATEGORY*/
273 store.append (out iter, null);
274 store.@set (iter,
275 Column.ICON, null,
276 Column.NAME, _("Personal"),
277- Column.ROW_TYPE, PlaceType.BOOKMARKS_CATEGORY,
278+ Column.ROW_TYPE, Marlin.PlaceType.BOOKMARKS_CATEGORY,
279 Column.EJECT, false,
280 Column.NO_EJECT, true,
281 Column.BOOKMARK, false,
282@@ -407,7 +397,7 @@
283 mount_uri = "";
284 }
285
286- add_place (PlaceType.BUILT_IN,
287+ add_place (Marlin.PlaceType.BUILT_IN,
288 iter,
289 _("Home"),
290 new ThemedIcon (Marlin.ICON_HOME),
291@@ -434,7 +424,7 @@
292 }
293
294 /* Add trash */
295- add_place (PlaceType.BUILT_IN,
296+ add_place (Marlin.PlaceType.BUILT_IN,
297 iter,
298 _("Trash"),
299 Marlin.TrashMonitor.get_icon (),
300@@ -450,14 +440,14 @@
301 store.@set (iter,
302 Column.ICON, null,
303 Column.NAME, _("Devices"),
304- Column.ROW_TYPE, PlaceType.STORAGE_CATEGORY,
305+ Column.ROW_TYPE, Marlin.PlaceType.STORAGE_CATEGORY,
306 Column.EJECT, false,
307 Column.NO_EJECT, true,
308 Column.BOOKMARK, false,
309 Column.TOOLTIP, _("Your local partitions and devices"));
310
311 /* Add Filesystem BUILTIN */
312- add_place (PlaceType.BUILT_IN,
313+ add_place (Marlin.PlaceType.BUILT_IN,
314 iter,
315 _("File System"),
316 new ThemedIcon.with_default_fallbacks (Marlin.ICON_FILESYSTEM),
317@@ -487,7 +477,7 @@
318 * in the OS to save battery juice.
319 */
320 var name = drive.get_name ();
321- add_place (PlaceType.BUILT_IN,
322+ add_place (Marlin.PlaceType.BUILT_IN,
323 iter,
324 name,
325 drive.get_icon (),
326@@ -508,7 +498,7 @@
327 var mount = volume.get_mount ();
328 if (mount != null) {
329 var root = mount.get_default_location ();
330- add_place (PlaceType.MOUNTED_VOLUME,
331+ add_place (Marlin.PlaceType.MOUNTED_VOLUME,
332 iter,
333 mount.get_name (),
334 mount.get_icon (),
335@@ -521,7 +511,7 @@
336 } else {
337 /* see comment above in why we add an icon for an unmounted mountable volume */
338 var name = volume.get_name ();
339- add_place (PlaceType.MOUNTED_VOLUME,
340+ add_place (Marlin.PlaceType.MOUNTED_VOLUME,
341 iter,
342 name,
343 volume.get_icon (),
344@@ -553,7 +543,7 @@
345 }
346 }
347
348- add_place (PlaceType.MOUNTED_VOLUME,
349+ add_place (Marlin.PlaceType.MOUNTED_VOLUME,
350 iter,
351 mount.get_name (),
352 mount.get_icon (),
353@@ -570,17 +560,19 @@
354 store.@set (iter,
355 Column.ICON, null,
356 Column.NAME, _("Network"),
357- Column.ROW_TYPE, PlaceType.STORAGE_CATEGORY,
358+ Column.ROW_TYPE, Marlin.PlaceType.STORAGE_CATEGORY,
359 Column.EJECT, false,
360 Column.NO_EJECT, true,
361 Column.BOOKMARK, false,
362 Column.TOOLTIP, _("Your network places"));
363
364+ network_category_reference = new Gtk.TreeRowReference (store, store.get_path (iter));
365+
366 /* Add network mounts */
367 network_mounts.reverse ();
368 foreach (Mount mount in network_mounts) {
369 var root = mount.get_default_location ();
370- add_place (PlaceType.BUILT_IN,
371+ add_place (Marlin.PlaceType.BUILT_IN,
372 iter,
373 mount.get_name (),
374 mount.get_icon (),
375@@ -593,7 +585,7 @@
376 }
377
378 /* Add Entire Network BUILTIN */
379- add_place (PlaceType.BUILT_IN,
380+ add_place (Marlin.PlaceType.BUILT_IN,
381 iter,
382 _("Entire Network"),
383 new GLib.ThemedIcon (Marlin.ICON_NETWORK),
384@@ -604,6 +596,8 @@
385 0,
386 _("Browse the contents of the network"));
387
388+ plugins.update_sidebar ((Gtk.Widget)this);
389+
390 expander_init_pref_state (tree_view);
391
392 /* select any previously selected place or any place matching slot location */
393@@ -614,7 +608,7 @@
394 }
395
396 private void add_bookmark (Gtk.TreeIter iter, Marlin.Bookmark bm, uint index) {
397- add_place ( PlaceType.BOOKMARK,
398+ add_place ( Marlin.PlaceType.BOOKMARK,
399 iter,
400 bm.label.dup (),
401 bm.get_icon (),
402@@ -635,7 +629,7 @@
403 if (mount != null) {
404 /* show mounted volume in sidebar */
405 var root = mount.get_default_location ();
406- last_iter = add_place (PlaceType.MOUNTED_VOLUME,
407+ last_iter = add_place (Marlin.PlaceType.MOUNTED_VOLUME,
408 iter,
409 mount.get_name (),
410 mount.get_icon (),
411@@ -661,7 +655,7 @@
412 * he just unmounted it.
413 */
414 var name = volume.get_name ();
415- add_place (PlaceType.MOUNTED_VOLUME,
416+ add_place (Marlin.PlaceType.MOUNTED_VOLUME,
417 iter,
418 name,
419 volume.get_icon (),
420@@ -673,7 +667,7 @@
421 (_("Mount and open %s")).printf (name));
422 }
423 }
424- }
425+ }
426
427 private void get_filesystem_space (GLib.File root, out uint64 fs_capacity, out uint64 fs_free) {
428 GLib.FileInfo info;
429@@ -843,14 +837,14 @@
430 private bool process_drop_between (Gtk.TreeIter iter,
431 Gtk.TreeViewDropPosition drop_pos,
432 uint info) {
433- PlaceType type;
434+ Marlin.PlaceType type;
435 uint position;
436 store.@get (iter,
437 Column.ROW_TYPE, out type,
438 Column.INDEX, out position);
439
440- if (type == PlaceType.BOOKMARK || type == PlaceType.BUILT_IN) {
441- if (type == PlaceType.BOOKMARK && drop_pos == Gtk.TreeViewDropPosition.BEFORE)
442+ if (type == Marlin.PlaceType.BOOKMARK || type == Marlin.PlaceType.BUILT_IN) {
443+ if (type == Marlin.PlaceType.BOOKMARK && drop_pos == Gtk.TreeViewDropPosition.BEFORE)
444 position--;
445
446 switch (info) {
447@@ -1044,7 +1038,8 @@
448 return;
449
450 string uri;
451- store.@get (iter, Column.URI, out uri);
452+ Marlin.PluginCallbackFunc f;
453+ store.@get (iter, Column.URI, out uri, Column.PLUGIN_CALLBACK, out f);
454
455 if (uri != null) {
456 var location = File.new_for_uri (uri);
457@@ -1058,6 +1053,8 @@
458 if (slot != null)
459 GLib.Signal.emit_by_name (slot.ctab, "path-changed", location);
460 }
461+ } else if (f != null) {
462+ f (this);
463 } else if (!ejecting_or_unmounting) {
464 Drive drive;
465 Volume volume;
466@@ -1199,6 +1196,7 @@
467 popupmenu.append (item);
468
469 item = new Gtk.ImageMenuItem.with_mnemonic (_("Open in New _Window"));
470+ popupmenu_open_in_new_window_item = item;
471 item.activate.connect (open_shortcut_in_new_window_cb);
472 item.show ();
473 popupmenu.append (item);
474@@ -1246,14 +1244,6 @@
475 item.activate.connect (empty_trash_cb);
476 item.show ();
477 popupmenu.append (item);
478-
479- /* Connect to server menu item */
480- item = new Gtk.ImageMenuItem.with_mnemonic (_("Connect to Server..."));
481- popupmenu_connect_server_item = item;
482- item.activate.connect (connect_server_cb);
483- item.show ();
484- popupmenu.append (item);
485-
486 check_popup_sensitivity ();
487 }
488
489@@ -1284,7 +1274,6 @@
490 popupmenu_start_item = null;
491 popupmenu_stop_item = null;
492 popupmenu_empty_trash_item = null;
493- popupmenu_connect_server_item = null;
494 }
495
496 /* Callback used for the GtkWidget::popup-menu signal of the shortcuts list */
497@@ -1388,26 +1377,26 @@
498 Gtk.CellRenderer cell,
499 Gtk.TreeModel model,
500 Gtk.TreeIter iter) {
501- PlaceType type;
502+ Marlin.PlaceType type;
503 store.@get (iter, Column.ROW_TYPE, out type, -1);
504
505- if (type == PlaceType.PERSONAL_CATEGORY ||
506- type == PlaceType.STORAGE_CATEGORY ||
507- type == PlaceType.BOOKMARKS_CATEGORY)
508+ if (type == Marlin.PlaceType.PERSONAL_CATEGORY ||
509+ type == Marlin.PlaceType.STORAGE_CATEGORY ||
510+ type == Marlin.PlaceType.BOOKMARKS_CATEGORY)
511 expander_renderer.visible = true;
512 else
513 expander_renderer.visible = false;
514 }
515
516- private void expander_update_pref_state (PlaceType type, bool flag) {
517+ private void expander_update_pref_state (Marlin.PlaceType type, bool flag) {
518 switch (type) {
519- case PlaceType.PERSONAL_CATEGORY:
520+ case Marlin.PlaceType.PERSONAL_CATEGORY:
521 Preferences.settings.set_boolean ("sidebar-cat-network-expander", flag);
522 break;
523- case PlaceType.STORAGE_CATEGORY:
524+ case Marlin.PlaceType.STORAGE_CATEGORY:
525 Preferences.settings.set_boolean ("sidebar-cat-devices-expander", flag);
526 break;
527- case PlaceType.BOOKMARKS_CATEGORY:
528+ case Marlin.PlaceType.BOOKMARKS_CATEGORY:
529 Preferences.settings.set_boolean ("sidebar-cat-personal-expander", flag);
530 break;
531 }
532@@ -1438,13 +1427,13 @@
533 Gtk.CellRenderer renderer,
534 Gtk.TreeModel model,
535 Gtk.TreeIter iter) {
536- PlaceType type;
537+ Marlin.PlaceType type;
538 Gtk.CellRendererText crt = renderer as Gtk.CellRendererText;
539 model.@get (iter, Column.ROW_TYPE, out type, -1);
540
541- if (type == PlaceType.PERSONAL_CATEGORY ||
542- type == PlaceType.STORAGE_CATEGORY ||
543- type == PlaceType.BOOKMARKS_CATEGORY) {
544+ if (type == Marlin.PlaceType.PERSONAL_CATEGORY ||
545+ type == Marlin.PlaceType.STORAGE_CATEGORY ||
546+ type == Marlin.PlaceType.BOOKMARKS_CATEGORY) {
547
548 crt.weight = 900;
549 crt.weight_set = true;
550@@ -1466,7 +1455,7 @@
551 private void category_row_expanded_event_cb (Gtk.TreeView tree,
552 Gtk.TreeIter iter,
553 Gtk.TreePath path) {
554- PlaceType type;
555+ Marlin.PlaceType type;
556 store.@get (iter, Column.ROW_TYPE, out type);
557 expander_update_pref_state (type, true);
558 }
559@@ -1474,7 +1463,7 @@
560 private void category_row_collapsed_event_cb (Gtk.TreeView tree,
561 Gtk.TreeIter iter,
562 Gtk.TreePath path) {
563- PlaceType type;
564+ Marlin.PlaceType type;
565 store.@get (iter, Column.ROW_TYPE, out type);
566 expander_update_pref_state (type, false);
567 }
568@@ -1886,11 +1875,6 @@
569 Marlin.FileOperations.empty_trash (window);
570 }
571
572- private void connect_server_cb (Gtk.MenuItem item) {
573- var dialog = new Marlin.ConnectServer.Dialog (window);
574- dialog.show ();
575- }
576-
577 /* VOLUME MONITOR CALLBACK FUNCTIONS */
578
579 private void mount_added_callback (Mount mount) {
580@@ -2007,7 +1991,7 @@
581 if (!get_selected_iter (out iter))
582 return;
583
584- PlaceType type;
585+ Marlin.PlaceType type;
586 Drive drive;
587 Volume volume;
588 Mount mount;
589@@ -2039,18 +2023,18 @@
590 out show_stop);
591
592 bool show_empty_trash = (uri != null) && (uri == Marlin.TRASH_URI);
593- bool show_connect_server = (uri != null) && (uri == Marlin.NETWORK_URI);
594 Eel.gtk_widget_set_shown (popupmenu_separator_item2,
595 show_eject || show_unmount ||
596- show_mount || show_empty_trash ||
597- show_connect_server);
598+ show_mount || show_empty_trash);
599 Eel.gtk_widget_set_shown (popupmenu_mount_item, show_mount);
600 Eel.gtk_widget_set_shown (popupmenu_unmount_item, show_unmount);
601 Eel.gtk_widget_set_shown (popupmenu_eject_item, show_eject);
602 Eel.gtk_widget_set_shown (popupmenu_empty_trash_item, show_empty_trash);
603 popupmenu_empty_trash_item.set_sensitive (!(Marlin.TrashMonitor.is_empty ()));
604
605- Eel.gtk_widget_set_shown (popupmenu_connect_server_item, show_connect_server);
606+ bool is_plugin = (type == Marlin.PlaceType.PLUGIN_ITEM);
607+ Eel.gtk_widget_set_shown (popupmenu_open_in_new_tab_item, !is_plugin);
608+ Eel.gtk_widget_set_shown (popupmenu_open_in_new_window_item, !is_plugin);
609 }
610
611 /**

Subscribers

People subscribed via source and target branches

to all changes: