From 162a8b5f4c2a3a3ec2b0234b525c24c318228319 Mon Sep 17 00:00:00 2001 From: Adam Nash Date: Sat, 27 Nov 2021 00:46:26 -0500 Subject: [PATCH] feat: add config setting for skipping delete confirmation --- src/hobbits-gui/preferencesdialog.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/hobbits-gui/preferencesdialog.cpp b/src/hobbits-gui/preferencesdialog.cpp index ebb6a8c0..e8a02ea0 100644 --- a/src/hobbits-gui/preferencesdialog.cpp +++ b/src/hobbits-gui/preferencesdialog.cpp @@ -9,6 +9,7 @@ #include #include #include +#include PreferencesDialog::PreferencesDialog(QSharedPointer pluginManager, QWidget *parent) : QDialog(parent), @@ -104,6 +105,17 @@ QLayoutItem* PreferencesDialog::createEditor( }); return new QWidgetItem(editor); } + else if (value.type() == QVariant::Bool) { + QCheckBox *editor = new QCheckBox(parent); + editor->setChecked(value.toBool()); + connect( + editor, + &QCheckBox::toggled, + [setter](bool newVal) { + setter(QVariant(newVal)); + }); + return new QWidgetItem(editor); + } else if (int(value.type()) == QMetaType::QColor) { QPushButton *dialogLauncher = new QPushButton("Select Color...", parent); QLabel *colorChip = new QLabel(parent);