check if pid file is already removed

This commit is contained in:
Dimitur Kirov 2006-06-15 09:43:08 +00:00
parent a4b4323e38
commit fff37fe869

View file

@ -145,11 +145,15 @@ if profile:
pid_filename += '.pid' pid_filename += '.pid'
import dialogs import dialogs
if os.path.exists(pid_filename): if os.path.exists(pid_filename):
path_to_file = os.path.join(gajim.DATA_DIR, 'pixmaps/gajim.png')
pix = gtk.gdk.pixbuf_new_from_file(path_to_file)
gtk.window_set_default_icon(pix) # set the icon to all newly opened wind
pritext = _('Gajim is already running') pritext = _('Gajim is already running')
sectext = _('Another instance of Gajim seems to be running\nRun anyway?') sectext = _('Another instance of Gajim seems to be running\nRun anyway?')
dialog = dialogs.YesNoDialog(pritext, sectext) dialog = dialogs.YesNoDialog(pritext, sectext)
if dialog.get_response() != gtk.RESPONSE_YES: if dialog.get_response() != gtk.RESPONSE_YES:
sys.exit(3) sys.exit(3)
if os.path.exists(pid_filename):
os.remove(pid_filename) os.remove(pid_filename)
dialog.destroy() dialog.destroy()
@ -169,7 +173,6 @@ parser = optparser.OptionsParser(config_filename)
import roster_window import roster_window
import systray import systray
import dialogs
import vcard import vcard
import config import config