maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   SailfishOS (https://talk.maemo.org/forumdisplay.php?f=52)
-   -   Quickactions now called Shortcuts (https://talk.maemo.org/showthread.php?t=100529)

Markkyboy 2018-11-03 10:53

Quickactions now called Shortcuts
 
Hello all,

Some of the original quickactions required an argument to determine which part of the software you were wanting to access. The files were .conf files but are now .json files, the data is almost the same but the syntax is a little different.

I've lost count of the numerous ways I've tried to add my data, but clearly I'm doing something wrong, as my 'shortcut' to "Create a contact" only opens the app but not on the page where we add our new contact.....so what data/code is required?

Here is my original data when we were using quickactions; (note: arguments required)

Code:

   
    priority=0
    icon=icon-m-file-vcard
    title=contacts-me-add_contact
    translation-catalog=contacts
    remote-service="com.jolla.contacts.ui"
    remote-path="/com/jolla/contacts/ui"
    remote-interface="com.jolla.contacts.ui"
    remote-method="createContact"
    remote-arguments/size=1
    remote-arguments/1/argument="createContact"

And here is the data for the new 'Top menu shortcuts', the last 2 lines are the problem I believe;

Code:

{
    "translation_catalog": "lipstick-jolla-home",
    "entries": [
        {
            "path": "system_settings/look_and_feel/topmenu/actions/add_a_contact",
            "title": "Create a contact",
            "translation_id": "settings_quickaction-la-add_a_contact",
            "title_short": "Contact",
            "translation_id_short": "settings_quickaction-la-add_a_contact",
            "type": "action",
            "icon": "image://theme/icon-m-file-vcard",
            "order": 55,
            "params": {
                "type": "grid",
                "remote-service": "com.jolla.contacts.ui",
                "remote-path": "/com/jolla/contacts/ui",
                "remote-interface": "com.jolla.contacts.ui",
                "remote-method": "createContact",

                "remote-arguments/size": 1,
                "remote-arguments/1/argument": "createContact"
            }
        }
    ]

I have tried many different variations to make this work, too many to list. Does anyone have any idea of the code required to make this work?, currently, it opens the app but not on the required page; 'add a contact'

Thanks,

fooxl 2018-11-06 17:05

Re: Quickactions now called Shortcuts
 
Where are the config files for shortcuts located?

Edit: ok, just found them. For example
Code:

/usr/share/jolla-settings/entries/com.jolla.notes.json
is the shortcut for creating new note.

fooxl 2018-11-06 22:40

Re: Quickactions now called Shortcuts
 
If you take a look at
Code:

/usr/share/jolla-settings/entries/com.jolla.internet.json
it uses
Code:

...
"remote-arguments": ["wifi"]
...

so maybe

Code:

            "params": {
                "type": "grid",
                "remote-service": "com.jolla.contacts.ui",
                "remote-path": "/com/jolla/contacts/ui",
                "remote-interface": "com.jolla.contacts.ui",
                "remote-method": "createContact",
                "remote-arguments": ["createContact"]
            }

works for you

rasmarc 2019-01-29 12:57

Re: Quickactions now called Shortcuts
 
Fiddling with
Code:

            "params": {
                "type": "grid",
                "requires-package": "jolla-contacts",
                "remote-service": "com.jolla.contacts.ui",
                "remote-path": "/",
                "remote-interface": "com.jolla.contacts.ui",
                "remote-method": "createContact"
            }

I found out when using a non-existent "remote-method" in one of the other shortcut entries

com.jolla.notes.json
com.jolla.clock.json
com.jolla.camera.json

the apps won't launch at all. But doing this in

com.jolla.contacts.json

the people app will always launch with its start screen.

So maybe there's something broken and the remote-method is not recognized by the people app.

rasmarc 2019-01-29 15:35

Re: Quickactions now called Shortcuts
 
Some progress:
Code:

dbus-send --type=method_call --dest=com.jolla.contacts.ui /com/jolla/contacts/ui com.jolla.contacts.ui.createContact string:""
This shows the "add contact" page when the people app is already open.

rasmarc 2019-01-29 15:54

Re: Quickactions now called Shortcuts
 
Yippie!

Code:

{
    "translation_catalog": "lipstick-jolla-home",
    "entries": [
        {
            "path": "system_settings/look_and_feel/topmenu/actions/add_a_contact",
            "title": "Create a contact",
            "translation_id": "settings_quickaction-la-add_a_contact",
            "title_short": "Contact",
            "translation_id_short": "settings_quickaction-la-add_a_contact_short",
            "type": "action",
            "icon": "image://theme/icon-m-file-vcard",
            "order": 58,
            "params": {
                "type": "grid",
                "requires-package": "jolla-contacts",
                "remote-service": "com.jolla.contacts.ui",
                "remote-path": "/com/jolla/contacts/ui",
                "remote-interface": "com.jolla.contacts.ui",
                "remote-method": "createContact",
                "remote-arguments": ["string:''"]
            }
        }
    ]
}


But I prefer a different icon: icon-m-people

Markkyboy 2019-01-29 15:54

Re: Quickactions now called Shortcuts
 
Quote:

Originally Posted by fooxl (Post 1550164)
If you take a look at
Code:

/usr/share/jolla-settings/entries/com.jolla.internet.json
it uses
Code:

...
"remote-arguments": ["wifi"]
...

so maybe

Code:

            "params": {
                "type": "grid",
                "remote-service": "com.jolla.contacts.ui",
                "remote-path": "/com/jolla/contacts/ui",
                "remote-interface": "com.jolla.contacts.ui",
                "remote-method": "createContact",
                "remote-arguments": ["createContact"]
            }

works for you

Thanks @fooxl - you're final code is correct and is indeed working. It seems I managed to work it out anyway, but had forgotten that I had actually posted asking for help.

Thanks @rasmarc for your efforts :)

Regards

rasmarc 2019-01-29 16:04

Re: Quickactions now called Shortcuts
 
Ha, the solution was already there :o

But note that the remote-argument can be anything, even "".
Code:

            "params": {
                "type": "grid",
                "requires-package": "jolla-contacts",
                "remote-service": "com.jolla.contacts.ui",
                "remote-path": "/com/jolla/contacts/ui",
                "remote-interface": "com.jolla.contacts.ui",
                "remote-method": "createContact",
                "remote-arguments": [""]
            }


rasmarc 2019-02-08 16:50

Re: Quickactions now called Shortcuts
 
Markkyboy, will you upload the patch again?


All times are GMT. The time now is 11:41.

vBulletin® Version 3.8.8