diff --git a/src/dialog/AccountSwitcherDialog.cpp b/src/dialog/AccountSwitcherDialog.cpp index d52334b..a2ceda3 100644 --- a/src/dialog/AccountSwitcherDialog.cpp +++ b/src/dialog/AccountSwitcherDialog.cpp @@ -78,7 +78,6 @@ void AccountSwitcherDialog::editLabel() { } void AccountSwitcherDialog::updateSelection() { - qDebug() << "test"; QModelIndex index = m_model->index(m_ctx->wallet->currentSubaddressAccount(), 0); ui->accounts->selectionModel()->select(index, QItemSelectionModel::ClearAndSelect | QItemSelectionModel::Rows); } diff --git a/src/dialog/BroadcastTxDialog.cpp b/src/dialog/TxBroadcastDialog.cpp similarity index 71% rename from src/dialog/BroadcastTxDialog.cpp rename to src/dialog/TxBroadcastDialog.cpp index 5f031d5..daefe4a 100644 --- a/src/dialog/BroadcastTxDialog.cpp +++ b/src/dialog/TxBroadcastDialog.cpp @@ -1,15 +1,15 @@ // SPDX-License-Identifier: BSD-3-Clause // Copyright (c) 2020-2021, The Monero Project. -#include "BroadcastTxDialog.h" -#include "ui_BroadcastTxDialog.h" +#include "TxBroadcastDialog.h" +#include "ui_TxBroadcastDialog.h" #include "utils/NetworkManager.h" #include -BroadcastTxDialog::BroadcastTxDialog(QWidget *parent, QSharedPointer ctx, const QString &transactionHex) +TxBroadcastDialog::TxBroadcastDialog(QWidget *parent, QSharedPointer ctx, const QString &transactionHex) : QDialog(parent) - , ui(new Ui::BroadcastTxDialog) + , ui(new Ui::TxBroadcastDialog) , m_ctx(std::move(ctx)) { ui->setupUi(this); @@ -17,10 +17,10 @@ BroadcastTxDialog::BroadcastTxDialog(QWidget *parent, QSharedPointer auto node = m_ctx->nodes->connection(); m_rpc = new DaemonRpc(this, getNetworkTor(), node.toAddress()); - connect(ui->btn_Broadcast, &QPushButton::clicked, this, &BroadcastTxDialog::broadcastTx); - connect(ui->btn_Close, &QPushButton::clicked, this, &BroadcastTxDialog::reject); + connect(ui->btn_Broadcast, &QPushButton::clicked, this, &TxBroadcastDialog::broadcastTx); + connect(ui->btn_Close, &QPushButton::clicked, this, &TxBroadcastDialog::reject); - connect(m_rpc, &DaemonRpc::ApiResponse, this, &BroadcastTxDialog::onApiResponse); + connect(m_rpc, &DaemonRpc::ApiResponse, this, &TxBroadcastDialog::onApiResponse); if (!transactionHex.isEmpty()) { ui->transaction->setPlainText(transactionHex); @@ -29,7 +29,7 @@ BroadcastTxDialog::BroadcastTxDialog(QWidget *parent, QSharedPointer this->adjustSize(); } -void BroadcastTxDialog::broadcastTx() { +void TxBroadcastDialog::broadcastTx() { QString tx = ui->transaction->toPlainText(); FeatherNode node = ui->radio_useCustom->isChecked() ? FeatherNode(ui->customNode->text()) : m_ctx->nodes->connection(); @@ -44,7 +44,7 @@ void BroadcastTxDialog::broadcastTx() { m_rpc->sendRawTransaction(tx); } -void BroadcastTxDialog::onApiResponse(const DaemonRpc::DaemonResponse &resp) { +void TxBroadcastDialog::onApiResponse(const DaemonRpc::DaemonResponse &resp) { if (!resp.ok) { QMessageBox::warning(this, "Transaction broadcast", resp.status); return; @@ -56,4 +56,4 @@ void BroadcastTxDialog::onApiResponse(const DaemonRpc::DaemonResponse &resp) { } } -BroadcastTxDialog::~BroadcastTxDialog() = default; +TxBroadcastDialog::~TxBroadcastDialog() = default; diff --git a/src/dialog/BroadcastTxDialog.h b/src/dialog/TxBroadcastDialog.h similarity index 59% rename from src/dialog/BroadcastTxDialog.h rename to src/dialog/TxBroadcastDialog.h index eefc93f..a559632 100644 --- a/src/dialog/BroadcastTxDialog.h +++ b/src/dialog/TxBroadcastDialog.h @@ -1,35 +1,35 @@ // SPDX-License-Identifier: BSD-3-Clause // Copyright (c) 2020-2021, The Monero Project. -#ifndef FEATHER_BROADCASTTXDIALOG_H -#define FEATHER_BROADCASTTXDIALOG_H +#ifndef FEATHER_TXBROADCASTDIALOG_H +#define FEATHER_TXBROADCASTDIALOG_H #include #include "appcontext.h" #include "utils/daemonrpc.h" namespace Ui { - class BroadcastTxDialog; + class TxBroadcastDialog; } -class BroadcastTxDialog : public QDialog +class TxBroadcastDialog : public QDialog { Q_OBJECT public: - explicit BroadcastTxDialog(QWidget *parent, QSharedPointer ctx, const QString &transactionHex = ""); - ~BroadcastTxDialog() override; + explicit TxBroadcastDialog(QWidget *parent, QSharedPointer ctx, const QString &transactionHex = ""); + ~TxBroadcastDialog() override; private slots: void broadcastTx(); void onApiResponse(const DaemonRpc::DaemonResponse &resp); private: - QScopedPointer ui; + QScopedPointer ui; QSharedPointer m_ctx; UtilsNetworking *m_network; DaemonRpc *m_rpc; }; -#endif //FEATHER_BROADCASTTXDIALOG_H +#endif //FEATHER_TXBROADCASTDIALOG_H diff --git a/src/dialog/BroadcastTxDialog.ui b/src/dialog/TxBroadcastDialog.ui similarity index 96% rename from src/dialog/BroadcastTxDialog.ui rename to src/dialog/TxBroadcastDialog.ui index 0be33f2..65341f1 100644 --- a/src/dialog/BroadcastTxDialog.ui +++ b/src/dialog/TxBroadcastDialog.ui @@ -1,7 +1,7 @@ - BroadcastTxDialog - + TxBroadcastDialog + 0 diff --git a/src/dialog/TransactionInfoDialog.cpp b/src/dialog/TxInfoDialog.cpp similarity index 85% rename from src/dialog/TransactionInfoDialog.cpp rename to src/dialog/TxInfoDialog.cpp index a7dcc8d..1b1a13d 100644 --- a/src/dialog/TransactionInfoDialog.cpp +++ b/src/dialog/TxInfoDialog.cpp @@ -1,8 +1,8 @@ // SPDX-License-Identifier: BSD-3-Clause // Copyright (c) 2020-2021, The Monero Project. -#include "TransactionInfoDialog.h" -#include "ui_TransactionInfoDialog.h" +#include "TxInfoDialog.h" +#include "ui_TxInfoDialog.h" #include "libwalletqt/CoinsInfo.h" #include "libwalletqt/WalletManager.h" @@ -17,9 +17,9 @@ #include #include -TransactionInfoDialog::TransactionInfoDialog(QSharedPointer ctx, TransactionInfo *txInfo, QWidget *parent) +TxInfoDialog::TxInfoDialog(QSharedPointer ctx, TransactionInfo *txInfo, QWidget *parent) : QDialog(parent) - , ui(new Ui::TransactionInfoDialog) + , ui(new Ui::TxInfoDialog) , m_ctx(std::move(ctx)) , m_txInfo(txInfo) { @@ -34,10 +34,10 @@ TransactionInfoDialog::TransactionInfoDialog(QSharedPointer ctx, Tra ui->btn_CopyTxKey->setToolTip("Transaction key unknown"); } - connect(ui->btn_CopyTxKey, &QPushButton::pressed, this, &TransactionInfoDialog::copyTxKey); - connect(ui->btn_createTxProof, &QPushButton::pressed, this, &TransactionInfoDialog::createTxProof); + connect(ui->btn_CopyTxKey, &QPushButton::pressed, this, &TxInfoDialog::copyTxKey); + connect(ui->btn_createTxProof, &QPushButton::pressed, this, &TxInfoDialog::createTxProof); - connect(m_ctx->wallet.get(), &Wallet::newBlock, this, &TransactionInfoDialog::updateData); + connect(m_ctx->wallet.get(), &Wallet::newBlock, this, &TxInfoDialog::updateData); this->setData(txInfo); @@ -78,7 +78,7 @@ TransactionInfoDialog::TransactionInfoDialog(QSharedPointer ctx, Tra this->adjustSize(); } -void TransactionInfoDialog::setData(TransactionInfo* tx) { +void TxInfoDialog::setData(TransactionInfo* tx) { QString blockHeight = QString::number(tx->blockHeight()); if (tx->isFailed()) { @@ -120,18 +120,18 @@ void TransactionInfoDialog::setData(TransactionInfo* tx) { } -void TransactionInfoDialog::updateData() { +void TxInfoDialog::updateData() { TransactionInfo* tx = m_ctx->wallet->history()->transaction(m_txid); if (!tx) return; this->setData(tx); } -void TransactionInfoDialog::copyTxKey() { +void TxInfoDialog::copyTxKey() { Utils::copyToClipboard(m_txKey); } -void TransactionInfoDialog::createTxProof() { +void TxInfoDialog::createTxProof() { m_txProofDialog->show(); } -TransactionInfoDialog::~TransactionInfoDialog() = default; \ No newline at end of file +TxInfoDialog::~TxInfoDialog() = default; \ No newline at end of file diff --git a/src/dialog/TransactionInfoDialog.h b/src/dialog/TxInfoDialog.h similarity index 60% rename from src/dialog/TransactionInfoDialog.h rename to src/dialog/TxInfoDialog.h index 95f8136..900ddc2 100644 --- a/src/dialog/TransactionInfoDialog.h +++ b/src/dialog/TxInfoDialog.h @@ -1,8 +1,8 @@ // SPDX-License-Identifier: BSD-3-Clause // Copyright (c) 2020-2021, The Monero Project. -#ifndef FEATHER_TRANSACTIONINFODIALOG_H -#define FEATHER_TRANSACTIONINFODIALOG_H +#ifndef FEATHER_TXINFODIALOG_H +#define FEATHER_TXINFODIALOG_H #include #include @@ -11,16 +11,16 @@ #include "dialog/TxProofDialog.h" namespace Ui { - class TransactionInfoDialog; + class TxInfoDialog; } -class TransactionInfoDialog : public QDialog +class TxInfoDialog : public QDialog { Q_OBJECT public: - explicit TransactionInfoDialog(QSharedPointer ctx, TransactionInfo *txInfo, QWidget *parent = nullptr); - ~TransactionInfoDialog() override; + explicit TxInfoDialog(QSharedPointer ctx, TransactionInfo *txInfo, QWidget *parent = nullptr); + ~TxInfoDialog() override; signals: void resendTranscation(const QString &txid); @@ -31,7 +31,7 @@ private: void setData(TransactionInfo* tx); void updateData(); - QScopedPointer ui; + QScopedPointer ui; QSharedPointer m_ctx; TransactionInfo *m_txInfo; @@ -41,4 +41,4 @@ private: QTimer m_updateTimer; }; -#endif //FEATHER_TRANSACTIONINFODIALOG_H +#endif //FEATHER_TXINFODIALOG_H diff --git a/src/dialog/TransactionInfoDialog.ui b/src/dialog/TxInfoDialog.ui similarity index 98% rename from src/dialog/TransactionInfoDialog.ui rename to src/dialog/TxInfoDialog.ui index ceb0dfc..66e9c0c 100644 --- a/src/dialog/TransactionInfoDialog.ui +++ b/src/dialog/TxInfoDialog.ui @@ -1,7 +1,7 @@ - TransactionInfoDialog - + TxInfoDialog + 0 diff --git a/src/historywidget.cpp b/src/historywidget.cpp index 4c347d3..e2c9c3e 100644 --- a/src/historywidget.cpp +++ b/src/historywidget.cpp @@ -3,7 +3,7 @@ #include "historywidget.h" #include "ui_historywidget.h" -#include "dialog/TransactionInfoDialog.h" +#include "dialog/TxInfoDialog.h" #include "dialog/TxProofDialog.h" #include "utils/Icons.h" #include "utils/config.h" @@ -115,8 +115,8 @@ void HistoryWidget::showTxDetails() { auto *tx = ui->history->currentEntry(); if (!tx) return; - auto *dialog = new TransactionInfoDialog(m_ctx, tx, this); - connect(dialog, &TransactionInfoDialog::resendTranscation, [this](const QString &txid){ + auto *dialog = new TxInfoDialog(m_ctx, tx, this); + connect(dialog, &TxInfoDialog::resendTranscation, [this](const QString &txid){ emit resendTransaction(txid); }); dialog->show(); diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 4eb5797..04adfc0 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -14,7 +14,7 @@ #include "dialog/WalletInfoDialog.h" #include "dialog/TorInfoDialog.h" #include "dialog/ViewOnlyDialog.h" -#include "dialog/BroadcastTxDialog.h" +#include "dialog/TxBroadcastDialog.h" #include "dialog/TxImportDialog.h" #include "dialog/PasswordDialog.h" #include "dialog/BalanceDialog.h" @@ -872,7 +872,7 @@ void MainWindow::onResendTransaction(const QString &txid) { // Connect to a different node so chances of successful relay are higher m_ctx->nodes->autoConnect(true); - BroadcastTxDialog dialog{this, m_ctx, m_ctx->txCache[txid]}; + TxBroadcastDialog dialog{this, m_ctx, m_ctx->txCache[txid]}; dialog.exec(); } @@ -1034,7 +1034,7 @@ void MainWindow::loadSignedTx() { } void MainWindow::loadSignedTxFromText() { - BroadcastTxDialog dialog{this, m_ctx}; + TxBroadcastDialog dialog{this, m_ctx}; dialog.exec(); }