Skip to content

Commit

Permalink
s/AdvancedPSUI/AdvancedCJUI/g
Browse files Browse the repository at this point in the history
  • Loading branch information
UdjinM6 committed Mar 11, 2021
1 parent 9c1a3bd commit 4dc95e2
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 30 deletions.
2 changes: 1 addition & 1 deletion src/qt/forms/optionsdialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@
<widget class="QWidget" name="pageCoinJoin">
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<widget class="QCheckBox" name="showAdvancedPSUI">
<widget class="QCheckBox" name="showAdvancedCJUI">
<property name="toolTip">
<string>Show additional information and buttons for CoinJoin on overview screen.</string>
</property>
Expand Down
2 changes: 1 addition & 1 deletion src/qt/optionsdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ void OptionsDialog::setMapper()
/* Wallet */
mapper->addMapping(ui->coinControlFeatures, OptionsModel::CoinControlFeatures);
mapper->addMapping(ui->showMasternodesTab, OptionsModel::ShowMasternodesTab);
mapper->addMapping(ui->showAdvancedPSUI, OptionsModel::ShowAdvancedPSUI);
mapper->addMapping(ui->showAdvancedCJUI, OptionsModel::ShowAdvancedCJUI);
mapper->addMapping(ui->showCoinJoinPopups, OptionsModel::ShowCoinJoinPopups);
mapper->addMapping(ui->lowKeysWarning, OptionsModel::LowKeysWarning);
mapper->addMapping(ui->coinJoinMultiSession, OptionsModel::CoinJoinMultiSession);
Expand Down
20 changes: 10 additions & 10 deletions src/qt/optionsmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,9 @@ void OptionsModel::Init(bool resetSettings)
addOverriddenOption("-enablecoinjoin");
}

if (!settings.contains("fShowAdvancedPSUI"))
settings.setValue("fShowAdvancedPSUI", false);
fShowAdvancedPSUI = settings.value("fShowAdvancedPSUI", false).toBool();
if (!settings.contains("fShowAdvancedCJUI"))
settings.setValue("fShowAdvancedCJUI", false);
fShowAdvancedCJUI = settings.value("fShowAdvancedCJUI", false).toBool();

if (!settings.contains("fShowCoinJoinPopups"))
settings.setValue("fShowCoinJoinPopups", true);
Expand Down Expand Up @@ -336,8 +336,8 @@ QVariant OptionsModel::data(const QModelIndex & index, int role) const
return settings.value("fShowMasternodesTab");
case CoinJoinEnabled:
return settings.value("fCoinJoinEnabled");
case ShowAdvancedPSUI:
return fShowAdvancedPSUI;
case ShowAdvancedCJUI:
return fShowAdvancedCJUI;
case ShowCoinJoinPopups:
return settings.value("fShowCoinJoinPopups");
case LowKeysWarning:
Expand Down Expand Up @@ -493,11 +493,11 @@ bool OptionsModel::setData(const QModelIndex & index, const QVariant & value, in
Q_EMIT coinJoinEnabledChanged();
}
break;
case ShowAdvancedPSUI:
if (settings.value("fShowAdvancedPSUI") != value) {
fShowAdvancedPSUI = value.toBool();
settings.setValue("fShowAdvancedPSUI", fShowAdvancedPSUI);
Q_EMIT advancedPSUIChanged(fShowAdvancedPSUI);
case ShowAdvancedCJUI:
if (settings.value("fShowAdvancedCJUI") != value) {
fShowAdvancedCJUI = value.toBool();
settings.setValue("fShowAdvancedCJUI", fShowAdvancedCJUI);
Q_EMIT AdvancedCJUIChanged(fShowAdvancedCJUI);
}
break;
case ShowCoinJoinPopups:
Expand Down
8 changes: 4 additions & 4 deletions src/qt/optionsmodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class OptionsModel : public QAbstractListModel
SpendZeroConfChange, // bool
ShowMasternodesTab, // bool
CoinJoinEnabled, // bool
ShowAdvancedPSUI, // bool
ShowAdvancedCJUI, // bool
ShowCoinJoinPopups, // bool
LowKeysWarning, // bool
CoinJoinRounds, // int
Expand All @@ -87,7 +87,7 @@ class OptionsModel : public QAbstractListModel
QString getThirdPartyTxUrls() const { return strThirdPartyTxUrls; }
bool getProxySettings(QNetworkProxy& proxy) const;
bool getCoinControlFeatures() const { return fCoinControlFeatures; }
bool getShowAdvancedPSUI() { return fShowAdvancedPSUI; }
bool getShowAdvancedCJUI() { return fShowAdvancedCJUI; }
const QString& getOverriddenByCommandLine() { return strOverriddenByCommandLine; }
void emitCoinJoinEnabledChanged();

Expand All @@ -108,7 +108,7 @@ class OptionsModel : public QAbstractListModel
int nDisplayUnit;
QString strThirdPartyTxUrls;
bool fCoinControlFeatures;
bool fShowAdvancedPSUI;
bool fShowAdvancedCJUI;
/* settings that were overridden by command-line */
QString strOverriddenByCommandLine;

Expand All @@ -122,7 +122,7 @@ class OptionsModel : public QAbstractListModel
void coinJoinEnabledChanged();
void coinJoinRoundsChanged();
void privateSentAmountChanged();
void advancedPSUIChanged(bool);
void AdvancedCJUIChanged(bool);
void coinControlFeaturesChanged(bool);
void hideTrayIconChanged(bool);
};
Expand Down
24 changes: 12 additions & 12 deletions src/qt/overviewpage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ OverviewPage::OverviewPage(QWidget* parent) :

// Recent transactions
ui->listTransactions->setItemDelegate(txdelegate);
// Note: minimum height of listTransactions will be set later in updateAdvancedPSUI() to reflect actual settings
// Note: minimum height of listTransactions will be set later in updateAdvancedCJUI() to reflect actual settings
ui->listTransactions->setAttribute(Qt::WA_MacShowFocusRect, false);

connect(ui->listTransactions, SIGNAL(clicked(QModelIndex)), this, SLOT(handleTransactionClicked(QModelIndex)));
Expand Down Expand Up @@ -267,11 +267,11 @@ void OverviewPage::setWalletModel(WalletModel *model)
connect(model, SIGNAL(notifyWatchonlyChanged(bool)), this, SLOT(updateWatchOnlyLabels(bool)));

// explicitly update PS frame and transaction list to reflect actual settings
updateAdvancedPSUI(model->getOptionsModel()->getShowAdvancedPSUI());
updateAdvancedCJUI(model->getOptionsModel()->getShowAdvancedCJUI());

connect(model->getOptionsModel(), SIGNAL(coinJoinRoundsChanged()), this, SLOT(updateCoinJoinProgress()));
connect(model->getOptionsModel(), SIGNAL(privateSentAmountChanged()), this, SLOT(updateCoinJoinProgress()));
connect(model->getOptionsModel(), SIGNAL(advancedPSUIChanged(bool)), this, SLOT(updateAdvancedPSUI(bool)));
connect(model->getOptionsModel(), SIGNAL(AdvancedCJUIChanged(bool)), this, SLOT(updateAdvancedCJUI(bool)));
connect(model->getOptionsModel(), &OptionsModel::coinJoinEnabledChanged, [=]() {
coinJoinStatus(true);
});
Expand Down Expand Up @@ -365,7 +365,7 @@ void OverviewPage::updateCoinJoinProgress()
}
ui->labelAmountRounds->setText(strAmountAndRounds);

if (!fShowAdvancedPSUI) return;
if (!fShowAdvancedCJUI) return;

CAmount nDenominatedConfirmedBalance;
CAmount nDenominatedUnconfirmedBalance;
Expand Down Expand Up @@ -422,11 +422,11 @@ void OverviewPage::updateCoinJoinProgress()
ui->coinJoinProgress->setToolTip(strToolPip);
}

void OverviewPage::updateAdvancedPSUI(bool fShowAdvancedPSUI)
void OverviewPage::updateAdvancedCJUI(bool fShowAdvancedCJUI)
{
if (!walletModel || !clientModel || !clientModel->coinJoinOptions().isEnabled()) return;

this->fShowAdvancedPSUI = fShowAdvancedPSUI;
this->fShowAdvancedCJUI = fShowAdvancedCJUI;
coinJoinStatus(true);
}

Expand Down Expand Up @@ -476,7 +476,7 @@ void OverviewPage::coinJoinStatus(bool fForce)
static bool fLastVisible{false};
static bool fLastShowAdvanced{false};
// Only update the widget's visibility if something changed since the last call of setWidgetsVisible
if (fLastShowAdvanced == fShowAdvancedPSUI && fLastVisible == fVisible) {
if (fLastShowAdvanced == fShowAdvancedCJUI && fLastVisible == fVisible) {
if (fInitial) {
fInitial = false;
} else {
Expand All @@ -485,10 +485,10 @@ void OverviewPage::coinJoinStatus(bool fForce)
}
// Set visible if: fVisible and not advanced UI element or advanced ui element and advanced ui active
for (const auto& it : coinJoinWidgets) {
it.first->setVisible(fVisible && (!it.second || it.second == fShowAdvancedPSUI));
it.first->setVisible(fVisible && (!it.second || it.second == fShowAdvancedCJUI));
}
fLastVisible = fVisible;
fLastShowAdvanced = fShowAdvancedPSUI;
fLastShowAdvanced = fShowAdvancedCJUI;
};

static int64_t nLastDSProgressBlockTime = 0;
Expand All @@ -515,7 +515,7 @@ void OverviewPage::coinJoinStatus(bool fForce)

QString strEnabled = tr("Disabled");
// Show how many keys left in advanced PS UI mode only
if (fShowAdvancedPSUI) strEnabled += ", " + strKeysLeftText;
if (fShowAdvancedCJUI) strEnabled += ", " + strKeysLeftText;
ui->labelCoinJoinEnabled->setText(strEnabled);

// If mixing isn't active always show the lower number of txes because there are
Expand All @@ -524,7 +524,7 @@ void OverviewPage::coinJoinStatus(bool fForce)

return;
} else {
SetupTransactionList(fShowAdvancedPSUI ? NUM_ITEMS_ENABLED_ADVANCED : NUM_ITEMS_ENABLED_NORMAL);
SetupTransactionList(fShowAdvancedCJUI ? NUM_ITEMS_ENABLED_ADVANCED : NUM_ITEMS_ENABLED_NORMAL);
}

// Warn user that wallet is running out of keys
Expand Down Expand Up @@ -569,7 +569,7 @@ void OverviewPage::coinJoinStatus(bool fForce)

QString strEnabled = walletModel->coinJoin().isMixing() ? tr("Enabled") : tr("Disabled");
// Show how many keys left in advanced PS UI mode only
if(fShowAdvancedPSUI) strEnabled += ", " + strKeysLeftText;
if(fShowAdvancedCJUI) strEnabled += ", " + strKeysLeftText;
ui->labelCoinJoinEnabled->setText(strEnabled);

if(nWalletBackups == -1) {
Expand Down
4 changes: 2 additions & 2 deletions src/qt/overviewpage.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public Q_SLOTS:
WalletModel *walletModel;
interfaces::WalletBalances m_balances;
int nDisplayUnit;
bool fShowAdvancedPSUI;
bool fShowAdvancedCJUI;
int cachedNumISLocks;

TxViewDelegate *txdelegate;
Expand All @@ -64,7 +64,7 @@ private Q_SLOTS:
void toggleCoinJoin();
void updateDisplayUnit();
void updateCoinJoinProgress();
void updateAdvancedPSUI(bool fShowAdvancedPSUI);
void updateAdvancedCJUI(bool fShowAdvancedCJUI);
void handleTransactionClicked(const QModelIndex &index);
void updateAlerts(const QString &warnings);
void updateWatchOnlyLabels(bool showWatchOnly);
Expand Down

0 comments on commit 4dc95e2

Please sign in to comment.