mirror of
https://github.com/feather-wallet/feather.git
synced 2025-01-10 21:05:00 +00:00
Merge pull request 'Beta-8 fixes (3)' (#372) from tobtoht/feather:beta-8-fixes-3 into master
Reviewed-on: https://git.featherwallet.org/feather/feather/pulls/372
This commit is contained in:
commit
a88425eb60
7 changed files with 57 additions and 21 deletions
|
@ -24,8 +24,8 @@ ContactsWidget::ContactsWidget(QSharedPointer<AppContext> ctx, QWidget *parent)
|
||||||
ui->contacts->setModel(m_proxyModel);
|
ui->contacts->setModel(m_proxyModel);
|
||||||
|
|
||||||
ui->contacts->setSortingEnabled(true);
|
ui->contacts->setSortingEnabled(true);
|
||||||
ui->contacts->header()->setSectionResizeMode(AddressBookModel::Address, QHeaderView::Stretch);
|
ui->contacts->header()->setSectionResizeMode(AddressBookModel::Address, QHeaderView::ResizeToContents);
|
||||||
ui->contacts->header()->setSectionResizeMode(AddressBookModel::Description, QHeaderView::ResizeToContents);
|
ui->contacts->header()->setSectionResizeMode(AddressBookModel::Description, QHeaderView::Stretch);
|
||||||
ui->contacts->header()->setMinimumSectionSize(200);
|
ui->contacts->header()->setMinimumSectionSize(200);
|
||||||
|
|
||||||
// header context menu
|
// header context menu
|
||||||
|
@ -36,6 +36,12 @@ ContactsWidget::ContactsWidget(QSharedPointer<AppContext> ctx, QWidget *parent)
|
||||||
|
|
||||||
connect(ui->contacts->header(), &QHeaderView::customContextMenuRequested, this, &ContactsWidget::showHeaderMenu);
|
connect(ui->contacts->header(), &QHeaderView::customContextMenuRequested, this, &ContactsWidget::showHeaderMenu);
|
||||||
|
|
||||||
|
connect(ui->contacts, &QTreeView::doubleClicked, [this](QModelIndex index){
|
||||||
|
if (!(m_model->flags(index) & Qt::ItemIsEditable)) {
|
||||||
|
this->payTo();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
// context menu
|
// context menu
|
||||||
ui->contacts->setContextMenuPolicy(Qt::CustomContextMenu);
|
ui->contacts->setContextMenuPolicy(Qt::CustomContextMenu);
|
||||||
m_contextMenu = new QMenu(ui->contacts);
|
m_contextMenu = new QMenu(ui->contacts);
|
||||||
|
@ -45,8 +51,7 @@ ContactsWidget::ContactsWidget(QSharedPointer<AppContext> ctx, QWidget *parent)
|
||||||
|
|
||||||
// row context menu
|
// row context menu
|
||||||
m_rowMenu = new QMenu(ui->contacts);
|
m_rowMenu = new QMenu(ui->contacts);
|
||||||
m_rowMenu->addAction(icons()->icon("copy.png"), "Copy address", this, &ContactsWidget::copyAddress);
|
m_rowMenu->addAction("Copy address", this, &ContactsWidget::copyAddress);
|
||||||
m_rowMenu->addAction(icons()->icon("copy.png"), "Copy name", this, &ContactsWidget::copyName);
|
|
||||||
m_rowMenu->addAction("Pay to", this, &ContactsWidget::payTo);
|
m_rowMenu->addAction("Pay to", this, &ContactsWidget::payTo);
|
||||||
m_rowMenu->addAction("Delete", this, &ContactsWidget::deleteContact);
|
m_rowMenu->addAction("Delete", this, &ContactsWidget::deleteContact);
|
||||||
|
|
||||||
|
|
|
@ -701,6 +701,10 @@ void MainWindow::showSeedDialog() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!this->verifyPassword()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
SeedDialog dialog{m_ctx, this};
|
SeedDialog dialog{m_ctx, this};
|
||||||
dialog.exec();
|
dialog.exec();
|
||||||
}
|
}
|
||||||
|
@ -772,6 +776,10 @@ void MainWindow::showRestoreHeightDialog() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::showKeysDialog() {
|
void MainWindow::showKeysDialog() {
|
||||||
|
if (!this->verifyPassword()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
KeysDialog dialog{m_ctx, this};
|
KeysDialog dialog{m_ctx, this};
|
||||||
dialog.exec();
|
dialog.exec();
|
||||||
}
|
}
|
||||||
|
@ -1557,6 +1565,22 @@ void MainWindow::updateRecentlyOpenedMenu() {
|
||||||
ui->menuRecently_open->addAction(m_clearRecentlyOpenAction);
|
ui->menuRecently_open->addAction(m_clearRecentlyOpenAction);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool MainWindow::verifyPassword() {
|
||||||
|
bool ok;
|
||||||
|
while (true) {
|
||||||
|
QString password = QInputDialog::getText(this, "Enter password", "Please enter your password:", QLineEdit::EchoMode::Password, "", &ok);
|
||||||
|
if (!ok) { // Dialog cancelled
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (password != m_ctx->wallet->getPassword()) {
|
||||||
|
QMessageBox::warning(this, "Error", "Incorrect password");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
void MainWindow::toggleSearchbar(bool visible) {
|
void MainWindow::toggleSearchbar(bool visible) {
|
||||||
config()->set(Config::showSearchbar, visible);
|
config()->set(Config::showSearchbar, visible);
|
||||||
|
|
||||||
|
|
|
@ -212,6 +212,7 @@ private:
|
||||||
void addToRecentlyOpened(const QString &filename);
|
void addToRecentlyOpened(const QString &filename);
|
||||||
void updateRecentlyOpenedMenu();
|
void updateRecentlyOpenedMenu();
|
||||||
void updateWidgetIcons();
|
void updateWidgetIcons();
|
||||||
|
bool verifyPassword();
|
||||||
|
|
||||||
QIcon hardwareDevicePairedIcon();
|
QIcon hardwareDevicePairedIcon();
|
||||||
QIcon hardwareDeviceUnpairedIcon();
|
QIcon hardwareDeviceUnpairedIcon();
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
"node-1.sethsimmons.me:18089",
|
"node-1.sethsimmons.me:18089",
|
||||||
"selsta1.featherwallet.net:18081",
|
"selsta1.featherwallet.net:18081",
|
||||||
"selsta2.featherwallet.net:18081",
|
"selsta2.featherwallet.net:18081",
|
||||||
|
"node.monerooutreach.org:18081",
|
||||||
"xmr-node-eu.cakewallet.com:18081",
|
"xmr-node-eu.cakewallet.com:18081",
|
||||||
"xmr-node-usa-east.cakewallet.com:18081",
|
"xmr-node-usa-east.cakewallet.com:18081",
|
||||||
"canada.node.xmr.pm:18089",
|
"canada.node.xmr.pm:18089",
|
||||||
|
|
|
@ -43,21 +43,21 @@ TxInfoDialog::TxInfoDialog(QSharedPointer<AppContext> ctx, TransactionInfo *txIn
|
||||||
} else {
|
} else {
|
||||||
ui->btn_rebroadcastTx->hide();
|
ui->btn_rebroadcastTx->hide();
|
||||||
}
|
}
|
||||||
|
//
|
||||||
if (txInfo->direction() == TransactionInfo::Direction_Out) {
|
// if (txInfo->direction() == TransactionInfo::Direction_Out) {
|
||||||
// TODO: this will not properly represent coinjoin-like transactions.
|
// // TODO: this will not properly represent coinjoin-like transactions.
|
||||||
QVector<CoinsInfo*> coins = m_ctx->wallet->coins()->coins_from_txid(m_txid);
|
// QVector<CoinsInfo*> coins = m_ctx->wallet->coins()->coins_from_txid(m_txid);
|
||||||
QTextCursor c_i = ui->inputs->textCursor();
|
// QTextCursor c_i = ui->inputs->textCursor();
|
||||||
QString inputs_str;
|
// QString inputs_str;
|
||||||
for (const auto &coin : coins) {
|
// for (const auto &coin : coins) {
|
||||||
inputs_str += QString("%1 %2\n").arg(coin->pubKey(), coin->displayAmount());
|
// inputs_str += QString("%1 %2\n").arg(coin->pubKey(), coin->displayAmount());
|
||||||
}
|
// }
|
||||||
ui->inputs->setText(inputs_str);
|
// ui->inputs->setText(inputs_str);
|
||||||
ui->label_inputs->setText(QString("Inputs (%1)").arg(QString::number(coins.size())));
|
// ui->label_inputs->setText(QString("Inputs (%1)").arg(QString::number(coins.size())));
|
||||||
this->adjustHeight(ui->inputs, coins.size());
|
// this->adjustHeight(ui->inputs, coins.size());
|
||||||
} else {
|
// } else {
|
||||||
ui->frameInputs->hide();
|
ui->frameInputs->hide();
|
||||||
}
|
// }
|
||||||
|
|
||||||
QTextCursor cursor = ui->outputs->textCursor();
|
QTextCursor cursor = ui->outputs->textCursor();
|
||||||
|
|
||||||
|
|
|
@ -16,8 +16,8 @@ class AddressBookModel : public QAbstractTableModel
|
||||||
public:
|
public:
|
||||||
enum ModelColumn
|
enum ModelColumn
|
||||||
{
|
{
|
||||||
Address = 0,
|
Description = 0,
|
||||||
Description,
|
Address,
|
||||||
COUNT
|
COUNT
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -22,10 +22,15 @@ QrCodeScanDialog::QrCodeScanDialog(QWidget *parent)
|
||||||
if (m_cameras.count() < 1) {
|
if (m_cameras.count() < 1) {
|
||||||
QMessageBox::warning(parent, "QR code scanner", "No available cameras found.");
|
QMessageBox::warning(parent, "QR code scanner", "No available cameras found.");
|
||||||
this->close();
|
this->close();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const auto &camera : m_cameras) {
|
for (const auto &camera : m_cameras) {
|
||||||
|
#ifdef Q_OS_WIN
|
||||||
|
ui->combo_camera->addItem(camera.description());
|
||||||
|
#else
|
||||||
ui->combo_camera->addItem(camera.deviceName());
|
ui->combo_camera->addItem(camera.deviceName());
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
connect(ui->combo_camera, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &QrCodeScanDialog::onCameraSwitched);
|
connect(ui->combo_camera, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &QrCodeScanDialog::onCameraSwitched);
|
||||||
|
|
Loading…
Reference in a new issue