[change] removed redundant propmpt because new picks have to be accepted in the first place when closing PickDlg
This commit is contained in:
parent
7257d43155
commit
aea77cd49c
47
QtPyLoT.py
47
QtPyLoT.py
@ -1626,30 +1626,33 @@ class MainWindow(QMainWindow):
|
|||||||
self.thread.quit()
|
self.thread.quit()
|
||||||
|
|
||||||
def addPicks(self, station, picks, type='manual'):
|
def addPicks(self, station, picks, type='manual'):
|
||||||
stat_picks = self.getPicksOnStation(station, type)
|
# stat_picks = self.getPicksOnStation(station, type)
|
||||||
rval = False
|
# rval = False
|
||||||
if not stat_picks:
|
# if not stat_picks:
|
||||||
stat_picks = picks
|
# stat_picks = picks
|
||||||
else:
|
# else:
|
||||||
msgBox = QMessageBox(self)
|
# msgBox = QMessageBox(self)
|
||||||
msgBox.setText("The picks for station {0} have been "
|
# msgBox.setText("The picks for station {0} have been "
|
||||||
"changed.".format(station))
|
# "changed.".format(station))
|
||||||
msgBox.setDetailedText("Old picks:\n"
|
# msgBox.setDetailedText("Old picks:\n"
|
||||||
"{old_picks}\n\n"
|
# "{old_picks}\n\n"
|
||||||
"New picks:\n"
|
# "New picks:\n"
|
||||||
"{new_picks}".format(old_picks=stat_picks,
|
# "{new_picks}".format(old_picks=stat_picks,
|
||||||
new_picks=picks))
|
# new_picks=picks))
|
||||||
msgBox.setInformativeText("Do you want to save your changes?")
|
# msgBox.setInformativeText("Do you want to save your changes?")
|
||||||
msgBox.setStandardButtons(QMessageBox.Save | QMessageBox.Cancel)
|
# msgBox.setStandardButtons(QMessageBox.Save | QMessageBox.Cancel)
|
||||||
msgBox.setDefaultButton(QMessageBox.Save)
|
# msgBox.setDefaultButton(QMessageBox.Save)
|
||||||
ret = msgBox.exec_()
|
# ret = msgBox.exec_()
|
||||||
if ret == QMessageBox.Save:
|
# if ret == QMessageBox.Save:
|
||||||
|
# stat_picks = picks
|
||||||
|
# rval = True
|
||||||
|
# elif ret == QMessageBox.Cancel:
|
||||||
|
# pass
|
||||||
|
# else:
|
||||||
|
# raise Exception('FATAL: Should never occur!')
|
||||||
|
# MP MP prompt redundant because new picks have to be accepted in the first place closing PickDlg
|
||||||
stat_picks = picks
|
stat_picks = picks
|
||||||
rval = True
|
rval = True
|
||||||
elif ret == QMessageBox.Cancel:
|
|
||||||
pass
|
|
||||||
else:
|
|
||||||
raise Exception('FATAL: Should never occur!')
|
|
||||||
self.getPicks(type=type)[station] = stat_picks
|
self.getPicks(type=type)[station] = stat_picks
|
||||||
return rval
|
return rval
|
||||||
|
|
||||||
|
@ -1 +1 @@
|
|||||||
7548-dirty
|
7257-dirty
|
||||||
|
Loading…
Reference in New Issue
Block a user