Rename misc dialogs

This commit is contained in:
tobtoht 2021-06-27 14:22:54 +02:00
parent bc21aed5af
commit 6921d7b1a7
No known key found for this signature in database
GPG key ID: 1CADD27F41F45C3C
9 changed files with 48 additions and 49 deletions

View file

@ -78,7 +78,6 @@ void AccountSwitcherDialog::editLabel() {
} }
void AccountSwitcherDialog::updateSelection() { void AccountSwitcherDialog::updateSelection() {
qDebug() << "test";
QModelIndex index = m_model->index(m_ctx->wallet->currentSubaddressAccount(), 0); QModelIndex index = m_model->index(m_ctx->wallet->currentSubaddressAccount(), 0);
ui->accounts->selectionModel()->select(index, QItemSelectionModel::ClearAndSelect | QItemSelectionModel::Rows); ui->accounts->selectionModel()->select(index, QItemSelectionModel::ClearAndSelect | QItemSelectionModel::Rows);
} }

View file

@ -1,15 +1,15 @@
// SPDX-License-Identifier: BSD-3-Clause // SPDX-License-Identifier: BSD-3-Clause
// Copyright (c) 2020-2021, The Monero Project. // Copyright (c) 2020-2021, The Monero Project.
#include "BroadcastTxDialog.h" #include "TxBroadcastDialog.h"
#include "ui_BroadcastTxDialog.h" #include "ui_TxBroadcastDialog.h"
#include "utils/NetworkManager.h" #include "utils/NetworkManager.h"
#include <QMessageBox> #include <QMessageBox>
BroadcastTxDialog::BroadcastTxDialog(QWidget *parent, QSharedPointer<AppContext> ctx, const QString &transactionHex) TxBroadcastDialog::TxBroadcastDialog(QWidget *parent, QSharedPointer<AppContext> ctx, const QString &transactionHex)
: QDialog(parent) : QDialog(parent)
, ui(new Ui::BroadcastTxDialog) , ui(new Ui::TxBroadcastDialog)
, m_ctx(std::move(ctx)) , m_ctx(std::move(ctx))
{ {
ui->setupUi(this); ui->setupUi(this);
@ -17,10 +17,10 @@ BroadcastTxDialog::BroadcastTxDialog(QWidget *parent, QSharedPointer<AppContext>
auto node = m_ctx->nodes->connection(); auto node = m_ctx->nodes->connection();
m_rpc = new DaemonRpc(this, getNetworkTor(), node.toAddress()); m_rpc = new DaemonRpc(this, getNetworkTor(), node.toAddress());
connect(ui->btn_Broadcast, &QPushButton::clicked, this, &BroadcastTxDialog::broadcastTx); connect(ui->btn_Broadcast, &QPushButton::clicked, this, &TxBroadcastDialog::broadcastTx);
connect(ui->btn_Close, &QPushButton::clicked, this, &BroadcastTxDialog::reject); 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()) { if (!transactionHex.isEmpty()) {
ui->transaction->setPlainText(transactionHex); ui->transaction->setPlainText(transactionHex);
@ -29,7 +29,7 @@ BroadcastTxDialog::BroadcastTxDialog(QWidget *parent, QSharedPointer<AppContext>
this->adjustSize(); this->adjustSize();
} }
void BroadcastTxDialog::broadcastTx() { void TxBroadcastDialog::broadcastTx() {
QString tx = ui->transaction->toPlainText(); QString tx = ui->transaction->toPlainText();
FeatherNode node = ui->radio_useCustom->isChecked() ? FeatherNode(ui->customNode->text()) : m_ctx->nodes->connection(); 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); m_rpc->sendRawTransaction(tx);
} }
void BroadcastTxDialog::onApiResponse(const DaemonRpc::DaemonResponse &resp) { void TxBroadcastDialog::onApiResponse(const DaemonRpc::DaemonResponse &resp) {
if (!resp.ok) { if (!resp.ok) {
QMessageBox::warning(this, "Transaction broadcast", resp.status); QMessageBox::warning(this, "Transaction broadcast", resp.status);
return; return;
@ -56,4 +56,4 @@ void BroadcastTxDialog::onApiResponse(const DaemonRpc::DaemonResponse &resp) {
} }
} }
BroadcastTxDialog::~BroadcastTxDialog() = default; TxBroadcastDialog::~TxBroadcastDialog() = default;

View file

@ -1,35 +1,35 @@
// SPDX-License-Identifier: BSD-3-Clause // SPDX-License-Identifier: BSD-3-Clause
// Copyright (c) 2020-2021, The Monero Project. // Copyright (c) 2020-2021, The Monero Project.
#ifndef FEATHER_BROADCASTTXDIALOG_H #ifndef FEATHER_TXBROADCASTDIALOG_H
#define FEATHER_BROADCASTTXDIALOG_H #define FEATHER_TXBROADCASTDIALOG_H
#include <QDialog> #include <QDialog>
#include "appcontext.h" #include "appcontext.h"
#include "utils/daemonrpc.h" #include "utils/daemonrpc.h"
namespace Ui { namespace Ui {
class BroadcastTxDialog; class TxBroadcastDialog;
} }
class BroadcastTxDialog : public QDialog class TxBroadcastDialog : public QDialog
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit BroadcastTxDialog(QWidget *parent, QSharedPointer<AppContext> ctx, const QString &transactionHex = ""); explicit TxBroadcastDialog(QWidget *parent, QSharedPointer<AppContext> ctx, const QString &transactionHex = "");
~BroadcastTxDialog() override; ~TxBroadcastDialog() override;
private slots: private slots:
void broadcastTx(); void broadcastTx();
void onApiResponse(const DaemonRpc::DaemonResponse &resp); void onApiResponse(const DaemonRpc::DaemonResponse &resp);
private: private:
QScopedPointer<Ui::BroadcastTxDialog> ui; QScopedPointer<Ui::TxBroadcastDialog> ui;
QSharedPointer<AppContext> m_ctx; QSharedPointer<AppContext> m_ctx;
UtilsNetworking *m_network; UtilsNetworking *m_network;
DaemonRpc *m_rpc; DaemonRpc *m_rpc;
}; };
#endif //FEATHER_BROADCASTTXDIALOG_H #endif //FEATHER_TXBROADCASTDIALOG_H

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0"> <ui version="4.0">
<class>BroadcastTxDialog</class> <class>TxBroadcastDialog</class>
<widget class="QDialog" name="BroadcastTxDialog"> <widget class="QDialog" name="TxBroadcastDialog">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>

View file

@ -1,8 +1,8 @@
// SPDX-License-Identifier: BSD-3-Clause // SPDX-License-Identifier: BSD-3-Clause
// Copyright (c) 2020-2021, The Monero Project. // Copyright (c) 2020-2021, The Monero Project.
#include "TransactionInfoDialog.h" #include "TxInfoDialog.h"
#include "ui_TransactionInfoDialog.h" #include "ui_TxInfoDialog.h"
#include "libwalletqt/CoinsInfo.h" #include "libwalletqt/CoinsInfo.h"
#include "libwalletqt/WalletManager.h" #include "libwalletqt/WalletManager.h"
@ -17,9 +17,9 @@
#include <QMessageBox> #include <QMessageBox>
#include <QScrollBar> #include <QScrollBar>
TransactionInfoDialog::TransactionInfoDialog(QSharedPointer<AppContext> ctx, TransactionInfo *txInfo, QWidget *parent) TxInfoDialog::TxInfoDialog(QSharedPointer<AppContext> ctx, TransactionInfo *txInfo, QWidget *parent)
: QDialog(parent) : QDialog(parent)
, ui(new Ui::TransactionInfoDialog) , ui(new Ui::TxInfoDialog)
, m_ctx(std::move(ctx)) , m_ctx(std::move(ctx))
, m_txInfo(txInfo) , m_txInfo(txInfo)
{ {
@ -34,10 +34,10 @@ TransactionInfoDialog::TransactionInfoDialog(QSharedPointer<AppContext> ctx, Tra
ui->btn_CopyTxKey->setToolTip("Transaction key unknown"); ui->btn_CopyTxKey->setToolTip("Transaction key unknown");
} }
connect(ui->btn_CopyTxKey, &QPushButton::pressed, this, &TransactionInfoDialog::copyTxKey); connect(ui->btn_CopyTxKey, &QPushButton::pressed, this, &TxInfoDialog::copyTxKey);
connect(ui->btn_createTxProof, &QPushButton::pressed, this, &TransactionInfoDialog::createTxProof); 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); this->setData(txInfo);
@ -78,7 +78,7 @@ TransactionInfoDialog::TransactionInfoDialog(QSharedPointer<AppContext> ctx, Tra
this->adjustSize(); this->adjustSize();
} }
void TransactionInfoDialog::setData(TransactionInfo* tx) { void TxInfoDialog::setData(TransactionInfo* tx) {
QString blockHeight = QString::number(tx->blockHeight()); QString blockHeight = QString::number(tx->blockHeight());
if (tx->isFailed()) { 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); TransactionInfo* tx = m_ctx->wallet->history()->transaction(m_txid);
if (!tx) return; if (!tx) return;
this->setData(tx); this->setData(tx);
} }
void TransactionInfoDialog::copyTxKey() { void TxInfoDialog::copyTxKey() {
Utils::copyToClipboard(m_txKey); Utils::copyToClipboard(m_txKey);
} }
void TransactionInfoDialog::createTxProof() { void TxInfoDialog::createTxProof() {
m_txProofDialog->show(); m_txProofDialog->show();
} }
TransactionInfoDialog::~TransactionInfoDialog() = default; TxInfoDialog::~TxInfoDialog() = default;

View file

@ -1,8 +1,8 @@
// SPDX-License-Identifier: BSD-3-Clause // SPDX-License-Identifier: BSD-3-Clause
// Copyright (c) 2020-2021, The Monero Project. // Copyright (c) 2020-2021, The Monero Project.
#ifndef FEATHER_TRANSACTIONINFODIALOG_H #ifndef FEATHER_TXINFODIALOG_H
#define FEATHER_TRANSACTIONINFODIALOG_H #define FEATHER_TXINFODIALOG_H
#include <QDialog> #include <QDialog>
#include <QTextCharFormat> #include <QTextCharFormat>
@ -11,16 +11,16 @@
#include "dialog/TxProofDialog.h" #include "dialog/TxProofDialog.h"
namespace Ui { namespace Ui {
class TransactionInfoDialog; class TxInfoDialog;
} }
class TransactionInfoDialog : public QDialog class TxInfoDialog : public QDialog
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit TransactionInfoDialog(QSharedPointer<AppContext> ctx, TransactionInfo *txInfo, QWidget *parent = nullptr); explicit TxInfoDialog(QSharedPointer<AppContext> ctx, TransactionInfo *txInfo, QWidget *parent = nullptr);
~TransactionInfoDialog() override; ~TxInfoDialog() override;
signals: signals:
void resendTranscation(const QString &txid); void resendTranscation(const QString &txid);
@ -31,7 +31,7 @@ private:
void setData(TransactionInfo* tx); void setData(TransactionInfo* tx);
void updateData(); void updateData();
QScopedPointer<Ui::TransactionInfoDialog> ui; QScopedPointer<Ui::TxInfoDialog> ui;
QSharedPointer<AppContext> m_ctx; QSharedPointer<AppContext> m_ctx;
TransactionInfo *m_txInfo; TransactionInfo *m_txInfo;
@ -41,4 +41,4 @@ private:
QTimer m_updateTimer; QTimer m_updateTimer;
}; };
#endif //FEATHER_TRANSACTIONINFODIALOG_H #endif //FEATHER_TXINFODIALOG_H

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0"> <ui version="4.0">
<class>TransactionInfoDialog</class> <class>TxInfoDialog</class>
<widget class="QWidget" name="TransactionInfoDialog"> <widget class="QWidget" name="TxInfoDialog">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>

View file

@ -3,7 +3,7 @@
#include "historywidget.h" #include "historywidget.h"
#include "ui_historywidget.h" #include "ui_historywidget.h"
#include "dialog/TransactionInfoDialog.h" #include "dialog/TxInfoDialog.h"
#include "dialog/TxProofDialog.h" #include "dialog/TxProofDialog.h"
#include "utils/Icons.h" #include "utils/Icons.h"
#include "utils/config.h" #include "utils/config.h"
@ -115,8 +115,8 @@ void HistoryWidget::showTxDetails() {
auto *tx = ui->history->currentEntry(); auto *tx = ui->history->currentEntry();
if (!tx) return; if (!tx) return;
auto *dialog = new TransactionInfoDialog(m_ctx, tx, this); auto *dialog = new TxInfoDialog(m_ctx, tx, this);
connect(dialog, &TransactionInfoDialog::resendTranscation, [this](const QString &txid){ connect(dialog, &TxInfoDialog::resendTranscation, [this](const QString &txid){
emit resendTransaction(txid); emit resendTransaction(txid);
}); });
dialog->show(); dialog->show();

View file

@ -14,7 +14,7 @@
#include "dialog/WalletInfoDialog.h" #include "dialog/WalletInfoDialog.h"
#include "dialog/TorInfoDialog.h" #include "dialog/TorInfoDialog.h"
#include "dialog/ViewOnlyDialog.h" #include "dialog/ViewOnlyDialog.h"
#include "dialog/BroadcastTxDialog.h" #include "dialog/TxBroadcastDialog.h"
#include "dialog/TxImportDialog.h" #include "dialog/TxImportDialog.h"
#include "dialog/PasswordDialog.h" #include "dialog/PasswordDialog.h"
#include "dialog/BalanceDialog.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 // Connect to a different node so chances of successful relay are higher
m_ctx->nodes->autoConnect(true); 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(); dialog.exec();
} }
@ -1034,7 +1034,7 @@ void MainWindow::loadSignedTx() {
} }
void MainWindow::loadSignedTxFromText() { void MainWindow::loadSignedTxFromText() {
BroadcastTxDialog dialog{this, m_ctx}; TxBroadcastDialog dialog{this, m_ctx};
dialog.exec(); dialog.exec();
} }