mirror of
https://github.com/dashpay/dash.git
synced 2024-12-29 13:59:06 +01:00
UI: Persist Darksend+InstantX settings and default to Darksend=false on first start
This commit is contained in:
parent
9a4914e6c1
commit
63c8ae1516
@ -616,8 +616,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>830</width>
|
||||
<height>68</height>
|
||||
<width>828</width>
|
||||
<height>64</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2" stretch="0,1">
|
||||
@ -1339,7 +1339,7 @@
|
||||
<string>Darksend</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@ -1409,7 +1409,7 @@
|
||||
</resources>
|
||||
<connections/>
|
||||
<buttongroups>
|
||||
<buttongroup name="groupFee"/>
|
||||
<buttongroup name="groupCustomFee"/>
|
||||
<buttongroup name="groupFee"/>
|
||||
</buttongroups>
|
||||
</ui>
|
||||
|
@ -54,6 +54,14 @@ SendCoinsDialog::SendCoinsDialog(QWidget *parent) :
|
||||
connect(ui->lineEditCoinControlChange, SIGNAL(textEdited(const QString &)), this, SLOT(coinControlChangeEdited(const QString &)));
|
||||
|
||||
// Dash specific
|
||||
QSettings settings;
|
||||
if (!settings.contains("bUseDarkSend"))
|
||||
settings.setValue("bUseDarkSend", false);
|
||||
if (!settings.contains("bUseInstantX"))
|
||||
settings.setValue("bUseInstantX", false);
|
||||
|
||||
bool useDarkSend = settings.value("bUseDarkSend").toBool();
|
||||
bool useInstantX = settings.value("bUseInstantX").toBool();
|
||||
if(fLiteMode) {
|
||||
ui->checkUseDarksend->setChecked(false);
|
||||
ui->checkUseDarksend->setVisible(false);
|
||||
@ -61,6 +69,13 @@ SendCoinsDialog::SendCoinsDialog(QWidget *parent) :
|
||||
CoinControlDialog::coinControl->useDarkSend = false;
|
||||
CoinControlDialog::coinControl->useInstantX = false;
|
||||
}
|
||||
else{
|
||||
ui->checkUseDarksend->setChecked(useDarkSend);
|
||||
ui->checkInstantX->setChecked(useInstantX);
|
||||
CoinControlDialog::coinControl->useDarkSend = useDarkSend;
|
||||
CoinControlDialog::coinControl->useInstantX = useInstantX;
|
||||
}
|
||||
|
||||
connect(ui->checkUseDarksend, SIGNAL(stateChanged ( int )), this, SLOT(updateDisplayUnit()));
|
||||
connect(ui->checkInstantX, SIGNAL(stateChanged ( int )), this, SLOT(updateInstantX()));
|
||||
|
||||
@ -91,7 +106,6 @@ SendCoinsDialog::SendCoinsDialog(QWidget *parent) :
|
||||
ui->labelCoinControlChange->addAction(clipboardChangeAction);
|
||||
|
||||
// init transaction fee section
|
||||
QSettings settings;
|
||||
if (!settings.contains("fFeeSectionMinimized"))
|
||||
settings.setValue("fFeeSectionMinimized", true);
|
||||
if (!settings.contains("nFeeRadio") && settings.contains("nTransactionFee") && settings.value("nTransactionFee").toLongLong() > 0) // compatibility
|
||||
@ -110,6 +124,7 @@ SendCoinsDialog::SendCoinsDialog(QWidget *parent) :
|
||||
settings.setValue("fPayOnlyMinFee", false);
|
||||
if (!settings.contains("fSendFreeTransactions"))
|
||||
settings.setValue("fSendFreeTransactions", false);
|
||||
|
||||
ui->groupFee->setId(ui->radioSmartFee, 0);
|
||||
ui->groupFee->setId(ui->radioCustomFee, 1);
|
||||
ui->groupFee->button((int)std::max(0, std::min(1, settings.value("nFeeRadio").toInt())))->setChecked(true);
|
||||
@ -120,7 +135,7 @@ SendCoinsDialog::SendCoinsDialog(QWidget *parent) :
|
||||
ui->customFee->setValue(settings.value("nTransactionFee").toLongLong());
|
||||
ui->checkBoxMinimumFee->setChecked(settings.value("fPayOnlyMinFee").toBool());
|
||||
ui->checkBoxFreeTx->setChecked(settings.value("fSendFreeTransactions").toBool());
|
||||
minimizeFeeSection(settings.value("fFeeSectionMinimized").toBool());
|
||||
minimizeFeeSection(settings.value("bDarksendChecked").toBool());
|
||||
}
|
||||
|
||||
void SendCoinsDialog::setClientModel(ClientModel *clientModel)
|
||||
@ -533,11 +548,12 @@ void SendCoinsDialog::setBalance(const CAmount& balance, const CAmount& unconfir
|
||||
if(model && model->getOptionsModel())
|
||||
{
|
||||
uint64_t bal = 0;
|
||||
|
||||
QSettings settings;
|
||||
settings.setValue("bUseDarkSend", ui->checkUseDarksend->isChecked());
|
||||
if(ui->checkUseDarksend->isChecked()) {
|
||||
bal = anonymizedBalance;
|
||||
bal = anonymizedBalance;
|
||||
} else {
|
||||
bal = balance;
|
||||
bal = balance;
|
||||
}
|
||||
|
||||
ui->labelBalance->setText(BitcoinUnits::formatWithUnit(model->getOptionsModel()->getDisplayUnit(), bal));
|
||||
@ -557,6 +573,8 @@ void SendCoinsDialog::updateDisplayUnit()
|
||||
|
||||
void SendCoinsDialog::updateInstantX()
|
||||
{
|
||||
QSettings settings;
|
||||
settings.setValue("bUseInstantX", ui->checkInstantX->isChecked());
|
||||
CoinControlDialog::coinControl->useInstantX = ui->checkInstantX->isChecked();
|
||||
coinControlUpdateLabels();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user