We have moved to a new Sailfish OS Forum. Please start new discussions there.
4

Looking for documentation on how to add settings page to applications

asked 2017-06-09 11:45:24 +0200

I have just came across a problem which would required the adding of a settings page to an application (which is accessible through Settings -> Apps -> App icon).

Is there any documentation on this area?

edit retag flag offensive close delete

Comments

1

Good question, but I'm not sure we will find documentation for it. However, why not just look at the device, pick a setting and have a look in /usr/share/jolla-settings/entries - these are .json entries, showing how they are laid out, easy enough (even for me!), but how to connect your new switch/setting with your app, this is the bit I am struggling with.

Spam Hunter ( 2017-06-09 12:03:16 +0200 )edit

Thanks! Meanwhile I have found them, and got rolling what I wanted. But again it would be nice if there would be any docs in the wiki with guidelines and so on. Is the Sailfish wiki user contributable?

My best answer on how connect the app with the settings is the Dconf.

martonmiklos ( 2017-06-09 12:06:58 +0200 )edit

It would be nice to have a straightforward guide how to create the rpm to install an app settingspage on the device. Patches on openrepos that create settings are not available on harbour. Is it because it is not allowed?

rgrnetalk ( 2017-06-09 12:13:30 +0200 )edit

@rgnetalk Yes it is forbidden: https://harbour.jolla.com/faq

RPM-Packaging In which locations can I install files? You are allowed to install: /usr/bin/<harbour_app_name> <- the executable binary /usr/share/applications/<harbour_app_name>.desktop <- the desktop file /usr/share/icons/hicolor/<size>/apps/<harbour_app_name>.png <- the icon files /usr/share/<harbour_app_name>/</harbour_app_name></harbour_app_name></size></harbour_app_name></harbour_app_name> <- anything else (data files, private shared libraries, private QML imports, etc..) goes here*

@Alex I would be curious about the security flaws. I think it could be secured with restrictions: - Limit the uploading of /usr/share/jolla-settings/entries/<harbour_app_name>.json - Check the contents to not to be able to mimic other apps settings icon</harbour_app_name>

martonmiklos ( 2017-06-09 12:24:53 +0200 )edit

@martonmiklos I added the link to the pull request in my answer - have a look at the comments there. :)

Alex ( 2017-06-09 12:43:36 +0200 )edit

1 Answer

Sort by » oldest newest most voted
7

answered 2017-06-09 12:16:42 +0200

Alex gravatar image

updated 2017-06-09 12:25:15 +0200

At the moment it is officially not allowed to add app settings into the native settings app (at least you won't be able to publish your app to Jolla store afaik) for third party app developers because it seems to be a security issue since it got priveleged execution rights. A Jolla employee once tried to add this feature but afaik it was rejected because of possible security flaws (corresponding pull request: https://github.com/sailfish-sdk/sdk-harbour-rpmvalidator/pull/79).

If you want to know how to add this feature to your app anyway, just have a look at the code of this openrepos apps.

edit flag offensive delete publish link more

Comments

4

Thanks, let's complaining on that PR....

martonmiklos ( 2017-06-09 12:46:45 +0200 )edit
Login/Signup to Answer

Question tools

Follow
4 followers

Stats

Asked: 2017-06-09 11:45:24 +0200

Seen: 348 times

Last updated: Jun 09 '17