mirror of
https://github.com/feather-wallet/feather.git
synced 2025-01-08 20:09:43 +00:00
Rename misc dialogs
This commit is contained in:
parent
bc21aed5af
commit
6921d7b1a7
9 changed files with 48 additions and 49 deletions
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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 <QMessageBox>
|
||||
|
||||
BroadcastTxDialog::BroadcastTxDialog(QWidget *parent, QSharedPointer<AppContext> ctx, const QString &transactionHex)
|
||||
TxBroadcastDialog::TxBroadcastDialog(QWidget *parent, QSharedPointer<AppContext> 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<AppContext>
|
|||
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<AppContext>
|
|||
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;
|
|
@ -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 <QDialog>
|
||||
#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<AppContext> ctx, const QString &transactionHex = "");
|
||||
~BroadcastTxDialog() override;
|
||||
explicit TxBroadcastDialog(QWidget *parent, QSharedPointer<AppContext> ctx, const QString &transactionHex = "");
|
||||
~TxBroadcastDialog() override;
|
||||
|
||||
private slots:
|
||||
void broadcastTx();
|
||||
void onApiResponse(const DaemonRpc::DaemonResponse &resp);
|
||||
|
||||
private:
|
||||
QScopedPointer<Ui::BroadcastTxDialog> ui;
|
||||
QScopedPointer<Ui::TxBroadcastDialog> ui;
|
||||
QSharedPointer<AppContext> m_ctx;
|
||||
UtilsNetworking *m_network;
|
||||
DaemonRpc *m_rpc;
|
||||
};
|
||||
|
||||
|
||||
#endif //FEATHER_BROADCASTTXDIALOG_H
|
||||
#endif //FEATHER_TXBROADCASTDIALOG_H
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>BroadcastTxDialog</class>
|
||||
<widget class="QDialog" name="BroadcastTxDialog">
|
||||
<class>TxBroadcastDialog</class>
|
||||
<widget class="QDialog" name="TxBroadcastDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
|
@ -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 <QMessageBox>
|
||||
#include <QScrollBar>
|
||||
|
||||
TransactionInfoDialog::TransactionInfoDialog(QSharedPointer<AppContext> ctx, TransactionInfo *txInfo, QWidget *parent)
|
||||
TxInfoDialog::TxInfoDialog(QSharedPointer<AppContext> 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<AppContext> 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<AppContext> 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;
|
||||
TxInfoDialog::~TxInfoDialog() = default;
|
|
@ -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 <QDialog>
|
||||
#include <QTextCharFormat>
|
||||
|
@ -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<AppContext> ctx, TransactionInfo *txInfo, QWidget *parent = nullptr);
|
||||
~TransactionInfoDialog() override;
|
||||
explicit TxInfoDialog(QSharedPointer<AppContext> 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::TransactionInfoDialog> ui;
|
||||
QScopedPointer<Ui::TxInfoDialog> ui;
|
||||
|
||||
QSharedPointer<AppContext> m_ctx;
|
||||
TransactionInfo *m_txInfo;
|
||||
|
@ -41,4 +41,4 @@ private:
|
|||
QTimer m_updateTimer;
|
||||
};
|
||||
|
||||
#endif //FEATHER_TRANSACTIONINFODIALOG_H
|
||||
#endif //FEATHER_TXINFODIALOG_H
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>TransactionInfoDialog</class>
|
||||
<widget class="QWidget" name="TransactionInfoDialog">
|
||||
<class>TxInfoDialog</class>
|
||||
<widget class="QWidget" name="TxInfoDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
|
@ -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();
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue