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 | 976 ++++++++++++++++++++++----------------------- 3 files changed, 491 insertions(+), 491 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,6 +61,494 @@ 0 + + + 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 + + + + + 300 + 0 + + + + <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 + + + 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 + + + + 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 + + + + + + + + + + + Balance @@ -1337,494 +1825,6 @@ - - - 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 - - - - - 300 - 0 - - - - <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 - - - 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 - - - - 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 - - - - - - - - - - -