From 97fceb4ff4d6085710a0df7c6dcda6b93bd3cf3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20K=C3=A4berich?= Date: Sun, 10 Jul 2022 15:30:42 +0200 Subject: [PATCH] reset preferences command line option --- Software/PC_Application/appwindow.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Software/PC_Application/appwindow.cpp b/Software/PC_Application/appwindow.cpp index 305960c..e964080 100644 --- a/Software/PC_Application/appwindow.cpp +++ b/Software/PC_Application/appwindow.cpp @@ -181,10 +181,15 @@ AppWindow::AppWindow(QWidget *parent) parser.addOption(QCommandLineOption("no-gui", "Disables the graphical interface")); parser.addOption(QCommandLineOption("cal", "Calibration file to load on startup", "cal")); parser.addOption(QCommandLineOption("setup", "Setup file to load on startup", "setup")); + parser.addOption(QCommandLineOption("reset-preferences", "Resets all preferences to their default values")); parser.process(QCoreApplication::arguments()); - Preferences::getInstance().load(); + if(parser.isSet("reset-preferences")) { + Preferences::getInstance().setDefault(); + } else { + Preferences::getInstance().load(); + } device = nullptr; if(parser.isSet("port")) {