Add Yes / No to Error Message

This commit is contained in:
Tim Bentley 2011-03-26 19:34:01 +00:00
parent afaf10f986
commit dce9a73153
2 changed files with 8 additions and 4 deletions

View File

@ -133,10 +133,13 @@ class OpenLP(QtGui.QApplication):
def isAlreadyRunning(self):
self.sharedMemory = QtCore.QSharedMemory('OpenLP')
if self.sharedMemory.attach():
QtGui.QMessageBox.critical(None,
status = QtGui.QMessageBox.critical(None,
UiStrings.Error, UiStrings.OpenLPStart,
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok))
return True
QtGui.QMessageBox.StandardButtons(
QtGui.QMessageBox.Yes | QtGui.QMessageBox.No))
if status == QtGui.QMessageBox.No:
return True
return False
else:
self.sharedMemory.create(1)
return False

View File

@ -76,7 +76,8 @@ class UiStrings(object):
NISp = translate('OpenLP.Ui', 'No Items Selected', 'Plural')
OLPV1 = translate('OpenLP.Ui', 'openlp.org 1.x')
OLPV2 = translate('OpenLP.Ui', 'OpenLP 2.0')
OpenLPStart = translate('OpenLP.Ui', 'OpenLP is already running')
OpenLPStart = translate('OpenLP.Ui', 'OpenLP is already running. Do you '
'wish continue.')
OpenService = translate('OpenLP.Ui', 'Open Service')
Preview = translate('OpenLP.Ui', 'Preview')
PreviewPanel = translate('OpenLP.Ui', 'Preview Panel')