mirror of
https://github.com/feather-wallet/feather.git
synced 2025-01-24 03:25:51 +00:00
non-static mainwindow
This commit is contained in:
parent
b9995c44ec
commit
cc01924858
14 changed files with 82 additions and 92 deletions
|
@ -11,14 +11,14 @@
|
||||||
#include <QClipboard>
|
#include <QClipboard>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
|
|
||||||
CoinsWidget::CoinsWidget(QWidget *parent)
|
CoinsWidget::CoinsWidget(AppContext *ctx, QWidget *parent)
|
||||||
: QWidget(parent)
|
: QWidget(parent)
|
||||||
, ui(new Ui::CoinsWidget)
|
, ui(new Ui::CoinsWidget)
|
||||||
|
, m_ctx(ctx)
|
||||||
, m_headerMenu(new QMenu(this))
|
, m_headerMenu(new QMenu(this))
|
||||||
, m_copyMenu(new QMenu("Copy",this))
|
, m_copyMenu(new QMenu("Copy",this))
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
m_ctx = MainWindow::getContext();
|
|
||||||
|
|
||||||
// header context menu
|
// header context menu
|
||||||
ui->coins->header()->setContextMenuPolicy(Qt::CustomContextMenu);
|
ui->coins->header()->setContextMenuPolicy(Qt::CustomContextMenu);
|
||||||
|
|
|
@ -22,7 +22,7 @@ class CoinsWidget : public QWidget
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit CoinsWidget(QWidget *parent = nullptr);
|
explicit CoinsWidget(AppContext *ctx, QWidget *parent = nullptr);
|
||||||
void setModel(CoinsModel * model, Coins * coins);
|
void setModel(CoinsModel * model, Coins * coins);
|
||||||
~CoinsWidget() override;
|
~CoinsWidget() override;
|
||||||
|
|
||||||
|
@ -54,6 +54,7 @@ private:
|
||||||
};
|
};
|
||||||
|
|
||||||
Ui::CoinsWidget *ui;
|
Ui::CoinsWidget *ui;
|
||||||
|
AppContext *m_ctx;
|
||||||
|
|
||||||
QMenu *m_contextMenu;
|
QMenu *m_contextMenu;
|
||||||
QMenu *m_headerMenu;
|
QMenu *m_headerMenu;
|
||||||
|
@ -68,7 +69,6 @@ private:
|
||||||
Coins *m_coins;
|
Coins *m_coins;
|
||||||
CoinsModel * m_model;
|
CoinsModel * m_model;
|
||||||
CoinsProxyModel * m_proxyModel;
|
CoinsProxyModel * m_proxyModel;
|
||||||
AppContext *m_ctx;
|
|
||||||
|
|
||||||
void showContextMenu(const QPoint & point);
|
void showContextMenu(const QPoint & point);
|
||||||
void copy(copyField field);
|
void copy(copyField field);
|
||||||
|
|
|
@ -11,12 +11,11 @@
|
||||||
|
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
|
|
||||||
ContactsWidget::ContactsWidget(QWidget *parent) :
|
ContactsWidget::ContactsWidget(QWidget *parent)
|
||||||
QWidget(parent),
|
: QWidget(parent)
|
||||||
ui(new Ui::ContactsWidget)
|
, ui(new Ui::ContactsWidget)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
m_ctx = MainWindow::getContext();
|
|
||||||
|
|
||||||
// header context menu
|
// header context menu
|
||||||
ui->contacts->header()->setContextMenuPolicy(Qt::CustomContextMenu);
|
ui->contacts->header()->setContextMenuPolicy(Qt::CustomContextMenu);
|
||||||
|
@ -69,9 +68,10 @@ void ContactsWidget::payTo() {
|
||||||
emit fillAddress(address);
|
emit fillAddress(address);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ContactsWidget::setModel(AddressBookModel *model)
|
void ContactsWidget::setModel(AddressBookModel *model, Wallet *wallet)
|
||||||
{
|
{
|
||||||
m_model = model;
|
m_model = model;
|
||||||
|
m_wallet = wallet;
|
||||||
m_proxyModel = new AddressBookProxyModel;
|
m_proxyModel = new AddressBookProxyModel;
|
||||||
m_proxyModel->setSourceModel(m_model);
|
m_proxyModel->setSourceModel(m_model);
|
||||||
ui->contacts->setModel(m_proxyModel);
|
ui->contacts->setModel(m_proxyModel);
|
||||||
|
@ -104,24 +104,31 @@ void ContactsWidget::showHeaderMenu(const QPoint& position)
|
||||||
|
|
||||||
void ContactsWidget::newContact(QString address, QString name)
|
void ContactsWidget::newContact(QString address, QString name)
|
||||||
{
|
{
|
||||||
auto * dialog = new ContactsDialog(this, address, name);
|
if (!m_wallet) {
|
||||||
int ret = dialog->exec();
|
QMessageBox::warning(this, "Error", "No wallet opened.");
|
||||||
if (!ret) return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
address = dialog->getAddress();
|
ContactsDialog dialog{this, address, name};
|
||||||
name = dialog->getName();
|
int ret = dialog.exec();
|
||||||
|
if (ret != QDialog::Accepted) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
bool addressValid = WalletManager::addressValid(address, m_ctx->currentWallet->nettype());
|
address = dialog.getAddress();
|
||||||
|
name = dialog.getName();
|
||||||
|
|
||||||
|
bool addressValid = WalletManager::addressValid(address, m_wallet->nettype());
|
||||||
if (!addressValid) {
|
if (!addressValid) {
|
||||||
QMessageBox::warning(this, "Invalid address", "Invalid address");
|
QMessageBox::warning(this, "Invalid address", "Invalid address");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int num_addresses = m_ctx->currentWallet->addressBook()->count();
|
int num_addresses = m_wallet->addressBook()->count();
|
||||||
QString address_entry;
|
QString address_entry;
|
||||||
QString name_entry;
|
QString name_entry;
|
||||||
for (int i=0; i<num_addresses; i++) {
|
for (int i=0; i<num_addresses; i++) {
|
||||||
m_ctx->currentWallet->addressBook()->getRow(i, [&address_entry, &name_entry](const AddressBookInfo &entry){
|
m_wallet->addressBook()->getRow(i, [&address_entry, &name_entry](const AddressBookInfo &entry){
|
||||||
address_entry = entry.address();
|
address_entry = entry.address();
|
||||||
name_entry = entry.description();
|
name_entry = entry.description();
|
||||||
});
|
});
|
||||||
|
@ -138,7 +145,7 @@ void ContactsWidget::newContact(QString address, QString name)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
m_ctx->currentWallet->addressBook()->addRow(address, "", name);
|
m_wallet->addressBook()->addRow(address, "", name);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ContactsWidget::deleteContact()
|
void ContactsWidget::deleteContact()
|
||||||
|
|
|
@ -21,7 +21,7 @@ class ContactsWidget : public QWidget
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit ContactsWidget(QWidget *parent = nullptr);
|
explicit ContactsWidget(QWidget *parent = nullptr);
|
||||||
void setModel(AddressBookModel * model);
|
void setModel(AddressBookModel *model, Wallet *wallet);
|
||||||
~ContactsWidget() override;
|
~ContactsWidget() override;
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
|
@ -42,7 +42,6 @@ private slots:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::ContactsWidget *ui;
|
Ui::ContactsWidget *ui;
|
||||||
AppContext *m_ctx;
|
|
||||||
|
|
||||||
QAction *m_showFullAddressesAction;
|
QAction *m_showFullAddressesAction;
|
||||||
QMenu *m_rowMenu;
|
QMenu *m_rowMenu;
|
||||||
|
@ -50,6 +49,7 @@ private:
|
||||||
QMenu *m_headerMenu;
|
QMenu *m_headerMenu;
|
||||||
AddressBookModel * m_model;
|
AddressBookModel * m_model;
|
||||||
AddressBookProxyModel * m_proxyModel;
|
AddressBookProxyModel * m_proxyModel;
|
||||||
|
Wallet *m_wallet;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // CONTACTSWIDGET_H
|
#endif // CONTACTSWIDGET_H
|
||||||
|
|
|
@ -5,7 +5,9 @@
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
|
||||||
Subaddress::Subaddress(Monero::Subaddress *subaddressImpl, QObject *parent)
|
Subaddress::Subaddress(Monero::Subaddress *subaddressImpl, QObject *parent)
|
||||||
: QObject(parent), m_subaddressImpl(subaddressImpl), m_unusedLookahead(0)
|
: QObject(parent)
|
||||||
|
, m_subaddressImpl(subaddressImpl)
|
||||||
|
, m_unusedLookahead(0)
|
||||||
{
|
{
|
||||||
getAll();
|
getAll();
|
||||||
}
|
}
|
||||||
|
|
|
@ -423,7 +423,7 @@ public:
|
||||||
|
|
||||||
// Passphrase entry for hardware wallets
|
// Passphrase entry for hardware wallets
|
||||||
void onPassphraseEntered(const QString &passphrase, bool enter_on_device, bool entry_abort=false);
|
void onPassphraseEntered(const QString &passphrase, bool enter_on_device, bool entry_abort=false);
|
||||||
virtual void onWalletPassphraseNeeded(bool on_device) override;
|
void onWalletPassphraseNeeded(bool on_device) override;
|
||||||
|
|
||||||
quint64 getBytesReceived() const;
|
quint64 getBytesReceived() const;
|
||||||
quint64 getBytesSent() const;
|
quint64 getBytesSent() const;
|
||||||
|
@ -466,7 +466,7 @@ signals:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Wallet(QObject * parent = nullptr);
|
Wallet(QObject * parent = nullptr);
|
||||||
Wallet(Monero::Wallet *w, QObject * parent = 0);
|
Wallet(Monero::Wallet *w, QObject * parent = nullptr);
|
||||||
~Wallet();
|
~Wallet();
|
||||||
|
|
||||||
//! initializes wallet
|
//! initializes wallet
|
||||||
|
|
|
@ -32,17 +32,14 @@
|
||||||
#include "utils/WebsocketNotifier.h"
|
#include "utils/WebsocketNotifier.h"
|
||||||
#include "utils/Updater.h"
|
#include "utils/Updater.h"
|
||||||
|
|
||||||
MainWindow * MainWindow::pMainWindow = nullptr;
|
|
||||||
|
|
||||||
MainWindow::MainWindow(AppContext *ctx, QWidget *parent)
|
MainWindow::MainWindow(AppContext *ctx, QWidget *parent)
|
||||||
: QMainWindow(parent)
|
: QMainWindow(parent)
|
||||||
, ui(new Ui::MainWindow)
|
, ui(new Ui::MainWindow)
|
||||||
, m_ctx(ctx)
|
, m_ctx(ctx)
|
||||||
{
|
{
|
||||||
pMainWindow = this;
|
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
m_windowSettings = new Settings(this);
|
m_windowSettings = new Settings(m_ctx, this);
|
||||||
m_windowCalc = new CalcWindow(this);
|
m_windowCalc = new CalcWindow(this);
|
||||||
m_splashDialog = new SplashDialog(this);
|
m_splashDialog = new SplashDialog(this);
|
||||||
|
|
||||||
|
@ -71,7 +68,7 @@ MainWindow::MainWindow(AppContext *ctx, QWidget *parent)
|
||||||
connect(m_windowSettings, &Settings::preferredFiatCurrencyChanged, tickerWidget, &TickerWidget::init);
|
connect(m_windowSettings, &Settings::preferredFiatCurrencyChanged, tickerWidget, &TickerWidget::init);
|
||||||
connect(m_windowSettings, &Settings::preferredFiatCurrencyChanged, m_balanceWidget, &TickerWidget::init);
|
connect(m_windowSettings, &Settings::preferredFiatCurrencyChanged, m_balanceWidget, &TickerWidget::init);
|
||||||
connect(m_windowSettings, &Settings::preferredFiatCurrencyChanged, m_ctx, &AppContext::onPreferredFiatCurrencyChanged);
|
connect(m_windowSettings, &Settings::preferredFiatCurrencyChanged, m_ctx, &AppContext::onPreferredFiatCurrencyChanged);
|
||||||
connect(m_windowSettings, &Settings::preferredFiatCurrencyChanged, ui->sendWidget, QOverload<>::of(&SendWidget::onPreferredFiatCurrencyChanged));
|
connect(m_windowSettings, &Settings::preferredFiatCurrencyChanged, m_sendWidget, QOverload<>::of(&SendWidget::onPreferredFiatCurrencyChanged));
|
||||||
connect(m_windowSettings, &Settings::amountPrecisionChanged, m_ctx, &AppContext::onAmountPrecisionChanged);
|
connect(m_windowSettings, &Settings::amountPrecisionChanged, m_ctx, &AppContext::onAmountPrecisionChanged);
|
||||||
connect(m_windowSettings, &Settings::skinChanged, this, &MainWindow::skinChanged);
|
connect(m_windowSettings, &Settings::skinChanged, this, &MainWindow::skinChanged);
|
||||||
|
|
||||||
|
@ -192,13 +189,20 @@ void MainWindow::initWidgets() {
|
||||||
connect(ui->historyWidget, &HistoryWidget::viewOnBlockExplorer, this, &MainWindow::onViewOnBlockExplorer);
|
connect(ui->historyWidget, &HistoryWidget::viewOnBlockExplorer, this, &MainWindow::onViewOnBlockExplorer);
|
||||||
connect(ui->historyWidget, &HistoryWidget::resendTransaction, this, &MainWindow::onResendTransaction);
|
connect(ui->historyWidget, &HistoryWidget::resendTransaction, this, &MainWindow::onResendTransaction);
|
||||||
|
|
||||||
|
// [Send]
|
||||||
|
m_sendWidget = new SendWidget(m_ctx, this);
|
||||||
|
ui->sendWidgetLayout->addWidget(m_sendWidget);
|
||||||
|
|
||||||
// [Receive]
|
// [Receive]
|
||||||
connect(ui->receiveWidget, &ReceiveWidget::showTransactions, [this](const QString &text) {
|
connect(ui->receiveWidget, &ReceiveWidget::showTransactions, [this](const QString &text) {
|
||||||
ui->historyWidget->setSearchText(text);
|
ui->historyWidget->setSearchText(text);
|
||||||
ui->tabWidget->setCurrentIndex(Tabs::HISTORY);
|
ui->tabWidget->setCurrentIndex(Tabs::HISTORY);
|
||||||
});
|
});
|
||||||
connect(ui->contactWidget, &ContactsWidget::fillAddress, ui->sendWidget, &SendWidget::fillAddress);
|
connect(ui->contactWidget, &ContactsWidget::fillAddress, m_sendWidget, &SendWidget::fillAddress);
|
||||||
|
|
||||||
|
// [Coins]
|
||||||
|
m_coinsWidget = new CoinsWidget(m_ctx, this);
|
||||||
|
ui->coinsWidgetLayout->addWidget(m_coinsWidget);
|
||||||
|
|
||||||
#ifdef HAS_LOCALMONERO
|
#ifdef HAS_LOCALMONERO
|
||||||
m_localMoneroWidget = new LocalMoneroWidget(this, m_ctx);
|
m_localMoneroWidget = new LocalMoneroWidget(this, m_ctx);
|
||||||
|
@ -618,11 +622,11 @@ void MainWindow::onWalletOpened() {
|
||||||
ui->historyWidget->setModel(m_ctx->currentWallet->historyModel(), m_ctx->currentWallet);
|
ui->historyWidget->setModel(m_ctx->currentWallet->historyModel(), m_ctx->currentWallet);
|
||||||
|
|
||||||
// contacts widget
|
// contacts widget
|
||||||
ui->contactWidget->setModel(m_ctx->currentWallet->addressBookModel());
|
ui->contactWidget->setModel(m_ctx->currentWallet->addressBookModel(), m_ctx->currentWallet);
|
||||||
|
|
||||||
// coins page
|
// coins page
|
||||||
m_ctx->currentWallet->coins()->refresh(m_ctx->currentWallet->currentSubaddressAccount());
|
m_ctx->currentWallet->coins()->refresh(m_ctx->currentWallet->currentSubaddressAccount());
|
||||||
ui->coinsWidget->setModel(m_ctx->currentWallet->coinsModel(), m_ctx->currentWallet->coins());
|
m_coinsWidget->setModel(m_ctx->currentWallet->coinsModel(), m_ctx->currentWallet->coins());
|
||||||
|
|
||||||
this->touchbarShowWallet();
|
this->touchbarShowWallet();
|
||||||
this->updatePasswordIcon();
|
this->updatePasswordIcon();
|
||||||
|
@ -784,7 +788,7 @@ void MainWindow::onTransactionCommitted(bool status, PendingTransaction *tx, con
|
||||||
if (status) { // success
|
if (status) { // success
|
||||||
QString body = QString("Successfully sent %1 transaction(s).").arg(txid.count());
|
QString body = QString("Successfully sent %1 transaction(s).").arg(txid.count());
|
||||||
QMessageBox::information(this, "Transactions sent", body);
|
QMessageBox::information(this, "Transactions sent", body);
|
||||||
ui->sendWidget->clearFields();
|
m_sendWidget->clearFields();
|
||||||
} else {
|
} else {
|
||||||
auto err = tx->errorString();
|
auto err = tx->errorString();
|
||||||
QString body = QString("Error committing transaction: %1").arg(err);
|
QString body = QString("Error committing transaction: %1").arg(err);
|
||||||
|
@ -994,7 +998,7 @@ void MainWindow::donateButtonClicked() {
|
||||||
if (donation <= 0)
|
if (donation <= 0)
|
||||||
donation = 0.1337;
|
donation = 0.1337;
|
||||||
|
|
||||||
ui->sendWidget->fill(globals::donationAddress, "Donation to the Feather development team", donation);
|
m_sendWidget->fill(globals::donationAddress, "Donation to the Feather development team", donation);
|
||||||
ui->tabWidget->setCurrentIndex(Tabs::SEND);
|
ui->tabWidget->setCurrentIndex(Tabs::SEND);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1014,7 +1018,7 @@ void MainWindow::showCalcWindow() {
|
||||||
|
|
||||||
void MainWindow::payToMany() {
|
void MainWindow::payToMany() {
|
||||||
ui->tabWidget->setCurrentIndex(Tabs::SEND);
|
ui->tabWidget->setCurrentIndex(Tabs::SEND);
|
||||||
ui->sendWidget->payToMany();
|
m_sendWidget->payToMany();
|
||||||
QMessageBox::information(this, "Pay to many", "Enter a list of outputs in the 'Pay to' field.\n"
|
QMessageBox::information(this, "Pay to many", "Enter a list of outputs in the 'Pay to' field.\n"
|
||||||
"One output per line.\n"
|
"One output per line.\n"
|
||||||
"Format: address, amount\n"
|
"Format: address, amount\n"
|
||||||
|
@ -1022,7 +1026,7 @@ void MainWindow::payToMany() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::showSendScreen(const CCSEntry &entry) {
|
void MainWindow::showSendScreen(const CCSEntry &entry) {
|
||||||
ui->sendWidget->fill(entry);
|
m_sendWidget->fill(entry);
|
||||||
ui->tabWidget->setCurrentIndex(Tabs::SEND);
|
ui->tabWidget->setCurrentIndex(Tabs::SEND);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1064,14 +1068,6 @@ void MainWindow::importContacts() {
|
||||||
QMessageBox::information(this, "Contacts imported", QString("Total contacts imported: %1").arg(inserts));
|
QMessageBox::information(this, "Contacts imported", QString("Total contacts imported: %1").arg(inserts));
|
||||||
}
|
}
|
||||||
|
|
||||||
MainWindow *MainWindow::getInstance() {
|
|
||||||
return pMainWindow;
|
|
||||||
}
|
|
||||||
|
|
||||||
AppContext *MainWindow::getContext(){
|
|
||||||
return pMainWindow->m_ctx;
|
|
||||||
}
|
|
||||||
|
|
||||||
QString MainWindow::loadStylesheet(const QString &resource) {
|
QString MainWindow::loadStylesheet(const QString &resource) {
|
||||||
QFile f(resource);
|
QFile f(resource);
|
||||||
if (!f.exists()) {
|
if (!f.exists()) {
|
||||||
|
@ -1481,7 +1477,7 @@ void MainWindow::onWalletAboutToClose() {
|
||||||
ui->historyWidget->resetModel();
|
ui->historyWidget->resetModel();
|
||||||
ui->contactWidget->resetModel();
|
ui->contactWidget->resetModel();
|
||||||
ui->receiveWidget->resetModel();
|
ui->receiveWidget->resetModel();
|
||||||
ui->coinsWidget->resetModel();
|
m_coinsWidget->resetModel();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::onExportHistoryCSV(bool checked) {
|
void MainWindow::onExportHistoryCSV(bool checked) {
|
||||||
|
|
|
@ -36,6 +36,9 @@
|
||||||
#include "widgets/tickerwidget.h"
|
#include "widgets/tickerwidget.h"
|
||||||
#include "wizard/WalletWizard.h"
|
#include "wizard/WalletWizard.h"
|
||||||
|
|
||||||
|
#include "sendwidget.h"
|
||||||
|
#include "coinswidget.h"
|
||||||
|
|
||||||
#ifdef HAS_LOCALMONERO
|
#ifdef HAS_LOCALMONERO
|
||||||
#include "widgets/LocalMoneroWidget.h"
|
#include "widgets/LocalMoneroWidget.h"
|
||||||
#endif
|
#endif
|
||||||
|
@ -68,8 +71,6 @@ Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit MainWindow(AppContext *ctx, QWidget *parent = nullptr);
|
explicit MainWindow(AppContext *ctx, QWidget *parent = nullptr);
|
||||||
static MainWindow *getInstance();
|
|
||||||
static AppContext *getContext();
|
|
||||||
~MainWindow() override;
|
~MainWindow() override;
|
||||||
|
|
||||||
enum Tabs {
|
enum Tabs {
|
||||||
|
@ -181,7 +182,6 @@ private:
|
||||||
void startupWarning();
|
void startupWarning();
|
||||||
bool autoOpenWallet();
|
bool autoOpenWallet();
|
||||||
|
|
||||||
static MainWindow * pMainWindow;
|
|
||||||
void closeEvent(QCloseEvent *event) override;
|
void closeEvent(QCloseEvent *event) override;
|
||||||
void cleanupBeforeClose();
|
void cleanupBeforeClose();
|
||||||
QString loadStylesheet(const QString &resource);
|
QString loadStylesheet(const QString &resource);
|
||||||
|
@ -216,6 +216,8 @@ private:
|
||||||
XMRigWidget *m_xmrig = nullptr;
|
XMRigWidget *m_xmrig = nullptr;
|
||||||
SplashDialog *m_splashDialog = nullptr;
|
SplashDialog *m_splashDialog = nullptr;
|
||||||
|
|
||||||
|
SendWidget *m_sendWidget = nullptr;
|
||||||
|
CoinsWidget *m_coinsWidget = nullptr;
|
||||||
#ifdef HAS_LOCALMONERO
|
#ifdef HAS_LOCALMONERO
|
||||||
LocalMoneroWidget *m_localMoneroWidget = nullptr;
|
LocalMoneroWidget *m_localMoneroWidget = nullptr;
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -188,29 +188,11 @@
|
||||||
<number>11</number>
|
<number>11</number>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<widget class="SendWidget" name="sendWidget" native="true">
|
<layout class="QVBoxLayout" name="sendWidgetLayout">
|
||||||
<property name="sizePolicy">
|
<property name="spacing">
|
||||||
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
|
<number>0</number>
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
</property>
|
||||||
<property name="minimumSize">
|
</layout>
|
||||||
<size>
|
|
||||||
<width>0</width>
|
|
||||||
<height>100</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="maximumSize">
|
|
||||||
<size>
|
|
||||||
<width>16777215</width>
|
|
||||||
<height>16777215</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="styleSheet">
|
|
||||||
<string notr="true"/>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="Line" name="line_3">
|
<widget class="Line" name="line_3">
|
||||||
|
@ -226,7 +208,14 @@
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="ContactsWidget" name="contactWidget" native="true"/>
|
<widget class="ContactsWidget" name="contactWidget" native="true">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
|
@ -254,7 +243,7 @@
|
||||||
</attribute>
|
</attribute>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||||
<item>
|
<item>
|
||||||
<widget class="CoinsWidget" name="coinsWidget" native="true"/>
|
<layout class="QVBoxLayout" name="coinsWidgetLayout"/>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
|
@ -735,12 +724,6 @@
|
||||||
</widget>
|
</widget>
|
||||||
<layoutdefault spacing="6" margin="11"/>
|
<layoutdefault spacing="6" margin="11"/>
|
||||||
<customwidgets>
|
<customwidgets>
|
||||||
<customwidget>
|
|
||||||
<class>SendWidget</class>
|
|
||||||
<extends>QWidget</extends>
|
|
||||||
<header>sendwidget.h</header>
|
|
||||||
<container>1</container>
|
|
||||||
</customwidget>
|
|
||||||
<customwidget>
|
<customwidget>
|
||||||
<class>ContactsWidget</class>
|
<class>ContactsWidget</class>
|
||||||
<extends>QWidget</extends>
|
<extends>QWidget</extends>
|
||||||
|
@ -753,12 +736,6 @@
|
||||||
<header>receivewidget.h</header>
|
<header>receivewidget.h</header>
|
||||||
<container>1</container>
|
<container>1</container>
|
||||||
</customwidget>
|
</customwidget>
|
||||||
<customwidget>
|
|
||||||
<class>CoinsWidget</class>
|
|
||||||
<extends>QWidget</extends>
|
|
||||||
<header>coinswidget.h</header>
|
|
||||||
<container>1</container>
|
|
||||||
</customwidget>
|
|
||||||
<customwidget>
|
<customwidget>
|
||||||
<class>HistoryWidget</class>
|
<class>HistoryWidget</class>
|
||||||
<extends>QWidget</extends>
|
<extends>QWidget</extends>
|
||||||
|
|
|
@ -8,12 +8,12 @@
|
||||||
#include "globals.h"
|
#include "globals.h"
|
||||||
#include "utils/AppData.h"
|
#include "utils/AppData.h"
|
||||||
|
|
||||||
SendWidget::SendWidget(QWidget *parent)
|
SendWidget::SendWidget(AppContext *ctx, QWidget *parent)
|
||||||
: QWidget(parent)
|
: QWidget(parent)
|
||||||
, ui(new Ui::SendWidget)
|
, ui(new Ui::SendWidget)
|
||||||
|
, m_ctx(ctx)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
m_ctx = MainWindow::getContext();
|
|
||||||
|
|
||||||
QString amount_rx = R"(^\d{0,8}[\.,]\d{0,12}|(all)$)";
|
QString amount_rx = R"(^\d{0,8}[\.,]\d{0,12}|(all)$)";
|
||||||
QRegExp rx;
|
QRegExp rx;
|
||||||
|
|
|
@ -17,7 +17,7 @@ class SendWidget : public QWidget
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit SendWidget(QWidget *parent = nullptr);
|
explicit SendWidget(AppContext *ctx, QWidget *parent = nullptr);
|
||||||
void fill(const CCSEntry &entry);
|
void fill(const CCSEntry &entry);
|
||||||
void fill(const QString &address, const QString& description, double amount = 0);
|
void fill(const QString &address, const QString& description, double amount = 0);
|
||||||
void fill(double amount);
|
void fill(double amount);
|
||||||
|
|
|
@ -10,6 +10,12 @@
|
||||||
<height>231</height>
|
<height>231</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>Form</string>
|
<string>Form</string>
|
||||||
</property>
|
</property>
|
||||||
|
|
|
@ -7,12 +7,12 @@
|
||||||
|
|
||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
|
|
||||||
Settings::Settings(QWidget *parent) :
|
Settings::Settings(AppContext *ctx, QWidget *parent)
|
||||||
QDialog(parent),
|
: QDialog(parent)
|
||||||
ui(new Ui::Settings)
|
, ui(new Ui::Settings)
|
||||||
|
, m_ctx(ctx)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
m_ctx = MainWindow::getContext();
|
|
||||||
|
|
||||||
this->setWindowIcon(QIcon("://assets/images/appicons/64x64.png"));
|
this->setWindowIcon(QIcon("://assets/images/appicons/64x64.png"));
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@ class Settings : public QDialog
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit Settings(QWidget *parent = nullptr);
|
explicit Settings(AppContext *ctx, QWidget *parent = nullptr);
|
||||||
~Settings() override;
|
~Settings() override;
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
@ -49,8 +49,8 @@ private:
|
||||||
void setupSkinCombobox();
|
void setupSkinCombobox();
|
||||||
void setupLocalMoneroFrontendCombobox();
|
void setupLocalMoneroFrontendCombobox();
|
||||||
|
|
||||||
AppContext *m_ctx;
|
|
||||||
Ui::Settings *ui;
|
Ui::Settings *ui;
|
||||||
|
AppContext *m_ctx;
|
||||||
|
|
||||||
QStringList m_skins{"Native", "QDarkStyle", "Breeze/Dark", "Breeze/Light"};
|
QStringList m_skins{"Native", "QDarkStyle", "Breeze/Dark", "Breeze/Light"};
|
||||||
QStringList m_dateFormats{"yyyy-MM-dd", "MM-dd-yyyy", "dd-MM-yyyy"};
|
QStringList m_dateFormats{"yyyy-MM-dd", "MM-dd-yyyy", "dd-MM-yyyy"};
|
||||||
|
|
Loading…
Reference in a new issue