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/unknownBlack.png</file>
<file>res/unknownWhite.png</file> <file>res/unknownWhite.png</file>
<file>res/dark-01.png</file> <file>res/dark-01.png</file>
<file>res/money-mouth.png</file>
<file>res/money-outgoing.png</file>
</qresource> </qresource>
<qresource prefix="/img"> <qresource prefix="/img">
<file>res/hushdlogo.gif</file> <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; _amt = amt;
} }
QString MainWindow::getMoneyMemo()
{
return _moneymemo;
}
void MainWindow::setMoneyMemo(QString moneymemo)
{
_moneymemo = moneymemo;
}
void MainWindow::setupStatusBar() { void MainWindow::setupStatusBar() {
// Status Bar // Status Bar
loadingLabel = new QLabel(); loadingLabel = new QLabel();
@ -1513,6 +1525,9 @@ void MainWindow::setupchatTab() {
QDialog transactionDialog(this); QDialog transactionDialog(this);
transaction.setupUi(&transactionDialog); transaction.setupUi(&transactionDialog);
Settings::saveRestore(&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->setUniformItemSizes(true);
transaction.contactName->setDragDropMode(QAbstractItemView::DropOnly); transaction.contactName->setDragDropMode(QAbstractItemView::DropOnly);
transaction.contactName->show(); transaction.contactName->show();
} }
QObject::connect(transaction.sendHush, &QPushButton::clicked, [&] (){ QObject::connect(transaction.sendHush, &QPushButton::clicked, [&] (){
QString amt = transaction.amountChat->text(); QString amt = transaction.amountChat->text();
this->setAmt(amt); QString memo = transaction.MemoMoney->text();
this->setAmt(amt);
this->setMoneyMemo(memo);
transactionDialog.close(); transactionDialog.close();
}); });
@ -1599,9 +1618,10 @@ Tx MainWindow::createTxFromSendChatPage() {
QString myAddr = c.getMyAddress(); QString myAddr = c.getMyAddress();
QString type = "Money"; QString type = "Money";
QString addr = c.getPartnerAddress(); QString addr = c.getPartnerAddress();
QString moneymemo = this->getMoneyMemo();
/////////User input for chatmemos /////////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 /////////We convert the user input from QString to unsigned char*, so we can encrypt it later
int lengthmemo = memoplain.length(); int lengthmemo = memoplain.length();

3
src/mainwindow.h

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

144
src/sendHushTransactionChat.ui

@ -6,48 +6,22 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>530</width> <width>216</width>
<height>377</height> <height>384</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
<string>Dialog</string> <string>Send or Request Hush</string>
</property> </property>
<layout class="QGridLayout" name="gridLayout_2"> <layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0"> <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"> <widget class="QLabel" name="label_2">
<property name="text"> <property name="text">
<string>To :</string> <string>To :</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="2"> <item row="1" column="0" colspan="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">
<layout class="QHBoxLayout" name="horizontalLayout"> <layout class="QHBoxLayout" name="horizontalLayout">
<property name="sizeConstraint"> <property name="sizeConstraint">
<enum>QLayout::SetFixedSize</enum> <enum>QLayout::SetFixedSize</enum>
@ -88,23 +62,31 @@
</item> </item>
</layout> </layout>
</item> </item>
<item row="2" column="1"> <item row="2" column="0" colspan="2">
<spacer name="verticalSpacer"> <layout class="QHBoxLayout" name="horizontalLayout_3">
<property name="orientation"> <property name="sizeConstraint">
<enum>Qt::Vertical</enum> <enum>QLayout::SetFixedSize</enum>
</property> </property>
<property name="sizeHint" stdset="0"> <property name="leftMargin">
<size> <number>6</number>
<width>20</width> </property>
<height>79</height> <property name="topMargin">
</size> <number>6</number>
</property>
<property name="rightMargin">
<number>6</number>
</property>
<property name="bottomMargin">
<number>6</number>
</property> </property>
</spacer>
</item>
<item row="3" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item> <item>
<widget class="QLabel" name="label_6"> <widget class="QLabel" name="label_6">
<property name="maximumSize">
<size>
<width>80</width>
<height>16777215</height>
</size>
</property>
<property name="text"> <property name="text">
<string>Amount: </string> <string>Amount: </string>
</property> </property>
@ -112,12 +94,21 @@
</item> </item>
<item> <item>
<widget class="QLineEdit" name="amountChat"> <widget class="QLineEdit" name="amountChat">
<property name="maximumSize">
<size>
<width>80</width>
<height>16777215</height>
</size>
</property>
<property name="baseSize"> <property name="baseSize">
<size> <size>
<width>200</width> <width>200</width>
<height>0</height> <height>0</height>
</size> </size>
</property> </property>
<property name="maxLength">
<number>9</number>
</property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property> </property>
@ -126,9 +117,61 @@
</property> </property>
</widget> </widget>
</item> </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> </layout>
</item> </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"> <spacer name="verticalSpacer_2">
<property name="orientation"> <property name="orientation">
<enum>Qt::Vertical</enum> <enum>Qt::Vertical</enum>
@ -136,12 +179,12 @@
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
<width>20</width> <width>20</width>
<height>64</height> <height>39</height>
</size> </size>
</property> </property>
</spacer> </spacer>
</item> </item>
<item row="5" column="0"> <item row="6" column="0" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout_2"> <layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="sizeConstraint"> <property name="sizeConstraint">
<enum>QLayout::SetFixedSize</enum> <enum>QLayout::SetFixedSize</enum>
@ -180,7 +223,7 @@
</item> </item>
</layout> </layout>
</item> </item>
<item row="6" column="0"> <item row="7" column="1">
<widget class="QDialogButtonBox" name="buttonBox"> <widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
@ -190,13 +233,6 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="3" column="1">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Hush</string>
</property>
</widget>
</item>
</layout> </layout>
</widget> </widget>
<resources/> <resources/>

Loading…
Cancel
Save