Browse Source

add funds button #104

pull/130/head
DenioD 4 years ago
parent
commit
2b907a20d4
  1. 2
      silentdragon-lite.pro
  2. 100
      src/deposithush.ui
  3. 31
      src/mainwindow.cpp
  4. 31
      src/mainwindow.ui

2
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

100
src/deposithush.ui

@ -1,29 +1,66 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<author></author>
<comment></comment>
<exportmacro></exportmacro>
<class>Dialog</class>
<widget class="QDialog" name="Dialog" >
<class>deposithush</class>
<widget class="QDialog" name="deposithush">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
<width>792</width>
<height>650</height>
</rect>
</property>
<property name="windowTitle">
<string>Dialog</string>
<string>Deposit Hush</string>
</property>
<widget class="QDialogButtonBox" name="buttonBox" >
<property name="geometry" >
<rect>
<x>30</x>
<y>240</y>
<width>341</width>
<height>32</height>
</rect>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0" colspan="2">
<widget class="QTextBrowser" name="textBrowser">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>71</height>
</size>
</property>
<property name="html">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Ubuntu'; font-size:11pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Ubuntu'; font-size:16pt;&quot;&gt;Please use the following hush address to transfer funds to SilentDragonLite. You can either copy the address or use the QR Code. &lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item row="1" column="0" colspan="2">
<widget class="QLabel" name="label">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;QR Code of your Hush Address&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item row="3" column="0" colspan="2">
<widget class="QLabel" name="label_2">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; text-decoration: underline;&quot;&gt;Your Hush Address &lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item row="4" column="0" colspan="2">
<widget class="QLabel" name="zaddr">
<property name="text">
<string>Hush zaddr</string>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QPushButton" name="CopyAddress">
<property name="text">
<string>Copy Address</string>
</property>
</widget>
</item>
<item row="6" column="1">
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
@ -31,14 +68,38 @@
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
<item row="2" column="0" colspan="2">
<widget class="QRCodeLabel" name="qrcodeDisplayDeposit">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="styleSheet">
<string notr="true">background-color: #fff</string>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
</layout>
</widget>
<pixmapfunction></pixmapfunction>
<customwidgets>
<customwidget>
<class>QRCodeLabel</class>
<extends>QLabel</extends>
<header>qrcodelabel.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>Dialog</receiver>
<receiver>deposithush</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
@ -54,7 +115,7 @@
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>Dialog</receiver>
<receiver>deposithush</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
@ -69,4 +130,3 @@
</connection>
</connections>
</ui>

31
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<QString> 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);

31
src/mainwindow.ui

@ -59,7 +59,7 @@
<item row="0" column="0" colspan="2">
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>5</number>
<number>2</number>
</property>
<widget class="QWidget" name="tab">
<attribute name="title">
@ -84,8 +84,6 @@
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="label">
@ -112,7 +110,7 @@
</item>
</layout>
</item>
<item>
<item row="1" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_17">
<item>
<widget class="QLabel" name="label_15">
@ -139,7 +137,7 @@
</item>
</layout>
</item>
<item>
<item row="2" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="label_2">
@ -166,14 +164,14 @@
</item>
</layout>
</item>
<item>
<item row="3" column="0">
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<item row="4" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QLabel" name="label_3">
@ -212,7 +210,7 @@
</item>
</layout>
</item>
<item>
<item row="5" column="0">
<widget class="QLabel" name="lblSyncWarning">
<property name="styleSheet">
<string notr="true">color:red;</string>
@ -225,7 +223,7 @@
</property>
</widget>
</item>
<item>
<item row="6" column="0">
<widget class="QLabel" name="unconfirmedWarning">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
@ -244,7 +242,14 @@
</property>
</widget>
</item>
<item>
<item row="7" column="0">
<widget class="QPushButton" name="depositHushButton">
<property name="text">
<string>Deposit Hush</string>
</property>
</widget>
</item>
<item row="8" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
@ -252,14 +257,12 @@
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
<height>383</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item>
@ -1627,7 +1630,7 @@
<bool>false</bool>
</property>
<property name="dragDropMode">
<enum>QAbstractItemView::NoDragDrop</enum>
<enum>QAbstractItemView::DragOnly</enum>
</property>
<property name="defaultDropAction">
<enum>Qt::IgnoreAction</enum>

Loading…
Cancel
Save