Added NewsFeed / Popup / Chat Configuration options.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@870 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
drbob 2008-12-07 14:19:13 +00:00
parent 52012e8fe9
commit c05acf2f95
14 changed files with 281 additions and 50 deletions

View file

@ -18,6 +18,8 @@
#include "gui/toaster/ChatToaster.h"
#include "gui/toaster/CallToaster.h"
#include "gui/Preferences/rsharesettings.h"
#include <iostream>
#include <sstream>
@ -185,34 +187,41 @@ static time_t lastTs = 0;
if (rsNotify->NotifyPopupMessage(type, id, msg))
{
RshareSettings settings;
uint popupflags = settings.getNotifyFlags();
/* id the name */
std::string name = rsPeers->getPeerName(id);
std::string realmsg = msg + "<strong>" + name + "</strong>";
switch(type)
{
case RS_POPUP_MSG:
if (popupflags & RS_POPUP_MSG)
{
MessageToaster * msgToaster = new MessageToaster();
msgToaster->setMessage(QString::fromStdString(realmsg));
msgToaster->show();
break;
}
break;
case RS_POPUP_CHAT:
if (popupflags & RS_POPUP_CHAT)
{
ChatToaster * chatToaster = new ChatToaster();
chatToaster->setMessage(QString::fromStdString(realmsg));
chatToaster->show();
break;
}
break;
case RS_POPUP_CALL:
if (popupflags & RS_POPUP_CALL)
{
CallToaster * callToaster = new CallToaster();
callToaster->setMessage(QString::fromStdString(realmsg));
callToaster->show();
break;
}
break;
default:
case RS_POPUP_CONNECT:
if (popupflags & RS_POPUP_CONNECT)
{
OnlineToaster * onlineToaster = new OnlineToaster();
onlineToaster->setMessage(QString::fromStdString(realmsg));

View file

@ -45,7 +45,12 @@ const uint32_t RS_POPUP_CHAT = 0x0002;
const uint32_t RS_POPUP_CALL = 0x0004;
const uint32_t RS_POPUP_CONNECT = 0x0008;
/* CHAT flags are here - so they are in the same place as
* other Notify flags... not used by libretroshare though
*/
const uint32_t RS_CHAT_OPEN_NEW = 0x0001;
const uint32_t RS_CHAT_REOPEN = 0x0002;
const uint32_t RS_CHAT_FOCUS = 0x0004;
const uint32_t RS_FEED_TYPE_PEER = 0x0010;
const uint32_t RS_FEED_TYPE_CHAN = 0x0020;