Merge pull request #23 from RetroShare/master

update to master
This commit is contained in:
defnax 2019-10-14 14:20:09 +02:00 committed by GitHub
commit 759b62bfc9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 168 additions and 72 deletions

View File

@ -341,7 +341,7 @@ bool p3ChatService::sendChat(ChatId destination, std::string msg)
message.incoming = false; message.incoming = false;
message.online = true; message.online = true;
if(!isOnline(vpid)) if(!isOnline(vpid) && !destination.isDistantChatId())
{ {
message.online = false; message.online = false;
RsServer::notify()->notifyChatMessage(message); RsServer::notify()->notifyChatMessage(message);
@ -352,11 +352,15 @@ bool p3ChatService::sendChat(ChatId destination, std::string msg)
RsGxsTransId tId = RSRandom::random_u64(); RsGxsTransId tId = RSRandom::random_u64();
#ifdef SUSPENDED_CODE
// this part of the code was formerly used to send the traffic over GxsTransport. The problem is that
// gxstunnel takes care of reaching the peer already, so GxsTransport would only be needed when the
// current peer is offline. So we need to fin a way to quickly push the items to friends when quitting RS.
if(destination.isDistantChatId()) if(destination.isDistantChatId())
{ {
RS_STACK_MUTEX(mDGMutex); RS_STACK_MUTEX(mDGMutex);
DIDEMap::const_iterator it = DIDEMap::const_iterator it = mDistantGxsMap.find(destination.toDistantChatId());
mDistantGxsMap.find(destination.toDistantChatId());
if(it != mDistantGxsMap.end()) if(it != mDistantGxsMap.end())
{ {
const DistantEndpoints& de(it->second); const DistantEndpoints& de(it->second);
@ -371,6 +375,7 @@ bool p3ChatService::sendChat(ChatId destination, std::string msg)
<< "chat id in mDistantGxsMap this is unxpected!" << "chat id in mDistantGxsMap this is unxpected!"
<< std::endl; << std::endl;
} }
#endif
// peer is offline, add to outgoing list // peer is offline, add to outgoing list
{ {
@ -412,10 +417,10 @@ bool p3ChatService::sendChat(ChatId destination, std::string msg)
RsServer::notify()->notifyChatMessage(message); RsServer::notify()->notifyChatMessage(message);
// cyril: history is temporarily diabled for distant chat, since we need to store the full tunnel ID, but then // cyril: history is temporarily disabled for distant chat, since we need to store the full tunnel ID, but then
// at loading time, the ID is not known so that chat window shows 00000000 as a peer. // at loading time, the ID is not known so that chat window shows 00000000 as a peer.
if(!message.chat_id.isDistantChatId()) //if(!message.chat_id.isDistantChatId())
mHistoryMgr->addMessage(message); mHistoryMgr->addMessage(message);
checkSizeAndSendMessage(ci); checkSizeAndSendMessage(ci);
@ -871,10 +876,6 @@ bool p3ChatService::handleRecvChatMsgItem(RsChatMsgItem *& ci)
cm.online = true; cm.online = true;
RsServer::notify()->notifyChatMessage(cm); RsServer::notify()->notifyChatMessage(cm);
// cyril: history is temporarily diabled for distant chat, since we need to store the full tunnel ID, but then
// at loading time, the ID is not known so that chat window shows 00000000 as a peer.
if(!cm.chat_id.isDistantChatId())
mHistoryMgr->addMessage(cm); mHistoryMgr->addMessage(cm);
return true ; return true ;

View File

@ -113,6 +113,8 @@ int p3GxsTunnelService::tick()
flush() ; flush() ;
rstime::rs_usleep(1000*500);
return 0 ; return 0 ;
} }
@ -1294,8 +1296,7 @@ bool p3GxsTunnelService::locked_sendEncryptedTunnelData(RsGxsTunnelItem *item)
} }
if(it->second.status != RS_GXS_TUNNEL_STATUS_CAN_TALK) if(it->second.status != RS_GXS_TUNNEL_STATUS_CAN_TALK)
{ {
std::cerr << "(EE) Cannot talk to tunnel id " << tunnel_id std::cerr << "(EE) Cannot talk to tunnel id " << tunnel_id << ". Tunnel status is: " << it->second.status << std::endl;
<< ". Tunnel status is: " << it->second.status << std::endl;
return false; return false;
} }

View File

@ -48,10 +48,13 @@ p3HistoryMgr::p3HistoryMgr()
mPublicEnable = false; mPublicEnable = false;
mPrivateEnable = true; mPrivateEnable = true;
mLobbyEnable = true; mLobbyEnable = true;
mDistantEnable = true;
mPublicSaveCount = 0; mPublicSaveCount = 0;
mLobbySaveCount = 0; mLobbySaveCount = 0;
mPrivateSaveCount = 0; mPrivateSaveCount = 0;
mDistantSaveCount = 0;
mLastCleanTime = 0 ; mLastCleanTime = 0 ;
mMaxStorageDurationSeconds = 10*86400 ; // store for 10 days at most. mMaxStorageDurationSeconds = 10*86400 ; // store for 10 days at most.
@ -99,11 +102,25 @@ void p3HistoryMgr::addMessage(const ChatMessage& cm)
enabled = true; enabled = true;
} }
if(cm.chat_id.isDistantChatId()) if(cm.chat_id.isDistantChatId()&& mDistantEnable == true)
{ {
DistantChatPeerInfo dcpinfo; DistantChatPeerInfo dcpinfo;
if (rsMsgs->getDistantChatStatus(cm.chat_id.toDistantChatId(), dcpinfo)) if (rsMsgs->getDistantChatStatus(cm.chat_id.toDistantChatId(), dcpinfo))
peerName = cm.chat_id.toPeerId().toStdString(); {
RsIdentityDetails det;
RsGxsId writer_id = cm.incoming?(dcpinfo.to_id):(dcpinfo.own_id);
if(rsIdentity->getIdDetails(writer_id,det))
peerName = det.mNickname;
else
peerName = writer_id.toStdString();
}
else
{
RsErr() << "Cannot retrieve friend name for distant chat " << cm.chat_id.toDistantChatId() << std::endl;
peerName = "";
}
enabled = true; enabled = true;
} }
@ -259,6 +276,10 @@ bool p3HistoryMgr::saveList(bool& cleanup, std::list<RsItem*>& saveData)
kv.value = mLobbyEnable ? "TRUE" : "FALSE"; kv.value = mLobbyEnable ? "TRUE" : "FALSE";
vitem->tlvkvs.pairs.push_back(kv); vitem->tlvkvs.pairs.push_back(kv);
kv.key = "DISTANT_ENABLE";
kv.value = mDistantEnable ? "TRUE" : "FALSE";
vitem->tlvkvs.pairs.push_back(kv);
kv.key = "MAX_STORAGE_TIME"; kv.key = "MAX_STORAGE_TIME";
rs_sprintf(kv.value,"%d",mMaxStorageDurationSeconds) ; rs_sprintf(kv.value,"%d",mMaxStorageDurationSeconds) ;
vitem->tlvkvs.pairs.push_back(kv); vitem->tlvkvs.pairs.push_back(kv);
@ -275,6 +296,10 @@ bool p3HistoryMgr::saveList(bool& cleanup, std::list<RsItem*>& saveData)
rs_sprintf(kv.value, "%lu", mPrivateSaveCount); rs_sprintf(kv.value, "%lu", mPrivateSaveCount);
vitem->tlvkvs.pairs.push_back(kv); vitem->tlvkvs.pairs.push_back(kv);
kv.key = "DISTANT_SAVECOUNT";
rs_sprintf(kv.value, "%lu", mDistantSaveCount);
vitem->tlvkvs.pairs.push_back(kv);
saveData.push_back(vitem); saveData.push_back(vitem);
saveCleanupList.push_back(vitem); saveCleanupList.push_back(vitem);
@ -344,6 +369,11 @@ bool p3HistoryMgr::loadList(std::list<RsItem*>& load)
continue; continue;
} }
if (kit->key == "DISTANT_ENABLE") {
mDistantEnable = (kit->value == "TRUE") ? true : false;
continue;
}
if (kit->key == "MAX_STORAGE_TIME") { if (kit->key == "MAX_STORAGE_TIME") {
uint32_t val ; uint32_t val ;
if (sscanf(kit->value.c_str(), "%u", &val) == 1) if (sscanf(kit->value.c_str(), "%u", &val) == 1)
@ -367,6 +397,10 @@ bool p3HistoryMgr::loadList(std::list<RsItem*>& load)
mLobbySaveCount = atoi(kit->value.c_str()); mLobbySaveCount = atoi(kit->value.c_str());
continue; continue;
} }
if (kit->key == "DISTANT_SAVECOUNT") {
mDistantSaveCount = atoi(kit->value.c_str());
continue;
}
} }
delete (*it); delete (*it);
@ -444,7 +478,7 @@ bool p3HistoryMgr::getMessages(const ChatId &chatId, std::list<HistoryMsg> &msgs
if (chatId.isLobbyId() && mLobbyEnable == true) { if (chatId.isLobbyId() && mLobbyEnable == true) {
enabled = true; enabled = true;
} }
if (chatId.isDistantChatId() && mPrivateEnable == true) { if (chatId.isDistantChatId() && mDistantEnable == true) {
enabled = true; enabled = true;
} }
@ -586,6 +620,7 @@ bool p3HistoryMgr::getEnable(uint32_t chat_type)
case RS_HISTORY_TYPE_PUBLIC : return mPublicEnable ; case RS_HISTORY_TYPE_PUBLIC : return mPublicEnable ;
case RS_HISTORY_TYPE_LOBBY : return mLobbyEnable ; case RS_HISTORY_TYPE_LOBBY : return mLobbyEnable ;
case RS_HISTORY_TYPE_PRIVATE: return mPrivateEnable ; case RS_HISTORY_TYPE_PRIVATE: return mPrivateEnable ;
case RS_HISTORY_TYPE_DISTANT: return mDistantEnable ;
default: default:
std::cerr << "Unexpected value " << chat_type<< " in p3HistoryMgr::getEnable(): this is a bug." << std::endl; std::cerr << "Unexpected value " << chat_type<< " in p3HistoryMgr::getEnable(): this is a bug." << std::endl;
return 0 ; return 0 ;
@ -623,6 +658,9 @@ void p3HistoryMgr::setEnable(uint32_t chat_type, bool enable)
case RS_HISTORY_TYPE_PRIVATE: oldValue = mPrivateEnable ; case RS_HISTORY_TYPE_PRIVATE: oldValue = mPrivateEnable ;
mPrivateEnable = enable ; mPrivateEnable = enable ;
break ; break ;
case RS_HISTORY_TYPE_DISTANT: oldValue = mDistantEnable ;
mDistantEnable = enable ;
break ;
default: default:
return; return;
} }

View File

@ -82,10 +82,12 @@ private:
bool mPublicEnable; bool mPublicEnable;
bool mLobbyEnable; bool mLobbyEnable;
bool mPrivateEnable; bool mPrivateEnable;
bool mDistantEnable;
uint32_t mPublicSaveCount; uint32_t mPublicSaveCount;
uint32_t mLobbySaveCount; uint32_t mLobbySaveCount;
uint32_t mPrivateSaveCount; uint32_t mPrivateSaveCount;
uint32_t mDistantSaveCount;
uint32_t mMaxStorageDurationSeconds ; uint32_t mMaxStorageDurationSeconds ;
rstime_t mLastCleanTime ; rstime_t mLastCleanTime ;

View File

@ -39,6 +39,7 @@ extern RsHistory *rsHistory;
static const uint32_t RS_HISTORY_TYPE_PUBLIC = 0 ; static const uint32_t RS_HISTORY_TYPE_PUBLIC = 0 ;
static const uint32_t RS_HISTORY_TYPE_PRIVATE = 1 ; static const uint32_t RS_HISTORY_TYPE_PRIVATE = 1 ;
static const uint32_t RS_HISTORY_TYPE_LOBBY = 2 ; static const uint32_t RS_HISTORY_TYPE_LOBBY = 2 ;
static const uint32_t RS_HISTORY_TYPE_DISTANT = 3 ;
class HistoryMsg class HistoryMsg
{ {

View File

@ -363,8 +363,8 @@ void ChatWidget::init(const ChatId &chat_id, const QString &title)
QString customStateString = QString::fromUtf8(rsMsgs->getCustomStateString(chatId.toPeerId()).c_str()); QString customStateString = QString::fromUtf8(rsMsgs->getCustomStateString(chatId.toPeerId()).c_str());
updatePeersCustomStateString(QString::fromStdString(chatId.toPeerId().toStdString()), customStateString); updatePeersCustomStateString(QString::fromStdString(chatId.toPeerId().toStdString()), customStateString);
} else if (chatType() == CHATTYPE_DISTANT){ } else if (chatType() == CHATTYPE_DISTANT){
hist_chat_type = RS_HISTORY_TYPE_PRIVATE ; hist_chat_type = RS_HISTORY_TYPE_DISTANT ;
messageCount = Settings->getPrivateChatHistoryCount(); messageCount = Settings->getDistantChatHistoryCount();
} else if(chatId.isBroadcast()){ } else if(chatId.isBroadcast()){
hist_chat_type = RS_HISTORY_TYPE_PUBLIC; hist_chat_type = RS_HISTORY_TYPE_PUBLIC;
messageCount = Settings->getPublicChatHistoryCount(); messageCount = Settings->getPublicChatHistoryCount();
@ -435,8 +435,8 @@ ChatWidget::ChatType ChatWidget::chatType()
void ChatWidget::blockSending(QString msg) void ChatWidget::blockSending(QString msg)
{ {
#ifndef RS_ASYNC_CHAT #ifndef RS_ASYNC_CHAT
sendingBlocked = true; // sendingBlocked = true;
ui->sendButton->setEnabled(false); // ui->sendButton->setEnabled(false);
#endif #endif
ui->sendButton->setToolTip(msg); ui->sendButton->setToolTip(msg);
} }

View File

@ -166,14 +166,18 @@ void ChatPage::updateHistoryParams()
Settings->setPublicChatHistoryCount(ui.publicChatLoadCount->value()); Settings->setPublicChatHistoryCount(ui.publicChatLoadCount->value());
Settings->setPrivateChatHistoryCount(ui.privateChatLoadCount->value()); Settings->setPrivateChatHistoryCount(ui.privateChatLoadCount->value());
Settings->setLobbyChatHistoryCount(ui.lobbyChatLoadCount->value()); Settings->setLobbyChatHistoryCount(ui.lobbyChatLoadCount->value());
Settings->setDistantChatHistoryCount(ui.distantChatLoadCount->value());
rsHistory->setEnable(RS_HISTORY_TYPE_PUBLIC , ui.publicChatEnable->isChecked()); rsHistory->setEnable(RS_HISTORY_TYPE_PUBLIC , ui.publicChatEnable->isChecked());
rsHistory->setEnable(RS_HISTORY_TYPE_PRIVATE, ui.privateChatEnable->isChecked()); rsHistory->setEnable(RS_HISTORY_TYPE_PRIVATE, ui.privateChatEnable->isChecked());
rsHistory->setEnable(RS_HISTORY_TYPE_LOBBY , ui.lobbyChatEnable->isChecked()); rsHistory->setEnable(RS_HISTORY_TYPE_LOBBY , ui.lobbyChatEnable->isChecked());
rsHistory->setEnable(RS_HISTORY_TYPE_DISTANT, ui.distantChatEnable->isChecked());
rsHistory->setSaveCount(RS_HISTORY_TYPE_PUBLIC , ui.publicChatSaveCount->value()); rsHistory->setSaveCount(RS_HISTORY_TYPE_PUBLIC , ui.publicChatSaveCount->value());
rsHistory->setSaveCount(RS_HISTORY_TYPE_PRIVATE, ui.privateChatSaveCount->value()); rsHistory->setSaveCount(RS_HISTORY_TYPE_PRIVATE, ui.privateChatSaveCount->value());
rsHistory->setSaveCount(RS_HISTORY_TYPE_LOBBY , ui.lobbyChatSaveCount->value()); rsHistory->setSaveCount(RS_HISTORY_TYPE_LOBBY , ui.lobbyChatSaveCount->value());
rsHistory->setSaveCount(RS_HISTORY_TYPE_DISTANT, ui.distantChatSaveCount->value());
} }
void ChatPage::updatePublicStyle() void ChatPage::updatePublicStyle()
@ -247,13 +251,19 @@ ChatPage::ChatPage(QWidget * parent, Qt::WindowFlags flags)
connect(ui.publicChatLoadCount, SIGNAL(valueChanged(int)), this, SLOT(updateHistoryParams())); connect(ui.publicChatLoadCount, SIGNAL(valueChanged(int)), this, SLOT(updateHistoryParams()));
connect(ui.privateChatLoadCount, SIGNAL(valueChanged(int)), this, SLOT(updateHistoryParams())); connect(ui.privateChatLoadCount, SIGNAL(valueChanged(int)), this, SLOT(updateHistoryParams()));
connect(ui.distantChatLoadCount, SIGNAL(valueChanged(int)), this, SLOT(updateHistoryParams()));
connect(ui.lobbyChatLoadCount, SIGNAL(valueChanged(int)), this, SLOT(updateHistoryParams())); connect(ui.lobbyChatLoadCount, SIGNAL(valueChanged(int)), this, SLOT(updateHistoryParams()));
connect(ui.publicChatEnable, SIGNAL(toggled(bool)), this, SLOT(updateHistoryParams())); connect(ui.publicChatEnable, SIGNAL(toggled(bool)), this, SLOT(updateHistoryParams()));
connect(ui.privateChatEnable, SIGNAL(toggled(bool)), this, SLOT(updateHistoryParams())); connect(ui.privateChatEnable, SIGNAL(toggled(bool)), this, SLOT(updateHistoryParams()));
connect(ui.distantChatEnable, SIGNAL(toggled(bool)), this, SLOT(updateHistoryParams()));
connect(ui.lobbyChatEnable, SIGNAL(toggled(bool)), this, SLOT(updateHistoryParams())); connect(ui.lobbyChatEnable, SIGNAL(toggled(bool)), this, SLOT(updateHistoryParams()));
connect(ui.publicChatSaveCount, SIGNAL(valueChanged(int)), this, SLOT(updateHistoryParams())); connect(ui.publicChatSaveCount, SIGNAL(valueChanged(int)), this, SLOT(updateHistoryParams()));
connect(ui.privateChatSaveCount, SIGNAL(valueChanged(int)), this, SLOT(updateHistoryParams())); connect(ui.privateChatSaveCount, SIGNAL(valueChanged(int)), this, SLOT(updateHistoryParams()));
connect(ui.lobbyChatSaveCount, SIGNAL(valueChanged(int)), this, SLOT(updateHistoryParams())); connect(ui.lobbyChatSaveCount, SIGNAL(valueChanged(int)), this, SLOT(updateHistoryParams()));
connect(ui.distantChatSaveCount, SIGNAL(valueChanged(int)), this, SLOT(updateHistoryParams()));
connect(ui.publicStyle, SIGNAL(currentIndexChanged(int)), this, SLOT(updatePublicStyle())) ; connect(ui.publicStyle, SIGNAL(currentIndexChanged(int)), this, SLOT(updatePublicStyle())) ;
connect(ui.publicComboBoxVariant, SIGNAL(currentIndexChanged(int)), this, SLOT(updatePublicStyle())) ; connect(ui.publicComboBoxVariant, SIGNAL(currentIndexChanged(int)), this, SLOT(updatePublicStyle())) ;
@ -349,14 +359,18 @@ ChatPage::load()
whileBlocking(ui.publicChatLoadCount)->setValue(Settings->getPublicChatHistoryCount()); whileBlocking(ui.publicChatLoadCount)->setValue(Settings->getPublicChatHistoryCount());
whileBlocking(ui.privateChatLoadCount)->setValue(Settings->getPrivateChatHistoryCount()); whileBlocking(ui.privateChatLoadCount)->setValue(Settings->getPrivateChatHistoryCount());
whileBlocking(ui.lobbyChatLoadCount)->setValue(Settings->getLobbyChatHistoryCount()); whileBlocking(ui.lobbyChatLoadCount)->setValue(Settings->getLobbyChatHistoryCount());
whileBlocking(ui.distantChatLoadCount)->setValue(Settings->getDistantChatHistoryCount());
whileBlocking(ui.publicChatEnable)->setChecked(rsHistory->getEnable(RS_HISTORY_TYPE_PUBLIC)); whileBlocking(ui.publicChatEnable)->setChecked(rsHistory->getEnable(RS_HISTORY_TYPE_PUBLIC));
whileBlocking(ui.privateChatEnable)->setChecked(rsHistory->getEnable(RS_HISTORY_TYPE_PRIVATE)); whileBlocking(ui.privateChatEnable)->setChecked(rsHistory->getEnable(RS_HISTORY_TYPE_PRIVATE));
whileBlocking(ui.lobbyChatEnable)->setChecked(rsHistory->getEnable(RS_HISTORY_TYPE_LOBBY)); whileBlocking(ui.lobbyChatEnable)->setChecked(rsHistory->getEnable(RS_HISTORY_TYPE_LOBBY));
whileBlocking(ui.distantChatEnable)->setChecked(rsHistory->getEnable(RS_HISTORY_TYPE_DISTANT));
whileBlocking(ui.publicChatSaveCount)->setValue(rsHistory->getSaveCount(RS_HISTORY_TYPE_PUBLIC)); whileBlocking(ui.publicChatSaveCount)->setValue(rsHistory->getSaveCount(RS_HISTORY_TYPE_PUBLIC));
whileBlocking(ui.privateChatSaveCount)->setValue(rsHistory->getSaveCount(RS_HISTORY_TYPE_PRIVATE)); whileBlocking(ui.privateChatSaveCount)->setValue(rsHistory->getSaveCount(RS_HISTORY_TYPE_PRIVATE));
whileBlocking(ui.lobbyChatSaveCount)->setValue(rsHistory->getSaveCount(RS_HISTORY_TYPE_LOBBY)); whileBlocking(ui.lobbyChatSaveCount)->setValue(rsHistory->getSaveCount(RS_HISTORY_TYPE_LOBBY));
whileBlocking(ui.distantChatSaveCount)->setValue(rsHistory->getSaveCount(RS_HISTORY_TYPE_DISTANT));
// using fontTempChat.rawname() does not always work! // using fontTempChat.rawname() does not always work!
// see http://doc.qt.digia.com/qt-maemo/qfont.html#rawName // see http://doc.qt.digia.com/qt-maemo/qfont.html#rawName

View File

@ -6,8 +6,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>1216</width> <width>800</width>
<height>1127</height> <height>600</height>
</rect> </rect>
</property> </property>
<layout class="QGridLayout"> <layout class="QGridLayout">
@ -598,8 +598,21 @@
<layout class="QHBoxLayout" name="histSetupVLayout"> <layout class="QHBoxLayout" name="histSetupVLayout">
<item> <item>
<layout class="QGridLayout" name="histSetupGLayout"> <layout class="QGridLayout" name="histSetupGLayout">
<item row="0" column="1"> <item row="1" column="0">
<widget class="QLabel" name="publicHeaderLabel"> <widget class="QLabel" name="labelChatEnable">
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
</property>
<property name="text">
<string>Enabled:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="0" column="4">
<widget class="QLabel" name="lobbyHeaderLabel">
<property name="font"> <property name="font">
<font> <font>
<weight>75</weight> <weight>75</weight>
@ -607,7 +620,7 @@
</font> </font>
</property> </property>
<property name="text"> <property name="text">
<string>Group chat</string> <string>Chatlobbies</string>
</property> </property>
</widget> </widget>
</item> </item>
@ -624,8 +637,8 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="3"> <item row="0" column="1">
<widget class="QLabel" name="lobbyHeaderLabel"> <widget class="QLabel" name="publicHeaderLabel">
<property name="font"> <property name="font">
<font> <font>
<weight>75</weight> <weight>75</weight>
@ -633,20 +646,7 @@
</font> </font>
</property> </property>
<property name="text"> <property name="text">
<string>Chatlobbies</string> <string>Group chat</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="labelChatEnable">
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
</property>
<property name="text">
<string>Enabled:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property> </property>
</widget> </widget>
</item> </item>
@ -657,20 +657,6 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="2">
<widget class="QCheckBox" name="privateChatEnable">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="1" column="3">
<widget class="QCheckBox" name="lobbyChatEnable">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="2" column="0"> <item row="2" column="0">
<widget class="QLabel" name="labelChatSaveCount"> <widget class="QLabel" name="labelChatSaveCount">
<property name="text"> <property name="text">
@ -681,6 +667,13 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="2">
<widget class="QCheckBox" name="privateChatEnable">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="2" column="1"> <item row="2" column="1">
<widget class="QSpinBox" name="publicChatSaveCount"> <widget class="QSpinBox" name="publicChatSaveCount">
<property name="maximumSize"> <property name="maximumSize">
@ -700,27 +693,15 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="2"> <item row="1" column="4">
<widget class="QSpinBox" name="privateChatSaveCount"> <widget class="QCheckBox" name="lobbyChatEnable">
<property name="maximumSize"> <property name="text">
<size>
<width>60</width>
<height>16777215</height>
</size>
</property>
<property name="suffix">
<string/> <string/>
</property> </property>
<property name="prefix">
<string/>
</property>
<property name="maximum">
<number>1000000000</number>
</property>
</widget> </widget>
</item> </item>
<item row="2" column="3"> <item row="2" column="2">
<widget class="QSpinBox" name="lobbyChatSaveCount"> <widget class="QSpinBox" name="privateChatSaveCount">
<property name="maximumSize"> <property name="maximumSize">
<size> <size>
<width>60</width> <width>60</width>
@ -761,6 +742,25 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="4">
<widget class="QSpinBox" name="lobbyChatSaveCount">
<property name="maximumSize">
<size>
<width>60</width>
<height>16777215</height>
</size>
</property>
<property name="suffix">
<string/>
</property>
<property name="prefix">
<string/>
</property>
<property name="maximum">
<number>1000000000</number>
</property>
</widget>
</item>
<item row="3" column="2"> <item row="3" column="2">
<widget class="QSpinBox" name="privateChatLoadCount"> <widget class="QSpinBox" name="privateChatLoadCount">
<property name="maximumSize"> <property name="maximumSize">
@ -774,7 +774,7 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="3" column="3"> <item row="3" column="4">
<widget class="QSpinBox" name="lobbyChatLoadCount"> <widget class="QSpinBox" name="lobbyChatLoadCount">
<property name="maximumSize"> <property name="maximumSize">
<size> <size>
@ -787,6 +787,32 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="3">
<widget class="QLabel" name="distantchatHeaderLabel">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Distant chat</string>
</property>
</widget>
</item>
<item row="1" column="3">
<widget class="QCheckBox" name="distantChatEnable">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="2" column="3">
<widget class="QSpinBox" name="distantChatSaveCount"/>
</item>
<item row="3" column="3">
<widget class="QSpinBox" name="distantChatLoadCount"/>
</item>
</layout> </layout>
</item> </item>
<item> <item>
@ -866,7 +892,7 @@
<enum>QTabWidget::North</enum> <enum>QTabWidget::North</enum>
</property> </property>
<property name="currentIndex"> <property name="currentIndex">
<number>2</number> <number>0</number>
</property> </property>
<widget class="QWidget" name="publicTab"> <widget class="QWidget" name="publicTab">
<attribute name="title"> <attribute name="title">

View File

@ -728,6 +728,16 @@ void RshareSettings::setPrivateChatHistoryCount(int value)
setValueToGroup("Chat", "PrivateChatHistoryCount", value); setValueToGroup("Chat", "PrivateChatHistoryCount", value);
} }
int RshareSettings::getDistantChatHistoryCount()
{
return valueFromGroup("Chat", "DistantChatHistoryCount", 20).toInt();
}
void RshareSettings::setDistantChatHistoryCount(int value)
{
setValueToGroup("Chat", "DistantChatHistoryCount", value);
}
/** Returns true if RetroShare is set to run on system boot. */ /** Returns true if RetroShare is set to run on system boot. */
bool bool
RshareSettings::runRetroshareOnBoot(bool &minimized) RshareSettings::runRetroshareOnBoot(bool &minimized)

View File

@ -274,6 +274,9 @@ public:
int getLobbyChatHistoryCount(); int getLobbyChatHistoryCount();
void setLobbyChatHistoryCount(int value); void setLobbyChatHistoryCount(int value);
int getDistantChatHistoryCount();
void setDistantChatHistoryCount(int value);
//! Save placement, state and size information of a window. //! Save placement, state and size information of a window.
void saveWidgetInformation(QWidget *widget); void saveWidgetInformation(QWidget *widget);