add a new button to send contact request, some ui tweaks
This commit is contained in:
@@ -32,6 +32,10 @@
|
|||||||
<file>res/send-new-white.png</file>
|
<file>res/send-new-white.png</file>
|
||||||
<file>res/add_contact.png</file>
|
<file>res/add_contact.png</file>
|
||||||
<file>res/notification.png</file>
|
<file>res/notification.png</file>
|
||||||
|
<file>res/rahmen-message.png</file>
|
||||||
|
<file>res/upload.png</file>
|
||||||
|
<file>res/upload.svg</file>
|
||||||
|
<file>res/message-icon.svg</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
<qresource prefix="/img">
|
<qresource prefix="/img">
|
||||||
<file>res/hushdlogo.gif</file>
|
<file>res/hushdlogo.gif</file>
|
||||||
|
|||||||
9
res/message-icon.svg
Normal file
9
res/message-icon.svg
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||||
|
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||||
|
viewBox="0 0 512 512" style="enable-background:new 0 0 512 512;" xml:space="preserve">
|
||||||
|
<g id="XMLID_1_">
|
||||||
|
<polygon id="XMLID_3_" points="256,371.5 256,379 512,379 512,27.4 0,27.4 0,379 136.3,379 136.3,484.6 261,377.4 256,371.5
|
||||||
|
256,379 256,371.5 251,364.9 152.1,449.7 152.1,363.2 15.8,363.2 15.8,43.2 496.2,43.2 496.2,363.2 252.7,363.2 251,364.9 "/>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 636 B |
BIN
res/rahmen-message.png
Normal file
BIN
res/rahmen-message.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.5 KiB |
BIN
res/upload.png
Normal file
BIN
res/upload.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.3 KiB |
8
res/upload.svg
Normal file
8
res/upload.svg
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!-- Generator: Adobe Illustrator 21.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||||
|
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||||
|
viewBox="0 0 218.8 283.5" style="enable-background:new 0 0 218.8 283.5;" xml:space="preserve">
|
||||||
|
<g>
|
||||||
|
<path d="M109.4,0L0,109.4h62.5v93.8h93.8v-93.8h62.5L109.4,0z M0,234.4v31.3h218.8v-31.3H0z M0,234.4"/>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 476 B |
@@ -155,7 +155,7 @@ void ChatModel::renderContactRequest(){
|
|||||||
requestContact.setupUi(&dialog);
|
requestContact.setupUi(&dialog);
|
||||||
Settings::saveRestore(&dialog);
|
Settings::saveRestore(&dialog);
|
||||||
|
|
||||||
{
|
/* {
|
||||||
QStandardItemModel* contactRequest = new QStandardItemModel();
|
QStandardItemModel* contactRequest = new QStandardItemModel();
|
||||||
|
|
||||||
|
|
||||||
@@ -183,8 +183,7 @@ void ChatModel::renderContactRequest(){
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// }
|
|
||||||
|
|
||||||
QObject::connect(requestContact.requestContact, &QTableView::clicked, [&] () {
|
QObject::connect(requestContact.requestContact, &QTableView::clicked, [&] () {
|
||||||
|
|
||||||
@@ -228,7 +227,7 @@ void ChatModel::renderContactRequest(){
|
|||||||
qDebug()<<"Beginn kopiert" <<cid << addr << newLabel << myAddr;
|
qDebug()<<"Beginn kopiert" <<cid << addr << newLabel << myAddr;
|
||||||
AddressBook::getInstance()->addAddressLabel(newLabel, addr, myAddr, cid, avatar);
|
AddressBook::getInstance()->addAddressLabel(newLabel, addr, myAddr, cid, avatar);
|
||||||
});
|
});
|
||||||
|
*/
|
||||||
|
|
||||||
dialog.exec();
|
dialog.exec();
|
||||||
}
|
}
|
||||||
@@ -476,7 +475,7 @@ QString MainWindow::doSendChatTxValidations(Tx tx) {
|
|||||||
auto available = rpc->getModel()->getAvailableBalance();
|
auto available = rpc->getModel()->getAvailableBalance();
|
||||||
|
|
||||||
if (available < total) {
|
if (available < total) {
|
||||||
return tr("Not enough available funds to send this transaction\n\nHave: %1\nNeed: %2\n\nNote: Funds need 5 confirmations before they can be spent")
|
return tr("Not enough available funds to send this transaction\n\nHave: %1\nNeed: %2\n\nNote: Funds need 3 confirmations before they can be spent")
|
||||||
.arg(available.toDecimalhushString(), total.toDecimalhushString());
|
.arg(available.toDecimalhushString(), total.toDecimalhushString());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -601,6 +600,18 @@ Tx MainWindow::createTxForSafeContactRequest() {
|
|||||||
|
|
||||||
void MainWindow::ContactRequest() {
|
void MainWindow::ContactRequest() {
|
||||||
|
|
||||||
|
if (ui->contactNameMemo->text().trimmed().isEmpty() || ui->memoTxtChat->toPlainText().trimmed().isEmpty()) {
|
||||||
|
|
||||||
|
// auto addr = "";
|
||||||
|
// if (! Settings::isZAddress(AddressBook::addressFromAddressLabel(addr->text()))) {
|
||||||
|
QMessageBox msg(QMessageBox::Critical, tr("You have to select a contact and insert a Memo"),
|
||||||
|
tr("You have selected no Contact from Contactlist,\n") + tr("\nor your Memo is empty"),
|
||||||
|
QMessageBox::Ok, this);
|
||||||
|
|
||||||
|
msg.exec();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Tx tx = createTxForSafeContactRequest();
|
Tx tx = createTxForSafeContactRequest();
|
||||||
|
|
||||||
QString error = doSendRequestTxValidations(tx);
|
QString error = doSendRequestTxValidations(tx);
|
||||||
@@ -659,6 +670,7 @@ void MainWindow::ContactRequest() {
|
|||||||
// Force a UI update so we get the unconfirmed Tx
|
// Force a UI update so we get the unconfirmed Tx
|
||||||
// rpc->refresh(true);
|
// rpc->refresh(true);
|
||||||
ui->memoTxtChat->clear();
|
ui->memoTxtChat->clear();
|
||||||
|
rpc->refresh(true);
|
||||||
|
|
||||||
},
|
},
|
||||||
// Errored out
|
// Errored out
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2019-2020 The Hush developers
|
// Copyright 2019-2020 The Hush developers
|
||||||
// GPLv3
|
// GPLv3
|
||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
#include "addressbook.h"
|
#include "addressbook.h"
|
||||||
@@ -44,7 +44,7 @@ MainWindow::MainWindow(QWidget *parent) :
|
|||||||
|
|
||||||
|
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
ui->request->setChecked(false);
|
|
||||||
logger = new Logger(this, QDir(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation)).filePath("silentdragonlite-wallet.log"));
|
logger = new Logger(this, QDir(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation)).filePath("silentdragonlite-wallet.log"));
|
||||||
ui->memoTxtChat->setAutoFillBackground(false);
|
ui->memoTxtChat->setAutoFillBackground(false);
|
||||||
ui->memoTxtChat->setPlaceholderText("Send Message");
|
ui->memoTxtChat->setPlaceholderText("Send Message");
|
||||||
@@ -1005,22 +1005,10 @@ void MainWindow::setupTransactionsTab() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::setupchatTab() {
|
void MainWindow::setupchatTab() {
|
||||||
|
|
||||||
|
/////////////Setting Icons for Chattab and different themes
|
||||||
|
|
||||||
// Send button
|
auto theme = Settings::getInstance()->get_theme_name();
|
||||||
|
|
||||||
// Is request Contact checked?
|
|
||||||
|
|
||||||
// if (ui->request->isChecked()) {
|
|
||||||
|
|
||||||
|
|
||||||
// QObject::connect(ui->sendChatButton, &QPushButton::clicked, this, &MainWindow::ContactRequest);
|
|
||||||
|
|
||||||
// qDebug() <<ui->request->isChecked()->text();
|
|
||||||
// }else{
|
|
||||||
|
|
||||||
/////////////Setting Icons for Chattab and different themes
|
|
||||||
|
|
||||||
auto theme = Settings::getInstance()->get_theme_name();
|
|
||||||
if (theme == "dark" || theme == "midnight") {
|
if (theme == "dark" || theme == "midnight") {
|
||||||
QPixmap send(":/icons/res/send-new-white.png");
|
QPixmap send(":/icons/res/send-new-white.png");
|
||||||
QIcon sendIcon(send);
|
QIcon sendIcon(send);
|
||||||
@@ -1032,8 +1020,15 @@ void MainWindow::setupchatTab() {
|
|||||||
|
|
||||||
QPixmap addContact(":/icons/res/add_contact.png");
|
QPixmap addContact(":/icons/res/add_contact.png");
|
||||||
QIcon addContactIcon(addContact);
|
QIcon addContactIcon(addContact);
|
||||||
ui->safeContactRequest->setIcon(addContact);
|
ui->safeContactRequest->setIcon(addContactIcon);
|
||||||
|
|
||||||
|
/*QPixmap rahmen(":/icons/res/rahmen-message.png");
|
||||||
|
QIcon addRahmenIcon(rahmen);
|
||||||
|
ui->lcdNumber->setIcon(addRahmenIcon);*/
|
||||||
|
|
||||||
|
QPixmap sendContact(":/icons/res/upload.png");
|
||||||
|
QIcon addSendContactIcon(sendContact);
|
||||||
|
ui->sendContact->setIcon(addSendContactIcon);
|
||||||
}else{
|
}else{
|
||||||
QPixmap pixmap(":/icons/res/send-new.svg");
|
QPixmap pixmap(":/icons/res/send-new.svg");
|
||||||
QIcon sendIcon(pixmap);
|
QIcon sendIcon(pixmap);
|
||||||
@@ -1046,11 +1041,21 @@ void MainWindow::setupchatTab() {
|
|||||||
QPixmap addContact(":/icons/res/add_contact.svg");
|
QPixmap addContact(":/icons/res/add_contact.svg");
|
||||||
QIcon addContactIcon(addContact);
|
QIcon addContactIcon(addContact);
|
||||||
ui->safeContactRequest->setIcon(addContact);
|
ui->safeContactRequest->setIcon(addContact);
|
||||||
}
|
|
||||||
QObject::connect(ui->sendChatButton, &QPushButton::clicked, this, &MainWindow::sendChatButton);
|
|
||||||
|
|
||||||
// }
|
/*QPixmap rahmen(":/icons/res/message-icon.svg");
|
||||||
|
QIcon addRahmenIcon(rahmen);
|
||||||
|
ui->lcdNumber->setIcon(addRahmenIcon);*/
|
||||||
|
|
||||||
|
QPixmap sendContact(":/icons/res/upload.svg");
|
||||||
|
QIcon addSendContactIcon(sendContact);
|
||||||
|
ui->sendContact->setIcon(addSendContactIcon);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
QObject::connect(ui->sendChatButton, &QPushButton::clicked, this, &MainWindow::sendChatButton);
|
||||||
|
QObject::connect(ui->sendContact, &QPushButton::clicked, this, &MainWindow::ContactRequest);
|
||||||
QObject::connect(ui->safeContactRequest, &QPushButton::clicked, this, &MainWindow::addContact);
|
QObject::connect(ui->safeContactRequest, &QPushButton::clicked, this, &MainWindow::addContact);
|
||||||
|
|
||||||
///////// Set selected Zaddr for Chat with Klick
|
///////// Set selected Zaddr for Chat with Klick
|
||||||
@@ -1549,4 +1554,4 @@ MainWindow::~MainWindow()
|
|||||||
|
|
||||||
delete wsserver;
|
delete wsserver;
|
||||||
delete wormhole;
|
delete wormhole;
|
||||||
}
|
}
|
||||||
@@ -92,10 +92,14 @@ public slots:
|
|||||||
void slot_change_currency(const QString& currencyName);
|
void slot_change_currency(const QString& currencyName);
|
||||||
|
|
||||||
|
|
||||||
private:
|
private slots:
|
||||||
|
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
void closeEvent(QCloseEvent* event);
|
void closeEvent(QCloseEvent* event);
|
||||||
|
|
||||||
|
|
||||||
void setupSendTab();
|
void setupSendTab();
|
||||||
void setupTransactionsTab();
|
void setupTransactionsTab();
|
||||||
void setupReceiveTab();
|
void setupReceiveTab();
|
||||||
|
|||||||
@@ -1360,7 +1360,7 @@
|
|||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string><html><head/><body><p align="center">Hushchat Contactlist</p></body></html></string>
|
<string><html><head/><body><p align="center"><span style=" font-weight:600; text-decoration: underline;">Contactlist</span></p></body></html></string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QTextEdit" name="memoTxtChat">
|
<widget class="QTextEdit" name="memoTxtChat">
|
||||||
@@ -1438,7 +1438,7 @@
|
|||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string><html><head/><body><p align="center">Contact Name:</p></body></html></string>
|
<string><html><head/><body><p align="center"><span style=" font-weight:600;">Contact Name :</span></p></body></html></string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QListView" name="listChat">
|
<widget class="QListView" name="listChat">
|
||||||
@@ -1475,19 +1475,6 @@
|
|||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QCheckBox" name="request">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>340</x>
|
|
||||||
<y>650</y>
|
|
||||||
<width>261</width>
|
|
||||||
<height>23</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Is this message a contact request?</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
<widget class="QPushButton" name="safeContactRequest">
|
<widget class="QPushButton" name="safeContactRequest">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
@@ -1578,6 +1565,39 @@
|
|||||||
<double>0.000000000000000</double>
|
<double>0.000000000000000</double>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
|
<widget class="QPushButton" name="sendContact">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>270</x>
|
||||||
|
<y>510</y>
|
||||||
|
<width>51</width>
|
||||||
|
<height>51</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="baseSize">
|
||||||
|
<size>
|
||||||
|
<width>100</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset theme="Dark">
|
||||||
|
<normalon>:/icons/res/add_contact.png</normalon>
|
||||||
|
</iconset>
|
||||||
|
</property>
|
||||||
|
<property name="iconSize">
|
||||||
|
<size>
|
||||||
|
<width>43</width>
|
||||||
|
<height>49</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="flat">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
<zorder>lcdNumber</zorder>
|
<zorder>lcdNumber</zorder>
|
||||||
<zorder>listContactWidget</zorder>
|
<zorder>listContactWidget</zorder>
|
||||||
<zorder>label_39</zorder>
|
<zorder>label_39</zorder>
|
||||||
@@ -1586,9 +1606,9 @@
|
|||||||
<zorder>sendChatButton</zorder>
|
<zorder>sendChatButton</zorder>
|
||||||
<zorder>contactNameMemo_3</zorder>
|
<zorder>contactNameMemo_3</zorder>
|
||||||
<zorder>listChat</zorder>
|
<zorder>listChat</zorder>
|
||||||
<zorder>request</zorder>
|
|
||||||
<zorder>safeContactRequest</zorder>
|
<zorder>safeContactRequest</zorder>
|
||||||
<zorder>pushContact</zorder>
|
<zorder>pushContact</zorder>
|
||||||
|
<zorder>sendContact</zorder>
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@@ -1799,22 +1819,5 @@
|
|||||||
<resources>
|
<resources>
|
||||||
<include location="../application.qrc"/>
|
<include location="../application.qrc"/>
|
||||||
</resources>
|
</resources>
|
||||||
<connections>
|
<connections/>
|
||||||
<connection>
|
|
||||||
<sender>request</sender>
|
|
||||||
<signal>stateChanged(int)</signal>
|
|
||||||
<receiver>MainWindow</receiver>
|
|
||||||
<slot>update()</slot>
|
|
||||||
<hints>
|
|
||||||
<hint type="sourcelabel">
|
|
||||||
<x>481</x>
|
|
||||||
<y>721</y>
|
|
||||||
</hint>
|
|
||||||
<hint type="destinationlabel">
|
|
||||||
<x>636</x>
|
|
||||||
<y>389</y>
|
|
||||||
</hint>
|
|
||||||
</hints>
|
|
||||||
</connection>
|
|
||||||
</connections>
|
|
||||||
</ui>
|
</ui>
|
||||||
|
|||||||
Reference in New Issue
Block a user