Moved the tag feature in messages from the gui to the libretroshare.

Changed rsmsg interface and item classes so need full recompile.
Created new notifier for tag changes - NOTIFY_LIST_MESSAGE_TAGS.
Changed serialiser tests for message items.

After that all tags are reset to standard and all assigned tags to messages are lost.
Please delete the file msg_locale.cfg in your profile directory.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3381 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2010-08-22 22:12:26 +00:00
parent 340982b996
commit 52183a0c75
18 changed files with 708 additions and 515 deletions

View file

@ -216,16 +216,17 @@ class NotifyBase
virtual std::string askForPassword(const std::string& /* key_details */ ,bool /* prev_is_bad */ ) { return "" ;}
};
const int NOTIFY_LIST_NEIGHBOURS = 1;
const int NOTIFY_LIST_FRIENDS = 2;
const int NOTIFY_LIST_SEARCHLIST = 4;
const int NOTIFY_LIST_MESSAGELIST = 5;
const int NOTIFY_LIST_CHANNELLIST = 6;
const int NOTIFY_LIST_TRANSFERLIST = 7;
const int NOTIFY_LIST_CONFIG = 8;
const int NOTIFY_LIST_DIRLIST_LOCAL = 9;
const int NOTIFY_LIST_NEIGHBOURS = 1;
const int NOTIFY_LIST_FRIENDS = 2;
const int NOTIFY_LIST_SEARCHLIST = 4;
const int NOTIFY_LIST_MESSAGELIST = 5;
const int NOTIFY_LIST_CHANNELLIST = 6;
const int NOTIFY_LIST_TRANSFERLIST = 7;
const int NOTIFY_LIST_CONFIG = 8;
const int NOTIFY_LIST_DIRLIST_LOCAL = 9;
const int NOTIFY_LIST_DIRLIST_FRIENDS = 10;
const int NOTIFY_LIST_FORUMLIST_LOCKED = 11; // use connect with Qt::QueuedConnection
const int NOTIFY_LIST_MESSAGE_TAGS = 12;
const int NOTIFY_TYPE_SAME = 0x01;
const int NOTIFY_TYPE_MOD = 0x02; /* general purpose, check all */

View file

@ -37,18 +37,26 @@
#define RS_MSG_BOXMASK 0x000f /* Mask for determining Box */
#define RS_MSG_OUTGOING 0x0001 /* !Inbox */
#define RS_MSG_PENDING 0x0002 /* OutBox */
#define RS_MSG_DRAFT 0x0004 /* Draft */
#define RS_MSG_OUTGOING 0x0001 /* !Inbox */
#define RS_MSG_PENDING 0x0002 /* OutBox */
#define RS_MSG_DRAFT 0x0004 /* Draft */
/* ORs of above */
#define RS_MSG_INBOX 0x00 /* Inbox */
#define RS_MSG_SENTBOX 0x01 /* Sentbox */
#define RS_MSG_OUTBOX 0x03 /* Outbox */
#define RS_MSG_DRAFTBOX 0x05 /* Draftbox */
#define RS_MSG_INBOX 0x00 /* Inbox */
#define RS_MSG_SENTBOX 0x01 /* Sentbox */
#define RS_MSG_OUTBOX 0x03 /* Outbox */
#define RS_MSG_DRAFTBOX 0x05 /* Draftbox */
#define RS_MSG_NEW 0x0010 /* New */
#define RS_MSG_TRASH 0x0020 /* Trash */
#define RS_MSG_NEW 0x0010 /* New */
#define RS_MSG_TRASH 0x0020 /* Trash */
#define RS_MSG_UNREAD_BY_USER 0x0040 /* Unread by user */
#define RS_MSGTAGTYPE_IMPORTANT 1
#define RS_MSGTAGTYPE_WORK 2
#define RS_MSGTAGTYPE_PERSONAL 3
#define RS_MSGTAGTYPE_TODO 4
#define RS_MSGTAGTYPE_LATER 5
#define RS_MSGTAGTYPE_USER 100
class MessageInfo
{
@ -96,8 +104,8 @@ class MsgTagInfo
public:
MsgTagInfo() {}
uint32_t tagId;
std::string msgId;
std::list<uint32_t> tagIds;
};
class MsgTagType
@ -105,7 +113,7 @@ class MsgTagType
public:
MsgTagType() {}
/* map containing tagid-> pair (text, rgb color) */
/* map containing tagId -> pair (text, rgb color) */
std::map<uint32_t, std::pair<std::string, uint32_t> > types;
};
@ -151,15 +159,19 @@ virtual bool MessageToDraft(MessageInfo &info) = 0;
virtual bool MessageToTrash(std::string mid, bool bTrash) = 0;
virtual bool MessageDelete(std::string mid) = 0;
virtual bool MessageRead(std::string mid) = 0;
virtual bool MessageRead(std::string mid, bool bUnreadByUser) = 0;
/* message tagging */
virtual bool MessageGetTagTypes(MsgTagType& tags) = 0;
virtual bool MessageGetMsgTag(std::string msgId, MsgTagInfo& info) = 0;
virtual bool getMessageTagTypes(MsgTagType& tags) = 0;
/* set == false && tagId == 0 --> remove all */
virtual bool setMessageTagType(uint32_t tagId, std::string& text, uint32_t rgb_color) = 0;
virtual bool removeMessageTagType(uint32_t tagId) = 0;
virtual bool MessageSetTagType(std::string& text, uint32_t tag_id, uint32_t rgb_color) = 0;
virtual bool MessageSetMsgTag(MsgTagInfo& ) = 0;
virtual bool getMessageTag(std::string msgId, MsgTagInfo& info) = 0;
virtual bool setMessageTag(std::string msgId, uint32_t tagId, bool set) = 0;
virtual bool resetMessageStandardTagTypes(MsgTagType& tags) = 0;
/****************************************/
/* Chat */