mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-11 10:35:22 -04:00
Moved p3notify to pqi directory to fix compile order.
This is a bit of a hack, and should be fixed later. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@379 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
7eeb4420fe
commit
0a9382cea5
5 changed files with 7 additions and 4 deletions
129
libretroshare/src/pqi/p3notify.cc
Normal file
129
libretroshare/src/pqi/p3notify.cc
Normal file
|
@ -0,0 +1,129 @@
|
|||
/*
|
||||
* libretroshare/src/rsserver: p3notify.cc
|
||||
*
|
||||
* RetroShare C++ Interface.
|
||||
*
|
||||
* Copyright 2007-2008 by Robert Fernie.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License Version 2 as published by the Free Software Foundation.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
||||
* USA.
|
||||
*
|
||||
* Please report all bugs and problems to "retroshare@lunamutt.com".
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include "pqi/p3notify.h"
|
||||
|
||||
/* external reference point */
|
||||
RsNotify *rsNotify = NULL;
|
||||
|
||||
/* Output for retroshare-gui */
|
||||
bool p3Notify::NotifySysMessage(uint32_t &sysid, uint32_t &type,
|
||||
std::string &title, std::string &msg)
|
||||
{
|
||||
RsStackMutex stack(noteMtx); /************* LOCK MUTEX ************/
|
||||
if (pendingSysMsgs.size() > 0)
|
||||
{
|
||||
p3NotifySysMsg smsg = pendingSysMsgs.front();
|
||||
pendingSysMsgs.pop_front();
|
||||
|
||||
sysid = smsg.sysid;
|
||||
type = smsg.type;
|
||||
title = smsg.title;
|
||||
msg = smsg.msg;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
bool p3Notify::NotifyPopupMessage(uint32_t &ptype, std::string &name, std::string &msg)
|
||||
{
|
||||
RsStackMutex stack(noteMtx); /************* LOCK MUTEX ************/
|
||||
if (pendingPopupMsgs.size() > 0)
|
||||
{
|
||||
p3NotifyPopupMsg pmsg = pendingPopupMsgs.front();
|
||||
pendingPopupMsgs.pop_front();
|
||||
|
||||
ptype = pmsg.type;
|
||||
name = pmsg.name;
|
||||
msg = pmsg.msg;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/* Control over Messages */
|
||||
bool p3Notify::GetSysMessageList(std::map<uint32_t, std::string> &list)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool p3Notify::GetPopupMessageList(std::map<uint32_t, std::string> &list)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
bool p3Notify::SetSysMessageMode(uint32_t sysid, uint32_t mode)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool p3Notify::SetPopupMessageMode(uint32_t ptype, uint32_t mode)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/* Input from libretroshare */
|
||||
bool p3Notify::AddPopupMessage(uint32_t ptype, std::string name, std::string msg)
|
||||
{
|
||||
RsStackMutex stack(noteMtx); /************* LOCK MUTEX ************/
|
||||
|
||||
p3NotifyPopupMsg pmsg;
|
||||
|
||||
pmsg.type = ptype;
|
||||
pmsg.name = name;
|
||||
pmsg.msg = msg;
|
||||
|
||||
pendingPopupMsgs.push_back(pmsg);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool p3Notify::AddSysMessage(uint32_t sysid, uint32_t type,
|
||||
std::string title, std::string msg)
|
||||
{
|
||||
RsStackMutex stack(noteMtx); /************* LOCK MUTEX ************/
|
||||
|
||||
p3NotifySysMsg smsg;
|
||||
|
||||
smsg.sysid = sysid;
|
||||
smsg.type = type;
|
||||
smsg.title = title;
|
||||
smsg.msg = msg;
|
||||
|
||||
pendingSysMsgs.push_back(smsg);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue