ivoflipse / Pawlabeling

Tool for processing and analyzing pressure measurements
Other
18 stars 1 forks source link

Prevent multiple instances of the application #30

Closed ivoflipse closed 11 years ago

ivoflipse commented 11 years ago

As soon as there are multiple instances of the application, the log will no longer make sense and it would be recommendable to close older versions. If someone has a good argument against it, I might consider not blocking it

ivoflipse commented 11 years ago

I found this recipe: https://gitorious.org/qsingleapplication/qsingleapplication/blobs/master/qSingleApplication.py from here http://www.dallagnese.fr/en/computers-it/recette-python-qt4-qsingleapplication-pyside/

Which basically lets the app create a local server, then if the app fails to connect with that server, that means its the first instance.

However, it still somewhat messes up the log, but at least it'll block you from doing any more than that

ivoflipse commented 11 years ago

I've decided to put it on hold for now, because it feels like its more annoying the user than actually being useful. Worst case, I could check the log and see if the last line contains Application Shutdown

ivoflipse commented 11 years ago

I found a better version, that's based on the C++ Qt version: http://stackoverflow.com/questions/12712360/qtsingleapplication-for-pyside-or-pyqt This hooks in before the window or anything else is created and is a lot more natural.