From 159fad476a95df39bb8b88bb59074917c318c7c6 Mon Sep 17 00:00:00 2001 From: defnax Date: Sun, 26 Apr 2020 00:40:05 +0200 Subject: [PATCH 01/27] Set default column width for nickname columns & fixed missed icons * Set default column width for nickname columns & fixed missed icons * Set by default white background color for the Follower list frame --- .../src/gui/Circles/CreateCircleDialog.cpp | 5 +++++ retroshare-gui/src/gui/Circles/CreateCircleDialog.ui | 12 ++++++------ retroshare-gui/src/gui/TheWire/WireGroupItem.ui | 2 +- retroshare-gui/src/gui/qss/stylesheet/Standard.qss | 3 +++ 4 files changed, 15 insertions(+), 7 deletions(-) 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/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/qss/stylesheet/Standard.qss b/retroshare-gui/src/gui/qss/stylesheet/Standard.qss index ea8b32337..21e81ec92 100644 --- a/retroshare-gui/src/gui/qss/stylesheet/Standard.qss +++ b/retroshare-gui/src/gui/qss/stylesheet/Standard.qss @@ -870,3 +870,6 @@ WireGroupItem QWidget:hover background-color: #7ecbfb; } +WireDialog QFrame#frame{ + background-color: white; +} From 936cda9910d555d2592ee3e0398429839c247bc9 Mon Sep 17 00:00:00 2001 From: Phenom Date: Sun, 26 Apr 2020 11:57:20 +0200 Subject: [PATCH 02/27] Add some words for QtCreator and build batch to Win install guide. --- .../Windows-msys2/WindowsMSys2_InstallGuide.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) 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 From 9a9eb56a3aff6bb338f02e6057f1d431dc99a230 Mon Sep 17 00:00:00 2001 From: Olivier Marty Date: Mon, 27 Apr 2020 16:08:20 +0200 Subject: [PATCH 03/27] clean rewrite of RsServer::threadTick --- libretroshare/src/rsserver/p3face-server.cc | 232 ++++++++------------ libretroshare/src/rsserver/p3face.h | 19 +- 2 files changed, 100 insertions(+), 151 deletions(-) diff --git a/libretroshare/src/rsserver/p3face-server.cc b/libretroshare/src/rsserver/p3face-server.cc index 54605333b..2abf16e98 100644 --- a/libretroshare/src/rsserver/p3face-server.cc +++ b/libretroshare/src/rsserver/p3face-server.cc @@ -73,14 +73,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 +107,16 @@ RsServer::RsServer() : msgSrv = NULL; chatSrv = NULL; mStatusSrv = NULL; - mGxsTunnels = NULL; + mGxsTunnels = NULL; - mMin = 0; - mLoop = 0; + mLastts = getCurrentTS(); + mTickInterval = maxTickInterval ; + mAvgRunDuration = 0; + mLastRunDuration = 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 +126,101 @@ 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); +RsDbg() << "DEBUG_TICK" << std::endl; +RsDbg() << "DEBUG_TICK ticking interval "<< mTickInterval << std::endl; - 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 +// we try to tick at a regular interval which depends on the load +// if there is time left, we sleep + double timeToSleep = mTickInterval - mAvgRunDuration; - mLastts = ts; + if (timeToSleep > 0) + { +RsDbg() << "DEBUG_TICK will sleep " << timeToSleep << " ms" << std::endl; + rstime::rs_usleep(timeToSleep * 1000000); + } - /******************************** RUN SERVER *****************/ - lockRsCore(); + double ts = getCurrentTS(); + double delta = ts - mLastts; + mLastts = ts; - int moreToTick = pqih->tick(); +// stuff we do always +RsDbg() << "DEBUG_TICK ticking server" << std::endl; + lockRsCore(); + int moreToTick = pqih->tick(); + unlockRsCore(); -#ifdef DEBUG_TICK - std::cerr << "RsServer::run() ftserver->tick(): moreToTick: " << moreToTick << std::endl; -#endif - - unlockRsCore(); - - /* tick the Managers */ +// tick the managers +RsDbg() << "DEBUG_TICK ticking mPeerMgr" << std::endl; mPeerMgr->tick(); +RsDbg() << "DEBUG_TICK ticking mLinkMgr" << std::endl; mLinkMgr->tick(); +RsDbg() << "DEBUG_TICK ticking mNetMgr" << std::endl; mNetMgr->tick(); - /******************************** RUN SERVER *****************/ - /* adjust tick rate depending on whether there is more. - */ - mAvgTickRate = 0.2 * mTimeDelta + 0.8 * mAvgTickRate; - - if (1 == moreToTick) +// stuff we do every second + if (delta > 1) { - mTimeDelta = 0.9 * mAvgTickRate; - if (mTimeDelta > kickLimit) - { - /* force next tick in one sec - * if we are reading data. - */ - mTimeDelta = kickLimit; - mAvgTickRate = kickLimit; - } - } +RsDbg() << "DEBUG_TICK every second" << std::endl; + // slow services + if (rsPlugins) + rsPlugins->slowTickPlugins((rstime_t)ts); + // UDP keepalive + // tou_tick_stunkeepalive(); + // other stuff to tick + // update(); + } + +// stuff we do every five seconds + if (delta > 5) + { +RsDbg() << "DEBUG_TICK every 5 seconds" << std::endl; + // save stuff + mConfigMgr->tick(); + } + +// stuff we do every minute + if (delta > 60) + { +RsDbg() << "DEBUG_TICK 60 seconds" << std::endl; + // force saving FileTransferStatus TODO + // ftserver->saveFileTransferStatus(); + // see if we need to resave certs + // AuthSSL::getAuthSSL()->CheckSaveCertificates(); + } + +// stuff we do every hour + if (delta > 3600) + { +RsDbg() << "DEBUG_TICK every hour" << std::endl; + } + +// ticking is done, now compute new values of mLastRunDuration, mAvgRunDuration and mTickInterval + ts = getCurrentTS(); + mLastRunDuration = ts - mLastts; + mAvgRunDuration = 0.1 * mLastRunDuration + 0.9 * mAvgRunDuration; + +RsDbg() << "DEBUG_TICK new mLastRunDuration " << mLastRunDuration << " mAvgRunDuration " << mAvgRunDuration << std::endl; + if (mLastRunDuration > WARN_BIG_CYCLE_TIME) + RsDbg() << "DEBUG_TICK excessively long lycle time " << mLastRunDuration << std::endl; + +// if the core has returned that there is more to tick we decrease the ticking interval, else we increse it +RsDbg() << "DEBUG_TICK moreToTick " << moreToTick << std::endl; + if (moreToTick == 1) + mTickInterval = 0.9 * mTickInterval; else - { - mTimeDelta = 1.1 * mAvgTickRate; - } + mTickInterval = 1.1 * mTickInterval; +RsDbg() << "DEBUG_TICK new tick interval " << mTickInterval << std::endl; - /* 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; - } -#endif +// keep the tick interval within allowed limits + if (mTickInterval < minTickInterval) + mTickInterval = minTickInterval; + else if (mTickInterval > maxTickInterval) + mTickInterval = maxTickInterval; +RsDbg() << "DEBUG_TICK new tick interval after limiter " << mTickInterval << std::endl; } + diff --git a/libretroshare/src/rsserver/p3face.h b/libretroshare/src/rsserver/p3face.h index 320c6f991..bb0b15353 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,13 @@ public: // Worker Data..... - int mMin ; - int mLoop ; - int mLastts ; - long mLastSec ; - double mAvgTickRate ; - double mTimeDelta ; + double mLastts; + double mTickInterval; + double mLastRunDuration; + double mAvgRunDuration; - 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; From 6a9e0088974971d669d26fc0064bc69226fcdda4 Mon Sep 17 00:00:00 2001 From: Phenom Date: Mon, 27 Apr 2020 19:26:23 +0200 Subject: [PATCH 04/27] Change ChannelPostITem Title to Elided so you can read long one. --- retroshare-gui/src/gui/feeds/GxsChannelPostItem.ui | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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
+
From 6fc89c2d373898661296796daee2636c13fd6f93 Mon Sep 17 00:00:00 2001 From: Gioacchino Mazzurco Date: Mon, 27 Apr 2020 13:57:04 +0200 Subject: [PATCH 05/27] RawMemoryWrapper DESERIALIZE warn if got non null ptr --- .../src/serialiser/rstypeserializer.cc | 41 ++++++++++--------- 1 file changed, 21 insertions(+), 20 deletions(-) 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: { From 0f1a3879d06a64099e5c748fa8d2f0654ad00218 Mon Sep 17 00:00:00 2001 From: csoler Date: Mon, 27 Apr 2020 20:28:34 +0200 Subject: [PATCH 06/27] quick fix for debug flag that was left in the code --- libretroshare/src/rsserver/rsinit.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From b0613ef653fbee9bdc8c30d0bc72ff01e637055f Mon Sep 17 00:00:00 2001 From: Olivier Marty Date: Tue, 28 Apr 2020 09:48:12 +0200 Subject: [PATCH 07/27] Correct design flaw in slow process control, improve indentation, set up debug #ifdef --- libretroshare/src/rsserver/p3face-server.cc | 112 +++++++++++++------- libretroshare/src/rsserver/p3face.h | 5 +- 2 files changed, 76 insertions(+), 41 deletions(-) diff --git a/libretroshare/src/rsserver/p3face-server.cc b/libretroshare/src/rsserver/p3face-server.cc index 2abf16e98..65747739f 100644 --- a/libretroshare/src/rsserver/p3face-server.cc +++ b/libretroshare/src/rsserver/p3face-server.cc @@ -41,11 +41,10 @@ #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 @@ -113,6 +112,10 @@ RsServer::RsServer() : mTickInterval = maxTickInterval ; mAvgRunDuration = 0; mLastRunDuration = 0; + mCycle1 = 0; + mCycle2 = 0; + mCycle3 = 0; + mCycle4 = 0; /* caches (that need ticking) */ @@ -130,42 +133,54 @@ RsServer::~RsServer() void RsServer::threadTick() { -RsDbg() << "DEBUG_TICK" << std::endl; -RsDbg() << "DEBUG_TICK ticking interval "<< mTickInterval << std::endl; +#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; + double timeToSleep = mTickInterval - mAvgRunDuration; if (timeToSleep > 0) { -RsDbg() << "DEBUG_TICK will sleep " << timeToSleep << " ms" << std::endl; +#ifdef TICK_DEBUG + RsDbg() << "TICK_DEBUG will sleep " << timeToSleep << " ms" << std::endl; +#endif rstime::rs_usleep(timeToSleep * 1000000); } double ts = getCurrentTS(); - double delta = ts - mLastts; mLastts = ts; // stuff we do always -RsDbg() << "DEBUG_TICK ticking server" << std::endl; +// tick the core +#ifdef TICK_DEBUG + RsDbg() << "TICK_DEBUG ticking server" << std::endl; +#endif lockRsCore(); int moreToTick = pqih->tick(); unlockRsCore(); - // tick the managers -RsDbg() << "DEBUG_TICK ticking mPeerMgr" << std::endl; - mPeerMgr->tick(); -RsDbg() << "DEBUG_TICK ticking mLinkMgr" << std::endl; - mLinkMgr->tick(); -RsDbg() << "DEBUG_TICK ticking mNetMgr" << std::endl; - mNetMgr->tick(); +#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 (delta > 1) - { -RsDbg() << "DEBUG_TICK every second" << std::endl; + if (ts - mCycle1 > 1) + { +#ifdef TICK_DEBUG + RsDbg() << "TICK_DEBUG every second" << std::endl; +#endif // slow services if (rsPlugins) rsPlugins->slowTickPlugins((rstime_t)ts); @@ -173,54 +188,73 @@ RsDbg() << "DEBUG_TICK every second" << std::endl; // tou_tick_stunkeepalive(); // other stuff to tick // update(); + mCycle1 = ts; } // stuff we do every five seconds - if (delta > 5) + if (ts - mCycle2 > 5) { -RsDbg() << "DEBUG_TICK every 5 seconds" << std::endl; +#ifdef TICK_DEBUG + RsDbg() << "TICK_DEBUG every 5 seconds" << std::endl; +#endif // save stuff mConfigMgr->tick(); + mCycle2 = ts; } // stuff we do every minute - if (delta > 60) + if (ts - mCycle3 > 60) { -RsDbg() << "DEBUG_TICK 60 seconds" << std::endl; +#ifdef TICK_DEBUG + RsDbg() << "TICK_DEBUG every 60 seconds" << std::endl; +#endif // force saving FileTransferStatus TODO - // ftserver->saveFileTransferStatus(); + // ftserver->saveFileTransferStatus(); // see if we need to resave certs - // AuthSSL::getAuthSSL()->CheckSaveCertificates(); + // AuthSSL::getAuthSSL()->CheckSaveCertificates(); + mCycle3 = ts; } // stuff we do every hour - if (delta > 3600) + if (ts - mCycle4 > 3600) { -RsDbg() << "DEBUG_TICK every hour" << std::endl; +#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; + ts = getCurrentTS(); + mLastRunDuration = ts - mLastts; + mAvgRunDuration = 0.1 * mLastRunDuration + 0.9 * mAvgRunDuration; -RsDbg() << "DEBUG_TICK new mLastRunDuration " << mLastRunDuration << " mAvgRunDuration " << mAvgRunDuration << std::endl; - if (mLastRunDuration > WARN_BIG_CYCLE_TIME) - RsDbg() << "DEBUG_TICK excessively long lycle time " << mLastRunDuration << std::endl; +#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 -RsDbg() << "DEBUG_TICK moreToTick " << moreToTick << std::endl; +// 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 + else mTickInterval = 1.1 * mTickInterval; -RsDbg() << "DEBUG_TICK new tick interval " << mTickInterval << std::endl; +#ifdef TICK_DEBUG + RsDbg() << "TICK_DEBUG new tick interval " << mTickInterval << std::endl; +#endif // keep the tick interval within allowed limits - if (mTickInterval < minTickInterval) + if (mTickInterval < minTickInterval) mTickInterval = minTickInterval; - else if (mTickInterval > maxTickInterval) + else if (mTickInterval > maxTickInterval) mTickInterval = maxTickInterval; -RsDbg() << "DEBUG_TICK new tick interval after limiter " << mTickInterval << std::endl; +#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 bb0b15353..a2637ceaf 100644 --- a/libretroshare/src/rsserver/p3face.h +++ b/libretroshare/src/rsserver/p3face.h @@ -188,10 +188,11 @@ public: // Worker Data..... - double mLastts; - double mTickInterval; + double mLastts; + double mTickInterval; double mLastRunDuration; double mAvgRunDuration; + double mCycle1, mCycle2, mCycle3, mCycle4; static const double minTickInterval; static const double maxTickInterval; From 04dc163d30949e44a4582bac4c70ca10b68e766e Mon Sep 17 00:00:00 2001 From: sehraf Date: Tue, 28 Apr 2020 15:59:05 +0200 Subject: [PATCH 08/27] pqissl: document statemachine and function hierarchy --- libretroshare/src/pqi/pqissl.h | 67 +++++++++++++++++++++++++++++++++- 1 file changed, 65 insertions(+), 2 deletions(-) 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) }; From eab5821ac3854b53a51e1c02d18080abe7a654bc Mon Sep 17 00:00:00 2001 From: Phenom Date: Tue, 28 Apr 2020 19:39:07 +0200 Subject: [PATCH 09/27] Fix Forum Post ToolButton enabled case. Clear the tree widget too, when forum group selected else changing post do nothing. --- .../gui/gxsforums/GxsForumThreadWidget.cpp | 114 +++++----- .../src/gui/gxsforums/GxsForumThreadWidget.h | 13 +- .../src/gui/gxsforums/GxsForumThreadWidget.ui | 212 +++++++++--------- 3 files changed, 174 insertions(+), 165 deletions(-) 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 + + + From e8b8119174277043207883ffa1aac07677028b31 Mon Sep 17 00:00:00 2001 From: Phenom Date: Tue, 28 Apr 2020 00:51:56 +0200 Subject: [PATCH 10/27] Fix Channel Post Comments Number --- libretroshare/src/retroshare/rsgxschannels.h | 13 ++++++++++++ libretroshare/src/services/p3gxschannels.cc | 21 ++++++++++++++++++- libretroshare/src/services/p3gxschannels.h | 5 +++++ .../src/gui/feeds/GxsChannelPostItem.cpp | 4 ++-- 4 files changed, 40 insertions(+), 3 deletions(-) diff --git a/libretroshare/src/retroshare/rsgxschannels.h b/libretroshare/src/retroshare/rsgxschannels.h index c31eb011f..6b4f5e66a 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 channelId id of the channel of which the content is requested + * @param contentIds ids of requested contents + * @param 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/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/feeds/GxsChannelPostItem.cpp b/retroshare-gui/src/gui/feeds/GxsChannelPostItem.cpp index 5678cb018..b2a1d54c2 100644 --- a/retroshare-gui/src/gui/feeds/GxsChannelPostItem.cpp +++ b/retroshare-gui/src/gui/feeds/GxsChannelPostItem.cpp @@ -385,13 +385,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]() { From 43d39ff6f883cd50ceeee096fd072ac40068c966 Mon Sep 17 00:00:00 2001 From: defnax Date: Wed, 29 Apr 2020 14:30:16 +0200 Subject: [PATCH 11/27] Removed forgetten buttons from the popup mode message window * Removed the forgetten buttons from the popup mode message window * Added white background stylsheets for feeds Forum Msg item , Posted CardView & Follower Widget --- retroshare-gui/src/gui/msgs/MessageWindow.cpp | 21 +- retroshare-gui/src/gui/msgs/MessageWindow.ui | 205 ++---------------- .../src/gui/qss/stylesheet/Standard.qss | 17 ++ 3 files changed, 40 insertions(+), 203 deletions(-) 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 21e81ec92..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; @@ -873,3 +886,7 @@ WireGroupItem QWidget:hover WireDialog QFrame#frame{ background-color: white; } + +WireDialog QWidget#scrollAreaWidgetContents_groups{ + background-color: white; +} From 1c9bea730fafef1433e90a13ed487f20b5342932 Mon Sep 17 00:00:00 2001 From: Phenom Date: Wed, 29 Apr 2020 17:25:53 +0200 Subject: [PATCH 12/27] Fix Log User Notify --- retroshare-gui/src/gui/MainWindow.cpp | 4 +++- retroshare-gui/src/gui/NewsFeed.cpp | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) 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) From e8faa25c3b06b6ce757a9d61aa8ca678a56b6c69 Mon Sep 17 00:00:00 2001 From: Phenom Date: Wed, 29 Apr 2020 20:01:15 +0200 Subject: [PATCH 13/27] Fix NewFriendList in StyleSheet files. --- retroshare-gui/src/qss/blacknight.qss | 2 +- retroshare-gui/src/qss/qdarkstyle-v2.qss | 2 +- retroshare-gui/src/qss/qdarkstyle.qss | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) 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; From b6b581f4b0cb84076f702456a84e1e930274c001 Mon Sep 17 00:00:00 2001 From: Phenom Date: Thu, 30 Apr 2020 10:29:15 +0200 Subject: [PATCH 14/27] Fix NewFriendList delete by Keyboard --- .../src/gui/common/NewFriendList.cpp | 21 ++++++++++++++++++- retroshare-gui/src/gui/common/NewFriendList.h | 1 + 2 files changed, 21 insertions(+), 1 deletion(-) 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."< Date: Thu, 30 Apr 2020 15:17:22 +0200 Subject: [PATCH 15/27] Set by default for Windows Fusion style --- retroshare-gui/src/gui/settings/rsharesettings.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 { From c11eb3efbf219e3f64dc36e9c81176bd0efb2b8e Mon Sep 17 00:00:00 2001 From: defnax Date: Sat, 2 May 2020 00:07:30 +0200 Subject: [PATCH 16/27] Moved search & settings buttons to the top Moved search & settings buttons to the top --- retroshare-gui/src/gui/chat/ChatWidget.ui | 254 +++++++++++----------- 1 file changed, 127 insertions(+), 127 deletions(-) diff --git a/retroshare-gui/src/gui/chat/ChatWidget.ui b/retroshare-gui/src/gui/chat/ChatWidget.ui index 729e78143..a1ad38cb1 100644 --- a/retroshare-gui/src/gui/chat/ChatWidget.ui +++ b/retroshare-gui/src/gui/chat/ChatWidget.ui @@ -448,133 +448,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 +659,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 + + + From 06c84e043b098f4b07285f45ee3e8b1163fba8e0 Mon Sep 17 00:00:00 2001 From: defnax Date: Sat, 2 May 2020 00:28:44 +0200 Subject: [PATCH 17/27] changed color of the leave icon --- retroshare-gui/src/gui/icons/png/leave.png | Bin 3736 -> 3354 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/retroshare-gui/src/gui/icons/png/leave.png b/retroshare-gui/src/gui/icons/png/leave.png index df5af7ced17eb0885a0d1e6568f8ed9bee4cb13c..6cb7c154e5fa06586dcccee291f81ab5c8b773c4 100644 GIT binary patch delta 3292 zcmV<23?uWH9hw@DI|~<=000-40dE#NH<3mse+-vNL_t(|ob8=^a8%VD$3N$8LLMq8 zAyNof5P2kSBtGP zI_*%PJW@kQ5CcYD%7lbB#3k81{o`gayX<@Kz31M|`OGlM?%sROce&r3=kJ^&$T6Cr zf1m^WAs8WGNC<`qC=*a3p#<}v0h|H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XXu0mjftpWb% From 7db8cbca979774a21de8fbb0ead6c76c5d66f435 Mon Sep 17 00:00:00 2001 From: jolavillette Date: Sat, 2 May 2020 21:21:42 +0200 Subject: [PATCH 18/27] remove debug flag --- libretroshare/src/rsserver/p3face-server.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libretroshare/src/rsserver/p3face-server.cc b/libretroshare/src/rsserver/p3face-server.cc index 65747739f..0ed2f698c 100644 --- a/libretroshare/src/rsserver/p3face-server.cc +++ b/libretroshare/src/rsserver/p3face-server.cc @@ -41,7 +41,9 @@ #include "services/rseventsservice.h" +/******************* #define TICK_DEBUG 1 +*******************/ #define WARN_BIG_CYCLE_TIME (0.2) From 53b76732a98d08618baa052b004c9e57811c583e Mon Sep 17 00:00:00 2001 From: sehraf Date: Sun, 3 May 2020 14:54:52 +0200 Subject: [PATCH 19/27] pqisslistener: document accept() process --- libretroshare/src/pqi/pqissllistener.h | 67 ++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) 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 ********************************* */ From 638648cf6476152a6f1ba5abf53ec165ba92164f Mon Sep 17 00:00:00 2001 From: sehraf Date: Sun, 3 May 2020 20:57:48 +0200 Subject: [PATCH 20/27] fix json api markup --- libretroshare/src/retroshare/rsgxschannels.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libretroshare/src/retroshare/rsgxschannels.h b/libretroshare/src/retroshare/rsgxschannels.h index 6b4f5e66a..0fcde2960 100644 --- a/libretroshare/src/retroshare/rsgxschannels.h +++ b/libretroshare/src/retroshare/rsgxschannels.h @@ -337,9 +337,9 @@ public: * @brief Get channel comments corresponding to the given IDs. * If the set is empty, nothing is returned. * @jsonapi{development} - * @param channelId id of the channel of which the content is requested - * @param contentIds ids of requested contents - * @param comments storage for the comments + * @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, From 25f0119e4d601705454bd49138a1350934bb4be3 Mon Sep 17 00:00:00 2001 From: sehraf Date: Sun, 3 May 2020 20:58:36 +0200 Subject: [PATCH 21/27] Add back the I2P Bob confuguration page. It is used by both - clear net and hidden locations - to configure I2P either just as an in proxy (clear net location) or as a full service (hidden i2p location). --- retroshare-gui/src/gui/settings/ServerPage.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) 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"))) ; From 2c0cdf398a86a2587209148bf58033fc96c02634 Mon Sep 17 00:00:00 2001 From: defnax Date: Mon, 4 May 2020 22:27:57 +0200 Subject: [PATCH 22/27] Channel loading issue fix by ET --- retroshare-gui/src/gui/feeds/GxsChannelPostItem.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/retroshare-gui/src/gui/feeds/GxsChannelPostItem.cpp b/retroshare-gui/src/gui/feeds/GxsChannelPostItem.cpp index b2a1d54c2..e099be278 100644 --- a/retroshare-gui/src/gui/feeds/GxsChannelPostItem.cpp +++ b/retroshare-gui/src/gui/feeds/GxsChannelPostItem.cpp @@ -63,7 +63,7 @@ GxsChannelPostItem::GxsChannelPostItem(FeedHolder *feedHolder, uint32_t feedId, setMessageVersions(v) ; setup(); - + mLoaded = false; // no call to loadGroup() here because we have it already. } @@ -83,7 +83,7 @@ GxsChannelPostItem::GxsChannelPostItem(FeedHolder *feedHolder, uint32_t feedId, setMessageVersions(v) ; setup(); - + mLoaded = false; loadGroup(); } From c2372322e198989915376eac6c7c7336372a14a2 Mon Sep 17 00:00:00 2001 From: defnax Date: Tue, 5 May 2020 01:46:07 +0200 Subject: [PATCH 23/27] Fixed stylesheet issues on PostedItem class * Fixed stylesheet issues on PostedItem class --- retroshare-gui/src/gui/Posted/PostedItem.h | 2 ++ 1 file changed, 2 insertions(+) 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); From e0e1411ab9a9e1a29f5fb917395ba7f1eef14dec Mon Sep 17 00:00:00 2001 From: Phenom Date: Tue, 5 May 2020 09:36:44 +0200 Subject: [PATCH 24/27] Fix PR#1907 by setting bool in the place that other. --- retroshare-gui/src/gui/feeds/GxsChannelPostItem.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/retroshare-gui/src/gui/feeds/GxsChannelPostItem.cpp b/retroshare-gui/src/gui/feeds/GxsChannelPostItem.cpp index e099be278..3dc5504cc 100644 --- a/retroshare-gui/src/gui/feeds/GxsChannelPostItem.cpp +++ b/retroshare-gui/src/gui/feeds/GxsChannelPostItem.cpp @@ -62,9 +62,9 @@ GxsChannelPostItem::GxsChannelPostItem(FeedHolder *feedHolder, uint32_t feedId, v.push_back(messageId); setMessageVersions(v) ; - setup(); - mLoaded = false; - // no call to loadGroup() here because we have it already. + setup(); + + // no call to loadGroup() here because we have it already. } GxsChannelPostItem::GxsChannelPostItem(FeedHolder *feedHolder, uint32_t feedId, const RsGxsGroupId& groupId, const RsGxsMessageId &messageId, bool isHome, bool autoUpdate,const std::set& older_versions) : @@ -82,9 +82,9 @@ GxsChannelPostItem::GxsChannelPostItem(FeedHolder *feedHolder, uint32_t feedId, v.push_back(messageId); setMessageVersions(v) ; - setup(); - mLoaded = false; - loadGroup(); + setup(); + + loadGroup(); } // GxsChannelPostItem::GxsChannelPostItem(FeedHolder *feedHolder, uint32_t feedId, const RsGxsChannelPost& post, bool isHome, bool autoUpdate,const std::set& older_versions) : @@ -173,6 +173,7 @@ void GxsChannelPostItem::setup() mInFill = false; mCloseOnRead = false; + mLoaded = false; /* clear ui */ ui->titleLabel->setText(tr("Loading...")); From a8e8cfbd3287efa6e7fa49f412c18f460a7fd514 Mon Sep 17 00:00:00 2001 From: defnax Date: Tue, 5 May 2020 16:10:30 +0200 Subject: [PATCH 25/27] Fixing typing icon --- retroshare-gui/src/gui/chat/ChatWidget.ui | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/retroshare-gui/src/gui/chat/ChatWidget.ui b/retroshare-gui/src/gui/chat/ChatWidget.ui index a1ad38cb1..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 From f676314d48a47cd3d26aeb6cddbe5c4973d4c162 Mon Sep 17 00:00:00 2001 From: defnax Date: Tue, 5 May 2020 17:12:54 +0200 Subject: [PATCH 26/27] using the correct icon for mail delete on message feeds items --- retroshare-gui/src/gui/feeds/MsgItem.ui | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 From 6dec124131f74abe8811d6ce9c67692ddf4644cb Mon Sep 17 00:00:00 2001 From: defnax Date: Tue, 5 May 2020 17:56:52 +0200 Subject: [PATCH 27/27] Fixing comments button icon --- retroshare-gui/src/gui/feeds/GxsChannelPostItem.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/retroshare-gui/src/gui/feeds/GxsChannelPostItem.cpp b/retroshare-gui/src/gui/feeds/GxsChannelPostItem.cpp index 3dc5504cc..01c0b227b 100644 --- a/retroshare-gui/src/gui/feeds/GxsChannelPostItem.cpp +++ b/retroshare-gui/src/gui/feeds/GxsChannelPostItem.cpp @@ -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"));