[Gambas-user] Single instance application, anyone else done it?

Benoît Minisini g4mba5 at gmail.com
Thu Jul 8 16:37:46 CEST 2021


Le 08/07/2021 à 15:56, Bruce Steers a écrit :
> 
> Nope it does not work using DBus.Session.Applications.Exist() , it works 
> if one app is ready loaded but launching 2 apps together fails to 
> connect for the second but Applications[] is not yet updated.
> 
> seems all i can do is test error.Text ends with "already registered" (im 
> not sure if gambas translates that msg)
> 
> Another option on a gambas level is to edit the DBus.class gb.dbus and 
> add a boolean property "ApplicationExists" that gets set to true if the 
> connection fails due to already existing interface during  
> _RegisterApplication()
> 
> Or if Error.Code could be something other than -1 if connection exists?
> 
> then i can tell if error was because connection exists or something else.
> 
> BruceS
> 

Error messages are never translated (otherwise it's a bug).

But of course this is a temporary workaround, and a solution like you 
suggest must be implemented.

Regards,

-- 
Benoît Minisini


More information about the User mailing list