From 63c8ae15161d253457e34f280c2db98f7d0b7bcf Mon Sep 17 00:00:00 2001 From: crowning- Date: Sun, 19 Jul 2015 14:25:55 +0200 Subject: [PATCH 1/3] UI: Persist Darksend+InstantX settings and default to Darksend=false on first start --- src/qt/forms/sendcoinsdialog.ui | 8 ++++---- src/qt/sendcoinsdialog.cpp | 28 +++++++++++++++++++++++----- 2 files changed, 27 insertions(+), 9 deletions(-) diff --git a/src/qt/forms/sendcoinsdialog.ui b/src/qt/forms/sendcoinsdialog.ui index 84d4e4a8d..cccf651a9 100644 --- a/src/qt/forms/sendcoinsdialog.ui +++ b/src/qt/forms/sendcoinsdialog.ui @@ -616,8 +616,8 @@ 0 0 - 830 - 68 + 828 + 64 @@ -1339,7 +1339,7 @@ Darksend - true + false @@ -1409,7 +1409,7 @@ - + diff --git a/src/qt/sendcoinsdialog.cpp b/src/qt/sendcoinsdialog.cpp index fe311be3f..cc92599b7 100644 --- a/src/qt/sendcoinsdialog.cpp +++ b/src/qt/sendcoinsdialog.cpp @@ -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(); } From c8c83af2f53d9036ca20f48c17a3bc820d642e2e Mon Sep 17 00:00:00 2001 From: crowning- Date: Sun, 19 Jul 2015 14:29:18 +0200 Subject: [PATCH 2/3] UI: Persist Darksend+InstantX settings and default to Darksend=false on first start (revert screen-size change) --- src/qt/forms/sendcoinsdialog.ui | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/qt/forms/sendcoinsdialog.ui b/src/qt/forms/sendcoinsdialog.ui index cccf651a9..0d4e4debf 100644 --- a/src/qt/forms/sendcoinsdialog.ui +++ b/src/qt/forms/sendcoinsdialog.ui @@ -616,8 +616,8 @@ 0 0 - 828 - 64 + 830 + 68 From 19d698529edb17862cd7ea59eb5a28ce723b5f71 Mon Sep 17 00:00:00 2001 From: crowning- Date: Sun, 19 Jul 2015 14:42:38 +0200 Subject: [PATCH 3/3] UI: Persist Darksend+InstantX settings (Cut'n'paste error fixed) --- src/qt/sendcoinsdialog.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qt/sendcoinsdialog.cpp b/src/qt/sendcoinsdialog.cpp index cc92599b7..297574145 100644 --- a/src/qt/sendcoinsdialog.cpp +++ b/src/qt/sendcoinsdialog.cpp @@ -135,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("bDarksendChecked").toBool()); + minimizeFeeSection(settings.value("fFeeSectionMinimized").toBool()); } void SendCoinsDialog::setClientModel(ClientModel *clientModel)