maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   [Announce] Shortcut Stash Home Screen Widget (https://talk.maemo.org/showthread.php?t=65137)

rooster13 2010-11-28 08:38

Re: [Announce] Shortcut Stash Home Screen Widget
 
Quote:

Originally Posted by xenomorph72 (Post 884840)
Voted!

awesome app

Thank you!

moepda 2010-11-28 08:50

Re: [Announce] Shortcut Stash Home Screen Widget
 
likewise big thumbs up from me !!! vote added :)

rooster13 2010-11-28 09:13

Re: [Announce] Shortcut Stash Home Screen Widget
 
Quote:

Originally Posted by moepda (Post 884845)
likewise big thumbs up from me !!! vote added :)

Thank you!

nicolai 2010-11-28 11:07

Re: [Announce] Shortcut Stash Home Screen Widget
 
Funny, you can use a dbus-call, for example:

dbus-send --print-reply --type=method_call --dest=com.nokia.osso_filemanager /com/nokia/osso_filemanager com.nokia.osso_filemanager.open_folder string:/home/user/MyDocs/FCamera

to open any folder, but you have to make sure, that the filemanager
is already open.

So, from commandline I can always open any
folder under MyDocs, if I make two calls

dbus-send --print-reply --type=method_call --dest=com.nokia.osso_filemanager /com/nokia/osso_filemanager com.nokia.osso_filemanager.open_folder string:/home/user/MyDocs/

and then for example:
dbus-send --print-reply --type=method_call --dest=com.nokia.osso_filemanager /com/nokia/osso_filemanager com.nokia.osso_filemanager.open_folder string:/home/user/MyDocs/FCamera

Can you try if this is working from maemostash as well,
I mean: making two dbus-calls.

nicolai

rooster13 2010-11-28 13:14

Re: [Announce] Shortcut Stash Home Screen Widget
 
Quote:

Originally Posted by nicolai (Post 884900)
Funny, you can use a dbus-call, for example:

dbus-send --print-reply --type=method_call --dest=com.nokia.osso_filemanager /com/nokia/osso_filemanager com.nokia.osso_filemanager.open_folder string:/home/user/MyDocs/FCamera

to open any folder, but you have to make sure, that the filemanager
is already open.

So, from commandline I can always open any
folder under MyDocs, if I make two calls

dbus-send --print-reply --type=method_call --dest=com.nokia.osso_filemanager /com/nokia/osso_filemanager com.nokia.osso_filemanager.open_folder string:/home/user/MyDocs/

and then for example:
dbus-send --print-reply --type=method_call --dest=com.nokia.osso_filemanager /com/nokia/osso_filemanager com.nokia.osso_filemanager.open_folder string:/home/user/MyDocs/FCamera

Can you try if this is working from maemostash as well,
I mean: making two dbus-calls.

nicolai

Excellent idea Nicolai. I will try changing the open folder method so that it first opens the FileManager and then opens the folder.

rooster13 2010-11-28 17:56

Re: [Announce] Shortcut Stash Home Screen Widget
 
I have released a new version of Shortcut Stash.
Version 0.1-6 is now available, and it is trying to fix the Filemanager open folder issue.

Please update and test it.

rooster13 2010-11-28 18:29

Re: [Announce] Shortcut Stash Home Screen Widget
 
Bugger!

Does not work every time :(.

I am calling the DBus, first open Filemanager and then goto to the desired directory like this:
Code:

QDBusInterface fileManagerd1("com.nokia.HildonDesktop.AppMgr",
                            "/com/nokia/HildonDesktop/AppMgr",
                            "com.nokia.HildonDesktop.AppMgr");
fileManagerd1.call("LaunchApplication", "/usr/bin/ossofilemanager");
QDBusInterface fileManagerd2("com.nokia.osso_filemanager",
                            "/com/nokia/osso_filemanager",
                            "com.nokia.osso_filemanager");
fileManagerd2.call("open_folder", item->data(Qt::UserRole).toString());

I was in the belief that the QDBusInterface.call would return only after it has finished, but that does not seem to be the case. Should I use some other type of call or try to make the main thread sleep for a while? I personnally don't like the sleep idea, but is there any other way?

d-iivil 2010-11-28 19:27

Re: [Announce] Shortcut Stash Home Screen Widget
 
Quote:

Originally Posted by rooster13 (Post 885134)
Bugger!

Does not work every time :(.

I am calling the DBus, first open Filemanager and then goto to the desired directory like this:
Code:

QDBusInterface fileManagerd1("com.nokia.HildonDesktop.AppMgr",
                            "/com/nokia/HildonDesktop/AppMgr",
                            "com.nokia.HildonDesktop.AppMgr");
fileManagerd1.call("LaunchApplication", "/usr/bin/ossofilemanager");
QDBusInterface fileManagerd2("com.nokia.osso_filemanager",
                            "/com/nokia/osso_filemanager",
                            "com.nokia.osso_filemanager");
fileManagerd2.call("open_folder", item->data(Qt::UserRole).toString());

I was in the belief that the QDBusInterface.call would return only after it has finished, but that does not seem to be the case. Should I use some other type of call or try to make the main thread sleep for a while? I personnally don't like the sleep idea, but is there any other way?

One way to do it would be call the dbus-message via QProcess and use waitForFinished -attribute.

edit:
Code:

QStringList arguments;
arguments << "run-standalone.sh dbus-send --type=method_call xxxx";
QProcess *process0 = new QProcess(this);
process0->start(arguments);
process0->waitForFinished();


rooster13 2010-11-28 19:40

Re: [Announce] Shortcut Stash Home Screen Widget
 
Quote:

Originally Posted by d-iivil (Post 885168)
One way to do it would be call the dbus-message via QProcess and use waitForFinished -attribute.

edit:
Code:

QStringList arguments;
arguments << "run-standalone.sh dbus-send --type=method_call xxxx";
QProcess *process0 = new QProcess(this);
process0->start(arguments);
process0->waitForFinished();


Kiitos d-iivil,

I will first try like this:
Code:

QDBusInterface fileManagerd("com.nokia.osso_filemanager",
                                        "/com/nokia/osso_filemanager",
                                        "com.nokia.osso_filemanager");
            QDBusReply<int> reply = fileManagerd.call("open_folder", "/home/user/MyDocs");
            if (reply.isValid())
            {
                fileManagerd.call("open_folder", item->data(Qt::UserRole).toString());
            }

If that does not work I'll try your way.
I guess the problem in my first try was that I was using two QDBusInterface objects instead of one.

rooster13 2010-11-28 21:57

Re: [Announce] Shortcut Stash Home Screen Widget
 
Quote:

Originally Posted by d-iivil (Post 885168)
One way to do it would be call the dbus-message via QProcess and use waitForFinished -attribute.

edit:
Code:

QStringList arguments;
arguments << "run-standalone.sh dbus-send --type=method_call xxxx";
QProcess *process0 = new QProcess(this);
process0->start(arguments);
process0->waitForFinished();


Hi d-iivil,

I tried your method like this:
Code:

QProcess *proc = new QProcess(this);
proc->start("run-standalone.sh dbus-send --type=method_call --dest=com.nokia.osso_filemanager /com/nokia/osso_filemanager com.nokia.osso_filemanager.open_folder string:/home/user/MyDocs");
proc->waitForFinished();
QDBusInterface fileManagerd("com.nokia.osso_filemanager",
                            "/com/nokia/osso_filemanager",
                            "com.nokia.osso_filemanager");
fileManagerd.call("open_folder", item->data(Qt::UserRole).toString());

But still the same result first time it does not work and most of the time the second time it works.


All times are GMT. The time now is 06:40.

vBulletin® Version 3.8.8