mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
Merge remote-tracking branch 'upstream/master' into v0.6-BugFixing_4
This commit is contained in:
commit
d842c6fe52
@ -104,6 +104,7 @@ copy "%RsBuildPath%\retroshare-gui\src\%RsBuildConfig%\RetroShare*.exe" "%RsDepl
|
||||
copy "%RsBuildPath%\retroshare-nogui\src\%RsBuildConfig%\retroshare*-nogui.exe" "%RsDeployPath%" %Quite%
|
||||
copy "%RsBuildPath%\retroshare-service\src\%RsBuildConfig%\retroshare*-service.exe" "%RsDeployPath%" %Quite%
|
||||
copy "%RsBuildPath%\supportlibs\cmark\build\src\libcmark.dll" "%RsDeployPath%" %Quite%
|
||||
if exist "%RsBuildPath%\libretroshare\src\lib\retroshare.dll" copy "%RsBuildPath%\libretroshare\src\lib\retroshare.dll" "%RsDeployPath%" %Quite%
|
||||
|
||||
echo copy extensions
|
||||
for /D %%D in ("%RsBuildPath%\plugins\*") do (
|
||||
@ -212,8 +213,8 @@ endlocal
|
||||
exit /B 1
|
||||
|
||||
:copy_extension
|
||||
if exist "%~1\%RsBuildConfig%\%~n1.dll" (
|
||||
copy "%~1\%RsBuildConfig%\%~n1.dll" %2 %Quite%
|
||||
if exist "%~1\lib\%~n1.dll" (
|
||||
copy "%~1\lib\%~n1.dll" %2 %Quite%
|
||||
)
|
||||
goto :EOF
|
||||
|
||||
|
@ -1,10 +1,10 @@
|
||||
ZLIB_VERSION=1.2.3
|
||||
BZIP2_VERSION=1.0.6
|
||||
MINIUPNPC_VERSION=2.0
|
||||
OPENSSL_VERSION=1.1.1g
|
||||
OPENSSL_VERSION=1.1.1h
|
||||
SPEEX_VERSION=1.2.0
|
||||
SPEEXDSP_VERSION=1.2rc3
|
||||
OPENCV_VERSION=3.4.11
|
||||
OPENCV_VERSION=4.5.0
|
||||
LIBXML2_VERSION=2.9.7
|
||||
LIBXSLT_VERSION=1.1.32
|
||||
CURL_VERSION=7.58.0
|
||||
|
@ -27,8 +27,8 @@ if exist "%EnvMSYS2Path%\msys%MSYS2Base%\usr\bin\pacman.exe" (
|
||||
|
||||
set MSYS2Install=msys2-base-%MSYS2Architecture%-20190524.tar.xz
|
||||
set MSYS2Url=http://sourceforge.net/projects/msys2/files/Base/%MSYS2Architecture%/%MSYS2Install%/download
|
||||
set CMakeInstall=cmake-3.1.0-win32-x86.zip
|
||||
set CMakeUrl=http://www.cmake.org/files/v3.1/%CMakeInstall%
|
||||
set CMakeInstall=cmake-3.19.0-win32-x86.zip
|
||||
set CMakeUrl=https://github.com/Kitware/CMake/releases/download/v3.19.0/%CMakeInstall%
|
||||
set CMakeUnpackPath=%EnvMSYS2Path%\msys%MSYS2Base%
|
||||
|
||||
if exist "%EnvMSYS2Path%\msys%MSYS2Base%" (
|
||||
|
@ -16,9 +16,9 @@ set NSISInstallPath=%EnvToolsPath%\NSIS
|
||||
set MinGitInstall=MinGit-2.28.0-32-bit.zip
|
||||
set MinGitUrl=https://github.com/git-for-windows/git/releases/download/v2.28.0.windows.1/%MinGitInstall%
|
||||
set MinGitInstallPath=%EnvToolsPath%\MinGit
|
||||
set CMakeVersion=cmake-3.1.0-win32-x86
|
||||
set CMakeVersion=cmake-3.19.0-win32-x86
|
||||
set CMakeInstall=%CMakeVersion%.zip
|
||||
set CMakeUrl=http://www.cmake.org/files/v3.1/%CMakeInstall%
|
||||
set CMakeUrl=https://github.com/Kitware/CMake/releases/download/v3.19.0/%CMakeInstall%
|
||||
set CMakeInstallPath=%EnvToolsPath%\cmake
|
||||
set TorProjectUrl=https://www.torproject.org
|
||||
set TorDownloadIndexUrl=%TorProjectUrl%/download/tor
|
||||
|
@ -1083,6 +1083,8 @@ bool ftServer::sendTurtleItem(const RsPeerId& peerId,const RsFileHash& hash,RsTu
|
||||
if(!encryptItem(item, hash, encrypted_item))
|
||||
return false ;
|
||||
|
||||
encrypted_item->setPriorityLevel(item->priority_level());
|
||||
|
||||
delete item ;
|
||||
|
||||
mTurtleRouter->sendTurtleData(peerId,encrypted_item) ;
|
||||
|
@ -709,44 +709,46 @@ void RsGxsDataAccess::processRequests()
|
||||
|
||||
while (!mRequestQueue.empty())
|
||||
{
|
||||
// Extract the first elements from the request queue. cleanup all other elements marked at terminated.
|
||||
// Extract the first elements from the request queue. cleanup all other elements marked at terminated.
|
||||
|
||||
GxsRequest* req = nullptr;
|
||||
{
|
||||
RsStackMutex stack(mDataMutex); /******* LOCKED *******/
|
||||
rstime_t now = time(nullptr); // this is ok while in the loop below
|
||||
rstime_t now = time(nullptr); // this is ok while in the loop below
|
||||
|
||||
while(!mRequestQueue.empty() && req == nullptr)
|
||||
{
|
||||
if(now > mRequestQueue.begin()->second->reqTime + MAX_REQUEST_AGE)
|
||||
{
|
||||
while(!mRequestQueue.empty() && req == nullptr)
|
||||
{
|
||||
if(now > mRequestQueue.begin()->second->reqTime + MAX_REQUEST_AGE)
|
||||
{
|
||||
delete mRequestQueue.begin()->second;
|
||||
mRequestQueue.erase(mRequestQueue.begin());
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
switch( mRequestQueue.begin()->second->status )
|
||||
{
|
||||
case PARTIAL:
|
||||
RsErr() << "Found partial request in mRequestQueue. This is a bug." << std::endl; // fallthrough
|
||||
case COMPLETE:
|
||||
case DONE:
|
||||
case FAILED:
|
||||
case CANCELLED:
|
||||
switch( mRequestQueue.begin()->second->status )
|
||||
{
|
||||
case PARTIAL:
|
||||
RsErr() << "Found partial request in mRequestQueue. This is a bug." << std::endl; // fallthrough
|
||||
case COMPLETE:
|
||||
case DONE:
|
||||
case FAILED:
|
||||
case CANCELLED:
|
||||
#ifdef DATA_DEBUG
|
||||
RsDbg() << " request " << mRequestQueue.begin()->second->token << ": status = " << mRequestQueue.begin()->second->status << ": removing from the RequestQueue" << std::endl;
|
||||
RsDbg() << " request " << mRequestQueue.begin()->second->token << ": status = " << mRequestQueue.begin()->second->status << ": removing from the RequestQueue" << std::endl;
|
||||
#endif
|
||||
mRequestQueue.erase(mRequestQueue.begin());
|
||||
continue;
|
||||
break;
|
||||
case PENDING:
|
||||
req = mRequestQueue.begin()->second;
|
||||
req->status = PARTIAL;
|
||||
mRequestQueue.erase(mRequestQueue.begin()); // remove it right away from the waiting queue.
|
||||
break;
|
||||
}
|
||||
delete mRequestQueue.begin()->second;
|
||||
mRequestQueue.erase(mRequestQueue.begin());
|
||||
continue;
|
||||
break;
|
||||
case PENDING:
|
||||
req = mRequestQueue.begin()->second;
|
||||
req->status = PARTIAL;
|
||||
mRequestQueue.erase(mRequestQueue.begin()); // remove it right away from the waiting queue.
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
} // END OF MUTEX.
|
||||
|
||||
if (!req)
|
||||
break;
|
||||
@ -813,33 +815,33 @@ void RsGxsDataAccess::processRequests()
|
||||
else
|
||||
RsErr() << __PRETTY_FUNCTION__ << " Failed to process request, token: " << req->token << std::endl;
|
||||
|
||||
// We cannot easily remove the request here because the queue may have more elements now and mRequestQueue.begin() is not necessarily the same element.
|
||||
// but we mark it as COMPLETE/FAILED so that it will be removed in the next loop.
|
||||
// We cannot easily remove the request here because the queue may have more elements now and mRequestQueue.begin() is not necessarily the same element.
|
||||
// but we mark it as COMPLETE/FAILED so that it will be removed in the next loop.
|
||||
{
|
||||
RsStackMutex stack(mDataMutex); /******* LOCKED *******/
|
||||
|
||||
if(ok)
|
||||
{
|
||||
// When the request is complete, we move it to the complete list, so that the caller can easily retrieve the request data
|
||||
if(ok)
|
||||
{
|
||||
// When the request is complete, we move it to the complete list, so that the caller can easily retrieve the request data
|
||||
|
||||
#ifdef DATA_DEBUG
|
||||
RsDbg() << " Request completed successfully. Marking as COMPLETE." << std::endl;
|
||||
RsDbg() << " Request completed successfully. Marking as COMPLETE." << std::endl;
|
||||
#endif
|
||||
req->status = COMPLETE ;
|
||||
mCompletedRequests[req->token] = req;
|
||||
mPublicToken[req->token] = COMPLETE;
|
||||
}
|
||||
else
|
||||
{
|
||||
mCompletedRequests[req->token] = req;
|
||||
mPublicToken[req->token] = COMPLETE;
|
||||
}
|
||||
else
|
||||
{
|
||||
req->status = FAILED;
|
||||
mPublicToken[req->token] = FAILED;
|
||||
mPublicToken[req->token] = FAILED;
|
||||
#ifdef DATA_DEBUG
|
||||
RsDbg() << " Request failed. Marking as FAILED." << std::endl;
|
||||
RsDbg() << " Request failed. Marking as FAILED." << std::endl;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
} // END OF MUTEX.
|
||||
|
||||
} // END OF MUTEX.
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -308,7 +308,7 @@ static const uint32_t GROUP_STATS_UPDATE_DELAY = 240; //
|
||||
static const uint32_t GROUP_STATS_UPDATE_NB_PEERS = 2; // number of peers to which the group stats are asked
|
||||
static const uint32_t MAX_ALLOWED_GXS_MESSAGE_SIZE = 199000; // 200,000 bytes including signature and headers
|
||||
static const uint32_t MIN_DELAY_BETWEEN_GROUP_SEARCH = 40; // dont search same group more than every 40 secs.
|
||||
static const uint32_t SAFETY_DELAY_FOR_UNSUCCESSFUL_UPDATE = 1800; // avoid re-sending the same msg list to a peer who asks twice for the same update in less than this time
|
||||
static const uint32_t SAFETY_DELAY_FOR_UNSUCCESSFUL_UPDATE = 0; // avoid re-sending the same msg list to a peer who asks twice for the same update in less than this time
|
||||
|
||||
static const uint32_t RS_NXS_ITEM_ENCRYPTION_STATUS_UNKNOWN = 0x00 ;
|
||||
static const uint32_t RS_NXS_ITEM_ENCRYPTION_STATUS_NO_ERROR = 0x01 ;
|
||||
|
@ -1221,9 +1221,12 @@ bool p3GxsTunnelService::locked_sendClearTunnelData(RsGxsTunnelDHPublicKeyItem *
|
||||
std::cerr << "GxsTunnelService::sendClearTunnelData(): try sending item " << (void*)item << " to peer " << item->PeerId() << std::endl;
|
||||
#endif
|
||||
|
||||
// make a TurtleGenericData item out of it, and send it in clear.
|
||||
//
|
||||
// make a RsTurtleGenericData item out of it, and send it in clear.
|
||||
// this is compatible with nodes older than 0.6.6
|
||||
RsTurtleGenericDataItem *gitem = new RsTurtleGenericDataItem ;
|
||||
// force item priority to QOS_PRIORITY_RS_TURTLE_GENERIC_FAST_DATA to make the DH exchange faster on 0.6.6+ nodes
|
||||
// this will not affect old nodes
|
||||
gitem->setPriorityLevel(QOS_PRIORITY_RS_TURTLE_GENERIC_FAST_DATA);
|
||||
|
||||
RsGxsTunnelSerialiser ser ;
|
||||
|
||||
|
@ -797,13 +797,13 @@ public:
|
||||
* @jsonapi{development}
|
||||
* @param[in] sslId Id of the peer of which we want to generate an invite,
|
||||
* a null id (all 0) is passed, an invite for own node is returned.
|
||||
* @param[in] includeSignatures true to add key signatures to the invite
|
||||
* @param[in] includeExtraLocators false to avoid to add extra locators
|
||||
* @param[in] inviteFlags specify extra data to include in the invite
|
||||
* @return invite string
|
||||
*/
|
||||
virtual std::string GetRetroshareInvite(
|
||||
const RsPeerId& sslId = RsPeerId(),
|
||||
RetroshareInviteFlags = RetroshareInviteFlags::DNS | RetroshareInviteFlags::CURRENT_IP ) = 0;
|
||||
const RsPeerId& sslId = RsPeerId(),
|
||||
RetroshareInviteFlags inviteFlags =
|
||||
RetroshareInviteFlags::DNS | RetroshareInviteFlags::CURRENT_IP ) = 0;
|
||||
|
||||
/**
|
||||
* @brief Get RetroShare short invite of the given peer
|
||||
@ -811,19 +811,19 @@ public:
|
||||
* @param[out] invite storage for the generated invite
|
||||
* @param[in] sslId Id of the peer of which we want to generate an invite,
|
||||
* a null id (all 0) is passed, an invite for own node is returned.
|
||||
* @param[in] formatRadix true to get in base64 format false to get URL.
|
||||
* @param[in] bareBones true to get smallest invite, which miss also
|
||||
* the information necessary to attempt an outgoing connection, but still
|
||||
* enough to accept an incoming one.
|
||||
* @param[in] inviteFlags specify extra data to include in the invite and
|
||||
* format.
|
||||
* @param[in] baseUrl URL into which to sneak in the RetroShare invite
|
||||
* radix, this is primarly useful to trick other applications into making
|
||||
* the invite clickable, or to disguise the RetroShare invite into a
|
||||
* "normal" looking web link. Used only if formatRadix is false.
|
||||
* @return false if error occurred, true otherwise
|
||||
*/
|
||||
virtual bool getShortInvite(std::string& invite, const RsPeerId& sslId = RsPeerId(),
|
||||
RetroshareInviteFlags locator_flags = RetroshareInviteFlags::CURRENT_IP | RetroshareInviteFlags::DNS,
|
||||
const std::string& baseUrl = "https://retroshare.me/" ) = 0;
|
||||
virtual bool getShortInvite(
|
||||
std::string& invite, const RsPeerId& sslId = RsPeerId(),
|
||||
RetroshareInviteFlags inviteFlags =
|
||||
RetroshareInviteFlags::CURRENT_IP | RetroshareInviteFlags::DNS,
|
||||
const std::string& baseUrl = "https://retroshare.me/" ) = 0;
|
||||
|
||||
/**
|
||||
* @brief Parse the give short invite to extract contained information
|
||||
|
@ -23,7 +23,7 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
// This file centralises QoS priorities for all transfer RsItems.
|
||||
// This file centralises QoS priorities for all transfer RsItems
|
||||
//
|
||||
const uint8_t QOS_PRIORITY_UNKNOWN = 0 ;
|
||||
const uint8_t QOS_PRIORITY_DEFAULT = 3 ;
|
||||
@ -33,63 +33,66 @@ const uint8_t QOS_PRIORITY_TOP = 9 ;
|
||||
//
|
||||
const uint8_t QOS_PRIORITY_RS_TURTLE_OPEN_TUNNEL = 7 ;
|
||||
const uint8_t QOS_PRIORITY_RS_TURTLE_TUNNEL_OK = 7 ;
|
||||
const uint8_t QOS_PRIORITY_RS_TURTLE_SEARCH_REQUEST = 7 ;
|
||||
|
||||
const uint8_t QOS_PRIORITY_RS_TURTLE_FILE_REQUEST = 5 ;
|
||||
const uint8_t QOS_PRIORITY_RS_TURTLE_FILE_CRC_REQUEST = 5 ;
|
||||
const uint8_t QOS_PRIORITY_RS_TURTLE_CHUNK_CRC_REQUEST = 5 ;
|
||||
const uint8_t QOS_PRIORITY_RS_TURTLE_FILE_MAP_REQUEST = 5 ;
|
||||
const uint8_t QOS_PRIORITY_RS_TURTLE_SEARCH_REQUEST = 6 ;
|
||||
const uint8_t QOS_PRIORITY_RS_TURTLE_FILE_REQUEST = 6 ;
|
||||
const uint8_t QOS_PRIORITY_RS_TURTLE_FILE_MAP_REQUEST = 6 ;
|
||||
const uint8_t QOS_PRIORITY_RS_TURTLE_FILE_CRC_REQUEST = 6 ; // unused
|
||||
const uint8_t QOS_PRIORITY_RS_TURTLE_CHUNK_CRC_REQUEST = 6 ; // unused
|
||||
|
||||
const uint8_t QOS_PRIORITY_RS_TURTLE_FILE_DATA = 5 ;
|
||||
const uint8_t QOS_PRIORITY_RS_TURTLE_FILE_CRC = 5 ;
|
||||
const uint8_t QOS_PRIORITY_RS_TURTLE_CHUNK_CRC = 5 ;
|
||||
const uint8_t QOS_PRIORITY_RS_TURTLE_FILE_MAP = 5 ;
|
||||
const uint8_t QOS_PRIORITY_RS_TURTLE_FILE_MAP = 6 ;
|
||||
const uint8_t QOS_PRIORITY_RS_TURTLE_FILE_CRC = 6 ; // unused
|
||||
const uint8_t QOS_PRIORITY_RS_TURTLE_CHUNK_CRC = 6 ; // unused
|
||||
|
||||
const uint8_t QOS_PRIORITY_RS_TURTLE_SEARCH_RESULT = 4 ;
|
||||
const uint8_t QOS_PRIORITY_RS_TURTLE_GENERIC_ITEM = 3 ;
|
||||
//const uint8_t QOS_PRIORITY_RS_TURTLE_FORWARD_FILE_DATA= 3 ; // unused
|
||||
const uint8_t QOS_PRIORITY_RS_TURTLE_GENERIC_DATA = 5 ;
|
||||
const uint8_t QOS_PRIORITY_RS_TURTLE_GENERIC_FAST_DATA = 7 ;
|
||||
const uint8_t QOS_PRIORITY_RS_TURTLE_SEARCH_RESULT = 6 ;
|
||||
const uint8_t QOS_PRIORITY_RS_TURTLE_GENERIC_DATA = 5 ;
|
||||
const uint8_t QOS_PRIORITY_RS_TURTLE_GENERIC_ITEM = 3 ;
|
||||
const uint8_t QOS_PRIORITY_RS_TURTLE_FORWARD_FILE_DATA = 3 ; // unused
|
||||
|
||||
// File transfer
|
||||
//
|
||||
const uint8_t QOS_PRIORITY_RS_FILE_REQUEST = 5 ;
|
||||
const uint8_t QOS_PRIORITY_RS_FILE_CRC_REQUEST = 5 ;
|
||||
const uint8_t QOS_PRIORITY_RS_CHUNK_CRC_REQUEST = 5 ;
|
||||
const uint8_t QOS_PRIORITY_RS_FILE_MAP_REQUEST = 5 ;
|
||||
const uint8_t QOS_PRIORITY_RS_FILE_DATA = 5 ;
|
||||
const uint8_t QOS_PRIORITY_RS_FILE_CRC = 5 ;
|
||||
const uint8_t QOS_PRIORITY_RS_CHUNK_CRC = 5 ;
|
||||
const uint8_t QOS_PRIORITY_RS_FILE_MAP = 5 ;
|
||||
//const uint8_t QOS_PRIORITY_RS_CACHE_ITEM = 3 ; // unused
|
||||
const uint8_t QOS_PRIORITY_RS_FILE_REQUEST = 6 ;
|
||||
const uint8_t QOS_PRIORITY_RS_FILE_MAP_REQUEST = 6 ;
|
||||
const uint8_t QOS_PRIORITY_RS_FILE_CRC_REQUEST = 6 ; // unused
|
||||
const uint8_t QOS_PRIORITY_RS_CHUNK_CRC_REQUEST = 6 ;
|
||||
|
||||
const uint8_t QOS_PRIORITY_RS_FILE_DATA = 5 ;
|
||||
const uint8_t QOS_PRIORITY_RS_FILE_MAP = 6 ;
|
||||
const uint8_t QOS_PRIORITY_RS_FILE_CRC = 6 ; // unused
|
||||
const uint8_t QOS_PRIORITY_RS_CHUNK_CRC = 6 ;
|
||||
|
||||
const uint8_t QOS_PRIORITY_RS_CACHE_ITEM = 3 ; // unused
|
||||
|
||||
// Discovery
|
||||
//
|
||||
const uint8_t QOS_PRIORITY_RS_DISC_HEART_BEAT = 8 ;
|
||||
const uint8_t QOS_PRIORITY_RS_DISC_ASK_INFO = 2 ;
|
||||
const uint8_t QOS_PRIORITY_RS_DISC_REPLY = 2 ;
|
||||
const uint8_t QOS_PRIORITY_RS_DISC_VERSION = 2 ;
|
||||
const uint8_t QOS_PRIORITY_RS_DISC_HEART_BEAT = 8 ;
|
||||
const uint8_t QOS_PRIORITY_RS_DISC_ASK_INFO = 2 ;
|
||||
const uint8_t QOS_PRIORITY_RS_DISC_REPLY = 2 ;
|
||||
const uint8_t QOS_PRIORITY_RS_DISC_VERSION = 2 ;
|
||||
|
||||
const uint8_t QOS_PRIORITY_RS_DISC_CONTACT = 2 ; // CONTACT and PGPLIST must have
|
||||
const uint8_t QOS_PRIORITY_RS_DISC_PGP_LIST = 2 ; // same priority.
|
||||
const uint8_t QOS_PRIORITY_RS_DISC_SERVICES = 2 ;
|
||||
const uint8_t QOS_PRIORITY_RS_DISC_PGP_CERT = 2 ;
|
||||
const uint8_t QOS_PRIORITY_RS_DISC_CONTACT = 2 ; // CONTACT and PGPLIST must have
|
||||
const uint8_t QOS_PRIORITY_RS_DISC_PGP_LIST = 2 ; // same priority
|
||||
const uint8_t QOS_PRIORITY_RS_DISC_SERVICES = 2 ;
|
||||
const uint8_t QOS_PRIORITY_RS_DISC_PGP_CERT = 2 ;
|
||||
|
||||
// File database
|
||||
//
|
||||
const uint8_t QOS_PRIORITY_RS_FAST_SYNC_REQUEST = 7 ;
|
||||
const uint8_t QOS_PRIORITY_RS_SLOW_SYNC_REQUEST = 3 ;
|
||||
|
||||
// Heartbeat.
|
||||
// Heartbeat
|
||||
//
|
||||
const uint8_t QOS_PRIORITY_RS_HEARTBEAT_PULSE = 8 ;
|
||||
const uint8_t QOS_PRIORITY_RS_HEARTBEAT_PULSE = 8 ;
|
||||
|
||||
// Chat/Msgs
|
||||
//
|
||||
const uint8_t QOS_PRIORITY_RS_CHAT_ITEM = 7 ;
|
||||
const uint8_t QOS_PRIORITY_RS_CHAT_AVATAR_ITEM = 2 ;
|
||||
const uint8_t QOS_PRIORITY_RS_MSG_ITEM = 2 ; // depreciated.
|
||||
const uint8_t QOS_PRIORITY_RS_MAIL_ITEM = 2 ; // new mail service
|
||||
const uint8_t QOS_PRIORITY_RS_STATUS_ITEM = 2 ;
|
||||
const uint8_t QOS_PRIORITY_RS_CHAT_ITEM = 7 ;
|
||||
const uint8_t QOS_PRIORITY_RS_CHAT_AVATAR_ITEM = 2 ;
|
||||
const uint8_t QOS_PRIORITY_RS_MSG_ITEM = 2 ; // deprecated
|
||||
const uint8_t QOS_PRIORITY_RS_MAIL_ITEM = 2 ; // new mail service
|
||||
const uint8_t QOS_PRIORITY_RS_STATUS_ITEM = 2 ;
|
||||
|
||||
// RTT
|
||||
//
|
||||
@ -97,24 +100,26 @@ const uint8_t QOS_PRIORITY_RS_RTT_PING = 9 ;
|
||||
|
||||
// BanList
|
||||
//
|
||||
const uint8_t QOS_PRIORITY_RS_BANLIST_ITEM = 3 ;
|
||||
const uint8_t QOS_PRIORITY_RS_BANLIST_ITEM = 3 ;
|
||||
|
||||
// Bandwidth Control.
|
||||
// Bandwidth Control
|
||||
//
|
||||
const uint8_t QOS_PRIORITY_RS_BWCTRL_ALLOWED_ITEM = 9 ;
|
||||
const uint8_t QOS_PRIORITY_RS_BWCTRL_ALLOWED_ITEM = 9 ;
|
||||
|
||||
// Dsdv Routing
|
||||
// DsDv Routing
|
||||
//
|
||||
const uint8_t QOS_PRIORITY_RS_DSDV_ROUTE = 4 ;
|
||||
const uint8_t QOS_PRIORITY_RS_DSDV_DATA = 2 ;
|
||||
const uint8_t QOS_PRIORITY_RS_DSDV_ROUTE = 4 ;
|
||||
const uint8_t QOS_PRIORITY_RS_DSDV_DATA = 2 ;
|
||||
|
||||
// GXS
|
||||
//
|
||||
const uint8_t QOS_PRIORITY_RS_GXS_NET = 6 ;
|
||||
|
||||
// GXS Reputation.
|
||||
const uint8_t QOS_PRIORITY_RS_GXSREPUTATION_ITEM = 3;
|
||||
// GXS Reputation
|
||||
//
|
||||
const uint8_t QOS_PRIORITY_RS_GXSREPUTATION_ITEM = 3 ;
|
||||
|
||||
// Service Info / Control.
|
||||
const uint8_t QOS_PRIORITY_RS_SERVICE_INFO_ITEM = 8;
|
||||
// Service Info / Control
|
||||
//
|
||||
const uint8_t QOS_PRIORITY_RS_SERVICE_INFO_ITEM = 8 ;
|
||||
|
||||
|
@ -33,11 +33,16 @@
|
||||
|
||||
RsItem *RsServiceSerializer::deserialise(void *data, uint32_t *size)
|
||||
{
|
||||
if(!data || !size || !*size)
|
||||
if(!data || !size || *size < 8)
|
||||
{
|
||||
RsErr() << __PRETTY_FUNCTION__ << " Called with null paramethers data: "
|
||||
<< data << " size: " << static_cast<void*>(size) << " *size: "
|
||||
<< (size ? *size : 0) << " this should never happen!"
|
||||
RsErr() << __PRETTY_FUNCTION__ << " Called with inconsistent parameters data: " << std::endl;
|
||||
if(data)
|
||||
RsErr() << "Data is: " << RsUtil::BinToHex(static_cast<uint8_t*>(data),std::min(50u,*size)) << ((*size>50)?"...":"") << std::endl;
|
||||
else
|
||||
RsErr() << "Null Data" << std::endl;
|
||||
|
||||
RsErr() << " size: " << static_cast<void*>(size) << " *size: " << (size ? *size : 0) << std::endl
|
||||
<< " this should never happen!"
|
||||
<< std::endl;
|
||||
print_stacktrace();
|
||||
return nullptr;
|
||||
|
@ -324,7 +324,7 @@ class RsTurtleGenericTunnelItem: public RsTurtleItem
|
||||
class RsTurtleGenericDataItem: public RsTurtleGenericTunnelItem
|
||||
{
|
||||
public:
|
||||
RsTurtleGenericDataItem() : RsTurtleGenericTunnelItem(RS_TURTLE_SUBTYPE_GENERIC_DATA), data_size(0), data_bytes(0) { setPriorityLevel(QOS_PRIORITY_RS_TURTLE_FILE_REQUEST);}
|
||||
RsTurtleGenericDataItem() : RsTurtleGenericTunnelItem(RS_TURTLE_SUBTYPE_GENERIC_DATA), data_size(0), data_bytes(0) { setPriorityLevel(QOS_PRIORITY_RS_TURTLE_GENERIC_DATA);}
|
||||
virtual ~RsTurtleGenericDataItem() { if(data_bytes != NULL) free(data_bytes) ; }
|
||||
|
||||
virtual bool shouldStampTunnel() const { return true ; }
|
||||
|
@ -10,7 +10,13 @@ INCLUDEPATH *= $$clean_path($${RS_SRC_PATH}/libretroshare/src)
|
||||
equals(TARGET, retroshare):equals(TEMPLATE, lib){
|
||||
} else {
|
||||
LIBS *= -L$$clean_path($${RS_BUILD_PATH}/libretroshare/src/lib/) -lretroshare
|
||||
PRE_TARGETDEPS *= $$clean_path($${RS_BUILD_PATH}/libretroshare/src/lib/libretroshare.a)
|
||||
win32-g++|win32-clang-g++:!isEmpty(QMAKE_SH):libretroshare_shared {
|
||||
# Windows msys2
|
||||
LIBRETROSHARE_TARGET=libretroshare.dll.a
|
||||
} else {
|
||||
LIBRETROSHARE_TARGET=libretroshare.a
|
||||
}
|
||||
PRE_TARGETDEPS *= $$clean_path($${RS_BUILD_PATH}/libretroshare/src/lib/$${LIBRETROSHARE_TARGET})
|
||||
}
|
||||
|
||||
!include("../../openpgpsdk/src/use_openpgpsdk.pri"):error("Including")
|
||||
|
@ -892,6 +892,10 @@ int RsDirUtil::createLockFile(const std::string& lock_file_path, rs_lock_handle_
|
||||
return 2;
|
||||
}
|
||||
|
||||
// Write to lock file our pid
|
||||
std::string ourPID = std::to_string(::getpid());
|
||||
write(lock_handle, ourPID.c_str(), sizeof(char)*ourPID.size() );
|
||||
|
||||
return 0;
|
||||
#else
|
||||
// Suspended. The user should make sure he's not already using the file descriptor.
|
||||
|
@ -43,7 +43,13 @@ win32 {
|
||||
}
|
||||
|
||||
libretroshare_shared {
|
||||
PRE_TARGETDEPS += $$OUT_PWD/../../libretroshare/src/lib/libretroshare.a
|
||||
win32-g++|win32-clang-g++:!isEmpty(QMAKE_SH) {
|
||||
# Windows msys2
|
||||
LIBRETROSHARE_TARGET=libretroshare.dll.a
|
||||
} else {
|
||||
LIBRETROSHARE_TARGET=libretroshare.a
|
||||
}
|
||||
PRE_TARGETDEPS += $$OUT_PWD/../../libretroshare/src/lib/$${LIBRETROSHARE_TARGET}
|
||||
LIBS += -L"$$OUT_PWD/../../libretroshare/src/lib" -lretroshare
|
||||
}
|
||||
|
||||
@ -69,7 +75,7 @@ win32 {
|
||||
|
||||
DEFINES += WINDOWS_SYS WIN32 STATICLIB MINGW WIN32_LEAN_AND_MEAN
|
||||
#DEFINES += MINIUPNPC_VERSION=13
|
||||
# DESTDIR = lib
|
||||
DESTDIR = lib
|
||||
|
||||
# Switch off optimization for release version
|
||||
QMAKE_CXXFLAGS_RELEASE -= -O2
|
||||
|
@ -22,6 +22,7 @@
|
||||
#include "ui_FeedReaderConfig.h"
|
||||
#include "gui/settings/rsharesettings.h"
|
||||
#include "interface/rsFeedReader.h"
|
||||
#include <util/misc.h>
|
||||
|
||||
/** Constructor */
|
||||
FeedReaderConfig::FeedReaderConfig(QWidget *parent, Qt::WindowFlags flags)
|
||||
@ -30,12 +31,30 @@ FeedReaderConfig::FeedReaderConfig(QWidget *parent, Qt::WindowFlags flags)
|
||||
/* Invoke the Qt Designer generated object setup routine */
|
||||
ui->setupUi(this);
|
||||
|
||||
connect(ui->useProxyCheckBox, SIGNAL(toggled(bool)), this, SLOT(useProxyToggled()));
|
||||
|
||||
ui->proxyAddressLineEdit->setEnabled(false);
|
||||
ui->proxyPortSpinBox->setEnabled(false);
|
||||
|
||||
loaded = false;
|
||||
/* Connect signals */
|
||||
connect(ui->updateIntervalSpinBox, (void(QSpinBox::*)(int))&QSpinBox::valueChanged, this, [this]() {
|
||||
rsFeedReader->setStandardUpdateInterval(ui->updateIntervalSpinBox->value() * 60);
|
||||
});
|
||||
connect(ui->storageTimeSpinBox, (void(QSpinBox::*)(int))&QSpinBox::valueChanged, this, [this]() {
|
||||
rsFeedReader->setStandardStorageTime(ui->storageTimeSpinBox->value() * 60 *60 * 24);
|
||||
});
|
||||
connect(ui->saveInBackgroundCheckBox, &QCheckBox::toggled, this, [this]() {
|
||||
rsFeedReader->setSaveInBackground(ui->saveInBackgroundCheckBox->isChecked());
|
||||
});
|
||||
connect(ui->setMsgToReadOnActivate, &QCheckBox::toggled, this, [this]() {
|
||||
Settings->setValueToGroup("FeedReaderDialog", "SetMsgToReadOnActivate", ui->setMsgToReadOnActivate->isChecked());
|
||||
});
|
||||
connect(ui->openAllInNewTabCheckBox, &QCheckBox::toggled, this, [this]() {
|
||||
Settings->setValueToGroup("FeedReaderDialog", "OpenAllInNewTab", ui->openAllInNewTabCheckBox->isChecked());
|
||||
});
|
||||
connect(ui->useProxyCheckBox, &QCheckBox::toggled, this, &FeedReaderConfig::updateProxy);
|
||||
connect(ui->proxyAddressLineEdit, &QLineEdit::textChanged, this, &FeedReaderConfig::updateProxy);
|
||||
connect(ui->proxyPortSpinBox, (void(QSpinBox::*)(int))&QSpinBox::valueChanged, this, &FeedReaderConfig::updateProxy);
|
||||
|
||||
connect(ui->useProxyCheckBox, SIGNAL(toggled(bool)), this, SLOT(useProxyToggled()));
|
||||
}
|
||||
|
||||
/** Destructor */
|
||||
@ -47,31 +66,21 @@ FeedReaderConfig::~FeedReaderConfig()
|
||||
/** Loads the settings for this page */
|
||||
void FeedReaderConfig::load()
|
||||
{
|
||||
ui->updateIntervalSpinBox->setValue(rsFeedReader->getStandardUpdateInterval() / 60);
|
||||
ui->storageTimeSpinBox->setValue(rsFeedReader->getStandardStorageTime() / (60 * 60 *24));
|
||||
ui->saveInBackgroundCheckBox->setChecked(rsFeedReader->getSaveInBackground());
|
||||
ui->setMsgToReadOnActivate->setChecked(FeedReaderSetting_SetMsgToReadOnActivate());
|
||||
ui->openAllInNewTabCheckBox->setChecked(FeedReaderSetting_OpenAllInNewTab());
|
||||
whileBlocking(ui->updateIntervalSpinBox)->setValue(rsFeedReader->getStandardUpdateInterval() / 60);
|
||||
whileBlocking(ui->storageTimeSpinBox)->setValue(rsFeedReader->getStandardStorageTime() / (60 * 60 *24));
|
||||
whileBlocking(ui->saveInBackgroundCheckBox)->setChecked(rsFeedReader->getSaveInBackground());
|
||||
whileBlocking(ui->setMsgToReadOnActivate)->setChecked(FeedReaderSetting_SetMsgToReadOnActivate());
|
||||
whileBlocking(ui->openAllInNewTabCheckBox)->setChecked(FeedReaderSetting_OpenAllInNewTab());
|
||||
|
||||
std::string proxyAddress;
|
||||
uint16_t proxyPort;
|
||||
ui->useProxyCheckBox->setChecked(rsFeedReader->getStandardProxy(proxyAddress, proxyPort));
|
||||
ui->proxyAddressLineEdit->setText(QString::fromUtf8(proxyAddress.c_str()));
|
||||
ui->proxyPortSpinBox->setValue(proxyPort);
|
||||
whileBlocking(ui->useProxyCheckBox)->setChecked(rsFeedReader->getStandardProxy(proxyAddress, proxyPort));
|
||||
whileBlocking(ui->proxyAddressLineEdit)->setText(QString::fromUtf8(proxyAddress.c_str()));
|
||||
whileBlocking(ui->proxyPortSpinBox)->setValue(proxyPort);
|
||||
|
||||
loaded = true;
|
||||
}
|
||||
|
||||
bool FeedReaderConfig::save(QString &/*errmsg*/)
|
||||
{
|
||||
rsFeedReader->setStandardUpdateInterval(ui->updateIntervalSpinBox->value() * 60);
|
||||
rsFeedReader->setStandardStorageTime(ui->storageTimeSpinBox->value() * 60 *60 * 24);
|
||||
rsFeedReader->setStandardProxy(ui->useProxyCheckBox->isChecked(), ui->proxyAddressLineEdit->text().toUtf8().constData(), ui->proxyPortSpinBox->value());
|
||||
rsFeedReader->setSaveInBackground(ui->saveInBackgroundCheckBox->isChecked());
|
||||
Settings->setValueToGroup("FeedReaderDialog", "SetMsgToReadOnActivate", ui->setMsgToReadOnActivate->isChecked());
|
||||
Settings->setValueToGroup("FeedReaderDialog", "OpenAllInNewTab", ui->openAllInNewTabCheckBox->isChecked());
|
||||
|
||||
return true;
|
||||
useProxyToggled();
|
||||
}
|
||||
|
||||
void FeedReaderConfig::useProxyToggled()
|
||||
@ -81,3 +90,8 @@ void FeedReaderConfig::useProxyToggled()
|
||||
ui->proxyAddressLineEdit->setEnabled(enabled);
|
||||
ui->proxyPortSpinBox->setEnabled(enabled);
|
||||
}
|
||||
|
||||
void FeedReaderConfig::updateProxy()
|
||||
{
|
||||
rsFeedReader->setStandardProxy(ui->useProxyCheckBox->isChecked(), ui->proxyAddressLineEdit->text().toUtf8().constData(), ui->proxyPortSpinBox->value());
|
||||
}
|
||||
|
@ -40,8 +40,6 @@ public:
|
||||
/** Default Destructor */
|
||||
virtual ~FeedReaderConfig();
|
||||
|
||||
/** Saves the changes on this page */
|
||||
virtual bool save(QString &errmsg);
|
||||
/** Loads the settings for this page */
|
||||
virtual void load();
|
||||
|
||||
@ -51,10 +49,10 @@ public:
|
||||
|
||||
private slots:
|
||||
void useProxyToggled();
|
||||
void updateProxy();
|
||||
|
||||
private:
|
||||
Ui::FeedReaderConfig *ui;
|
||||
bool loaded;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -65,64 +65,38 @@ win32 {
|
||||
DEPENDPATH += . $$INC_DIR
|
||||
INCLUDEPATH += . $$INC_DIR
|
||||
|
||||
OPENCV_VERSION = "341"
|
||||
USE_PRECOMPILED_LIBS =
|
||||
for(lib, RS_LIB_DIR) {
|
||||
#message(Scanning $$lib)
|
||||
exists( $$lib/opencv/libopencv_core$${OPENCV_VERSION}.a) {
|
||||
isEmpty(USE_PRECOMPILED_LIBS) {
|
||||
message(Get pre-compiled opencv $$OPENCV_VERSION libraries here:)
|
||||
message($$lib)
|
||||
isEmpty(USE_PRECOMPILED_LIBS) {
|
||||
exists($$lib/opencv/libopencv_core.a) {
|
||||
message(Get pre-compiled opencv libraries here:)
|
||||
message($$lib/opencv)
|
||||
LIBS += -L"$$lib/opencv"
|
||||
LIBS += -lopencv_core$$OPENCV_VERSION -lopencv_highgui$$OPENCV_VERSION -lopencv_imgproc$$OPENCV_VERSION -lopencv_videoio$$OPENCV_VERSION -lopencv_imgcodecs$$OPENCV_VERSION -llibwebp
|
||||
USE_PRECOMPILED_LIBS = 1
|
||||
}
|
||||
}
|
||||
exists( $$lib/opencv/libopencv_core.a) {
|
||||
isEmpty(USE_PRECOMPILED_LIBS) {
|
||||
exists($$lib/libopencv_core.dll.a) {
|
||||
message(Get pre-compiled opencv libraries here:)
|
||||
message($$lib)
|
||||
LIBS += -L"$$lib/opencv"
|
||||
LIBS += -lopencv_core -lopencv_highgui -lopencv_imgproc
|
||||
LIBS += -L"$$lib"
|
||||
USE_PRECOMPILED_LIBS = 1
|
||||
}
|
||||
}
|
||||
exists( $$lib/libopencv_core.dll.a) {
|
||||
isEmpty(USE_PRECOMPILED_LIBS) {
|
||||
message(Get pre-compiled opencv libraries here:)
|
||||
message($$lib)
|
||||
LIBS += -L"$$lib/opencv"
|
||||
LIBS += -lopencv_core -lopencv_highgui -lopencv_imgproc
|
||||
USE_PRECOMPILED_LIBS = 1
|
||||
}
|
||||
}
|
||||
exists( $$lib/opencv/libopencv_videoio.a) {
|
||||
message(videoio found in opencv libraries.)
|
||||
message($$lib)
|
||||
LIBS += -lopencv_videoio
|
||||
}
|
||||
exists( $$lib/libopencv_videoio.dll.a) {
|
||||
message(videoio found in opencv libraries.)
|
||||
message($$lib)
|
||||
LIBS += -lopencv_videoio
|
||||
}
|
||||
exists( $$lib/opencv/libopencv_imgcodecs.a) {
|
||||
message(videoio found in opencv libraries.)
|
||||
message($$lib)
|
||||
LIBS += -lopencv_imgcodecs
|
||||
}
|
||||
exists( $$lib/opencv/liblibwebp.a) {
|
||||
message(videoio found in opencv libraries.)
|
||||
message($$lib)
|
||||
LIBS += -llibwebp
|
||||
}
|
||||
}
|
||||
isEmpty(USE_PRECOMPILED_LIBS) {
|
||||
message(Use system opencv libraries.)
|
||||
LIBS += -lopencv_core -lopencv_highgui -lopencv_imgproc
|
||||
}
|
||||
LIBS += -lzlib -lole32 -loleaut32 -luuid -lvfw32 -llibjpeg-turbo -llibtiff -llibpng -llibjasper -lIlmImf
|
||||
LIBS += -lavifil32 -lavicap32 -lavcodec -lavutil -lswresample
|
||||
|
||||
LIBS += -lopencv_core -lopencv_highgui -lopencv_imgproc -lopencv_videoio -lopencv_imgcodecs -llibwebp -llibtiff -llibpng -llibopenjp2 -lIlmImf
|
||||
LIBS += -lole32 -loleaut32 -luuid -lvfw32
|
||||
|
||||
# Check for msys2
|
||||
!isEmpty(PREFIX_MSYS2) {
|
||||
message(Use msys2 opencv4.)
|
||||
INCLUDEPATH += "$${PREFIX_MSYS2}/include/opencv4"
|
||||
} else {
|
||||
LIBS += -llibjpeg-turbo -lzlib
|
||||
}
|
||||
}
|
||||
|
||||
#################################### MacOSX #####################################
|
||||
|
@ -38,7 +38,7 @@
|
||||
#include "gui/SoundManager.h"
|
||||
#include "gui/chat/ChatWidget.h"
|
||||
|
||||
#include <opencv/cv.h>
|
||||
#include <opencv2/opencv.hpp>
|
||||
#include <speex/speex.h>
|
||||
|
||||
#define IMAGE_VOIP ":/images/talking_on.svg"
|
||||
|
@ -18,8 +18,9 @@
|
||||
* *
|
||||
*******************************************************************************/
|
||||
|
||||
#include <opencv/cv.h>
|
||||
#include <opencv/highgui.h>
|
||||
#include <opencv2/opencv.hpp>
|
||||
#include <opencv2/highgui.hpp>
|
||||
#include <opencv2/imgproc/types_c.h>
|
||||
|
||||
#include <QTimer>
|
||||
#include <QPainter>
|
||||
|
@ -473,10 +473,10 @@ FFmpegVideo::FFmpegVideo()
|
||||
encoding_context->rc_max_rate = 0;
|
||||
encoding_context->rc_buffer_size = 0;
|
||||
#endif
|
||||
if (encoding_codec->capabilities & CODEC_CAP_TRUNCATED)
|
||||
encoding_context->flags |= CODEC_FLAG_TRUNCATED;
|
||||
encoding_context->flags |= CODEC_FLAG_PSNR;//Peak signal-to-noise ratio
|
||||
encoding_context->flags |= CODEC_CAP_PARAM_CHANGE;
|
||||
if (encoding_codec->capabilities & AV_CODEC_CAP_TRUNCATED)
|
||||
encoding_context->flags |= AV_CODEC_FLAG_TRUNCATED;
|
||||
encoding_context->flags |= AV_CODEC_FLAG_PSNR;//Peak signal-to-noise ratio
|
||||
encoding_context->flags |= AV_CODEC_CAP_PARAM_CHANGE;
|
||||
encoding_context->i_quant_factor = 0.769f;
|
||||
encoding_context->b_quant_factor = 1.4f;
|
||||
encoding_context->time_base.num = 1;
|
||||
@ -569,10 +569,10 @@ FFmpegVideo::FFmpegVideo()
|
||||
decoding_context->pix_fmt = AV_PIX_FMT_YUV420P;
|
||||
#endif
|
||||
|
||||
if(decoding_codec->capabilities & CODEC_CAP_TRUNCATED)
|
||||
decoding_context->flags |= CODEC_FLAG_TRUNCATED; // we do not send complete frames
|
||||
if(decoding_codec->capabilities & AV_CODEC_CAP_TRUNCATED)
|
||||
decoding_context->flags |= AV_CODEC_FLAG_TRUNCATED; // we do not send complete frames
|
||||
//we can receive truncated frames
|
||||
decoding_context->flags2 |= CODEC_FLAG2_CHUNKS;
|
||||
decoding_context->flags2 |= AV_CODEC_FLAG2_CHUNKS;
|
||||
|
||||
AVDictionary* dictionary = NULL;
|
||||
if(avcodec_open2(decoding_context, decoding_codec, &dictionary) < 0)
|
||||
|
@ -60,7 +60,7 @@
|
||||
#define IMAGE_PLAY ":/images/start.png"
|
||||
#define IMAGE_HASH_BUSY ":/images/settings.png"
|
||||
#define IMAGE_HASH_DONE ":/images/accepted16.png"
|
||||
#define IMAGE_MSG ":/images/message-mail.png"
|
||||
#define IMAGE_MSG ":/icons/png/message.png"
|
||||
#define IMAGE_ATTACHMENT ":/icons/png/attachements.png"
|
||||
#define IMAGE_FRIEND ":/images/peers_16x16.png"
|
||||
#define IMAGE_COPYLINK ":/images/copyrslink.png"
|
||||
|
@ -133,21 +133,22 @@ void NetworkDialog::connectTreeWidgetCostumPopupMenu( QPoint /*point*/ )
|
||||
contextMnu->addAction(QIcon(IMAGE_PEERDETAILS), tr("Profile details..."), this, SLOT(peerdetails()));
|
||||
contextMnu->addSeparator() ;
|
||||
contextMnu->addAction(QIcon(), tr("Remove unused keys..."), this, SLOT(removeUnusedKeys()));
|
||||
contextMnu->addAction(QIcon(), tr("Remove this key"), this, SLOT(removeSelectedKeys()));
|
||||
|
||||
contextMnu->exec(QCursor::pos());
|
||||
}
|
||||
|
||||
void NetworkDialog::removeUnusedKeys()
|
||||
{
|
||||
std::set<RsPgpId> pre_selected ;
|
||||
std::list<RsPgpId> ids ;
|
||||
std::set<RsPgpId> pre_selected ;
|
||||
std::list<RsPgpId> ids ;
|
||||
|
||||
rsPeers->getGPGAllList(ids) ;
|
||||
RsPeerDetails details ;
|
||||
time_t now = time(NULL) ;
|
||||
time_t THREE_MONTHS = 3*31*24*60*60 ;//3*DayPerMonth*HoursPerDay*MinPerHour*SecPerMin
|
||||
time_t THREE_MONTHS = 3*31*24*60*60 ;//3*DayPerMonth*HoursPerDay*MinPerHour*SecPerMin
|
||||
|
||||
for(std::list<RsPgpId>::const_iterator it(ids.begin());it!=ids.end();++it)
|
||||
for(std::list<RsPgpId>::const_iterator it(ids.begin());it!=ids.end();++it)
|
||||
{
|
||||
rsPeers->getGPGDetails(*it,details) ;
|
||||
|
||||
@ -159,17 +160,34 @@ void NetworkDialog::removeUnusedKeys()
|
||||
if(now > (time_t) (THREE_MONTHS + details.lastUsed) && !details.accept_connection)
|
||||
{
|
||||
std::cerr << "Adding " << *it << " to pre-selection." << std::endl;
|
||||
pre_selected.insert(*it) ;
|
||||
pre_selected.insert(*it) ;
|
||||
}
|
||||
}
|
||||
|
||||
std::set<RsPgpId> selected = FriendSelectionDialog::selectFriends_PGP(NULL,
|
||||
tr("Clean keyring"),
|
||||
tr("The selected keys below haven't been used in the last 3 months. \nDo you want to delete them permanently ? \n\nNotes: Your old keyring will be backed up.\n The removal may fail when running multiple Retroshare instances on the same machine."),FriendSelectionWidget::MODUS_CHECK,FriendSelectionWidget::SHOW_GPG | FriendSelectionWidget::SHOW_NON_FRIEND_GPG,
|
||||
pre_selected) ;
|
||||
|
||||
std::set<RsPgpId> selected = FriendSelectionDialog::selectFriends_PGP(NULL,
|
||||
tr("Clean keyring"),
|
||||
tr("The selected keys below haven't been used in the last 3 months. \nDo you want to delete them permanently ? \n\nNotes: Your old keyring will be backed up.\n The removal may fail when running multiple Retroshare instances on the same machine."),FriendSelectionWidget::MODUS_CHECK,FriendSelectionWidget::SHOW_GPG | FriendSelectionWidget::SHOW_NON_FRIEND_GPG,
|
||||
pre_selected) ;
|
||||
|
||||
removeKeys(selected);
|
||||
}
|
||||
|
||||
void NetworkDialog::removeSelectedKeys()
|
||||
{
|
||||
QModelIndexList l = ui.connectTreeWidget->selectionModel()->selection().indexes();
|
||||
if(l.empty())
|
||||
return;
|
||||
|
||||
std::set<RsPgpId> selected;
|
||||
selected.insert(RsPgpId(ui.connectTreeWidget->model()->data(ui.connectTreeWidget->model()->index(l.begin()->row(), COLUMN_PEERID)).toString().toStdString()));
|
||||
|
||||
removeKeys(selected);
|
||||
}
|
||||
|
||||
void NetworkDialog::removeKeys(std::set<RsPgpId> selected)
|
||||
{
|
||||
std::cerr << "Removing these keys from the keyring: " << std::endl;
|
||||
for(std::set<RsPgpId>::const_iterator it(selected.begin());it!=selected.end();++it)
|
||||
for(std::set<RsPgpId>::const_iterator it(selected.begin());it!=selected.end();++it)
|
||||
std::cerr << " " << *it << std::endl;
|
||||
|
||||
std::string backup_file ;
|
||||
@ -200,7 +218,7 @@ void NetworkDialog::removeUnusedKeys()
|
||||
}
|
||||
QMessageBox::warning(NULL,tr("Keyring info"),tr("Key removal has failed. Your keyring remains intact.\n\nReported error:")+" "+error_string ) ;
|
||||
}
|
||||
updateDisplay();
|
||||
updateDisplay();
|
||||
// insertConnect() ;
|
||||
}
|
||||
|
||||
|
@ -68,6 +68,7 @@ protected:
|
||||
private slots:
|
||||
|
||||
void removeUnusedKeys() ;
|
||||
void removeSelectedKeys() ;
|
||||
void makeFriend() ;
|
||||
void denyFriend() ;
|
||||
void peerdetails();
|
||||
@ -86,6 +87,8 @@ private slots:
|
||||
|
||||
private:
|
||||
|
||||
void removeKeys(std::set<RsPgpId> selected) ;
|
||||
|
||||
/* Color definitions (for standard see qss.default) */
|
||||
QColor mBackgroundColorSelf;
|
||||
QColor mBackgroundColorOwnSign;
|
||||
|
@ -60,29 +60,25 @@ BoardPostDisplayWidgetBase::BoardPostDisplayWidgetBase(const RsPostedPost& post,
|
||||
|
||||
void BoardPostDisplayWidgetBase::setCommentsSize(int comNb)
|
||||
{
|
||||
QString sComButText ;
|
||||
QString sComButText = tr("Comment");
|
||||
QString sComButTooltip ;
|
||||
|
||||
if (comNb == 1)
|
||||
sComButText = tr("1 comment");
|
||||
else if(comNb > 1)
|
||||
sComButText = tr("%1 comments").arg(comNb);
|
||||
else
|
||||
sComButText = tr("No comments yet. Click to add one.");
|
||||
|
||||
commentButton()->setToolTip(sComButText);
|
||||
if (comNb == 0)
|
||||
sComButTooltip = tr("No comments yet. Click to add one.");
|
||||
|
||||
commentButton()->setToolTip(sComButTooltip);
|
||||
commentButton()->setText(sComButText);
|
||||
|
||||
if(comNb > 0)
|
||||
commentButton()->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/comments_blue.png"));
|
||||
else
|
||||
commentButton()->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/comments.png"));
|
||||
|
||||
// QString sComButText = tr("Comment");
|
||||
// if (comNb == 1)
|
||||
// sComButText = sComButText.append("(1)");
|
||||
// else if(comNb > 1)
|
||||
// sComButText = tr("Comments ").append("(%1)").arg(comNb);
|
||||
//
|
||||
commentButton()->setText(tr("Comments"));
|
||||
}
|
||||
|
||||
void BoardPostDisplayWidgetBase::makeDownVote()
|
||||
|
@ -460,18 +460,14 @@ p, li { white-space: pre-wrap; }
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="LineEditClear" name="filter_LE">
|
||||
<property name="placeholderText">
|
||||
<string>Search</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Minimum</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
@ -480,6 +476,13 @@ p, li { white-space: pre-wrap; }
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="LineEditClear" name="filter_LE">
|
||||
<property name="placeholderText">
|
||||
<string>Search</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<property name="spacing">
|
||||
|
@ -292,6 +292,11 @@ void ChatWidget::addTitleBarWidget(QWidget *w)
|
||||
ui->pluginTitleFrame->layout()->addWidget(w) ;
|
||||
}
|
||||
|
||||
void ChatWidget::addTopBarWidget(QWidget *w)
|
||||
{
|
||||
ui->pluginTopFrame->layout()->addWidget(w) ;
|
||||
}
|
||||
|
||||
void ChatWidget::hideChatText(bool hidden)
|
||||
{
|
||||
ui->chatTextFrame->setHidden(hidden); ;
|
||||
|
@ -115,6 +115,7 @@ public:
|
||||
// small enough in size.
|
||||
void addChatBarWidget(QWidget *w) ;
|
||||
void addTitleBarWidget(QWidget *w);
|
||||
void addTopBarWidget(QWidget *w);
|
||||
void hideChatText(bool hidden);
|
||||
RSButtonOnText* getNewButtonOnTextBrowser();
|
||||
RSButtonOnText* getNewButtonOnTextBrowser(QString text);
|
||||
|
@ -26,6 +26,322 @@
|
||||
<property name="verticalSpacing">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<layout class="QHBoxLayout" name="titleBarMainHLayout">
|
||||
<property name="sizeConstraint">
|
||||
<enum>QLayout::SetMaximumSize</enum>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QFrame" name="titleBarFrame">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>64</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Plain</enum>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="titleBarFrameHLayout">
|
||||
<property name="leftMargin">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="titleLayout">
|
||||
<property name="spacing">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="nameLayout">
|
||||
<item>
|
||||
<widget class="StyledLabel" name="titleLabel">
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string notr="true">Title</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="StyledLabel" name="statusLabel">
|
||||
<property name="text">
|
||||
<string>(Status)</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="statusMessageLabel">
|
||||
<property name="text">
|
||||
<string notr="true">Status message</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QFrame" name="pluginTopFrame">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Plain</enum>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="pluginTitleFrameHLayout_2">
|
||||
<property name="spacing">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="titleBarHSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>28</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="searchButton">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::NoFocus</enum>
|
||||
</property>
|
||||
<property name="contextMenuPolicy">
|
||||
<enum>Qt::CustomContextMenu</enum>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../icons.qrc">
|
||||
<normaloff>:/icons/png/search.png</normaloff>:/icons/png/search.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>28</width>
|
||||
<height>28</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="autoRaise">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="LineEditClear" name="leSearch"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="markButton">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::NoFocus</enum>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../icons.qrc">
|
||||
<normaloff>:/icons/png/highlight.png</normaloff>:/icons/png/highlight.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>28</width>
|
||||
<height>28</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="autoRaise">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="searchBefore">
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::NoFocus</enum>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../icons.qrc">
|
||||
<normaloff>:/icons/png/arrow-left.png</normaloff>:/icons/png/arrow-left.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>28</width>
|
||||
<height>28</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="autoRaise">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="searchAfter">
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::NoFocus</enum>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../icons.qrc">
|
||||
<normaloff>:/icons/png/arrow-right.png</normaloff>:/icons/png/arrow-right.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>28</width>
|
||||
<height>28</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="autoRaise">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="notifyButton">
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::NoFocus</enum>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../icons.qrc">
|
||||
<normaloff>:/icons/png/chat-bubble-notify.png</normaloff>:/icons/png/chat-bubble-notify.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>28</width>
|
||||
<height>28</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="autoRaise">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="pushtoolsButton">
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::NoFocus</enum>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Chat menu</p></body></html></string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../icons.qrc">
|
||||
<normaloff>:/icons/png/menu.png</normaloff>:/icons/png/menu.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>28</width>
|
||||
<height>28</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="popupMode">
|
||||
<enum>QToolButton::InstantPopup</enum>
|
||||
</property>
|
||||
<property name="autoRaise">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QFrame" name="pluginTitleFrame">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Plain</enum>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="pluginTitleFrameHLayout">
|
||||
<property name="spacing">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<layout class="QHBoxLayout" name="textChatHLayout">
|
||||
<property name="spacing">
|
||||
@ -561,295 +877,6 @@ border-image: url(:/images/closepressed.png)
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<layout class="QHBoxLayout" name="titleBarMainHLayout">
|
||||
<property name="sizeConstraint">
|
||||
<enum>QLayout::SetMaximumSize</enum>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QFrame" name="titleBarFrame">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>64</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Plain</enum>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="titleBarFrameHLayout">
|
||||
<property name="leftMargin">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="titleLayout">
|
||||
<property name="spacing">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="nameLayout">
|
||||
<item>
|
||||
<widget class="StyledLabel" name="titleLabel">
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string notr="true">Title</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="StyledLabel" name="statusLabel">
|
||||
<property name="text">
|
||||
<string>(Status)</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="statusMessageLabel">
|
||||
<property name="text">
|
||||
<string notr="true">Status message</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="titleBarHSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>28</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="searchButton">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::NoFocus</enum>
|
||||
</property>
|
||||
<property name="contextMenuPolicy">
|
||||
<enum>Qt::CustomContextMenu</enum>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../icons.qrc">
|
||||
<normaloff>:/icons/png/search.png</normaloff>:/icons/png/search.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>28</width>
|
||||
<height>28</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="autoRaise">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="LineEditClear" name="leSearch"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="markButton">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::NoFocus</enum>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../icons.qrc">
|
||||
<normaloff>:/icons/png/highlight.png</normaloff>:/icons/png/highlight.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>28</width>
|
||||
<height>28</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="autoRaise">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="searchBefore">
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::NoFocus</enum>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../icons.qrc">
|
||||
<normaloff>:/icons/png/arrow-left.png</normaloff>:/icons/png/arrow-left.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>28</width>
|
||||
<height>28</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="autoRaise">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="searchAfter">
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::NoFocus</enum>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../icons.qrc">
|
||||
<normaloff>:/icons/png/arrow-right.png</normaloff>:/icons/png/arrow-right.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>28</width>
|
||||
<height>28</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="autoRaise">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="notifyButton">
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::NoFocus</enum>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../icons.qrc">
|
||||
<normaloff>:/icons/png/chat-bubble-notify.png</normaloff>:/icons/png/chat-bubble-notify.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>28</width>
|
||||
<height>28</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="autoRaise">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="pushtoolsButton">
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::NoFocus</enum>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Chat menu</p></body></html></string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../icons.qrc">
|
||||
<normaloff>:/icons/png/menu.png</normaloff>:/icons/png/menu.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>28</width>
|
||||
<height>28</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="popupMode">
|
||||
<enum>QToolButton::InstantPopup</enum>
|
||||
</property>
|
||||
<property name="autoRaise">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QFrame" name="pluginTitleFrame">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Plain</enum>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="pluginTitleFrameHLayout">
|
||||
<property name="spacing">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
<action name="actionBold">
|
||||
<property name="text">
|
||||
|
@ -62,7 +62,7 @@ PopupDistantChatDialog::PopupDistantChatDialog(const DistantChatPeerId& tunnel_i
|
||||
|
||||
_update_timer->start() ;
|
||||
|
||||
getChatWidget()->addChatBarWidget(_status_label) ;
|
||||
getChatWidget()->addTopBarWidget(_status_label) ;
|
||||
updateDisplay() ;
|
||||
}
|
||||
|
||||
|
@ -185,7 +185,7 @@ int FriendSelectionWidget::addColumn(const QString &title)
|
||||
return column;
|
||||
}
|
||||
|
||||
void FriendSelectionWidget::showEvent(QShowEvent *e)
|
||||
void FriendSelectionWidget::showEvent(QShowEvent */*e*/)
|
||||
{
|
||||
if(gxsIds.empty())
|
||||
loadIdentities();
|
||||
@ -838,6 +838,9 @@ void FriendSelectionWidget::contextMenuRequested(const QPoint &/*pos*/)
|
||||
contextMenu->addAction(QIcon(), tr("Mark all"), this, SLOT(selectAll()));
|
||||
contextMenu->addAction(QIcon(), tr("Mark none"), this, SLOT(deselectAll()));
|
||||
}
|
||||
if (mListModus == MODUS_CHECK) {
|
||||
contextMenu->addAction(QIcon(), tr("Mark none"), this, SLOT(deselectAll()));
|
||||
}
|
||||
|
||||
if (!mContextMenuActions.isEmpty()) {
|
||||
bool addSeparator = false;
|
||||
|
@ -209,6 +209,9 @@ void GxsChannelPostItem::setup()
|
||||
|
||||
ui->scoreLabel->hide();
|
||||
|
||||
// hide unsubscribe button not necessary
|
||||
ui->unsubscribeButton->hide();
|
||||
|
||||
ui->downloadButton->hide();
|
||||
ui->playButton->hide();
|
||||
//ui->warn_image_label->hide();
|
||||
@ -426,7 +429,7 @@ void GxsChannelPostItem::fill()
|
||||
mInFill = true;
|
||||
|
||||
QString title;
|
||||
|
||||
QString msgText;
|
||||
//float f = QFontMetricsF(font()).height()/14.0 ;
|
||||
|
||||
if(mPost.mThumbnail.mData != NULL)
|
||||
@ -465,8 +468,10 @@ void GxsChannelPostItem::fill()
|
||||
title += link.toHtml();
|
||||
ui->titleLabel->setText(title);
|
||||
|
||||
msgText = tr("Post") + ": ";
|
||||
RetroShareLink msgLink = RetroShareLink::createGxsMessageLink(RetroShareLink::TYPE_CHANNEL, mPost.mMeta.mGroupId, mPost.mMeta.mMsgId, messageName());
|
||||
ui->subjectLabel->setText(msgLink.toHtml());
|
||||
msgText += msgLink.toHtml();
|
||||
ui->subjectLabel->setText(msgText);
|
||||
|
||||
if (IS_GROUP_SUBSCRIBED(mGroupMeta.mSubscribeFlags) || IS_GROUP_ADMIN(mGroupMeta.mSubscribeFlags))
|
||||
{
|
||||
|
@ -77,7 +77,7 @@
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="tilteHLayout">
|
||||
<item>
|
||||
<widget class="StyledElidedLabel" name="titleLabel">
|
||||
<widget class="QLabel" name="titleLabel">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
@ -124,16 +124,6 @@
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="subjectLabel">
|
||||
<property name="text">
|
||||
<string notr="true">TextLabel</string>
|
||||
</property>
|
||||
<property name="openExternalLinks">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer_2">
|
||||
<property name="orientation">
|
||||
@ -147,6 +137,16 @@
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="subjectLabel">
|
||||
<property name="text">
|
||||
<string notr="true">TextLabel</string>
|
||||
</property>
|
||||
<property name="openExternalLinks">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="newCommHLayout">
|
||||
<property name="topMargin">
|
||||
@ -469,11 +469,6 @@
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>StyledElidedLabel</class>
|
||||
<extends>QLabel</extends>
|
||||
<header>gui/common/StyledElidedLabel.h</header>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>ElidedLabel</class>
|
||||
<extends>QLabel</extends>
|
||||
|
@ -25,6 +25,7 @@
|
||||
#include "gui/notifyqt.h"
|
||||
#include "gui/Circles/CreateCircleDialog.h"
|
||||
#include "gui/gxs/GxsIdDetails.h"
|
||||
#include "gui/common/FilesDefs.h"
|
||||
|
||||
#include <QLabel>
|
||||
#include <QPushButton>
|
||||
@ -98,8 +99,9 @@ void GxsCircleItem::setup()
|
||||
ui->gxsIdLabel->setId(mGxsId);
|
||||
|
||||
ui->inviteeButton->setHidden(false);
|
||||
ui->inviteeButton->setText(tr("Grant membership"));
|
||||
ui->inviteeButton->setToolTip(tr("Grant membership to this circle, for this identity"));
|
||||
ui->inviteeButton->setText(tr("Grant membership"));
|
||||
ui->inviteeButton->setToolTip(tr("Grant membership to this circle, for this identity"));
|
||||
ui->inviteeButton->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/accepted16.png"));
|
||||
|
||||
ui->membershipButton->setHidden(true);
|
||||
}
|
||||
@ -133,6 +135,7 @@ void GxsCircleItem::setup()
|
||||
ui->inviteeButton->setHidden(false);
|
||||
ui->inviteeButton->setText(tr("Revoke membership"));
|
||||
ui->inviteeButton->setToolTip(tr("Revoke membership for that identity"));
|
||||
ui->inviteeButton->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/cancel.png"));
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -155,6 +158,7 @@ void GxsCircleItem::setup()
|
||||
ui->membershipButton->setHidden(false);
|
||||
ui->membershipButton->setText(tr("Cancel membership request"));
|
||||
ui->membershipButton->setToolTip(tr("Cancel your membership request from that circle"));
|
||||
ui->membershipButton->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/cancel.png"));
|
||||
|
||||
ui->inviteeButton->setHidden(true);
|
||||
}
|
||||
@ -168,6 +172,7 @@ void GxsCircleItem::setup()
|
||||
ui->membershipButton->setHidden(false);
|
||||
ui->membershipButton->setText(tr("Cancel membership"));
|
||||
ui->membershipButton->setToolTip(tr("Cancel your membership from that circle"));
|
||||
ui->membershipButton->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/cancel.png"));
|
||||
|
||||
ui->inviteeButton->setHidden(true);
|
||||
}
|
||||
|
@ -7,7 +7,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>618</width>
|
||||
<height>217</height>
|
||||
<height>108</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="GxsCircleItemGLayout">
|
||||
@ -133,29 +133,86 @@
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="titleLabel">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>75</weight>
|
||||
<italic>true</italic>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string notr="true">Circle msg</string>
|
||||
</property>
|
||||
</widget>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="iconLabel">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>TextLabel</string>
|
||||
</property>
|
||||
<property name="scaledContents">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="GxsIdLabel" name="gxsIdLabel">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>10</pointsize>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string notr="true">name</string>
|
||||
</property>
|
||||
<property name="openExternalLinks">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="titleLabel">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>75</weight>
|
||||
<italic>true</italic>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string notr="true">Circle msg</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>358</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="nameHLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>10</pointsize>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Circle name:</string>
|
||||
</property>
|
||||
@ -186,56 +243,6 @@
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="forLabel">
|
||||
<property name="text">
|
||||
<string>Identity:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="iconLabel">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>TextLabel</string>
|
||||
</property>
|
||||
<property name="scaledContents">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="GxsIdLabel" name="gxsIdLabel">
|
||||
<property name="text">
|
||||
<string notr="true">name</string>
|
||||
</property>
|
||||
<property name="openExternalLinks">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>358</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
|
@ -118,6 +118,9 @@ void GxsForumMsgItem::setup()
|
||||
|
||||
ui->subjectLabel->setMinimumWidth(20);
|
||||
|
||||
// hide unsubscribe button not necessary
|
||||
ui->unsubscribeButton->hide();
|
||||
|
||||
ui->expandFrame->hide();
|
||||
ui->parentFrame->hide();
|
||||
}
|
||||
|
@ -313,7 +313,11 @@ void GxsCommentTreeWidget::setCurrentCommentMsgId(QTreeWidgetItem *current, QTre
|
||||
mCurrentCommentText = current->text(PCITEM_COLUMN_COMMENT);
|
||||
mCurrentCommentAuthor = current->text(PCITEM_COLUMN_AUTHOR);
|
||||
mCurrentCommentAuthorId = RsGxsId(current->text(PCITEM_COLUMN_AUTHORID).toStdString());
|
||||
|
||||
} else {
|
||||
mCurrentCommentMsgId.clear();
|
||||
mCurrentCommentText.clear();
|
||||
mCurrentCommentAuthor.clear();
|
||||
mCurrentCommentAuthorId.clear();
|
||||
}
|
||||
}
|
||||
|
||||
@ -323,19 +327,22 @@ void GxsCommentTreeWidget::customPopUpMenu(const QPoint& point)
|
||||
|
||||
QMenu contextMnu( this );
|
||||
QAction* action = contextMnu.addAction(FilesDefs::getIconFromQtResourcePath(IMAGE_REPLY), tr("Reply to Comment"), this, SLOT(replyToComment()));
|
||||
action->setDisabled(mCurrentCommentMsgId.isNull());
|
||||
action->setDisabled(!item || mCurrentCommentMsgId.isNull());
|
||||
|
||||
action = contextMnu.addAction(FilesDefs::getIconFromQtResourcePath(IMAGE_MESSAGE), tr("Submit Comment"), this, SLOT(makeComment()));
|
||||
action->setDisabled(mMsgVersions.empty());
|
||||
|
||||
action = contextMnu.addAction(FilesDefs::getIconFromQtResourcePath(IMAGE_COPY), tr("Copy Comment"), this, SLOT(copyComment()));
|
||||
action->setData( item->data(PCITEM_COLUMN_COMMENT,Qt::DisplayRole) );
|
||||
action->setDisabled(mCurrentCommentMsgId.isNull());
|
||||
action->setData( item ? item->data(PCITEM_COLUMN_COMMENT,Qt::DisplayRole) : "" );
|
||||
action->setDisabled(!item || mCurrentCommentMsgId.isNull());
|
||||
|
||||
contextMnu.addSeparator();
|
||||
|
||||
action = contextMnu.addAction(FilesDefs::getIconFromQtResourcePath(IMAGE_VOTEUP), tr("Vote Up"), this, SLOT(voteUp()));
|
||||
action->setDisabled(mVoterId.isNull());
|
||||
action->setDisabled(!item || mCurrentCommentMsgId.isNull() || mVoterId.isNull());
|
||||
|
||||
action = contextMnu.addAction(FilesDefs::getIconFromQtResourcePath(IMAGE_VOTEDOWN), tr("Vote Down"), this, SLOT(voteDown()));
|
||||
action->setDisabled(mVoterId.isNull());
|
||||
action->setDisabled(!item || mCurrentCommentMsgId.isNull() || mVoterId.isNull());
|
||||
|
||||
|
||||
if (!mCurrentCommentMsgId.isNull())
|
||||
|
@ -75,6 +75,7 @@ CreateGxsChannelMsg::CreateGxsChannelMsg(const RsGxsGroupId &cId, RsGxsMessageId
|
||||
connect(removeAllFilesButton, SIGNAL(clicked() ), this , SLOT(clearAllAttachments()));
|
||||
//connect(addfilepushButton, SIGNAL(clicked() ), this , SLOT(addExtraFile()));
|
||||
connect(subjectEdit,SIGNAL(textChanged(const QString&)),this,SLOT(updatePreviewText(const QString&)));
|
||||
connect(expandButton, SIGNAL(clicked()), this, SLOT( toggle()));
|
||||
|
||||
connect(addThumbnailButton, SIGNAL(clicked() ), this , SLOT(addThumbnail()));
|
||||
connect(thumbNailCb, SIGNAL(toggled(bool)), this, SLOT(allowAutoMediaThumbNail(bool)));
|
||||
@ -86,6 +87,8 @@ CreateGxsChannelMsg::CreateGxsChannelMsg(const RsGxsGroupId &cId, RsGxsMessageId
|
||||
channelpostButton->setIcon(FilesDefs::getIconFromQtResourcePath(":/icons/png/comment.png"));
|
||||
attachmentsButton->setIcon(FilesDefs::getIconFromQtResourcePath(":/icons/png/attachements.png"));
|
||||
addThumbnailButton->setIcon(FilesDefs::getIconFromQtResourcePath(":/icons/png/add-image.png"));
|
||||
expandButton->setIcon(FilesDefs::getIconFromQtResourcePath(QString(":/icons/png/up-arrow.png")));
|
||||
removeButton->setIcon(FilesDefs::getIconFromQtResourcePath(QString(":/icons/mail/delete.png")));
|
||||
|
||||
aspectRatio_CB->setItemIcon(0,FilesDefs::getIconFromQtResourcePath(":/icons/svg/ratio-auto.svg"));
|
||||
aspectRatio_CB->setItemIcon(1,FilesDefs::getIconFromQtResourcePath(":/icons/svg/ratio-1-1.svg"));
|
||||
@ -114,6 +117,8 @@ CreateGxsChannelMsg::CreateGxsChannelMsg(const RsGxsGroupId &cId, RsGxsMessageId
|
||||
generateSpinBox->hide();
|
||||
#endif
|
||||
|
||||
removeButton->hide();
|
||||
|
||||
/* load settings */
|
||||
processSettings(true);
|
||||
}
|
||||
@ -824,8 +829,8 @@ void CreateGxsChannelMsg::addThumbnail()
|
||||
picture = img;
|
||||
|
||||
// to show the selected
|
||||
preview_W->setPixmap(picture, aspectRatio_CB->currentIndex()==0);
|
||||
|
||||
preview_W->setPixmap(picture, aspectRatio_CB->currentIndex()==0);
|
||||
removeButton->show();
|
||||
}
|
||||
|
||||
void CreateGxsChannelMsg::loadOriginalChannelPostInfo()
|
||||
@ -869,7 +874,8 @@ void CreateGxsChannelMsg::loadOriginalChannelPostInfo()
|
||||
if(post.mThumbnail.mData != NULL)
|
||||
{
|
||||
GxsIdDetails::loadPixmapFromData(post.mThumbnail.mData,post.mThumbnail.mSize,picture,GxsIdDetails::ORIGINAL);
|
||||
preview_W->setPixmap(picture,true);
|
||||
preview_W->setPixmap(picture,true);
|
||||
removeButton->show();
|
||||
}
|
||||
|
||||
|
||||
@ -926,3 +932,28 @@ void CreateGxsChannelMsg::on_attachmentsButton_clicked()
|
||||
{
|
||||
stackedWidget->setCurrentIndex(1);
|
||||
}
|
||||
|
||||
void CreateGxsChannelMsg::toggle()
|
||||
{
|
||||
if (expandButton->isChecked())
|
||||
{
|
||||
thumbnailFrame->hide();
|
||||
gridLayoutTextEdit->setContentsMargins(0,9,0,0);
|
||||
expandButton->setIcon(FilesDefs::getIconFromQtResourcePath(QString(":/icons/png/down-arrow.png")));
|
||||
expandButton->setToolTip(tr("Show"));
|
||||
}
|
||||
else
|
||||
{
|
||||
thumbnailFrame->show();
|
||||
gridLayoutTextEdit->setContentsMargins(0,0,0,0);
|
||||
expandButton->setIcon(FilesDefs::getIconFromQtResourcePath(QString(":/icons/png/up-arrow.png")));
|
||||
expandButton->setToolTip(tr("Hide"));
|
||||
}
|
||||
}
|
||||
|
||||
void CreateGxsChannelMsg::on_removeButton_clicked()
|
||||
{
|
||||
preview_W->setPixmap(FilesDefs::getPixmapFromQtResourcePath(ChannelPostThumbnailView::CHAN_DEFAULT_IMAGE),true);
|
||||
removeButton->hide();
|
||||
}
|
||||
|
||||
|
@ -57,6 +57,7 @@ protected:
|
||||
virtual void dropEvent(QDropEvent *event);
|
||||
|
||||
private slots:
|
||||
void toggle() ;
|
||||
void addExtraFile();
|
||||
void checkAttachmentReady();
|
||||
void deleteAttachment();
|
||||
@ -74,6 +75,7 @@ private slots:
|
||||
|
||||
void on_channelpostButton_clicked();
|
||||
void on_attachmentsButton_clicked();
|
||||
void on_removeButton_clicked();
|
||||
private:
|
||||
void processSettings(bool load);
|
||||
void loadChannelInfo();
|
||||
|
@ -57,10 +57,16 @@
|
||||
<property name="verticalSpacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item row="0" column="1">
|
||||
<widget class="QPushButton" name="attachmentsButton">
|
||||
<item row="0" column="0">
|
||||
<widget class="QPushButton" name="channelpostButton">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Attachments</string>
|
||||
<string>Channel Post</string>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
@ -70,7 +76,58 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0" colspan="3">
|
||||
<item row="2" column="0" colspan="4">
|
||||
<layout class="QHBoxLayout" name="buttonHLayout">
|
||||
<property name="spacing">
|
||||
<number>9</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="generateCheckBox">
|
||||
<property name="text">
|
||||
<string>Generate mass data</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSpinBox" name="generateSpinBox">
|
||||
<property name="minimum">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>999</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="postButton">
|
||||
<property name="text">
|
||||
<string>Post</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="cancelButton">
|
||||
<property name="text">
|
||||
<string>Cancel</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="0" colspan="4">
|
||||
<widget class="QStackedWidget" name="stackedWidget">
|
||||
<property name="mouseTracking">
|
||||
<bool>true</bool>
|
||||
@ -85,192 +142,250 @@
|
||||
<number>0</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="stackedWidgetPage1">
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<layout class="QGridLayout" name="gridLayout_5">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item row="0" column="0" rowspan="4">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<widget class="ChannelPostThumbnailView" name="preview_W" native="true">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>1</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<layout class="QHBoxLayout" name="channelNameHLayout">
|
||||
<property name="topMargin">
|
||||
<number>6</number>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QFrame" name="thumbnailFrame">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="channelNameLabel">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Channel Post to:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="channelName">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLabel" name="channelAttachLabel">
|
||||
<property name="text">
|
||||
<string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Plain</enum>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
<property name="leftMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>9</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item row="2" column="1">
|
||||
<widget class="QLabel" name="channelAttachLabel">
|
||||
<property name="text">
|
||||
<string><!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:'Ubuntu'; font-size:11pt; 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:'MS Shell Dlg 2'; font-size:10pt; font-weight:600;">Attachments:</span></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><img src=":/images/feedback_arrow.png" /><span style=" font-family:'MS Shell Dlg 2'; font-size:8pt;"> Use Drag and Drop / Add Files button, to Hash new files.</span></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><img src=":/images/feedback_arrow.png" /><span style=" font-family:'MS Shell Dlg 2'; font-size:8pt;"> Copy/Paste RetroShare links from your shares</span></p></body></html></string>
|
||||
</property>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QPushButton" name="addThumbnailButton">
|
||||
<property name="text">
|
||||
<string>Add Channel Thumbnail</string>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>24</width>
|
||||
<height>24</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="aspectRatio_CB">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Choose aspect ratio policy. In 'Auto' mode, the most suitable aspect ratio is chosen for you.</p></body></html></string>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>24</width>
|
||||
<height>24</height>
|
||||
</size>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Auto</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>1:1</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>3:4</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>16:9</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="removeButton">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Remove Thumbnail</p></body></html></string>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>24</width>
|
||||
<height>24</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Expanding</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<layout class="QHBoxLayout" name="channelNameHLayout">
|
||||
<property name="spacing">
|
||||
<number>9</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="channelNameLabel">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Channel Post to:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="channelName">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="0" column="0" rowspan="4">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="ChannelPostThumbnailView" name="preview_W" native="true">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>1</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QPushButton" name="addThumbnailButton">
|
||||
<property name="text">
|
||||
<string>Add Channel Thumbnail</string>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>24</width>
|
||||
<height>24</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="aspectRatio_CB">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Choose aspect ratio policy. In 'Auto' mode, the most suitable aspect ratio is chosen for you.</p></body></html></string>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>24</width>
|
||||
<height>24</height>
|
||||
</size>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Auto</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>1:1</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>3:4</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>16:9</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Expanding</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<item row="1" column="0">
|
||||
<layout class="QGridLayout" name="gridLayoutTextEdit">
|
||||
<property name="topMargin">
|
||||
<number>9</number>
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLineEdit" name="subjectEdit">
|
||||
<property name="placeholderText">
|
||||
<string>Title</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
<item row="0" column="1">
|
||||
<widget class="QToolButton" name="expandButton">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Hide</p></body></html></string>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</spacer>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0" colspan="2">
|
||||
<widget class="RichTextEdit" name="RichTextEditWidget" native="true">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="4" column="0" colspan="2">
|
||||
<widget class="RichTextEdit" name="RichTextEditWidget" native="true">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="stackedWidgetPage2">
|
||||
@ -344,7 +459,7 @@ p, li { white-space: pre-wrap; }
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Add File</p></body></html></string>
|
||||
<string><html><head/><body><p>Remove File</p></body></html></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
@ -393,7 +508,7 @@ p, li { white-space: pre-wrap; }
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>827</width>
|
||||
<width>63</width>
|
||||
<height>24</height>
|
||||
</rect>
|
||||
</property>
|
||||
@ -444,23 +559,16 @@ p, li { white-space: pre-wrap; }
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
<item row="0" column="1">
|
||||
<widget class="QPushButton" name="attachmentsButton">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>486</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QPushButton" name="channelpostButton">
|
||||
<property name="text">
|
||||
<string>Channel Post</string>
|
||||
<string>Attachments</string>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
@ -470,56 +578,18 @@ p, li { white-space: pre-wrap; }
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0" colspan="3">
|
||||
<layout class="QHBoxLayout" name="buttonHLayout">
|
||||
<property name="spacing">
|
||||
<number>9</number>
|
||||
<item row="0" column="2">
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="generateCheckBox">
|
||||
<property name="text">
|
||||
<string>Generate mass data</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSpinBox" name="generateSpinBox">
|
||||
<property name="minimum">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>999</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="postButton">
|
||||
<property name="text">
|
||||
<string>Post</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="cancelButton">
|
||||
<property name="text">
|
||||
<string>Cancel</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
|
@ -908,6 +908,7 @@ void GxsForumThreadWidget::changedThread(QModelIndex index)
|
||||
return;
|
||||
|
||||
mThreadId = mOrigThreadId = new_id;
|
||||
mLastSelectedPosts[groupId()] = new_id;
|
||||
|
||||
#ifdef DEBUG_FORUMS
|
||||
std::cerr << "Switched to new thread ID " << mThreadId << std::endl;
|
||||
@ -1492,22 +1493,25 @@ void GxsForumThreadWidget::expandSubtree() {
|
||||
|
||||
bool GxsForumThreadWidget::navigate(const RsGxsMessageId &msgId)
|
||||
{
|
||||
QModelIndex source_index = mThreadModel->getIndexOfMessage(msgId);
|
||||
QModelIndex source_index = mThreadModel->getIndexOfMessage(msgId);
|
||||
|
||||
if(!source_index.isValid())
|
||||
{
|
||||
std::cerr << "(EE) Cannot navigate to msg " << msgId << " in forum " << mForumGroup.mMeta.mGroupId << ": index unknown. Setting mNavigatePendingMsgId." << std::endl;
|
||||
if(!source_index.isValid())
|
||||
{
|
||||
std::cerr << "(EE) Cannot navigate to msg " << msgId << " in forum " << mForumGroup.mMeta.mGroupId << ": index unknown. Setting mNavigatePendingMsgId." << std::endl;
|
||||
|
||||
mNavigatePendingMsgId = msgId; // not found. That means the forum may not be loaded yet. So we keep that post in mind, for after loading.
|
||||
return true; // we have to return true here, otherwise the caller will intepret the async loading as an error.
|
||||
}
|
||||
mNavigatePendingMsgId = msgId; // not found. That means the forum may not be loaded yet. So we keep that post in mind, for after loading.
|
||||
return true; // we have to return true here, otherwise the caller will intepret the async loading as an error.
|
||||
}
|
||||
|
||||
QModelIndex indx = mThreadProxyModel->mapFromSource(source_index);
|
||||
QModelIndex indx = mThreadProxyModel->mapFromSource(source_index);
|
||||
|
||||
ui->threadTreeWidget->setCurrentIndex(indx);
|
||||
ui->threadTreeWidget->scrollTo(ui->threadTreeWidget->currentIndex());//May change if model reloaded
|
||||
ui->threadTreeWidget->setFocus();
|
||||
return true;
|
||||
ui->threadTreeWidget->selectionModel()->setCurrentIndex(indx,QItemSelectionModel::ClearAndSelect);
|
||||
ui->threadTreeWidget->scrollTo(ui->threadTreeWidget->currentIndex());//May change if model reloaded
|
||||
ui->threadTreeWidget->setFocus();
|
||||
|
||||
mNavigatePendingMsgId.clear();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void GxsForumThreadWidget::copyMessageLink()
|
||||
@ -1797,22 +1801,33 @@ void GxsForumThreadWidget::saveImage()
|
||||
|
||||
void GxsForumThreadWidget::changedViewBox()
|
||||
{
|
||||
ui->threadTreeWidget->selectionModel()->clear();
|
||||
ui->threadTreeWidget->selectionModel()->reset();
|
||||
mThreadId.clear();
|
||||
ui->threadTreeWidget->selectionModel()->clear();
|
||||
ui->threadTreeWidget->selectionModel()->reset();
|
||||
mThreadId.clear();
|
||||
|
||||
// save index
|
||||
Settings->setValueToGroup("ForumThreadWidget", "viewBox", ui->viewBox->currentIndex());
|
||||
// save index
|
||||
Settings->setValueToGroup("ForumThreadWidget", "viewBox", ui->viewBox->currentIndex());
|
||||
|
||||
if(ui->viewBox->currentIndex() == VIEW_FLAT)
|
||||
mThreadModel->setTreeMode(RsGxsForumModel::TREE_MODE_FLAT);
|
||||
else
|
||||
mThreadModel->setTreeMode(RsGxsForumModel::TREE_MODE_TREE);
|
||||
if(ui->viewBox->currentIndex() == VIEW_FLAT)
|
||||
mThreadModel->setTreeMode(RsGxsForumModel::TREE_MODE_FLAT);
|
||||
else
|
||||
mThreadModel->setTreeMode(RsGxsForumModel::TREE_MODE_TREE);
|
||||
|
||||
if(ui->viewBox->currentIndex() == VIEW_LAST_POST)
|
||||
mThreadModel->setSortMode(RsGxsForumModel::SORT_MODE_CHILDREN_PUBLISH_TS);
|
||||
else
|
||||
mThreadModel->setSortMode(RsGxsForumModel::SORT_MODE_PUBLISH_TS);
|
||||
if(ui->viewBox->currentIndex() == VIEW_LAST_POST)
|
||||
mThreadModel->setSortMode(RsGxsForumModel::SORT_MODE_CHILDREN_PUBLISH_TS);
|
||||
else
|
||||
mThreadModel->setSortMode(RsGxsForumModel::SORT_MODE_PUBLISH_TS);
|
||||
|
||||
if( (mLastSelectedPosts.count(groupId()) > 0)
|
||||
&& !mLastSelectedPosts[groupId()].isNull()
|
||||
&& mThreadModel->getIndexOfMessage(mLastSelectedPosts[groupId()]).isValid())
|
||||
{
|
||||
QModelIndex source_index = mThreadModel->getIndexOfMessage(mLastSelectedPosts[groupId()]);
|
||||
QModelIndex index = mThreadProxyModel->mapFromSource(source_index);
|
||||
|
||||
ui->threadTreeWidget->selectionModel()->setCurrentIndex(index,QItemSelectionModel::SelectCurrent | QItemSelectionModel::Rows);
|
||||
ui->threadTreeWidget->scrollTo(ui->threadTreeWidget->currentIndex());//May change if model reloaded
|
||||
}
|
||||
}
|
||||
|
||||
void GxsForumThreadWidget::filterColumnChanged(int column)
|
||||
@ -1868,67 +1883,72 @@ void GxsForumThreadWidget::filterItems(const QString& text)
|
||||
|
||||
void GxsForumThreadWidget::postForumLoading()
|
||||
{
|
||||
if(groupId().isNull())
|
||||
{
|
||||
ui->nextUnreadButton->setEnabled(false);
|
||||
return;
|
||||
}
|
||||
if(groupId().isNull())
|
||||
{
|
||||
ui->nextUnreadButton->setEnabled(false);
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef DEBUG_FORUMS
|
||||
std::cerr << "Post forum loading..." << std::endl;
|
||||
std::cerr << "Post forum loading..." << std::endl;
|
||||
#endif
|
||||
if(!mNavigatePendingMsgId.isNull() && mThreadModel->getIndexOfMessage(mNavigatePendingMsgId).isValid())
|
||||
{
|
||||
|
||||
if (!mNavigatePendingMsgId.isNull())
|
||||
navigate(mNavigatePendingMsgId);
|
||||
|
||||
else if( (mLastSelectedPosts.count(groupId()) > 0)
|
||||
&& !mLastSelectedPosts[groupId()].isNull()
|
||||
&& mThreadModel->getIndexOfMessage(mLastSelectedPosts[groupId()]).isValid())
|
||||
{
|
||||
#ifdef DEBUG_FORUMS
|
||||
std::cerr << "Pending msg navigation: " << mNavigatePendingMsgId << ". Using it as new thread Id" << std::endl;
|
||||
std::cerr << "Last selected msg navigation: " << mLastSelectedPosts[groupId()].toStdString() << ". Using it as new thread Id" << std::endl;
|
||||
#endif
|
||||
|
||||
QModelIndex source_index = mThreadModel->getIndexOfMessage(mNavigatePendingMsgId);
|
||||
QModelIndex index = mThreadProxyModel->mapFromSource(source_index);
|
||||
QModelIndex source_index = mThreadModel->getIndexOfMessage(mLastSelectedPosts[groupId()]);
|
||||
QModelIndex index = mThreadProxyModel->mapFromSource(source_index);
|
||||
|
||||
ui->threadTreeWidget->selectionModel()->setCurrentIndex(index,QItemSelectionModel::SelectCurrent | QItemSelectionModel::Rows);
|
||||
ui->threadTreeWidget->scrollTo(ui->threadTreeWidget->currentIndex());//May change if model reloaded
|
||||
ui->threadTreeWidget->selectionModel()->setCurrentIndex(index,QItemSelectionModel::SelectCurrent | QItemSelectionModel::Rows);
|
||||
ui->threadTreeWidget->scrollTo(ui->threadTreeWidget->currentIndex());//May change if model reloaded
|
||||
|
||||
mNavigatePendingMsgId.clear();
|
||||
}
|
||||
else
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
QModelIndex source_index = mThreadModel->getIndexOfMessage(mThreadId);
|
||||
QModelIndex source_index = mThreadModel->getIndexOfMessage(mThreadId);
|
||||
|
||||
if(!mThreadId.isNull() && source_index.isValid())
|
||||
{
|
||||
QModelIndex index = mThreadProxyModel->mapFromSource(source_index);
|
||||
ui->threadTreeWidget->selectionModel()->setCurrentIndex(index,QItemSelectionModel::SelectCurrent | QItemSelectionModel::Rows);
|
||||
ui->threadTreeWidget->scrollTo(ui->threadTreeWidget->currentIndex());//May change if model reloaded
|
||||
if(!mThreadId.isNull() && source_index.isValid())
|
||||
{
|
||||
QModelIndex index = mThreadProxyModel->mapFromSource(source_index);
|
||||
ui->threadTreeWidget->selectionModel()->setCurrentIndex(index,QItemSelectionModel::SelectCurrent | QItemSelectionModel::Rows);
|
||||
ui->threadTreeWidget->scrollTo(ui->threadTreeWidget->currentIndex());//May change if model reloaded
|
||||
#ifdef DEBUG_FORUMS
|
||||
std::cerr << " re-selecting index of message " << mThreadId << " to " << source_index.row() << "," << source_index.column() << " " << (void*)source_index.internalPointer() << std::endl;
|
||||
std::cerr << " re-selecting index of message " << mThreadId << " to " << source_index.row() << "," << source_index.column() << " " << (void*)source_index.internalPointer() << std::endl;
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef DEBUG_FORUMS
|
||||
std::cerr << " previously message " << mThreadId << " not visible anymore -> de-selecting" << std::endl;
|
||||
std::cerr << " previously message " << mThreadId << " not visible anymore -> de-selecting" << std::endl;
|
||||
#endif
|
||||
ui->threadTreeWidget->selectionModel()->clear();
|
||||
ui->threadTreeWidget->selectionModel()->reset();
|
||||
mThreadId.clear();
|
||||
//blank();
|
||||
}
|
||||
// we also need to restore expanded threads
|
||||
}
|
||||
ui->threadTreeWidget->selectionModel()->clear();
|
||||
ui->threadTreeWidget->selectionModel()->reset();
|
||||
mThreadId.clear();
|
||||
//blank();
|
||||
}
|
||||
// we also need to restore expanded threads
|
||||
}
|
||||
|
||||
ui->newthreadButton->show();
|
||||
ui->forumName->setText(QString::fromUtf8(mForumGroup.mMeta.mGroupName.c_str()));
|
||||
ui->threadTreeWidget->sortByColumn(RsGxsForumModel::COLUMN_THREAD_DATE, Qt::DescendingOrder);
|
||||
ui->threadTreeWidget->update();
|
||||
ui->viewBox->setEnabled(true);
|
||||
ui->filterLineEdit->setEnabled(true);
|
||||
ui->newthreadButton->show();
|
||||
ui->forumName->setText(QString::fromUtf8(mForumGroup.mMeta.mGroupName.c_str()));
|
||||
ui->threadTreeWidget->sortByColumn(RsGxsForumModel::COLUMN_THREAD_DATE, Qt::DescendingOrder);
|
||||
ui->threadTreeWidget->update();
|
||||
ui->viewBox->setEnabled(true);
|
||||
ui->filterLineEdit->setEnabled(true);
|
||||
|
||||
recursRestoreExpandedItems(mThreadProxyModel->mapFromSource(mThreadModel->root()),mSavedExpandedMessages);
|
||||
//mUpdating = false;
|
||||
recursRestoreExpandedItems(mThreadProxyModel->mapFromSource(mThreadModel->root()),mSavedExpandedMessages);
|
||||
//mUpdating = false;
|
||||
|
||||
ui->nextUnreadButton->setEnabled(true);
|
||||
ui->nextUnreadButton->setEnabled(true);
|
||||
}
|
||||
|
||||
void GxsForumThreadWidget::updateGroupData()
|
||||
|
@ -224,6 +224,7 @@ private:
|
||||
QColor mBackgroundColorPinned;
|
||||
QColor mBackgroundColorFiltered;
|
||||
|
||||
std::map<RsGxsGroupId,RsGxsMessageId> mLastSelectedPosts;
|
||||
RsGxsMessageId mNavigatePendingMsgId;
|
||||
QList<RsGxsMessageId> mIgnoredMsgId;
|
||||
|
||||
|
@ -169,7 +169,7 @@ ShareManager QPushButton#closeButton {
|
||||
padding-right: 6px;
|
||||
}
|
||||
|
||||
ShareManager QPushButton#addButton {
|
||||
ShareManager QPushButton#addButton{
|
||||
font: bold;
|
||||
font-size: 15px;
|
||||
color: white;
|
||||
@ -180,7 +180,25 @@ ShareManager QPushButton#addButton {
|
||||
padding: 4px;
|
||||
}
|
||||
|
||||
ShareManager QPushButton#addButton:hover {
|
||||
ShareManager QPushButton#addButton:hover{
|
||||
background: #5AD75A;
|
||||
border-radius: 4px;
|
||||
min-width: 4em;
|
||||
padding: 4px;
|
||||
}
|
||||
|
||||
SearchDialog QPushButton#pushButtonSearch {
|
||||
font: bold;
|
||||
font-size: 15px;
|
||||
color: white;
|
||||
background: #32CD32;
|
||||
border-radius: 4px;
|
||||
max-height: 25px;
|
||||
min-width: 4em;
|
||||
padding: 4px;
|
||||
}
|
||||
|
||||
SearchDialog QPushButton#pushButtonSearch:hover{
|
||||
background: #5AD75A;
|
||||
border-radius: 4px;
|
||||
min-width: 4em;
|
||||
@ -433,21 +451,28 @@ ChanNewItem QLabel#logoLabel {
|
||||
}
|
||||
|
||||
GxsChannelPostItem > QFrame#mainFrame[new=false] {
|
||||
border: 3px solid #D3D3D3;
|
||||
background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #FFFFFF, stop:1 #F2F2F2);
|
||||
border-radius: 10px;
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
GxsChannelPostItem > QFrame#mainFrame[new=true] {
|
||||
border: 3px solid #82B9F4;
|
||||
background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #F0F8FD, stop:0.8 #E6F2FD, stop: 0.81 #E6F2FD, stop: 1 #D2E7FD);
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
GxsChannelPostItem QLabel#newLabel {
|
||||
GxsChannelPostItem QLabel#newLabel{
|
||||
border: 1px solid #167BE7;
|
||||
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #2291E0, stop: 1 #3EB3FF);
|
||||
border-radius: 3px;
|
||||
color: white;
|
||||
}
|
||||
|
||||
GxsChannelPostItem QLabel#subjectLabel, GxsChannelPostItem QLabel#titleLabel {
|
||||
font: 11pt;
|
||||
font: bold italic;
|
||||
}
|
||||
|
||||
GxsChannelPostItem QFrame#msgFrame {
|
||||
border: 2px solid #82B9F4;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
GxsChannelPostItem QLabel#logoLabel {
|
||||
@ -458,6 +483,15 @@ GxsChannelPostItem QLabel#logoLabel {
|
||||
background-color: black;
|
||||
}
|
||||
|
||||
GxsCircleItem QFrame#frame {
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
GxsCircleItem QLabel#nameLabel, QLabel#titleLabel {
|
||||
font: 11pt;
|
||||
font: bold italic;
|
||||
}
|
||||
|
||||
ForumNewItem > QFrame#frame, ForumMsgItem > QFrame#frame {
|
||||
border: 2px solid #CCCCCC;
|
||||
background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #EEEEEE, stop: 1 #CCCCCC);
|
||||
|
@ -27,6 +27,7 @@
|
||||
#include <retroshare/rsmsgs.h>
|
||||
#include <retroshare/rspeers.h>
|
||||
#include "ChatPage.h"
|
||||
#include "gui/MainWindow.h"
|
||||
#include <gui/RetroShareLink.h>
|
||||
#include "gui/chat/ChatDialog.h"
|
||||
#include "gui/notifyqt.h"
|
||||
@ -224,7 +225,14 @@ ChatPage::ChatPage(QWidget * parent, Qt::WindowFlags flags)
|
||||
ui.minimumContrastLabel->hide();
|
||||
ui.minimumContrast->hide();
|
||||
#endif
|
||||
connect(ui.distantChatComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(distantChatComboBoxChanged(int)));
|
||||
connect(ui.chatLobbies_CountFollowingText, SIGNAL(toggled(bool)),ui.chatLobbies_TextToNotify,SLOT(setEnabled(bool)));
|
||||
connect(ui.chatLobbies_CountUnRead, SIGNAL(toggled(bool)),this, SLOT(updateChatLobbyUserNotify())) ;
|
||||
connect(ui.chatLobbies_CheckNickName, SIGNAL(toggled(bool)),this, SLOT(updateChatLobbyUserNotify())) ;
|
||||
connect(ui.chatLobbies_CountFollowingText, SIGNAL(toggled(bool)),this, SLOT(updateChatLobbyUserNotify())) ;
|
||||
connect(ui.chatLobbies_TextToNotify, SIGNAL(textChanged(QString)),this, SLOT(updateChatLobbyUserNotify()));
|
||||
connect(ui.chatLobbies_TextCaseSensitive, SIGNAL(toggled(bool)),this, SLOT(updateChatLobbyUserNotify())) ;
|
||||
|
||||
connect(ui.distantChatComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(distantChatComboBoxChanged(int)));
|
||||
|
||||
connect(ui.checkBox_emoteprivchat, SIGNAL(toggled(bool)), this, SLOT(updateFontsAndEmotes()));
|
||||
connect(ui.checkBox_emotegroupchat, SIGNAL(toggled(bool)), this, SLOT(updateFontsAndEmotes()));
|
||||
@ -286,7 +294,40 @@ ChatPage::ChatPage(QWidget * parent, Qt::WindowFlags flags)
|
||||
connect(ui.publicStyle, SIGNAL(currentIndexChanged(int)), this,SLOT(on_publicList_currentRowChanged(int)));
|
||||
connect(ui.privateStyle, SIGNAL(currentIndexChanged(int)), this,SLOT(on_privateList_currentRowChanged(int)));
|
||||
connect(ui.historyStyle, SIGNAL(currentIndexChanged(int)), this,SLOT(on_historyList_currentRowChanged(int)));
|
||||
|
||||
/* Add user notify */
|
||||
const QList<UserNotify*> &userNotifyList = MainWindow::getInstance()->getUserNotifyList() ;
|
||||
QList<UserNotify*>::const_iterator it;
|
||||
|
||||
mChatLobbyUserNotify = nullptr;
|
||||
|
||||
for (it = userNotifyList.begin(); it != userNotifyList.end(); ++it)
|
||||
{
|
||||
UserNotify *userNotify = *it;
|
||||
|
||||
//To get ChatLobbyUserNotify Settings
|
||||
|
||||
if(!mChatLobbyUserNotify)
|
||||
mChatLobbyUserNotify = dynamic_cast<ChatLobbyUserNotify*>(*it);
|
||||
}
|
||||
|
||||
// hide the broadcast page: it only shows "show/hide emoticons, which is really not much for an entire page
|
||||
ui.tabWidget->removeTab(3);
|
||||
}
|
||||
|
||||
void ChatPage::updateChatLobbyUserNotify()
|
||||
{
|
||||
if(!mChatLobbyUserNotify)
|
||||
return ;
|
||||
|
||||
mChatLobbyUserNotify->setCountUnRead(ui.chatLobbies_CountUnRead->isChecked()) ;
|
||||
mChatLobbyUserNotify->setCheckForNickName(ui.chatLobbies_CheckNickName->isChecked()) ;
|
||||
mChatLobbyUserNotify->setCountSpecificText(ui.chatLobbies_CountFollowingText->isChecked()) ;
|
||||
mChatLobbyUserNotify->setTextToNotify(ui.chatLobbies_TextToNotify->document()->toPlainText());
|
||||
mChatLobbyUserNotify->setTextCaseSensitive(ui.chatLobbies_TextCaseSensitive->isChecked());
|
||||
}
|
||||
|
||||
|
||||
void ChatPage::updateChatFlags()
|
||||
{
|
||||
uint chatflags = 0;
|
||||
@ -423,6 +464,15 @@ ChatPage::load()
|
||||
ui._collected_contacts_LW->insertItem(0,item) ;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (mChatLobbyUserNotify){
|
||||
whileBlocking(ui.chatLobbies_CountUnRead)->setChecked(mChatLobbyUserNotify->isCountUnRead());
|
||||
whileBlocking(ui.chatLobbies_CheckNickName)->setChecked(mChatLobbyUserNotify->isCheckForNickName());
|
||||
whileBlocking(ui.chatLobbies_CountFollowingText)->setChecked(mChatLobbyUserNotify->isCountSpecificText()) ;
|
||||
whileBlocking(ui.chatLobbies_TextToNotify)->setEnabled(mChatLobbyUserNotify->isCountSpecificText()) ;
|
||||
whileBlocking(ui.chatLobbies_TextToNotify)->setPlainText(mChatLobbyUserNotify->textToNotify());
|
||||
whileBlocking(ui.chatLobbies_TextCaseSensitive)->setChecked(mChatLobbyUserNotify->isTextCaseSensitive());
|
||||
}
|
||||
}
|
||||
|
||||
void ChatPage::on_pushButtonChangeChatFont_clicked()
|
||||
|
@ -23,6 +23,7 @@
|
||||
|
||||
#include "retroshare-gui/configpage.h"
|
||||
#include "gui/chat/ChatStyle.h"
|
||||
#include "gui/chat/ChatLobbyUserNotify.h"
|
||||
#include "ui_ChatPage.h"
|
||||
#include "gui/common/FilesDefs.h"
|
||||
|
||||
@ -44,6 +45,7 @@ class ChatPage : public ConfigPage
|
||||
virtual QString helpText() const { return ""; }
|
||||
|
||||
private slots:
|
||||
void updateChatLobbyUserNotify();
|
||||
void on_historyComboBoxVariant_currentIndexChanged(int index);
|
||||
void on_privateComboBoxVariant_currentIndexChanged(int index);
|
||||
void on_publicComboBoxVariant_currentIndexChanged(int index);
|
||||
@ -87,6 +89,8 @@ class ChatPage : public ConfigPage
|
||||
|
||||
/** Qt Designer generated object */
|
||||
Ui::ChatPage ui;
|
||||
|
||||
ChatLobbyUserNotify* mChatLobbyUserNotify;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -46,7 +46,6 @@ NotifyPage::NotifyPage(QWidget * parent, Qt::WindowFlags flags)
|
||||
connect(ui.testToasterButton, SIGNAL(clicked()), this, SLOT(testToaster()));
|
||||
connect(ui.pushButtonDisableAll,SIGNAL(toggled(bool)), NotifyQt::getInstance(), SLOT(SetDisableAll(bool)));
|
||||
connect(NotifyQt::getInstance(),SIGNAL(disableAllChanged(bool)), ui.pushButtonDisableAll, SLOT(setChecked(bool)));
|
||||
connect(ui.chatLobbies_CountFollowingText,SIGNAL(toggled(bool)),ui.chatLobbies_TextToNotify,SLOT(setEnabled(bool)));
|
||||
|
||||
ui.notify_Blogs->hide();
|
||||
|
||||
@ -116,41 +115,37 @@ NotifyPage::NotifyPage(QWidget * parent, Qt::WindowFlags flags)
|
||||
|
||||
}
|
||||
|
||||
/* Add user notify */
|
||||
const QList<UserNotify*> &userNotifyList = MainWindow::getInstance()->getUserNotifyList() ;
|
||||
QList<UserNotify*>::const_iterator it;
|
||||
rowFeed = 0;
|
||||
mChatLobbyUserNotify = 0;
|
||||
for (it = userNotifyList.begin(); it != userNotifyList.end(); ++it) {
|
||||
UserNotify *userNotify = *it;
|
||||
/* Add user notify */
|
||||
const QList<UserNotify*> &userNotifyList = MainWindow::getInstance()->getUserNotifyList() ;
|
||||
QList<UserNotify*>::const_iterator it;
|
||||
rowFeed = 0;
|
||||
for (it = userNotifyList.begin(); it != userNotifyList.end(); ++it) {
|
||||
UserNotify *userNotify = *it;
|
||||
|
||||
QString name;
|
||||
if (!userNotify->hasSetting(&name, NULL)) {
|
||||
continue;
|
||||
}
|
||||
QString name;
|
||||
if (!userNotify->hasSetting(&name, NULL)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
QCheckBox *enabledCheckBox = new QCheckBox(name, this);
|
||||
enabledCheckBox->setFont(font);
|
||||
ui.notifyLayout->addWidget(enabledCheckBox, rowFeed, 0, 0);
|
||||
connect(enabledCheckBox, SIGNAL(toggled(bool)), this, SLOT(notifyToggled()));
|
||||
QCheckBox *enabledCheckBox = new QCheckBox(name, this);
|
||||
enabledCheckBox->setFont(font);
|
||||
ui.notifyLayout->addWidget(enabledCheckBox, rowFeed, 0, 0);
|
||||
connect(enabledCheckBox, SIGNAL(toggled(bool)), this, SLOT(notifyToggled()));
|
||||
|
||||
QCheckBox *combinedCheckBox = new QCheckBox(tr("Combined"), this);
|
||||
combinedCheckBox->setFont(font);
|
||||
ui.notifyLayout->addWidget(combinedCheckBox, rowFeed, 1);
|
||||
QCheckBox *combinedCheckBox = new QCheckBox(tr("Combined"), this);
|
||||
combinedCheckBox->setFont(font);
|
||||
ui.notifyLayout->addWidget(combinedCheckBox, rowFeed, 1);
|
||||
|
||||
QCheckBox *blinkCheckBox = new QCheckBox(tr("Blink"), this);
|
||||
blinkCheckBox->setFont(font);
|
||||
ui.notifyLayout->addWidget(blinkCheckBox, rowFeed++, 2);
|
||||
QCheckBox *blinkCheckBox = new QCheckBox(tr("Blink"), this);
|
||||
blinkCheckBox->setFont(font);
|
||||
ui.notifyLayout->addWidget(blinkCheckBox, rowFeed++, 2);
|
||||
|
||||
mUserNotifySettingList.push_back(UserNotifySetting(userNotify, enabledCheckBox, combinedCheckBox, blinkCheckBox));
|
||||
mUserNotifySettingList.push_back(UserNotifySetting(userNotify, enabledCheckBox, combinedCheckBox, blinkCheckBox));
|
||||
|
||||
connect(enabledCheckBox,SIGNAL(toggled(bool)),this,SLOT(updateUserNotifySettings())) ;
|
||||
connect(blinkCheckBox,SIGNAL(toggled(bool)),this,SLOT(updateUserNotifySettings())) ;
|
||||
connect(combinedCheckBox,SIGNAL(toggled(bool)),this,SLOT(updateUserNotifySettings())) ;
|
||||
|
||||
//To get ChatLobbyUserNotify Settings
|
||||
if (!mChatLobbyUserNotify) mChatLobbyUserNotify = dynamic_cast<ChatLobbyUserNotify*>(*it);
|
||||
}
|
||||
connect(enabledCheckBox,SIGNAL(toggled(bool)),this,SLOT(updateUserNotifySettings())) ;
|
||||
connect(blinkCheckBox,SIGNAL(toggled(bool)),this,SLOT(updateUserNotifySettings())) ;
|
||||
connect(combinedCheckBox,SIGNAL(toggled(bool)),this,SLOT(updateUserNotifySettings())) ;
|
||||
}
|
||||
|
||||
connect(ui.popup_Connect, SIGNAL(toggled(bool)), this, SLOT(updateNotifyFlags())) ;
|
||||
connect(ui.popup_NewMsg, SIGNAL(toggled(bool)), this, SLOT(updateNotifyFlags())) ;
|
||||
@ -179,12 +174,6 @@ NotifyPage::NotifyPage(QWidget * parent, Qt::WindowFlags flags)
|
||||
connect(ui.spinBoxToasterYMargin, SIGNAL(valueChanged(int)), this, SLOT(updateToasterMargin()));
|
||||
|
||||
connect(ui.comboBoxToasterPosition, SIGNAL(currentIndexChanged(int)),this, SLOT(updateToasterPosition())) ;
|
||||
|
||||
connect(ui.chatLobbies_CountUnRead, SIGNAL(toggled(bool)),this, SLOT(updateChatLobbyUserNotify())) ;
|
||||
connect(ui.chatLobbies_CheckNickName, SIGNAL(toggled(bool)),this, SLOT(updateChatLobbyUserNotify())) ;
|
||||
connect(ui.chatLobbies_CountFollowingText, SIGNAL(toggled(bool)),this, SLOT(updateChatLobbyUserNotify())) ;
|
||||
connect(ui.chatLobbies_TextToNotify, SIGNAL(textChanged(QString)),this, SLOT(updateChatLobbyUserNotify()));
|
||||
connect(ui.chatLobbies_TextCaseSensitive, SIGNAL(toggled(bool)),this, SLOT(updateChatLobbyUserNotify())) ;
|
||||
}
|
||||
|
||||
NotifyPage::~NotifyPage()
|
||||
@ -299,18 +288,6 @@ void NotifyPage::updateToasterPosition()
|
||||
Settings->setToasterPosition((RshareSettings::enumToasterPosition) ui.comboBoxToasterPosition->itemData(index).toInt());
|
||||
}
|
||||
|
||||
void NotifyPage::updateChatLobbyUserNotify()
|
||||
{
|
||||
if(!mChatLobbyUserNotify)
|
||||
return ;
|
||||
|
||||
mChatLobbyUserNotify->setCountUnRead(ui.chatLobbies_CountUnRead->isChecked()) ;
|
||||
mChatLobbyUserNotify->setCheckForNickName(ui.chatLobbies_CheckNickName->isChecked()) ;
|
||||
mChatLobbyUserNotify->setCountSpecificText(ui.chatLobbies_CountFollowingText->isChecked()) ;
|
||||
mChatLobbyUserNotify->setTextToNotify(ui.chatLobbies_TextToNotify->document()->toPlainText());
|
||||
mChatLobbyUserNotify->setTextCaseSensitive(ui.chatLobbies_TextCaseSensitive->isChecked());
|
||||
}
|
||||
|
||||
/** Loads the settings for this page */
|
||||
void NotifyPage::load()
|
||||
{
|
||||
@ -399,14 +376,6 @@ void NotifyPage::load()
|
||||
|
||||
notifyToggled() ;
|
||||
|
||||
if (mChatLobbyUserNotify){
|
||||
whileBlocking(ui.chatLobbies_CountUnRead)->setChecked(mChatLobbyUserNotify->isCountUnRead());
|
||||
whileBlocking(ui.chatLobbies_CheckNickName)->setChecked(mChatLobbyUserNotify->isCheckForNickName());
|
||||
whileBlocking(ui.chatLobbies_CountFollowingText)->setChecked(mChatLobbyUserNotify->isCountSpecificText()) ;
|
||||
whileBlocking(ui.chatLobbies_TextToNotify)->setEnabled(mChatLobbyUserNotify->isCountSpecificText()) ;
|
||||
whileBlocking(ui.chatLobbies_TextToNotify)->setPlainText(mChatLobbyUserNotify->textToNotify());
|
||||
whileBlocking(ui.chatLobbies_TextCaseSensitive)->setChecked(mChatLobbyUserNotify->isTextCaseSensitive());
|
||||
}
|
||||
}
|
||||
|
||||
void NotifyPage::notifyToggled()
|
||||
|
@ -100,12 +100,10 @@ private slots:
|
||||
void updateToasterMargin();
|
||||
|
||||
void updateToasterPosition();
|
||||
void updateChatLobbyUserNotify();
|
||||
|
||||
private:
|
||||
uint getNewsFlags();
|
||||
uint getNotifyFlags();
|
||||
ChatLobbyUserNotify* mChatLobbyUserNotify;
|
||||
|
||||
QList<FeedNotifySetting> mFeedNotifySettingList;
|
||||
QList<ToasterNotifySetting> mToasterNotifySettingList;
|
||||
|
@ -14,7 +14,7 @@
|
||||
<item>
|
||||
<widget class="QTabWidget" name="tabWidget">
|
||||
<property name="currentIndex">
|
||||
<number>0</number>
|
||||
<number>2</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="tabFeed">
|
||||
<attribute name="title">
|
||||
@ -443,60 +443,6 @@
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tabChatLobbies">
|
||||
<attribute name="title">
|
||||
<string>Chat Rooms</string>
|
||||
</attribute>
|
||||
<layout class="QVBoxLayout" name="tabChatLobbiesVLayout">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="chatLobbies_CountUnRead">
|
||||
<property name="text">
|
||||
<string>Count all unread messages</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="chatLobbies_CheckNickName">
|
||||
<property name="text">
|
||||
<string>Count occurrences of my current identity</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="chatLobbies_CountFollowingText">
|
||||
<property name="text">
|
||||
<string>Count occurrences of any of the following texts (separate by newlines):</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPlainTextEdit" name="chatLobbies_TextToNotify"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="chatLobbies_TextCaseSensitive">
|
||||
<property name="toolTip">
|
||||
<string>Checked, if the identity and the text above occurrences must be in the same case to trigger count.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Case sensitive</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="tabChatLobbiesVSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
@ -527,10 +473,6 @@
|
||||
<tabstop>spinBoxToasterYMargin</tabstop>
|
||||
<tabstop>systray_GroupChat</tabstop>
|
||||
<tabstop>systray_ChatLobby</tabstop>
|
||||
<tabstop>chatLobbies_CountUnRead</tabstop>
|
||||
<tabstop>chatLobbies_CheckNickName</tabstop>
|
||||
<tabstop>chatLobbies_CountFollowingText</tabstop>
|
||||
<tabstop>chatLobbies_TextToNotify</tabstop>
|
||||
<tabstop>pushButtonDisableAll</tabstop>
|
||||
</tabstops>
|
||||
<resources/>
|
||||
|
Loading…
Reference in New Issue
Block a user