From 459726a43f641f0cefeee513f65973739e533aeb Mon Sep 17 00:00:00 2001 From: Pieter Hijma Date: Sun, 20 Jul 2025 11:16:45 +0200 Subject: [PATCH] Gui: Stop remember state expression dialog Before this commit, the expression dialog remembered the state of whether the varset information should be shown. This is removed according to #17075. --- src/Gui/Dialogs/DlgExpressionInput.cpp | 12 +++--------- src/Gui/Dialogs/DlgExpressionInput.h | 2 +- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/src/Gui/Dialogs/DlgExpressionInput.cpp b/src/Gui/Dialogs/DlgExpressionInput.cpp index d907362751..1843920c02 100644 --- a/src/Gui/Dialogs/DlgExpressionInput.cpp +++ b/src/Gui/Dialogs/DlgExpressionInput.cpp @@ -53,9 +53,6 @@ using namespace Gui::Dialog; FC_LOG_LEVEL_INIT("DlgExpressionInput", true, true) - -bool DlgExpressionInput::varSetsVisible = false; - DlgExpressionInput::DlgExpressionInput(const App::ObjectIdentifier & _path, std::shared_ptr _expression, const Base::Unit & _impliedUnit, QWidget *parent) @@ -66,6 +63,7 @@ DlgExpressionInput::DlgExpressionInput(const App::ObjectIdentifier & _path, , discarded(false) , impliedUnit(_impliedUnit) , minimumWidth(10) + , varSetsVisible(false) { assert(path.getDocumentObject()); @@ -225,15 +223,11 @@ void DlgExpressionInput::initializeVarSets() std::vector varSets = getAllVarSets(); if (!varSets.empty() && typeOkForVarSet()) { ui->checkBoxVarSets->setVisible(true); - ui->checkBoxVarSets->setCheckState(varSetsVisible ? Qt::Checked : Qt::Unchecked); - ui->groupBoxVarSets->setVisible(varSetsVisible); - if (varSetsVisible) { - setupVarSets(); - } + ui->checkBoxVarSets->setCheckState(Qt::Unchecked); + ui->groupBoxVarSets->setVisible(false); } else { // The dialog is shown without any VarSet options. - varSetsVisible = false; ui->checkBoxVarSets->setVisible(false); ui->groupBoxVarSets->setVisible(false); } diff --git a/src/Gui/Dialogs/DlgExpressionInput.h b/src/Gui/Dialogs/DlgExpressionInput.h index 2c714750e6..ccb889f432 100644 --- a/src/Gui/Dialogs/DlgExpressionInput.h +++ b/src/Gui/Dialogs/DlgExpressionInput.h @@ -118,7 +118,7 @@ private: int minimumWidth; - static bool varSetsVisible; + bool varSetsVisible; std::unique_ptr treeWidget; QPushButton* okBtn = nullptr; QPushButton* discardBtn = nullptr;