Closed cschramm closed 10 years ago
Typically you would let it be handled by Gtk/XDG, something like the below should work.
>>> from gi.repository import Gtk, Gdk
>>> Gtk.show_uri(None, 'file:///home/sander', Gdk.CURRENT_TIME)
True
I think this does not support the obex: schema, does it?
It should if gvfs is build with bluetooth. Unfortunately I have never been able to get obex browsing working so I can't test this.
What if we used something like xdg-open $URI
then whatever browser that supports the uri is automatically selected we dont need to directly interface with gvfs in this way, since all users don't run it.
I can confirm that Gtk.show_uri
works with obex:
. The reason nautilus is used directly in the code is probably just that at that time no other file manager did have support for this.
@Teknocrat: I think they all do use gvfs. I'm sure for nautilus, thunar, caja, and pcmanfm. I don't know about dolphin, but KDE's not blueman's target platform anyway. Is there any counterexample?
Concerning the browse command setting: There seems to be a bug in the "Local services" dialog. I'm getting
Traceback (most recent call last):
File "/usr/bin/blueman-services", line 159, in on_selection_changed
self.set_page(id)
File "/usr/bin/blueman-services", line 143, in set_page
inst.on_load(self.container)
File "/usr/lib/python2.7/dist-packages/blueman/plugins/services/Transfer.py", line 43, in on_load
self.setup_transfer()
File "/usr/lib/python2.7/dist-packages/blueman/plugins/services/Transfer.py", line 132, in setup_transfer
status = a.TransferStatus("opp")
File "/usr/lib/python2.7/dist-packages/dbus/proxies.py", line 70, in __call__
return self._proxy_method(*args, **keywords)
File "/usr/lib/python2.7/dist-packages/dbus/proxies.py", line 145, in __call__
**keywords)
File "/usr/lib/python2.7/dist-packages/dbus/connection.py", line 651, in call_blocking
message, timeout)
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.UnknownMethod: Method "IsStarted" with signature "" on interface "org.openobex.Server" doesn't exist
when opening the Transfer tab and it's completely empty. Will look into this.
@Teknocrat: I think they all do use gvfs. I'm sure for nautilus, thunar, caja, and pcmanfm.
Yes, when you give xdg-open
an obex://
uri it will send it off to gvfs-open
.
I don't know about dolphin, but KDE's not blueman's target platform anyway. Is there any counterexample?
The nice thing is you really do not need to care :smile:. Gtk.show_uri
will lookup the default FM and pass the uri on to it. You may be running dolphin
as default under MATE and it should pick that up and hand it the uri.
But thinking about this now, it could potentially hand the uri to a FM that does not know how to deal with obex://
. However I do not think this is very likely these days..
Looks like the dialog problem is directly related to #84 as the obex servers are not started properly. They emit the Started
signal, but then disappear so that any method call (such as IsStarted) will fail.
Well, I agree most* file browsers use gvfs backend, however hardcoding or assuming gvfs is a mistake, and I think will in the end hurt the flexibility of blueman. I believe we can meet the demands of any file browser and use just xdg compliance.
If we pull in too many gnome dependencies then whats the difference between blueman and gnome-bluetooth?? If i need half of gnome to run blueman then i will definitely use gnome-bluetooth over blueman anyday. I hope we can retain a lightweight philosophy for blueman in general.
gvfs is optional support for pcmanfm(qt and gtk versions) and spacefm doesn't use it at all and dolphin (KDE) does NOT use it, they use solid and qt hardware abstractions
If I get it right, blueman won't use gvfs in any case. We just need to select the best option from explicit file manager invocations, Gtk.show_uri, and xdg-open. I think the last two are equivalent.
Are you saying that Gtk.show_uri won't invoke e.g. dolphin when given an obex location if gvfs is not installed, while kfmclient (invoked from xdg-open in KDE) will?
as far as i understand show_uri should envoke whichever application is specified as the default for obex:// or file:// etc protocols.. that could be anything, from dolphin to pcmanfm or it might throw some error if no application is assigned the that uri
https://developer.gnome.org/pygtk/stable/gtk-functions.html#function-gtk--show-uri
I take that back, i believe no error is thrown if there is no URI association..
@Teknocrat the function return a boolean so it is up to the application to handle it.
By all means use xdg-open and see it fail on gvfs when you run in MATE, xfce or lxde (gtk version).
Let me ask a question, what desktops are targeted here? Because if it is xfce or MATE then you are pretty much tied to gvfs anyway.
In my eyes Xfce (aka mine :wink:) and MATE (aka yours :wink:) are primary target desktops. Maybe LXDE could be added too. KDE and Gnome do have their own bluetooth managers and everything else is too exotic to target it explicitly.
I'll go for the Gtk implementation. If there's any case where xdg-open has a better behavior than Gtk.show_uri please present it. Of course I will still allow to set an explicit browse command which has precedence over the Gtk handling. BTW: are you two seeing the same issue when opening the transfer settings?
I'll build master and have a look if I see the same traceback.
For me it fails with not finding openobex which is not the same as what you are seeing. But I never have been able to get obex working here so this may be my inability to get my gentoo configured properly :wink:
edit: it is actually the same. :facepalm:
Traceback (most recent call last):
File "/usr/bin/blueman-services", line 161, in on_selection_changed
self.set_page(id)
File "/usr/bin/blueman-services", line 145, in set_page
inst.on_load(self.container)
File "/usr/lib64/python2.7/site-packages/blueman/plugins/services/Transfer.py", line 45, in on_load
self.setup_transfer()
File "/usr/lib64/python2.7/site-packages/blueman/plugins/services/Transfer.py", line 134, in setup_transfer
status = a.TransferStatus("opp")
File "/usr/lib64/python2.7/site-packages/dbus/proxies.py", line 70, in __call__
return self._proxy_method(*args, **keywords)
File "/usr/lib64/python2.7/site-packages/dbus/proxies.py", line 145, in __call__
**keywords)
File "/usr/lib64/python2.7/site-packages/dbus/connection.py", line 651, in call_blocking
message, timeout)
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.UnknownMethod: Method "IsStarted" with signature "" on interface "org.openobex.Server" doesn't exist
Debian #761286
We need to check if it's possible to set an arbitrary file browser command. It should be, but maybe it's broken.
We should also consider built-in support for more browsers than nautilus and thunar. Since MATE is one of the primary target desktops beside Xfce, caja support is very reasonable.