From 2b907a20d46599b678b4d80dcce2b48cb1d8f8d6 Mon Sep 17 00:00:00 2001 From: DenioD <41270280+DenioD@users.noreply.github.com> Date: Wed, 10 Jun 2020 21:59:32 +0200 Subject: [PATCH] add funds button #104 --- silentdragon-lite.pro | 2 + src/deposithush.ui | 130 +++++++++++++------ src/mainwindow.cpp | 31 +++++ src/mainwindow.ui | 285 +++++++++++++++++++++--------------------- 4 files changed, 272 insertions(+), 176 deletions(-) diff --git a/silentdragon-lite.pro b/silentdragon-lite.pro index 90b261b..57144f4 100644 --- a/silentdragon-lite.pro +++ b/silentdragon-lite.pro @@ -121,6 +121,7 @@ HEADERS += \ FORMS += \ src/contactrequest.ui \ + src/deposithush.ui \ src/encryption.ui \ src/hushrequest.ui \ src/mainwindow.ui \ @@ -147,6 +148,7 @@ FORMS += \ src/removeencryption.ui \ src/recurringmultiple.ui \ src/chatbubbleme.ui \ + src/deposithush.ui \ src/chatbubblepartner.ui diff --git a/src/deposithush.ui b/src/deposithush.ui index fb923db..6ac7e71 100644 --- a/src/deposithush.ui +++ b/src/deposithush.ui @@ -1,51 +1,112 @@ - - - - - Dialog - - + + + deposithush + + 0 0 - 400 - 300 + 792 + 650 - - Dialog + + Deposit Hush - - - - 30 - 240 - 341 - 32 - - - - Qt::Horizontal - - - QDialogButtonBox::Cancel|QDialogButtonBox::Ok - - + + + + + + 16777215 + 71 + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Ubuntu'; font-size:11pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Ubuntu'; font-size:16pt;">Please use the following hush address to transfer funds to SilentDragonLite. You can either copy the address or use the QR Code. </span></p></body></html> + + + + + + + <html><head/><body><p align="center">QR Code of your Hush Address</p></body></html> + + + + + + + <html><head/><body><p align="center"><span style=" text-decoration: underline;">Your Hush Address </span></p></body></html> + + + + + + + Hush zaddr + + + + + + + Copy Address + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + + 0 + 0 + + + + background-color: #fff + + + + + + + - + + + QRCodeLabel + QLabel +
qrcodelabel.h
+
+
buttonBox accepted() - Dialog + deposithush accept() - + 248 254 - + 157 274 @@ -54,14 +115,14 @@ buttonBox rejected() - Dialog + deposithush reject() - + 316 260 - + 286 274 @@ -69,4 +130,3 @@
- diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 441126e..4f278e7 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -18,6 +18,7 @@ #include "version.h" #include "connection.h" #include "ui_contactrequest.h" +#include "ui_deposithush.h" #include "ui_requestContactDialog.h" #include "chatmodel.h" #include "requestdialog.h" @@ -1158,6 +1159,36 @@ void MainWindow::setupBalancesTab() { ui->unconfirmedWarning->setVisible(false); ui->lblSyncWarning->setVisible(false); ui->lblSyncWarningReceive->setVisible(false); + QObject::connect(ui->depositHushButton, &QPushButton::clicked, [=](){ + + Ui_deposithush deposithush; + QDialog dialog(this); + deposithush.setupUi(&dialog); + Settings::saveRestore(&dialog); + + QList allAddresses; + + allAddresses = getRPC()->getModel()->getAllZAddresses(); + QString depositzaddr = allAddresses[1]; + deposithush.qrcodeDisplayDeposit->setQrcodeString(depositzaddr); + deposithush.zaddr->setText(depositzaddr); + + QObject::connect(deposithush.CopyAddress, &QPushButton::clicked, [=](){ + + QGuiApplication::clipboard()->setText(depositzaddr); + ui->statusBar->showMessage(tr("Copied to clipboard"), 3 * 1000); + + }); + + + + dialog.exec(); + + + + + }); + // Setup context menu on balances tab ui->balancesTable->setContextMenuPolicy(Qt::CustomContextMenu); diff --git a/src/mainwindow.ui b/src/mainwindow.ui index 2fa544c..8471227 100644 --- a/src/mainwindow.ui +++ b/src/mainwindow.ui @@ -59,7 +59,7 @@ - 5 + 2 @@ -84,181 +84,184 @@
- + - - - - - - 0 - 0 - - - - Shielded - - - - - - - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - + + + + 0 + 0 + + + + Shielded + + - - - - - - 0 - 0 - - - - Notarized - - - - - - - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - + + + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + - - - - - - 0 - 0 - - - - Transparent - - - - - - - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - + + + + 0 + 0 + + + + Notarized + + - - - Qt::Horizontal + + + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + - - - - - - 0 - 0 - - - - - 75 - true - - - - Total - - - - - - - - 75 - true - - - - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - + + + + 0 + 0 + + + + Transparent + + - - - color:red; - + - Your node is still syncing, balances may not be updated. + - - true + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + Qt::Horizontal + + + + + - + 0 0 - - color: red; + + + 75 + true + - Some transactions are not yet confirmed. Balances may change. - - - true + Total - - - Qt::Vertical + + + + 75 + true + - - - 20 - 40 - + + - + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + +
+ + + + color:red; + + + Your node is still syncing, balances may not be updated. + + + true + + + + + + + + 0 + 0 + + + + color: red; + + + Some transactions are not yet confirmed. Balances may change. + + + true + + + + + + + Deposit Hush + + + + + + + Qt::Vertical + + + + 20 + 383 + + + + @@ -1627,7 +1630,7 @@ false - QAbstractItemView::NoDragDrop + QAbstractItemView::DragOnly Qt::IgnoreAction