×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Oct 2011
    Posts
    33

    Show/hide (start/stop) application via DBus (Harmattan)

    Hello!
    I bumped into a problem launching native Nokia Gallery (N950/N9 phone) via DBus.
    I used such code:
    Code:
    QProcess::execute("/usr/bin/dbus-send --type=method_call --dest=com.nokia.Gallery /com/nokia/Gallery com.nokia.Gallery.LaunchApplication");
    It works fine on the first run. But if Gallery is already running nothing is happening. I expected that Gallery will come to top and my application will minimize.

    I tried to use trick from N900 (Maemo5), I called top_application instead LaunchApplication, but attempt is failed, behavior isn't changed...

    Question: how to move Nokia Gallery to top from my application if Gallery is already running?
    Last edited by Habolog; 2011-11-07 at 13:06.

  2. #2
    Nokia Developer Moderator
    Join Date
    Mar 2009
    Posts
    1,024

    Re: Show/hide (start/stop) application via DBus (Harmattan)

    Why don't you use Qt.openUrlExternally(file.jpg) [FOR QML] or QDesktopServices::setUrlHandler (..) [FOR C++] instead of using QProcess+DBus.
    You solution looks quite weird to me.

  3. #3
    Registered User
    Join Date
    Oct 2011
    Posts
    33

    Re: Show/hide (start/stop) application via DBus (Harmattan)

    My goal isn't to open some file but just to run Gallery application. For that reason I use DBus instead QDesktopServices.
    Or QDesktopServices may run executable files? I tried to use it like this:
    Code:
    QDesktopServices::openUrl(QUrl("/usr/bin/gallery"));
    and like this too:
    Code:
    QDesktopServices::openUrl(QUrl("file://usr/bin/gallery"));
    But both attempts ended with debug message:
    no default action for the given PARAMS
    Last edited by Habolog; 2011-11-08 at 02:48.

  4. #4
    Nokia Developer Champion
    Join Date
    Oct 2007
    Location
    જુનાગઢ - India
    Posts
    3,034

    Re: Show/hide (start/stop) application via DBus (Harmattan)

    QProcess::start() may do your job.

  5. #5
    Registered User
    Join Date
    Oct 2011
    Posts
    33

    Re: Show/hide (start/stop) application via DBus (Harmattan)

    Quote Originally Posted by savaj View Post
    QProcess::start() may do your job.
    It works not exactly as I need. To open already open gallery I have to close process and start it again - it's not fast operation.
    Code:
    if(process.isOpen())
                process.close();
            process.start("/usr/bin/gallery");
    Maybe there exist more flexible solution?

    Anyway, thanks for your hint!

  6. #6
    Registered User
    Join Date
    Mar 2012
    Posts
    1

    Re: Show/hide (start/stop) application via DBus (Harmattan)

    Quote Originally Posted by Habolog View Post
    Hello!
    I bumped into a problem launching native Nokia Gallery (N950/N9 phone) via DBus.
    I used such code:
    Code:
    QProcess::execute("/usr/bin/dbus-send --type=method_call --dest=com.nokia.Gallery /com/nokia/Gallery com.nokia.Gallery.LaunchApplication");
    It works fine on the first run. But if Gallery is already running nothing is happening. I expected that Gallery will come to top and my application will minimize.

    Question: how to move Nokia Gallery to top from my application if Gallery is already running?
    I faced the same problem and solved it using libcontentaction. I wrote a blog post about how I solved it.

Similar Threads

  1. Stop or hide default USSD application
    By zoran_zlatanov in forum Symbian Networking & Messaging (Closed)
    Replies: 4
    Last Post: 2008-12-24, 15:34
  2. start or stop application on mobile device
    By rbs in forum Symbian Tools & SDKs
    Replies: 1
    Last Post: 2007-01-01, 08:07
  3. hide/show application (open by keypress)
    By ZeeMoo in forum Symbian C++
    Replies: 3
    Last Post: 2006-05-13, 05:24
  4. hide/show application icon dynamically
    By diablos_2003 in forum Symbian C++
    Replies: 0
    Last Post: 2006-03-21, 16:30
  5. Application start/stop notification
    By ca_localhero in forum Symbian C++
    Replies: 0
    Last Post: 2004-04-05, 15:42

Posting Permissions

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