Browse Source

render only memos from a valid cid if checkbox is true

pull/130/head
DenioD 4 years ago
parent
commit
29492b73c3
  1. 24
      src/chatmodel.cpp
  2. 1
      src/mainwindow.cpp

24
src/chatmodel.cpp

@ -129,24 +129,34 @@ void ChatModel::renderChatBox(Ui::MainWindow* ui, QListWidget *view)
if ((ui->MyZaddr->text().trimmed() == c.second.getAddress()) && (c.second.getMemo().startsWith("{") == false) && (c.second.getMemo().isEmpty() == false)){
for(auto &p : AddressBook::getInstance()->getAllAddressLabels()){
if ((p.getCid() == c.second.getCid())){
line+= QString("[") + "Verified Message" + QString("]"); ////Todo: Render a green checkmark instead of QString
}else{
if ((ui->checkBox->isChecked() == true) && (p.getCid() != c.second.getCid()))
{
}else{
// line+= QString("[") + "Warning. Not verified!" + QString("]");
}
}
line += QString("[") + myDateTime.toString("dd.MM.yyyy hh:mm:ss ") + QString("] ");
line += QString("<") + QString("incoming") + QString("> :\n");
line += QString(c.second.getMemo()) + QString("\n");
view->addItem(line);
line ="";
}else{}
line ="";
}
}
}
}
}
void ChatModel::addCid(QString tx, QString cid)
{
this->cidMap[tx] = cid;

1
src/mainwindow.cpp

@ -39,6 +39,7 @@ MainWindow::MainWindow(QWidget *parent) :
ui->setupUi(this);
ui->checkBox->setChecked(true);
logger = new Logger(this, QDir(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation)).filePath("silentdragonlite-wallet.log"));
// Status Bar

Loading…
Cancel
Save