Browse Source

show outgoing memos correctly

pull/130/head
DenioD 4 years ago
parent
commit
b8a1443832
  1. 2
      application.qrc
  2. BIN
      res/Elsa.png
  3. 10
      src/addressbook.ui
  4. 13
      src/chatmodel.cpp
  5. 22
      src/contactrequest.ui
  6. 12
      src/controller.cpp
  7. 4
      src/mainwindow.cpp
  8. 3
      src/mainwindow.h
  9. 28
      src/mainwindow.ui

2
application.qrc

@ -22,10 +22,10 @@
<file>res/Garfield.png</file>
<file>res/Pinguin.png</file>
<file>res/Stag.png</file>
<file>res/Elsa.png</file>
</qresource>
<qresource prefix="/img">
<file>res/hushdlogo.gif</file>
<file>res/logobig.gif</file>
<file>res/silentdragonlite-animated.gif</file>
<file>res/silentdragonlite-animated-dark.gif</file>
<file>res/silentdragonlite-animated-startup.gif</file>

BIN
res/Elsa.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 92 KiB

10
src/addressbook.ui

@ -73,6 +73,16 @@
</iconset>
</property>
</item>
<item>
<property name="text">
<string>Elsa</string>
</property>
<property name="icon">
<iconset>
<normalon>:/icons/res/Elsa.png</normalon>
</iconset>
</property>
</item>
<item>
<property name="text">
<string>Denio</string>

13
src/chatmodel.cpp

@ -228,12 +228,13 @@ Tx MainWindow::createTxFromChatPage() {
QString hmemo= createHeaderMemo(type,cid,myAddr);
QString memo = ui->memoTxtChat->toPlainText().trimmed();
// ui->memoSizeChat->setLenDisplayLabel();// Todo -> activate lendisplay for chat
tx.toAddrs.push_back(ToFields{addr, amt, hmemo}) ;
// ui->memoSizeChat->setLenDisplayLabel();// Todo -> activate lendisplay for chat
tx.toAddrs.push_back(ToFields{addr, amt, memo});
tx.toAddrs.push_back(ToFields{addr, amt, hmemo});
qDebug() << "pushback chattx";
} }
@ -472,9 +473,9 @@ Tx MainWindow::createTxForSafeContactRequest() {
QString hmemo= createHeaderMemo(type,cid,myAddr);
QString memo = ui->memoTxtChat->toPlainText().trimmed();
tx.toAddrs.push_back(ToFields{addr, amt, hmemo});
tx.toAddrs.push_back(ToFields{addr, amt, memo});
tx.toAddrs.push_back(ToFields{addr, amt, hmemo});
qDebug() << "pushback chattx";

22
src/contactrequest.ui

@ -28,7 +28,7 @@
</property>
</widget>
</item>
<item row="1" column="1" colspan="2">
<item row="1" column="1">
<widget class="QComboBox" name="comboBoxAvatar">
<item>
<property name="text">
@ -40,6 +40,16 @@
</iconset>
</property>
</item>
<item>
<property name="text">
<string>Elsa</string>
</property>
<property name="icon">
<iconset>
<normalon>:/icons/res/Elsa.png</normalon>
</iconset>
</property>
</item>
<item>
<property name="text">
<string>Denio</string>
@ -162,7 +172,7 @@
</property>
</widget>
</item>
<item row="4" column="0" colspan="3">
<item row="4" column="0">
<widget class="QLineEdit" name="zaddr"/>
</item>
<item row="5" column="0">
@ -172,12 +182,8 @@
</property>
</widget>
</item>
<item row="6" column="0" colspan="3">
<widget class="QLabel" name="myzaddr">
<property name="text">
<string/>
</property>
</widget>
<item row="6" column="0">
<widget class="QLineEdit" name="myzaddr"/>
</item>
<item row="7" column="0">
<widget class="QLabel" name="label_5">

12
src/controller.cpp

@ -882,7 +882,7 @@ void Controller::refreshTransactions() {
QString cid;
QString contact;
for(auto &c : AddressBook::getInstance()->getAllAddressLabels())
{
if (ui->contactNameMemo->text().trimmed() == c.getName()) {
@ -894,7 +894,7 @@ void Controller::refreshTransactions() {
contact = c.getName();
}else{ contact = "";}
ChatItem item = ChatItem(
datetime,
address,
@ -906,6 +906,7 @@ void Controller::refreshTransactions() {
);
chatModel->addMessage(item);
}
}
@ -918,11 +919,9 @@ void Controller::refreshTransactions() {
QList<QString> addresses;
for (auto item : items) {
// Concat all the addresses
if (item.amount == 0) {
}else{
addresses.push_back(item.address); }
addresses.push_back(item.address);
}
@ -932,6 +931,7 @@ void Controller::refreshTransactions() {
txdata.push_back(TransactionItem{
"send", datetime, address, txid,confirmations, items
});
} else {
// Incoming Transaction
address = (it["address"].is_null() ? "" : QString::fromStdString(it["address"]));

4
src/mainwindow.cpp

@ -1077,10 +1077,6 @@ void ChatMemoEdit::setMaxLen(int len) {
updateDisplay();
}
void ChatMemoEdit::setLenDisplayLabel(QLabel* label_40) {
this->lenDisplayLabel = label_40;
}
void ChatMemoEdit::setSendChatButton(QPushButton* button) {
this->sendChatButton = button;
}

3
src/mainwindow.h

@ -93,6 +93,7 @@ private:
void setupBalancesTab();
void setuphushdTab();
void setupchatTab();
void setLenDisplayLabel(QLabel* label);
void updateContacts();
void updateChat();
@ -168,7 +169,7 @@ public:
ChatMemoEdit(QWidget* parent);
void setMaxLen(int len);
void setLenDisplayLabel(QLabel* label_40);
void setSendChatButton(QPushButton* button);
void includeReplyTo(QString replyToAddress);
void updateDisplay();

28
src/mainwindow.ui

@ -1337,6 +1337,18 @@
<height>601</height>
</rect>
</property>
<property name="mouseTracking">
<bool>true</bool>
</property>
<property name="editTriggers">
<set>QAbstractItemView::EditKeyPressed|QAbstractItemView::SelectedClicked</set>
</property>
<property name="alternatingRowColors">
<bool>false</bool>
</property>
<property name="selectionMode">
<enum>QAbstractItemView::SingleSelection</enum>
</property>
</widget>
<widget class="QLabel" name="label_39">
<property name="geometry">
@ -1364,22 +1376,6 @@
<string notr="true">font: 11pt &quot;Noto Color Emoji&quot;;</string>
</property>
</widget>
<widget class="QLabel" name="memoSizeChat">
<property name="geometry">
<rect>
<x>1190</x>
<y>650</y>
<width>47</width>
<height>17</height>
</rect>
</property>
<property name="text">
<string notr="true">0 / 512</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
<widget class="QLabel" name="contactNameMemo">
<property name="geometry">
<rect>

Loading…
Cancel
Save