mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-12 16:09:37 -05:00
Groups for friends in PeersDialog.
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3523 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
8b1ffdb5d9
commit
077b2871f1
@ -38,6 +38,7 @@ const int p3connectzone = 3431;
|
|||||||
|
|
||||||
#include "serialiser/rsconfigitems.h"
|
#include "serialiser/rsconfigitems.h"
|
||||||
#include "pqi/pqinotify.h"
|
#include "pqi/pqinotify.h"
|
||||||
|
#include "retroshare/rsiface.h"
|
||||||
|
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
|
||||||
@ -196,6 +197,8 @@ p3ConnectMgr::p3ConnectMgr()
|
|||||||
|
|
||||||
mNetFlags = pqiNetStatus();
|
mNetFlags = pqiNetStatus();
|
||||||
mOldNetFlags = pqiNetStatus();
|
mOldNetFlags = pqiNetStatus();
|
||||||
|
|
||||||
|
lastGroupId = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONN_DEBUG
|
#ifdef CONN_DEBUG
|
||||||
@ -2194,53 +2197,62 @@ bool p3ConnectMgr::removeFriend(std::string id)
|
|||||||
{
|
{
|
||||||
|
|
||||||
#ifdef CONN_DEBUG
|
#ifdef CONN_DEBUG
|
||||||
std::cerr << "p3ConnectMgr::removeFriend() for id : " << id << std::endl;
|
std::cerr << "p3ConnectMgr::removeFriend() for id : " << id << std::endl;
|
||||||
std::cerr << "p3ConnectMgr::removeFriend() mFriendList.size() : " << mFriendList.size() << std::endl;
|
std::cerr << "p3ConnectMgr::removeFriend() mFriendList.size() : " << mFriendList.size() << std::endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
netAssistFriend(id, false);
|
netAssistFriend(id, false);
|
||||||
|
|
||||||
RsStackMutex stack(connMtx); /****** STACK LOCK MUTEX *******/
|
std::list<std::string> toRemove;
|
||||||
|
|
||||||
/* move to othersList */
|
{
|
||||||
bool success = false;
|
RsStackMutex stack(connMtx); /****** STACK LOCK MUTEX *******/
|
||||||
std::list<std::string> toRemove;
|
|
||||||
std::map<std::string, peerConnectState>::iterator it;
|
/* move to othersList */
|
||||||
//remove ssl and gpg_ids
|
bool success = false;
|
||||||
for(it = mFriendList.begin(); it != mFriendList.end(); it++)
|
std::map<std::string, peerConnectState>::iterator it;
|
||||||
{
|
//remove ssl and gpg_ids
|
||||||
if (it->second.id == id || it->second.gpg_id == id) {
|
for(it = mFriendList.begin(); it != mFriendList.end(); it++)
|
||||||
|
{
|
||||||
|
if (it->second.id == id || it->second.gpg_id == id) {
|
||||||
#ifdef CONN_DEBUG
|
#ifdef CONN_DEBUG
|
||||||
std::cerr << "p3ConnectMgr::removeFriend() friend found in the list." << id << std::endl;
|
std::cerr << "p3ConnectMgr::removeFriend() friend found in the list." << id << std::endl;
|
||||||
#endif
|
#endif
|
||||||
peerConnectState peer = it->second;
|
peerConnectState peer = it->second;
|
||||||
|
|
||||||
toRemove.push_back(it->second.id);
|
toRemove.push_back(it->second.id);
|
||||||
|
|
||||||
peer.state &= (~RS_PEER_S_FRIEND);
|
peer.state &= (~RS_PEER_S_FRIEND);
|
||||||
peer.state &= (~RS_PEER_S_CONNECTED);
|
peer.state &= (~RS_PEER_S_CONNECTED);
|
||||||
peer.state &= (~RS_PEER_S_ONLINE);
|
peer.state &= (~RS_PEER_S_ONLINE);
|
||||||
peer.actions = RS_PEER_MOVED;
|
peer.actions = RS_PEER_MOVED;
|
||||||
peer.inConnAttempt = false;
|
peer.inConnAttempt = false;
|
||||||
mOthersList[id] = peer;
|
mOthersList[id] = peer;
|
||||||
mStatusChanged = true;
|
mStatusChanged = true;
|
||||||
|
|
||||||
success = true;
|
success = true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
std::list<std::string>::iterator toRemoveIt;
|
||||||
|
for(toRemoveIt = toRemove.begin(); toRemoveIt != toRemove.end(); toRemoveIt++) {
|
||||||
|
if (mFriendList.end() != (it = mFriendList.find(*toRemoveIt))) {
|
||||||
|
mFriendList.erase(it);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef CONN_DEBUG
|
||||||
|
std::cerr << "p3ConnectMgr::removeFriend() new mFriendList.size() : " << mFriendList.size() << std::endl;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
std::list<std::string>::iterator toRemoveIt;
|
/* remove id from all groups */
|
||||||
for(toRemoveIt = toRemove.begin(); toRemoveIt != toRemove.end(); toRemoveIt++) {
|
std::list<std::string> peerIds;
|
||||||
if (mFriendList.end() != (it = mFriendList.find(*toRemoveIt))) {
|
peerIds.push_back(id);
|
||||||
mFriendList.erase(it);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
assignPeersToGroup("", peerIds, false);
|
||||||
|
|
||||||
#ifdef CONN_DEBUG
|
IndicateConfigChanged(); /**** INDICATE MSG CONFIG CHANGED! *****/
|
||||||
std::cerr << "p3ConnectMgr::removeFriend() new mFriendList.size() : " << mFriendList.size() << std::endl;
|
|
||||||
#endif
|
|
||||||
IndicateConfigChanged(); /**** INDICATE MSG CONFIG CHANGED! *****/
|
|
||||||
|
|
||||||
return !toRemove.empty();
|
return !toRemove.empty();
|
||||||
}
|
}
|
||||||
@ -2994,9 +3006,9 @@ std::list<RsItem *> p3ConnectMgr::saveList(bool &cleanup)
|
|||||||
{
|
{
|
||||||
/* create a list of current peers */
|
/* create a list of current peers */
|
||||||
std::list<RsItem *> saveData;
|
std::list<RsItem *> saveData;
|
||||||
cleanup = true;
|
cleanup = false;
|
||||||
|
|
||||||
RsStackMutex stack(connMtx); /****** STACK LOCK MUTEX *******/
|
connMtx.lock(); /****** MUTEX LOCKED *******/
|
||||||
|
|
||||||
RsPeerNetItem *item = new RsPeerNetItem();
|
RsPeerNetItem *item = new RsPeerNetItem();
|
||||||
item->clear();
|
item->clear();
|
||||||
@ -3033,6 +3045,7 @@ std::list<RsItem *> p3ConnectMgr::saveList(bool &cleanup)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
saveData.push_back(item);
|
saveData.push_back(item);
|
||||||
|
saveCleanupList.push_back(item);
|
||||||
|
|
||||||
/* iterate through all friends and save */
|
/* iterate through all friends and save */
|
||||||
std::map<std::string, peerConnectState>::iterator it;
|
std::map<std::string, peerConnectState>::iterator it;
|
||||||
@ -3054,6 +3067,7 @@ std::list<RsItem *> p3ConnectMgr::saveList(bool &cleanup)
|
|||||||
(it->second).ipAddrs.mExt.loadTlv(item->extAddrList);
|
(it->second).ipAddrs.mExt.loadTlv(item->extAddrList);
|
||||||
|
|
||||||
saveData.push_back(item);
|
saveData.push_back(item);
|
||||||
|
saveCleanupList.push_back(item);
|
||||||
#ifdef CONN_DEBUG
|
#ifdef CONN_DEBUG
|
||||||
std::cerr << "p3ConnectMgr::saveList() Peer Config Item:" << std::endl;
|
std::cerr << "p3ConnectMgr::saveList() Peer Config Item:" << std::endl;
|
||||||
item->print(std::cerr, 10);
|
item->print(std::cerr, 10);
|
||||||
@ -3074,6 +3088,7 @@ std::list<RsItem *> p3ConnectMgr::saveList(bool &cleanup)
|
|||||||
std::cout << "Pushing item for use_extr_addr_finder = " << mUseExtAddrFinder << std::endl ;
|
std::cout << "Pushing item for use_extr_addr_finder = " << mUseExtAddrFinder << std::endl ;
|
||||||
#endif
|
#endif
|
||||||
saveData.push_back(vitem);
|
saveData.push_back(vitem);
|
||||||
|
saveCleanupList.push_back(vitem);
|
||||||
|
|
||||||
// Now save config for network digging strategies
|
// Now save config for network digging strategies
|
||||||
|
|
||||||
@ -3088,10 +3103,33 @@ std::list<RsItem *> p3ConnectMgr::saveList(bool &cleanup)
|
|||||||
std::cout << "Pushing item for allow_tunnel_connection = " << mAllowTunnelConnection << std::endl ;
|
std::cout << "Pushing item for allow_tunnel_connection = " << mAllowTunnelConnection << std::endl ;
|
||||||
#endif
|
#endif
|
||||||
saveData.push_back(vitem2);
|
saveData.push_back(vitem2);
|
||||||
|
saveCleanupList.push_back(vitem2);
|
||||||
|
|
||||||
|
/* save groups */
|
||||||
|
|
||||||
|
std::list<RsPeerGroupItem *>::iterator groupIt;
|
||||||
|
for (groupIt = groupList.begin(); groupIt != groupList.end(); groupIt++) {
|
||||||
|
saveData.push_back(*groupIt); // no delete
|
||||||
|
}
|
||||||
|
|
||||||
return saveData;
|
return saveData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void p3ConnectMgr::saveDone()
|
||||||
|
{
|
||||||
|
/* clean up the save List */
|
||||||
|
std::list<RsItem *>::iterator it;
|
||||||
|
for(it = saveCleanupList.begin(); it != saveCleanupList.end(); it++)
|
||||||
|
{
|
||||||
|
delete (*it);
|
||||||
|
}
|
||||||
|
|
||||||
|
saveCleanupList.clear();
|
||||||
|
|
||||||
|
/* unlock mutex */
|
||||||
|
connMtx.unlock(); /****** MUTEX UNLOCKED *******/
|
||||||
|
}
|
||||||
|
|
||||||
bool p3ConnectMgr::loadList(std::list<RsItem *> load)
|
bool p3ConnectMgr::loadList(std::list<RsItem *> load)
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -3111,7 +3149,6 @@ bool p3ConnectMgr::loadList(std::list<RsItem *> load)
|
|||||||
for(it = load.begin(); it != load.end(); it++)
|
for(it = load.begin(); it != load.end(); it++)
|
||||||
{
|
{
|
||||||
RsPeerNetItem *pitem = dynamic_cast<RsPeerNetItem *>(*it);
|
RsPeerNetItem *pitem = dynamic_cast<RsPeerNetItem *>(*it);
|
||||||
RsConfigKeyValueSet *vitem = dynamic_cast<RsConfigKeyValueSet *>(*it) ;
|
|
||||||
if (pitem)
|
if (pitem)
|
||||||
{
|
{
|
||||||
if (pitem->pid == ownId)
|
if (pitem->pid == ownId)
|
||||||
@ -3146,8 +3183,14 @@ bool p3ConnectMgr::loadList(std::list<RsItem *> load)
|
|||||||
addrs.mLocal.extractFromTlv(pitem->localAddrList);
|
addrs.mLocal.extractFromTlv(pitem->localAddrList);
|
||||||
addrs.mExt.extractFromTlv(pitem->extAddrList);
|
addrs.mExt.extractFromTlv(pitem->extAddrList);
|
||||||
updateAddressList(pitem->pid, addrs);
|
updateAddressList(pitem->pid, addrs);
|
||||||
|
|
||||||
|
delete(*it);
|
||||||
|
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
else if(vitem)
|
|
||||||
|
RsConfigKeyValueSet *vitem = dynamic_cast<RsConfigKeyValueSet *>(*it) ;
|
||||||
|
if (vitem)
|
||||||
{
|
{
|
||||||
RsStackMutex stack(connMtx); /****** STACK LOCK MUTEX *******/
|
RsStackMutex stack(connMtx); /****** STACK LOCK MUTEX *******/
|
||||||
|
|
||||||
@ -3166,10 +3209,86 @@ bool p3ConnectMgr::loadList(std::list<RsItem *> load)
|
|||||||
std::cerr << "setting allow_tunnel_connection to " << mAllowTunnelConnection << std::endl ;
|
std::cerr << "setting allow_tunnel_connection to " << mAllowTunnelConnection << std::endl ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
delete(*it);
|
||||||
|
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
RsPeerGroupItem *gitem = dynamic_cast<RsPeerGroupItem *>(*it) ;
|
||||||
|
if (gitem)
|
||||||
|
{
|
||||||
|
RsStackMutex stack(connMtx); /****** STACK LOCK MUTEX *******/
|
||||||
|
|
||||||
|
#ifdef CONN_DEBUG
|
||||||
|
std::cerr << "p3ConnectMgr::loadList() Peer group item:" << std::endl;
|
||||||
|
gitem->print(std::cerr, 10);
|
||||||
|
std::cerr << std::endl;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
groupList.push_back(gitem); // don't delete
|
||||||
|
|
||||||
|
if ((gitem->flag & RS_GROUP_FLAG_STANDARD) == 0) {
|
||||||
|
/* calculate group id */
|
||||||
|
uint32_t groupId = atoi(gitem->id.c_str());
|
||||||
|
if (groupId > lastGroupId) {
|
||||||
|
lastGroupId = groupId;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
delete (*it);
|
delete (*it);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
/* set missing groupIds */
|
||||||
|
|
||||||
|
RsStackMutex stack(connMtx); /****** STACK LOCK MUTEX *******/
|
||||||
|
|
||||||
|
/* Standard groups */
|
||||||
|
const int standardGroupCount = 5;
|
||||||
|
const char *standardGroup[standardGroupCount] = { RS_GROUP_ID_FRIENDS, RS_GROUP_ID_FAMILY, RS_GROUP_ID_COWORKERS, RS_GROUP_ID_OTHERS, RS_GROUP_ID_FAVORITES };
|
||||||
|
bool foundStandardGroup[standardGroupCount] = { false, false, false, false, false };
|
||||||
|
|
||||||
|
std::list<RsPeerGroupItem *>::iterator groupIt;
|
||||||
|
for (groupIt = groupList.begin(); groupIt != groupList.end(); groupIt++) {
|
||||||
|
if ((*groupIt)->flag & RS_GROUP_FLAG_STANDARD) {
|
||||||
|
int i;
|
||||||
|
for (i = 0; i < standardGroupCount; i++) {
|
||||||
|
if ((*groupIt)->id == standardGroup[i]) {
|
||||||
|
foundStandardGroup[i] = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (i >= standardGroupCount) {
|
||||||
|
/* No more a standard group, remove the flag standard */
|
||||||
|
(*groupIt)->flag &= ~RS_GROUP_FLAG_STANDARD;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
uint32_t groupId = atoi((*groupIt)->id.c_str());
|
||||||
|
if (groupId == 0) {
|
||||||
|
std::ostringstream out;
|
||||||
|
out << (lastGroupId++);
|
||||||
|
(*groupIt)->id = out.str();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Initialize standard groups */
|
||||||
|
for (int i = 0; i < standardGroupCount; i++) {
|
||||||
|
if (foundStandardGroup[i] == false) {
|
||||||
|
RsPeerGroupItem *gitem = new RsPeerGroupItem;
|
||||||
|
gitem->id = standardGroup[i];
|
||||||
|
gitem->name = standardGroup[i];
|
||||||
|
gitem->flag |= RS_GROUP_FLAG_STANDARD;
|
||||||
|
groupList.push_back(gitem);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3399,10 +3518,203 @@ bool p3ConnectMgr::getDHTEnabled()
|
|||||||
return netAssistConnectEnabled();
|
return netAssistConnectEnabled();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void p3ConnectMgr::getNetStatus(pqiNetStatus &status)
|
void p3ConnectMgr::getNetStatus(pqiNetStatus &status)
|
||||||
{
|
{
|
||||||
RsStackMutex stack(connMtx); /****** STACK LOCK MUTEX *******/
|
RsStackMutex stack(connMtx); /****** STACK LOCK MUTEX *******/
|
||||||
status = mNetFlags;
|
status = mNetFlags;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**********************************************************************
|
||||||
|
**********************************************************************
|
||||||
|
************************** Groups ************************************
|
||||||
|
**********************************************************************
|
||||||
|
**********************************************************************/
|
||||||
|
|
||||||
|
bool p3ConnectMgr::addGroup(RsGroupInfo &groupInfo)
|
||||||
|
{
|
||||||
|
{
|
||||||
|
RsStackMutex stack(connMtx); /****** STACK LOCK MUTEX *******/
|
||||||
|
|
||||||
|
RsPeerGroupItem *groupItem = new RsPeerGroupItem;
|
||||||
|
groupItem->set(groupInfo);
|
||||||
|
|
||||||
|
std::ostringstream out;
|
||||||
|
out << (++lastGroupId);
|
||||||
|
groupItem->id = out.str();
|
||||||
|
|
||||||
|
// remove standard flag
|
||||||
|
groupItem->flag &= ~RS_GROUP_FLAG_STANDARD;
|
||||||
|
|
||||||
|
groupItem->PeerId(getOwnId());
|
||||||
|
|
||||||
|
groupList.push_back(groupItem);
|
||||||
|
}
|
||||||
|
|
||||||
|
rsicontrol->getNotify().notifyListChange(NOTIFY_LIST_GROUPLIST, NOTIFY_TYPE_ADD);
|
||||||
|
|
||||||
|
IndicateConfigChanged();
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool p3ConnectMgr::editGroup(const std::string &groupId, RsGroupInfo &groupInfo)
|
||||||
|
{
|
||||||
|
if (groupId.empty()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool changed = false;
|
||||||
|
|
||||||
|
{
|
||||||
|
RsStackMutex stack(connMtx); /****** STACK LOCK MUTEX *******/
|
||||||
|
|
||||||
|
std::list<RsPeerGroupItem*>::iterator groupIt;
|
||||||
|
for (groupIt = groupList.begin(); groupIt != groupList.end(); groupIt++) {
|
||||||
|
if ((*groupIt)->id == groupId) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (groupIt != groupList.end()) {
|
||||||
|
if ((*groupIt)->flag & RS_GROUP_FLAG_STANDARD) {
|
||||||
|
// can't edit standard groups
|
||||||
|
} else {
|
||||||
|
changed = true;
|
||||||
|
(*groupIt)->set(groupInfo);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (changed) {
|
||||||
|
rsicontrol->getNotify().notifyListChange(NOTIFY_LIST_GROUPLIST, NOTIFY_TYPE_MOD);
|
||||||
|
|
||||||
|
IndicateConfigChanged();
|
||||||
|
}
|
||||||
|
|
||||||
|
return changed;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool p3ConnectMgr::removeGroup(const std::string &groupId)
|
||||||
|
{
|
||||||
|
if (groupId.empty()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool changed = false;
|
||||||
|
|
||||||
|
{
|
||||||
|
RsStackMutex stack(connMtx); /****** STACK LOCK MUTEX *******/
|
||||||
|
|
||||||
|
std::list<RsPeerGroupItem*>::iterator groupIt;
|
||||||
|
for (groupIt = groupList.begin(); groupIt != groupList.end(); groupIt++) {
|
||||||
|
if ((*groupIt)->id == groupId) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (groupIt != groupList.end()) {
|
||||||
|
if ((*groupIt)->flag & RS_GROUP_FLAG_STANDARD) {
|
||||||
|
// can't remove standard groups
|
||||||
|
} else {
|
||||||
|
changed = true;
|
||||||
|
delete(*groupIt);
|
||||||
|
groupList.erase(groupIt);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (changed) {
|
||||||
|
rsicontrol->getNotify().notifyListChange(NOTIFY_LIST_GROUPLIST, NOTIFY_TYPE_DEL);
|
||||||
|
|
||||||
|
IndicateConfigChanged();
|
||||||
|
}
|
||||||
|
|
||||||
|
return changed;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool p3ConnectMgr::getGroupInfo(const std::string &groupId, RsGroupInfo &groupInfo)
|
||||||
|
{
|
||||||
|
if (groupId.empty()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
RsStackMutex stack(connMtx); /****** STACK LOCK MUTEX *******/
|
||||||
|
|
||||||
|
std::list<RsPeerGroupItem*>::iterator groupIt;
|
||||||
|
for (groupIt = groupList.begin(); groupIt != groupList.end(); groupIt++) {
|
||||||
|
if ((*groupIt)->id == groupId) {
|
||||||
|
(*groupIt)->get(groupInfo);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool p3ConnectMgr::getGroupInfoList(std::list<RsGroupInfo> &groupInfoList)
|
||||||
|
{
|
||||||
|
RsStackMutex stack(connMtx); /****** STACK LOCK MUTEX *******/
|
||||||
|
|
||||||
|
std::list<RsPeerGroupItem*>::iterator groupIt;
|
||||||
|
for (groupIt = groupList.begin(); groupIt != groupList.end(); groupIt++) {
|
||||||
|
RsGroupInfo groupInfo;
|
||||||
|
(*groupIt)->get(groupInfo);
|
||||||
|
groupInfoList.push_back(groupInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// groupId == "" && assign == false -> remove from all groups
|
||||||
|
bool p3ConnectMgr::assignPeersToGroup(const std::string &groupId, const std::list<std::string> &peerIds, bool assign)
|
||||||
|
{
|
||||||
|
if (groupId.empty() && assign == true) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (peerIds.empty()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool changed = false;
|
||||||
|
|
||||||
|
{
|
||||||
|
RsStackMutex stack(connMtx); /****** STACK LOCK MUTEX *******/
|
||||||
|
|
||||||
|
std::list<RsPeerGroupItem*>::iterator groupIt;
|
||||||
|
for (groupIt = groupList.begin(); groupIt != groupList.end(); groupIt++) {
|
||||||
|
if (groupId.empty() || (*groupIt)->id == groupId) {
|
||||||
|
RsPeerGroupItem *groupItem = *groupIt;
|
||||||
|
|
||||||
|
std::list<std::string>::const_iterator peerIt;
|
||||||
|
for (peerIt = peerIds.begin(); peerIt != peerIds.end(); peerIt++) {
|
||||||
|
std::list<std::string>::iterator peerIt1 = std::find(groupItem->peerIds.begin(), groupItem->peerIds.end(), *peerIt);
|
||||||
|
if (assign) {
|
||||||
|
if (peerIt1 == groupItem->peerIds.end()) {
|
||||||
|
groupItem->peerIds.push_back(*peerIt);
|
||||||
|
changed = true;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (peerIt1 != groupItem->peerIds.end()) {
|
||||||
|
groupItem->peerIds.erase(peerIt1);
|
||||||
|
changed = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (groupId.empty() == false) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (changed) {
|
||||||
|
rsicontrol->getNotify().notifyListChange(NOTIFY_LIST_GROUPLIST, NOTIFY_TYPE_MOD);
|
||||||
|
|
||||||
|
IndicateConfigChanged();
|
||||||
|
}
|
||||||
|
|
||||||
|
return changed;
|
||||||
|
}
|
||||||
|
@ -201,7 +201,8 @@ class pqiNetStatus
|
|||||||
};
|
};
|
||||||
|
|
||||||
class p3tunnel;
|
class p3tunnel;
|
||||||
|
class RsPeerGroupItem;
|
||||||
|
class RsGroupInfo;
|
||||||
|
|
||||||
std::string textPeerConnectState(peerConnectState &state);
|
std::string textPeerConnectState(peerConnectState &state);
|
||||||
|
|
||||||
@ -299,6 +300,13 @@ bool connectAttempt(std::string id, struct sockaddr_in &addr,
|
|||||||
uint32_t &delay, uint32_t &period, uint32_t &type);
|
uint32_t &delay, uint32_t &period, uint32_t &type);
|
||||||
bool connectResult(std::string id, bool success, uint32_t flags, struct sockaddr_in remote_peer_address);
|
bool connectResult(std::string id, bool success, uint32_t flags, struct sockaddr_in remote_peer_address);
|
||||||
|
|
||||||
|
/******************** Groups **********************/
|
||||||
|
bool addGroup(RsGroupInfo &groupInfo);
|
||||||
|
bool editGroup(const std::string &groupId, RsGroupInfo &groupInfo);
|
||||||
|
bool removeGroup(const std::string &groupId);
|
||||||
|
bool getGroupInfo(const std::string &groupId, RsGroupInfo &groupInfo);
|
||||||
|
bool getGroupInfoList(std::list<RsGroupInfo> &groupInfoList);
|
||||||
|
bool assignPeersToGroup(const std::string &groupId, const std::list<std::string> &peerIds, bool assign);
|
||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@ -362,6 +370,7 @@ bool retryConnectTCP(std::string id);
|
|||||||
/* Key Functions to be overloaded for Full Configuration */
|
/* Key Functions to be overloaded for Full Configuration */
|
||||||
virtual RsSerialiser *setupSerialiser();
|
virtual RsSerialiser *setupSerialiser();
|
||||||
virtual std::list<RsItem *> saveList(bool &cleanup);
|
virtual std::list<RsItem *> saveList(bool &cleanup);
|
||||||
|
virtual void saveDone();
|
||||||
virtual bool loadList(std::list<RsItem *> load);
|
virtual bool loadList(std::list<RsItem *> load);
|
||||||
/*****************************************************************/
|
/*****************************************************************/
|
||||||
|
|
||||||
@ -408,6 +417,11 @@ void netStatusReset_locked();
|
|||||||
|
|
||||||
std::map<std::string, peerConnectState> mFriendList;
|
std::map<std::string, peerConnectState> mFriendList;
|
||||||
std::map<std::string, peerConnectState> mOthersList;
|
std::map<std::string, peerConnectState> mOthersList;
|
||||||
|
|
||||||
|
std::list<RsPeerGroupItem *> groupList;
|
||||||
|
uint32_t lastGroupId;
|
||||||
|
|
||||||
|
std::list<RsItem *> saveCleanupList; /* TEMPORARY LIST WHEN SAVING */
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // MRK_PQI_CONNECTION_MANAGER_HEADER
|
#endif // MRK_PQI_CONNECTION_MANAGER_HEADER
|
||||||
|
@ -230,6 +230,7 @@ const int NOTIFY_LIST_MESSAGE_TAGS = 12;
|
|||||||
const int NOTIFY_LIST_PUBLIC_CHAT = 13;
|
const int NOTIFY_LIST_PUBLIC_CHAT = 13;
|
||||||
const int NOTIFY_LIST_PRIVATE_INCOMING_CHAT = 14;
|
const int NOTIFY_LIST_PRIVATE_INCOMING_CHAT = 14;
|
||||||
const int NOTIFY_LIST_PRIVATE_OUTGOING_CHAT = 15;
|
const int NOTIFY_LIST_PRIVATE_OUTGOING_CHAT = 15;
|
||||||
|
const int NOTIFY_LIST_GROUPLIST = 16;
|
||||||
|
|
||||||
const int NOTIFY_TYPE_SAME = 0x01;
|
const int NOTIFY_TYPE_SAME = 0x01;
|
||||||
const int NOTIFY_TYPE_MOD = 0x02; /* general purpose, check all */
|
const int NOTIFY_TYPE_MOD = 0x02; /* general purpose, check all */
|
||||||
|
@ -61,6 +61,15 @@ const uint32_t RS_PEER_STATE_ONLINE = 0x0002;
|
|||||||
const uint32_t RS_PEER_STATE_CONNECTED = 0x0004;
|
const uint32_t RS_PEER_STATE_CONNECTED = 0x0004;
|
||||||
const uint32_t RS_PEER_STATE_UNREACHABLE= 0x0008;
|
const uint32_t RS_PEER_STATE_UNREACHABLE= 0x0008;
|
||||||
|
|
||||||
|
/* Groups */
|
||||||
|
#define RS_GROUP_ID_FRIENDS "Friends"
|
||||||
|
#define RS_GROUP_ID_FAMILY "Family"
|
||||||
|
#define RS_GROUP_ID_COWORKERS "Co-Workers"
|
||||||
|
#define RS_GROUP_ID_OTHERS "Other Contacts"
|
||||||
|
#define RS_GROUP_ID_FAVORITES "Favorites"
|
||||||
|
|
||||||
|
const uint32_t RS_GROUP_FLAG_STANDARD = 0x0001;
|
||||||
|
|
||||||
/* A couple of helper functions for translating the numbers games */
|
/* A couple of helper functions for translating the numbers games */
|
||||||
|
|
||||||
std::string RsPeerTrustString(uint32_t trustLvl);
|
std::string RsPeerTrustString(uint32_t trustLvl);
|
||||||
@ -119,6 +128,18 @@ class RsPeerDetails
|
|||||||
uint32_t connectPeriod;
|
uint32_t connectPeriod;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class RsGroupInfo
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
RsGroupInfo();
|
||||||
|
|
||||||
|
std::string id;
|
||||||
|
std::string name;
|
||||||
|
uint32_t flag;
|
||||||
|
|
||||||
|
std::list<std::string> peerIds;
|
||||||
|
};
|
||||||
|
|
||||||
std::ostream &operator<<(std::ostream &out, const RsPeerDetails &detail);
|
std::ostream &operator<<(std::ostream &out, const RsPeerDetails &detail);
|
||||||
|
|
||||||
class RsPeers
|
class RsPeers
|
||||||
@ -191,6 +212,16 @@ virtual bool setAcceptToConnectGPGCertificate(std::string gpg_id, bool acceptanc
|
|||||||
virtual bool signGPGCertificate(std::string gpg_id) = 0;
|
virtual bool signGPGCertificate(std::string gpg_id) = 0;
|
||||||
virtual bool trustGPGCertificate(std::string gpg_id, uint32_t trustlvl) = 0;
|
virtual bool trustGPGCertificate(std::string gpg_id, uint32_t trustlvl) = 0;
|
||||||
|
|
||||||
|
/* Group Stuff */
|
||||||
|
virtual bool addGroup(RsGroupInfo &groupInfo) = 0;
|
||||||
|
virtual bool editGroup(const std::string &groupId, RsGroupInfo &groupInfo) = 0;
|
||||||
|
virtual bool removeGroup(const std::string &groupId) = 0;
|
||||||
|
virtual bool getGroupInfo(const std::string &groupId, RsGroupInfo &groupInfo) = 0;
|
||||||
|
virtual bool getGroupInfoList(std::list<RsGroupInfo> &groupInfoList) = 0;
|
||||||
|
// groupId == "" && assign == false -> remove from all groups
|
||||||
|
virtual bool assignPeerToGroup(const std::string &groupId, const std::string &peerId, bool assign) = 0;
|
||||||
|
virtual bool assignPeersToGroup(const std::string &groupId, const std::list<std::string> &peerIds, bool assign) = 0;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -1150,8 +1150,68 @@ int ensureExtension(std::string &name, std::string def_ext)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Group Stuff */
|
||||||
|
bool p3Peers::addGroup(RsGroupInfo &groupInfo)
|
||||||
|
{
|
||||||
|
#ifdef P3PEERS_DEBUG
|
||||||
|
std::cerr << "p3Peers::addGroup()" << std::endl;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return mConnMgr->addGroup(groupInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool p3Peers::editGroup(const std::string &groupId, RsGroupInfo &groupInfo)
|
||||||
|
{
|
||||||
|
#ifdef P3PEERS_DEBUG
|
||||||
|
std::cerr << "p3Peers::editGroup()" << std::endl;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return mConnMgr->editGroup(groupId, groupInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool p3Peers::removeGroup(const std::string &groupId)
|
||||||
|
{
|
||||||
|
#ifdef P3PEERS_DEBUG
|
||||||
|
std::cerr << "p3Peers::removeGroup()" << std::endl;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return mConnMgr->removeGroup(groupId);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool p3Peers::getGroupInfo(const std::string &groupId, RsGroupInfo &groupInfo)
|
||||||
|
{
|
||||||
|
#ifdef P3PEERS_DEBUG
|
||||||
|
std::cerr << "p3Peers::getGroupInfo()" << std::endl;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return mConnMgr->getGroupInfo(groupId, groupInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool p3Peers::getGroupInfoList(std::list<RsGroupInfo> &groupInfoList)
|
||||||
|
{
|
||||||
|
#ifdef P3PEERS_DEBUG
|
||||||
|
std::cerr << "p3Peers::getGroupInfoList()" << std::endl;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return mConnMgr->getGroupInfoList(groupInfoList);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool p3Peers::assignPeerToGroup(const std::string &groupId, const std::string &peerId, bool assign)
|
||||||
|
{
|
||||||
|
std::list<std::string> peerIds;
|
||||||
|
peerIds.push_back(peerId);
|
||||||
|
|
||||||
|
return assignPeersToGroup(groupId, peerIds, assign);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool p3Peers::assignPeersToGroup(const std::string &groupId, const std::list<std::string> &peerIds, bool assign)
|
||||||
|
{
|
||||||
|
#ifdef P3PEERS_DEBUG
|
||||||
|
std::cerr << "p3Peers::assignPeersToGroup()" << std::endl;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return mConnMgr->assignPeersToGroup(groupId, peerIds, assign);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
RsPeerDetails::RsPeerDetails()
|
RsPeerDetails::RsPeerDetails()
|
||||||
@ -1214,3 +1274,8 @@ std::ostream &operator<<(std::ostream &out, const RsPeerDetails &detail)
|
|||||||
|
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RsGroupInfo::RsGroupInfo()
|
||||||
|
{
|
||||||
|
flag = 0;
|
||||||
|
}
|
||||||
|
@ -101,6 +101,15 @@ virtual bool setAcceptToConnectGPGCertificate(std::string gpg_id, bool acceptanc
|
|||||||
virtual bool signGPGCertificate(std::string id);
|
virtual bool signGPGCertificate(std::string id);
|
||||||
virtual bool trustGPGCertificate(std::string id, uint32_t trustlvl);
|
virtual bool trustGPGCertificate(std::string id, uint32_t trustlvl);
|
||||||
|
|
||||||
|
/* Group Stuff */
|
||||||
|
virtual bool addGroup(RsGroupInfo &groupInfo);
|
||||||
|
virtual bool editGroup(const std::string &groupId, RsGroupInfo &groupInfo);
|
||||||
|
virtual bool removeGroup(const std::string &groupId);
|
||||||
|
virtual bool getGroupInfo(const std::string &groupId, RsGroupInfo &groupInfo);
|
||||||
|
virtual bool getGroupInfoList(std::list<RsGroupInfo> &groupInfoList);
|
||||||
|
virtual bool assignPeerToGroup(const std::string &groupId, const std::string &peerId, bool assign);
|
||||||
|
virtual bool assignPeersToGroup(const std::string &groupId, const std::list<std::string> &peerIds, bool assign);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
p3ConnectMgr *mConnMgr;
|
p3ConnectMgr *mConnMgr;
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
|
|
||||||
#include "serialiser/rsbaseserial.h"
|
#include "serialiser/rsbaseserial.h"
|
||||||
#include "serialiser/rsconfigitems.h"
|
#include "serialiser/rsconfigitems.h"
|
||||||
|
#include "retroshare/rspeers.h"
|
||||||
|
|
||||||
/***
|
/***
|
||||||
#define RSSERIAL_DEBUG 1
|
#define RSSERIAL_DEBUG 1
|
||||||
@ -664,6 +665,7 @@ uint32_t RsPeerConfigSerialiser::size(RsItem *i)
|
|||||||
RsPeerOldNetItem *oldpni;
|
RsPeerOldNetItem *oldpni;
|
||||||
RsPeerStunItem *psi;
|
RsPeerStunItem *psi;
|
||||||
RsPeerNetItem *pni;
|
RsPeerNetItem *pni;
|
||||||
|
RsPeerGroupItem *pgi;
|
||||||
|
|
||||||
if (NULL != (oldpni = dynamic_cast<RsPeerOldNetItem *>(i)))
|
if (NULL != (oldpni = dynamic_cast<RsPeerOldNetItem *>(i)))
|
||||||
{
|
{
|
||||||
@ -677,6 +679,10 @@ uint32_t RsPeerConfigSerialiser::size(RsItem *i)
|
|||||||
{
|
{
|
||||||
return sizeStun(psi);
|
return sizeStun(psi);
|
||||||
}
|
}
|
||||||
|
else if (NULL != (pgi = dynamic_cast<RsPeerGroupItem *>(i)))
|
||||||
|
{
|
||||||
|
return sizeGroup(pgi);
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -687,6 +693,7 @@ bool RsPeerConfigSerialiser::serialise(RsItem *i, void *data, uint32_t *pktsi
|
|||||||
RsPeerOldNetItem *oldpni;
|
RsPeerOldNetItem *oldpni;
|
||||||
RsPeerNetItem *pni;
|
RsPeerNetItem *pni;
|
||||||
RsPeerStunItem *psi;
|
RsPeerStunItem *psi;
|
||||||
|
RsPeerGroupItem *pgi;
|
||||||
|
|
||||||
if (NULL != (oldpni = dynamic_cast<RsPeerOldNetItem *>(i)))
|
if (NULL != (oldpni = dynamic_cast<RsPeerOldNetItem *>(i)))
|
||||||
{
|
{
|
||||||
@ -700,6 +707,10 @@ bool RsPeerConfigSerialiser::serialise(RsItem *i, void *data, uint32_t *pktsi
|
|||||||
{
|
{
|
||||||
return serialiseStun(psi, data, pktsize);
|
return serialiseStun(psi, data, pktsize);
|
||||||
}
|
}
|
||||||
|
else if (NULL != (pgi = dynamic_cast<RsPeerGroupItem *>(i)))
|
||||||
|
{
|
||||||
|
return serialiseGroup(pgi, data, pktsize);
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -726,16 +737,14 @@ RsItem *RsPeerConfigSerialiser::deserialise(void *data, uint32_t *pktsize)
|
|||||||
old = deserialiseOldNet(data, pktsize);
|
old = deserialiseOldNet(data, pktsize);
|
||||||
/* upgrade mechanism */
|
/* upgrade mechanism */
|
||||||
return convertToNetItem(old);
|
return convertToNetItem(old);
|
||||||
break;
|
|
||||||
case RS_PKT_SUBTYPE_PEER_NET:
|
case RS_PKT_SUBTYPE_PEER_NET:
|
||||||
return deserialiseNet(data, pktsize);
|
return deserialiseNet(data, pktsize);
|
||||||
break;
|
|
||||||
case RS_PKT_SUBTYPE_PEER_STUN:
|
case RS_PKT_SUBTYPE_PEER_STUN:
|
||||||
return deserialiseStun(data, pktsize);
|
return deserialiseStun(data, pktsize);
|
||||||
break;
|
case RS_PKT_SUBTYPE_PEER_GROUP:
|
||||||
|
return deserialiseGroup(data, pktsize);
|
||||||
default:
|
default:
|
||||||
return NULL;
|
return NULL;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@ -1302,6 +1311,186 @@ RsPeerStunItem *RsPeerConfigSerialiser::deserialiseStun(void *data, uint32_t *si
|
|||||||
return item;
|
return item;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*************************************************************************/
|
||||||
|
|
||||||
|
RsPeerGroupItem::RsPeerGroupItem() : RsItem(RS_PKT_VERSION1, RS_PKT_CLASS_CONFIG, RS_PKT_TYPE_PEER_CONFIG, RS_PKT_SUBTYPE_PEER_GROUP)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
RsPeerGroupItem::~RsPeerGroupItem()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void RsPeerGroupItem::clear()
|
||||||
|
{
|
||||||
|
id.clear();
|
||||||
|
name.clear();
|
||||||
|
flag = 0;
|
||||||
|
peerIds.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
std::ostream &RsPeerGroupItem::print(std::ostream &out, uint16_t indent)
|
||||||
|
{
|
||||||
|
printRsItemBase(out, "RsPeerGroupItem", indent);
|
||||||
|
uint16_t int_Indent = indent + 2;
|
||||||
|
|
||||||
|
printIndent(out, int_Indent);
|
||||||
|
out << "groupId: " << id << std::endl;
|
||||||
|
|
||||||
|
printIndent(out, int_Indent);
|
||||||
|
out << "groupName: " << name << std::endl;
|
||||||
|
|
||||||
|
printIndent(out, int_Indent);
|
||||||
|
out << "groupFlag: " << flag << std::endl;
|
||||||
|
|
||||||
|
std::list<std::string>::iterator it;
|
||||||
|
for (it = peerIds.begin(); it != peerIds.end(); it++) {
|
||||||
|
printIndent(out, int_Indent);
|
||||||
|
out << "peerId: " << *it << std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
printRsItemEnd(out, "RsPeerGroupItem", indent);
|
||||||
|
return out;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* set data from RsGroupInfo to RsPeerGroupItem */
|
||||||
|
void RsPeerGroupItem::set(RsGroupInfo &groupInfo)
|
||||||
|
{
|
||||||
|
id = groupInfo.id;
|
||||||
|
name = groupInfo.name;
|
||||||
|
flag = groupInfo.flag;
|
||||||
|
peerIds = groupInfo.peerIds;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* get data from RsGroupInfo to RsPeerGroupItem */
|
||||||
|
void RsPeerGroupItem::get(RsGroupInfo &groupInfo)
|
||||||
|
{
|
||||||
|
groupInfo.id = id;
|
||||||
|
groupInfo.name = name;
|
||||||
|
groupInfo.flag = flag;
|
||||||
|
groupInfo.peerIds = peerIds;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*************************************************************************/
|
||||||
|
|
||||||
|
uint32_t RsPeerConfigSerialiser::sizeGroup(RsPeerGroupItem *i)
|
||||||
|
{
|
||||||
|
uint32_t s = 8; /* header */
|
||||||
|
s += 4; /* version */
|
||||||
|
s += GetTlvStringSize(i->id);
|
||||||
|
s += GetTlvStringSize(i->name);
|
||||||
|
s += 4; /* flag */
|
||||||
|
|
||||||
|
std::list<std::string>::iterator it;
|
||||||
|
for (it = i->peerIds.begin(); it != i->peerIds.end(); it++) {
|
||||||
|
s += GetTlvStringSize(*it);
|
||||||
|
}
|
||||||
|
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool RsPeerConfigSerialiser::serialiseGroup(RsPeerGroupItem *item, void *data, uint32_t *size)
|
||||||
|
{
|
||||||
|
uint32_t tlvsize = RsPeerConfigSerialiser::sizeGroup(item);
|
||||||
|
uint32_t offset = 0;
|
||||||
|
|
||||||
|
if(*size < tlvsize)
|
||||||
|
return false; /* not enough space */
|
||||||
|
|
||||||
|
*size = tlvsize;
|
||||||
|
|
||||||
|
bool ok = true;
|
||||||
|
|
||||||
|
// serialise header
|
||||||
|
|
||||||
|
ok &= setRsItemHeader(data, tlvsize, item->PacketId(), tlvsize);
|
||||||
|
|
||||||
|
#ifdef RSSERIAL_DEBUG
|
||||||
|
std::cerr << "RsPeerConfigSerialiser::serialiseGroup() Header: " << ok << std::endl;
|
||||||
|
std::cerr << "RsPeerConfigSerialiser::serialiseGroup() Header: " << tlvsize << std::endl;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* skip the header */
|
||||||
|
offset += 8;
|
||||||
|
|
||||||
|
/* add mandatory parts first */
|
||||||
|
ok &= setRawUInt32(data, tlvsize, &offset, 0);
|
||||||
|
ok &= SetTlvString(data, tlvsize, &offset, TLV_TYPE_STR_KEY, item->id);
|
||||||
|
ok &= SetTlvString(data, tlvsize, &offset, TLV_TYPE_STR_NAME, item->name);
|
||||||
|
ok &= setRawUInt32(data, tlvsize, &offset, item->flag);
|
||||||
|
|
||||||
|
std::list<std::string>::iterator it;
|
||||||
|
for (it = item->peerIds.begin(); it != item->peerIds.end(); it++) {
|
||||||
|
ok &= SetTlvString(data, tlvsize, &offset, TLV_TYPE_STR_PEERID, *it);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(offset != tlvsize)
|
||||||
|
{
|
||||||
|
ok = false;
|
||||||
|
#ifdef RSSERIAL_DEBUG
|
||||||
|
std::cerr << "RsPeerConfigSerialiser::serialiseGroup() Size Error! " << std::endl;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
return ok;
|
||||||
|
}
|
||||||
|
|
||||||
|
RsPeerGroupItem *RsPeerConfigSerialiser::deserialiseGroup(void *data, uint32_t *size)
|
||||||
|
{
|
||||||
|
/* get the type and size */
|
||||||
|
uint32_t rstype = getRsItemId(data);
|
||||||
|
uint32_t rssize = getRsItemSize(data);
|
||||||
|
|
||||||
|
uint32_t offset = 0;
|
||||||
|
|
||||||
|
if ((RS_PKT_VERSION1 != getRsItemVersion(rstype)) ||
|
||||||
|
(RS_PKT_CLASS_CONFIG != getRsItemClass(rstype)) ||
|
||||||
|
(RS_PKT_TYPE_PEER_CONFIG != getRsItemType(rstype)) ||
|
||||||
|
(RS_PKT_SUBTYPE_PEER_GROUP != getRsItemSubType(rstype)))
|
||||||
|
{
|
||||||
|
return NULL; /* wrong type */
|
||||||
|
}
|
||||||
|
|
||||||
|
if (*size < rssize) /* check size */
|
||||||
|
return NULL; /* not enough data */
|
||||||
|
|
||||||
|
/* set the packet length */
|
||||||
|
*size = rssize;
|
||||||
|
|
||||||
|
bool ok = true;
|
||||||
|
|
||||||
|
RsPeerGroupItem *item = new RsPeerGroupItem();
|
||||||
|
item->clear();
|
||||||
|
|
||||||
|
/* skip the header */
|
||||||
|
offset += 8;
|
||||||
|
|
||||||
|
/* get mandatory parts first */
|
||||||
|
uint32_t version;
|
||||||
|
ok &= getRawUInt32(data, rssize, &offset, &version);
|
||||||
|
ok &= GetTlvString(data, rssize, &offset, TLV_TYPE_STR_KEY, item->id);
|
||||||
|
ok &= GetTlvString(data, rssize, &offset, TLV_TYPE_STR_NAME, item->name);
|
||||||
|
ok &= getRawUInt32(data, rssize, &offset, &(item->flag));
|
||||||
|
|
||||||
|
std::string peerId;
|
||||||
|
while (offset != rssize) {
|
||||||
|
peerId.erase();
|
||||||
|
|
||||||
|
ok &= GetTlvString(data, rssize, &offset, TLV_TYPE_STR_PEERID, peerId);
|
||||||
|
|
||||||
|
item->peerIds.push_back(peerId);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (offset != rssize)
|
||||||
|
{
|
||||||
|
/* error */
|
||||||
|
delete item;
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
return item;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************/
|
/****************************************************************************/
|
||||||
|
|
||||||
|
@ -35,6 +35,8 @@
|
|||||||
#include "serialiser/rstlvtypes.h"
|
#include "serialiser/rstlvtypes.h"
|
||||||
#include "serialiser/rstlvaddrs.h"
|
#include "serialiser/rstlvaddrs.h"
|
||||||
|
|
||||||
|
class RsGroupInfo;
|
||||||
|
|
||||||
const uint8_t RS_PKT_TYPE_GENERAL_CONFIG = 0x01;
|
const uint8_t RS_PKT_TYPE_GENERAL_CONFIG = 0x01;
|
||||||
const uint8_t RS_PKT_TYPE_PEER_CONFIG = 0x02;
|
const uint8_t RS_PKT_TYPE_PEER_CONFIG = 0x02;
|
||||||
const uint8_t RS_PKT_TYPE_CACHE_CONFIG = 0x03;
|
const uint8_t RS_PKT_TYPE_CACHE_CONFIG = 0x03;
|
||||||
@ -44,9 +46,10 @@ const uint8_t RS_PKT_TYPE_FILE_CONFIG = 0x04;
|
|||||||
const uint8_t RS_PKT_SUBTYPE_KEY_VALUE = 0x01;
|
const uint8_t RS_PKT_SUBTYPE_KEY_VALUE = 0x01;
|
||||||
|
|
||||||
/* PEER CONFIG SUBTYPES */
|
/* PEER CONFIG SUBTYPES */
|
||||||
const uint8_t RS_PKT_SUBTYPE_PEER_OLD_NET = 0x01;
|
const uint8_t RS_PKT_SUBTYPE_PEER_OLD_NET = 0x01;
|
||||||
const uint8_t RS_PKT_SUBTYPE_PEER_STUN = 0x02;
|
const uint8_t RS_PKT_SUBTYPE_PEER_STUN = 0x02;
|
||||||
const uint8_t RS_PKT_SUBTYPE_PEER_NET = 0x03; /* replacement for OLD_NET */
|
const uint8_t RS_PKT_SUBTYPE_PEER_NET = 0x03; /* replacement for OLD_NET */
|
||||||
|
const uint8_t RS_PKT_SUBTYPE_PEER_GROUP = 0x04;
|
||||||
|
|
||||||
/* FILE CONFIG SUBTYPES */
|
/* FILE CONFIG SUBTYPES */
|
||||||
const uint8_t RS_PKT_SUBTYPE_FILE_TRANSFER = 0x01;
|
const uint8_t RS_PKT_SUBTYPE_FILE_TRANSFER = 0x01;
|
||||||
@ -114,6 +117,28 @@ std::ostream &print(std::ostream &out, uint16_t indent = 0);
|
|||||||
RsTlvIpAddrSet extAddrList;
|
RsTlvIpAddrSet extAddrList;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class RsPeerGroupItem : public RsItem
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
RsPeerGroupItem();
|
||||||
|
virtual ~RsPeerGroupItem();
|
||||||
|
|
||||||
|
virtual void clear();
|
||||||
|
std::ostream &print(std::ostream &out, uint16_t indent = 0);
|
||||||
|
|
||||||
|
/* set data from RsGroupInfo to RsPeerGroupItem */
|
||||||
|
void set(RsGroupInfo &groupInfo);
|
||||||
|
/* get data from RsGroupInfo to RsPeerGroupItem */
|
||||||
|
void get(RsGroupInfo &groupInfo);
|
||||||
|
|
||||||
|
/* Mandatory */
|
||||||
|
std::string id;
|
||||||
|
std::string name;
|
||||||
|
uint32_t flag;
|
||||||
|
|
||||||
|
std::list<std::string> peerIds;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
class RsPeerStunItem: public RsItem
|
class RsPeerStunItem: public RsItem
|
||||||
{
|
{
|
||||||
@ -160,6 +185,10 @@ virtual uint32_t sizeStun(RsPeerStunItem *);
|
|||||||
virtual bool serialiseStun (RsPeerStunItem *item, void *data, uint32_t *size);
|
virtual bool serialiseStun (RsPeerStunItem *item, void *data, uint32_t *size);
|
||||||
virtual RsPeerStunItem * deserialiseStun(void *data, uint32_t *size);
|
virtual RsPeerStunItem * deserialiseStun(void *data, uint32_t *size);
|
||||||
|
|
||||||
|
virtual uint32_t sizeGroup(RsPeerGroupItem *);
|
||||||
|
virtual bool serialiseGroup (RsPeerGroupItem *item, void *data, uint32_t *size);
|
||||||
|
virtual RsPeerGroupItem * deserialiseGroup(void *data, uint32_t *size);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**************************************************************************/
|
/**************************************************************************/
|
||||||
|
@ -281,6 +281,7 @@ HEADERS += rshare.h \
|
|||||||
gui/common/html.h \
|
gui/common/html.h \
|
||||||
gui/common/StatusDefs.h \
|
gui/common/StatusDefs.h \
|
||||||
gui/common/TagDefs.h \
|
gui/common/TagDefs.h \
|
||||||
|
gui/common/GroupDefs.h \
|
||||||
gui/common/Emoticons.h \
|
gui/common/Emoticons.h \
|
||||||
gui/common/RSTreeWidgetItem.h \
|
gui/common/RSTreeWidgetItem.h \
|
||||||
gui/MessagesDialog.h \
|
gui/MessagesDialog.h \
|
||||||
@ -478,6 +479,7 @@ SOURCES += main.cpp \
|
|||||||
gui/common/html.cpp \
|
gui/common/html.cpp \
|
||||||
gui/common/StatusDefs.cpp \
|
gui/common/StatusDefs.cpp \
|
||||||
gui/common/TagDefs.cpp \
|
gui/common/TagDefs.cpp \
|
||||||
|
gui/common/GroupDefs.cpp \
|
||||||
gui/common/Emoticons.cpp \
|
gui/common/Emoticons.cpp \
|
||||||
gui/common/RSTreeWidgetItem.cpp \
|
gui/common/RSTreeWidgetItem.cpp \
|
||||||
gui/settings/rsharesettings.cpp \
|
gui/settings/rsharesettings.cpp \
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -53,46 +53,48 @@ class RSTreeWidgetItemCompareRole;
|
|||||||
|
|
||||||
class PeersDialog : public RsAutoUpdatePage
|
class PeersDialog : public RsAutoUpdatePage
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/** Default Constructor */
|
/** Default Constructor */
|
||||||
PeersDialog(QWidget *parent = 0);
|
PeersDialog(QWidget *parent = 0);
|
||||||
/** Default Destructor */
|
/** Default Destructor */
|
||||||
~PeersDialog ();
|
~PeersDialog ();
|
||||||
|
|
||||||
// void setChatDialog(ChatDialog *cd);
|
// void setChatDialog(ChatDialog *cd);
|
||||||
|
|
||||||
virtual void updateDisplay() ; // overloaded from RsAutoUpdatePage
|
virtual void updateDisplay() ; // overloaded from RsAutoUpdatePage
|
||||||
// replaced by shortcut
|
// replaced by shortcut
|
||||||
// virtual void keyPressEvent(QKeyEvent *) ;
|
// virtual void keyPressEvent(QKeyEvent *) ;
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
|
|
||||||
void insertPeers();
|
void insertPeers();
|
||||||
void publicChatChanged(int type);
|
void publicChatChanged(int type);
|
||||||
void toggleSendItem( QTreeWidgetItem *item, int col );
|
void toggleSendItem( QTreeWidgetItem *item, int col );
|
||||||
|
|
||||||
void insertChat();
|
void insertChat();
|
||||||
void setChatInfo(QString info, QColor color=QApplication::palette().color(QPalette::WindowText));
|
void setChatInfo(QString info, QColor color=QApplication::palette().color(QPalette::WindowText));
|
||||||
void resetStatusBar() ;
|
void resetStatusBar() ;
|
||||||
|
|
||||||
void fileHashingFinished(AttachFileItem* file);
|
void fileHashingFinished(AttachFileItem* file);
|
||||||
|
|
||||||
void smileyWidgetgroupchat();
|
void smileyWidgetgroupchat();
|
||||||
void addSmileys();
|
void addSmileys();
|
||||||
|
|
||||||
void on_actionClearChat_triggered();
|
void on_actionClearChat_triggered();
|
||||||
void on_actionMessageHistory_triggered();
|
void on_actionMessageHistory_triggered();
|
||||||
|
|
||||||
void displayInfoChatMenu(const QPoint& pos);
|
void displayInfoChatMenu(const QPoint& pos);
|
||||||
|
|
||||||
// called by notifyQt when another peer is typing (in group chant and private chat)
|
// called by notifyQt when another peer is typing (in group chant and private chat)
|
||||||
void updatePeerStatusString(const QString& peer_id,const QString& status_string,bool is_private_chat) ;
|
void updatePeerStatusString(const QString& peer_id,const QString& status_string,bool is_private_chat) ;
|
||||||
|
|
||||||
|
void updatePeersAvatar(const QString& peer_id);
|
||||||
|
void updateAvatar(); // called by notifyQt to update the avatar when it gets changed by another component
|
||||||
|
|
||||||
|
void groupsChanged(int type);
|
||||||
|
|
||||||
void updatePeersAvatar(const QString& peer_id);
|
|
||||||
void updateAvatar(); // called by notifyQt to update the avatar when it gets changed by another component
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void dragEnterEvent(QDragEnterEvent *event);
|
virtual void dragEnterEvent(QDragEnterEvent *event);
|
||||||
virtual void dropEvent(QDropEvent *event);
|
virtual void dropEvent(QDropEvent *event);
|
||||||
@ -100,108 +102,112 @@ protected:
|
|||||||
void showEvent (QShowEvent *event);
|
void showEvent (QShowEvent *event);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void pasteLink() ;
|
void pasteLink() ;
|
||||||
void contextMenu(QPoint) ;
|
void contextMenu(QPoint) ;
|
||||||
|
|
||||||
/** Create the context popup menu and it's submenus */
|
/** Create the context popup menu and it's submenus */
|
||||||
void peertreeWidgetCostumPopupMenu( QPoint point );
|
void peertreeWidgetCostumPopupMenu( QPoint point );
|
||||||
|
|
||||||
void updateStatusString(const QString& peer_id, const QString& statusString) ; // called when a peer is typing in group chat
|
void updateStatusString(const QString& peer_id, const QString& statusString) ; // called when a peer is typing in group chat
|
||||||
void updateStatusTyping() ; // called each time a key is hit
|
void updateStatusTyping() ; // called each time a key is hit
|
||||||
|
|
||||||
//void updatePeerStatusString(const QString& peer_id,const QString& chat_status) ;
|
//void updatePeerStatusString(const QString& peer_id,const QString& chat_status) ;
|
||||||
|
|
||||||
/** Export friend in Friends Dialog */
|
/** Export friend in Friends Dialog */
|
||||||
void exportfriend();
|
void exportfriend();
|
||||||
/** Remove friend */
|
/** Remove friend */
|
||||||
void removefriend();
|
void removefriend();
|
||||||
/** start a chat with a friend **/
|
/** start a chat with a friend **/
|
||||||
void chatfriend(QTreeWidgetItem* );
|
void chatfriend(QTreeWidgetItem* );
|
||||||
void chatfriendproxy();
|
void chatfriendproxy();
|
||||||
void msgfriend();
|
void msgfriend();
|
||||||
void recommendfriend();
|
void recommendfriend();
|
||||||
void pastePerson();
|
void pastePerson();
|
||||||
|
void addToGroup();
|
||||||
|
void moveToGroup();
|
||||||
|
void removeFromGroup();
|
||||||
|
void removeGroup();
|
||||||
|
|
||||||
|
void configurefriend();
|
||||||
|
void viewprofile();
|
||||||
|
|
||||||
void configurefriend();
|
/** RsServer Friend Calls */
|
||||||
void viewprofile();
|
void connectfriend();
|
||||||
|
|
||||||
/** RsServer Friend Calls */
|
void setColor();
|
||||||
void connectfriend();
|
void insertSendList();
|
||||||
|
void sendMsg();
|
||||||
|
|
||||||
void setColor();
|
void statusmessage();
|
||||||
void insertSendList();
|
|
||||||
void sendMsg();
|
|
||||||
|
|
||||||
void statusmessage();
|
|
||||||
|
|
||||||
void setFont();
|
void setFont();
|
||||||
void getFont();
|
void getFont();
|
||||||
void underline();
|
void underline();
|
||||||
|
|
||||||
void changeAvatarClicked();
|
void changeAvatarClicked();
|
||||||
void getAvatar();
|
void getAvatar();
|
||||||
|
|
||||||
void on_actionAdd_Friend_activated();
|
void on_actionAdd_Friend_activated();
|
||||||
void on_actionAdd_Group_activated();
|
void on_actionAdd_Group_activated();
|
||||||
void on_actionCreate_New_Forum_activated();
|
void on_actionCreate_New_Forum_activated();
|
||||||
void on_actionCreate_New_Channel_activated();
|
void on_actionCreate_New_Channel_activated();
|
||||||
|
|
||||||
void loadmypersonalstatus();
|
void loadmypersonalstatus();
|
||||||
|
|
||||||
void addExtraFile();
|
|
||||||
void anchorClicked (const QUrl &);
|
|
||||||
void addAttachment(std::string);
|
|
||||||
|
|
||||||
bool fileSave();
|
|
||||||
bool fileSaveAs();
|
|
||||||
|
|
||||||
void setCurrentFileName(const QString &fileName);
|
void addExtraFile();
|
||||||
|
void anchorClicked (const QUrl &);
|
||||||
void displayMenu();
|
void addAttachment(std::string);
|
||||||
void statusColumn();
|
|
||||||
|
|
||||||
|
bool fileSave();
|
||||||
|
bool fileSaveAs();
|
||||||
|
|
||||||
|
void setCurrentFileName(const QString &fileName);
|
||||||
|
|
||||||
|
void displayMenu();
|
||||||
|
void statusColumn();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void friendsUpdated() ;
|
void friendsUpdated() ;
|
||||||
void notifyGroupChat(const QString&,const QString&) ;
|
void notifyGroupChat(const QString&,const QString&) ;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void processSettings(bool bLoad);
|
void processSettings(bool bLoad);
|
||||||
void addChatMsg(bool incoming, bool history, QString &name, QDateTime &sendTime, QString &message);
|
void addChatMsg(bool incoming, bool history, QString &name, QDateTime &sendTime, QString &message);
|
||||||
|
|
||||||
class QLabel *iconLabel, *textLabel;
|
class QLabel *iconLabel, *textLabel;
|
||||||
class QWidget *widget;
|
class QWidget *widget;
|
||||||
class QWidgetAction *widgetAction;
|
class QWidgetAction *widgetAction;
|
||||||
class QSpacerItem *spacerItem;
|
class QSpacerItem *spacerItem;
|
||||||
|
|
||||||
RSTreeWidgetItemCompareRole *m_compareRole;
|
RSTreeWidgetItemCompareRole *m_compareRole;
|
||||||
|
|
||||||
///play the sound when recv a message
|
///play the sound when recv a message
|
||||||
void playsound();
|
void playsound();
|
||||||
|
|
||||||
QString fileName;
|
QString fileName;
|
||||||
|
bool groupsHasChanged;
|
||||||
|
std::list<std::string> openGroups;
|
||||||
|
|
||||||
/* Worker Functions */
|
/* Worker Functions */
|
||||||
/* (1) Update Display */
|
/* (1) Update Display */
|
||||||
|
|
||||||
/* (2) Utility Fns */
|
/* (2) Utility Fns */
|
||||||
QTreeWidgetItem *getCurrentPeer();
|
QTreeWidgetItem *getCurrentPeer();
|
||||||
|
|
||||||
/** Defines the actions for the context menu */
|
/** Defines the actions for the context menu */
|
||||||
QAction* pasteLinkAct;
|
QAction* pasteLinkAct;
|
||||||
|
|
||||||
IMHistoryKeeper historyKeeper;
|
IMHistoryKeeper historyKeeper;
|
||||||
ChatStyle style;
|
ChatStyle style;
|
||||||
|
|
||||||
QColor _currentColor;
|
QColor _currentColor;
|
||||||
bool _underline;
|
bool _underline;
|
||||||
time_t last_status_send_time ;
|
time_t last_status_send_time ;
|
||||||
|
|
||||||
QFont mCurrentFont; /* how the text will come out */
|
QFont mCurrentFont; /* how the text will come out */
|
||||||
|
|
||||||
/** Qt Designer generated object */
|
/** Qt Designer generated object */
|
||||||
Ui::PeersDialog ui;
|
Ui::PeersDialog ui;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // MINIMAL_RSGUI
|
#endif // MINIMAL_RSGUI
|
||||||
|
65
retroshare-gui/src/gui/common/GroupDefs.cpp
Normal file
65
retroshare-gui/src/gui/common/GroupDefs.cpp
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
/****************************************************************
|
||||||
|
* This file is distributed under the following license:
|
||||||
|
*
|
||||||
|
* Copyright (c) 2010, RetroShare Team
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License
|
||||||
|
* as published by the Free Software Foundation; either version 2
|
||||||
|
* of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program 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 General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||||
|
* Boston, MA 02110-1301, USA.
|
||||||
|
****************************************************************/
|
||||||
|
|
||||||
|
#include <QCoreApplication>
|
||||||
|
#include <retroshare/rspeers.h>
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
#include <algorithm>
|
||||||
|
|
||||||
|
#include "GroupDefs.h"
|
||||||
|
|
||||||
|
const QString GroupDefs::name(const RsGroupInfo &groupInfo)
|
||||||
|
{
|
||||||
|
if ((groupInfo.flag & RS_GROUP_FLAG_STANDARD) == 0) {
|
||||||
|
/* no need to be translated */
|
||||||
|
return QString::fromUtf8(groupInfo.name.c_str());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (groupInfo.id == RS_GROUP_ID_FRIENDS) {
|
||||||
|
return qApp->translate("GroupDefs", "Friends");
|
||||||
|
}
|
||||||
|
if (groupInfo.id == RS_GROUP_ID_FAMILY) {
|
||||||
|
return qApp->translate("GroupDefs", "Family");
|
||||||
|
}
|
||||||
|
if (groupInfo.id == RS_GROUP_ID_COWORKERS) {
|
||||||
|
return qApp->translate("GroupDefs", "Co-Workers");
|
||||||
|
}
|
||||||
|
if (groupInfo.id == RS_GROUP_ID_OTHERS) {
|
||||||
|
return qApp->translate("GroupDefs", "Other Contacts");
|
||||||
|
}
|
||||||
|
if (groupInfo.id == RS_GROUP_ID_FAVORITES) {
|
||||||
|
return qApp->translate("GroupDefs", "Favorites");
|
||||||
|
}
|
||||||
|
|
||||||
|
std::cerr << "GroupDefs::name: Unknown group id requested " << groupInfo.id;
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool sortGroupInfo(const RsGroupInfo &groupInfo1, const RsGroupInfo &groupInfo2)
|
||||||
|
{
|
||||||
|
return (GroupDefs::name(groupInfo1).compare(GroupDefs::name(groupInfo2), Qt::CaseInsensitive) < 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
void GroupDefs::sortByName(std::list<RsGroupInfo> &groupInfoList)
|
||||||
|
{
|
||||||
|
groupInfoList.sort(sortGroupInfo);
|
||||||
|
}
|
37
retroshare-gui/src/gui/common/GroupDefs.h
Normal file
37
retroshare-gui/src/gui/common/GroupDefs.h
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
/****************************************************************
|
||||||
|
* This file is distributed under the following license:
|
||||||
|
*
|
||||||
|
* Copyright (c) 2010, RetroShare Team
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License
|
||||||
|
* as published by the Free Software Foundation; either version 2
|
||||||
|
* of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program 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 General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||||
|
* Boston, MA 02110-1301, USA.
|
||||||
|
****************************************************************/
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef _GROUPDEFS_H
|
||||||
|
#define _GROUPDEFS_H
|
||||||
|
|
||||||
|
class RsGroupInfo;
|
||||||
|
|
||||||
|
class GroupDefs
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
static const QString name(const RsGroupInfo &groupInfo);
|
||||||
|
|
||||||
|
static void sortByName(std::list<RsGroupInfo> &groupInfoList);
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
@ -19,16 +19,42 @@
|
|||||||
* Boston, MA 02110-1301, USA.
|
* Boston, MA 02110-1301, USA.
|
||||||
****************************************************************/
|
****************************************************************/
|
||||||
|
|
||||||
|
#include <QPushButton>
|
||||||
|
|
||||||
|
#include <retroshare/rspeers.h>
|
||||||
|
|
||||||
#include "CreateGroup.h"
|
#include "CreateGroup.h"
|
||||||
|
#include "gui/common/GroupDefs.h"
|
||||||
|
|
||||||
/** Default constructor */
|
/** Default constructor */
|
||||||
CreateGroup::CreateGroup(QWidget *parent, Qt::WFlags flags)
|
CreateGroup::CreateGroup(const std::string groupId, QWidget *parent, Qt::WFlags flags)
|
||||||
: QDialog(parent, flags)
|
: QDialog(parent, flags)
|
||||||
{
|
{
|
||||||
/* Invoke Qt Designer generated QObject setup routine */
|
/* Invoke Qt Designer generated QObject setup routine */
|
||||||
ui.setupUi(this);
|
ui.setupUi(this);
|
||||||
|
|
||||||
|
m_groupId = groupId;
|
||||||
|
|
||||||
|
if (m_groupId.empty() == false) {
|
||||||
|
/* edit exisiting group */
|
||||||
|
RsGroupInfo groupInfo;
|
||||||
|
if (rsPeers->getGroupInfo(m_groupId, groupInfo)) {
|
||||||
|
ui.groupname->setText(QString::fromUtf8(groupInfo.name.c_str()));
|
||||||
|
} else {
|
||||||
|
/* Group not found, create new */
|
||||||
|
m_groupId.clear();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
std::list<RsGroupInfo> groupInfoList;
|
||||||
|
rsPeers->getGroupInfoList(groupInfoList);
|
||||||
|
|
||||||
|
std::list<RsGroupInfo>::iterator groupIt;
|
||||||
|
for (groupIt = groupInfoList.begin(); groupIt != groupInfoList.end(); groupIt++) {
|
||||||
|
usedGroupNames.append(GroupDefs::name(*groupIt));
|
||||||
|
}
|
||||||
|
|
||||||
|
on_groupname_textChanged(ui.groupname->text());
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Destructor. */
|
/** Destructor. */
|
||||||
@ -36,3 +62,31 @@ CreateGroup::~CreateGroup()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CreateGroup::on_groupname_textChanged(QString text)
|
||||||
|
{
|
||||||
|
if (text.isEmpty() || usedGroupNames.contains(text)) {
|
||||||
|
ui.buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false);
|
||||||
|
} else {
|
||||||
|
ui.buttonBox->button(QDialogButtonBox::Ok)->setEnabled(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void CreateGroup::on_buttonBox_accepted()
|
||||||
|
{
|
||||||
|
RsGroupInfo groupInfo;
|
||||||
|
|
||||||
|
if (m_groupId.empty()) {
|
||||||
|
// add new group
|
||||||
|
groupInfo.name = ui.groupname->text().toUtf8().constData();
|
||||||
|
if (rsPeers->addGroup(groupInfo)) {
|
||||||
|
close();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (rsPeers->getGroupInfo(m_groupId, groupInfo) == true) {
|
||||||
|
groupInfo.name = ui.groupname->text().toUtf8().constData();
|
||||||
|
if (rsPeers->editGroup(m_groupId, groupInfo)) {
|
||||||
|
close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -28,25 +28,29 @@
|
|||||||
|
|
||||||
class CreateGroup : public QDialog
|
class CreateGroup : public QDialog
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/** Default constructor */
|
/** Default constructor */
|
||||||
CreateGroup(QWidget *parent = 0, Qt::WFlags flags = 0);
|
CreateGroup(const std::string groupId, QWidget *parent = 0, Qt::WFlags flags = 0);
|
||||||
/** Default destructor */
|
/** Default destructor */
|
||||||
~CreateGroup();
|
~CreateGroup();
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
|
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
std::string m_groupId;
|
||||||
|
|
||||||
|
QStringList usedGroupNames;
|
||||||
/** Qt Designer generated object */
|
|
||||||
Ui::CreateGroup ui;
|
/** Qt Designer generated object */
|
||||||
|
Ui::CreateGroup ui;
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
void on_buttonBox_accepted();
|
||||||
|
void on_groupname_textChanged(QString );
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -114,11 +114,7 @@ p, li { white-space: pre-wrap; }
|
|||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
<widget class="QLabel" name="label">
|
<widget class="QLabel" name="label">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
<string>Group Name</string>
|
||||||
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
|
||||||
p, li { white-space: pre-wrap; }
|
|
||||||
</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;">
|
|
||||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Arial'; font-size:9pt;">Group Name</span></p></body></html></string>
|
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@ -177,9 +173,6 @@ p, li { white-space: pre-wrap; }
|
|||||||
</widget>
|
</widget>
|
||||||
<resources>
|
<resources>
|
||||||
<include location="../images.qrc"/>
|
<include location="../images.qrc"/>
|
||||||
<include location="../images.qrc"/>
|
|
||||||
<include location="../images.qrc"/>
|
|
||||||
<include location="../images.qrc"/>
|
|
||||||
</resources>
|
</resources>
|
||||||
<connections>
|
<connections>
|
||||||
<connection>
|
<connection>
|
||||||
|
@ -226,6 +226,7 @@
|
|||||||
<file>images/informations_24x24.png</file>
|
<file>images/informations_24x24.png</file>
|
||||||
<file>images/invite-friend24.png</file>
|
<file>images/invite-friend24.png</file>
|
||||||
<file>images/connect_friend.png</file>
|
<file>images/connect_friend.png</file>
|
||||||
|
<file>images/group24.png</file>
|
||||||
<file>images/kalarm.png</file>
|
<file>images/kalarm.png</file>
|
||||||
<file>images/kbackgammon.png</file>
|
<file>images/kbackgammon.png</file>
|
||||||
<file>images/kblogger.png</file>
|
<file>images/kblogger.png</file>
|
||||||
|
BIN
retroshare-gui/src/gui/images/group24.png
Normal file
BIN
retroshare-gui/src/gui/images/group24.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.6 KiB |
@ -239,6 +239,12 @@ void NotifyQt::notifyListChange(int list, int type)
|
|||||||
#endif
|
#endif
|
||||||
emit privateChatChanged(list, type);
|
emit privateChatChanged(list, type);
|
||||||
break;
|
break;
|
||||||
|
case NOTIFY_LIST_GROUPLIST:
|
||||||
|
#ifdef NOTIFY_DEBUG
|
||||||
|
std::cerr << "received groups changed" << std::endl ;
|
||||||
|
#endif
|
||||||
|
emit groupsChanged(type);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -77,6 +77,7 @@ class NotifyQt: public QObject, public NotifyBase
|
|||||||
void peerStatusChangedSummary() const;
|
void peerStatusChangedSummary() const;
|
||||||
void publicChatChanged(int type) const ;
|
void publicChatChanged(int type) const ;
|
||||||
void privateChatChanged(int list, int type) const ;
|
void privateChatChanged(int list, int type) const ;
|
||||||
|
void groupsChanged(int type) const ;
|
||||||
|
|
||||||
/* Notify from GUI */
|
/* Notify from GUI */
|
||||||
void chatStyleChanged(int /*ChatStyle::enumStyleType*/ styleType);
|
void chatStyleChanged(int /*ChatStyle::enumStyleType*/ styleType);
|
||||||
|
Binary file not shown.
@ -2405,7 +2405,7 @@ p, li { white-space: pre-wrap; }
|
|||||||
<message>
|
<message>
|
||||||
<location filename="../gui/groups/CreateGroup.ui" line="+14"/>
|
<location filename="../gui/groups/CreateGroup.ui" line="+14"/>
|
||||||
<source>Create a Group</source>
|
<source>Create a Group</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation>Gruppe erstellen</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+72"/>
|
<location line="+72"/>
|
||||||
@ -2414,21 +2414,22 @@ p, li { white-space: pre-wrap; }
|
|||||||
p, li { white-space: pre-wrap; }
|
p, li { white-space: pre-wrap; }
|
||||||
</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:18pt; font-weight:600; font-style:normal;">
|
</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:18pt; font-weight:600; font-style:normal;">
|
||||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:400; color:#ffffff;">Create a Group</span></p></body></html></source>
|
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:400; color:#ffffff;">Create a Group</span></p></body></html></source>
|
||||||
<translation type="unfinished"></translation>
|
<translatorcomment>ruppe erstellen</translatorcomment>
|
||||||
|
<translation><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
||||||
|
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||||
|
p, li { white-space: pre-wrap; }
|
||||||
|
</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:18pt; font-weight:600; font-style:normal;">
|
||||||
|
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:400; color:#ffffff;">Gruppe erstellen</span></p></body></html></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+31"/>
|
<location line="+31"/>
|
||||||
<source><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
<source>Group Name</source>
|
||||||
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
<translation>Name</translation>
|
||||||
p, li { white-space: pre-wrap; }
|
|
||||||
</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;">
|
|
||||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Arial'; font-size:9pt;">Group Name</span></p></body></html></source>
|
|
||||||
<translation type="unfinished"></translation>
|
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+11"/>
|
<location line="+7"/>
|
||||||
<source>Enter a name for your group</source>
|
<source>Enter a name for your group</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation>Gib einen Namen für Deine Gruppe ein</translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
@ -4098,6 +4099,34 @@ Fill in your GPG password when asked, to sign your new key.</source>
|
|||||||
<translation></translation>
|
<translation></translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
|
<context>
|
||||||
|
<name>GroupDefs</name>
|
||||||
|
<message>
|
||||||
|
<location filename="../gui/common/GroupDefs.cpp" line="+38"/>
|
||||||
|
<source>Friends</source>
|
||||||
|
<translation>Freunde</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location line="+3"/>
|
||||||
|
<source>Family</source>
|
||||||
|
<translation>Familie</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location line="+3"/>
|
||||||
|
<source>Co-Workers</source>
|
||||||
|
<translation>Mitarbeiter</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location line="+3"/>
|
||||||
|
<source>Other Contacts</source>
|
||||||
|
<translation>Andere Kontakte</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location line="+3"/>
|
||||||
|
<source>Favorites</source>
|
||||||
|
<translation>Favoriten</translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>HelpBrowser</name>
|
<name>HelpBrowser</name>
|
||||||
<message>
|
<message>
|
||||||
@ -4781,16 +4810,17 @@ p, li { white-space: pre-wrap; }
|
|||||||
<translation>Kanäle</translation>
|
<translation>Kanäle</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
|
<location line="+4"/>
|
||||||
<source>Blogs</source>
|
<source>Blogs</source>
|
||||||
<translation type="obsolete">Blogs</translation>
|
<translation type="unfinished">Blogs</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+540"/>
|
<location line="+539"/>
|
||||||
<source>Internal Error</source>
|
<source>Internal Error</source>
|
||||||
<translation>Interener Fehler</translation>
|
<translation>Interener Fehler</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../gui/MainWindow.ui" line="+83"/>
|
<location filename="../gui/MainWindow.ui" line="+82"/>
|
||||||
<location filename="../gui/MainWindow.cpp" line="-43"/>
|
<location filename="../gui/MainWindow.cpp" line="-43"/>
|
||||||
<source>Options</source>
|
<source>Options</source>
|
||||||
<translation>Optionen</translation>
|
<translation>Optionen</translation>
|
||||||
@ -4815,12 +4845,12 @@ p, li { white-space: pre-wrap; }
|
|||||||
<translation></translation>
|
<translation></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../gui/MainWindow.ui" line="-69"/>
|
<location filename="../gui/MainWindow.ui" line="-68"/>
|
||||||
<source>MainWindow</source>
|
<source>MainWindow</source>
|
||||||
<translation>Hauptfenster</translation>
|
<translation>Hauptfenster</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+48"/>
|
<location line="+47"/>
|
||||||
<source>Add Friend</source>
|
<source>Add Friend</source>
|
||||||
<translation>Freund hinzufügen</translation>
|
<translation>Freund hinzufügen</translation>
|
||||||
</message>
|
</message>
|
||||||
@ -4841,12 +4871,7 @@ p, li { white-space: pre-wrap; }
|
|||||||
<translation>Schnellstart Assistent</translation>
|
<translation>Schnellstart Assistent</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+9"/>
|
<location filename="../gui/MainWindow.cpp" line="-264"/>
|
||||||
<source>Add Group</source>
|
|
||||||
<translation type="unfinished"></translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<location filename="../gui/MainWindow.cpp" line="-261"/>
|
|
||||||
<source>Search</source>
|
<source>Search</source>
|
||||||
<translation>Suchen</translation>
|
<translation>Suchen</translation>
|
||||||
</message>
|
</message>
|
||||||
@ -4856,12 +4881,12 @@ p, li { white-space: pre-wrap; }
|
|||||||
<translation>Dateien</translation>
|
<translation>Dateien</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../gui/MainWindow.ui" line="-47"/>
|
<location filename="../gui/MainWindow.ui" line="-38"/>
|
||||||
<source>Messenger</source>
|
<source>Messenger</source>
|
||||||
<translation>Messenger</translation>
|
<translation>Messenger</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../gui/MainWindow.cpp" line="+148"/>
|
<location filename="../gui/MainWindow.cpp" line="+151"/>
|
||||||
<source>Show/Hide</source>
|
<source>Show/Hide</source>
|
||||||
<translation>Anzeigen/Verbergen</translation>
|
<translation>Anzeigen/Verbergen</translation>
|
||||||
</message>
|
</message>
|
||||||
@ -4938,12 +4963,12 @@ p, li { white-space: pre-wrap; }
|
|||||||
<translation>Foren</translation>
|
<translation>Foren</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="-66"/>
|
<location line="-69"/>
|
||||||
<source>RetroShare %1 a secure decentralised communication platform</source>
|
<source>RetroShare %1 a secure decentralised communication platform</source>
|
||||||
<translation>RetroShare %1 eine sichere und dezentralisierte Kommunikationsplattform</translation>
|
<translation>RetroShare %1 eine sichere und dezentralisierte Kommunikationsplattform</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+567"/>
|
<location line="+570"/>
|
||||||
<source>Open Messages</source>
|
<source>Open Messages</source>
|
||||||
<translation>Öffne Nachrichten</translation>
|
<translation>Öffne Nachrichten</translation>
|
||||||
</message>
|
</message>
|
||||||
@ -6852,17 +6877,12 @@ p, li { white-space: pre-wrap; }
|
|||||||
<context>
|
<context>
|
||||||
<name>PeersDialog</name>
|
<name>PeersDialog</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../gui/PeersDialog.cpp" line="+329"/>
|
<location filename="../gui/PeersDialog.cpp" line="+360"/>
|
||||||
<source>Chat</source>
|
<source>Chat</source>
|
||||||
<translation>Chat</translation>
|
<translation>Chat</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+49"/>
|
<location line="+737"/>
|
||||||
<source>Export Friend</source>
|
|
||||||
<translation>Zertifikat des Freundes exportieren</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<location line="+439"/>
|
|
||||||
<source>Save Certificate</source>
|
<source>Save Certificate</source>
|
||||||
<translation>Zertifikat speichern</translation>
|
<translation>Zertifikat speichern</translation>
|
||||||
</message>
|
</message>
|
||||||
@ -6877,12 +6897,12 @@ p, li { white-space: pre-wrap; }
|
|||||||
<translation>Status</translation>
|
<translation>Status</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../gui/PeersDialog.cpp" line="-475"/>
|
<location filename="../gui/PeersDialog.cpp" line="-736"/>
|
||||||
<source>Connect To Friend</source>
|
<source>Connect To Friend</source>
|
||||||
<translation>Verbinde zum Freund</translation>
|
<translation>Verbinde zum Freund</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="-217"/>
|
<location line="-227"/>
|
||||||
<source>Profile</source>
|
<source>Profile</source>
|
||||||
<translation>Profil</translation>
|
<translation>Profil</translation>
|
||||||
</message>
|
</message>
|
||||||
@ -6902,7 +6922,7 @@ p, li { white-space: pre-wrap; }
|
|||||||
<translation>ich</translation>
|
<translation>ich</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+93"/>
|
<location line="+115"/>
|
||||||
<source>Expand all</source>
|
<source>Expand all</source>
|
||||||
<translation>Alle erweitern</translation>
|
<translation>Alle erweitern</translation>
|
||||||
</message>
|
</message>
|
||||||
@ -6912,27 +6932,57 @@ p, li { white-space: pre-wrap; }
|
|||||||
<translation>Alle reduzieren</translation>
|
<translation>Alle reduzieren</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+10"/>
|
<location line="+4"/>
|
||||||
<source>Message Friend</source>
|
<source>Message Friend</source>
|
||||||
<translation>Freund anschreiben</translation>
|
<translation>Freund anschreiben</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+14"/>
|
<location line="+2"/>
|
||||||
<source>Peer Details</source>
|
<source>Peer Details</source>
|
||||||
<translation>Peer-Details</translation>
|
<translation>Peer-Details</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+35"/>
|
<location line="+2"/>
|
||||||
<source>Deny Friend</source>
|
<source>Deny Friend</source>
|
||||||
<translation>Blockiere Freund</translation>
|
<translation>Blockiere Freund</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+4"/>
|
<location line="+11"/>
|
||||||
<source>Remove Friend Location</source>
|
<source>Remove Friend Location</source>
|
||||||
<translation>Freund entfernen</translation>
|
<translation>Freund entfernen</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+22"/>
|
<location line="+53"/>
|
||||||
|
<source>Add to group</source>
|
||||||
|
<translation>Hinzufügen zur Gruppe</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location line="+8"/>
|
||||||
|
<source>Move to group</source>
|
||||||
|
<translation>Verschiebe in Gruppe</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location line="+12"/>
|
||||||
|
<source>Groups</source>
|
||||||
|
<translation>Gruppen</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location line="+14"/>
|
||||||
|
<source>Remove from group</source>
|
||||||
|
<translation>Aus Gruppe entfernen</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location line="+5"/>
|
||||||
|
<source>Remove from all groups</source>
|
||||||
|
<translation>Aus allen Gruppen entfernen</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location line="+7"/>
|
||||||
|
<source>Remove group</source>
|
||||||
|
<translation>Gruppe entfernen</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location line="+24"/>
|
||||||
<source><strong>GPG Key</strong></source>
|
<source><strong>GPG Key</strong></source>
|
||||||
<translation></translation>
|
<translation></translation>
|
||||||
</message>
|
</message>
|
||||||
@ -6942,12 +6992,12 @@ p, li { white-space: pre-wrap; }
|
|||||||
<translation></translation>
|
<translation></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+349"/>
|
<location line="+519"/>
|
||||||
<source>Available</source>
|
<source>Available</source>
|
||||||
<translation>Verfügbar</translation>
|
<translation>Verfügbar</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+736"/>
|
<location line="+758"/>
|
||||||
<source>Add Extra File</source>
|
<source>Add Extra File</source>
|
||||||
<translation>Zusätzliche Datei hinzufügen</translation>
|
<translation>Zusätzliche Datei hinzufügen</translation>
|
||||||
</message>
|
</message>
|
||||||
@ -7061,7 +7111,7 @@ p, li { white-space: pre-wrap; }
|
|||||||
<location line="+41"/>
|
<location line="+41"/>
|
||||||
<location line="+3"/>
|
<location line="+3"/>
|
||||||
<source>Add a new Group</source>
|
<source>Add a new Group</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation>Neue Gruppe hinzufügen</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="-107"/>
|
<location line="-107"/>
|
||||||
@ -7107,18 +7157,13 @@ p, li { white-space: pre-wrap; }
|
|||||||
<translation>Verlauf löschen</translation>
|
<translation>Verlauf löschen</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../gui/PeersDialog.cpp" line="-1225"/>
|
<location line="+85"/>
|
||||||
<source>Profile View</source>
|
|
||||||
<translation type="unfinished"></translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<location filename="../gui/PeersDialog.ui" line="+85"/>
|
|
||||||
<location line="+3"/>
|
<location line="+3"/>
|
||||||
<source>Save Chat History</source>
|
<source>Save Chat History</source>
|
||||||
<translation>Chat Verlauf speichern</translation>
|
<translation>Chat Verlauf speichern</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../gui/PeersDialog.cpp" line="+564"/>
|
<location filename="../gui/PeersDialog.cpp" line="-661"/>
|
||||||
<source>RetroShare</source>
|
<source>RetroShare</source>
|
||||||
<translation></translation>
|
<translation></translation>
|
||||||
</message>
|
</message>
|
||||||
@ -7161,17 +7206,17 @@ p, li { white-space: pre-wrap; }
|
|||||||
<translation>Status Spalte ausblenden</translation>
|
<translation>Status Spalte ausblenden</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../gui/PeersDialog.cpp" line="-1528"/>
|
<location filename="../gui/PeersDialog.cpp" line="-1799"/>
|
||||||
<source>Friends Storm</source>
|
<source>Friends Storm</source>
|
||||||
<translation>Aktivitäten</translation>
|
<translation>Aktivitäten</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+230"/>
|
<location line="+252"/>
|
||||||
<source>Recomend this Friend to...</source>
|
<source>Recomend this Friend to...</source>
|
||||||
<translation>Freund weiterempfehlen...</translation>
|
<translation>Freund weiterempfehlen...</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+645"/>
|
<location line="+894"/>
|
||||||
<source>is typing...</source>
|
<source>is typing...</source>
|
||||||
<translation>tippt...</translation>
|
<translation>tippt...</translation>
|
||||||
</message>
|
</message>
|
||||||
@ -7191,12 +7236,12 @@ p, li { white-space: pre-wrap; }
|
|||||||
<translation>Freunde</translation>
|
<translation>Freunde</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../gui/PeersDialog.cpp" line="-638"/>
|
<location filename="../gui/PeersDialog.cpp" line="-887"/>
|
||||||
<source>Paste Friend Link</source>
|
<source>Paste Friend Link</source>
|
||||||
<translation>RetroShare Link einfügen</translation>
|
<translation>RetroShare Link einfügen</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+258"/>
|
<location line="+482"/>
|
||||||
<source>location</source>
|
<source>location</source>
|
||||||
<translation>Standort</translation>
|
<translation>Standort</translation>
|
||||||
</message>
|
</message>
|
||||||
@ -7654,11 +7699,6 @@ Do you want to send them a Message instead</source>
|
|||||||
<source>apears to be Offline.</source>
|
<source>apears to be Offline.</source>
|
||||||
<translation>ist Offline.</translation>
|
<translation>ist Offline.</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
|
||||||
<source>Messages you send will be lost and not delivered, rs-Mail this contact instead.</source>
|
|
||||||
<translation type="obsolete">Nachrichten, die Du versendest gehen bei diesem Kontakt nicht ein.
|
|
||||||
Diesem Kontakt stattdessen eine RS-Mail senden.</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
<message>
|
||||||
<location line="-693"/>
|
<location line="-693"/>
|
||||||
<source>is typing...</source>
|
<source>is typing...</source>
|
||||||
@ -7820,7 +7860,7 @@ Diesem Kontakt stattdessen eine RS-Mail senden.</translation>
|
|||||||
<context>
|
<context>
|
||||||
<name>ProfileView</name>
|
<name>ProfileView</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../gui/profile/ProfileView.cpp" line="+77"/>
|
<location filename="../gui/profile/ProfileView.cpp" line="+76"/>
|
||||||
<source>Clear Photo</source>
|
<source>Clear Photo</source>
|
||||||
<translation>Photo entfernen</translation>
|
<translation>Photo entfernen</translation>
|
||||||
</message>
|
</message>
|
||||||
|
@ -189,6 +189,7 @@ int main(int argc, char *argv[])
|
|||||||
QObject::connect(notify,SIGNAL(transfersChanged()) ,w->transfersDialog ,SLOT(insertTransfers() )) ;
|
QObject::connect(notify,SIGNAL(transfersChanged()) ,w->transfersDialog ,SLOT(insertTransfers() )) ;
|
||||||
QObject::connect(notify,SIGNAL(friendsChanged()) ,w->peersDialog ,SLOT(insertPeers() )) ;
|
QObject::connect(notify,SIGNAL(friendsChanged()) ,w->peersDialog ,SLOT(insertPeers() )) ;
|
||||||
QObject::connect(notify,SIGNAL(publicChatChanged(int)) ,w->peersDialog ,SLOT(publicChatChanged(int) ));
|
QObject::connect(notify,SIGNAL(publicChatChanged(int)) ,w->peersDialog ,SLOT(publicChatChanged(int) ));
|
||||||
|
QObject::connect(notify,SIGNAL(groupsChanged(int)) ,w->peersDialog ,SLOT(groupsChanged(int) ));
|
||||||
QObject::connect(notify,SIGNAL(privateChatChanged(int, int)) ,w ,SLOT(privateChatChanged(int, int) ));
|
QObject::connect(notify,SIGNAL(privateChatChanged(int, int)) ,w ,SLOT(privateChatChanged(int, int) ));
|
||||||
QObject::connect(notify,SIGNAL(neighborsChanged()) ,w->networkDialog ,SLOT(insertConnect() )) ;
|
QObject::connect(notify,SIGNAL(neighborsChanged()) ,w->networkDialog ,SLOT(insertConnect() )) ;
|
||||||
QObject::connect(notify,SIGNAL(messagesChanged()) ,w->messagesDialog ,SLOT(insertMessages() )) ;
|
QObject::connect(notify,SIGNAL(messagesChanged()) ,w->messagesDialog ,SLOT(insertMessages() )) ;
|
||||||
|
Loading…
Reference in New Issue
Block a user