Skip to content

Commit

Permalink
Write settings on change, fixes #766
Browse files Browse the repository at this point in the history
  • Loading branch information
macumber committed Nov 29, 2024
1 parent ef255ea commit 82954b4
Showing 1 changed file with 24 additions and 8 deletions.
32 changes: 24 additions & 8 deletions src/openstudio_lib/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -302,23 +302,32 @@ bool MainWindow::allowAnalytics() const {
//}

void MainWindow::toggleUnits(bool displayIP) {
m_displayIP = displayIP;
if (m_displayIP != displayIP) {
m_displayIP = displayIP;
writeSettings();
}
}

bool MainWindow::verboseOutput() const {
return m_verboseOutput;
}

void MainWindow::toggleVerboseOutput(bool verboseOutput) {
m_verboseOutput = verboseOutput;
if (m_verboseOutput != verboseOutput) {
m_verboseOutput = verboseOutput;
writeSettings();
}
}

bool MainWindow::useClassicCLI() const {
return m_useClassicCLI;
}

void MainWindow::toggleUseClassicCLI(bool useClassicCLI) {
m_useClassicCLI = useClassicCLI;
if (m_useClassicCLI != useClassicCLI) {
m_useClassicCLI = useClassicCLI;
writeSettings();
}
}

bool MainWindow::geometryDiagnostics() const {
Expand Down Expand Up @@ -384,7 +393,10 @@ void MainWindow::onVerticalTabSelected(int verticalTabId) {
}

void MainWindow::toggleGeometryDiagnostics(bool geometryDiagnostics) {
m_geometryDiagnostics = geometryDiagnostics;
if (m_geometryDiagnostics != geometryDiagnostics) {
m_geometryDiagnostics = geometryDiagnostics;
writeSettings();
}
}

void MainWindow::promptAnalytics() {
Expand Down Expand Up @@ -414,8 +426,10 @@ void MainWindow::toggleAnalytics(bool allowAnalytics) {
}

void MainWindow::changeLanguage(const QString& rLanguage) {
m_currLang = rLanguage;
writeSettings();
if (m_currLang != rLanguage) {
m_currLang = rLanguage;
writeSettings();
}
}

void MainWindow::configureProxyClicked() {
Expand Down Expand Up @@ -459,8 +473,10 @@ bool MainWindow::displayAdditionalProps() const {
}

void MainWindow::toggleDisplayAdditionalProps(bool displayAdditionalProps) {
m_displayAdditionalProps = displayAdditionalProps;
writeSettings();
if (m_displayAdditionalProps != displayAdditionalProps) {
m_displayAdditionalProps = displayAdditionalProps;
writeSettings();
}
}

} // namespace openstudio

0 comments on commit 82954b4

Please sign in to comment.