diff --git a/build_scripts/Windows-msys2/WindowsMSys2_InstallGuide.md b/build_scripts/Windows-msys2/WindowsMSys2_InstallGuide.md index 5d939d2de..2105112f1 100644 --- a/build_scripts/Windows-msys2/WindowsMSys2_InstallGuide.md +++ b/build_scripts/Windows-msys2/WindowsMSys2_InstallGuide.md @@ -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 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 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 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. ### BUILDING RETROSHARE diff --git a/libretroshare/src/pqi/pqissl.h b/libretroshare/src/pqi/pqissl.h index 3f315e329..30905be5e 100644 --- a/libretroshare/src/pqi/pqissl.h +++ b/libretroshare/src/pqi/pqissl.h @@ -56,6 +56,69 @@ const int PQISSL_UDP_FLAG = 0x02; /* TCP buffer size for Windows systems */ 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 ********************************* * This provides the base SSL interface class, * and handles most of the required functionality. @@ -203,9 +266,9 @@ bool CheckConnectionTimeout(); uint32_t mConnectTimeout; rstime_t mTimeoutTS; + RS_SET_CONTEXT_DEBUG_LEVEL(1) + private: // ssl only fns. int connectInterface(const struct sockaddr_storage &addr); - - RS_SET_CONTEXT_DEBUG_LEVEL(1) }; diff --git a/libretroshare/src/pqi/pqissllistener.h b/libretroshare/src/pqi/pqissllistener.h index 42ad0d0c2..85af2d869 100644 --- a/libretroshare/src/pqi/pqissllistener.h +++ b/libretroshare/src/pqi/pqissllistener.h @@ -34,6 +34,73 @@ #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 ********************************* */ diff --git a/libretroshare/src/retroshare/rsgxschannels.h b/libretroshare/src/retroshare/rsgxschannels.h index c31eb011f..0fcde2960 100644 --- a/libretroshare/src/retroshare/rsgxschannels.h +++ b/libretroshare/src/retroshare/rsgxschannels.h @@ -333,6 +333,19 @@ public: std::vector& posts, std::vector& 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 &contentIds, + std::vector &comments) = 0; + /** * @brief Get channel content summaries * @jsonapi{development} diff --git a/libretroshare/src/rsserver/p3face-server.cc b/libretroshare/src/rsserver/p3face-server.cc index 54605333b..0ed2f698c 100644 --- a/libretroshare/src/rsserver/p3face-server.cc +++ b/libretroshare/src/rsserver/p3face-server.cc @@ -41,11 +41,12 @@ #include "services/rseventsservice.h" -/**** -#define DEBUG_TICK 1 -****/ +/******************* +#define TICK_DEBUG 1 +*******************/ #define WARN_BIG_CYCLE_TIME (0.2) + #ifdef WINDOWS_SYS #include "util/rstime.h" #include @@ -73,14 +74,13 @@ static double getCurrentTS() // 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 -const double RsServer::minTimeDelta = 0.05; // 25; -const double RsServer::maxTimeDelta = 0.2; -const double RsServer::kickLimit = 0.15; +const double RsServer::minTickInterval = 0.05; +const double RsServer::maxTickInterval = 0.2; RsServer::RsServer() : - coreMutex("RsServer"), mShutdownCallback([](int){}), - coreReady(false) + coreMutex("RsServer"), mShutdownCallback([](int){}), + coreReady(false) { { RsEventsService* tmpRsEvtPtr = new RsEventsService(); @@ -108,21 +108,20 @@ RsServer::RsServer() : msgSrv = NULL; chatSrv = NULL; mStatusSrv = NULL; - mGxsTunnels = NULL; + mGxsTunnels = NULL; - mMin = 0; - mLoop = 0; + mLastts = getCurrentTS(); + mTickInterval = maxTickInterval ; + mAvgRunDuration = 0; + mLastRunDuration = 0; + mCycle1 = 0; + mCycle2 = 0; + mCycle3 = 0; + mCycle4 = 0; + /* caches (that need ticking) */ - mLastts = getCurrentTS(); - mLastSec = 0; /* for the slower ticked stuff */ - mTimeDelta = 0.25 ; - - mAvgTickRate = mTimeDelta; - - /* caches (that need ticking) */ - - /* Config */ + /* config */ mConfigMgr = NULL; mGeneralConfig = NULL; } @@ -132,143 +131,132 @@ RsServer::~RsServer() delete mGxsTrans; } - /* General Internal Helper Functions - ----> MUST BE LOCKED! - */ +// General Internal Helper Functions ----> MUST BE LOCKED! - - - /* Thread Fn: Run the Core */ void RsServer::threadTick() { - rstime::rs_usleep(mTimeDelta * 1000000); - - 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; +#ifdef TICK_DEBUG + RsDbg() << "TICK_DEBUG ticking interval "<< mTickInterval << std::endl; #endif - mLastts = ts; +// we try to tick at a regular interval which depends on the load +// if there is time left, we sleep + double timeToSleep = mTickInterval - mAvgRunDuration; - /******************************** RUN SERVER *****************/ - lockRsCore(); + if (timeToSleep > 0) + { +#ifdef TICK_DEBUG + RsDbg() << "TICK_DEBUG will sleep " << timeToSleep << " ms" << std::endl; +#endif + rstime::rs_usleep(timeToSleep * 1000000); + } - int moreToTick = pqih->tick(); + double ts = getCurrentTS(); + mLastts = ts; -#ifdef DEBUG_TICK - std::cerr << "RsServer::run() ftserver->tick(): moreToTick: " << moreToTick << std::endl; +// stuff we do always +// tick the core +#ifdef TICK_DEBUG + RsDbg() << "TICK_DEBUG ticking server" << std::endl; +#endif + lockRsCore(); + int moreToTick = pqih->tick(); + unlockRsCore(); +// tick the managers +#ifdef TICK_DEBUG + RsDbg() << "TICK_DEBUG ticking mPeerMgr" << std::endl; +#endif + mPeerMgr->tick(); +#ifdef TICK_DEBUG + RsDbg() << "TICK_DEBUG ticking mLinkMgr" << std::endl; +#endif + mLinkMgr->tick(); +#ifdef TICK_DEBUG + RsDbg() << "TICK_DEBUG ticking mNetMgr" << std::endl; +#endif + mNetMgr->tick(); + + +// stuff we do every second + if (ts - mCycle1 > 1) + { +#ifdef TICK_DEBUG + RsDbg() << "TICK_DEBUG every second" << std::endl; +#endif + // slow services + if (rsPlugins) + rsPlugins->slowTickPlugins((rstime_t)ts); + // UDP keepalive + // tou_tick_stunkeepalive(); + // other stuff to tick + // update(); + mCycle1 = ts; + } + +// stuff we do every five seconds + if (ts - mCycle2 > 5) + { +#ifdef TICK_DEBUG + RsDbg() << "TICK_DEBUG every 5 seconds" << std::endl; +#endif + // save stuff + mConfigMgr->tick(); + mCycle2 = ts; + } + +// stuff we do every minute + if (ts - mCycle3 > 60) + { +#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; + } + +// stuff we do every hour + if (ts - mCycle4 > 3600) + { +#ifdef TICK_DEBUG + RsDbg() << "TICK_DEBUG every hour" << std::endl; +#endif + mCycle4 = ts; + } + +// ticking is done, now compute new values of mLastRunDuration, mAvgRunDuration and mTickInterval + ts = getCurrentTS(); + mLastRunDuration = ts - mLastts; + 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 + +// 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 - unlockRsCore(); - - /* tick the Managers */ - mPeerMgr->tick(); - mLinkMgr->tick(); - mNetMgr->tick(); - /******************************** RUN SERVER *****************/ - - /* adjust tick rate depending on whether there is more. - */ - - mAvgTickRate = 0.2 * mTimeDelta + 0.8 * mAvgTickRate; - - if (1 == moreToTick) - { - mTimeDelta = 0.9 * mAvgTickRate; - if (mTimeDelta > kickLimit) - { - /* force next tick in one sec - * if we are reading data. - */ - mTimeDelta = kickLimit; - mAvgTickRate = kickLimit; - } - } - else - { - mTimeDelta = 1.1 * mAvgTickRate; - } - - /* limiter */ - if (mTimeDelta < minTimeDelta) - { - mTimeDelta = minTimeDelta; - } - else if (mTimeDelta > maxTimeDelta) - { - mTimeDelta = maxTimeDelta; - } - - /* Fast Updates */ - - - /* now we have the slow ticking stuff */ - /* stuff ticked once a second (but can be slowed down) */ - if ((int) ts > mLastSec) - { - mLastSec = (int) ts; - - // Every second! (UDP keepalive). - //tou_tick_stunkeepalive(); - - // every five loops (> 5 secs) - if (mLoop % 5 == 0) - { - // update_quick_stats(); - - // Update All Every 5 Seconds. - // These Update Functions do the locking themselves. -#ifdef DEBUG_TICK - std::cerr << "RsServer::run() Updates()" << std::endl; -#endif - - mConfigMgr->tick(); /* saves stuff */ - - } - - // every 60 loops (> 1 min) - if (++mLoop >= 60) - { - mLoop = 0; - - /* 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; - } +// keep the tick interval within allowed limits + if (mTickInterval < minTickInterval) + mTickInterval = minTickInterval; + else if (mTickInterval > maxTickInterval) + mTickInterval = maxTickInterval; +#ifdef TICK_DEBUG + RsDbg() << "TICK_DEBUG new tick interval after limiter " << mTickInterval << std::endl; #endif } + diff --git a/libretroshare/src/rsserver/p3face.h b/libretroshare/src/rsserver/p3face.h index 320c6f991..a2637ceaf 100644 --- a/libretroshare/src/rsserver/p3face.h +++ b/libretroshare/src/rsserver/p3face.h @@ -172,8 +172,8 @@ public: // p3Posted *mPosted; // p3PhotoService *mPhoto; // p3GxsCircles *mGxsCircles; -// p3GxsNetService *mGxsNetService; -// p3IdService *mGxsIdService; +// p3GxsNetService *mGxsNetService; +// p3IdService *mGxsIdService; // p3GxsForums *mGxsForums; // p3GxsChannels *mGxsChannels; // p3Wire *mWire; @@ -188,16 +188,14 @@ public: // Worker Data..... - int mMin ; - int mLoop ; - int mLastts ; - long mLastSec ; - double mAvgTickRate ; - double mTimeDelta ; + double mLastts; + double mTickInterval; + double mLastRunDuration; + double mAvgRunDuration; + double mCycle1, mCycle2, mCycle3, mCycle4; - static const double minTimeDelta; // 25; - static const double maxTimeDelta; - static const double kickLimit; + static const double minTickInterval; + static const double maxTickInterval; /// @see RsControl::setShutdownCallback std::function mShutdownCallback; diff --git a/libretroshare/src/rsserver/rsinit.cc b/libretroshare/src/rsserver/rsinit.cc index 73a70d0c5..25391fcbe 100644 --- a/libretroshare/src/rsserver/rsinit.cc +++ b/libretroshare/src/rsserver/rsinit.cc @@ -1193,7 +1193,7 @@ int RsServer::StartupRetroShare() std::cerr << "(EE) Cannot create extensions directory " << extensions_dir << ". 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. // possible entries include: /usr/lib/retroshare, ~/.retroshare/extensions/, etc. #endif diff --git a/libretroshare/src/serialiser/rstypeserializer.cc b/libretroshare/src/serialiser/rstypeserializer.cc index 8e029e3dd..7ed98bd7f 100644 --- a/libretroshare/src/serialiser/rstypeserializer.cc +++ b/libretroshare/src/serialiser/rstypeserializer.cc @@ -542,28 +542,33 @@ void RsTypeSerializer::RawMemoryWrapper::serial_process( ctx.mOffset += second; break; case RsGenericSerializer::DESERIALIZE: - { - // In case first,second is not properly initialized, we set them to nullptr,0 - first = nullptr; - second = 0; + if(first || second) + { + /* Items are created anew before deserialization so buffer pointer + * must be null and size 0 at this point */ - uint32_t serialSize = 0; - RS_SERIAL_PROCESS(serialSize); + RsWarn() << __PRETTY_FUNCTION__ << " DESERIALIZE got uninitialized " + << " 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; - ctx.mOk = (serialSize <= MAX_SERIALIZED_CHUNK_SIZE); - + ctx.mOk = (second <= MAX_SERIALIZED_CHUNK_SIZE); if(!ctx.mOk) { RsErr() << __PRETTY_FUNCTION__ << std::errc::message_size << " " - << serialSize << " > " << MAX_SERIALIZED_CHUNK_SIZE + << second << " > " << MAX_SERIALIZED_CHUNK_SIZE << std::endl; clear(); break; } - if(!serialSize) + if(!second) { Dbg3() << __PRETTY_FUNCTION__ << " Deserialized empty memory chunk" << std::endl; @@ -571,25 +576,21 @@ void RsTypeSerializer::RawMemoryWrapper::serial_process( break; } - ctx.mOk = (ctx.mSize >= ctx.mOffset + serialSize); - + ctx.mOk = ctx.mSize >= ctx.mOffset + second; 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(); clear(); break; } - first = reinterpret_cast(malloc(serialSize)); - second = serialSize; - - memcpy(first, ctx.mData + ctx.mOffset, serialSize); - ctx.mOffset += serialSize; - + first = reinterpret_cast(malloc(second)); + memcpy(first, ctx.mData + ctx.mOffset, second); + ctx.mOffset += second; break; - } case RsGenericSerializer::PRINT: break; case RsGenericSerializer::TO_JSON: { diff --git a/libretroshare/src/services/p3gxschannels.cc b/libretroshare/src/services/p3gxschannels.cc index 9e0072d5b..a813c92e8 100644 --- a/libretroshare/src/services/p3gxschannels.cc +++ b/libretroshare/src/services/p3gxschannels.cc @@ -1137,11 +1137,30 @@ bool p3GxsChannels::getChannelContent( const RsGxsGroupId& channelId, msgIds[channelId] = contentIds; if( !requestMsgInfo(token, opts, msgIds) || waitToken(token) != RsTokenService::COMPLETE ) - return false; + return false; return getPostData(token, posts, comments); } +bool p3GxsChannels::getChannelComments(const RsGxsGroupId &channelId, + const std::set &contentIds, + std::vector &comments) +{ + std::vector 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( const std::string& name, const std::string& description, const RsGxsImage& thumbnail, const RsGxsId& authorId, diff --git a/libretroshare/src/services/p3gxschannels.h b/libretroshare/src/services/p3gxschannels.h index 843023fb8..d85372e65 100644 --- a/libretroshare/src/services/p3gxschannels.h +++ b/libretroshare/src/services/p3gxschannels.h @@ -196,6 +196,11 @@ virtual bool ExtraFileRemove(const RsFileHash &hash); std::vector& posts, std::vector& comments ) override; + /// Implementation of @see RsGxsChannels::getChannelComments + virtual bool getChannelComments(const RsGxsGroupId &channelId, + const std::set &contentIds, + std::vector &comments) override; + /// Implementation of @see RsGxsChannels::getContentSummaries bool getContentSummaries( const RsGxsGroupId& channelId, diff --git a/retroshare-gui/src/gui/Circles/CreateCircleDialog.cpp b/retroshare-gui/src/gui/Circles/CreateCircleDialog.cpp index e6821a088..59b0da95d 100644 --- a/retroshare-gui/src/gui/Circles/CreateCircleDialog.cpp +++ b/retroshare-gui/src/gui/Circles/CreateCircleDialog.cpp @@ -78,6 +78,11 @@ CreateCircleDialog::CreateCircleDialog() headerText = headerItem->text(RSCIRCLEID_COL_KEYID); 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.addButton->setEnabled(false); ui.radioButton_ListAll->setChecked(true); diff --git a/retroshare-gui/src/gui/Circles/CreateCircleDialog.ui b/retroshare-gui/src/gui/Circles/CreateCircleDialog.ui index 773980cc7..61923d757 100644 --- a/retroshare-gui/src/gui/Circles/CreateCircleDialog.ui +++ b/retroshare-gui/src/gui/Circles/CreateCircleDialog.ui @@ -6,8 +6,8 @@ 0 0 - 1211 - 647 + 721 + 561 @@ -106,8 +106,8 @@ - - :/images/back.png:/images/back.png + + :/icons/png/arrow-left.png:/icons/png/arrow-left.png @@ -120,8 +120,8 @@ - - :/images/forward.png:/images/forward.png + + :/icons/png/arrow-right.png:/icons/png/arrow-right.png diff --git a/retroshare-gui/src/gui/MainWindow.cpp b/retroshare-gui/src/gui/MainWindow.cpp index d66421243..08342517f 100644 --- a/retroshare-gui/src/gui/MainWindow.cpp +++ b/retroshare-gui/src/gui/MainWindow.cpp @@ -478,6 +478,9 @@ void MainWindow::initStackedPage() } #endif + + addPage(newsFeed = new NewsFeed(ui->stackPages), grp, ¬ify); + //List All notify before Setting was created QList > >::iterator notifyIt; for (notifyIt = notify.begin(); notifyIt != notify.end(); ++notifyIt) { @@ -489,7 +492,6 @@ void MainWindow::initStackedPage() } } - addPage(newsFeed = new NewsFeed(ui->stackPages), grp, ¬ify); addPage(settingsDialog = new SettingsPage(ui->stackPages),grp,¬ify); /* Create the toolbar */ diff --git a/retroshare-gui/src/gui/NewsFeed.cpp b/retroshare-gui/src/gui/NewsFeed.cpp index 9b85a32d1..5d41bb0f1 100644 --- a/retroshare-gui/src/gui/NewsFeed.cpp +++ b/retroshare-gui/src/gui/NewsFeed.cpp @@ -494,7 +494,7 @@ void NewsFeed::addFeedItemIfUnique(FeedItem *item, bool replace) } addFeedItem(item); - sendNewsFeedChanged(); + //sendNewsFeedChanged(); //Already done by addFeedItem() } void NewsFeed::remUniqueFeedItem(FeedItem *item) diff --git a/retroshare-gui/src/gui/Posted/PostedItem.h b/retroshare-gui/src/gui/Posted/PostedItem.h index e6557548f..c0c5ace44 100644 --- a/retroshare-gui/src/gui/Posted/PostedItem.h +++ b/retroshare-gui/src/gui/Posted/PostedItem.h @@ -94,6 +94,8 @@ private: class PostedItem: public BasePostedItem { + Q_OBJECT + public: 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); diff --git a/retroshare-gui/src/gui/TheWire/WireGroupItem.ui b/retroshare-gui/src/gui/TheWire/WireGroupItem.ui index d990da6d9..b0d53f4c6 100644 --- a/retroshare-gui/src/gui/TheWire/WireGroupItem.ui +++ b/retroshare-gui/src/gui/TheWire/WireGroupItem.ui @@ -27,7 +27,7 @@ 0 - + QFrame::StyledPanel diff --git a/retroshare-gui/src/gui/chat/ChatWidget.ui b/retroshare-gui/src/gui/chat/ChatWidget.ui index 729e78143..91fc10696 100644 --- a/retroshare-gui/src/gui/chat/ChatWidget.ui +++ b/retroshare-gui/src/gui/chat/ChatWidget.ui @@ -241,6 +241,9 @@ border-image: url(:/images/closepressed.png) + + 2 + @@ -258,6 +261,9 @@ border-image: url(:/images/closepressed.png) T + + true + Qt::AlignCenter @@ -448,133 +454,6 @@ border-image: url(:/images/closepressed.png) - - - - Qt::NoFocus - - - - :/icons/png/options2.png:/icons/png/options2.png - - - - 28 - 28 - - - - QToolButton::InstantPopup - - - true - - - - - - - - 0 - 0 - - - - Qt::NoFocus - - - Qt::CustomContextMenu - - - - :/icons/png/search.png:/icons/png/search.png - - - - 28 - 28 - - - - true - - - true - - - - - - - - - - - 0 - 0 - - - - Qt::NoFocus - - - - :/icons/png/highlight.png:/icons/png/highlight.png - - - - 28 - 28 - - - - true - - - true - - - - - - - Qt::NoFocus - - - - :/icons/png/arrow-left.png:/icons/png/arrow-left.png - - - - 28 - 28 - - - - true - - - - - - - Qt::NoFocus - - - - :/icons/png/arrow-right.png:/icons/png/arrow-right.png - - - - 28 - 28 - - - - true - - - @@ -786,6 +665,133 @@ border-image: url(:/images/closepressed.png) + + + + + 0 + 0 + + + + Qt::NoFocus + + + Qt::CustomContextMenu + + + + :/icons/png/search.png:/icons/png/search.png + + + + 28 + 28 + + + + true + + + true + + + + + + + + + + + 0 + 0 + + + + Qt::NoFocus + + + + :/icons/png/highlight.png:/icons/png/highlight.png + + + + 28 + 28 + + + + true + + + true + + + + + + + Qt::NoFocus + + + + :/icons/png/arrow-left.png:/icons/png/arrow-left.png + + + + 28 + 28 + + + + true + + + + + + + Qt::NoFocus + + + + :/icons/png/arrow-right.png:/icons/png/arrow-right.png + + + + 28 + 28 + + + + true + + + + + + + Qt::NoFocus + + + + :/icons/png/options2.png:/icons/png/options2.png + + + + 28 + 28 + + + + QToolButton::InstantPopup + + + true + + + diff --git a/retroshare-gui/src/gui/common/NewFriendList.cpp b/retroshare-gui/src/gui/common/NewFriendList.cpp index 131281285..9d9908642 100644 --- a/retroshare-gui/src/gui/common/NewFriendList.cpp +++ b/retroshare-gui/src/gui/common/NewFriendList.cpp @@ -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 // http://bugreports.qt.nokia.com/browse/QTBUG-8270 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()); @@ -915,6 +915,25 @@ void FriendsDialog::viewprofile() * * 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."<& older_versions) : @@ -82,9 +82,9 @@ GxsChannelPostItem::GxsChannelPostItem(FeedHolder *feedHolder, uint32_t feedId, v.push_back(messageId); setMessageVersions(v) ; - setup(); + setup(); - loadGroup(); + loadGroup(); } // GxsChannelPostItem::GxsChannelPostItem(FeedHolder *feedHolder, uint32_t feedId, const RsGxsChannelPost& post, bool isHome, bool autoUpdate,const std::set& older_versions) : @@ -162,7 +162,7 @@ void GxsChannelPostItem::setup() ui->voteDownButton->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/vote_down.png")); ui->downloadButton->setIcon(FilesDefs::getIconFromQtResourcePath(":/icons/png/download.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->copyLinkButton->setIcon(FilesDefs::getIconFromQtResourcePath(":/icons/png/copy.png")); ui->expandButton->setIcon(FilesDefs::getIconFromQtResourcePath(":/icons/png/down-arrow.png")); @@ -173,6 +173,7 @@ void GxsChannelPostItem::setup() mInFill = false; mCloseOnRead = false; + mLoaded = false; /* clear ui */ ui->titleLabel->setText(tr("Loading...")); @@ -385,13 +386,13 @@ void GxsChannelPostItem::loadComment() std::vector posts; std::vector comments; - if(! rsGxsChannels->getChannelContent( groupId(),msgIds,posts,comments)) + if(! rsGxsChannels->getChannelComments( groupId(),msgIds,comments)) { RsErr() << "GxsGxsChannelGroupItem::loadGroup() ERROR getting data" << std::endl; return; } - int comNb = comments.size(); + int comNb = comments.size(); RsQThreadUtils::postToObject( [comNb,this]() { diff --git a/retroshare-gui/src/gui/feeds/GxsChannelPostItem.ui b/retroshare-gui/src/gui/feeds/GxsChannelPostItem.ui index e3558ea10..3c524b1d6 100644 --- a/retroshare-gui/src/gui/feeds/GxsChannelPostItem.ui +++ b/retroshare-gui/src/gui/feeds/GxsChannelPostItem.ui @@ -77,7 +77,7 @@ - + 0 @@ -486,17 +486,17 @@ - - StyledLabel - QLabel -
gui/common/StyledLabel.h
-
ElidedLabel QLabel
gui/common/ElidedLabel.h
1
+ + StyledElidedLabel + QLabel +
gui/common/StyledElidedLabel.h
+
diff --git a/retroshare-gui/src/gui/feeds/MsgItem.ui b/retroshare-gui/src/gui/feeds/MsgItem.ui index 0437b72b5..592376182 100644 --- a/retroshare-gui/src/gui/feeds/MsgItem.ui +++ b/retroshare-gui/src/gui/feeds/MsgItem.ui @@ -162,7 +162,7 @@ Reply Message - + :/images/mail_reply.png:/images/mail_reply.png
@@ -196,7 +196,7 @@ - :/icons/png/cancel.png:/icons/png/cancel.png + :/icons/mail/delete.png:/icons/mail/delete.png
diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp index 309952bc3..66d25fafb 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp @@ -328,15 +328,7 @@ GxsForumThreadWidget::GxsForumThreadWidget(const RsGxsGroupId &forumId, QWidget //ui->threadTreeWidget->installEventFilter(this) ; - 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()); + blankPost(); ui->subscribeToolButton->setToolTip(tr( "

Subscribing to the forum will gather \ available posts from your subscribed friends, and make the \ @@ -376,29 +368,17 @@ void GxsForumThreadWidget::handleEvent_main_thread(std::shared_ptrprogressBar->hide(); - ui->progressText->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->subscribeToolButton->hide(); + ui->newthreadButton->hide(); 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); - mStateHelper->setWidgetEnabled(ui->previousButton, false); - mStateHelper->setWidgetEnabled(ui->nextButton, false); - - ui->versions_CB->hide(); + blankPost(); } GxsForumThreadWidget::~GxsForumThreadWidget() @@ -883,16 +863,38 @@ void GxsForumThreadWidget::clearForumDescription() 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) { - if(!success) - { + if(!success) + { + blank(); QString forum_description = QString("ERROR: Forum could not be loaded. Database might be in heavy use. Please try later."); ui->postText->setText(forum_description); mStateHelper->setWidgetEnabled(ui->newthreadButton, false); - - return; - } + return; + } std::cerr << "Updating forum description" << std::endl; if (!mThreadId.isNull()) @@ -906,7 +908,10 @@ void GxsForumThreadWidget::updateForumDescription(bool success) const RsGxsForumGroup& group = mForumGroup; - ui->forumName->setText(QString::fromUtf8(group.mMeta.mGroupName.c_str())); + ui->newthreadButton->show(); + ui->forumName->setText(QString::fromUtf8(group.mMeta.mGroupName.c_str())); + ui->viewBox->setEnabled(true); + ui->filterLineEdit->setEnabled(true); QString anti_spam_features1 ; QString forum_description; @@ -1019,6 +1024,9 @@ void GxsForumThreadWidget::insertMessage() return; } + /* blank text, incase we get nothing */ + blankPost(); + // We use this instead of getCurrentIndex() because right here the currentIndex() is not set yet. QModelIndex index = mThreadProxyModel->mapFromSource(mThreadModel->getIndexOfMessage(mOrigThreadId)); @@ -1043,18 +1051,7 @@ void GxsForumThreadWidget::insertMessage() return; } - mStateHelper->setWidgetEnabled(ui->newmessageButton, (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()); + ui->newmessageButton->setEnabled(IS_GROUP_SUBSCRIBED(mForumGroup.mMeta.mSubscribeFlags) && mThreadId.isNull() == false); // 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 = (overall_reputation == RsReputationLevel::LOCALLY_NEGATIVE); - ui->time_label->setText(DateTime::formatLongDateTime(msg.mMeta.mPublishTs)); - ui->by_label->setId(msg.mMeta.mAuthorId); - ui->lineRight->show(); + ui->nextUnreadButton->setEnabled(true); ui->lineLeft->show(); + ui->time_label->setText(DateTime::formatLongDateTime(msg.mMeta.mPublishTs)); + ui->lineRight->show(); ui->by_text_label->show(); + ui->by_label->setId(msg.mMeta.mAuthorId); ui->by_label->show(); 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); ui->postText->setHtml(extraTxt); } + + QStringList urls; + RsHtml::findAnchors(ui->postText->toHtml(), urls); + ui->downloadButton->setEnabled(urls.count() > 0); } void GxsForumThreadWidget::previousMessage() @@ -1675,6 +1677,9 @@ void GxsForumThreadWidget::filterItems(const QString& text) void GxsForumThreadWidget::postForumLoading() { + if(groupId().isNull()) + return; + #ifdef DEBUG_FORUMS std::cerr << "Post forum loading..." << std::endl; #endif @@ -1719,12 +1724,15 @@ void GxsForumThreadWidget::postForumLoading() // 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->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; } void GxsForumThreadWidget::updateGroupData() diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h index 6a880ee74..a071e5416 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h @@ -101,9 +101,9 @@ private slots: void changedSelection(const QModelIndex &, const QModelIndex &); void changedThread(QModelIndex index); void changedVersion(); - void clickedThread (QModelIndex index); - void postForumLoading(); - + void clickedThread (QModelIndex index); + void postForumLoading(); + void reply_with_private_message(); void replytoforummessage(); void editforummessage(); @@ -157,9 +157,9 @@ private: void saveExpandedItems(QList& expanded_items) const; int getSelectedMsgCount(QList *pRows, QList *pRowsRead, QList *pRowsUnread); - void setMsgReadStatus(QList &rows, bool read); - void markMsgAsReadUnread(bool read, bool children, bool forum, RsGxsMessageId msgId = RsGxsMessageId()); - void calculateUnreadCount(); + void setMsgReadStatus(QList &rows, bool read); + void markMsgAsReadUnread(bool read, bool children, bool forum, RsGxsMessageId msgId = RsGxsMessageId()); + void calculateUnreadCount(); void togglethreadview_internal(); @@ -178,6 +178,7 @@ private: private: void setForumDescriptionLoading(); void clearForumDescription(); + void blankPost(); RsGxsGroupId mLastForumID; RsGxsMessageId mThreadId; diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.ui b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.ui index d4b59faac..5fa0c36dd 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.ui +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.ui @@ -245,32 +245,6 @@ - - - - - 24 - 24 - - - - Qt::NoFocus - - - Download all files - - - Qt::LeftToRight - - - - :/icons/png/download.png:/icons/png/download.png - - - true - - - @@ -300,53 +274,7 @@ - - - - - 24 - 24 - - - - Qt::NoFocus - - - - - - - :/images/edit_remove24.png:/images/edit_remove24.png - - - true - - - true - - - - - - - Qt::Vertical - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - + @@ -384,7 +312,7 @@ - + false @@ -425,38 +353,7 @@ - - - - - - - - - - - Qt::Vertical - - - - - - - - - - - - - - - - - By - - - - + @@ -479,6 +376,109 @@ + + + + + 24 + 24 + + + + Qt::NoFocus + + + Download all files + + + Qt::LeftToRight + + + + :/icons/png/download.png:/icons/png/download.png + + + true + + + + + + + Qt::Vertical + + + + + + + + + + + + + + + + + Qt::Vertical + + + + + + + By + + + + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 24 + 24 + + + + Qt::NoFocus + + + + + + + :/images/edit_remove24.png:/images/edit_remove24.png + + + true + + + true + + + diff --git a/retroshare-gui/src/gui/icons/png/leave.png b/retroshare-gui/src/gui/icons/png/leave.png index df5af7ced..6cb7c154e 100644 Binary files a/retroshare-gui/src/gui/icons/png/leave.png and b/retroshare-gui/src/gui/icons/png/leave.png differ diff --git a/retroshare-gui/src/gui/msgs/MessageWindow.cpp b/retroshare-gui/src/gui/msgs/MessageWindow.cpp index 0dc9e8ef4..17355143f 100644 --- a/retroshare-gui/src/gui/msgs/MessageWindow.cpp +++ b/retroshare-gui/src/gui/msgs/MessageWindow.cpp @@ -55,19 +55,13 @@ MessageWindow::MessageWindow(QWidget *parent, Qt::WindowFlags flags) msgWidget = NULL; - // create tag menu + // create tag menu TagsMenu *menu = new TagsMenu (tr("Tags"), this); connect(menu, SIGNAL(aboutToShow()), this, SLOT(tagAboutToShow())); connect(menu, SIGNAL(tagSet(int, bool)), this, SLOT(tagSet(int, bool))); connect(menu, SIGNAL(tagRemoveAll()), this, SLOT(tagRemoveAll())); 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 QMenu *viewmenu = new QMenu(); @@ -92,7 +86,7 @@ void MessageWindow::processSettings(bool load) // load settings /* 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); } else { // save settings @@ -115,11 +109,6 @@ void MessageWindow::addWidget(MessageWidget *widget) ui.msgLayout->addWidget(msgWidget); 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, actionPrint); msgWidget->connectAction(MessageWidget::ACTION_PRINT_PREVIEW, ui.actionPrint_Preview); @@ -210,13 +199,7 @@ void MessageWindow::setupFileActions() void MessageWindow::setToolbarButtonStyle(Qt::ToolButtonStyle 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.printButton->setToolButtonStyle(style); - ui.viewtoolButton->setToolButtonStyle(style); } void MessageWindow::buttonStyle() diff --git a/retroshare-gui/src/gui/msgs/MessageWindow.ui b/retroshare-gui/src/gui/msgs/MessageWindow.ui index 7c5689dd7..d15d5447d 100644 --- a/retroshare-gui/src/gui/msgs/MessageWindow.ui +++ b/retroshare-gui/src/gui/msgs/MessageWindow.ui @@ -81,8 +81,8 @@ Compose - - :/images/folder-draft24.png:/images/folder-draft24.png + + :/icons/mail/compose.png:/icons/mail/compose.png @@ -91,7 +91,7 @@ - Qt::ToolButtonIconOnly + Qt::ToolButtonTextBesideIcon true @@ -105,174 +105,20 @@ - - - - Qt::NoFocus + + + + Qt::Horizontal - - Reply to selected message - - - Reply - - - - :/images/replymail-pressed.png:/images/replymail-pressed.png - - + - 24 - 24 + 40 + 20 - - Qt::ToolButtonIconOnly - - - true - - + - - - Qt::NoFocus - - - Reply all to selected message - - - Reply all - - - - :/images/replymailall24-hover.png:/images/replymailall24-hover.png - - - - 24 - 24 - - - - Qt::ToolButtonIconOnly - - - true - - - - - - - - 0 - 0 - - - - - 16777 - 16777 - - - - Qt::NoFocus - - - Forward selected message - - - Forward - - - - :/images/mailforward24-hover.png:/images/mailforward24-hover.png - - - - 24 - 24 - - - - Qt::ToolButtonIconOnly - - - true - - - - - - - Qt::Vertical - - - - - - - Qt::NoFocus - - - Remove selected message - - - Delete - - - - :/images/deletemail24.png:/images/deletemail24.png - - - - 24 - 24 - - - - Qt::ToolButtonIconOnly - - - true - - - - - - - Qt::NoFocus - - - Print selected message - - - Print - - - - :/images/print24.png:/images/print24.png - - - - 24 - 24 - - - - QToolButton::MenuButtonPopup - - - Qt::ToolButtonIconOnly - - - true - - - - Qt::NoFocus @@ -291,27 +137,14 @@ - QToolButton::MenuButtonPopup + QToolButton::InstantPopup true - - - - Qt::Horizontal - - - - 40 - 20 - - - - - + Qt::NoFocus @@ -323,8 +156,8 @@ Tags - - :/images/tag24.png:/images/tag24.png + + :/icons/mail/tags.png:/icons/mail/tags.png @@ -333,7 +166,10 @@ - QToolButton::MenuButtonPopup + QToolButton::InstantPopup + + + Qt::ToolButtonTextBesideIcon true @@ -355,7 +191,7 @@ 0 0 698 - 20 + 21 @@ -396,6 +232,7 @@ + diff --git a/retroshare-gui/src/gui/qss/stylesheet/Standard.qss b/retroshare-gui/src/gui/qss/stylesheet/Standard.qss index ea8b32337..f63132d48 100644 --- a/retroshare-gui/src/gui/qss/stylesheet/Standard.qss +++ b/retroshare-gui/src/gui/qss/stylesheet/Standard.qss @@ -732,6 +732,10 @@ GxsForumThreadWidget QToolButton#subscribeToolButton:hover { border-radius: 4px; } +GxsForumMsgItem QFrame#frame{ + background-color: white; +} + GxsChannelPostsWidget QFrame#infoFrame { @@ -787,6 +791,10 @@ PostedItem QFrame#frame_notes { background: white; } +PostedItem QFrame#mainFrame { + background-color: white; +} + PostedItem QLabel#notes { } @@ -832,6 +840,11 @@ PostedCardView QFrame#voteFrame { background: #f8f9fa; } +PostedCardView QFrame#mainFrame { + background: white; +} + + GxsCommentDialog QComboBox#sortBox { font: bold; color: #0099cc; @@ -870,3 +883,10 @@ WireGroupItem QWidget:hover background-color: #7ecbfb; } +WireDialog QFrame#frame{ + background-color: white; +} + +WireDialog QWidget#scrollAreaWidgetContents_groups{ + background-color: white; +} diff --git a/retroshare-gui/src/gui/settings/ServerPage.cpp b/retroshare-gui/src/gui/settings/ServerPage.cpp index 1f178405d..2881acd60 100755 --- a/retroshare-gui/src/gui/settings/ServerPage.cpp +++ b/retroshare-gui/src/gui/settings/ServerPage.cpp @@ -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_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_proxyLabel_i2p->hide() ; ui.hiddenpage_proxyPort_i2p->hide() ; @@ -109,8 +107,7 @@ ServerPage::ServerPage(QWidget * parent, Qt::WindowFlags flags) } 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); + ui.hiddenServiceTab->removeTab(TAB_HIDDEN_SERVICE_INCOMING); // warning: the order of operation here is very important. } ui.filteredIpsTable->setHorizontalHeaderItem(COLUMN_RANGE,new QTableWidgetItem(tr("IP Range"))) ; diff --git a/retroshare-gui/src/gui/settings/rsharesettings.cpp b/retroshare-gui/src/gui/settings/rsharesettings.cpp index 8888795f6..2d4a33c7b 100644 --- a/retroshare-gui/src/gui/settings/rsharesettings.cpp +++ b/retroshare-gui/src/gui/settings/rsharesettings.cpp @@ -113,10 +113,10 @@ void RshareSettings::initSettings() #else static QStringList styles = QStyleFactory::keys(); #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"); - else if (styles.contains("windowsxp", Qt::CaseInsensitive)) - setDefault(SETTING_STYLE, "windowsxp"); else #endif { diff --git a/retroshare-gui/src/qss/blacknight.qss b/retroshare-gui/src/qss/blacknight.qss index b20649895..3f08e0aa8 100644 --- a/retroshare-gui/src/qss/blacknight.qss +++ b/retroshare-gui/src/qss/blacknight.qss @@ -23,7 +23,7 @@ FriendSelectionWidget qproperty-textColorOnline: lightBlue; } -FriendList +NewFriendList { qproperty-textColorStatusOffline: white; qproperty-textColorStatusAway: gray; diff --git a/retroshare-gui/src/qss/qdarkstyle-v2.qss b/retroshare-gui/src/qss/qdarkstyle-v2.qss index 56afc36fc..0ad0b4d51 100644 --- a/retroshare-gui/src/qss/qdarkstyle-v2.qss +++ b/retroshare-gui/src/qss/qdarkstyle-v2.qss @@ -1940,7 +1940,7 @@ PlotWidget { padding: 0px; /* to fix cut labels in plots #134 */ } -FriendList { +NewFriendList { qproperty-textColorStatusAway: lightgray; qproperty-textColorStatusBusy: lightgray; qproperty-textColorStatusOnline: green; diff --git a/retroshare-gui/src/qss/qdarkstyle.qss b/retroshare-gui/src/qss/qdarkstyle.qss index 94e31596c..c6ceb7147 100644 --- a/retroshare-gui/src/qss/qdarkstyle.qss +++ b/retroshare-gui/src/qss/qdarkstyle.qss @@ -833,7 +833,7 @@ QDockWidget::close-button:pressed, QDockWidget::float-button:pressed { background: rgba(255, 255, 255, 10); } -FriendList { +NewFriendList { qproperty-textColorStatusAway: lightgray; qproperty-textColorStatusBusy: lightgray; qproperty-textColorStatusOnline: green;