diff --git a/.coveragerc b/.coveragerc index df5418a..a1bf8c4 100644 --- a/.coveragerc +++ b/.coveragerc @@ -2,6 +2,8 @@ [run] branch = True source = hyo2.ssm2 +omit = + hyo2/ssm2/app/* [report] # Regexes for lines to exclude from consideration diff --git a/hyo2/ssm2/__init__.py b/hyo2/ssm2/__init__.py index 7a3adab..928e1bb 100644 --- a/hyo2/ssm2/__init__.py +++ b/hyo2/ssm2/__init__.py @@ -12,7 +12,7 @@ logger.addHandler(logging.NullHandler()) name = "Sound Speed" -__version__ = '2024.2.1' +__version__ = '2024.2.2' __copyright__ = 'Copyright 2024 University of New Hampshire, Center for Coastal and Ocean Mapping' pkg_info = PkgInfo( diff --git a/hyo2/ssm2/app/gui/soundspeedmanager/mainwin.py b/hyo2/ssm2/app/gui/soundspeedmanager/mainwin.py index 73d5e82..d82c7fb 100644 --- a/hyo2/ssm2/app/gui/soundspeedmanager/mainwin.py +++ b/hyo2/ssm2/app/gui/soundspeedmanager/mainwin.py @@ -208,6 +208,9 @@ def __init__(self): self.data_cleared() self.tabs.blockSignals(False) + # using in app tests + self.skip_do_you_really_quit = False + logger.info("* > APP: initialized!") def on_change(self, i): @@ -830,17 +833,24 @@ def _do_you_really_want(self, title="Quit", text="quit"): def closeEvent(self, event): """ actions to be done before close the app """ + if self.skip_do_you_really_quit: + self._close(event=event) + return + reply = self._do_you_really_want("Quit", "quit %s" % app_info.app_name) # reply = QtWidgets.QMessageBox.Yes if reply == QtWidgets.QMessageBox.StandardButton.Yes: - event.accept() - self.lib.close() - if self.has_sdm_support: - self.tab_monitor.stop_plotting() - super(MainWin, self).closeEvent(event) + self._close(event) else: event.ignore() + def _close(self, event): + event.accept() + self.lib.close() + if self.has_sdm_support: + self.tab_monitor.stop_plotting() + super(MainWin, self).closeEvent(event) + # -------------------------- development-only -------------------------- def do(self):