diff --git a/PyLoT.py b/PyLoT.py index 71e63d14..775f888b 100755 --- a/PyLoT.py +++ b/PyLoT.py @@ -111,7 +111,7 @@ class MainWindow(QMainWindow): __version__ = _getVersionString() closing = Signal() - def __init__(self, parent=None, infile=None): + def __init__(self, parent=None, infile=None, reset_qsettings=False): super(MainWindow, self).__init__(parent) self.init_config_files(infile) @@ -152,6 +152,8 @@ class MainWindow(QMainWindow): self.createAction = createAction # read settings settings = QSettings() + if reset_qsettings: + settings.clear() self.recentfiles = settings.value("data/recentEvents", []) self.dispComponent = str(settings.value("plotting/dispComponent", "Z")) @@ -3909,6 +3911,7 @@ def main(args=None): project_filename = args.project_filename if args.input_filename: pylot_infile = args.input_filename + reset_qsettings = args.reset_qsettings # create the Qt application pylot_app, app_created = create_window() @@ -3921,7 +3924,7 @@ def main(args=None): app_icon.addPixmap(QPixmap(':/icons/pylot.png')) # create the main window - pylot_form = MainWindow(infile=pylot_infile) + pylot_form = MainWindow(infile=pylot_infile, reset_qsettings=reset_qsettings) pylot_form.setWindowIcon(app_icon) pylot_form.setIconSize(QSize(60, 60)) @@ -3954,5 +3957,7 @@ if __name__ == "__main__": default=None) parser.add_argument('-in', dest='input_filename', help='set pylot input file', default=None) + parser.add_argument('--reset_qsettings', default=False, action='store_true', + help='reset qsettings (debug option)') args = parser.parse_args() sys.exit(main(args)) diff --git a/pylot/core/util/widgets.py b/pylot/core/util/widgets.py index 6c8dde50..d65bd29e 100644 --- a/pylot/core/util/widgets.py +++ b/pylot/core/util/widgets.py @@ -4615,7 +4615,7 @@ class InputsTab(PropTab): for spinbox in [self.tstartBox, self.tstopBox]: spinbox.setRange(-99999, 99999) self.tstartBox.setValue(float(settings.value('tstart')) if get_None(settings.value('tstart')) else 0) - self.tstopBox.setValue(float(settings.value('tstop')) if get_None(settings.value('tstop')) else 0) + self.tstopBox.setValue(float(settings.value('tstop')) if get_None(settings.value('tstop')) else 1e6) self.cuttimesLayout.addWidget(self.tstartBox, 10) self.cuttimesLayout.addWidget(QLabel('[s] and'), 0) self.cuttimesLayout.addWidget(self.tstopBox, 10) @@ -4685,7 +4685,7 @@ class InputsTab(PropTab): "user/FullName": self.fullNameEdit.text(), "data/Structure": self.structureSelect.setCurrentIndex(index), "tstart": self.tstartBox.setValue(0), - "tstop": self.tstopBox.setValue(10000.), + "tstop": self.tstopBox.setValue(1e6), "autosaveXML": self.autosaveXML_checkbox.setChecked(True),} return values