mirror of
https://github.com/Retropex/bitcoin.git
synced 2025-05-12 19:20:42 +02:00
Bugfix: GUI/OptionsDialog: Properly disable dustdynamic labels when appropriate
This commit is contained in:
parent
1e529858e2
commit
a38caffcd0
@ -26,6 +26,7 @@
|
|||||||
#include <primitives/transaction.h> // for WITNESS_SCALE_FACTOR
|
#include <primitives/transaction.h> // for WITNESS_SCALE_FACTOR
|
||||||
#include <txdb.h>
|
#include <txdb.h>
|
||||||
#include <txmempool.h> // for maxmempoolMinimum
|
#include <txmempool.h> // for maxmempoolMinimum
|
||||||
|
#include <util/check.h>
|
||||||
#include <util/strencodings.h>
|
#include <util/strencodings.h>
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
@ -95,9 +96,24 @@ void OptionsDialog::CreateOptionUI(QBoxLayout * const layout, QWidget * const o,
|
|||||||
|
|
||||||
layout->addLayout(horizontalLayout);
|
layout->addLayout(horizontalLayout);
|
||||||
|
|
||||||
|
o->setProperty("L", QVariant::fromValue((QLayout*)horizontalLayout));
|
||||||
|
|
||||||
FixTabOrder(o);
|
FixTabOrder(o);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void setSiblingsEnabled(QWidget * const o, const bool state)
|
||||||
|
{
|
||||||
|
auto layout = o->property("L").value<QLayout*>();
|
||||||
|
Assert(layout);
|
||||||
|
// NOTE: QLayout::children does not do what we need here
|
||||||
|
for (int i = layout->count(); i-- > 0; ) {
|
||||||
|
QLayoutItem * const layoutitem = layout->itemAt(i);
|
||||||
|
QWidget * const childwidget = layoutitem->widget();
|
||||||
|
if (!childwidget) continue;
|
||||||
|
childwidget->setEnabled(state);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int setFontChoice(QComboBox* cb, const OptionsModel::FontChoice& fc)
|
int setFontChoice(QComboBox* cb, const OptionsModel::FontChoice& fc)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
@ -417,15 +433,12 @@ OptionsDialog::OptionsDialog(QWidget* parent, bool enableWallet)
|
|||||||
|
|
||||||
connect(dustdynamic_enable, &QAbstractButton::toggled, [this](const bool state){
|
connect(dustdynamic_enable, &QAbstractButton::toggled, [this](const bool state){
|
||||||
dustdynamic_multiplier->setEnabled(state);
|
dustdynamic_multiplier->setEnabled(state);
|
||||||
dustdynamic_target->setEnabled(state);
|
setSiblingsEnabled(dustdynamic_target_blocks, state);
|
||||||
dustdynamic_mempool->setEnabled(state);
|
setSiblingsEnabled(dustdynamic_mempool_kvB, state);
|
||||||
if (state) {
|
if (state) {
|
||||||
if (!dustdynamic_mempool->isChecked()) dustdynamic_target->setChecked(true);
|
if (!dustdynamic_mempool->isChecked()) dustdynamic_target->setChecked(true);
|
||||||
dustdynamic_target_blocks->setEnabled(dustdynamic_target->isChecked());
|
dustdynamic_target_blocks->setEnabled(dustdynamic_target->isChecked());
|
||||||
dustdynamic_mempool_kvB->setEnabled(dustdynamic_mempool->isChecked());
|
dustdynamic_mempool_kvB->setEnabled(dustdynamic_mempool->isChecked());
|
||||||
} else {
|
|
||||||
dustdynamic_target_blocks->setEnabled(false);
|
|
||||||
dustdynamic_mempool_kvB->setEnabled(false);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
dustdynamic_enable->toggled(dustdynamic_enable->isChecked());
|
dustdynamic_enable->toggled(dustdynamic_enable->isChecked());
|
||||||
|
Loading…
Reference in New Issue
Block a user