×

Discussion Board

Page 1 of 2 12 LastLast
Results 1 to 15 of 19
  1. #1
    Registered User
    Join Date
    Jan 2012
    Posts
    10

    Creating a declarative Settings Applet on Harmattan

    Hi,

    I am trying to develop my first application on N9. Reading the docs, I've found that the preferred way to store application settings is via gconf, and to expose them via a settings applet if these settings are user editable.

    I have found the examples on http://harmattan-dev.nokia.com/docs/...l_Applets.html

    So I have :
    - integrated the SettingsApplet class example in my QtCreator project
    - registered it for use from qml
    - created a .desktop file for my setting applet
    - created a .xml file for my setting applet
    - created the postinst and prerm scripts
    - created a qml menu entry to open my setting applet

    But :
    - I can't see my setting applet in the device's settings
    - if I run my application and click on the menu entry to launch the setting applet, I get a black screen (on first try), then nothing (the app remains, nothing seems to happen).

    What I have checked :
    - my .desktop and .xml files are deployed under /usr/share/duicontrolpanel/desktops and /usr/share/duicontrolpanel/uidescriptions respectively
    - when running from QtCreator, I get a debug statement from SettingsApplet class saying "Opening settings applet: JalonsSettings"

    but... I get a black screen. And no entry in the device settings... What is the way to track this down ? Thanks in advance.

  2. #2
    Registered User
    Join Date
    Sep 2011
    Posts
    449

    Re: Creating a declarative Settings Applet on Harmattan

    Hi,

    Seems to be aegis security issue. Please include the necessary aegis tokens incase you are including any apis that require the tokens.

    http://www.developer.nokia.com/Commu...ecurity_Tokens

  3. #3
    Registered User
    Join Date
    Jan 2012
    Posts
    10

    Re: Creating a declarative Settings Applet on Harmattan

    Thanks a lot for your input.
    I am using QDBusMessage and QDBusConnection, as well as QtDeclarative.
    In the project file I added qdbus for calling dbus to open the settings applet from qml.
    I must alos be using libuicontrolpanel, but in a declarative way... (http://harmattan-dev.nokia.com/docs/...cm9scGFuZWw%3D)

    Looking at the link you provide, I didn't find anythibg relevant to my usecase. But I admit this is far from clear to me :-)
    I also tried to modify qtc_packaging/debian_harmattan/manifest.aegis and uncomment <credential name="TrackerReadAccess" />, <credential name="TrackerWriteAccess" />, but then qtCreaator fails to deploy the app with :

    dpkg: status database area is locked by another process
    aegis-installing jalons (from '')

    If I comment again these lines, it will work, that is the app is installed on the device, and runs (but not the settings applet is not taken into account).

    Well... still a bit lost.

    Should I have anything in the logs if the problem comes from aegis ?

    Thanks,
    Franck

  4. #4
    Registered User
    Join Date
    Sep 2011
    Posts
    449

    Re: Creating a declarative Settings Applet on Harmattan

    Hi

    dpkg: status database area is locked by another process

    this error comes if application/package manager is running on device.

    If not the above, please reopen qtcreator once again and run the app.

    One more thing, you said you are using dbus, can i know which service you are trying to access using dbus. based on that you will have to include the respective aegis token

  5. #5
    Registered User
    Join Date
    Jan 2012
    Posts
    10

    Re: Creating a declarative Settings Applet on Harmattan

    Quote Originally Posted by kusumk View Post
    One more thing, you said you are using dbus, can i know which service you are trying to access using dbus.
    I use dbus, as explained in the SettingsApplet example code (from harmattan-dev.nokia.com), in this method (this is copy/paste from the example code) :

    void SettingsApplet:pen() {
    QDBusMessage message = QDBusMessage::createMethodCall("com.nokia.DuiControlPanel","/","com.nokia.DuiControlPanelIf","appletPage");
    QList<QVariant> args;
    args.append(QVariant(_name));
    message.setArguments(args);
    QDBusConnection bus = QDBusConnection::sessionBus();
    if (bus.isConnected()) { bus.send(message); }
    else { qDebug() << "Could not connect to dbus!"; }
    }

    This is exposed in my main via "qmlRegisterType<SettingsApplet>("MeeGoSettings", 1, 0, "SettingsApplet"); " and called in a qml menu entry with "onClicked: { settingsApplet.open() }".
    Then, I get a black page on first call, and nothing later.

    I have also included a jalons-settings.desktop file with :

    Type=ControlPanelApplet
    Name=JalonsSettings
    X-logical-id=decl_jalons_settings
    X-translation-catalog=duisettings
    Icon=

    # This has to be specified in order that the .desktop file can also be
    # used as an action (for example for search to know how to open the applet)
    X-Maemo-Service=com.nokia.DuiControlPanel
    X-Maemo-Method=com.nokia.DuiControlPanelIf.appletPage
    X-Maemo-Object-Path=/
    # this has to be the same as Name
    X-Maemo-Fixed-Args=JalonsSettings

    [DUI]
    X-DUIApplet-Applet=libdeclarative.so

    [DCP]
    Category=Applications
    Order=10
    Part=jalons-settings.xml
    WidgetType=Label

    and a jalons-settings.xml file with :

    <?xml version='1.0' encoding='UTF-8'?>
    <settings>
    <group title="Frequency">
    <integer key="/apps/Jalons/UpdateInterval" title="Update track every x seconds" min="5" max="300">
    </integer>
    </group>
    </settings>

    I was expecting this to add an entry in the device setings under Applications, independently of the application itself, at position 10, with a Label "JalonsSettings".

    Does it make sense ?

    Franck

  6. #6
    Registered User
    Join Date
    Sep 2011
    Posts
    449

    Re: Creating a declarative Settings Applet on Harmattan

    whatever i posted earlier about gconf seems irrelevant hence editing it. I shall check on this get back.

  7. #7
    Registered User
    Join Date
    Sep 2011
    Posts
    449

    Re: Creating a declarative Settings Applet on Harmattan

    XML file contents should be -


    <?xml version='1.0' encoding='UTF-8'?>
    <settings>
    <group title="Frequency">
    <integer key="/apps/ControlPanel/Jalons/UpdateInterval" title="Update track every x seconds" min="5" max="300">
    </integer>
    </group>
    </settings>

    ControlPanel in the above is the Settings application

    postinst file contents -

    #!/bin/sh
    /usr/bin/aegis-exec -s -u user /usr/bin/gconftool -s --type=int /apps/ControlPanel/Jalons/UpdateInterval 10
    exit 0

    preinst file -

    #!/bin/sh
    /usr/bin/aegis-exec -s -u user /usr/bin/gconftool --recursive-unset /apps/ControlPanel/Jalons
    exit 0

  8. #8
    Registered User
    Join Date
    Jan 2012
    Posts
    10

    Re: Creating a declarative Settings Applet on Harmattan

    This is what I tried first (as this is the gconf key given as example), but it does not work better. I tried it again, just to be sure, but with no success.
    Their must be another trick :-)

  9. #9
    Registered User
    Join Date
    Sep 2011
    Posts
    449

    Re: Creating a declarative Settings Applet on Harmattan

    Yes. Even i tried implementing an example. I face the same problem, No ui comes up, only a black screen. Can anybody help in this?

  10. #10
    Super Contributor
    Join Date
    Mar 2009
    Posts
    1,024

    Re: Creating a declarative Settings Applet on Harmattan

    Hi guys,
    Do you have anything to share that I can build and run on my device in order to help you?

  11. #11
    Registered User
    Join Date
    Jan 2012
    Posts
    10

    Re: Creating a declarative Settings Applet on Harmattan

    Well, I would happily send you my project (nothing confidential in it, I'm just learning a trying to create a simple GPL application).
    I compiles under QtSDK and deploys on my N9 without problem. And then the symptom is here.

    Can I send you a tar.gz ?

  12. #12
    Registered User
    Join Date
    Jan 2012
    Posts
    10

    Re: Creating a declarative Settings Applet on Harmattan

    I've just put a tar.bz2 of my project, with the "broken" declarative setting applet (and not much more) here http://ubuntuone.com/4UrJeWxoTejs4qQ19neCHc
    Would be great if you can have a look !

    Thanks
    Franck

  13. #13
    Registered User
    Join Date
    Jan 2012
    Posts
    10

    Re: Creating a declarative Settings Applet on Harmattan

    Bump... any try someone ?

  14. #14
    Super Contributor
    Join Date
    Mar 2009
    Posts
    1,024

    Re: Creating a declarative Settings Applet on Harmattan

    Hi,
    I think the problem is in the name. You should use only a single word for the name.

    Once the desktop file is in place you should be able to launch it with:
    dbus-send --session --print-reply --dest=com.nokia.DuiControlPanel / com.nokia.DuiControlPanelIf.appletPage string:SettingsExample

    Working example here: http://www.developer.nokia.com/Commu...ettingsapp.tgz
    Last edited by gnuton; 2012-01-25 at 15:31.

  15. #15
    Registered User
    Join Date
    Jan 2012
    Posts
    10

    Re: Creating a declarative Settings Applet on Harmattan

    Thansk gnuton !
    After carefully comparing the files, I finally found the problem : the [Desktop Entry] line was missing in my settings desktop file !
    My bad... and thanks to QtCreator 'split display' function :-)

    So, adding the right header did the trick.

    Thanks again for your time and support.

    Franck

Similar Threads

  1. Trouble getting declarative examples working with Harmattan
    By GuusDavidson in forum [Archived] Qt Quick
    Replies: 2
    Last Post: 2011-08-19, 16:07
  2. How to use Qt-declarative
    By BalajiR in forum Qt
    Replies: 1
    Last Post: 2010-02-17, 14:48
  3. Capability Declarative Statement
    By ahmdsd_ostora in forum Symbian Signed Support, Application Packaging and Distribution and Security
    Replies: 7
    Last Post: 2009-08-05, 04:55
  4. creating voip settings with DM
    By miikkis in forum Symbian
    Replies: 0
    Last Post: 2008-07-03, 11:47

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×