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

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

View File

@ -8,7 +8,15 @@ Requirements: about 12 GB of free space
The resulting binary is a 32-bit build of Retroshare which will also work
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

View File

@ -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)
};

View File

@ -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 *********************************
*/

View File

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

View File

@ -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 <sys/timeb.h>
@ -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
}

View File

@ -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<void(int)> mShutdownCallback;

View File

@ -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

View File

@ -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<uint8_t*>(malloc(serialSize));
second = serialSize;
memcpy(first, ctx.mData + ctx.mOffset, serialSize);
ctx.mOffset += serialSize;
first = reinterpret_cast<uint8_t*>(malloc(second));
memcpy(first, ctx.mData + ctx.mOffset, second);
ctx.mOffset += second;
break;
}
case RsGenericSerializer::PRINT: break;
case RsGenericSerializer::TO_JSON:
{

View File

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

View File

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

View File

@ -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);

View File

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

View File

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

View File

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

View File

@ -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);

View File

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

View File

@ -241,6 +241,9 @@ border-image: url(:/images/closepressed.png)
</property>
<item>
<layout class="QHBoxLayout" name="typingHLayout">
<property name="leftMargin">
<number>2</number>
</property>
<item>
<widget class="QLabel" name="typingPixmapLabel">
<property name="minimumSize">
@ -258,6 +261,9 @@ border-image: url(:/images/closepressed.png)
<property name="text">
<string notr="true">T</string>
</property>
<property name="scaledContents">
<bool>true</bool>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
@ -448,133 +454,6 @@ border-image: url(:/images/closepressed.png)
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="pushtoolsButton">
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="icon">
<iconset resource="../icons.qrc">
<normaloff>:/icons/png/options2.png</normaloff>:/icons/png/options2.png</iconset>
</property>
<property name="iconSize">
<size>
<width>28</width>
<height>28</height>
</size>
</property>
<property name="popupMode">
<enum>QToolButton::InstantPopup</enum>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="searchButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="contextMenuPolicy">
<enum>Qt::CustomContextMenu</enum>
</property>
<property name="icon">
<iconset resource="../icons.qrc">
<normaloff>:/icons/png/search.png</normaloff>:/icons/png/search.png</iconset>
</property>
<property name="iconSize">
<size>
<width>28</width>
<height>28</height>
</size>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="LineEditClear" name="leSearch"/>
</item>
<item>
<widget class="QToolButton" name="markButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="icon">
<iconset resource="../icons.qrc">
<normaloff>:/icons/png/highlight.png</normaloff>:/icons/png/highlight.png</iconset>
</property>
<property name="iconSize">
<size>
<width>28</width>
<height>28</height>
</size>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="searchBefore">
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="icon">
<iconset resource="../icons.qrc">
<normaloff>:/icons/png/arrow-left.png</normaloff>:/icons/png/arrow-left.png</iconset>
</property>
<property name="iconSize">
<size>
<width>28</width>
<height>28</height>
</size>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="searchAfter">
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="icon">
<iconset resource="../icons.qrc">
<normaloff>:/icons/png/arrow-right.png</normaloff>:/icons/png/arrow-right.png</iconset>
</property>
<property name="iconSize">
<size>
<width>28</width>
<height>28</height>
</size>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="notifyButton">
<property name="focusPolicy">
@ -786,6 +665,133 @@ border-image: url(:/images/closepressed.png)
</property>
</spacer>
</item>
<item>
<widget class="QToolButton" name="searchButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="contextMenuPolicy">
<enum>Qt::CustomContextMenu</enum>
</property>
<property name="icon">
<iconset resource="../icons.qrc">
<normaloff>:/icons/png/search.png</normaloff>:/icons/png/search.png</iconset>
</property>
<property name="iconSize">
<size>
<width>28</width>
<height>28</height>
</size>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="LineEditClear" name="leSearch"/>
</item>
<item>
<widget class="QToolButton" name="markButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="icon">
<iconset resource="../icons.qrc">
<normaloff>:/icons/png/highlight.png</normaloff>:/icons/png/highlight.png</iconset>
</property>
<property name="iconSize">
<size>
<width>28</width>
<height>28</height>
</size>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="searchBefore">
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="icon">
<iconset resource="../icons.qrc">
<normaloff>:/icons/png/arrow-left.png</normaloff>:/icons/png/arrow-left.png</iconset>
</property>
<property name="iconSize">
<size>
<width>28</width>
<height>28</height>
</size>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="searchAfter">
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="icon">
<iconset resource="../icons.qrc">
<normaloff>:/icons/png/arrow-right.png</normaloff>:/icons/png/arrow-right.png</iconset>
</property>
<property name="iconSize">
<size>
<width>28</width>
<height>28</height>
</size>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="pushtoolsButton">
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="icon">
<iconset resource="../icons.qrc">
<normaloff>:/icons/png/options2.png</normaloff>:/icons/png/options2.png</iconset>
</property>
<property name="iconSize">
<size>
<width>28</width>
<height>28</height>
</size>
</property>
<property name="popupMode">
<enum>QToolButton::InstantPopup</enum>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QFrame" name="pluginTitleFrame">
<property name="frameShape">

View File

@ -212,7 +212,7 @@ NewFriendList::NewFriendList(QWidget *parent) : /* RsAutoUpdatePage(5000,parent)
// workaround for Qt bug, should be solved in next Qt release 4.7.0
// 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."<<std::endl;
}
}
}
void NewFriendList::removeNode()
{
RsFriendListModel::RsNodeDetails det;

View File

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

View File

@ -62,9 +62,9 @@ GxsChannelPostItem::GxsChannelPostItem(FeedHolder *feedHolder, uint32_t feedId,
v.push_back(messageId);
setMessageVersions(v) ;
setup();
setup();
// no call to loadGroup() here because we have it already.
// 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<RsGxsMessageId>& 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<RsGxsMessageId>& 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<RsGxsChannelPost> posts;
std::vector<RsGxsComment> comments;
if(! rsGxsChannels->getChannelContent( groupId(),msgIds,posts,comments))
if(! rsGxsChannels->getChannelComments( groupId(),msgIds,comments))
{
RsErr() << "GxsGxsChannelGroupItem::loadGroup() ERROR getting data" << std::endl;
return;
}
int comNb = comments.size();
int comNb = comments.size();
RsQThreadUtils::postToObject( [comNb,this]()
{

View File

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

View File

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

View File

@ -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( "<p>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_ptr<const RsEvent
void GxsForumThreadWidget::blank()
{
ui->progressBar->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("<b>ERROR:</b> 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()

View File

@ -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<RsGxsMessageId>& expanded_items) const;
int getSelectedMsgCount(QList<QTreeWidgetItem*> *pRows, QList<QTreeWidgetItem*> *pRowsRead, QList<QTreeWidgetItem*> *pRowsUnread);
void setMsgReadStatus(QList<QTreeWidgetItem*> &rows, bool read);
void markMsgAsReadUnread(bool read, bool children, bool forum, RsGxsMessageId msgId = RsGxsMessageId());
void calculateUnreadCount();
void setMsgReadStatus(QList<QTreeWidgetItem*> &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;

View File

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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

View File

@ -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()

View File

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

View File

@ -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;
}

View File

@ -91,8 +91,6 @@ ServerPage::ServerPage(QWidget * parent, Qt::WindowFlags flags)
ui.tabWidget->removeTab(TAB_RELAYS) ; // remove relays. Not useful in Tor mode.
ui.tabWidget->removeTab(TAB_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"))) ;

View File

@ -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
{

View File

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

View File

@ -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;

View File

@ -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;