I've used QLocalSockets for this:

self._id = "yourIDkey"
self._outSocket = QtNetwork.QLocalSocket()
        self._outSocket.
connectToServer(self._id)
        self._isRunning = self._outSocket.waitForConnected()
        # No running server, that means that the notification dialog
is not being shown by another instance.
        if not self._isRunning:
            self._outSocket = None
            QtNetwork.QLocalServer.removeServer(self._id)
            self._server = QtNetwork.QLocalServer()
            self._server.listen(self._id)


On Wed, Oct 23, 2013 at 5:40 PM, Frank Rueter <fr...@beingfrank.info> wrote:
> Hi all,
>
>
> has anybody had success with enforcing only one instance of a PySide widget
> when it's registered as a panel?
>
> My app writes data to disk upon certain events and loads that data again
> through the widget's constructor. So I need to make sure that only one
> instance is open at any given time, otherwise I'm running the risk of
> losing/corrupting that data.
>
> Any ideas?
>
> Cheers,
> frank
> _______________________________________________
> Nuke-python mailing list
> Nuke-python@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/
> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python



-- 
Jose Fernandez de Castro
_______________________________________________
Nuke-python mailing list
Nuke-python@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python

Reply via email to