Places menu entries not fully integrated

Bug #593141 reported by Jan
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Cardapio
Fix Released
High
Unassigned

Bug Description

I have some servers and remote folders in my bookmarks but they are neither displayed in Cardapio nor found when searching. Local bookmarks work fine. The protocols used are ftp, sftp and smb.

Similar for extermal media: When I plug in a USB-Stick or connect my phone or put in a CD, the Places category does not change like in the normal main menu.

»Connect to Server …« and »Network« aren’t shown either. But these are not priorities and it would be better to only show them when searched for (like the System settings).

Version: 0.9.92-ubuntu1
Ubuntu Lucid Lynx

summary: - Bookmarks to remote locations not shown
+ Places menu entries not fully integrated
Thiago Teixeira (tvst)
summary: - Places menu entries not fully integrated
+ Bookmarks to remote locations not shown
description: updated
Revision history for this message
Thiago Teixeira (tvst) wrote :

I actually think the previous name was more descriptive :) So I switched back to that.

Now, about the bug itself: I will see what I can do about that.

Changed in cardapio:
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
Jan (jancborchardt-deactivatedaccount) wrote :

I should have changed the content _before_ changing the title. Changed the title back-back. ;)

summary: - Bookmarks to remote locations not shown
+ Places menu entries not fully integrated
Revision history for this message
Timo Reimerdes (timorei) wrote :

I have set my Homefolder-as-Desktopfolder (because thats just one less level of clickage to me). Nautilus gets it, the file dialog got it, but sadly theres still a "desktop entry" in the Places in cardapio.

thanks,
   Timo

Revision history for this message
Thiago Teixeira (tvst) wrote :

Timo: I will see what I can do. All in all, the places menu is a bit of a pain to code for. Right now, some parts are read automagically from your Gnome preferences, and other parts are hard-coded (which is why you are getting the Desktop entry). I will see how other menu apps deal with this and get back to you.

Revision history for this message
Thiago Teixeira (tvst) wrote :

Same goes for Jan-Christoph's original bug report, of course :)

Revision history for this message
Timo Reimerdes (timorei) wrote :

How about geting the list of folders from the same place that the default gnome-menubar thing gets it?

Because I just readded it to check - and surprise - it doesn't have superfluous entries.

Stuff like that should be in gnome-panel-2.30.0 sources -> gnome-panel -> panel-menu-bar.c I guess.

I'll take a look at it and post if I find something.

Revision history for this message
Timo Reimerdes (timorei) wrote :

Ok, it seems as if the more interesting file is the panel-menu-items.c
I just did:
apt-get source gnome-panel
to get the sources and am fast-reading it a bit, since I never ever before touched this code. ;)

oh boy, seems as if this is actually a rather hardcoded option in the panel-menu:
Lines 1041 to 1069 in panel-menu-items.c:
 panel_menu_items_append_place_item (PANEL_ICON_HOME, NULL,
         name,
         _("Open your personal folder"),
         places_menu,
         G_CALLBACK (activate_home_uri),
         uri);
 g_free (name);
 g_free (uri);

 if (!gconf_client_get_bool (panel_gconf_get_client (),
        DESKTOP_IS_HOME_DIR_KEY,
        NULL)) {
  file = g_file_new_for_path (g_get_user_special_dir (G_USER_DIRECTORY_DESKTOP));
  uri = g_file_get_uri (file);
  g_object_unref (file);

  panel_menu_items_append_place_item (
    PANEL_ICON_DESKTOP, NULL,
    /* Translators: Desktop is used here as in
     * "Desktop Folder" (this is not the Desktop
     * environment). */
    C_("Desktop Folder", "Desktop"),
    _("Open the contents of your desktop in a folder"),
    places_menu,
    G_CALLBACK (activate_desktop_uri),
    /* FIXME: if the dir changes, we'd need to update the drag data since the uri is not the same */
    uri);
  g_free (uri);
 }

Maybe this gives you enough pointers for you code :)

Revision history for this message
Thiago Teixeira (tvst) wrote :

Timo:
When you click "Home" on Cardapio, does it open the same folder as when you click "Desktop" ?

If so, this is really easy to fix :)

Revision history for this message
Timo Reimerdes (timorei) wrote :

yes, yes it does. :)

Revision history for this message
Thiago Teixeira (tvst) wrote :

Timo: Ok, this is now fixed in trunk. Will be in the PPA later tonight.

Revision history for this message
Timo Reimerdes (timorei) wrote :

I just did the upgrade and just in case it should have been fixed in the 0.0.109 it's not quite right.

The Desktop icon simply turned into another home icon (restarted the whole gnome-session to make sure).

Revision history for this message
David Robert Lewis (afrodeity) wrote :

I think there should be an option to keep the old Ubuntu format where system and places are in the panel.

Revision history for this message
Thiago Teixeira (tvst) wrote :

David:
please see this blueprint https://blueprints.launchpad.net/cardapio/+spec/always-show-administration-and-preferences

long story short: it's coming. :)

Revision history for this message
Jan (jancborchardt-deactivatedaccount) wrote :

Bookmarks to remote locations and servers are now displayed. Thanks! :)

Revision history for this message
Thiago Teixeira (tvst) wrote :

Yes, I removed an os.path.exists(filepath) check that I was doing before. I guess it's better this way.

Revision history for this message
xrayA4T (xraya4t) wrote :

I just got the latest version and my SFTP:// bookmarks are now listed. There is still a problem. If the location is mounted, clicking on the bookmark opens the location. If the location is not mounted nothing happens. When using the other menu apllets, Main Menu and Menu Bar, the location is mounted and then opened in Nautilus.

Revision history for this message
Jan (jancborchardt-deactivatedaccount) wrote :

I knew I forgot something … should have actually tried it out: I got the same problem as xrayA4T.

cardapio run-in-window simply prints »Error showing url: The specified location is not mounted«.

Revision history for this message
Thiago Teixeira (tvst) wrote :

This seems to be a problem with the xdg-open tool, which is what I use to launch anything that looks like a path in Cardapio (such as folders, files of any mime type, web urls, sftp, smb, etc.).

For example, try going to the terminal and typing:
$ xdg-open sftp://www.myserver.com
(where sftp://www.myserver.com is whatever appears in the tooltip of the sftp item in Cardapio)

This will not work, and will give the error that Jan-Christoph posted. The same problem occurs with gnome-open, by the way.

So, if anyone knows a command-line tool that can open all those items (folders, files of any mime type, web urls, sftp, smb, etc.), I'm all ears.

Otherwise, I'll keep researching this...

description: updated
Revision history for this message
cmulk (cmulk) wrote :

You may already know this, but the gvfs-mount command will handle sftp, ftp, and smb locations.

For example: gvfs-mount sftp://<email address hidden>

Revision history for this message
Thiago Teixeira (tvst) wrote :

milky2313:

The problem with gvfs-mount is that when it asks for a password it does so on stdout, and so the user doesn't see it.

But your post made me go ahead and look further into this situation :)

    ~

It seems that there is already a bug report upstream at freedesktop about xdg-open not mounting remote locations, but it has been untouched for a while.
http://bugs.freedesktop.org/show_bug.cgi?id=21728
https://bugs.launchpad.net/do/+bug/311620

There is also a bug report for gnome-open, but it was closed because gvfs-open replaced gnome-open.
https://bugzilla.gnome.org/show_bug.cgi?id=144704

Now, another alternative is to use the gio module's mount method in Python. But this means that I would have to replicate the password dialogbox, and also connect to the gnome keyring, etc. etc., which is just overkill.

    ~

So in the end I just took the easy route and made Cardapio simply launch Nautilus whenever an ftp, sftp, or smb path is detected (instead of trying to guess the correct app to use). This way, it is Nautilus that takes care of the password management, not Cardapio. It makes my life easier :)

Of course, the problem with this solution is that some people may want other apps to handle those paths instead of Nautilus. So as a work-around I added a new set of options in the config.ini file that lets you specify your favorite handler:

1) "handler for ftp paths": "nautilus '%s'",
2) "handler for sftp paths": "nautilus '%s'",
3) "handler for smb paths": "nautilus '%s'",

Just replace "nautilus '%s'" with the command line for your favorite program. Cardapio will replace %s with the remote location you are trying to open, and then it will execute that command line.

    ~

This is all a bit ugly, and I'm not entirely satisfied with this solution --- but at least it's something. Let me know if you have any other ideas...

Revision history for this message
Jan (jancborchardt-deactivatedaccount) wrote :

I don’t know if all other file managers are capable of handling the protocols, but if someone has the remote locations as file manager bookmarks it is likely that they are using them as well for browsing it.

So what about checking for the default file manager and set those handler commands to it?

(And by the way, it works great so far. Delegating to the file manager seems to be the intelligent choice.)

Revision history for this message
Thiago Teixeira (tvst) wrote :

I considered that solution, but the problem is that some popular file managers (like Thunar) do not support remote locations.

The real solution here would be for the Gnome guys to provide a way to mount remote locations, showing the login/password dialog if needed. :-/

Revision history for this message
Jan (jancborchardt-deactivatedaccount) wrote :

Regarding the »recent documents« part of the places menu:
The current recent documents plugin only shows up when searching for something. This somehow defeats the purpose of recent documents because you have to recall what you used some time ago – for search, there is already Tracker.

The plugin should instead show the 5 most recent documents not only on search.

What do you think?

Revision history for this message
Jan (jancborchardt-deactivatedaccount) wrote :

I’m currently trying this out as I changed the plugin code to:
hide_from_sidebar = True

And it’s just great. The only problem is that the list is not updated until you make a search.

Revision history for this message
Thiago Teixeira (tvst) wrote :

I don't understand what you mean about "the list is not updated until you make a search".

Do you mean:
1) that the list is not updated with new documents as they are viewed/edited?
or
2) that the list keeps the previous search results rather than showing the last recently viewed/edited documents?

(Let me know if you get the difference between the two. This is actually pretty hard to explain!)

Revision history for this message
Jan (jancborchardt-deactivatedaccount) wrote :

It is 1 since it is independent from search: I modified the plugin so that the recent documents are always shown – without the need to search for them, like in the normal places menu.

But the list does not update itself when I open new documents. You have to either restart gnome-panel or perform a search (so that a function for communicating with Zeitgeist is called, I suppose).

A fix for this would be to call that updating function every time Cardapio is opened, but I can’t code that myself. ;)

Changed in cardapio:
importance: Medium → High
Revision history for this message
Jan (jancborchardt-deactivatedaccount) wrote :

This really seems to have evolved into a meta-bug but anyway:
The bookmarks that are displayed in places should have the additional 2 right-click options for ›Remove‹ and ›Rename…‹ like in the Nautilus sidebar, therefore directly changing .gtk-bookmarks.

Revision history for this message
Thiago Teixeira (tvst) wrote :

Interesting idea. I'm adding it to my queue.

Changed in cardapio:
status: Confirmed → In Progress
Revision history for this message
Jan (jancborchardt-deactivatedaccount) wrote :

Thiago, I tested out the latest Places menu implementation and it looks good. :)

Seeing the file system fade from the Nautilus sidebar and it not being useful for normal users at all, I advise hiding it in Cardapio.
And since Computer is only the Nautilus equivalent of the places menu, it should be hidden as well.

Especially because the Places menu is on top we should not have technical / redundant items shown there. :)

Revision history for this message
Thiago Teixeira (tvst) wrote :

Good points. Will do.

Revision history for this message
Jan (jancborchardt-deactivatedaccount) wrote :

Cool, very nice. :)

I have a second partition which is unmounted and still shows. In my defense there is Ubuntu on it as well but I can imagine a lot of Windows / Ubuntu setups where one would wonder what that is – is there a way to differentiate unmounted file systems from, say, external hard drives and not show them there?

Also, I am thinking about »Network« – is it used that often to rectify having such a prime spot? The problem is that there isn’t another obvious solution: showing up only on search would be weird, also hiding it would destroy a feature. I know that with Cardapio having mounting and unmounting, the Nautilus sidebar is gone for me. Similar might be true for Network.

What do you think?

Revision history for this message
Thiago Teixeira (tvst) wrote :

> I have a second partition which is unmounted and still shows.

Yes, there are still a few bugs with these new Places features. Mainly: (1) picking which mountpoints should show up and (2) making sure unmount works for every shown mountpoint. This is why I haven't released this code to the PPA yet. I'll be working on these issues soon.

    ~

> Also, I am thinking about »Network«

I agree that the Network item is a bit strange. My original plan was to keep this item and list all mounted remote folders underneath it -- like Nautilus Elementary does. I think it will make a little more sense then, or at the very least it will be a little more cohesive.

    ~

My larger plan, when introduction these new features to the Places menu, was that we should soon give Cardapio a 3rd mode of operation, next to the existing Panel Mode and the Launcher Mode. The 3rd mode, tentatively called Horizontal Panel Mode, would recreate the "Application Places System" menu, and clicking on each each would open a different Cardapio view.

* "Applications" would open regular Cardapio, but without the Places category or Control Center.

* "Places" would open Cardapio showing only Places, but categorized into "Personal", "Devices", and "Network", like in Nautilus Elementary. Plus also "Recent Documents" with Zeitgeist.

* "System" would open Cardapio showing only the Control Center categories.

I'm just not sure what Super+Space would do when in Horizontal Panel Mode. Should it open "regular" Cardapio, or should it open "Applications", like the default menu does?

(by the way, someone posted this idea before either in a bug report or a blueprint, but I can't seem to find it to link it here)

Thiago Teixeira (tvst)
Changed in cardapio:
status: In Progress → Fix Released
Changed in cardapio:
milestone: none → 1.0
Revision history for this message
0N3_xyz (tophitter225) wrote :

I dont know if im in right place but using latest cardapio package in ubuntu 11.10 gnome shell extension none of the folders Home, Documents, Pictures ect will open from the menu nautilus is the file manager no idea why they wont have places disabled via the config.json file would be nice to get it working any more info needed glad to post would love the places plugin to work :(

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.