![]() |
Application Instance
Dear All,
I want to limit my application to one instance so if the user try to launch the application and it is already running in process it brings the process UI to front Regards Wael |
Re: Application Instance
You can register a D-Bus name for your application and terminate it if that name is already taken.
I'm not sure if the background running instance will pop to front or if you have to add few lines to handle sending and receiving dbus messages to tell that other instance to pop up. Or maybe there's some other nifty way to do app up popping. |
Re: Application Instance
My application has a single-app instance logic in it. The source is browsable from the link in my sig.
I have made it the way it is so that it works without dbus dependencies, because I need it to work in Windows as well. |
Re: Application Instance
Quote:
|
Re: Application Instance
In Qt you would need to do something like this to make sure the window is visible/active.
Code:
pMainWindow->show(); |
Re: Application Instance
Quote:
http://qt.nokia.com/products/appdev/add-on-products/catalog/4/Utilities/qtsingleapplication/ p.s. I haven't tested myself... I use DBus on my application to check for other instances. |
Re: Application Instance
In hildon, you register a dbus service for your application and list its name in the desktop file. The file manager/panel will use dbus activation to notify your program of the file names etc, so your application will only be running once.
http://wiki.maemo.org/Documentation/...mo_application |
Re: Application Instance
Quote:
but if application run on startup it is running and when i click it from desktop it runs again in different process i don't know why |
Re: Application Instance
May be the problem in my startup script
i use run-standalone to launch application at startup |
Re: Application Instance
Quote:
http://code.google.com/p/qgvdial PS: I think my sig isn't shown if I post in minimalist dark theme. |
All times are GMT. The time now is 01:54. |
vBulletin® Version 3.8.8