Merge remote-tracking branch 'upstream/master' into mutexDivorce

Update mutexDivorce
This commit is contained in:
jolavillette 2020-05-06 11:33:43 +02:00
commit 7634d121de
34 changed files with 764 additions and 714 deletions

View File

@ -8,7 +8,15 @@ Requirements: about 12 GB of free space
The resulting binary is a 32-bit build of Retroshare which will also work The resulting binary is a 32-bit build of Retroshare which will also work
fine on a 64-bit system. fine on a 64-bit system.
### MSYS2 INSTALLATION **If you want to make complet solution without debugging it, prefer to use \build_scripts\Windows-msys2\build.bat**
This batch will install and build all for you.
You only have to clone this repository (with [git for windows](https://gitforwindows.org/)) to a local folder, then start it in a terminal.
At the end, you'll get at ..\\*-msys2\deploy\ the Portable 7zip file.
### MSYS2 INSTALLATION (for editing or debugging)
Download MSYS2 from [MSYS2](http://www.msys2.org/). Get the i686 version Download MSYS2 from [MSYS2](http://www.msys2.org/). Get the i686 version
if you run a 32-bit Windows or the x86_64 if you run a 64-bit Windows. if you run a 32-bit Windows or the x86_64 if you run a 64-bit Windows.
@ -49,6 +57,12 @@ Install all needed dependencies:
pacman -S mingw32/mingw-w64-i686-cmake pacman -S mingw32/mingw-w64-i686-cmake
pacman -S mingw-w64-i686-rapidjson pacman -S mingw-w64-i686-rapidjson
If you want to use QtCreator as IDE, prefer using this one publish by MSYS2 as all build Kit are already setted.
pacman -S mingw-w64-i686-qt-creator
*You can start it from MSYS2 terminal.*
We're done installing MSYS2, close the shell terminal. We're done installing MSYS2, close the shell terminal.
### BUILDING RETROSHARE ### BUILDING RETROSHARE

View File

@ -56,6 +56,69 @@ const int PQISSL_UDP_FLAG = 0x02;
/* TCP buffer size for Windows systems */ /* TCP buffer size for Windows systems */
const int WINDOWS_TCP_BUFFER_SIZE = 512 * 1024; // 512 KB const int WINDOWS_TCP_BUFFER_SIZE = 512 * 1024; // 512 KB
// This is a (very) simple overview of the different state machnines. The tree includes high level funtions only.
//
// connect_parameter() is used to pass down settings, like address or timeout values
//
// tick() or connect()
// |
// +----- ConnectAttempt()
// |
// +--WAITING_NOT or WAITING_DELAY
// | |
// | +----- Delay_Connection()
// | |
// | +--WAITING_NOT
// | | - set 'waiting' to WAITING_DELAY and set delay for next connection attempt
// | |
// | +--WAITING_DELAY
// | |
// | +----- Initiate_Connection()
// | |
// | +----- setup socket
// | +----- connect
// | - on success: set "waiting" to WAITING_SOCK_CONNECT and "sockfd" to newly created socket
// | - on failure: set "waiting" to WAITING_FAIL_INTERFACE
// |
// +--WAITING_SOCK_CONNECT
// | |
// | +----- Initiate_SSL_Connection()
// | |
// | +----- Basic_Connection_Complete()
// | | |
// | | +----- CheckConnectionTimeout()
// | | |
// | | +----- ready up socket.
// | | - SOCKS, udp tou, i2p BOB intercept here
// | | - on failure: set "waiting" to WAITING_FAIL_INTERFACE and "sockfd" to -1
// | |
// | +----- create SSL context and attach file descriptors
// | - on success:_set "waiting" to WAITING_SSL_CONNECTION
// |
// +--WAITING_SSL_CONNECTION or WAITING_SSL_AUTHORISE
// | |
// | +----- Authorise_SSL_Connection()
// | |
// | +----- SSL_Connection_Complete()
// | | |
// | | +----- performes TSL handshake
// | | - on success: set "waiting" to WAITING_SSL_AUTHORISE
// | | - on failure: set "waiting" to WAITING_FAIL_INTERFACE
// | |
// | +----- set "waiting" to WAITING_NOT
// | |
// | +----- accept_locked()
// | - add peer to the rest of RS and start pqi thread
// |
// |
// +--WAITING_FAIL_INTERFACE
// |
// +----- Failed_Connection()
// - set "waiting" to WAITING_NOT
//
/***************************** pqi Net SSL Interface ********************************* /***************************** pqi Net SSL Interface *********************************
* This provides the base SSL interface class, * This provides the base SSL interface class,
* and handles most of the required functionality. * and handles most of the required functionality.
@ -203,9 +266,9 @@ bool CheckConnectionTimeout();
uint32_t mConnectTimeout; uint32_t mConnectTimeout;
rstime_t mTimeoutTS; rstime_t mTimeoutTS;
RS_SET_CONTEXT_DEBUG_LEVEL(1)
private: private:
// ssl only fns. // ssl only fns.
int connectInterface(const struct sockaddr_storage &addr); int connectInterface(const struct sockaddr_storage &addr);
RS_SET_CONTEXT_DEBUG_LEVEL(1)
}; };

View File

@ -34,6 +34,73 @@
#define RS_PQISSL_AUTH_DOUBLE_CHECK 1 #define RS_PQISSL_AUTH_DOUBLE_CHECK 1
// This is a simple overview of how the listener is setup, ticked (calling accept) and peers added to it.
// On the highest level (RsServer) the listener lives inside the pqisslpersongrp class (variable: "pqih").
// Inside pqisslpersongrp the listener is stored in "pqil".
//
// The listener has an internal list with incoming connections that are handled in a similar fashion to pqissl.
// (Mainly setting up the socket (non-blocking) and establisching the ssl handshake.)
// When everything went fine the connection is passed to pqissl in finaliseConnection()
//
// This is how the listener is initialized during start up:
//
// RsServer::StartupRetroShare()
// |
// +----- pqih = new pqisslpersongrp(serviceCtrl, flags, mPeerMgr);
// +----- pqih->init_listener();
// |
// +----- pqil = locked_createListener(laddr);
// |
// +----- return new pqissllistener(laddr, mPeerMgr);
//
//
// This is how the listener is ticked to call accept:
//
// RsServer::StartupRetroShare()
// |
// +----- pqih->tick();
// |
// +----- pqil->tick();
// |
// +----- acceptconnection();
// | |
// | +----- accecpt()
// |
// +----- continueaccepts();
// +----- finaliseAccepts();
// |
// +----- finaliseConnection()
// |
// +----- pqis->accept()
//
//
// This is how peers (their id) are registered to the listener:
// (This is only used to tell if a connection peer is known or a new one (which is then added))
//
// pqipersongrp::addPeer()
// |
// +----- pqiperson *pqip = locked_createPerson(id, pqil);
// | |
// | +----- pqiperson *pqip = new pqiperson(id, this);
// | +----- pqissl *pqis = new pqissl((pqissllistener *) listener, pqip, mLinkMgr);
// | +----- pqiconnect *pqisc = new pqiconnect(pqip, rss, pqis);
// | +----- pqip->addChildInterface(PQI_CONNECT_TCP, pqisc);
// | |
// | +-- sets kids[type] = pqisc;
// |
// +----- pqip->reset();
// +----- pqip->listen();
// |
// +-- for all kids[]
// |
// +----- listen() ( of class pqiconnect )
// |
// +----- listen() ( of class pqissl )
// |
// +----- pqil->addlistenaddr(PeerId(), this);
/***************************** pqi Net SSL Interface ********************************* /***************************** pqi Net SSL Interface *********************************
*/ */

View File

@ -333,6 +333,19 @@ public:
std::vector<RsGxsChannelPost>& posts, std::vector<RsGxsChannelPost>& posts,
std::vector<RsGxsComment>& comments ) = 0; std::vector<RsGxsComment>& comments ) = 0;
/**
* @brief Get channel comments corresponding to the given IDs.
* If the set is empty, nothing is returned.
* @jsonapi{development}
* @param[in] channelId id of the channel of which the content is requested
* @param[in] contentIds ids of requested contents
* @param[out] comments storage for the comments
* @return false if something failed, true otherwhise
*/
virtual bool getChannelComments(const RsGxsGroupId &channelId,
const std::set<RsGxsMessageId> &contentIds,
std::vector<RsGxsComment> &comments) = 0;
/** /**
* @brief Get channel content summaries * @brief Get channel content summaries
* @jsonapi{development} * @jsonapi{development}

View File

@ -41,11 +41,12 @@
#include "services/rseventsservice.h" #include "services/rseventsservice.h"
/**** /*******************
#define DEBUG_TICK 1 #define TICK_DEBUG 1
****/ *******************/
#define WARN_BIG_CYCLE_TIME (0.2) #define WARN_BIG_CYCLE_TIME (0.2)
#ifdef WINDOWS_SYS #ifdef WINDOWS_SYS
#include "util/rstime.h" #include "util/rstime.h"
#include <sys/timeb.h> #include <sys/timeb.h>
@ -73,9 +74,8 @@ static double getCurrentTS()
// In some cases (VOIP) it's likely that we will need to set them temporarily to a very low // In some cases (VOIP) it's likely that we will need to set them temporarily to a very low
// value, in order to favor a fast feedback // value, in order to favor a fast feedback
const double RsServer::minTimeDelta = 0.05; // 25; const double RsServer::minTickInterval = 0.05;
const double RsServer::maxTimeDelta = 0.2; const double RsServer::maxTickInterval = 0.2;
const double RsServer::kickLimit = 0.15;
RsServer::RsServer() : RsServer::RsServer() :
@ -110,19 +110,18 @@ RsServer::RsServer() :
mStatusSrv = NULL; mStatusSrv = NULL;
mGxsTunnels = NULL; mGxsTunnels = NULL;
mMin = 0;
mLoop = 0;
mLastts = getCurrentTS(); mLastts = getCurrentTS();
mLastSec = 0; /* for the slower ticked stuff */ mTickInterval = maxTickInterval ;
mTimeDelta = 0.25 ; mAvgRunDuration = 0;
mLastRunDuration = 0;
mAvgTickRate = mTimeDelta; mCycle1 = 0;
mCycle2 = 0;
mCycle3 = 0;
mCycle4 = 0;
/* caches (that need ticking) */ /* caches (that need ticking) */
/* Config */ /* config */
mConfigMgr = NULL; mConfigMgr = NULL;
mGeneralConfig = NULL; mGeneralConfig = NULL;
} }
@ -132,143 +131,132 @@ RsServer::~RsServer()
delete mGxsTrans; delete mGxsTrans;
} }
/* General Internal Helper Functions // General Internal Helper Functions ----> MUST BE LOCKED!
----> MUST BE LOCKED!
*/
/* Thread Fn: Run the Core */
void RsServer::threadTick() void RsServer::threadTick()
{ {
rstime::rs_usleep(mTimeDelta * 1000000); #ifdef TICK_DEBUG
RsDbg() << "TICK_DEBUG ticking interval "<< mTickInterval << std::endl;
#endif
// we try to tick at a regular interval which depends on the load
// if there is time left, we sleep
double timeToSleep = mTickInterval - mAvgRunDuration;
if (timeToSleep > 0)
{
#ifdef TICK_DEBUG
RsDbg() << "TICK_DEBUG will sleep " << timeToSleep << " ms" << std::endl;
#endif
rstime::rs_usleep(timeToSleep * 1000000);
}
double ts = getCurrentTS(); double ts = getCurrentTS();
double delta = ts - mLastts;
/* for the fast ticked stuff */
if (delta > mTimeDelta)
{
#ifdef DEBUG_TICK
std::cerr << "Delta: " << delta << std::endl;
std::cerr << "Time Delta: " << mTimeDelta << std::endl;
std::cerr << "Avg Tick Rate: " << mAvgTickRate << std::endl;
#endif
mLastts = ts; mLastts = ts;
/******************************** RUN SERVER *****************/ // stuff we do always
// tick the core
#ifdef TICK_DEBUG
RsDbg() << "TICK_DEBUG ticking server" << std::endl;
#endif
lockRsCore(); lockRsCore();
int moreToTick = pqih->tick(); int moreToTick = pqih->tick();
#ifdef DEBUG_TICK
std::cerr << "RsServer::run() ftserver->tick(): moreToTick: " << moreToTick << std::endl;
#endif
unlockRsCore(); unlockRsCore();
// tick the managers
/* tick the Managers */ #ifdef TICK_DEBUG
RsDbg() << "TICK_DEBUG ticking mPeerMgr" << std::endl;
#endif
mPeerMgr->tick(); mPeerMgr->tick();
#ifdef TICK_DEBUG
RsDbg() << "TICK_DEBUG ticking mLinkMgr" << std::endl;
#endif
mLinkMgr->tick(); mLinkMgr->tick();
#ifdef TICK_DEBUG
RsDbg() << "TICK_DEBUG ticking mNetMgr" << std::endl;
#endif
mNetMgr->tick(); mNetMgr->tick();
/******************************** RUN SERVER *****************/
/* adjust tick rate depending on whether there is more.
*/
mAvgTickRate = 0.2 * mTimeDelta + 0.8 * mAvgTickRate; // stuff we do every second
if (ts - mCycle1 > 1)
if (1 == moreToTick)
{ {
mTimeDelta = 0.9 * mAvgTickRate; #ifdef TICK_DEBUG
if (mTimeDelta > kickLimit) RsDbg() << "TICK_DEBUG every second" << std::endl;
{ #endif
/* force next tick in one sec // slow services
* if we are reading data. if (rsPlugins)
*/ rsPlugins->slowTickPlugins((rstime_t)ts);
mTimeDelta = kickLimit; // UDP keepalive
mAvgTickRate = kickLimit; // tou_tick_stunkeepalive();
} // other stuff to tick
} // update();
else mCycle1 = ts;
{
mTimeDelta = 1.1 * mAvgTickRate;
} }
/* limiter */ // stuff we do every five seconds
if (mTimeDelta < minTimeDelta) if (ts - mCycle2 > 5)
{ {
mTimeDelta = minTimeDelta; #ifdef TICK_DEBUG
} RsDbg() << "TICK_DEBUG every 5 seconds" << std::endl;
else if (mTimeDelta > maxTimeDelta) #endif
{ // save stuff
mTimeDelta = maxTimeDelta; mConfigMgr->tick();
mCycle2 = ts;
} }
/* Fast Updates */ // stuff we do every minute
if (ts - mCycle3 > 60)
/* now we have the slow ticking stuff */
/* stuff ticked once a second (but can be slowed down) */
if ((int) ts > mLastSec)
{ {
mLastSec = (int) ts; #ifdef TICK_DEBUG
RsDbg() << "TICK_DEBUG every 60 seconds" << std::endl;
#endif
// force saving FileTransferStatus TODO
// ftserver->saveFileTransferStatus();
// see if we need to resave certs
// AuthSSL::getAuthSSL()->CheckSaveCertificates();
mCycle3 = ts;
}
// Every second! (UDP keepalive). // stuff we do every hour
//tou_tick_stunkeepalive(); if (ts - mCycle4 > 3600)
// every five loops (> 5 secs)
if (mLoop % 5 == 0)
{ {
// update_quick_stats(); #ifdef TICK_DEBUG
RsDbg() << "TICK_DEBUG every hour" << std::endl;
#endif
mCycle4 = ts;
}
// Update All Every 5 Seconds. // ticking is done, now compute new values of mLastRunDuration, mAvgRunDuration and mTickInterval
// These Update Functions do the locking themselves. ts = getCurrentTS();
#ifdef DEBUG_TICK mLastRunDuration = ts - mLastts;
std::cerr << "RsServer::run() Updates()" << std::endl; mAvgRunDuration = 0.1 * mLastRunDuration + 0.9 * mAvgRunDuration;
#ifdef TICK_DEBUG
RsDbg() << "TICK_DEBUG new mLastRunDuration " << mLastRunDuration << " mAvgRunDuration " << mAvgRunDuration << std::endl;
if (mLastRunDuration > WARN_BIG_CYCLE_TIME)
RsDbg() << "TICK_DEBUG excessively long lycle time " << mLastRunDuration << std::endl;
#endif #endif
mConfigMgr->tick(); /* saves stuff */ // if the core has returned that there is more to tick we decrease the ticking interval, else we increse it
// this should be studied closer as I dont think that the core ever returns 1
#ifdef TICK_DEBUG
RsDbg() << "TICK_DEBUG moreToTick " << moreToTick << std::endl;
#endif
if (moreToTick == 1)
mTickInterval = 0.9 * mTickInterval;
else
mTickInterval = 1.1 * mTickInterval;
#ifdef TICK_DEBUG
RsDbg() << "TICK_DEBUG new tick interval " << mTickInterval << std::endl;
#endif
} // keep the tick interval within allowed limits
if (mTickInterval < minTickInterval)
// every 60 loops (> 1 min) mTickInterval = minTickInterval;
if (++mLoop >= 60) else if (mTickInterval > maxTickInterval)
{ mTickInterval = maxTickInterval;
mLoop = 0; #ifdef TICK_DEBUG
RsDbg() << "TICK_DEBUG new tick interval after limiter " << mTickInterval << std::endl;
/* force saving FileTransferStatus TODO */
//ftserver->saveFileTransferStatus();
/* see if we need to resave certs */
//AuthSSL::getAuthSSL()->CheckSaveCertificates();
/* hour loop */
if (++mMin >= 60)
{
mMin = 0;
}
}
/* Tick slow services */
if(rsPlugins)
rsPlugins->slowTickPlugins((rstime_t)ts);
// slow update tick as well.
// update();
} // end of slow tick.
} // end of only once a second.
#ifdef DEBUG_TICK
double endCycleTs = getCurrentTS();
double cycleTime = endCycleTs - ts;
if (cycleTime > WARN_BIG_CYCLE_TIME)
{
std::string out;
rs_sprintf(out, "RsServer::run() WARNING Excessively Long Cycle Time: %g secs => Please DEBUG", cycleTime);
std::cerr << out << std::endl;
}
#endif #endif
} }

View File

@ -188,16 +188,14 @@ public:
// Worker Data..... // Worker Data.....
int mMin ; double mLastts;
int mLoop ; double mTickInterval;
int mLastts ; double mLastRunDuration;
long mLastSec ; double mAvgRunDuration;
double mAvgTickRate ; double mCycle1, mCycle2, mCycle3, mCycle4;
double mTimeDelta ;
static const double minTimeDelta; // 25; static const double minTickInterval;
static const double maxTimeDelta; static const double maxTickInterval;
static const double kickLimit;
/// @see RsControl::setShutdownCallback /// @see RsControl::setShutdownCallback
std::function<void(int)> mShutdownCallback; std::function<void(int)> mShutdownCallback;

View File

@ -1193,7 +1193,7 @@ int RsServer::StartupRetroShare()
std::cerr << "(EE) Cannot create extensions directory " << extensions_dir std::cerr << "(EE) Cannot create extensions directory " << extensions_dir
<< ". This is not mandatory, but you probably have a permission problem." << std::endl; << ". This is not mandatory, but you probably have a permission problem." << std::endl;
#ifndef DEBUG_PLUGIN_SYSTEM #ifdef DEBUG_PLUGIN_SYSTEM
plugins_directories.push_back(".") ; // this list should be saved/set to some correct value. plugins_directories.push_back(".") ; // this list should be saved/set to some correct value.
// possible entries include: /usr/lib/retroshare, ~/.retroshare/extensions/, etc. // possible entries include: /usr/lib/retroshare, ~/.retroshare/extensions/, etc.
#endif #endif

View File

@ -542,28 +542,33 @@ void RsTypeSerializer::RawMemoryWrapper::serial_process(
ctx.mOffset += second; ctx.mOffset += second;
break; break;
case RsGenericSerializer::DESERIALIZE: case RsGenericSerializer::DESERIALIZE:
if(first || second)
{ {
// In case first,second is not properly initialized, we set them to nullptr,0 /* Items are created anew before deserialization so buffer pointer
first = nullptr; * must be null and size 0 at this point */
second = 0;
uint32_t serialSize = 0; RsWarn() << __PRETTY_FUNCTION__ << " DESERIALIZE got uninitialized "
RS_SERIAL_PROCESS(serialSize); << " or pre-allocated buffer! Buffer pointer: " << first
<< " must be null and size: " << second << " must be 0 at "
<< "this point. Does your item costructor initialize them "
<< "properly?" << std::endl;
print_stacktrace();
}
RS_SERIAL_PROCESS(second);
if(!ctx.mOk) break; if(!ctx.mOk) break;
ctx.mOk = (serialSize <= MAX_SERIALIZED_CHUNK_SIZE); ctx.mOk = (second <= MAX_SERIALIZED_CHUNK_SIZE);
if(!ctx.mOk) if(!ctx.mOk)
{ {
RsErr() << __PRETTY_FUNCTION__ RsErr() << __PRETTY_FUNCTION__
<< std::errc::message_size << " " << std::errc::message_size << " "
<< serialSize << " > " << MAX_SERIALIZED_CHUNK_SIZE << second << " > " << MAX_SERIALIZED_CHUNK_SIZE
<< std::endl; << std::endl;
clear(); clear();
break; break;
} }
if(!serialSize) if(!second)
{ {
Dbg3() << __PRETTY_FUNCTION__ << " Deserialized empty memory chunk" Dbg3() << __PRETTY_FUNCTION__ << " Deserialized empty memory chunk"
<< std::endl; << std::endl;
@ -571,25 +576,21 @@ void RsTypeSerializer::RawMemoryWrapper::serial_process(
break; break;
} }
ctx.mOk = (ctx.mSize >= ctx.mOffset + serialSize); ctx.mOk = ctx.mSize >= ctx.mOffset + second;
if(!ctx.mOk) if(!ctx.mOk)
{ {
RsErr() << __PRETTY_FUNCTION__ << std::errc::no_buffer_space << std::endl; RsErr() << __PRETTY_FUNCTION__ << std::errc::no_buffer_space
<< std::endl;
print_stacktrace(); print_stacktrace();
clear(); clear();
break; break;
} }
first = reinterpret_cast<uint8_t*>(malloc(serialSize)); first = reinterpret_cast<uint8_t*>(malloc(second));
second = serialSize; memcpy(first, ctx.mData + ctx.mOffset, second);
ctx.mOffset += second;
memcpy(first, ctx.mData + ctx.mOffset, serialSize);
ctx.mOffset += serialSize;
break; break;
}
case RsGenericSerializer::PRINT: break; case RsGenericSerializer::PRINT: break;
case RsGenericSerializer::TO_JSON: case RsGenericSerializer::TO_JSON:
{ {

View File

@ -1142,6 +1142,25 @@ bool p3GxsChannels::getChannelContent( const RsGxsGroupId& channelId,
return getPostData(token, posts, comments); return getPostData(token, posts, comments);
} }
bool p3GxsChannels::getChannelComments(const RsGxsGroupId &channelId,
const std::set<RsGxsMessageId> &contentIds,
std::vector<RsGxsComment> &comments)
{
std::vector<RsGxsGrpMsgIdPair> msgIds;
for (auto& msg:contentIds)
msgIds.push_back(RsGxsGrpMsgIdPair(channelId,msg));
RsTokReqOptions opts;
opts.mReqType = GXS_REQUEST_TYPE_MSG_RELATED_DATA;
opts.mOptions = RS_TOKREQOPT_MSG_THREAD | RS_TOKREQOPT_MSG_LATEST;
uint32_t token;
if( !requestMsgRelatedInfo(token, opts, msgIds) || waitToken(token) != RsTokenService::COMPLETE )
return false;
return getRelatedComments(token,comments);
}
bool p3GxsChannels::createChannelV2( bool p3GxsChannels::createChannelV2(
const std::string& name, const std::string& description, const std::string& name, const std::string& description,
const RsGxsImage& thumbnail, const RsGxsId& authorId, const RsGxsImage& thumbnail, const RsGxsId& authorId,

View File

@ -196,6 +196,11 @@ virtual bool ExtraFileRemove(const RsFileHash &hash);
std::vector<RsGxsChannelPost>& posts, std::vector<RsGxsChannelPost>& posts,
std::vector<RsGxsComment>& comments ) override; std::vector<RsGxsComment>& comments ) override;
/// Implementation of @see RsGxsChannels::getChannelComments
virtual bool getChannelComments(const RsGxsGroupId &channelId,
const std::set<RsGxsMessageId> &contentIds,
std::vector<RsGxsComment> &comments) override;
/// Implementation of @see RsGxsChannels::getContentSummaries /// Implementation of @see RsGxsChannels::getContentSummaries
bool getContentSummaries( bool getContentSummaries(
const RsGxsGroupId& channelId, const RsGxsGroupId& channelId,

View File

@ -78,6 +78,11 @@ CreateCircleDialog::CreateCircleDialog()
headerText = headerItem->text(RSCIRCLEID_COL_KEYID); headerText = headerItem->text(RSCIRCLEID_COL_KEYID);
ui.IdFilter->addFilter(QIcon(), headerText, RSCIRCLEID_COL_KEYID, QString("%1 %2").arg(tr("Search"), headerText)); ui.IdFilter->addFilter(QIcon(), headerText, RSCIRCLEID_COL_KEYID, QString("%1 %2").arg(tr("Search"), headerText));
/* Set initial column width */
int fontWidth = QFontMetricsF(ui.treeWidget_IdList->font()).width("W");
ui.treeWidget_IdList->setColumnWidth(RSCIRCLEID_COL_NICKNAME, 17 * fontWidth);
ui.treeWidget_membership->setColumnWidth(RSCIRCLEID_COL_NICKNAME, 17 * fontWidth);
ui.removeButton->setEnabled(false); ui.removeButton->setEnabled(false);
ui.addButton->setEnabled(false); ui.addButton->setEnabled(false);
ui.radioButton_ListAll->setChecked(true); ui.radioButton_ListAll->setChecked(true);

View File

@ -6,8 +6,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>1211</width> <width>721</width>
<height>647</height> <height>561</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
@ -106,8 +106,8 @@
<string/> <string/>
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="../images.qrc"> <iconset resource="../icons.qrc">
<normaloff>:/images/back.png</normaloff>:/images/back.png</iconset> <normaloff>:/icons/png/arrow-left.png</normaloff>:/icons/png/arrow-left.png</iconset>
</property> </property>
</widget> </widget>
</item> </item>
@ -120,8 +120,8 @@
<string/> <string/>
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="../images.qrc"> <iconset resource="../icons.qrc">
<normaloff>:/images/forward.png</normaloff>:/images/forward.png</iconset> <normaloff>:/icons/png/arrow-right.png</normaloff>:/icons/png/arrow-right.png</iconset>
</property> </property>
</widget> </widget>
</item> </item>

View File

@ -478,6 +478,9 @@ void MainWindow::initStackedPage()
} }
#endif #endif
addPage(newsFeed = new NewsFeed(ui->stackPages), grp, &notify);
//List All notify before Setting was created //List All notify before Setting was created
QList<QPair<MainPage*, QPair<QAction*, QListWidgetItem*> > >::iterator notifyIt; QList<QPair<MainPage*, QPair<QAction*, QListWidgetItem*> > >::iterator notifyIt;
for (notifyIt = notify.begin(); notifyIt != notify.end(); ++notifyIt) { for (notifyIt = notify.begin(); notifyIt != notify.end(); ++notifyIt) {
@ -489,7 +492,6 @@ void MainWindow::initStackedPage()
} }
} }
addPage(newsFeed = new NewsFeed(ui->stackPages), grp, &notify);
addPage(settingsDialog = new SettingsPage(ui->stackPages),grp,&notify); addPage(settingsDialog = new SettingsPage(ui->stackPages),grp,&notify);
/* Create the toolbar */ /* Create the toolbar */

View File

@ -494,7 +494,7 @@ void NewsFeed::addFeedItemIfUnique(FeedItem *item, bool replace)
} }
addFeedItem(item); addFeedItem(item);
sendNewsFeedChanged(); //sendNewsFeedChanged(); //Already done by addFeedItem()
} }
void NewsFeed::remUniqueFeedItem(FeedItem *item) void NewsFeed::remUniqueFeedItem(FeedItem *item)

View File

@ -94,6 +94,8 @@ private:
class PostedItem: public BasePostedItem class PostedItem: public BasePostedItem
{ {
Q_OBJECT
public: public:
PostedItem(FeedHolder *parent, uint32_t feedId, const RsGxsGroupId& groupId, const RsGxsMessageId& messageId, bool isHome, bool autoUpdate); PostedItem(FeedHolder *parent, uint32_t feedId, const RsGxsGroupId& groupId, const RsGxsMessageId& messageId, bool isHome, bool autoUpdate);
PostedItem(FeedHolder *parent, uint32_t feedId, const RsGroupMetaData& group_meta, const RsGxsMessageId& post_id, bool isHome, bool autoUpdate); PostedItem(FeedHolder *parent, uint32_t feedId, const RsGroupMetaData& group_meta, const RsGxsMessageId& post_id, bool isHome, bool autoUpdate);

View File

@ -27,7 +27,7 @@
<number>0</number> <number>0</number>
</property> </property>
<item> <item>
<widget class="QFrame" name="frame"> <widget class="QFrame" name="wire_frame">
<property name="frameShape"> <property name="frameShape">
<enum>QFrame::StyledPanel</enum> <enum>QFrame::StyledPanel</enum>
</property> </property>

View File

@ -241,6 +241,9 @@ border-image: url(:/images/closepressed.png)
</property> </property>
<item> <item>
<layout class="QHBoxLayout" name="typingHLayout"> <layout class="QHBoxLayout" name="typingHLayout">
<property name="leftMargin">
<number>2</number>
</property>
<item> <item>
<widget class="QLabel" name="typingPixmapLabel"> <widget class="QLabel" name="typingPixmapLabel">
<property name="minimumSize"> <property name="minimumSize">
@ -258,6 +261,9 @@ border-image: url(:/images/closepressed.png)
<property name="text"> <property name="text">
<string notr="true">T</string> <string notr="true">T</string>
</property> </property>
<property name="scaledContents">
<bool>true</bool>
</property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignCenter</set> <set>Qt::AlignCenter</set>
</property> </property>
@ -448,133 +454,6 @@ border-image: url(:/images/closepressed.png)
</property> </property>
</widget> </widget>
</item> </item>
<item>
<widget class="QToolButton" name="pushtoolsButton">
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="icon">
<iconset resource="../icons.qrc">
<normaloff>:/icons/png/options2.png</normaloff>:/icons/png/options2.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="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> <item>
<widget class="QToolButton" name="notifyButton"> <widget class="QToolButton" name="notifyButton">
<property name="focusPolicy"> <property name="focusPolicy">
@ -786,6 +665,133 @@ border-image: url(:/images/closepressed.png)
</property> </property>
</spacer> </spacer>
</item> </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="pushtoolsButton">
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="icon">
<iconset resource="../icons.qrc">
<normaloff>:/icons/png/options2.png</normaloff>:/icons/png/options2.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> <item>
<widget class="QFrame" name="pluginTitleFrame"> <widget class="QFrame" name="pluginTitleFrame">
<property name="frameShape"> <property name="frameShape">

View File

@ -212,7 +212,7 @@ NewFriendList::NewFriendList(QWidget *parent) : /* RsAutoUpdatePage(5000,parent)
// workaround for Qt bug, should be solved in next Qt release 4.7.0 // workaround for Qt bug, should be solved in next Qt release 4.7.0
// http://bugreports.qt.nokia.com/browse/QTBUG-8270 // http://bugreports.qt.nokia.com/browse/QTBUG-8270
QShortcut *Shortcut = new QShortcut(QKeySequence(Qt::Key_Delete), ui->peerTreeWidget, 0, 0, Qt::WidgetShortcut); QShortcut *Shortcut = new QShortcut(QKeySequence(Qt::Key_Delete), ui->peerTreeWidget, 0, 0, Qt::WidgetShortcut);
connect(Shortcut, SIGNAL(activated()), this, SLOT(removefriend()),Qt::QueuedConnection); connect(Shortcut, SIGNAL(activated()), this, SLOT(removeItem()),Qt::QueuedConnection);
QFontMetricsF fontMetrics(ui->peerTreeWidget->font()); QFontMetricsF fontMetrics(ui->peerTreeWidget->font());
@ -915,6 +915,25 @@ void FriendsDialog::viewprofile()
* *
* All of these rely on the finding of the current Id. * All of these rely on the finding of the current Id.
*/ */
void NewFriendList::removeItem()
{
QModelIndex index = getCurrentSourceIndex();
RsFriendListModel::EntryType type = mModel->getType(index);
if(index.isValid())
{
switch (type) {
case RsFriendListModel::ENTRY_TYPE_GROUP: removeGroup();
break;
case RsFriendListModel::ENTRY_TYPE_PROFILE: removeProfile();
break;
case RsFriendListModel::ENTRY_TYPE_NODE: removeNode();
break;
case RsFriendListModel::ENTRY_TYPE_UNKNOWN: RsErr()<<__PRETTY_FUNCTION__<<" Get Item of type unknow."<<std::endl;
}
}
}
void NewFriendList::removeNode() void NewFriendList::removeNode()
{ {
RsFriendListModel::RsNodeDetails det; RsFriendListModel::RsNodeDetails det;

View File

@ -144,6 +144,7 @@ private slots:
void msgGroup(); void msgGroup();
void msgProfile(); void msgProfile();
void recommendNode(); void recommendNode();
void removeItem();
void removeNode(); void removeNode();
void removeProfile(); void removeProfile();
void createNewGroup() ; void createNewGroup() ;

View File

@ -162,7 +162,7 @@ void GxsChannelPostItem::setup()
ui->voteDownButton->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/vote_down.png")); ui->voteDownButton->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/vote_down.png"));
ui->downloadButton->setIcon(FilesDefs::getIconFromQtResourcePath(":/icons/png/download.png")); ui->downloadButton->setIcon(FilesDefs::getIconFromQtResourcePath(":/icons/png/download.png"));
ui->playButton->setIcon(FilesDefs::getIconFromQtResourcePath(":/icons/png/play.png")); ui->playButton->setIcon(FilesDefs::getIconFromQtResourcePath(":/icons/png/play.png"));
ui->commentButton->setIcon(FilesDefs::getIconFromQtResourcePath(":/icons/png/commnt.png")); ui->commentButton->setIcon(FilesDefs::getIconFromQtResourcePath(":/icons/png/comment.png"));
ui->editButton->setIcon(FilesDefs::getIconFromQtResourcePath(":/icons/png/pencil-edit-button.png")); ui->editButton->setIcon(FilesDefs::getIconFromQtResourcePath(":/icons/png/pencil-edit-button.png"));
ui->copyLinkButton->setIcon(FilesDefs::getIconFromQtResourcePath(":/icons/png/copy.png")); ui->copyLinkButton->setIcon(FilesDefs::getIconFromQtResourcePath(":/icons/png/copy.png"));
ui->expandButton->setIcon(FilesDefs::getIconFromQtResourcePath(":/icons/png/down-arrow.png")); ui->expandButton->setIcon(FilesDefs::getIconFromQtResourcePath(":/icons/png/down-arrow.png"));
@ -173,6 +173,7 @@ void GxsChannelPostItem::setup()
mInFill = false; mInFill = false;
mCloseOnRead = false; mCloseOnRead = false;
mLoaded = false;
/* clear ui */ /* clear ui */
ui->titleLabel->setText(tr("Loading...")); ui->titleLabel->setText(tr("Loading..."));
@ -385,7 +386,7 @@ void GxsChannelPostItem::loadComment()
std::vector<RsGxsChannelPost> posts; std::vector<RsGxsChannelPost> posts;
std::vector<RsGxsComment> comments; std::vector<RsGxsComment> comments;
if(! rsGxsChannels->getChannelContent( groupId(),msgIds,posts,comments)) if(! rsGxsChannels->getChannelComments( groupId(),msgIds,comments))
{ {
RsErr() << "GxsGxsChannelGroupItem::loadGroup() ERROR getting data" << std::endl; RsErr() << "GxsGxsChannelGroupItem::loadGroup() ERROR getting data" << std::endl;
return; return;

View File

@ -77,7 +77,7 @@
<item> <item>
<layout class="QHBoxLayout" name="tilteHLayout"> <layout class="QHBoxLayout" name="tilteHLayout">
<item> <item>
<widget class="StyledLabel" name="titleLabel"> <widget class="StyledElidedLabel" name="titleLabel">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred"> <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -486,17 +486,17 @@
</layout> </layout>
</widget> </widget>
<customwidgets> <customwidgets>
<customwidget>
<class>StyledLabel</class>
<extends>QLabel</extends>
<header>gui/common/StyledLabel.h</header>
</customwidget>
<customwidget> <customwidget>
<class>ElidedLabel</class> <class>ElidedLabel</class>
<extends>QLabel</extends> <extends>QLabel</extends>
<header location="global">gui/common/ElidedLabel.h</header> <header location="global">gui/common/ElidedLabel.h</header>
<container>1</container> <container>1</container>
</customwidget> </customwidget>
<customwidget>
<class>StyledElidedLabel</class>
<extends>QLabel</extends>
<header>gui/common/StyledElidedLabel.h</header>
</customwidget>
</customwidgets> </customwidgets>
<resources> <resources>
<include location="../icons.qrc"/> <include location="../icons.qrc"/>

View File

@ -162,7 +162,7 @@
<string>Reply Message</string> <string>Reply Message</string>
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="../images.qrc"> <iconset>
<normaloff>:/images/mail_reply.png</normaloff>:/images/mail_reply.png</iconset> <normaloff>:/images/mail_reply.png</normaloff>:/images/mail_reply.png</iconset>
</property> </property>
</widget> </widget>
@ -196,7 +196,7 @@
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="../icons.qrc"> <iconset resource="../icons.qrc">
<normaloff>:/icons/png/cancel.png</normaloff>:/icons/png/cancel.png</iconset> <normaloff>:/icons/mail/delete.png</normaloff>:/icons/mail/delete.png</iconset>
</property> </property>
</widget> </widget>
</item> </item>

View File

@ -328,15 +328,7 @@ GxsForumThreadWidget::GxsForumThreadWidget(const RsGxsGroupId &forumId, QWidget
//ui->threadTreeWidget->installEventFilter(this) ; //ui->threadTreeWidget->installEventFilter(this) ;
ui->postText->clear() ; blankPost();
ui->by_label->setId(RsGxsId()) ;
ui->time_label->clear();
ui->lineRight->hide();
ui->lineLeft->hide();
ui->by_text_label->hide();
ui->by_label->hide();
ui->postText->setImageBlockWidget(ui->imageBlockWidget) ;
ui->postText->resetImagesStatus(Settings->getForumLoadEmbeddedImages());
ui->subscribeToolButton->setToolTip(tr( "<p>Subscribing to the forum will gather \ ui->subscribeToolButton->setToolTip(tr( "<p>Subscribing to the forum will gather \
available posts from your subscribed friends, and make the \ available posts from your subscribed friends, and make the \
@ -376,29 +368,17 @@ void GxsForumThreadWidget::handleEvent_main_thread(std::shared_ptr<const RsEvent
void GxsForumThreadWidget::blank() void GxsForumThreadWidget::blank()
{ {
ui->progressBar->hide(); ui->subscribeToolButton->hide();
ui->progressText->hide(); ui->newthreadButton->hide();
ui->postText->clear() ;
ui->by_label->setId(RsGxsId()) ;
ui->time_label->clear();
ui->lineRight->hide();
ui->lineLeft->hide();
ui->by_text_label->hide();
ui->by_label->hide();
ui->postText->setImageBlockWidget(ui->imageBlockWidget) ;
ui->postText->resetImagesStatus(Settings->getForumLoadEmbeddedImages());
#ifdef SUSPENDED_CODE
ui->threadTreeWidget->clear();
#endif
ui->forumName->setText(""); ui->forumName->setText("");
ui->progressText->hide();
ui->progressBar->hide();
ui->viewBox->setEnabled(false);
ui->filterLineEdit->setEnabled(false);
//mThreadModel->clear(); mThreadModel->clear();
mStateHelper->setWidgetEnabled(ui->newthreadButton, false); blankPost();
mStateHelper->setWidgetEnabled(ui->previousButton, false);
mStateHelper->setWidgetEnabled(ui->nextButton, false);
ui->versions_CB->hide();
} }
GxsForumThreadWidget::~GxsForumThreadWidget() GxsForumThreadWidget::~GxsForumThreadWidget()
@ -883,14 +863,36 @@ void GxsForumThreadWidget::clearForumDescription()
ui->postText->clear(); ui->postText->clear();
} }
void GxsForumThreadWidget::blankPost()
{
ui->newmessageButton->setEnabled(false);
ui->previousButton->setEnabled(false);
ui->nextButton->setEnabled(false);
ui->nextUnreadButton->setEnabled(false);
ui->downloadButton->setEnabled(false);
ui->lineLeft->hide();
ui->time_label->clear();
ui->versions_CB->hide();
ui->lineRight->hide();
ui->by_text_label->hide();
ui->by_label->setId(RsGxsId()) ;
ui->by_label->hide();
ui->expandButton->hide();
ui->postText->clear() ;
ui->postText->setImageBlockWidget(ui->imageBlockWidget) ;
ui->postText->resetImagesStatus(Settings->getForumLoadEmbeddedImages());
}
void GxsForumThreadWidget::updateForumDescription(bool success) void GxsForumThreadWidget::updateForumDescription(bool success)
{ {
if(!success) if(!success)
{ {
blank();
QString forum_description = QString("<b>ERROR:</b> Forum could not be loaded. Database might be in heavy use. Please try later."); QString forum_description = QString("<b>ERROR:</b> Forum could not be loaded. Database might be in heavy use. Please try later.");
ui->postText->setText(forum_description); ui->postText->setText(forum_description);
mStateHelper->setWidgetEnabled(ui->newthreadButton, false); mStateHelper->setWidgetEnabled(ui->newthreadButton, false);
return; return;
} }
@ -906,7 +908,10 @@ void GxsForumThreadWidget::updateForumDescription(bool success)
const RsGxsForumGroup& group = mForumGroup; const RsGxsForumGroup& group = mForumGroup;
ui->newthreadButton->show();
ui->forumName->setText(QString::fromUtf8(group.mMeta.mGroupName.c_str())); ui->forumName->setText(QString::fromUtf8(group.mMeta.mGroupName.c_str()));
ui->viewBox->setEnabled(true);
ui->filterLineEdit->setEnabled(true);
QString anti_spam_features1 ; QString anti_spam_features1 ;
QString forum_description; QString forum_description;
@ -1019,6 +1024,9 @@ void GxsForumThreadWidget::insertMessage()
return; return;
} }
/* blank text, incase we get nothing */
blankPost();
// We use this instead of getCurrentIndex() because right here the currentIndex() is not set yet. // We use this instead of getCurrentIndex() because right here the currentIndex() is not set yet.
QModelIndex index = mThreadProxyModel->mapFromSource(mThreadModel->getIndexOfMessage(mOrigThreadId)); QModelIndex index = mThreadProxyModel->mapFromSource(mThreadModel->getIndexOfMessage(mOrigThreadId));
@ -1043,18 +1051,7 @@ void GxsForumThreadWidget::insertMessage()
return; return;
} }
mStateHelper->setWidgetEnabled(ui->newmessageButton, (IS_GROUP_SUBSCRIBED(mForumGroup.mMeta.mSubscribeFlags) && mThreadId.isNull() == false)); ui->newmessageButton->setEnabled(IS_GROUP_SUBSCRIBED(mForumGroup.mMeta.mSubscribeFlags) && mThreadId.isNull() == false);
/* blank text, incase we get nothing */
ui->postText->clear();
ui->by_label->setId(RsGxsId()) ;
ui->time_label->clear();
ui->lineRight->hide();
ui->lineLeft->hide();
ui->by_text_label->hide();
ui->by_label->hide();
ui->postText->setImageBlockWidget(ui->imageBlockWidget) ;
ui->postText->resetImagesStatus(Settings->getForumLoadEmbeddedImages());
// add/show combobox for versions, if applicable, and enable it. If no older versions of the post available, hide the combobox. // add/show combobox for versions, if applicable, and enable it. If no older versions of the post available, hide the combobox.
@ -1145,11 +1142,12 @@ void GxsForumThreadWidget::insertMessageData(const RsGxsForumMsg &msg)
bool redacted = bool redacted =
(overall_reputation == RsReputationLevel::LOCALLY_NEGATIVE); (overall_reputation == RsReputationLevel::LOCALLY_NEGATIVE);
ui->time_label->setText(DateTime::formatLongDateTime(msg.mMeta.mPublishTs)); ui->nextUnreadButton->setEnabled(true);
ui->by_label->setId(msg.mMeta.mAuthorId);
ui->lineRight->show();
ui->lineLeft->show(); ui->lineLeft->show();
ui->time_label->setText(DateTime::formatLongDateTime(msg.mMeta.mPublishTs));
ui->lineRight->show();
ui->by_text_label->show(); ui->by_text_label->show();
ui->by_label->setId(msg.mMeta.mAuthorId);
ui->by_label->show(); ui->by_label->show();
ui->threadTreeWidget->setFocus(); ui->threadTreeWidget->setFocus();
@ -1171,6 +1169,10 @@ void GxsForumThreadWidget::insertMessageData(const RsGxsForumMsg &msg)
QString extraTxt = RsHtml().formatText(ui->postText->document(), QString::fromUtf8(msg.mMsg.c_str()),flags); QString extraTxt = RsHtml().formatText(ui->postText->document(), QString::fromUtf8(msg.mMsg.c_str()),flags);
ui->postText->setHtml(extraTxt); ui->postText->setHtml(extraTxt);
} }
QStringList urls;
RsHtml::findAnchors(ui->postText->toHtml(), urls);
ui->downloadButton->setEnabled(urls.count() > 0);
} }
void GxsForumThreadWidget::previousMessage() void GxsForumThreadWidget::previousMessage()
@ -1675,6 +1677,9 @@ void GxsForumThreadWidget::filterItems(const QString& text)
void GxsForumThreadWidget::postForumLoading() void GxsForumThreadWidget::postForumLoading()
{ {
if(groupId().isNull())
return;
#ifdef DEBUG_FORUMS #ifdef DEBUG_FORUMS
std::cerr << "Post forum loading..." << std::endl; std::cerr << "Post forum loading..." << std::endl;
#endif #endif
@ -1719,9 +1724,12 @@ void GxsForumThreadWidget::postForumLoading()
// we also need to restore expanded threads // we also need to restore expanded threads
} }
ui->newthreadButton->show();
ui->forumName->setText(QString::fromUtf8(mForumGroup.mMeta.mGroupName.c_str())); ui->forumName->setText(QString::fromUtf8(mForumGroup.mMeta.mGroupName.c_str()));
ui->threadTreeWidget->sortByColumn(RsGxsForumModel::COLUMN_THREAD_DATE, Qt::DescendingOrder); ui->threadTreeWidget->sortByColumn(RsGxsForumModel::COLUMN_THREAD_DATE, Qt::DescendingOrder);
ui->threadTreeWidget->update(); ui->threadTreeWidget->update();
ui->viewBox->setEnabled(true);
ui->filterLineEdit->setEnabled(true);
recursRestoreExpandedItems(mThreadProxyModel->mapFromSource(mThreadModel->root()),mSavedExpandedMessages); recursRestoreExpandedItems(mThreadProxyModel->mapFromSource(mThreadModel->root()),mSavedExpandedMessages);
//mUpdating = false; //mUpdating = false;

View File

@ -178,6 +178,7 @@ private:
private: private:
void setForumDescriptionLoading(); void setForumDescriptionLoading();
void clearForumDescription(); void clearForumDescription();
void blankPost();
RsGxsGroupId mLastForumID; RsGxsGroupId mLastForumID;
RsGxsMessageId mThreadId; RsGxsMessageId mThreadId;

View File

@ -245,32 +245,6 @@
</item> </item>
<item> <item>
<layout class="QGridLayout" name="postLayout"> <layout class="QGridLayout" name="postLayout">
<item row="0" column="6">
<widget class="QToolButton" name="downloadButton">
<property name="maximumSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="toolTip">
<string>Download all files</string>
</property>
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
</property>
<property name="icon">
<iconset resource="../icons.qrc">
<normaloff>:/icons/png/download.png</normaloff>:/icons/png/download.png</iconset>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="1"> <item row="0" column="1">
<widget class="QToolButton" name="newmessageButton"> <widget class="QToolButton" name="newmessageButton">
<property name="maximumSize"> <property name="maximumSize">
@ -300,53 +274,7 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="16"> <item row="0" column="2">
<widget class="QPushButton" name="expandButton">
<property name="maximumSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/edit_remove24.png</normaloff>:/images/edit_remove24.png</iconset>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="10">
<widget class="Line" name="lineRight">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item row="0" column="13">
<spacer name="postHSpacer">
<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 row="0" column="3">
<widget class="QToolButton" name="previousButton"> <widget class="QToolButton" name="previousButton">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed"> <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
@ -384,7 +312,7 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="4"> <item row="0" column="3">
<widget class="QToolButton" name="nextButton"> <widget class="QToolButton" name="nextButton">
<property name="enabled"> <property name="enabled">
<bool>false</bool> <bool>false</bool>
@ -425,38 +353,7 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="12"> <item row="0" column="4">
<widget class="GxsIdLabel" name="by_label">
<property name="text">
<string notr="true"/>
</property>
</widget>
</item>
<item row="0" column="7">
<widget class="Line" name="lineLeft">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item row="0" column="9">
<widget class="QComboBox" name="versions_CB"/>
</item>
<item row="0" column="8">
<widget class="QLabel" name="time_label">
<property name="text">
<string notr="true"/>
</property>
</widget>
</item>
<item row="0" column="11">
<widget class="QLabel" name="by_text_label">
<property name="text">
<string>By </string>
</property>
</widget>
</item>
<item row="0" column="5">
<widget class="QToolButton" name="nextUnreadButton"> <widget class="QToolButton" name="nextUnreadButton">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed"> <sizepolicy hsizetype="Maximum" vsizetype="Fixed">
@ -479,6 +376,109 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="5">
<widget class="QToolButton" name="downloadButton">
<property name="maximumSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="toolTip">
<string>Download all files</string>
</property>
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
</property>
<property name="icon">
<iconset resource="../icons.qrc">
<normaloff>:/icons/png/download.png</normaloff>:/icons/png/download.png</iconset>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="6">
<widget class="Line" name="lineLeft">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item row="0" column="7">
<widget class="QLabel" name="time_label">
<property name="text">
<string notr="true"/>
</property>
</widget>
</item>
<item row="0" column="8">
<widget class="QComboBox" name="versions_CB"/>
</item>
<item row="0" column="9">
<widget class="Line" name="lineRight">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item row="0" column="10">
<widget class="QLabel" name="by_text_label">
<property name="text">
<string>By </string>
</property>
</widget>
</item>
<item row="0" column="11">
<widget class="GxsIdLabel" name="by_label">
<property name="text">
<string notr="true"/>
</property>
</widget>
</item>
<item row="0" column="12">
<spacer name="postHSpacer">
<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 row="0" column="13">
<widget class="QPushButton" name="expandButton">
<property name="maximumSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/edit_remove24.png</normaloff>:/images/edit_remove24.png</iconset>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
</layout> </layout>
</item> </item>
</layout> </layout>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

View File

@ -63,12 +63,6 @@ MessageWindow::MessageWindow(QWidget *parent, Qt::WindowFlags flags)
ui.tagButton->setMenu(menu); ui.tagButton->setMenu(menu);
// create print menu
QMenu *printmenu = new QMenu();
printmenu->addAction(ui.actionPrint);
printmenu->addAction(ui.actionPrint_Preview);
ui.printButton->setMenu(printmenu);
// create view menu // create view menu
QMenu *viewmenu = new QMenu(); QMenu *viewmenu = new QMenu();
viewmenu->addAction(ui.actionTextBesideIcon); viewmenu->addAction(ui.actionTextBesideIcon);
@ -92,7 +86,7 @@ void MessageWindow::processSettings(bool load)
// load settings // load settings
/* toolbar button style */ /* toolbar button style */
Qt::ToolButtonStyle style = (Qt::ToolButtonStyle) Settings->value("ToolButon_Stlye", Qt::ToolButtonIconOnly).toInt(); Qt::ToolButtonStyle style = (Qt::ToolButtonStyle) Settings->value("ToolButon_Stlye", Qt::ToolButtonTextBesideIcon).toInt();
setToolbarButtonStyle(style); setToolbarButtonStyle(style);
} else { } else {
// save settings // save settings
@ -115,11 +109,6 @@ void MessageWindow::addWidget(MessageWidget *widget)
ui.msgLayout->addWidget(msgWidget); ui.msgLayout->addWidget(msgWidget);
setWindowTitle(msgWidget->subject(true)); setWindowTitle(msgWidget->subject(true));
msgWidget->connectAction(MessageWidget::ACTION_REMOVE, ui.removemessageButton);
msgWidget->connectAction(MessageWidget::ACTION_REPLY, ui.replymessageButton);
msgWidget->connectAction(MessageWidget::ACTION_REPLY_ALL, ui.replyallmessageButton);
msgWidget->connectAction(MessageWidget::ACTION_FORWARD, ui.forwardmessageButton);
msgWidget->connectAction(MessageWidget::ACTION_PRINT, ui.printButton);
msgWidget->connectAction(MessageWidget::ACTION_PRINT, ui.actionPrint); msgWidget->connectAction(MessageWidget::ACTION_PRINT, ui.actionPrint);
msgWidget->connectAction(MessageWidget::ACTION_PRINT, actionPrint); msgWidget->connectAction(MessageWidget::ACTION_PRINT, actionPrint);
msgWidget->connectAction(MessageWidget::ACTION_PRINT_PREVIEW, ui.actionPrint_Preview); msgWidget->connectAction(MessageWidget::ACTION_PRINT_PREVIEW, ui.actionPrint_Preview);
@ -210,13 +199,7 @@ void MessageWindow::setupFileActions()
void MessageWindow::setToolbarButtonStyle(Qt::ToolButtonStyle style) void MessageWindow::setToolbarButtonStyle(Qt::ToolButtonStyle style)
{ {
ui.newmessageButton->setToolButtonStyle(style); ui.newmessageButton->setToolButtonStyle(style);
ui.removemessageButton->setToolButtonStyle(style);
ui.replymessageButton->setToolButtonStyle(style);
ui.replyallmessageButton->setToolButtonStyle(style);
ui.forwardmessageButton->setToolButtonStyle(style);
ui.tagButton->setToolButtonStyle(style); ui.tagButton->setToolButtonStyle(style);
ui.printButton->setToolButtonStyle(style);
ui.viewtoolButton->setToolButtonStyle(style);
} }
void MessageWindow::buttonStyle() void MessageWindow::buttonStyle()

View File

@ -81,8 +81,8 @@
<string>Compose</string> <string>Compose</string>
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="../images.qrc"> <iconset resource="../icons.qrc">
<normaloff>:/images/folder-draft24.png</normaloff>:/images/folder-draft24.png</iconset> <normaloff>:/icons/mail/compose.png</normaloff>:/icons/mail/compose.png</iconset>
</property> </property>
<property name="iconSize"> <property name="iconSize">
<size> <size>
@ -91,7 +91,7 @@
</size> </size>
</property> </property>
<property name="toolButtonStyle"> <property name="toolButtonStyle">
<enum>Qt::ToolButtonIconOnly</enum> <enum>Qt::ToolButtonTextBesideIcon</enum>
</property> </property>
<property name="autoRaise"> <property name="autoRaise">
<bool>true</bool> <bool>true</bool>
@ -105,174 +105,20 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="2"> <item row="0" column="4">
<widget class="QToolButton" name="replymessageButton"> <spacer name="toolBarFrameHSpacer">
<property name="focusPolicy"> <property name="orientation">
<enum>Qt::NoFocus</enum> <enum>Qt::Horizontal</enum>
</property> </property>
<property name="toolTip"> <property name="sizeHint" stdset="0">
<string>Reply to selected message</string>
</property>
<property name="text">
<string>Reply</string>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/replymail-pressed.png</normaloff>:/images/replymail-pressed.png</iconset>
</property>
<property name="iconSize">
<size> <size>
<width>24</width> <width>40</width>
<height>24</height> <height>20</height>
</size> </size>
</property> </property>
<property name="toolButtonStyle"> </spacer>
<enum>Qt::ToolButtonIconOnly</enum>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item> </item>
<item row="0" column="3"> <item row="0" column="3">
<widget class="QToolButton" name="replyallmessageButton">
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="toolTip">
<string>Reply all to selected message</string>
</property>
<property name="text">
<string>Reply all</string>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/replymailall24-hover.png</normaloff>:/images/replymailall24-hover.png</iconset>
</property>
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonIconOnly</enum>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="4">
<widget class="QToolButton" name="forwardmessageButton">
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777</width>
<height>16777</height>
</size>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="toolTip">
<string>Forward selected message</string>
</property>
<property name="text">
<string>Forward</string>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/mailforward24-hover.png</normaloff>:/images/mailforward24-hover.png</iconset>
</property>
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonIconOnly</enum>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="5">
<widget class="Line" name="toolBarFrameLineR">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item row="0" column="7">
<widget class="QToolButton" name="removemessageButton">
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="toolTip">
<string>Remove selected message</string>
</property>
<property name="text">
<string>Delete</string>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/deletemail24.png</normaloff>:/images/deletemail24.png</iconset>
</property>
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonIconOnly</enum>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="8">
<widget class="QToolButton" name="printButton">
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="toolTip">
<string>Print selected message</string>
</property>
<property name="text">
<string>Print</string>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/print24.png</normaloff>:/images/print24.png</iconset>
</property>
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="popupMode">
<enum>QToolButton::MenuButtonPopup</enum>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonIconOnly</enum>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="9">
<widget class="QToolButton" name="viewtoolButton"> <widget class="QToolButton" name="viewtoolButton">
<property name="focusPolicy"> <property name="focusPolicy">
<enum>Qt::NoFocus</enum> <enum>Qt::NoFocus</enum>
@ -291,27 +137,14 @@
</size> </size>
</property> </property>
<property name="popupMode"> <property name="popupMode">
<enum>QToolButton::MenuButtonPopup</enum> <enum>QToolButton::InstantPopup</enum>
</property> </property>
<property name="autoRaise"> <property name="autoRaise">
<bool>true</bool> <bool>true</bool>
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="10"> <item row="0" column="2">
<spacer name="toolBarFrameHSpacer">
<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 row="0" column="6">
<widget class="QToolButton" name="tagButton"> <widget class="QToolButton" name="tagButton">
<property name="focusPolicy"> <property name="focusPolicy">
<enum>Qt::NoFocus</enum> <enum>Qt::NoFocus</enum>
@ -323,8 +156,8 @@
<string>Tags</string> <string>Tags</string>
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="../images.qrc"> <iconset resource="../icons.qrc">
<normaloff>:/images/tag24.png</normaloff>:/images/tag24.png</iconset> <normaloff>:/icons/mail/tags.png</normaloff>:/icons/mail/tags.png</iconset>
</property> </property>
<property name="iconSize"> <property name="iconSize">
<size> <size>
@ -333,7 +166,10 @@
</size> </size>
</property> </property>
<property name="popupMode"> <property name="popupMode">
<enum>QToolButton::MenuButtonPopup</enum> <enum>QToolButton::InstantPopup</enum>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextBesideIcon</enum>
</property> </property>
<property name="autoRaise"> <property name="autoRaise">
<bool>true</bool> <bool>true</bool>
@ -355,7 +191,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>698</width> <width>698</width>
<height>20</height> <height>21</height>
</rect> </rect>
</property> </property>
</widget> </widget>
@ -396,6 +232,7 @@
</widget> </widget>
<resources> <resources>
<include location="../images.qrc"/> <include location="../images.qrc"/>
<include location="../icons.qrc"/>
</resources> </resources>
<connections/> <connections/>
</ui> </ui>

View File

@ -732,6 +732,10 @@ GxsForumThreadWidget QToolButton#subscribeToolButton:hover {
border-radius: 4px; border-radius: 4px;
} }
GxsForumMsgItem QFrame#frame{
background-color: white;
}
GxsChannelPostsWidget QFrame#infoFrame GxsChannelPostsWidget QFrame#infoFrame
{ {
@ -787,6 +791,10 @@ PostedItem QFrame#frame_notes {
background: white; background: white;
} }
PostedItem QFrame#mainFrame {
background-color: white;
}
PostedItem QLabel#notes { PostedItem QLabel#notes {
} }
@ -832,6 +840,11 @@ PostedCardView QFrame#voteFrame {
background: #f8f9fa; background: #f8f9fa;
} }
PostedCardView QFrame#mainFrame {
background: white;
}
GxsCommentDialog QComboBox#sortBox { GxsCommentDialog QComboBox#sortBox {
font: bold; font: bold;
color: #0099cc; color: #0099cc;
@ -870,3 +883,10 @@ WireGroupItem QWidget:hover
background-color: #7ecbfb; background-color: #7ecbfb;
} }
WireDialog QFrame#frame{
background-color: white;
}
WireDialog QWidget#scrollAreaWidgetContents_groups{
background-color: white;
}

View File

@ -91,8 +91,6 @@ ServerPage::ServerPage(QWidget * parent, Qt::WindowFlags flags)
ui.tabWidget->removeTab(TAB_RELAYS) ; // remove relays. Not useful in Tor mode. ui.tabWidget->removeTab(TAB_RELAYS) ; // remove relays. Not useful in Tor mode.
ui.tabWidget->removeTab(TAB_IP_FILTERS) ; // remove IP filters. Not useful in Tor mode. ui.tabWidget->removeTab(TAB_IP_FILTERS) ; // remove IP filters. Not useful in Tor mode.
ui.hiddenServiceTab->removeTab(TAB_HIDDEN_SERVICE_I2P_BOB) ; // remove the Automatic I2P/BOB tab
ui.hiddenpage_proxyAddress_i2p->hide() ; ui.hiddenpage_proxyAddress_i2p->hide() ;
ui.hiddenpage_proxyLabel_i2p->hide() ; ui.hiddenpage_proxyLabel_i2p->hide() ;
ui.hiddenpage_proxyPort_i2p->hide() ; ui.hiddenpage_proxyPort_i2p->hide() ;
@ -109,8 +107,7 @@ ServerPage::ServerPage(QWidget * parent, Qt::WindowFlags flags)
} }
else else
{ {
ui.hiddenServiceTab->removeTab(TAB_HIDDEN_SERVICE_I2P_BOB); // warning: the order of operation here is very important. ui.hiddenServiceTab->removeTab(TAB_HIDDEN_SERVICE_INCOMING); // warning: the order of operation here is very important.
ui.hiddenServiceTab->removeTab(TAB_HIDDEN_SERVICE_INCOMING);
} }
ui.filteredIpsTable->setHorizontalHeaderItem(COLUMN_RANGE,new QTableWidgetItem(tr("IP Range"))) ; ui.filteredIpsTable->setHorizontalHeaderItem(COLUMN_RANGE,new QTableWidgetItem(tr("IP Range"))) ;

View File

@ -113,10 +113,10 @@ void RshareSettings::initSettings()
#else #else
static QStringList styles = QStyleFactory::keys(); static QStringList styles = QStyleFactory::keys();
#if defined(Q_OS_WIN) #if defined(Q_OS_WIN)
if (styles.contains("windowsvista", Qt::CaseInsensitive)) if (styles.contains("Fusion", Qt::CaseInsensitive))
setDefault(SETTING_STYLE, "Fusion");
else if (styles.contains("windowsvista", Qt::CaseInsensitive))
setDefault(SETTING_STYLE, "windowsvista"); setDefault(SETTING_STYLE, "windowsvista");
else if (styles.contains("windowsxp", Qt::CaseInsensitive))
setDefault(SETTING_STYLE, "windowsxp");
else else
#endif #endif
{ {

View File

@ -23,7 +23,7 @@ FriendSelectionWidget
qproperty-textColorOnline: lightBlue; qproperty-textColorOnline: lightBlue;
} }
FriendList NewFriendList
{ {
qproperty-textColorStatusOffline: white; qproperty-textColorStatusOffline: white;
qproperty-textColorStatusAway: gray; qproperty-textColorStatusAway: gray;

View File

@ -1940,7 +1940,7 @@ PlotWidget {
padding: 0px; /* to fix cut labels in plots #134 */ padding: 0px; /* to fix cut labels in plots #134 */
} }
FriendList { NewFriendList {
qproperty-textColorStatusAway: lightgray; qproperty-textColorStatusAway: lightgray;
qproperty-textColorStatusBusy: lightgray; qproperty-textColorStatusBusy: lightgray;
qproperty-textColorStatusOnline: green; qproperty-textColorStatusOnline: green;

View File

@ -833,7 +833,7 @@ QDockWidget::close-button:pressed, QDockWidget::float-button:pressed {
background: rgba(255, 255, 255, 10); background: rgba(255, 255, 255, 10);
} }
FriendList { NewFriendList {
qproperty-textColorStatusAway: lightgray; qproperty-textColorStatusAway: lightgray;
qproperty-textColorStatusBusy: lightgray; qproperty-textColorStatusBusy: lightgray;
qproperty-textColorStatusOnline: green; qproperty-textColorStatusOnline: green;