![]() |
Python / GTK / Hildon: start application / bring to foreground if running
Hi Developers!
I don't know if this is possible at maemo, at all. But perhaps someone has a solution for this: I want to check in a small python application if a other application is already running. If it is currently running I would like to bring it to the foreground. If it isn't running I would like to start this application. Has anybody a Idea? Does Hildon provide this thru the API?! :confused: |
Re: Python / GTK / Hildon: start application / bring to foreground if running
'lo there,
Are both the programs to be run yours? If so, you can make use of D-Bus. If you have control over both programs, you can make this much easier for yourself by only pretty much involving D-Bus; when I "wrote" a Media Player widget for Diablo, I had to use a mix of D-Bus and X stuff because the Diablo media player didn't implement its top_application method properly |
Re: Python / GTK / Hildon: start application / bring to foreground if running
Quote:
|
Re: Python / GTK / Hildon: start application / bring to foreground if running
What i am going to write can be so much dumb, but it looks like a n00b solution to me. When you start an app, say click an icon, and then go to dashboard and to the desktop and again click the icon it just brings back your opened window. So (i suppose) if you would like a your Py App to open another app, he would open a window(if it is already open) or open it from the start... Please correct me if i am wrong...
|
Re: Python / GTK / Hildon: start application / bring to foreground if running
Code:
run-standalone.sh dbus-send --type=method_call --dest=com.nokia.HildonDesktop.AppMgr /com/nokia/HildonDesktop/AppMgr com.nokia.HildonDesktop.AppMgr.LaunchApplication string:conky |
Re: Python / GTK / Hildon: start application / bring to foreground if running
Quote:
Sadly, if I do it using the command os.system("conky") it starts every time a new instance of conky. :( |
Re: Python / GTK / Hildon: start application / bring to foreground if running
Quote:
This code works. Thanks a lot! :) Sadly, if it is currently the application in the foreground I see the "flip window" animation. Am I able to check what application is currently on top? But it is a great step in the right direction. Exactly what i searched for. :) |
Re: Python / GTK / Hildon: start application / bring to foreground if running
Quote:
I'd be personally interested to know if there's a simpler way |
Re: Python / GTK / Hildon: start application / bring to foreground if running
Quote:
It would end with some wasted time. :( I'm trying to develop a application and if it works as I imagine myself at the moment I like to upload it to extra-devel and push it to extra-testing as soon as it works without errors. But depending on this package this would never happen. So it couldn't be a solution for normal applications. Or am I wrong? As you already stated, there should be a simpler way... :confused: |
Re: Python / GTK / Hildon: start application / bring to foreground if running
Quote:
Code:
#!/usr/bin/env python |
| All times are GMT. The time now is 08:35. |
vBulletin® Version 3.8.8