Added info widget for encrypted messages in MessageWidget.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6774 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2013-09-28 22:05:38 +00:00
parent 40ed94f7fb
commit 4dd77457ad
8 changed files with 248 additions and 77 deletions

View file

@ -727,7 +727,7 @@ void MessagesDialog::changeBox(int)
listMode = LIST_BOX;
insertMessages();
insertMsgTxtAndFiles();
insertMsgTxtAndFiles(ui.messagestreeView->currentIndex());
inChange = false;
}
@ -749,7 +749,7 @@ void MessagesDialog::changeQuickView(int newrow)
listMode = LIST_QUICKVIEW;
insertMessages();
insertMsgTxtAndFiles();
insertMsgTxtAndFiles(ui.messagestreeView->currentIndex());
inChange = false;
}
@ -1516,33 +1516,15 @@ void MessagesDialog::insertMsgTxtAndFiles(QModelIndex Index, bool bSetToRead)
void MessagesDialog::decryptSelectedMsg()
{
MessageInfo msgInfo;
if (!MessageWidget::decryptMsg(mCurrMsgId)) {
return;
}
if (!rsMsgs->getMessage(mCurrMsgId, msgInfo))
return ;
// Force refill
mCurrMsgId.clear();
msgWidget->fill("");
if(!msgInfo.msgflags & RS_MSG_ENCRYPTED)
{
QMessageBox::warning(NULL,tr("Decryption failed!"),tr("This message is not encrypted. Cannot decrypt!")) ;
return ;
}
if(!rsMsgs->decryptMessage(mCurrMsgId) )
QMessageBox::warning(NULL,tr("Decryption failed!"),tr("This message could not be decrypted.")) ;
//setMsgAsReadUnread(currentIndex.row(), true);
timer->start();
updateMessageSummaryList();
//QModelIndex currentIndex = ui.messagestreeView->currentIndex();
//QModelIndex index = ui.messagestreeView->model()->index(currentIndex.row(), COLUMN_UNREAD, currentIndex.parent());
//currentChanged(index);
MessagesModel->removeRows (0, MessagesModel->rowCount());
insertMessages();
insertMsgTxtAndFiles();
insertMsgTxtAndFiles(ui.messagestreeView->currentIndex());
}
bool MessagesDialog::getCurrentMsg(std::string &cid, std::string &mid)