diff --git a/src/Chat/Helper/ChatDelegator.h b/src/Chat/Helper/ChatDelegator.h index 72f3c1e..e4474a8 100644 --- a/src/Chat/Helper/ChatDelegator.h +++ b/src/Chat/Helper/ChatDelegator.h @@ -56,7 +56,6 @@ inline void ListViewDelegate::paint(QPainter *painter, QStyleOptionViewItem cons qreal bodyheight = bodydoc.size().height(); int outgoing = index.data(Qt::UserRole + 1).toInt(); int outdate = index.data(Qt::UserRole + 1).toInt(); - int indate = index.data(Qt::UserRole + 1).toInt(); painter->save(); painter->setRenderHint(QPainter::Antialiasing); diff --git a/src/Model/ChatItem.cpp b/src/Model/ChatItem.cpp index 722d2f6..9d8ede4 100644 --- a/src/Model/ChatItem.cpp +++ b/src/Model/ChatItem.cpp @@ -178,7 +178,6 @@ QString ChatItem::toChatLine() } -qDebug()<<_notarize; QString line = QString("") + myDateTime.toString("yyyy-MM-dd hh:mm"); line += QString(lock) + QString(""); line += QString("

") + _memo.toHtmlEscaped() + QString("

"); diff --git a/src/chatmodel.cpp b/src/chatmodel.cpp index 53203de..32ecb78 100644 --- a/src/chatmodel.cpp +++ b/src/chatmodel.cpp @@ -237,7 +237,7 @@ void MainWindow::renderContactRequest(){ return; } - qDebug()<<"Beginn kopiert" <addAddressLabel(newLabel, addr, myAddr, cid, avatar); rpc->refreshContacts( ui->listContactWidget); @@ -393,7 +393,6 @@ QString MainWindow::createHeaderMemo(QString type, QString cid, QString zaddr, Q j.setObject(h); header = j.toJson(); - qDebug() << "made header=" << header; return header; } @@ -449,7 +448,6 @@ Tx MainWindow::createTxFromChatPage() { QString hashEncryptionKey = passphrase; int length = hashEncryptionKey.length(); - qDebug()<<"Pubkey Erstellung :"<(header), crypto_secretstream_xchacha20poly1305_HEADERBYTES).toHex(); QString publickeyAlice = QByteArray(reinterpret_cast(pk), crypto_kx_PUBLICKEYBYTES).toHex(); - qDebug()<<"Headerbyte erstellung : "<contactNameMemo->text(); - int sizename = Name.size(); - qDebug()<< sizename; + if ((ui->contactNameMemo->text().isEmpty()) || (ui->memoTxtChat->toPlainText().trimmed().isEmpty())) { QMessageBox msg(QMessageBox::Critical, tr("You have to select a contact and insert a Memo"), @@ -577,7 +569,6 @@ void MainWindow::sendChat() { // abort the Tx return; - qDebug() << "Tx aborted"; } auto movie = new QMovie(this); @@ -716,7 +707,6 @@ void::MainWindow::addContact() request.myzaddr->setText(myAddr); ui->listReceiveAddresses->insertItem(0, myAddr); ui->listReceiveAddresses->setCurrentIndex(0); - qDebug() << "new generated myAddr add Contact" << myAddr; }); }catch(...) diff --git a/src/controller.cpp b/src/controller.cpp index f47ca17..5b1c979 100644 --- a/src/controller.cpp +++ b/src/controller.cpp @@ -1025,7 +1025,6 @@ void Controller::refreshTransactions() { int encryptedMemoSize1 = ba.length(); - int headersize = ba1.length(); //////unsigned char* as message from QString #define MESSAGE2 (const unsigned char *) encryptedMemo @@ -1062,8 +1061,6 @@ void Controller::refreshTransactions() { //////////////Give us the output of the decrypted message as debug to see if it was successfully - qDebug()<<"OUT decrypt:" << memodecrypt; - ChatItem item = ChatItem( datetime, @@ -1084,26 +1081,7 @@ void Controller::refreshTransactions() { updateUIBalances(); } - /*else{ - - - ChatItem item = ChatItem( - datetime, - address, - QString(""), - memo, - QString(""), - QString(""), - cid, - txid, - confirmations, - true, - isNotarized, - false - ); - DataStore::getChatDataStore()->setData(ChatIDGenerator::getInstance()->generateID(item), item); - updateUIBalances(); - }*/ + } items.push_back(TransactionItemDetail{address, amount, memo}); @@ -1153,7 +1131,6 @@ void Controller::refreshTransactions() { QString publickey; QString headerbytes; QString cid; - int position; QString requestZaddr; bool isContact; @@ -1261,10 +1238,6 @@ void Controller::refreshTransactions() { chatModel->addMemo(txid, headerbytes); }else{} - - qDebug()<<"Position message :"<getPassword(); QString hashEncryptionKey = passphrase; int length = hashEncryptionKey.length(); diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index cf6b039..6e9af7e 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -292,7 +292,6 @@ void MainWindow::closeEvent(QCloseEvent* event) { // Let the RPC know to shut down any running service. rpc->shutdownhushd(); int passphraselenght = this->getPassword().length(); - qDebug()<<"LÄNGE PW : "< 0) @@ -542,9 +541,7 @@ void MainWindow::removeWalletEncryption() { filencrypted.remove(); }else{ - - qDebug()<<"verschlüsselung gescheitert "; - + QMessageBox::critical(this, tr("Wallet Encryption Failed"), QString("False password, please try again"), QMessageBox::Ok @@ -632,8 +629,6 @@ void MainWindow::removeWalletEncryptionStartUp() { }else{ - - qDebug()<<"verschlüsselung gescheitert "; QMessageBox::critical(this, tr("Wallet Encryption Failed"), QString("false password please try again"), @@ -1365,24 +1360,10 @@ void MainWindow::setupchatTab() { QObject::connect(ui->safeContactRequest, &QPushButton::clicked, this, &MainWindow::addContact); QObject::connect(ui->pushContact, &QPushButton::clicked, this , &MainWindow::renderContactRequest); -///////// Set selected Zaddr for Chat with Klick ui->contactNameMemo->setText(""); - QObject::connect(ui->listContactWidget, &QTableView::clicked, [=] () { - - - QModelIndex index = ui->listContactWidget->currentIndex(); - QString label_contact = index.data(Qt::DisplayRole).toString(); - - for(auto &p : AddressBook::getInstance()->getAllAddressLabels()) - if (label_contact == p.getName()) { - ui->contactNameMemo->setText(p.getName()); - rpc->refresh(true); - - } - }); - - QMenu* contextMenu; +///////// Add contextmenu + QMenu* contextMenu; QAction* requestAction; QAction* editAction; QAction* HushAction; @@ -1394,16 +1375,22 @@ void MainWindow::setupchatTab() { HushAction = new QAction("Send a friend some Hush - coming soon",contextMenu); requestHushAction = new QAction("Request some Hush - coming soon",contextMenu); subatomicAction = new QAction("Make a subatomic swap with a friend- coming soon",contextMenu); + + +///////// Set selected Zaddr for Chat with click + + QObject::connect(ui->listContactWidget, &QTableView::clicked, [=] () { + ui->listContactWidget->setContextMenuPolicy(Qt::ActionsContextMenu); ui->listContactWidget->addAction(requestAction); ui->listContactWidget->addAction(editAction); ui->listContactWidget->addAction(HushAction); ui->listContactWidget->addAction(requestHushAction); ui->listContactWidget->addAction(subatomicAction); - - QObject::connect(requestHushAction, &QAction::triggered, [=]() { + + QObject::connect(requestHushAction, &QAction::triggered, [=]() { QModelIndex index = ui->listContactWidget->currentIndex(); - QString label_contact = index.data(Qt::DisplayRole).toString(); + QString label_contact = index.data(Qt::DisplayRole).toString(); for(auto &p : AddressBook::getInstance()->getAllAddressLabels()) if (label_contact == p.getName()) { @@ -1415,7 +1402,7 @@ void MainWindow::setupchatTab() { }); - QObject::connect(editAction, &QAction::triggered, [=]() { + QObject::connect(editAction, &QAction::triggered, [=]() { QModelIndex index = ui->listContactWidget->currentIndex(); QString label_contact = index.data(Qt::DisplayRole).toString(); @@ -1436,12 +1423,20 @@ void MainWindow::setupchatTab() { } }); + QModelIndex index = ui->listContactWidget->currentIndex(); + QString label_contact = index.data(Qt::DisplayRole).toString(); + + for(auto &p : AddressBook::getInstance()->getAllAddressLabels()) + if (label_contact == p.getName()) { + ui->contactNameMemo->setText(p.getName()); + rpc->refresh(true); + } + }); + ui->memoTxtChat->setLenDisplayLabelChat(ui->memoSizeChat); } - - void MainWindow::updateChat() { rpc->refreshChat(ui->listChat,ui->memoSizeChat);