Open genodeftest opened 8 years ago
Without looking at the code itself, it appears that the combobox is populated with the root folders that you add to your collection.
I don't mind the idea of a GFileMonitor instead of refresh... though, it seems like this sort of thing might be built into some GTK widget already. I wonder if you could repurpose a FileChooser widget for this purpose, as it already has builtin volumes/shortcuts support.
For linux, you should be able to find the removable devices via dbus/udisks et al... which I think there's a mass storage plugin that sorta handles some of that? But, I've never used it, and I don't think we've ever had a particularly good story about how to access removable devices.
For the others, it's hard to say, but almost certainly would need to be platform specific.
I've actually contemplated removing all device support from Exaile, just because it's incomplete and feels like it has been tacked on. However, the CD stuff uses it, so I haven't bothered yet.
I think in the toolbar we could get rid of the reload button. Instead a GFileMonitor should be used to watch folders for changes.
Makes sense, though I don't know how well that works on all platforms and on network GVFS mounts.
Path: Why is this using a GtkComboBox when there is no way to bookmark the current directory? How about just using a GtkEntry? Or is there a way to bookmark I don't know about?
It should list your library locations. Having bookmarks would indeed be useful.
Instead I think exaile should have another button for easy access of external mass storage devices. I often have to type in a path manually or have some 5…10 clicks to get to those devices. Bad thing is, this behaviour would be platform-specific: [...]
GVolumeMonitor kind of does this:
>>> [m.get_name() for m in Gio.VolumeMonitor.get().get_mounts()]
['BD-ROM Drive (F:)', 'Local Disk (D:)', 'Local Disk (C:)']
### In a cmd shell, I create a loopback mount with
### subst Z: C:\Windows
>>> [m.get_name() for m in Gio.VolumeMonitor.get().get_mounts()]
['Local Disk (Z:)', 'BD-ROM Drive (F:)', 'Local Disk (D:)', 'Local Disk (C:)']
but surprisingly it seems broken in Linux (tested on Arch under VirtualBox):
(Update: Never mind, apparently we just need a mainloop running. Ignore the text below.)
>>> [m.get_name() for m in Gio.VolumeMonitor.get().get_mounts()]
['localhost', '21 GB Volume']
### Looks ok so far. 'localhost' is an sftp mount, '21 GB Volume' is a data partition.
### At this point I manually mount a CD.
>>> [m.get_name() for m in Gio.VolumeMonitor.get().get_mounts()]
['localhost', '21 GB Volume']
### Hm, the CD doesn't show up.
### Then I manually unmount the '21 GB Volume'.
>>> [m.get_name() for m in Gio.VolumeMonitor.get().get_mounts()]
['localhost', '21 GB Volume']
### Also doesn't change.
### Now I restart the Python session.
>>> [m.get_name() for m in Gio.VolumeMonitor.get().get_mounts()]
['localhost', '10_2_RELEASE_AMD64_BO']
@sjohannes : I reported that upstream: https://bugzilla.gnome.org/show_bug.cgi?id=759644
A GtkFileChooserWidget would be ideal. Sadly there is no API for manipulating its columns. The default one might be too wide to be displayed in a Panel. Anyway we want it to display either the GtkPlacesSidebar or a GtkTreeView listing files. I'll try to implement this.
EDIT: There are a bunch of signals on e.g. GVolumeMonitor to listen for. That might help.
Also, is it possible to "remember" where in the list you were so when you go up/back a directory, the file list is positioned close to the folder just exited? Currently, it always sets you to the beginning.
Also, is it possible to "remember" where in the list you were so when you go up/back a directory, the file list is positioned close to the folder just exited? Currently, it always sets you to the beginning.
85dc8d6 implements a basic version of this. It won't work well if the directory has been modified in the meantime (it just saves the row+column number in history).
Thanks, @sjohannes! Just curious... would it be better to save as you enter a directory, or pull the name of the dir you are LEAVING and search for where that is in the updated ".." list? Just two different ways of doing it, I guess.
Good point. Nautilus and Thunar seem to work as you described, so I've modified the code to do that.
The previous design was based on Windows Explorer, where each history entry stores its own selection. I think that's actually better than Nautilus's behaviour for a file manager, but in our case not very important.
A most excellent patch, good sir! Arigato!
To summarize the discussion as I understand it: we've identified three things we can do to improve the Files panel:
Use GFileMonitor to automatically refresh the directory. There are some questions here regarding its reliability and performance, especially on network drives.
Provide a way to quickly browse to mounted filesystems. I have just implemented this in 728a2ea. It's now in the drop down list, after your library locations.
Preserve selection when going up/back/forward. This was implemented a long time ago.
This bug is a bit busy with discussion regarding points number 2 and 3 (which have been resolved), so I'm going to close it. Feel free to open a new bug for point 1, or if there are further requests.
Moving to exaile-ideas for point 1.
Currently, the files panel has these elements:
I think in the toolbar we could get rid of the reload button. Instead a GFileMonitor should be used to watch folders for changes.
Path: Why is this using a GtkComboBox when there is no way to bookmark the current directory? How about just using a GtkEntry? Or is there a way to bookmark I don't know about?
Instead I think exaile should have another button for easy access of external mass storage devices. I often have to type in a path manually or have some 5…10 clicks to get to those devices. Bad thing is, this behaviour would be platform-specific:
C:\
,D:\
,E:\
, …/run/media/username/
. Downside: unmounted disks are not present. Alternatively there isother-locations:///
, which currently isn't supported by gvfs but only by nautilus./media/
when I checked lastIdeas? Comments?