forked from qt-creator/qt-creator
Utils: Fix inverted logic for checkableDecider
`BoolAspect::checkableDecider` was used only in CMakeProjectManager for askBeforePresetsReload and askBeforeReConfigureInitialParams. Now the checkbox with "Ask before presets reload" would also match with the display of the message box. Change-Id: I45fc7a977dbeb13df051375bd3dac36e7be7bdc4 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -1607,7 +1607,15 @@ void BoolAspect::setLabelPlacement(BoolAspect::LabelPlacement labelPlacement)
|
||||
d->m_labelPlacement = labelPlacement;
|
||||
}
|
||||
|
||||
CheckableDecider BoolAspect::checkableDecider()
|
||||
CheckableDecider BoolAspect::askAgainCheckableDecider()
|
||||
{
|
||||
return CheckableDecider(
|
||||
[this] { return value(); },
|
||||
[this] { setValue(true); }
|
||||
);
|
||||
}
|
||||
|
||||
CheckableDecider BoolAspect::doNotAskAgainCheckableDecider()
|
||||
{
|
||||
return CheckableDecider(
|
||||
[this] { return !value(); },
|
||||
|
@@ -223,7 +223,9 @@ public:
|
||||
|
||||
void addToLayout(Layouting::LayoutItem &parent) override;
|
||||
std::function<void(QObject *)> groupChecker();
|
||||
Utils::CheckableDecider checkableDecider();
|
||||
|
||||
Utils::CheckableDecider askAgainCheckableDecider();
|
||||
Utils::CheckableDecider doNotAskAgainCheckableDecider();
|
||||
|
||||
QAction *action() override;
|
||||
|
||||
|
@@ -594,7 +594,7 @@ void CMakeBuildSettingsWidget::reconfigureWithInitialParameters()
|
||||
Core::ICore::dialogParent(),
|
||||
Tr::tr("Re-configure with Initial Parameters"),
|
||||
Tr::tr("Clear CMake configuration and configure with initial parameters?"),
|
||||
settings->askBeforeReConfigureInitialParams.checkableDecider(),
|
||||
settings->askBeforeReConfigureInitialParams.askAgainCheckableDecider(),
|
||||
QMessageBox::Yes | QMessageBox::No,
|
||||
QMessageBox::Yes);
|
||||
|
||||
|
@@ -238,7 +238,7 @@ void CMakeManager::reloadCMakePresets()
|
||||
Tr::tr("Reload CMake Presets"),
|
||||
Tr::tr("Re-generates the kits that were created for CMake presets. All manual "
|
||||
"modifications to the CMake project settings will be lost."),
|
||||
settings->askBeforePresetsReload.checkableDecider(),
|
||||
settings->askBeforePresetsReload.askAgainCheckableDecider(),
|
||||
QMessageBox::Yes | QMessageBox::Cancel,
|
||||
QMessageBox::Yes,
|
||||
QMessageBox::Yes,
|
||||
|
Reference in New Issue
Block a user