Browse Source

contact gui fix

pull/130/head
DenioD 4 years ago
parent
commit
ee672cfcca
  1. 11
      src/chatmodel.cpp
  2. 148
      src/contactrequest.ui
  3. 227
      src/mainwindow.ui
  4. 144
      src/requestContactDialog.ui

11
src/chatmodel.cpp

@ -127,7 +127,6 @@ void MainWindow::renderContactRequest(){
requestContact.requestZaddr->setText(c.second.getRequestZaddr());
requestContact.requestCID->setText(c.second.getCid());
requestContact.requestMyAddr->setText(c.second.getAddress());
}else{}
}
@ -152,9 +151,8 @@ void MainWindow::renderContactRequest(){
requestContact.requestMemo->setModel(contactMemo);
requestContact.requestMemo->show();
requestContact.requestZaddr->setText(c.second.getRequestZaddr());
requestContact.requestCID->setText(c.second.getCid());
requestContact.requestZaddr->setText(c.second.getRequestZaddr());
requestContact.requestMyAddr->setText(c.second.getAddress());
}else{}
}
@ -468,14 +466,15 @@ void::MainWindow::addContact()
bool sapling = true;
rpc->createNewZaddr(sapling, [=] (json reply) {
QString myAddr = QString::fromStdString(reply.get<json::array_t>()[0]);
rpc->refreshAddresses();
request.myzaddr->setText(myAddr);
ui->listReceiveAddresses->insertItem(0, myAddr);
ui->listReceiveAddresses->setCurrentIndex(0);
qDebug() << "new generated myAddr" << myAddr;
qDebug() << "new generated myAddr add Contact" << myAddr;
});
QString cid = QUuid::createUuid().toString(QUuid::WithoutBraces);
request.cid->setText(cid);
@ -483,7 +482,7 @@ void::MainWindow::addContact()
QString addr = request.zaddr->text();
QString myAddr = request.myzaddr->text().trimmed();
QString memo = request.memorequest->toPlainText().trimmed();
QString memo = request.memorequest->text().trimmed();
QString avatar = QString(":/icons/res/") + request.comboBoxAvatar->currentText() + QString(".png");
QString label = request.labelRequest->text().trimmed();

148
src/contactrequest.ui

@ -10,25 +10,31 @@
<height>427</height>
</rect>
</property>
<property name="maximumSize">
<size>
<width>780</width>
<height>427</height>
</size>
</property>
<property name="windowTitle">
<string>Send a contact request</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="3">
<item row="0" column="2" colspan="2">
<widget class="QLabel" name="label_6">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;right&quot;&gt;Choose a avatar for your contact :&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;right&quot;&gt;&lt;span style=&quot; font-weight:600; text-decoration: underline;&quot;&gt;Choose a avatar for your contact :&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item row="1" column="0" colspan="2">
<widget class="QLabel" name="label_3">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Please insert a Nickname for your contact :&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600; text-decoration: underline;&quot;&gt;Please insert a Nickname for your contact :&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item row="1" column="3">
<item row="1" column="4">
<widget class="QComboBox" name="comboBoxAvatar">
<item>
<property name="text">
@ -168,49 +174,120 @@
<item row="3" column="0" colspan="2">
<widget class="QLabel" name="label">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Please insert the Address of your contact :&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600; text-decoration: underline;&quot;&gt;Please insert the Address of your contact :&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item row="4" column="0" colspan="2">
<widget class="QLineEdit" name="zaddr"/>
</item>
<item row="4" column="2" colspan="2">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Insert a memo for the request</string>
<item row="4" column="0" colspan="4">
<widget class="QLineEdit" name="zaddr">
<property name="minimumSize">
<size>
<width>650</width>
<height>25</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>650</width>
<height>25</height>
</size>
</property>
</widget>
</item>
<item row="5" column="0" colspan="2">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Your HushChat Address</string>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600; text-decoration: underline;&quot;&gt;Your HushChat Address :&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item row="5" column="2" rowspan="4" colspan="2">
<widget class="QTextEdit" name="memorequest"/>
<item row="6" column="0" colspan="4">
<widget class="QLabel" name="myzaddr">
<property name="minimumSize">
<size>
<width>650</width>
<height>25</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>650</width>
<height>25</height>
</size>
</property>
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; color:#d3d7cf;&quot;&gt;Generate your HushChat Address - please wait a second - &lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item row="6" column="0" colspan="2">
<widget class="QLineEdit" name="myzaddr"/>
<item row="7" column="0" rowspan="2">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>148</height>
</size>
</property>
</spacer>
</item>
<item row="7" column="0" colspan="2">
<widget class="QLabel" name="label_5">
<item row="7" column="1" colspan="3">
<widget class="QLabel" name="label_2">
<property name="text">
<string>The Conversation ID </string>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-weight:600; text-decoration: underline;&quot;&gt;Insert a memo for your request&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item row="8" column="0" colspan="2">
<widget class="QLabel" name="cid">
<property name="text">
<string/>
<item row="8" column="1" colspan="3">
<widget class="QLineEdit" name="memorequest">
<property name="minimumSize">
<size>
<width>500</width>
<height>71</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>500</width>
<height>71</height>
</size>
</property>
<property name="contextMenuPolicy">
<enum>Qt::NoContextMenu</enum>
</property>
<property name="acceptDrops">
<bool>false</bool>
</property>
<property name="inputMethodHints">
<set>Qt::ImhSensitiveData</set>
</property>
<property name="maxLength">
<number>512</number>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
<property name="dragEnabled">
<bool>false</bool>
</property>
<property name="placeholderText">
<string>Add some memo to your request</string>
</property>
<property name="clearButtonEnabled">
<bool>true</bool>
</property>
</widget>
</item>
<item row="9" column="0">
<widget class="QPushButton" name="cancel">
<property name="maximumSize">
<size>
<width>80</width>
<height>25</height>
</size>
</property>
<property name="baseSize">
<size>
<width>100</width>
@ -220,6 +297,9 @@
<property name="text">
<string>Cancel</string>
</property>
<property name="autoDefault">
<bool>false</bool>
</property>
<property name="flat">
<bool>false</bool>
</property>
@ -240,6 +320,12 @@
</item>
<item row="9" column="2">
<widget class="QPushButton" name="onlyAdd">
<property name="maximumSize">
<size>
<width>152</width>
<height>25</height>
</size>
</property>
<property name="baseSize">
<size>
<width>100</width>
@ -249,13 +335,22 @@
<property name="text">
<string>Only add this contact</string>
</property>
<property name="autoDefault">
<bool>false</bool>
</property>
<property name="flat">
<bool>false</bool>
</property>
</widget>
</item>
<item row="9" column="3">
<item row="9" column="3" colspan="2">
<widget class="QPushButton" name="sendRequestButton">
<property name="maximumSize">
<size>
<width>188</width>
<height>25</height>
</size>
</property>
<property name="baseSize">
<size>
<width>100</width>
@ -265,6 +360,9 @@
<property name="text">
<string>Add Contact &amp; send request</string>
</property>
<property name="autoDefault">
<bool>false</bool>
</property>
<property name="flat">
<bool>false</bool>
</property>

227
src/mainwindow.ui

@ -1569,7 +1569,7 @@
<widget class="QPushButton" name="pushContact">
<property name="geometry">
<rect>
<x>50</x>
<x>0</x>
<y>20</y>
<width>61</width>
<height>51</height>
@ -1607,7 +1607,7 @@
<widget class="QPushButton" name="givemeZaddr">
<property name="geometry">
<rect>
<x>210</x>
<x>70</x>
<y>20</y>
<width>61</width>
<height>51</height>
@ -1633,229 +1633,6 @@
<bool>true</bool>
</property>
</widget>
<widget class="QLabel" name="label_40">
<property name="geometry">
<rect>
<x>90</x>
<y>10</y>
<width>21</width>
<height>16</height>
</rect>
</property>
<property name="palette">
<palette>
<active>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>204</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Text">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>204</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="BrightText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>239</red>
<green>41</green>
<blue>41</blue>
</color>
</brush>
</colorrole>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>204</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="LinkVisited">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>204</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="ToolTipText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>204</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="PlaceholderText">
<brush brushstyle="SolidPattern">
<color alpha="128">
<red>204</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>204</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Text">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>204</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="BrightText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>239</red>
<green>41</green>
<blue>41</blue>
</color>
</brush>
</colorrole>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>204</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="LinkVisited">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>204</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="ToolTipText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>204</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="PlaceholderText">
<brush brushstyle="SolidPattern">
<color alpha="128">
<red>204</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>190</red>
<green>190</green>
<blue>190</blue>
</color>
</brush>
</colorrole>
<colorrole role="Text">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>190</red>
<green>190</green>
<blue>190</blue>
</color>
</brush>
</colorrole>
<colorrole role="BrightText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>239</red>
<green>41</green>
<blue>41</blue>
</color>
</brush>
</colorrole>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>190</red>
<green>190</green>
<blue>190</blue>
</color>
</brush>
</colorrole>
<colorrole role="LinkVisited">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>204</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="ToolTipText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>204</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="PlaceholderText">
<brush brushstyle="SolidPattern">
<color alpha="128">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
</property>
<property name="text">
<string>1</string>
</property>
<property name="textFormat">
<enum>Qt::AutoText</enum>
</property>
</widget>
</widget>
</widget>
</item>

144
src/requestContactDialog.ui

@ -14,10 +14,26 @@
<string>Incoming contact request</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QLabel" name="label">
<item row="6" column="1">
<widget class="QLabel" name="label_7">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-weight:600; text-decoration: underline;&quot;&gt;Open requests&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string>My Zaddr :</string>
</property>
</widget>
</item>
<item row="3" column="0" rowspan="7">
<widget class="QListView" name="requestContactOld">
<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>
</item>
@ -44,6 +60,16 @@
</property>
</widget>
</item>
<item row="6" column="2" colspan="3">
<widget class="QLineEdit" name="requestMyAddr"/>
</item>
<item row="7" column="1">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Give a Nickname:</string>
</property>
</widget>
</item>
<item row="1" column="1" colspan="4">
<widget class="QListView" name="requestMemo">
<property name="verticalScrollBarPolicy">
@ -72,13 +98,6 @@
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-weight:600; text-decoration: underline;&quot;&gt;Recently closed requests&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item row="2" column="1" rowspan="2" colspan="4">
<widget class="QLabel" name="label_4">
<property name="text">
@ -86,66 +105,10 @@
</property>
</widget>
</item>
<item row="3" column="0" rowspan="7">
<widget class="QListView" name="requestContactOld">
<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>
</item>
<item row="4" column="1">
<widget class="QLabel" name="label_8">
<property name="text">
<string>Request from :</string>
</property>
</widget>
</item>
<item row="4" column="2" colspan="3">
<widget class="QLineEdit" name="requestZaddr"/>
</item>
<item row="5" column="1">
<widget class="QLabel" name="label_9">
<property name="text">
<string>Cid :</string>
</property>
</widget>
</item>
<item row="5" column="2" colspan="3">
<widget class="QLineEdit" name="requestCID"/>
</item>
<item row="6" column="1">
<widget class="QLabel" name="label_7">
<property name="text">
<string>My Zaddr :</string>
</property>
</widget>
</item>
<item row="6" column="2" colspan="3">
<widget class="QLineEdit" name="requestMyAddr"/>
</item>
<item row="7" column="1">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Nickname</string>
</property>
</widget>
</item>
<item row="7" column="2" colspan="2">
<widget class="QLineEdit" name="requestLabel"/>
</item>
<item row="8" column="1" colspan="2">
<widget class="QLabel" name="label_6">
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;right&quot;&gt;Choose a avatar for your contact :&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-weight:600; text-decoration: underline;&quot;&gt;Open requests&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
@ -283,6 +246,19 @@
</item>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-weight:600; text-decoration: underline;&quot;&gt;Recently closed requests&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item row="7" column="2" colspan="2">
<widget class="QLineEdit" name="requestLabel"/>
</item>
<item row="4" column="2" colspan="3">
<widget class="QLineEdit" name="requestZaddr"/>
</item>
<item row="9" column="3">
<widget class="QPushButton" name="cancel">
<property name="baseSize">
@ -294,6 +270,9 @@
<property name="text">
<string>Cancel</string>
</property>
<property name="autoDefault">
<bool>false</bool>
</property>
<property name="flat">
<bool>false</bool>
</property>
@ -304,6 +283,33 @@
<property name="text">
<string>Add this new Contact</string>
</property>
<property name="autoDefault">
<bool>false</bool>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QLabel" name="label_8">
<property name="text">
<string>Request from :</string>
</property>
</widget>
</item>
<item row="8" column="1" colspan="2">
<widget class="QLabel" name="label_6">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;right&quot;&gt;Choose a avatar for your contact :&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item row="5" column="2" colspan="3">
<widget class="QLineEdit" name="requestCID"/>
</item>
<item row="5" column="1">
<widget class="QLabel" name="label_9">
<property name="text">
<string>Cid :</string>
</property>
</widget>
</item>
</layout>

Loading…
Cancel
Save