From ec5a88aafdef0dfe516660e932ce071801a1f3a7 Mon Sep 17 00:00:00 2001 From: DenioD <41270280+DenioD@users.noreply.github.com> Date: Sun, 26 Jul 2020 17:10:21 +0200 Subject: [PATCH] allow to send a message only if their was a initial contact request #168 --- src/Chat/Chat.cpp | 2 +- src/mainwindow.cpp | 4 +- src/mainwindow.ui | 3188 ++++++++++++++++++++++---------------------- 3 files changed, 1597 insertions(+), 1597 deletions(-) diff --git a/src/Chat/Chat.cpp b/src/Chat/Chat.cpp index 3c68837..c769ed2 100644 --- a/src/Chat/Chat.cpp +++ b/src/Chat/Chat.cpp @@ -126,7 +126,7 @@ void Chat::renderChatBox(Ui::MainWindow *ui, QListView *view, QLabel *label) Items1->setData(INCOMING, Qt::UserRole + 1); chat->appendRow(Items1); ui->listChat->setModel(chat); - + ui->memoTxtChat->setEnabled(true); } else diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index f810d4d..3aa6df0 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -92,7 +92,7 @@ MainWindow::MainWindow(QWidget *parent) : } ui->memoTxtChat->setAutoFillBackground(false); - ui->memoTxtChat->setPlaceholderText("Send Message"); + ui->memoTxtChat->setPlaceholderText("Send Message (you can only write messages after the initial message from your contact)"); ui->memoTxtChat->setTextColor(Qt::white); // Status Bar @@ -1613,7 +1613,7 @@ void MainWindow::setupchatTab() { ui->listContactWidget->addAction(HushAction); ui->listContactWidget->addAction(editAction); ui->listContactWidget->addAction(subatomicAction); - ui->memoTxtChat->setEnabled(true); + ui->memoTxtChat->setEnabled(false); QModelIndex index = ui->listContactWidget->currentIndex(); QString label_contact = index.data(Qt::DisplayRole).toString(); diff --git a/src/mainwindow.ui b/src/mainwindow.ui index 4e62995..f14a9fe 100644 --- a/src/mainwindow.ui +++ b/src/mainwindow.ui @@ -61,1770 +61,1770 @@ 0 - + - Balance + HushChat - + - + - + + + QLayout::SetDefaultConstraint + + + 0 + + + 0 + + + 15 + + + + + + 51 + 51 + + + + + 51 + 51 + + + + + 100 + 0 + + + + Incoming contact request + + + false + + + + + + + :/icons/res/requestBlack.png:/icons/res/requestBlack.png + + + + 50 + 45 + + + + true + + + + + + + + 51 + 51 + + + + + 51 + 51 + + + + + 100 + 0 + + + + Add a new contact + + + + + + + :/icons/res/addContactBlack.png + + + + + 50 + 45 + + + + true + + + + + + + + 51 + 51 + + + + + 51 + 51 + + + + Get a new Address + + + + + + + :/icons/res/getAddrBlack.png:/icons/res/getAddrBlack.png + + + + 50 + 45 + + + + true + + + + + + + Qt::Horizontal + + + QSizePolicy::Preferred + + + + 100 + 20 + + + + + + + + + + + 0 + 0 + + - 250 + 300 0 - - Summary + + <html><head/><body><p align="center"><span style=" font-weight:600; text-decoration: underline;">Contactlist</span></p></body></html> - + + + + + + + 0 + 0 + + + + true + + + QAbstractItemView::NoEditTriggers + + false - - - - - - - - 0 - 0 - - - - Shielded - - - - - - - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - - - - - 0 - 0 - - - - Notarized - - - - - - - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - - - - - 0 - 0 - - - - Transparent - - - - - - - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - - Qt::Horizontal - - - - - - - - - - 0 - 0 - - - - - 75 - true - - - - Total - - - - - - - - 75 - true - - - - - - - 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 - - - - - + + false + + + QAbstractItemView::SingleSelection + + + QAbstractItemView::SelectItems + + + + + + + QLayout::SetDefaultConstraint + + + + + QLayout::SetDefaultConstraint + + + + + + 0 + 0 + + + + <html><head/><body><p align="center"><span style=" font-weight:600;">Contact Name :</span></p></body></html> + + + + + + + + 75 + true + + + + <html><head/><body><p align="center"><br/></p></body></html> + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + - + - + 0 0 - - Address Balances + + Qt::NoFocus - - - 6 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - QAbstractItemView::SingleSelection - - - QAbstractItemView::SelectRows - - - false - - - false - - - true - - - false - - - - - - - - - - - - - Send - - - - - - false - - - - - - false - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 75 - true - - - - Total notarized funds available: - - - - - - - - - - - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - Send To - - - false - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - QAbstractScrollArea::AdjustToContents - - - true - - - - - 0 - 0 - 1260 - 509 - + + The locks shows you the status of the message. Red lock = unconfirmed, green lock = min. 1 confirmations, orange lock = message is notarized + + + Qt::ScrollBarAsNeeded + + + Qt::ScrollBarAsNeeded + + + QAbstractScrollArea::AdjustToContents + + + true + + + QAbstractItemView::NoEditTriggers + + + false + + + QAbstractItemView::DragOnly + + + Qt::IgnoreAction + + + QAbstractItemView::NoSelection + + + QAbstractItemView::ScrollPerItem + + + QListView::Snap + + + QListView::TopToBottom + + + QListView::Adjust + + + QListView::SinglePass + + + 0 + + + false + + + true + + + true + + + + + + + QLayout::SetDefaultConstraint + + + 0 + + + + + + 0 + 0 + + + + + 850 + 0 + + + + false + + + font: 11pt "Noto Color Emoji"; + + + QTextEdit::AutoNone + + + QTextEdit::WidgetWidth + + + 600 + + + false + + + Qt::TextEditorInteraction - - - - - Recipient - - - - - - - - Address - - - - - - - Address - - - - - - - Address Book - - - - - - - - - - - Amount - - - - - - - - 200 - 0 - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - Amount - - - - - - - - - - - - - - Max Available - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - true - - - - - - Memo - - - - - - - - - - 10 - - - - - - - true - - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 200 - 0 - - - - Add Recipient - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - + + + + + + 20 + 0 + + + + + + + + :/emoji/res/emoji/emoji1.png + + + + + 17 + 17 + + + + true + + + + + + + 6 + + + 6 + + + 6 + + + 6 + + + + + + 0 + 0 + + + + + 16777215 + 50 + + + + + 100 + 0 + + + + false + + + + + + + :/icons/res/sendBlack.png + + + + + 50 + 49 + + + + false + + + true + + + + + + + + 0 + 0 + + + + QFrame::Sunken + + + 0 / 235 + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + - - + + + + + Balance + + + + - - - Qt::Horizontal - - + + - 40 - 20 + 250 + 0 - - - - - - - - - - Miner Fee - - - - - - - - 0 - 0 - - - - 0 - - - - - - - - - - - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 100 - 0 - - - - Send - - - false - - - - - - - - 100 - 0 - - - - Cancel - - - - - - - - - - Receive - - - - - - - - Address Type + + Summary false - - false - - - - + + + - + + + + 0 + 0 + + - z-Addr + Shielded - + + + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + + - + 0 0 - t-Addr + Notarized + + + + + + + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - + + - + - + 0 0 - - false + + Transparent - + - Next Address + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + Qt::Horizontal + + + + + - + + + + 0 + 0 + + + + + 75 + true + + - View All Addresses + Total + + + + + + + + 75 + true + + + + + + + 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 + + + + - - - - - - - - - Label - - - - - - - Update Label - - - - - - - - - - - - - - Address balance - - - - - - - 40 - - - Optional - - - - - - - - 0 - 0 - - - - true - - - - - - - - - Export Private Key - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - Address - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop - - - - - - - - - color: red; - - - Your node is still syncing, balances may not be updated - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - - 0 - 0 - - - - background-color: #fff - - - - - - - + + + + 0 + 0 + + + + Address Balances + + + + 6 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + QAbstractItemView::SingleSelection + + + QAbstractItemView::SelectRows + + + false + + + false + + + true + + + false + + + + + - - - Transactions - - - - - - QAbstractItemView::SingleSelection - - - QAbstractItemView::SelectRows - - - true - - - - - - + - Information about Hush + Send - + - - - - 0 - 0 - - - - - - + + false - - - - - - - 650 - 650 - - - - - 16777215 - 16777215 - - - + + false + + - + - Qt::Vertical + Qt::Horizontal - 20 - 40 + 40 + 20 - + - 15 + 75 + true - <html><head/><body><p align="center"><span style=" font-weight:600;">Hush Blockchain Information</span></p></body></html> + Total notarized funds available: - - - Qt::Horizontal - - - - - - - - - <html><head/><body><p align="center">|</p></body></html> - - - - - - - Loading... - - - - - - - <html><head/><body><p align="center">|</p></body></html> - - - - - - - Next Halving - - - - - - - Loading... - - - - - - - <html><head/><body><p align="center">|</p></body></html> - - - - - - - Loading... - - - - - - - Vendor - - - - - - - Loading... - - - - - - - Loading... - - - - - - - Loading... - - - - - - - Loading... - - - - - - - <html><head/><body><p align="center">|</p></body></html> - - - - - - - <html><head/><body><p align="center">|</p></body></html> - - - - - - - Difficulty - - - - - - - <html><head/><body><p align="center">|</p></body></html> - - - - - - - Last Notarized Block - - - - - - - Loading... - - - - - - - <html><head/><body><p align="center">|</p></body></html> - - - - - - - Total Supply - - - - - - - <html><head/><body><p align="center">|</p></body></html> - - - - - - - Longestchain - - - - - - - <html><head/><body><p align="center">|</p></body></html> - - - - - - - Version hushlightd - - - - - - - BlockHeight - - - - - - - Supply zAddr - - - - - - - <html><head/><body><p align="center">|</p></body></html> - - - - - - - Loading... - - - - - - - Loading... - - - - - - - Supply tAddr - - - - - - - - - Qt::Horizontal + + + - - - - 15 - - + - <html><head/><body><p align="center"><span style=" font-weight:600;">Hush Market Information</span></p></body></html> + - + Qt::Horizontal - - - - - - - - Loading... - - - - - - - Market Cap - - - - - - - <html><head/><body><p align="center">|</p></body></html> - - - - - - - Loading... - - - - - - - Volume on Exchanges - - - - - - - <html><head/><body><p align="center">|</p></body></html> - - - - + + + 40 + 20 + + + + + + + + + + Send To + + + false + + + + 0 + + + 0 + + + 0 + + + 0 + - - - Qt::Horizontal + + + QAbstractScrollArea::AdjustToContents - - - - - - <html><head/><body><p align="center">This is a Lightwallet, you cant mine with it!</p></body></html> + + true + + + + 0 + 0 + 1260 + 509 + + + + + + + Recipient + + + + + + + + Address + + + + + + + Address + + + + + + + Address Book + + + + + + + + + + + Amount + + + + + + + + 200 + 0 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + Amount + + + + + + + + + + + + + + Max Available + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + true + + + + + + Memo + + + + + + + + + + 10 + + + + + + + true + + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 200 + 0 + + + + Add Recipient + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - HushChat - - - - + + - - - QLayout::SetDefaultConstraint - - - 0 + + + Qt::Horizontal - - 0 + + + 40 + 20 + - - 15 + + + + + + + + + + Miner Fee - - - - - 51 - 51 - - - - - 51 - 51 - - - - - 100 - 0 - - - - Incoming contact request - - - false - - - - - - - :/icons/res/requestBlack.png:/icons/res/requestBlack.png - - - - 50 - 45 - - - - true - - - - - - - - 51 - 51 - - - - - 51 - 51 - - - - - 100 - 0 - - - - Add a new contact - - - - - - - :/icons/res/addContactBlack.png - - - - - 50 - 45 - - - - true - - - - - - - - 51 - 51 - - - - - 51 - 51 - - - - Get a new Address - - - - - - - :/icons/res/getAddrBlack.png:/icons/res/getAddrBlack.png - - - - 50 - 45 - - - - true - - - - - - - Qt::Horizontal - - - QSizePolicy::Preferred - - - - 100 - 20 - - - - - + - + - + 0 0 - - - 300 - 0 - - - <html><head/><body><p align="center"><span style=" font-weight:600; text-decoration: underline;">Contactlist</span></p></body></html> + 0 - - - - 0 - 0 - + + + - - true + + + + + + - - QAbstractItemView::NoEditTriggers + + + + + + Qt::Horizontal - - false + + + 40 + 20 + - - false + + + + + + + 100 + 0 + - - QAbstractItemView::SingleSelection + + Send - - QAbstractItemView::SelectItems + + false - - - - - - QLayout::SetDefaultConstraint - - - - QLayout::SetDefaultConstraint + + + + 100 + 0 + - - + + Cancel + + + + + + + + + + Receive + + + + + + + + Address Type + + + false + + + false + + + + + + + + z-Addr + + + + + + + + 0 + 0 + + + + t-Addr + + + + + + + + + + + + 0 + 0 + + + + false + + + + + + + Next Address + + + + + + + View All Addresses + + + + + + + + + + + + + + + + + + Label + + + + + + + Update Label + + + + + + + + + + + + + + Address balance + + + + + + + 40 + + + Optional + + + + + + + + 0 + 0 + + + + true + + + + + + + + + Export Private Key + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + Address + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + + + + + + + color: red; + + + Your node is still syncing, balances may not be updated + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + - + 0 0 - - <html><head/><body><p align="center"><span style=" font-weight:600;">Contact Name :</span></p></body></html> - - - - - - - - 75 - true - + + background-color: #fff - <html><head/><body><p align="center"><br/></p></body></html> + - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - 0 - 0 - - - - Qt::NoFocus - - - The locks shows you the status of the message. Red lock = unconfirmed, green lock = min. 1 confirmations, orange lock = message is notarized - - - Qt::ScrollBarAsNeeded - - - Qt::ScrollBarAsNeeded - - - QAbstractScrollArea::AdjustToContents - - - true - - - QAbstractItemView::NoEditTriggers - - - false - - - QAbstractItemView::DragOnly - - - Qt::IgnoreAction - - - QAbstractItemView::NoSelection - - - QAbstractItemView::ScrollPerItem - - - QListView::Snap - - - QListView::TopToBottom - - - QListView::Adjust - - - QListView::SinglePass - - - 0 - - - false - - - true - - - true - - - - - - - QLayout::SetDefaultConstraint - - - 0 - - - - - - 0 - 0 - - - - - 850 - 0 - - - - false - - - font: 11pt "Noto Color Emoji"; - - - QTextEdit::AutoNone - - - QTextEdit::WidgetWidth - - - 600 - - - false - - - Qt::TextEditorInteraction - - - - - - - - 20 - 0 - - - - - - - - :/emoji/res/emoji/emoji1.png - - - - - 17 - 17 - - - - true - - - - - - - 6 - - - 6 - - - 6 - - - 6 - - - - - - 0 - 0 - - - - - 16777215 - 50 - - - - - 100 - 0 - - - - false - - - - - - - :/icons/res/sendBlack.png - - - - - 50 - 49 - - - - false - - - true - - - - - - - - 0 - 0 - - - - QFrame::Sunken - - - 0 / 235 - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - + + + Transactions + + + + + + QAbstractItemView::SingleSelection + + + QAbstractItemView::SelectRows + + + true + + + + + + + + Information about Hush + + + + + + + 0 + 0 + + + + + + + false + + + + + + + + 650 + 650 + + + + + 16777215 + 16777215 + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + 15 + + + + <html><head/><body><p align="center"><span style=" font-weight:600;">Hush Blockchain Information</span></p></body></html> + + + + + + + Qt::Horizontal + + + + + + + + + <html><head/><body><p align="center">|</p></body></html> + + + + + + + Loading... + + + + + + + <html><head/><body><p align="center">|</p></body></html> + + + + + + + Next Halving + + + + + + + Loading... + + + + + + + <html><head/><body><p align="center">|</p></body></html> + + + + + + + Loading... + + + + + + + Vendor + + + + + + + Loading... + + + + + + + Loading... + + + + + + + Loading... + + + + + + + Loading... + + + + + + + <html><head/><body><p align="center">|</p></body></html> + + + + + + + <html><head/><body><p align="center">|</p></body></html> + + + + + + + Difficulty + + + + + + + <html><head/><body><p align="center">|</p></body></html> + + + + + + + Last Notarized Block + + + + + + + Loading... + + + + + + + <html><head/><body><p align="center">|</p></body></html> + + + + + + + Total Supply + + + + + + + <html><head/><body><p align="center">|</p></body></html> + + + + + + + Longestchain + + + + + + + <html><head/><body><p align="center">|</p></body></html> + + + + + + + Version hushlightd + + + + + + + BlockHeight + + + + + + + Supply zAddr + + + + + + + <html><head/><body><p align="center">|</p></body></html> + + + + + + + Loading... + + + + + + + Loading... + + + + + + + Supply tAddr + + + + + + + + + Qt::Horizontal + + + + + + + + 15 + + + + <html><head/><body><p align="center"><span style=" font-weight:600;">Hush Market Information</span></p></body></html> + + + + + + + Qt::Horizontal + + + + + + + + + Loading... + + + + + + + Market Cap + + + + + + + <html><head/><body><p align="center">|</p></body></html> + + + + + + + Loading... + + + + + + + Volume on Exchanges + + + + + + + <html><head/><body><p align="center">|</p></body></html> + + + + + + + + + Qt::Horizontal + + + + + + + <html><head/><body><p align="center">This is a Lightwallet, you cant mine with it!</p></body></html> + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + +