@@ -11,6 +11,17 @@
|
|||||||
<file>res/darkwing.png</file>
|
<file>res/darkwing.png</file>
|
||||||
<file>res/sdlogo.png</file>
|
<file>res/sdlogo.png</file>
|
||||||
<file>res/sdlogo2.png</file>
|
<file>res/sdlogo2.png</file>
|
||||||
|
<file>res/Berg.png</file>
|
||||||
|
<file>res/denio.png</file>
|
||||||
|
<file>res/duke.png</file>
|
||||||
|
<file>res/sharpee.png</file>
|
||||||
|
<file>res/yoda.png</file>
|
||||||
|
<file>res/mickey.png</file>
|
||||||
|
<file>res/snoopy.png</file>
|
||||||
|
<file>res/popey.png</file>
|
||||||
|
<file>res/garfield.png</file>
|
||||||
|
<file>res/pinguin.png</file>
|
||||||
|
<file>res/hirsch.png</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
<qresource prefix="/img">
|
<qresource prefix="/img">
|
||||||
<file>res/hushdlogo.gif</file>
|
<file>res/hushdlogo.gif</file>
|
||||||
|
|||||||
BIN
res/Berg.png
Normal file
|
After Width: | Height: | Size: 68 KiB |
BIN
res/Unbenannt-4 Kopie.png
Normal file
|
After Width: | Height: | Size: 86 KiB |
BIN
res/denio.png
Normal file
|
After Width: | Height: | Size: 65 KiB |
BIN
res/duke.png
Normal file
|
After Width: | Height: | Size: 75 KiB |
BIN
res/garfield.png
Normal file
|
After Width: | Height: | Size: 106 KiB |
BIN
res/hirsch.png
Normal file
|
After Width: | Height: | Size: 140 KiB |
BIN
res/mickey.png
Normal file
|
After Width: | Height: | Size: 57 KiB |
BIN
res/pinguin.png
Normal file
|
After Width: | Height: | Size: 52 KiB |
BIN
res/popey.png
Normal file
|
After Width: | Height: | Size: 38 KiB |
BIN
res/sharpee.png
Normal file
|
After Width: | Height: | Size: 5.9 KiB |
BIN
res/snoopy.png
Normal file
|
After Width: | Height: | Size: 45 KiB |
BIN
res/yoda.png
Normal file
|
After Width: | Height: | Size: 82 KiB |
@@ -12,6 +12,7 @@ PRECOMPILED_HEADER = src/precompiled.h
|
|||||||
|
|
||||||
QT += widgets
|
QT += widgets
|
||||||
QT += websockets
|
QT += websockets
|
||||||
|
QT += qml quick
|
||||||
|
|
||||||
TARGET = SilentDragonLite
|
TARGET = SilentDragonLite
|
||||||
|
|
||||||
@@ -33,6 +34,7 @@ mac: LIBS+= -Wl,-bind_at_load
|
|||||||
|
|
||||||
RESOURCES = application.qrc
|
RESOURCES = application.qrc
|
||||||
|
|
||||||
|
|
||||||
MOC_DIR = bin
|
MOC_DIR = bin
|
||||||
OBJECTS_DIR = bin
|
OBJECTS_DIR = bin
|
||||||
UI_DIR = src
|
UI_DIR = src
|
||||||
@@ -105,6 +107,7 @@ HEADERS += \
|
|||||||
src/contactmodel.h
|
src/contactmodel.h
|
||||||
|
|
||||||
FORMS += \
|
FORMS += \
|
||||||
|
src/contactrequest.ui \
|
||||||
src/encryption.ui \
|
src/encryption.ui \
|
||||||
src/mainwindow.ui \
|
src/mainwindow.ui \
|
||||||
src/migration.ui \
|
src/migration.ui \
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
AddressBookModel::AddressBookModel(QTableView *parent) : QAbstractTableModel(parent)
|
AddressBookModel::AddressBookModel(QTableView *parent) : QAbstractTableModel(parent)
|
||||||
{
|
{
|
||||||
headers << tr("Label") << tr("Address") << tr("HushChatAddress") << tr("cid");
|
headers << tr("Avatar")<< tr("Label") << tr("Address") << tr("HushChatAddress") << tr("CID");
|
||||||
this->parent = parent;
|
this->parent = parent;
|
||||||
loadData();
|
loadData();
|
||||||
}
|
}
|
||||||
@@ -38,10 +38,10 @@ void AddressBookModel::loadData()
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AddressBookModel::addNewLabel(QString label, QString addr, QString myAddr, QString cid)
|
void AddressBookModel::addNewLabel(QString label, QString addr, QString myAddr, QString cid, QString avatar)
|
||||||
{
|
{
|
||||||
//labels.push_back(QPair<QString, QString>(label, addr));
|
//labels.push_back(QPair<QString, QString>(label, addr));
|
||||||
AddressBook::getInstance()->addAddressLabel(label, addr, myAddr, cid);
|
AddressBook::getInstance()->addAddressLabel(label, addr, myAddr, cid, avatar);
|
||||||
updateUi();
|
updateUi();
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -59,7 +59,7 @@ void AddressBookModel::removeItemAt(int row)
|
|||||||
if (row >= labels.size())
|
if (row >= labels.size())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
AddressBook::getInstance()->removeAddressLabel(labels[row].getName(), labels[row].getPartnerAddress(), labels[row].getMyAddress(),labels[row].getCid());
|
AddressBook::getInstance()->removeAddressLabel(labels[row].getName(), labels[row].getPartnerAddress(), labels[row].getMyAddress(),labels[row].getCid(),labels[row].getAvatar());
|
||||||
labels.clear();
|
labels.clear();
|
||||||
labels = AddressBook::getInstance()->getAllAddressLabels();
|
labels = AddressBook::getInstance()->getAllAddressLabels();
|
||||||
dataChanged(index(0, 0), index(labels.size()-1, columnCount(index(0,0))-1));
|
dataChanged(index(0, 0), index(labels.size()-1, columnCount(index(0,0))-1));
|
||||||
@@ -70,7 +70,7 @@ ContactItem AddressBookModel::itemAt(int row)
|
|||||||
{
|
{
|
||||||
if (row >= labels.size())
|
if (row >= labels.size())
|
||||||
{
|
{
|
||||||
ContactItem item = ContactItem("", "", "", "");
|
ContactItem item = ContactItem("", "", "", "","");
|
||||||
return item;
|
return item;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -97,10 +97,11 @@ QVariant AddressBookModel::data(const QModelIndex &index, int role) const
|
|||||||
{
|
{
|
||||||
switch(index.column())
|
switch(index.column())
|
||||||
{
|
{
|
||||||
case 0: return labels.at(index.row()).getName();
|
case 0: return labels.at(index.row()).getAvatar();
|
||||||
case 1: return labels.at(index.row()).getPartnerAddress();
|
case 1: return labels.at(index.row()).getName();
|
||||||
case 2: return labels.at(index.row()).getMyAddress();
|
case 2: return labels.at(index.row()).getPartnerAddress();
|
||||||
case 3: return labels.at(index.row()).getCid();
|
case 3: return labels.at(index.row()).getMyAddress();
|
||||||
|
case 4: return labels.at(index.row()).getCid();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -168,6 +169,7 @@ void AddressBook::open(MainWindow* parent, QLineEdit* target)
|
|||||||
auto myAddr = ab.addr_chat->text().trimmed();
|
auto myAddr = ab.addr_chat->text().trimmed();
|
||||||
QString newLabel = ab.label->text();
|
QString newLabel = ab.label->text();
|
||||||
QString cid = ab.cid->text();
|
QString cid = ab.cid->text();
|
||||||
|
QString avatar = "res/yoda.png";
|
||||||
|
|
||||||
if (addr.isEmpty() || newLabel.isEmpty())
|
if (addr.isEmpty() || newLabel.isEmpty())
|
||||||
{
|
{
|
||||||
@@ -204,7 +206,7 @@ void AddressBook::open(MainWindow* parent, QLineEdit* target)
|
|||||||
}
|
}
|
||||||
|
|
||||||
////// We need a better popup here.
|
////// We need a better popup here.
|
||||||
AddressBook::getInstance()->addAddressLabel(newLabel, addr, myAddr, cid);
|
AddressBook::getInstance()->addAddressLabel(newLabel, addr, myAddr, cid,avatar);
|
||||||
QMessageBox::critical(
|
QMessageBox::critical(
|
||||||
parent,
|
parent,
|
||||||
QObject::tr("Add Successfully"),
|
QObject::tr("Add Successfully"),
|
||||||
@@ -256,7 +258,7 @@ void AddressBook::open(MainWindow* parent, QLineEdit* target)
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
// Add label, address.
|
// Add label, address.
|
||||||
model.addNewLabel(items.at(1), items.at(0), "", "");
|
model.addNewLabel(items.at(1), items.at(0), "", "", "");
|
||||||
numImported++;
|
numImported++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -267,7 +269,7 @@ void AddressBook::open(MainWindow* parent, QLineEdit* target)
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
auto fnSetTargetLabelAddr = [=] (QLineEdit* target, QString label, QString addr, QString myAddr, QString cid) {
|
auto fnSetTargetLabelAddr = [=] (QLineEdit* target, QString label, QString addr, QString myAddr, QString cid, QString avatar) {
|
||||||
target->setText(label % "/" % addr % myAddr);
|
target->setText(label % "/" % addr % myAddr);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -284,8 +286,9 @@ void AddressBook::open(MainWindow* parent, QLineEdit* target)
|
|||||||
QString addr = model.itemAt(index.row()).getPartnerAddress();
|
QString addr = model.itemAt(index.row()).getPartnerAddress();
|
||||||
QString myAddr = model.itemAt(index.row()).getMyAddress();
|
QString myAddr = model.itemAt(index.row()).getMyAddress();
|
||||||
QString cid = model.itemAt(index.row()).getCid();
|
QString cid = model.itemAt(index.row()).getCid();
|
||||||
|
QString avatar = model.itemAt(index.row()).getCid();
|
||||||
d.accept();
|
d.accept();
|
||||||
fnSetTargetLabelAddr(target, lbl, addr, myAddr, cid);
|
fnSetTargetLabelAddr(target, lbl, addr, myAddr, cid, avatar);
|
||||||
});
|
});
|
||||||
|
|
||||||
// Right-Click
|
// Right-Click
|
||||||
@@ -299,13 +302,14 @@ void AddressBook::open(MainWindow* parent, QLineEdit* target)
|
|||||||
QString addr = model.itemAt(index.row()).getPartnerAddress();
|
QString addr = model.itemAt(index.row()).getPartnerAddress();
|
||||||
QString myAddr = model.itemAt(index.row()).getMyAddress();
|
QString myAddr = model.itemAt(index.row()).getMyAddress();
|
||||||
QString cid = model.itemAt(index.row()).getCid();
|
QString cid = model.itemAt(index.row()).getCid();
|
||||||
|
QString avatar = model.itemAt(index.row()).getAvatar();
|
||||||
|
|
||||||
QMenu menu(parent);
|
QMenu menu(parent);
|
||||||
|
|
||||||
if (target != nullptr)
|
if (target != nullptr)
|
||||||
menu.addAction("Pick", [&] () {
|
menu.addAction("Pick", [&] () {
|
||||||
d.accept();
|
d.accept();
|
||||||
fnSetTargetLabelAddr(target, lbl, addr, myAddr, cid);
|
fnSetTargetLabelAddr(target, lbl, addr, myAddr, cid, avatar);
|
||||||
});
|
});
|
||||||
|
|
||||||
menu.addAction(QObject::tr("Copy address"), [&] () {
|
menu.addAction(QObject::tr("Copy address"), [&] () {
|
||||||
@@ -324,7 +328,7 @@ void AddressBook::open(MainWindow* parent, QLineEdit* target)
|
|||||||
auto selection = ab.addresses->selectionModel();
|
auto selection = ab.addresses->selectionModel();
|
||||||
if (selection && selection->hasSelection() && selection->selectedRows().size() > 0) {
|
if (selection && selection->hasSelection() && selection->selectedRows().size() > 0) {
|
||||||
auto item = model.itemAt(selection->selectedRows().at(0).row());
|
auto item = model.itemAt(selection->selectedRows().at(0).row());
|
||||||
fnSetTargetLabelAddr(target, item.getName(), item.getMyAddress(), item.getPartnerAddress(), item.getCid());
|
fnSetTargetLabelAddr(target, item.getName(), item.getMyAddress(), item.getPartnerAddress(), item.getCid(), item.getAvatar());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -370,7 +374,7 @@ void AddressBook::readFromStorage()
|
|||||||
//qDebug() << "0:" << stuff[i][0];
|
//qDebug() << "0:" << stuff[i][0];
|
||||||
//qDebug() << "1:" << stuff[i][1];
|
//qDebug() << "1:" << stuff[i][1];
|
||||||
//qDebug() << "2:" << stuff[i][2];
|
//qDebug() << "2:" << stuff[i][2];
|
||||||
ContactItem contact = ContactItem(stuff[i][0],stuff[i][1], stuff[i][2], stuff[i][3]);
|
ContactItem contact = ContactItem(stuff[i][0],stuff[i][1], stuff[i][2], stuff[i][3],stuff[i][4]);
|
||||||
//qDebug() << "contact=" << contact.toQTString();
|
//qDebug() << "contact=" << contact.toQTString();
|
||||||
allLabels.push_back(contact);
|
allLabels.push_back(contact);
|
||||||
}
|
}
|
||||||
@@ -406,6 +410,7 @@ void AddressBook::writeToStorage()
|
|||||||
c.push_back(item.getPartnerAddress());
|
c.push_back(item.getPartnerAddress());
|
||||||
c.push_back(item.getMyAddress());
|
c.push_back(item.getMyAddress());
|
||||||
c.push_back(item.getCid());
|
c.push_back(item.getCid());
|
||||||
|
c.push_back(item.getAvatar());
|
||||||
contacts.push_back(c);
|
contacts.push_back(c);
|
||||||
}
|
}
|
||||||
out << QString("v1") << contacts;
|
out << QString("v1") << contacts;
|
||||||
@@ -428,22 +433,22 @@ QString AddressBook::writeableFile()
|
|||||||
|
|
||||||
|
|
||||||
// Add a new address/label to the database
|
// Add a new address/label to the database
|
||||||
void AddressBook::addAddressLabel(QString label, QString address, QString myAddr, QString cid)
|
void AddressBook::addAddressLabel(QString label, QString address, QString myAddr, QString cid, QString avatar)
|
||||||
{
|
{
|
||||||
Q_ASSERT(Settings::isValidAddress(address));
|
Q_ASSERT(Settings::isValidAddress(address));
|
||||||
// getName(), remove any existing label
|
// getName(), remove any existing label
|
||||||
// Iterate over the list and remove the label/address
|
// Iterate over the list and remove the label/address
|
||||||
for (int i=0; i < allLabels.size(); i++)
|
for (int i=0; i < allLabels.size(); i++)
|
||||||
if (allLabels[i].getName() == label)
|
if (allLabels[i].getName() == label)
|
||||||
removeAddressLabel(allLabels[i].getName(), allLabels[i].getPartnerAddress(),allLabels[i].getMyAddress(), allLabels[i].getCid());
|
removeAddressLabel(allLabels[i].getName(), allLabels[i].getPartnerAddress(),allLabels[i].getMyAddress(), allLabels[i].getCid(), allLabels[i].getAvatar());
|
||||||
|
|
||||||
ContactItem item = ContactItem(label, address, myAddr, cid);
|
ContactItem item = ContactItem(label, address, myAddr, cid, avatar);
|
||||||
allLabels.push_back(item);
|
allLabels.push_back(item);
|
||||||
writeToStorage();
|
writeToStorage();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove a new address/label from the database
|
// Remove a new address/label from the database
|
||||||
void AddressBook::removeAddressLabel(QString label, QString address, QString myAddr, QString cid)
|
void AddressBook::removeAddressLabel(QString label, QString address, QString myAddr, QString cid, QString avatar)
|
||||||
{
|
{
|
||||||
// Iterate over the list and remove the label/address
|
// Iterate over the list and remove the label/address
|
||||||
for (int i=0; i < allLabels.size(); i++)
|
for (int i=0; i < allLabels.size(); i++)
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ public:
|
|||||||
AddressBookModel(QTableView* parent);
|
AddressBookModel(QTableView* parent);
|
||||||
~AddressBookModel();
|
~AddressBookModel();
|
||||||
|
|
||||||
void addNewLabel(QString label, QString address, QString myAddr, QString cid);
|
void addNewLabel(QString label, QString address, QString myAddr, QString cid, QString avatar);
|
||||||
void updateUi();
|
void updateUi();
|
||||||
void removeItemAt(int row);
|
void removeItemAt(int row);
|
||||||
//QPair<QString, QString> itemAt(int row);
|
//QPair<QString, QString> itemAt(int row);
|
||||||
@@ -43,10 +43,10 @@ public:
|
|||||||
static QString addressFromAddressLabel(const QString& lblAddr);
|
static QString addressFromAddressLabel(const QString& lblAddr);
|
||||||
|
|
||||||
// Add a new address/label to the database
|
// Add a new address/label to the database
|
||||||
void addAddressLabel(QString label, QString address, QString myAddr, QString cid);
|
void addAddressLabel(QString label, QString address, QString myAddr, QString cid, QString avatar);
|
||||||
|
|
||||||
// Remove a new address/label from the database
|
// Remove a new address/label from the database
|
||||||
void removeAddressLabel(QString label, QString address, QString myAddr, QString cid);
|
void removeAddressLabel(QString label, QString address, QString myAddr, QString cid, QString avatar);
|
||||||
|
|
||||||
// Update a label/address
|
// Update a label/address
|
||||||
void updateLabel(QString oldlabel, QString address, QString newlabel);
|
void updateLabel(QString oldlabel, QString address, QString newlabel);
|
||||||
|
|||||||
@@ -30,7 +30,7 @@
|
|||||||
<item row="0" column="1">
|
<item row="0" column="1">
|
||||||
<widget class="QLabel" name="label_2">
|
<widget class="QLabel" name="label_2">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Nickname</string>
|
<string><html><head/><body><p align="right">Nickname :</p></body></html></string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@@ -51,9 +51,130 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="2" column="1">
|
||||||
|
<widget class="QLabel" name="label_5">
|
||||||
|
<property name="text">
|
||||||
|
<string><html><head/><body><p align="right">Avatar :</p></body></html></string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item row="3" column="0">
|
<item row="3" column="0">
|
||||||
<widget class="QLineEdit" name="addr_chat"/>
|
<widget class="QLineEdit" name="addr_chat"/>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="3" column="1">
|
||||||
|
<widget class="QComboBox" name="comboBoxAvatar">
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>Stag</string>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset>
|
||||||
|
<activeon>:/icons/res/hirsch.png</activeon>
|
||||||
|
</iconset>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>Denio</string>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset>
|
||||||
|
<activeon>:/icons/res/denio.png</activeon>
|
||||||
|
</iconset>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>Duke</string>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset>
|
||||||
|
<activeon>:/icons/res/duke.png</activeon>
|
||||||
|
</iconset>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>Yoda</string>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset>
|
||||||
|
<activeon>:/icons/res/yoda.png</activeon>
|
||||||
|
</iconset>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>Berg</string>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset>
|
||||||
|
<activeon>:/icons/res/Berg.png</activeon>
|
||||||
|
</iconset>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>Sharpee</string>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset>
|
||||||
|
<activeon>:/icons/res/sharpee.png</activeon>
|
||||||
|
</iconset>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>Garflied</string>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset>
|
||||||
|
<activeon>:/icons/res/garfield.png</activeon>
|
||||||
|
</iconset>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>Snoopy</string>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset>
|
||||||
|
<activeon>:/icons/res/snoopy.png</activeon>
|
||||||
|
</iconset>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>Popey</string>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset>
|
||||||
|
<activeon>:/icons/res/popey.png</activeon>
|
||||||
|
</iconset>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>Pinguin</string>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset>
|
||||||
|
<activeon>:/icons/res/pinguin.png</activeon>
|
||||||
|
</iconset>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>SDLogo</string>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset>
|
||||||
|
<activeon>:/icons/res/sdlogo2.png</activeon>
|
||||||
|
</iconset>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item row="4" column="0">
|
<item row="4" column="0">
|
||||||
<widget class="QLabel" name="label_4">
|
<widget class="QLabel" name="label_4">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
|
|||||||
@@ -377,12 +377,28 @@ QString MainWindow::doSendChatTxValidations(Tx tx) {
|
|||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create a Contact Request.
|
|
||||||
Tx MainWindow::createTxForSafeContactRequest() {
|
|
||||||
Tx tx;
|
|
||||||
CAmount totalAmt;
|
|
||||||
{
|
|
||||||
|
|
||||||
|
// Create a Tx from the current state of the Chat page.
|
||||||
|
Tx MainWindow::createTxForSafeContactRequest() {
|
||||||
|
|
||||||
|
Ui_Dialog request;
|
||||||
|
QDialog dialog(this);
|
||||||
|
request.setupUi(&dialog);
|
||||||
|
Settings::saveRestore(&dialog);
|
||||||
|
dialog.exec();
|
||||||
|
|
||||||
|
Tx tx;
|
||||||
|
|
||||||
|
QObject::connect(request.cancel, &QPushButton::clicked, [&] () {
|
||||||
|
|
||||||
|
dialog.close();
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
QObject::connect(request.sendRequestButton, &QPushButton::clicked, this, &MainWindow::ContactRequest);
|
||||||
|
// For each addr/amt in the Chat tab
|
||||||
|
{
|
||||||
|
CAmount totalAmt;
|
||||||
QString amtStr = "0";
|
QString amtStr = "0";
|
||||||
CAmount amt;
|
CAmount amt;
|
||||||
|
|
||||||
@@ -392,48 +408,46 @@ Tx MainWindow::createTxForSafeContactRequest() {
|
|||||||
|
|
||||||
|
|
||||||
for(auto &c : AddressBook::getInstance()->getAllAddressLabels())
|
for(auto &c : AddressBook::getInstance()->getAllAddressLabels())
|
||||||
|
if (request.zaddr->text().trimmed() != c.getPartnerAddress()) {
|
||||||
|
|
||||||
if (ui->contactNameMemo->text().trimmed() == c.getName()) {
|
|
||||||
|
|
||||||
// QString cid = c.getCid(); // This has to be a new cid for the contact
|
QString cid = c.getCid();
|
||||||
// QString myAddr = c.getMyAddress(); // this should be a new HushChat zaddr
|
QString myAddr = c.getMyAddress();
|
||||||
// QString addr = c.getPartnerAddress(); // this address will be insert by the user
|
QString type = "cont";
|
||||||
QString cid = c.getCid();
|
QString addr = request.zaddr->text();
|
||||||
QString myAddr = c.getMyAddress();
|
|
||||||
QString addr = c.getPartnerAddress();
|
|
||||||
QString type = "cont";
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
QString hmemo= createHeaderMemo(type,cid,myAddr,0,0);
|
||||||
QString hmemo= createHeaderMemo(type,cid,myAddr);
|
QString memo = request.requestmemo->toPlainText().trimmed();
|
||||||
|
|
||||||
tx.toAddrs.push_back(ToFields{addr, amt, hmemo}) ;
|
|
||||||
|
|
||||||
qDebug() << "pushback chattx";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
tx.fee = Settings::getMinerFee();
|
tx.toAddrs.push_back(ToFields{addr, amt, hmemo});
|
||||||
|
tx.toAddrs.push_back(ToFields{addr, amt, memo});
|
||||||
|
|
||||||
|
qDebug() << "pushback chattx";
|
||||||
|
tx.fee = Settings::getMinerFee();
|
||||||
|
|
||||||
return tx;
|
return tx;
|
||||||
|
|
||||||
qDebug() << "ChatTx created";
|
qDebug() << "ChatTx created";
|
||||||
|
} if (request.zaddr->text().trimmed().isEmpty() == false){
|
||||||
|
|
||||||
|
QMessageBox msg(QMessageBox::Critical, tr("Please insert a contact Address"), request.zaddr->text(),
|
||||||
|
QMessageBox::Ok, this);
|
||||||
|
|
||||||
|
msg.exec();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
//////////////////De-activated for now///////////////////
|
void MainWindow::ContactRequest() {
|
||||||
void MainWindow::safeContactRequest() {
|
|
||||||
|
|
||||||
|
|
||||||
// Ui_ContactRequest contactRequest;
|
|
||||||
// QDialog dialog(this);
|
|
||||||
// contactRequest.setupUi(&dialog);
|
|
||||||
// Settings::saveRestore(&dialog);
|
|
||||||
|
|
||||||
// memoDialog.memoTxt->setLenDisplayLabel(memoDialog.memoSize);
|
////////////////////////////Todo: Check if a Contact is selected//////////
|
||||||
// memoDialog.memoTxt->setAcceptButton(memoDialog.buttonBox->button(QDialogButtonBox::Ok));
|
|
||||||
|
|
||||||
////////////////////////////Todo: Check if its a zaddr//////////
|
|
||||||
|
|
||||||
// Create a Tx from the values on the send tab. Note that this Tx object
|
// Create a Tx from the values on the send tab. Note that this Tx object
|
||||||
// might not be valid yet.
|
// might not be valid yet.
|
||||||
@@ -441,21 +455,24 @@ void MainWindow::safeContactRequest() {
|
|||||||
// Memos can only be used with zAddrs. So check that first
|
// Memos can only be used with zAddrs. So check that first
|
||||||
// for(auto &c : AddressBook::getInstance()->getAllAddressLabels())
|
// for(auto &c : AddressBook::getInstance()->getAllAddressLabels())
|
||||||
|
|
||||||
// if (ui->ContactZaddr->text().trimmed() == c.getName()) {
|
// if (ui->contactNameMemo->text().trimmed().isEmpty() || ui->memoTxtChat->toPlainText().trimmed().isEmpty()) {
|
||||||
|
|
||||||
// auto addr = "";
|
// auto addr = "";
|
||||||
// if (! Settings::isZAddress(AddressBook::addressFromAddressLabel(addr->text()))) {
|
// if (! Settings::isZAddress(AddressBook::addressFromAddressLabel(addr->text()))) {
|
||||||
// QMessageBox msg(QMessageBox::Critical, tr("Contact requests can only be used with z-addresses"),
|
// QMessageBox msg(QMessageBox::Critical, tr("You have to select a contact and insert a Memo"),
|
||||||
// tr("The memo field can only be used with a z-address.\n") + addr->text() + tr("\ndoesn't look like a z-address"),
|
// tr("You have selected no Contact from Contactlist,\n") + tr("\nor your Memo is empty"),
|
||||||
// QMessageBox::Ok, this);
|
// QMessageBox::Ok, this);
|
||||||
|
|
||||||
// msg.exec();
|
// msg.exec();
|
||||||
// return;
|
// return;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
Tx tx = createTxForSafeContactRequest();
|
|
||||||
|
|
||||||
QString error = doSendRequestTxValidations(tx);
|
//};
|
||||||
|
|
||||||
|
Tx tx = createTxForSafeContactRequest();
|
||||||
|
|
||||||
|
QString error = doSendChatTxValidations(tx);
|
||||||
|
|
||||||
if (!error.isEmpty()) {
|
if (!error.isEmpty()) {
|
||||||
// Something went wrong, so show an error and exit
|
// Something went wrong, so show an error and exit
|
||||||
@@ -469,7 +486,6 @@ void MainWindow::safeContactRequest() {
|
|||||||
qDebug() << "Tx aborted";
|
qDebug() << "Tx aborted";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create a new Dialog to show that we are computing/sending the Tx
|
|
||||||
// Create a new Dialog to show that we are computing/sending the Tx
|
// Create a new Dialog to show that we are computing/sending the Tx
|
||||||
auto d = new QDialog(this);
|
auto d = new QDialog(this);
|
||||||
auto connD = new Ui_ConnectionDialog();
|
auto connD = new Ui_ConnectionDialog();
|
||||||
@@ -488,9 +504,10 @@ void MainWindow::safeContactRequest() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
connD->status->setText(tr("Please wait..."));
|
connD->status->setText(tr("Please wait..."));
|
||||||
connD->statusDetail->setText(tr("Your Contact Request will be send"));
|
connD->statusDetail->setText(tr("Your Message will be send"));
|
||||||
|
|
||||||
d->show();
|
d->show();
|
||||||
|
ui->memoTxtChat->clear();
|
||||||
|
|
||||||
// And send the Tx
|
// And send the Tx
|
||||||
rpc->executeTransaction(tx,
|
rpc->executeTransaction(tx,
|
||||||
@@ -509,7 +526,8 @@ void MainWindow::safeContactRequest() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Force a UI update so we get the unconfirmed Tx
|
// Force a UI update so we get the unconfirmed Tx
|
||||||
rpc->refresh(true);
|
// rpc->refresh(true);
|
||||||
|
ui->memoTxtChat->clear();
|
||||||
|
|
||||||
},
|
},
|
||||||
// Errored out
|
// Errored out
|
||||||
@@ -527,6 +545,7 @@ void MainWindow::safeContactRequest() {
|
|||||||
QMessageBox::critical(this, QObject::tr("Transaction Error"), errStr, QMessageBox::Ok);
|
QMessageBox::critical(this, QObject::tr("Transaction Error"), errStr, QMessageBox::Ok);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -3,34 +3,29 @@
|
|||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
|
|
||||||
void ContactModel::renderContactList(QListView* view)
|
void ContactModel::renderContactList(QListView* view)
|
||||||
{ // QStandardItem(const QIcon & icon, const QString & text)
|
{
|
||||||
QStandardItemModel* contact = new QStandardItemModel();
|
QStandardItemModel* contact = new QStandardItemModel();
|
||||||
//}
|
|
||||||
for(auto &c : AddressBook::getInstance()->getAllAddressLabels())
|
for(auto &c : AddressBook::getInstance()->getAllAddressLabels())
|
||||||
{
|
{
|
||||||
|
|
||||||
//QStandardItem* Items = new QStandardItem();
|
|
||||||
auto theme = Settings::getInstance()->get_theme_name();
|
auto theme = Settings::getInstance()->get_theme_name();
|
||||||
if ((theme == "dark" || theme == "midnight")) {
|
if ((theme == "dark" || theme == "midnight")) {
|
||||||
QStandardItem* Items1 = new QStandardItem(QIcon("res/sdlogo.png"),c.getName());
|
|
||||||
|
// QIcon avatar = c.getAvatar();
|
||||||
|
QString avatar = "res/yoda.png";
|
||||||
|
|
||||||
|
QStandardItem* Items1 = new QStandardItem(QIcon(avatar) ,c.getName());
|
||||||
contact->appendRow(Items1);
|
contact->appendRow(Items1);
|
||||||
view->setModel(contact);
|
view->setModel(contact);
|
||||||
view->setIconSize(QSize(60,70));
|
view->setIconSize(QSize(60,70));
|
||||||
view->setUniformItemSizes(true);
|
view->setUniformItemSizes(true);
|
||||||
view->setDragDropMode(QAbstractItemView::DropOnly);;
|
view->setDragDropMode(QAbstractItemView::DropOnly);
|
||||||
}
|
|
||||||
if (theme == "default" || theme == "blue"){
|
|
||||||
|
|
||||||
QStandardItem* Items1 = new QStandardItem(QIcon("res/sdlogo2.png"),c.getName());
|
|
||||||
contact->appendRow(Items1);
|
|
||||||
view->setModel(contact);
|
|
||||||
view->setIconSize(QSize(60,70));
|
|
||||||
view->setUniformItemSizes(true);
|
|
||||||
view->setDragDropMode(QAbstractItemView::DropOnly);;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -14,15 +14,17 @@ class ContactItem
|
|||||||
QString _partnerAddress;
|
QString _partnerAddress;
|
||||||
QString _name;
|
QString _name;
|
||||||
QString _cid;
|
QString _cid;
|
||||||
|
QString _avatar;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ContactItem();
|
ContactItem();
|
||||||
ContactItem(QString name, QString partnerAddress, QString myAddress, QString cid)
|
ContactItem(QString name, QString partnerAddress, QString myAddress, QString cid, QString avatar)
|
||||||
{
|
{
|
||||||
_name = name;
|
_name = name;
|
||||||
_myAddress = myAddress;
|
_myAddress = myAddress;
|
||||||
_partnerAddress = partnerAddress;
|
_partnerAddress = partnerAddress;
|
||||||
_cid = cid;
|
_cid = cid;
|
||||||
|
_avatar = avatar;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString getName() const
|
QString getName() const
|
||||||
@@ -45,6 +47,11 @@ class ContactItem
|
|||||||
return _cid;
|
return _cid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString getAvatar() const
|
||||||
|
{
|
||||||
|
return _avatar;
|
||||||
|
}
|
||||||
|
|
||||||
void setName(QString name)
|
void setName(QString name)
|
||||||
{
|
{
|
||||||
_name = name;
|
_name = name;
|
||||||
@@ -64,10 +71,14 @@ class ContactItem
|
|||||||
{
|
{
|
||||||
_cid = cid;
|
_cid = cid;
|
||||||
}
|
}
|
||||||
|
void setAvatar(QString avatar)
|
||||||
|
{
|
||||||
|
_avatar = avatar;
|
||||||
|
}
|
||||||
|
|
||||||
QString toQTString()
|
QString toQTString()
|
||||||
{
|
{
|
||||||
return _name + "|" + _partnerAddress + "|" + _myAddress + "|" + _cid;
|
return _name + "|" + _partnerAddress + "|" + _myAddress + "|" + _cid + "|"+ _avatar;
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,72 +1,165 @@
|
|||||||
<ui version="4.0" >
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<author></author>
|
<ui version="4.0">
|
||||||
<comment></comment>
|
|
||||||
<exportmacro></exportmacro>
|
|
||||||
<class>Dialog</class>
|
<class>Dialog</class>
|
||||||
<widget class="QDialog" name="Dialog" >
|
<widget class="QDialog" name="Dialog">
|
||||||
<property name="geometry" >
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>400</width>
|
<width>780</width>
|
||||||
<height>300</height>
|
<height>416</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle" >
|
<property name="windowTitle">
|
||||||
<string>Dialog</string>
|
<string>Dialog</string>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QDialogButtonBox" name="buttonBox" >
|
<widget class="QLabel" name="label">
|
||||||
<property name="geometry" >
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>30</x>
|
<x>0</x>
|
||||||
<y>240</y>
|
<y>100</y>
|
||||||
<width>341</width>
|
<width>351</width>
|
||||||
<height>32</height>
|
<height>17</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="orientation" >
|
<property name="text">
|
||||||
<enum>Qt::Horizontal</enum>
|
<string><html><head/><body><p>Please insert the Address of your contact :</p></body></html></string>
|
||||||
</property>
|
</property>
|
||||||
<property name="standardButtons" >
|
</widget>
|
||||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
<widget class="QLabel" name="label_2">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>10</x>
|
||||||
|
<y>190</y>
|
||||||
|
<width>461</width>
|
||||||
|
<height>17</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string><html><head/><body><p>Insert a Message, and ask your friend for the contact request : </p><p><br/></p></body></html></string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QTextEdit" name="requestmemo">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>240</y>
|
||||||
|
<width>591</width>
|
||||||
|
<height>101</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QLineEdit" name="zaddr">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>140</y>
|
||||||
|
<width>591</width>
|
||||||
|
<height>25</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QPushButton" name="sendRequestButton">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>490</x>
|
||||||
|
<y>360</y>
|
||||||
|
<width>114</width>
|
||||||
|
<height>25</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="baseSize">
|
||||||
|
<size>
|
||||||
|
<width>100</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Send</string>
|
||||||
|
</property>
|
||||||
|
<property name="flat">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QPushButton" name="cancel">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>320</x>
|
||||||
|
<y>360</y>
|
||||||
|
<width>114</width>
|
||||||
|
<height>25</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="baseSize">
|
||||||
|
<size>
|
||||||
|
<width>100</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Cancel</string>
|
||||||
|
</property>
|
||||||
|
<property name="flat">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QLabel" name="label_3">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>10</y>
|
||||||
|
<width>351</width>
|
||||||
|
<height>17</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string><html><head/><body><p>Please insert a Nickname for your contact :</p></body></html></string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QLineEdit" name="labelRequest">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>50</y>
|
||||||
|
<width>591</width>
|
||||||
|
<height>25</height>
|
||||||
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
<pixmapfunction></pixmapfunction>
|
|
||||||
<resources/>
|
<resources/>
|
||||||
<connections>
|
<connections>
|
||||||
<connection>
|
<connection>
|
||||||
<sender>buttonBox</sender>
|
<sender>sendRequestButton</sender>
|
||||||
<signal>accepted()</signal>
|
<signal>clicked()</signal>
|
||||||
<receiver>Dialog</receiver>
|
<receiver>Dialog</receiver>
|
||||||
<slot>accept()</slot>
|
<slot>accept()</slot>
|
||||||
<hints>
|
<hints>
|
||||||
<hint type="sourcelabel" >
|
<hint type="sourcelabel">
|
||||||
<x>248</x>
|
<x>536</x>
|
||||||
<y>254</y>
|
<y>262</y>
|
||||||
</hint>
|
</hint>
|
||||||
<hint type="destinationlabel" >
|
<hint type="destinationlabel">
|
||||||
<x>157</x>
|
<x>389</x>
|
||||||
<y>274</y>
|
<y>207</y>
|
||||||
</hint>
|
</hint>
|
||||||
</hints>
|
</hints>
|
||||||
</connection>
|
</connection>
|
||||||
<connection>
|
<connection>
|
||||||
<sender>buttonBox</sender>
|
<sender>cancel</sender>
|
||||||
<signal>rejected()</signal>
|
<signal>clicked()</signal>
|
||||||
<receiver>Dialog</receiver>
|
<receiver>Dialog</receiver>
|
||||||
<slot>reject()</slot>
|
<slot>reject()</slot>
|
||||||
<hints>
|
<hints>
|
||||||
<hint type="sourcelabel" >
|
<hint type="sourcelabel">
|
||||||
<x>316</x>
|
<x>396</x>
|
||||||
<y>260</y>
|
<y>262</y>
|
||||||
</hint>
|
</hint>
|
||||||
<hint type="destinationlabel" >
|
<hint type="destinationlabel">
|
||||||
<x>286</x>
|
<x>389</x>
|
||||||
<y>274</y>
|
<y>207</y>
|
||||||
</hint>
|
</hint>
|
||||||
</hints>
|
</hints>
|
||||||
</connection>
|
</connection>
|
||||||
</connections>
|
</connections>
|
||||||
</ui>
|
</ui>
|
||||||
|
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
#include "settings.h"
|
#include "settings.h"
|
||||||
#include "version.h"
|
#include "version.h"
|
||||||
#include "connection.h"
|
#include "connection.h"
|
||||||
|
#include "ui_contactrequest.h"
|
||||||
#include "requestdialog.h"
|
#include "requestdialog.h"
|
||||||
#include "websockets.h"
|
#include "websockets.h"
|
||||||
#include <QRegularExpression>
|
#include <QRegularExpression>
|
||||||
@@ -1006,7 +1007,8 @@ void MainWindow::setupchatTab() {
|
|||||||
|
|
||||||
// Send button
|
// Send button
|
||||||
QObject::connect(ui->sendChatButton, &QPushButton::clicked, this, &MainWindow::sendChatButton);
|
QObject::connect(ui->sendChatButton, &QPushButton::clicked, this, &MainWindow::sendChatButton);
|
||||||
QObject::connect(ui->safeContactRequest, &QPushButton::clicked, this, &MainWindow::safeContactRequest);
|
QObject::connect(ui->safeContactRequest, &QPushButton::clicked, this, &MainWindow::ContactRequest);
|
||||||
|
|
||||||
|
|
||||||
///////// Set selected Zaddr for Chat with Doubleklick
|
///////// Set selected Zaddr for Chat with Doubleklick
|
||||||
|
|
||||||
@@ -1032,6 +1034,7 @@ void MainWindow::setupchatTab() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ChatMemoEdit::ChatMemoEdit(QWidget* parent) : QPlainTextEdit(parent) {
|
ChatMemoEdit::ChatMemoEdit(QWidget* parent) : QPlainTextEdit(parent) {
|
||||||
QObject::connect(this, &QPlainTextEdit::textChanged, this, &ChatMemoEdit::updateDisplay);
|
QObject::connect(this, &QPlainTextEdit::textChanged, this, &ChatMemoEdit::updateDisplay);
|
||||||
}
|
}
|
||||||
@@ -1316,6 +1319,7 @@ void MainWindow::setupReceiveTab() {
|
|||||||
// Receive tab add/update label
|
// Receive tab add/update label
|
||||||
QObject::connect(ui->rcvUpdateLabel, &QPushButton::clicked, [=]() {
|
QObject::connect(ui->rcvUpdateLabel, &QPushButton::clicked, [=]() {
|
||||||
QString addr = ui->listReceiveAddresses->currentText();
|
QString addr = ui->listReceiveAddresses->currentText();
|
||||||
|
|
||||||
if (addr.isEmpty())
|
if (addr.isEmpty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -1329,7 +1333,7 @@ void MainWindow::setupReceiveTab() {
|
|||||||
|
|
||||||
if (!curLabel.isEmpty() && label.isEmpty()) {
|
if (!curLabel.isEmpty() && label.isEmpty()) {
|
||||||
info = "Removed Label '" % curLabel % "'";
|
info = "Removed Label '" % curLabel % "'";
|
||||||
AddressBook::getInstance()->removeAddressLabel(curLabel, addr, "", "");
|
AddressBook::getInstance()->removeAddressLabel(curLabel, addr, "", "","" );
|
||||||
}
|
}
|
||||||
else if (!curLabel.isEmpty() && !label.isEmpty()) {
|
else if (!curLabel.isEmpty() && !label.isEmpty()) {
|
||||||
info = "Updated Label '" % curLabel % "' to '" % label % "'";
|
info = "Updated Label '" % curLabel % "' to '" % label % "'";
|
||||||
@@ -1337,7 +1341,7 @@ void MainWindow::setupReceiveTab() {
|
|||||||
}
|
}
|
||||||
else if (curLabel.isEmpty() && !label.isEmpty()) {
|
else if (curLabel.isEmpty() && !label.isEmpty()) {
|
||||||
info = "Added Label '" % label % "'";
|
info = "Added Label '" % label % "'";
|
||||||
AddressBook::getInstance()->addAddressLabel(label, addr, "", "");
|
AddressBook::getInstance()->addAddressLabel(label, addr, "", "", "");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update labels everywhere on the UI
|
// Update labels everywhere on the UI
|
||||||
|
|||||||
@@ -108,13 +108,14 @@ private:
|
|||||||
Tx createTxFromChatPage();
|
Tx createTxFromChatPage();
|
||||||
Tx createTxForSafeContactRequest();
|
Tx createTxForSafeContactRequest();
|
||||||
|
|
||||||
|
|
||||||
void encryptWallet();
|
void encryptWallet();
|
||||||
void removeWalletEncryption();
|
void removeWalletEncryption();
|
||||||
|
|
||||||
void cancelButton();
|
void cancelButton();
|
||||||
void sendButton();
|
void sendButton();
|
||||||
void sendChatButton();
|
void sendChatButton();
|
||||||
void safeContactRequest();
|
void ContactRequest();
|
||||||
void addAddressSection();
|
void addAddressSection();
|
||||||
void maxAmountChecked(int checked);
|
void maxAmountChecked(int checked);
|
||||||
|
|
||||||
|
|||||||