Reply
Thread Tools
Posts: 64 | Thanked: 13 times | Joined on Apr 2010
#1
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
 
Posts: 61 | Thanked: 43 times | Joined on Aug 2008
#2
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.
 
Posts: 1,048 | Thanked: 979 times | Joined on Mar 2008 @ SF Bay Area
#3
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.
 

The Following User Says Thank You to uvatbc For This Useful Post:
Switch_'s Avatar
Posts: 601 | Thanked: 549 times | Joined on Mar 2010 @ Redditch, UK
#4
Originally Posted by uvatbc View Post
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.
Thanks but you have no sig..... Link...?
 
fcrochik's Avatar
Posts: 722 | Thanked: 1,223 times | Joined on Apr 2010 @ USA
#5
In Qt you would need to do something like this to make sure the window is visible/active.

Code:
    pMainWindow->show();
    pMainWindow->activateWindow();
    pMainWindow->raise();
__________________

My maemo work:
------------------------------------------------------------------------------------------------------------------------------------------------------------------------
For Harmattan:
GeePS - native UI around google maps - GApp - access to optimized mobile "google apps".
Shutdown - shutdown and reboot with one click - QuickCall - one click call, skypeout and google voice integration using dial tones.
WakeOnLan - wake computers on your local network.
------------------------------------------------------------------------------------------------------------------------------------------------------------------------
For Maemo/N900:
GApp - access to optimized mobile "google apps". - MobWebMail: browser optimized to access multiple gmail accounts
MyContacts: 75 Contacts on your desktop, ring tones per group and more - GeePS: native front-end for google maps
Macuco2 : web browser to access web sites optimized for the iphone - WakeOnLan: wake up computers on your local network
dbBrowser: Simple application to browse sqlite databases
 
fcrochik's Avatar
Posts: 722 | Thanked: 1,223 times | Joined on Apr 2010 @ USA
#6
Originally Posted by Switch_ View Post
Thanks but you have no sig..... Link...?
This may be helpful:
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.
__________________

My maemo work:
------------------------------------------------------------------------------------------------------------------------------------------------------------------------
For Harmattan:
GeePS - native UI around google maps - GApp - access to optimized mobile "google apps".
Shutdown - shutdown and reboot with one click - QuickCall - one click call, skypeout and google voice integration using dial tones.
WakeOnLan - wake computers on your local network.
------------------------------------------------------------------------------------------------------------------------------------------------------------------------
For Maemo/N900:
GApp - access to optimized mobile "google apps". - MobWebMail: browser optimized to access multiple gmail accounts
MyContacts: 75 Contacts on your desktop, ring tones per group and more - GeePS: native front-end for google maps
Macuco2 : web browser to access web sites optimized for the iphone - WakeOnLan: wake up computers on your local network
dbBrowser: Simple application to browse sqlite databases
 
Posts: 56 | Thanked: 31 times | Joined on Jul 2008 @ Austria
#7
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
 
Posts: 64 | Thanked: 13 times | Joined on Apr 2010
#8
Originally Posted by dannym View Post
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
Thanks, this works
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

Last edited by waelfarouk0; 2010-07-13 at 08:22.
 
Posts: 64 | Thanked: 13 times | Joined on Apr 2010
#9
May be the problem in my startup script
i use run-standalone to launch application at startup
 
Posts: 1,048 | Thanked: 979 times | Joined on Mar 2008 @ SF Bay Area
#10
Originally Posted by Switch_ View Post
Thanks but you have no sig..... Link...?
argh where did it go?
http://code.google.com/p/qgvdial

PS: I think my sig isn't shown if I post in minimalist dark theme.
__________________
qgvdial: Google Voice client. All downloads
qgvtp: Phone integration for the n900 that dials out and sends texts using qgvdial.
mosquitto: message broker that implements the MQ Telemetry Transport protocol version 3.
qgvnotify: Google voice and contacts notifier for diablo and maemo.

If you want to thank me, click the Thanks button.
If you'd like to thank my applications, vote to move them to extras.
 
Reply


 
Forum Jump


All times are GMT. The time now is 02:26.