[Anton Shmigirilov] Confirmation dialog,
instead of Error dialog for pid file
This commit is contained in:
parent
514f94c2b2
commit
0b0e32ca32
17
src/gajim.py
17
src/gajim.py
|
@ -144,18 +144,15 @@ if profile:
|
||||||
pid_filename += '.%s' % profile
|
pid_filename += '.%s' % profile
|
||||||
|
|
||||||
pid_filename += '.pid'
|
pid_filename += '.pid'
|
||||||
|
import dialogs
|
||||||
if os.path.exists(pid_filename):
|
if os.path.exists(pid_filename):
|
||||||
pritext = _('Gajim is already running')
|
pritext = _('Gajim is already running')
|
||||||
sectext = _('Exit the already running Gajim, or delete pid file:\n "%s".\n Quiting...' % pid_filename)
|
sectext = _('Another instance of Gajim seems to be running\nRun anyway?')
|
||||||
dlg = gtk.MessageDialog(None,
|
dialog = dialogs.YesNoDialog(pritext, sectext)
|
||||||
gtk.DIALOG_DESTROY_WITH_PARENT | gtk.DIALOG_MODAL,
|
if dialog.get_response() != gtk.RESPONSE_YES:
|
||||||
gtk.MESSAGE_ERROR, gtk.BUTTONS_OK, message_format = pritext)
|
sys.exit(3)
|
||||||
|
os.remove(pid_filename)
|
||||||
dlg.format_secondary_text(sectext)
|
dialog.destroy()
|
||||||
dlg.run()
|
|
||||||
dlg.destroy()
|
|
||||||
sys.exit(3)
|
|
||||||
|
|
||||||
# Create pif file
|
# Create pif file
|
||||||
f = open(pid_filename, 'a')
|
f = open(pid_filename, 'a')
|
||||||
|
|
Loading…
Reference in New Issue