hsarkanen / JollaOpas

Jolla Opas
GNU General Public License v3.0
4 stars 4 forks source link

Add possibility to set from and to addresses from other programs #28

Open hsjpekka opened 4 years ago

hsjpekka commented 4 years ago

I'm working with a calendar patch that lauches web browser to show the calendar event location. It would be nice to be able to launch jollaopas and copy the location to the destination field. Perhaps something like Qt.openUrlExternally("reittiopas://from=address1&to=address2") could be used, like in https://unix.stackexchange.com/questions/497146/create-a-custom-url-protocol-handler. Or does jollaOpas already have something like this? ConfigurationValue-component perhaps?

hsjpekka commented 4 years ago

I wrote some code to enable this. If you are interested, I can send a patch-file, or add a branch. But for latter I need write access. I added a function to read an url given as a command line argument that extracts to- and from-parameters. And added DBusInterface to listen to destinationPointChanged-signal. And there is Show calendar event location -patch, that uses these methods. Currently Sailfish does not seem to have a d-bus service for sharing addresses, only coordinates.

hsarkanen commented 4 years ago

Ok, great, I can test, review and merge it! I would prefer more common Github workflow that you fork this repository under your account and then create pull request to this repository from your fork. You can use this as an example. That way we don’t need to share write access to any repository or send patch files.

hsjpekka commented 3 years ago

Added a pull request for command line arguments.

The problem with command line arguments is that it works only if JollaOpas is not running already.

D-bus would work with running JollaOpas, but I don't know what service to use. In the JollaOpas, it would require only few lines in addition to the ones in the pull request.

I made a patch to calendar event view page, that added sailfish DBusAdaptor-component and my.location.service-dbus. But that works only if the calendar event view is opened before JollaOpas is started. Otherwise JollaOpas can't find the dbus-service and misses the signals. Thus, some system bus or session bus that is started when a user logs in should be used.

If I have understood correctly org.freedesktop.Geoclue contains coordinates, velocities etc. but not address-field.