Browse Source

add .desktop

pull/170/head
DenioD 4 years ago
parent
commit
0cc36a6fcd
  1. 2
      application.qrc
  2. BIN
      res/money-mouth.png
  3. BIN
      res/money-outgoing.png
  4. 24
      src/mainwindow.cpp
  5. 3
      src/mainwindow.h
  6. 144
      src/sendHushTransactionChat.ui

2
application.qrc

@ -48,6 +48,8 @@
<file>res/unknownBlack.png</file>
<file>res/unknownWhite.png</file>
<file>res/dark-01.png</file>
<file>res/money-mouth.png</file>
<file>res/money-outgoing.png</file>
</qresource>
<qresource prefix="/img">
<file>res/hushdlogo.gif</file>

BIN
res/money-mouth.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

BIN
res/money-outgoing.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

24
src/mainwindow.cpp

@ -618,6 +618,18 @@ void MainWindow::setAmt(QString amt)
_amt = amt;
}
QString MainWindow::getMoneyMemo()
{
return _moneymemo;
}
void MainWindow::setMoneyMemo(QString moneymemo)
{
_moneymemo = moneymemo;
}
void MainWindow::setupStatusBar() {
// Status Bar
loadingLabel = new QLabel();
@ -1513,6 +1525,9 @@ void MainWindow::setupchatTab() {
QDialog transactionDialog(this);
transaction.setupUi(&transactionDialog);
Settings::saveRestore(&transactionDialog);
transaction.requestHush->setEnabled(false);
transaction.requestHush->setVisible(false);
transaction.amountChat->setValidator(this->getAmountValidator());
@ -1529,12 +1544,16 @@ void MainWindow::setupchatTab() {
transaction.contactName->setUniformItemSizes(true);
transaction.contactName->setDragDropMode(QAbstractItemView::DropOnly);
transaction.contactName->show();
}
QObject::connect(transaction.sendHush, &QPushButton::clicked, [&] (){
QString amt = transaction.amountChat->text();
this->setAmt(amt);
QString memo = transaction.MemoMoney->text();
this->setAmt(amt);
this->setMoneyMemo(memo);
transactionDialog.close();
});
@ -1599,9 +1618,10 @@ Tx MainWindow::createTxFromSendChatPage() {
QString myAddr = c.getMyAddress();
QString type = "Money";
QString addr = c.getPartnerAddress();
QString moneymemo = this->getMoneyMemo();
/////////User input for chatmemos
QString memoplain = QString("You have received/sent ") + amtStr + QString(" HUSH") ;
QString memoplain = QString("Money transaction of : ") + amtStr + QString(" HUSH") + QString("\n") + QString("\n") + moneymemo;
/////////We convert the user input from QString to unsigned char*, so we can encrypt it later
int lengthmemo = memoplain.length();

3
src/mainwindow.h

@ -53,11 +53,13 @@ public:
QString doSendRequestTxValidations(Tx tx);
QString getCid();
QString getAmt();
QString getMoneyMemo();
QString getPassword();
std::map<QString, QString> pubkeyMap;
QString getPubkeyByAddress(QString requestZaddr);
void setPassword(QString Password);
void setAmt(QString Amt);
void setMoneyMemo(QString MoneyMemo);
void addPubkey(QString requestZaddr, QString pubkey);
@ -115,6 +117,7 @@ private:
void closeEventpw(QCloseEvent* event);
QString _password;
QString _amt;
QString _moneymemo;
void setupSendTab();

144
src/sendHushTransactionChat.ui

@ -6,48 +6,22 @@
<rect>
<x>0</x>
<y>0</y>
<width>530</width>
<height>377</height>
<width>216</width>
<height>384</height>
</rect>
</property>
<property name="windowTitle">
<string>Dialog</string>
<string>Send or Request Hush</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>20</height>
</size>
</property>
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Send or Request some Hush&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>To :</string>
</property>
</widget>
</item>
<item row="1" column="2">
<spacer name="verticalSpacer_3">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>65</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="0">
<item row="1" column="0" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="sizeConstraint">
<enum>QLayout::SetFixedSize</enum>
@ -88,23 +62,31 @@
</item>
</layout>
</item>
<item row="2" column="1">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
<item row="2" column="0" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<property name="sizeConstraint">
<enum>QLayout::SetFixedSize</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>79</height>
</size>
<property name="leftMargin">
<number>6</number>
</property>
<property name="topMargin">
<number>6</number>
</property>
<property name="rightMargin">
<number>6</number>
</property>
<property name="bottomMargin">
<number>6</number>
</property>
</spacer>
</item>
<item row="3" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QLabel" name="label_6">
<property name="maximumSize">
<size>
<width>80</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>Amount: </string>
</property>
@ -112,12 +94,21 @@
</item>
<item>
<widget class="QLineEdit" name="amountChat">
<property name="maximumSize">
<size>
<width>80</width>
<height>16777215</height>
</size>
</property>
<property name="baseSize">
<size>
<width>200</width>
<height>0</height>
</size>
</property>
<property name="maxLength">
<number>9</number>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
@ -126,9 +117,61 @@
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_3">
<property name="maximumSize">
<size>
<width>35</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>Hush</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="4" column="1">
<item row="3" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Memo :</string>
</property>
</widget>
</item>
<item row="3" column="1">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="4" column="0" colspan="2">
<widget class="QLineEdit" name="MemoMoney">
<property name="minimumSize">
<size>
<width>0</width>
<height>41</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>41</height>
</size>
</property>
<property name="maxLength">
<number>100</number>
</property>
</widget>
</item>
<item row="5" column="1">
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
@ -136,12 +179,12 @@
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>64</height>
<height>39</height>
</size>
</property>
</spacer>
</item>
<item row="5" column="0">
<item row="6" column="0" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="sizeConstraint">
<enum>QLayout::SetFixedSize</enum>
@ -180,7 +223,7 @@
</item>
</layout>
</item>
<item row="6" column="0">
<item row="7" column="1">
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
@ -190,13 +233,6 @@
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Hush</string>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>

Loading…
Cancel
Save