Updated GUI to use new Message / Mail interface.

Configuration is in MessageInterface.h for the moment



git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@8067 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
drbob 2015-03-22 04:52:53 +00:00
parent 7cece484c4
commit 926dd3c8e4
15 changed files with 126 additions and 79 deletions

View File

@ -46,6 +46,8 @@
#include <algorithm>
#include "gui/msgs/MessageInterface.h"
/* Images for context menu icons */
#define IMAGE_MESSAGE ":/images/folder-draft.png"
#define IMAGE_MESSAGEREMOVE ":/images/message-mail-imapdelete.png"
@ -410,7 +412,7 @@ void MessagesDialog::changeEvent(QEvent *e)
void MessagesDialog::fillQuickView()
{
MsgTagType tags;
rsMsgs->getMessageTagTypes(tags);
rsMail->getMessageTagTypes(tags);
std::map<uint32_t, std::pair<std::string, uint32_t> >::iterator tag;
// fill tags
@ -543,7 +545,7 @@ void MessagesDialog::messageTreeWidgetCustomPopupMenu(QPoint /*point*/)
MessageInfo msgInfo;
if (getCurrentMsg(cid, mid)) {
rsMsgs->getMessage(mid, msgInfo);
rsMail->getMessage(mid, msgInfo);
}
QList<QTreeWidgetItem*> itemsRead;
@ -851,7 +853,7 @@ void MessagesDialog::insertMessages()
RsPeerId ownId = rsPeers->getOwnId();
rsMsgs -> getMessageSummaries(msgList);
rsMail -> getMessageSummaries(msgList);
std::cerr << "MessagesDialog::insertMessages()" << std::endl;
@ -960,7 +962,7 @@ void MessagesDialog::insertMessages()
if (doFill) {
MsgTagType Tags;
rsMsgs->getMessageTagTypes(Tags);
rsMail->getMessageTagTypes(Tags);
/* search messages */
std::list<MsgInfoSummary> msgToShow;
@ -980,7 +982,7 @@ void MessagesDialog::insertMessages()
}
} else if (listMode == LIST_QUICKVIEW && quickViewType == QUICKVIEW_TYPE_TAG) {
MsgTagInfo tagInfo;
rsMsgs->getMessageTag(it->msgId, tagInfo);
rsMail->getMessageTag(it->msgId, tagInfo);
if (std::find(tagInfo.tagIds.begin(), tagInfo.tagIds.end(), quickViewId) == tagInfo.tagIds.end()) {
continue;
}
@ -1107,7 +1109,7 @@ void MessagesDialog::insertMessages()
{
// distant message
setText = false;
if (gotInfo || rsMsgs->getMessage(it->msgId, msgInfo)) {
if (gotInfo || rsMail->getMessage(it->msgId, msgInfo)) {
gotInfo = true;
item->setId(RsGxsId(msgInfo.rsgxsid_srcId), COLUMN_FROM, false);
} else {
@ -1118,7 +1120,7 @@ void MessagesDialog::insertMessages()
}
}
} else {
if (gotInfo || rsMsgs->getMessage(it->msgId, msgInfo)) {
if (gotInfo || rsMail->getMessage(it->msgId, msgInfo)) {
gotInfo = true;
text.clear();
@ -1175,7 +1177,7 @@ void MessagesDialog::insertMessages()
// Tags
MsgTagInfo tagInfo;
rsMsgs->getMessageTag(it->msgId, tagInfo);
rsMail->getMessageTag(it->msgId, tagInfo);
text.clear();
@ -1190,7 +1192,7 @@ void MessagesDialog::insertMessages()
text += TagDefs::name(Tag->first, Tag->second.first);
} else {
// clean tagId
rsMsgs->setMessageTag(it->msgId, *tagId, false);
rsMail->setMessageTag(it->msgId, *tagId, false);
}
}
item->setText(COLUMN_TAGS, text);
@ -1204,7 +1206,7 @@ void MessagesDialog::insertMessages()
color = Tag->second.second;
} else {
// clean tagId
rsMsgs->setMessageTag(it->msgId, tagInfo.tagIds.front(), false);
rsMail->setMessageTag(it->msgId, tagInfo.tagIds.front(), false);
}
}
if (!color.isValid()) {
@ -1224,7 +1226,7 @@ void MessagesDialog::insertMessages()
if (filterColumn == COLUMN_CONTENT) {
// need content for filter
if (gotInfo || rsMsgs->getMessage(it->msgId, msgInfo)) {
if (gotInfo || rsMail->getMessage(it->msgId, msgInfo)) {
gotInfo = true;
QTextDocument doc;
doc.setHtml(QString::fromUtf8(msgInfo.msg.c_str()));
@ -1343,7 +1345,7 @@ void MessagesDialog::doubleClicked(QTreeWidgetItem *item, int column)
return ;
MessageInfo msgInfo;
if (!rsMsgs->getMessage(mid, msgInfo)) {
if (!rsMail->getMessage(mid, msgInfo)) {
return;
}
@ -1377,7 +1379,7 @@ void MessagesDialog::setMsgAsReadUnread(const QList<QTreeWidgetItem*> &items, bo
foreach (QTreeWidgetItem *item, items) {
std::string mid = item->data(COLUMN_DATA, ROLE_MSGID).toString().toStdString();
if (rsMsgs->MessageRead(mid, !read)) {
if (rsMail->MessageRead(mid, !read)) {
int msgFlag = item->data(COLUMN_DATA, ROLE_MSGFLAGS).toInt();
msgFlag &= ~RS_MSG_NEW;
@ -1429,7 +1431,7 @@ void MessagesDialog::setMsgStar(const QList<QTreeWidgetItem*> &items, bool star)
foreach (QTreeWidgetItem *item, items) {
std::string mid = item->data(COLUMN_DATA, ROLE_MSGID).toString().toStdString();
if (rsMsgs->MessageStar(mid, star)) {
if (rsMail->MessageStar(mid, star)) {
int msgFlag = item->data(COLUMN_DATA, ROLE_MSGFLAGS).toInt();
msgFlag &= ~RS_MSG_STAR;
@ -1487,7 +1489,7 @@ void MessagesDialog::insertMsgTxtAndFiles(QTreeWidgetItem *item, bool bSetToRead
mCurrMsgId = mid;
MessageInfo msgInfo;
if (!rsMsgs -> getMessage(mid, msgInfo)) {
if (!rsMail -> getMessage(mid, msgInfo)) {
std::cerr << "MessagesDialog::insertMsgTxtAndFiles() Couldn't find Msg" << std::endl;
return;
}
@ -1563,9 +1565,9 @@ void MessagesDialog::removemessage()
// closeTab(mid.toStdString());
if (doDelete) {
rsMsgs->MessageDelete(mid.toStdString());
rsMail->MessageDelete(mid.toStdString());
} else {
rsMsgs->MessageToTrash(mid.toStdString(), true);
rsMail->MessageToTrash(mid.toStdString(), true);
}
}
@ -1580,7 +1582,7 @@ void MessagesDialog::undeletemessage()
getSelectedMsgCount (&items, NULL, NULL, NULL);
foreach (QTreeWidgetItem *item, items) {
QString mid = item->data(COLUMN_DATA, ROLE_MSGID).toString();
rsMsgs->MessageToTrash(mid.toStdString(), false);
rsMail->MessageToTrash(mid.toStdString(), false);
}
// LockUpdate -> insertMessages();
@ -1636,12 +1638,12 @@ void MessagesDialog::updateMessageSummaryList()
unsigned int systemCount = 0;
/* calculating the new messages */
// rsMsgs->getMessageCount (&inboxCount, &newInboxCount, &newOutboxCount, &newDraftCount, &newSentboxCount);
// rsMail->getMessageCount (&inboxCount, &newInboxCount, &newOutboxCount, &newDraftCount, &newSentboxCount);
std::list<MsgInfoSummary> msgList;
std::list<MsgInfoSummary>::const_iterator it;
rsMsgs->getMessageSummaries(msgList);
rsMail->getMessageSummaries(msgList);
QMap<int, int> tagCount;
@ -1649,7 +1651,7 @@ void MessagesDialog::updateMessageSummaryList()
for (it = msgList.begin(); it != msgList.end(); ++it) {
/* calcluate tag count */
MsgTagInfo tagInfo;
rsMsgs->getMessageTag(it->msgId, tagInfo);
rsMail->getMessageTag(it->msgId, tagInfo);
for (std::list<uint32_t>::iterator tagId = tagInfo.tagIds.begin(); tagId != tagInfo.tagIds.end(); ++tagId) {
int nCount = tagCount [*tagId];
++nCount;
@ -1848,7 +1850,7 @@ void MessagesDialog::tagAboutToShow()
if (items.size()) {
std::string msgId = items.front()->data(COLUMN_DATA, ROLE_MSGID).toString().toStdString();
rsMsgs->getMessageTag(msgId, tagInfo);
rsMail->getMessageTag(msgId, tagInfo);
}
menu->activateActions(tagInfo.tagIds);
@ -1863,7 +1865,7 @@ void MessagesDialog::tagRemoveAll()
foreach (QTreeWidgetItem *item, items) {
std::string msgId = item->data(COLUMN_DATA, ROLE_MSGID).toString().toStdString();
rsMsgs->setMessageTag(msgId, 0, false);
rsMail->setMessageTag(msgId, 0, false);
Lock.setUpdate(true);
}
@ -1883,7 +1885,7 @@ void MessagesDialog::tagSet(int tagId, bool set)
foreach (QTreeWidgetItem *item, items) {
std::string msgId = item->data(COLUMN_DATA, ROLE_MSGID).toString().toStdString();
if (rsMsgs->setMessageTag(msgId, tagId, set)) {
if (rsMail->setMessageTag(msgId, tagId, set)) {
Lock.setUpdate(true);
}
}
@ -1896,12 +1898,12 @@ void MessagesDialog::emptyTrash()
LockUpdate Lock (this, true);
std::list<MsgInfoSummary> msgList;
rsMsgs->getMessageSummaries(msgList);
rsMail->getMessageSummaries(msgList);
std::list<MsgInfoSummary>::const_iterator it;
for (it = msgList.begin(); it != msgList.end(); ++it) {
if (it->msgflags & RS_MSG_TRASH) {
rsMsgs->MessageDelete(it->msgId);
rsMail->MessageDelete(it->msgId);
}
}

View File

@ -60,6 +60,8 @@
#include "common/FeedNotify.h"
#include "notifyqt.h"
#include "gui/msgs/MessageInterface.h"
const uint32_t NEWSFEED_PEERLIST = 0x0001;
const uint32_t NEWSFEED_FORUMNEWLIST = 0x0002;
@ -470,7 +472,7 @@ void NewsFeed::testFeeds(uint notifyFlags)
case RS_FEED_TYPE_MSG:
{
std::list<MsgInfoSummary> msgList;
rsMsgs->getMessageSummaries(msgList);
rsMail->getMessageSummaries(msgList);
std::list<MsgInfoSummary>::const_iterator msgIt;
for (msgIt = msgList.begin(); msgIt != msgList.end(); ++msgIt) {

View File

@ -36,6 +36,8 @@
#include <retroshare/rsmsgs.h>
#include <retroshare/rspeers.h>
#include "gui/msgs/MessageInterface.h"
/*****
* #define DEBUG_ITEM 1
****/
@ -249,7 +251,7 @@ void ChatMsgItem::sendMessage()
mi.msg = quickmsgText->toHtml().toUtf8().constData();
mi.rspeerid_msgto.push_back(mPeerId);
rsMsgs->MessageSend(mi);
rsMail->MessageSend(mi);
quickmsgText->clear();
messageFrame->setVisible(false);

View File

@ -35,6 +35,8 @@
#include <retroshare/rspeers.h>
#include <retroshare/rsidentity.h>
#include "gui/msgs/MessageInterface.h"
/****
* #define DEBUG_ITEM 1
****/
@ -75,10 +77,10 @@ void MsgItem::updateItemStatic()
MessageInfo mi;
if (!rsMsgs)
if (!rsMail)
return;
if (!rsMsgs->getMessage(mMsgId, mi))
if (!rsMail->getMessage(mMsgId, mi))
return;
/* get peer Id */
@ -263,9 +265,9 @@ void MsgItem::deleteMsg()
std::cerr << "MsgItem::deleteMsg()";
std::cerr << std::endl;
#endif
if (rsMsgs)
if (rsMail)
{
rsMsgs->MessageDelete(mMsgId);
rsMail->MessageDelete(mMsgId);
hide(); /* will be cleaned up next refresh */
}

View File

@ -514,7 +514,7 @@ void MessageComposer::sendConnectAttemptMsg(const RsPgpId &gpgId, const RsPeerId
std::list<MsgInfoSummary> msgList;
std::list<MsgInfoSummary>::const_iterator it;
rsMsgs->getMessageSummaries(msgList);
rsMail->getMessageSummaries(msgList);
for(it = msgList.begin(); it != msgList.end(); ++it) {
if (it->msgflags & RS_MSG_TRASH) {
continue;
@ -532,7 +532,7 @@ void MessageComposer::sendConnectAttemptMsg(const RsPgpId &gpgId, const RsPeerId
/* create a message */
QString msgText = tr("Hi %1,<br><br>%2 wants to be friends with you on RetroShare.<br><br>Respond now:<br>%3<br><br>Thanks,<br>The RetroShare Team").arg(QString::fromUtf8(rsPeers->getGPGName(rsPeers->getGPGOwnId()).c_str()), sslName, link.toHtml());
rsMsgs->SystemMessage(title.toUtf8().constData(), msgText.toUtf8().constData(), RS_MSG_USER_REQUEST);
rsMail->SystemMessage(title.toUtf8().constData(), msgText.toUtf8().constData(), RS_MSG_USER_REQUEST);
}
void MessageComposer::sendChannelPublishKey(RsGxsChannelGroup &group)
@ -548,7 +548,7 @@ void MessageComposer::sendChannelPublishKey(RsGxsChannelGroup &group)
// /* create a message */
// QString msgText = tr("... %1 ...<br>%2").arg(channelName, link.toHtml());
// rsMsgs->SystemMessage(title.toUtf8().constData(), msgText.toUtf8().constData(), RS_MSG_PUBLISH_KEY);
// rsMail->SystemMessage(title.toUtf8().constData(), msgText.toUtf8().constData(), RS_MSG_PUBLISH_KEY);
}
void MessageComposer::sendForumPublishKey(RsGxsForumGroup &group)
@ -564,7 +564,7 @@ void MessageComposer::sendForumPublishKey(RsGxsForumGroup &group)
// /* create a message */
// QString msgText = tr("... %1 ...<br>%2").arg(forumName, link.toHtml());
// rsMsgs->SystemMessage(title.toUtf8().constData(), msgText.toUtf8().constData(), RS_MSG_PUBLISH_KEY);
// rsMail->SystemMessage(title.toUtf8().constData(), msgText.toUtf8().constData(), RS_MSG_PUBLISH_KEY);
}
void MessageComposer::closeEvent (QCloseEvent * event)
@ -907,7 +907,7 @@ MessageComposer *MessageComposer::newMsg(const std::string &msgId /* = ""*/)
if (msgId.empty() == false) {
// fill existing message
MessageInfo msgInfo;
if (!rsMsgs->getMessage(msgId, msgInfo)) {
if (!rsMail->getMessage(msgId, msgInfo)) {
std::cerr << "MessageComposer::newMsg() Couldn't find Msg" << std::endl;
delete msgComposer;
return NULL;
@ -916,7 +916,7 @@ MessageComposer *MessageComposer::newMsg(const std::string &msgId /* = ""*/)
if (msgInfo.msgflags & RS_MSG_DRAFT) {
msgComposer->m_sDraftMsgId = msgId;
rsMsgs->getMsgParentId(msgId, msgComposer->m_msgParentId);
rsMail->getMsgParentId(msgId, msgComposer->m_msgParentId);
if (msgInfo.msgflags & RS_MSG_REPLIED) {
msgComposer->m_msgType = REPLY;
@ -962,7 +962,7 @@ MessageComposer *MessageComposer::newMsg(const std::string &msgId /* = ""*/)
for (std::list<RsGxsId>::const_iterator it = msgInfo.rsgxsid_msgbcc.begin(); it != msgInfo.rsgxsid_msgbcc.end(); ++it ) msgComposer->addRecipient(MessageComposer::BCC, *it) ;
MsgTagInfo tagInfo;
rsMsgs->getMessageTag(msgId, tagInfo);
rsMail->getMessageTag(msgId, tagInfo);
msgComposer->m_tagIds = tagInfo.tagIds;
msgComposer->showTagLabels();
@ -1074,7 +1074,7 @@ void MessageComposer::setQuotedMsg(const QString &msg, const QString &header)
MessageComposer *MessageComposer::replyMsg(const std::string &msgId, bool all)
{
MessageInfo msgInfo;
if (!rsMsgs->getMessage(msgId, msgInfo)) {
if (!rsMail->getMessage(msgId, msgInfo)) {
return NULL;
}
@ -1124,7 +1124,7 @@ MessageComposer *MessageComposer::replyMsg(const std::string &msgId, bool all)
MessageComposer *MessageComposer::forwardMsg(const std::string &msgId)
{
MessageInfo msgInfo;
if (!rsMsgs->getMessage(msgId, msgInfo)) {
if (!rsMail->getMessage(msgId, msgInfo)) {
return NULL;
}
@ -1339,7 +1339,7 @@ bool MessageComposer::sendMessage_internal(bool bDraftbox)
{
mi.msgId = m_sDraftMsgId;
rsMsgs->MessageToDraft(mi, m_msgParentId);
rsMail->MessageToDraft(mi, m_msgParentId);
// use new message id
m_sDraftMsgId = mi.msgId;
@ -1348,10 +1348,10 @@ bool MessageComposer::sendMessage_internal(bool bDraftbox)
case NORMAL:
break;
case REPLY:
rsMsgs->MessageReplied(m_sDraftMsgId, true);
rsMail->MessageReplied(m_sDraftMsgId, true);
break;
case FORWARD:
rsMsgs->MessageForwarded(m_sDraftMsgId, true);
rsMail->MessageForwarded(m_sDraftMsgId, true);
break;
}
}
@ -1372,7 +1372,7 @@ bool MessageComposer::sendMessage_internal(bool bDraftbox)
QMessageBox::warning(this, tr("RetroShare"), tr("Please create an identity to sign distant messages, or remove the distant peers fro the destination list."), QMessageBox::Ok);
return false; // Don't send if cannot sign.
}
if (rsMsgs->MessageSend(mi) == false) {
if (rsMail->MessageSend(mi) == false) {
return false;
}
@ -1381,10 +1381,10 @@ bool MessageComposer::sendMessage_internal(bool bDraftbox)
case NORMAL:
break;
case REPLY:
rsMsgs->MessageReplied(m_msgParentId, true);
rsMail->MessageReplied(m_msgParentId, true);
break;
case FORWARD:
rsMsgs->MessageForwarded(m_msgParentId, true);
rsMail->MessageForwarded(m_msgParentId, true);
break;
}
}
@ -1392,13 +1392,13 @@ bool MessageComposer::sendMessage_internal(bool bDraftbox)
if (mi.msgId.empty() == false) {
MsgTagInfo tagInfo;
rsMsgs->getMessageTag(mi.msgId, tagInfo);
rsMail->getMessageTag(mi.msgId, tagInfo);
/* insert new tags */
std::list<uint32_t>::iterator tag;
for (tag = m_tagIds.begin(); tag != m_tagIds.end(); ++tag) {
if (std::find(tagInfo.tagIds.begin(), tagInfo.tagIds.end(), *tag) == tagInfo.tagIds.end()) {
rsMsgs->setMessageTag(mi.msgId, *tag, true);
rsMail->setMessageTag(mi.msgId, *tag, true);
} else {
tagInfo.tagIds.remove(*tag);
}
@ -1406,7 +1406,7 @@ bool MessageComposer::sendMessage_internal(bool bDraftbox)
/* remove deleted tags */
for (tag = tagInfo.tagIds.begin(); tag != tagInfo.tagIds.end(); ++tag) {
rsMsgs->setMessageTag(mi.msgId, *tag, false);
rsMail->setMessageTag(mi.msgId, *tag, false);
}
}
ui.msgText->document()->setModified(false);
@ -2561,7 +2561,7 @@ void MessageComposer::showTagLabels()
if (m_tagIds.empty() == false) {
MsgTagType tags;
rsMsgs->getMessageTagTypes(tags);
rsMail->getMessageTagTypes(tags);
std::map<uint32_t, std::pair<std::string, uint32_t> >::iterator tag;
for (std::list<uint32_t>::iterator tagId = m_tagIds.begin(); tagId != m_tagIds.end(); ++tagId) {

View File

@ -27,13 +27,14 @@
#include <retroshare/rsmsgs.h>
#include "ui_MessageComposer.h"
#include "gui/msgs/MessageInterface.h"
class QAction;
class QComboBox;
class QFontComboBox;
class QTextEdit;
class QTextCharFormat;
class RSTreeWidgetItemCompareRole;
struct MessageInfo;
class RsGxsChannelGroup;
class RsGxsForumGroup;

View File

@ -0,0 +1,31 @@
#ifndef MRK_MESSAGE_INTERFACE_H
#define MRK_MESSAGE_INTERFACE_H
/* This header will be used to switch the GUI from
* the old RsMsg to the new RsMail interface.
*
* The GUI uses similar interface, with the differences
* specified here.
*
*/
#define USE_OLD_MAIL 1
#ifdef USE_OLD_MAIL
#include <retroshare/rsmsgs.h>
using namespace Rs::Msgs;
#define rsMail rsMsgs
#else
#include <retroshare/rsmail.h>
using namespace Rs::Mail;
#endif
#endif // MRK_MESSAGE_INTERFACE

View File

@ -23,7 +23,7 @@
#include "gui/notifyqt.h"
#include "gui/MainWindow.h"
#include <retroshare/rsmsgs.h>
#include "gui/msgs/MessageInterface.h"
MessageUserNotify::MessageUserNotify(QObject *parent) :
UserNotify(parent)
@ -52,7 +52,7 @@ QIcon MessageUserNotify::getMainIcon(bool hasNew)
unsigned int MessageUserNotify::getNewCount()
{
unsigned int newInboxCount = 0;
rsMsgs->getMessageCount(NULL, &newInboxCount, NULL, NULL, NULL, NULL);
rsMail->getMessageCount(NULL, &newInboxCount, NULL, NULL, NULL, NULL);
return newInboxCount;
}

View File

@ -57,6 +57,8 @@
#define COLUMN_FILE_HASH 2
#define COLUMN_FILE_COUNT 3
#include "gui/msgs/MessageInterface.h"
class RsHtmlMsg : public RsHtml
{
public:
@ -93,7 +95,7 @@ MessageWidget *MessageWidget::openMsg(const std::string &msgId, bool window)
}
MessageInfo msgInfo;
if (!rsMsgs->getMessage(msgId, msgInfo)) {
if (!rsMail->getMessage(msgId, msgInfo)) {
std::cerr << "MessageWidget::openMsg() Couldn't find Msg" << std::endl;
return NULL;
}
@ -300,7 +302,7 @@ void MessageWidget::togglefileview()
void MessageWidget::getcurrentrecommended()
{
MessageInfo msgInfo;
if (rsMsgs->getMessage(currMsgId, msgInfo) == false) {
if (rsMail->getMessage(currMsgId, msgInfo) == false) {
return;
}
@ -342,7 +344,7 @@ void MessageWidget::getallrecommended()
{
/* get Message */
MessageInfo msgInfo;
if (rsMsgs->getMessage(currMsgId, msgInfo) == false) {
if (rsMail->getMessage(currMsgId, msgInfo) == false) {
return;
}
@ -372,7 +374,7 @@ void MessageWidget::messagesChanged()
/* test Message */
MessageInfo msgInfo;
if (rsMsgs->getMessage(currMsgId, msgInfo) == false) {
if (rsMail->getMessage(currMsgId, msgInfo) == false) {
/* messages was removed */
if (isWindow) {
window()->close();
@ -405,13 +407,13 @@ void MessageWidget::showTagLabels()
}
MsgTagInfo tagInfo;
rsMsgs->getMessageTag(currMsgId, tagInfo);
rsMail->getMessageTag(currMsgId, tagInfo);
if (tagInfo.tagIds.empty() == false) {
ui.tagsLabel->setVisible(true);
MsgTagType Tags;
rsMsgs->getMessageTagTypes(Tags);
rsMail->getMessageTagTypes(Tags);
std::map<uint32_t, std::pair<std::string, uint32_t> >::iterator Tag;
for (std::list<uint32_t>::iterator tagId = tagInfo.tagIds.begin(); tagId != tagInfo.tagIds.end(); ++tagId) {
@ -477,7 +479,7 @@ void MessageWidget::fill(const std::string &msgId)
clearTagLabels();
MessageInfo msgInfo;
if (rsMsgs->getMessage(currMsgId, msgInfo) == false) {
if (rsMail->getMessage(currMsgId, msgInfo) == false) {
std::cerr << "MessageWidget::fill() Couldn't find Msg" << std::endl;
return;
}
@ -589,7 +591,7 @@ void MessageWidget::fill(const std::string &msgId)
void MessageWidget::remove()
{
MessageInfo msgInfo;
if (rsMsgs->getMessage(currMsgId, msgInfo) == false) {
if (rsMail->getMessage(currMsgId, msgInfo) == false) {
std::cerr << "MessageWidget::fill() Couldn't find Msg" << std::endl;
return;
}
@ -604,9 +606,9 @@ void MessageWidget::remove()
}
if (deleteReal) {
rsMsgs->MessageDelete(currMsgId);
rsMail->MessageDelete(currMsgId);
} else {
rsMsgs->MessageToTrash(currMsgId, true);
rsMail->MessageToTrash(currMsgId, true);
}
if (isWindow) {
@ -736,5 +738,5 @@ void MessageWidget::loadImagesAlways()
return;
}
rsMsgs->MessageLoadEmbeddedImages(currMsgId, true);
rsMail->MessageLoadEmbeddedImages(currMsgId, true);
}

View File

@ -27,6 +27,8 @@
#include <retroshare/rsmsgs.h>
#include "gui/msgs/MessageInterface.h"
/** Constructor */
MessageWindow::MessageWindow(QWidget *parent, Qt::WindowFlags flags)
: RWindow("MessageWindow", parent, flags)
@ -162,7 +164,7 @@ void MessageWindow::tagAboutToShow()
// activate actions
MsgTagInfo tagInfo;
rsMsgs->getMessageTag(msgWidget->msgId(), tagInfo);
rsMail->getMessageTag(msgWidget->msgId(), tagInfo);
menu->activateActions(tagInfo.tagIds);
}
@ -173,7 +175,7 @@ void MessageWindow::tagRemoveAll()
return;
}
rsMsgs->setMessageTag(msgWidget->msgId(), 0, false);
rsMail->setMessageTag(msgWidget->msgId(), 0, false);
}
void MessageWindow::tagSet(int tagId, bool set)
@ -186,7 +188,7 @@ void MessageWindow::tagSet(int tagId, bool set)
return;
}
rsMsgs->setMessageTag(msgWidget->msgId(), tagId, set);
rsMail->setMessageTag(msgWidget->msgId(), tagId, set);
}
void MessageWindow::setupFileActions()

View File

@ -32,6 +32,8 @@
#include "gui/settings/NewTag.h"
#include "gui/notifyqt.h"
#include "gui/msgs/MessageInterface.h"
#define ACTION_TAGSINDEX_SIZE 3
#define ACTION_TAGSINDEX_TYPE "Type"
#define ACTION_TAGSINDEX_ID "ID"
@ -93,7 +95,7 @@ void TagsMenu::fillTags()
clear();
MsgTagType tags;
rsMsgs->getMessageTagTypes(tags);
rsMail->getMessageTagTypes(tags);
std::map<uint32_t, std::pair<std::string, uint32_t> >::iterator tag;
bool user = false;
@ -179,13 +181,13 @@ void TagsMenu::tagTriggered(QAction *action)
} else if (values [ACTION_TAGSINDEX_TYPE] == ACTION_TAGS_NEWTAG) {
// new tag
MsgTagType tags;
rsMsgs->getMessageTagTypes(tags);
rsMail->getMessageTagTypes(tags);
NewTag tagDlg(tags);
if (tagDlg.exec() == QDialog::Accepted && tagDlg.m_nId) {
std::map<uint32_t, std::pair<std::string, uint32_t> >::iterator tag = tags.types.find(tagDlg.m_nId);
if (tag != tags.types.end()) {
if (rsMsgs->setMessageTagType(tag->first, tag->second.first, tag->second.second)) {
if (rsMail->setMessageTagType(tag->first, tag->second.first, tag->second.second)) {
emit tagSet(tagDlg.m_nId, true);
}
}

View File

@ -59,7 +59,7 @@ MessagePage::~MessagePage()
void MessagePage::toggleEnableEncryptedDistantMsgs(bool b)
{
rsMsgs->enableDistantMessaging(b) ;
rsMail->enableDistantMessaging(b) ;
}
/** Saves the changes on this page */
@ -78,11 +78,11 @@ MessagePage::save(QString &/*errmsg*/)
if (*changedTagId == Tag->first) {
if (Tag->second.first.empty()) {
// delete tag
rsMsgs->removeMessageTagType(Tag->first);
rsMail->removeMessageTagType(Tag->first);
continue;
}
rsMsgs->setMessageTagType(Tag->first, Tag->second.first, Tag->second.second);
rsMail->setMessageTagType(Tag->first, Tag->second.first, Tag->second.second);
break;
}
}
@ -99,9 +99,9 @@ MessagePage::load()
ui.loadEmbeddedImages->setChecked(Settings->getMsgLoadEmbeddedImages());
ui.openComboBox->setCurrentIndex(ui.openComboBox->findData(Settings->getMsgOpen()));
ui.encryptedMsgs_CB->setChecked(rsMsgs->distantMessagingEnabled()) ;
ui.encryptedMsgs_CB->setChecked(rsMail->distantMessagingEnabled()) ;
// fill items
rsMsgs->getMessageTagTypes(*m_pTags);
rsMail->getMessageTagTypes(*m_pTags);
fillTags();
}
@ -202,7 +202,7 @@ void MessagePage::deleteTag()
void MessagePage::defaultTag()
{
rsMsgs->resetMessageStandardTagTypes(*m_pTags);
rsMail->resetMessageStandardTagTypes(*m_pTags);
// add all standard items to changed list
std::map<uint32_t, std::pair<std::string, uint32_t> >::iterator Tag;

View File

@ -27,7 +27,7 @@
#include <retroshare-gui/configpage.h>
#include "ui_MessagePage.h"
class MsgTagType;
#include "gui/msgs/MessageInterface.h"
class MessagePage : public ConfigPage
{

View File

@ -28,7 +28,7 @@
#include "ui_NewTag.h"
class MsgTagType;
#include "gui/msgs/MessageInterface.h"
class NewTag : public QDialog
{

View File

@ -394,6 +394,7 @@ HEADERS += rshare.h \
gui/chat/ChatUserNotify.h \
gui/chat/ChatLobbyUserNotify.h \
gui/connect/ConfCertDialog.h \
gui/msgs/MessageInterface.h \
gui/msgs/MessageComposer.h \
gui/msgs/MessageWindow.h \
gui/msgs/MessageWidget.h \