Merge branch 'master' into hid1

This commit is contained in:
Pooh 2017-10-23 11:46:39 +03:00 committed by GitHub
commit a0f6a741b1
16 changed files with 60 additions and 17 deletions

View File

@ -210,8 +210,9 @@ MainWindow::MainWindow(QWidget* parent, Qt::WindowFlags flags)
connect(ui->listWidget, SIGNAL(currentRowChanged(int)), this, SLOT(setNewPage(int)));
connect(ui->stackPages, SIGNAL(currentChanged(int)), this, SLOT(setNewPage(int)));
//ui->stackPages->setCurrentIndex(Settings->getLastPageInMainWindow());
setNewPage(Settings->getLastPageInMainWindow());
int lastpageindex = Settings->getLastPageInMainWindow();
if(lastpageindex < ui->stackPages->count()) //Do not crash when a page was removed after last run
setNewPage(lastpageindex);
ui->splitter->setStretchFactor(0, 0);
ui->splitter->setStretchFactor(1, 1);

View File

@ -1116,7 +1116,7 @@ static bool addFeedItemIfUniqueCallback(FeedItem *feedItem, void *data)
if (findData->mSecurityIpItem) {
SecurityIpItem *securityIpItem = dynamic_cast<SecurityIpItem*>(feedItem);
if (securityIpItem && securityIpItem->isSame(findData->mId1, findData->mId2, findData->mType)) {
if (securityIpItem && securityIpItem->isSame(RsPeerId(findData->mId1), findData->mId2, findData->mId3, findData->mType)) {
return true;
}
return false;

View File

@ -27,6 +27,8 @@
#include "util/TokenQueue.h"
#include "gui/settings/rsharesettings.h"
#include <iostream>
PostedCreatePostDialog::PostedCreatePostDialog(TokenQueue* tokenQ, RsPosted *posted, const RsGxsGroupId& grpId, QWidget *parent):
@ -35,7 +37,7 @@ PostedCreatePostDialog::PostedCreatePostDialog(TokenQueue* tokenQ, RsPosted *pos
ui(new Ui::PostedCreatePostDialog)
{
ui->setupUi(this);
Settings->loadWidgetInformation(this);
connect(ui->submitButton, SIGNAL(clicked()), this, SLOT(createPost()));
connect(ui->buttonBox, SIGNAL(rejected()), this, SLOT(close()));
@ -50,6 +52,7 @@ PostedCreatePostDialog::PostedCreatePostDialog(TokenQueue* tokenQ, RsPosted *pos
PostedCreatePostDialog::~PostedCreatePostDialog()
{
Settings->saveWidgetInformation(this);
delete ui;
}

View File

@ -83,7 +83,7 @@ ConfCertDialog::ConfCertDialog(const RsPeerId& id, const RsPgpId &pgp_id, QWidge
{
/* Invoke Qt Designer generated QObject setup routine */
ui.setupUi(this);
Settings->loadWidgetInformation(this);
ui.headerFrame->setHeaderImage(QPixmap(":/images/user/identityinfo64.png"));
//ui.headerFrame->setHeaderText(tr("Friend node details"));
@ -105,6 +105,7 @@ ConfCertDialog::ConfCertDialog(const RsPeerId& id, const RsPgpId &pgp_id, QWidge
ConfCertDialog::~ConfCertDialog()
{
Settings->saveWidgetInformation(this);
QMap<RsPeerId, ConfCertDialog*>::iterator it = instances_ssl.find(peerId);
if (it != instances_ssl.end())
instances_ssl.erase(it);

View File

@ -65,7 +65,7 @@ PGPKeyDialog::PGPKeyDialog(const RsPeerId& id, const RsPgpId &pgp_id, QWidget *p
{
/* Invoke Qt Designer generated QObject setup routine */
ui.setupUi(this);
Settings->loadWidgetInformation(this);
// if(id.isNull())
// ui._useOldFormat_CB->setChecked(true) ;
// else
@ -100,6 +100,7 @@ PGPKeyDialog::PGPKeyDialog(const RsPeerId& id, const RsPgpId &pgp_id, QWidget *p
PGPKeyDialog::~PGPKeyDialog()
{
Settings->saveWidgetInformation(this);
QMap<RsPgpId, PGPKeyDialog*>::iterator it = instances_pgp.find(pgpId);
if (it != instances_pgp.end())
instances_pgp.erase(it);

View File

@ -79,9 +79,9 @@ void SecurityIpItem::setup()
updateItem();
}
bool SecurityIpItem::isSame(const std::string& ipAddr, const std::string& ipAddrReported, uint32_t type)
bool SecurityIpItem::isSame(const RsPeerId &sslId, const std::string& ipAddr, const std::string& ipAddrReported, uint32_t type)
{
if (mType == type && mIpAddr == ipAddr && mIpAddrReported == ipAddrReported) {
if (mType == type && mSslId==sslId && mIpAddr == ipAddr && mIpAddrReported == ipAddrReported) {
return true;
}

View File

@ -44,7 +44,7 @@ public:
void updateItemStatic();
bool isSame(const std::string& ipAddr, const std::string& ipAddrReported, uint32_t type);
bool isSame(const RsPeerId &sslId, const std::string& ipAddr, const std::string& ipAddrReported, uint32_t type);
protected:
/* FeedItem */

View File

@ -34,6 +34,8 @@
#include <retroshare/rspeers.h>
#include <retroshare/rsgxscircles.h>
#include <gui/settings/rsharesettings.h>
#include <iostream>
// Control of Publish Signatures.
@ -66,7 +68,7 @@ GxsGroupDialog::GxsGroupDialog(TokenQueue *tokenExternalQueue, uint32_t enableFl
{
/* Invoke the Qt Designer generated object setup routine */
ui.setupUi(this);
mInternalTokenQueue = NULL;
init();
@ -87,6 +89,7 @@ GxsGroupDialog::GxsGroupDialog(TokenQueue *tokenExternalQueue, RsTokenService *t
GxsGroupDialog::~GxsGroupDialog()
{
Settings->saveWidgetInformation(this);
if (mInternalTokenQueue) {
delete(mInternalTokenQueue);
}
@ -134,6 +137,7 @@ void GxsGroupDialog::init()
ui.personal_required->setChecked(true) ; // this is always true
initMode();
Settings->loadWidgetInformation(this);
}
QIcon GxsGroupDialog::serviceWindowIcon()

View File

@ -50,7 +50,7 @@ CreateGxsChannelMsg::CreateGxsChannelMsg(const RsGxsGroupId &cId, RsGxsMessageId
{
/* Invoke the Qt Designer generated object setup routine */
setupUi(this);
Settings->loadWidgetInformation(this);
mChannelQueue = new TokenQueue(rsGxsChannels->getTokenService(), this);
headerFrame->setHeaderImage(QPixmap(":/images/channels.png"));
@ -95,6 +95,7 @@ CreateGxsChannelMsg::CreateGxsChannelMsg(const RsGxsGroupId &cId, RsGxsMessageId
CreateGxsChannelMsg::~CreateGxsChannelMsg()
{
Settings->saveWidgetInformation(this);
#ifdef CHANNELS_FRAME_CATCHER
delete fCatcher;
#endif

View File

@ -60,7 +60,7 @@
<bool>false</bool>
</property>
<property name="currentIndex">
<number>1</number>
<number>0</number>
</property>
<widget class="QWidget" name="channelPostTab">
<attribute name="title">

View File

@ -75,6 +75,8 @@ GxsChannelPostsWidget::GxsChannelPostsWidget(const RsGxsGroupId &channelId, QWid
connect(ui->subscribeToolButton, SIGNAL(subscribe(bool)), this, SLOT(subscribeGroup(bool)));
connect(NotifyQt::getInstance(), SIGNAL(settingsChanged()), this, SLOT(settingsChanged()));
ui->postButton->setText(tr("Add new post"));
/* add filter actions */
ui->filterLineEdit->addFilter(QIcon(), tr("Title"), FILTER_TITLE, tr("Search Title"));
ui->filterLineEdit->addFilter(QIcon(), tr("Message"), FILTER_MSG, tr("Search Message"));

View File

@ -169,6 +169,9 @@
<property name="toolTip">
<string>Post to Channel</string>
</property>
<property name="text">
<string>Add new post</string>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/mail_send.png</normaloff>:/images/mail_send.png</iconset>
@ -179,6 +182,9 @@
<height>16</height>
</size>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextBesideIcon</enum>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>

View File

@ -210,6 +210,9 @@ GxsForumThreadWidget::GxsForumThreadWidget(const RsGxsGroupId &forumId, QWidget
connect(ui->newmessageButton, SIGNAL(clicked()), this, SLOT(replytoforummessage()));
connect(ui->newthreadButton, SIGNAL(clicked()), this, SLOT(createthread()));
ui->newmessageButton->setText(tr("Reply"));
ui->newthreadButton->setText(tr("New thread"));
connect(ui->threadTreeWidget, SIGNAL(itemSelectionChanged()), this, SLOT(changedThread()));
connect(ui->threadTreeWidget, SIGNAL(itemClicked(QTreeWidgetItem*,int)), this, SLOT(clickedThread(QTreeWidgetItem*,int)));
connect(ui->viewBox, SIGNAL(currentIndexChanged(int)), this, SLOT(changedViewBox()));
@ -228,6 +231,7 @@ GxsForumThreadWidget::GxsForumThreadWidget(const RsGxsGroupId &forumId, QWidget
/* Set own item delegate */
RSElidedItemDelegate *itemDelegate = new RSElidedItemDelegate(this);
itemDelegate->setSpacing(QSize(0, 2));
itemDelegate->setOnlyPlainText(true);
ui->threadTreeWidget->setItemDelegate(itemDelegate);
/* Set header resize modes and initial section sizes */

View File

@ -84,6 +84,9 @@
<property name="toolTip">
<string>Start new Thread for Selected Forum</string>
</property>
<property name="text">
<string>New Thread</string>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/mail_new.png</normaloff>:/images/mail_new.png</iconset>
@ -94,6 +97,9 @@
<height>16</height>
</size>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextBesideIcon</enum>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
@ -306,8 +312,8 @@
<widget class="QToolButton" name="newmessageButton">
<property name="maximumSize">
<size>
<width>24</width>
<height>24</height>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="focusPolicy">
@ -316,10 +322,16 @@
<property name="toolTip">
<string>Reply Message</string>
</property>
<property name="text">
<string>Reply</string>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/mail_reply.png</normaloff>:/images/mail_reply.png</iconset>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextBesideIcon</enum>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
@ -358,7 +370,7 @@
</property>
</widget>
</item>
<item row="0" column="8">
<item row="0" column="9">
<widget class="Line" name="lineRight">
<property name="orientation">
<enum>Qt::Vertical</enum>
@ -471,7 +483,7 @@
</property>
</widget>
</item>
<item row="0" column="9">
<item row="0" column="8">
<widget class="QComboBox" name="versions_CB"/>
</item>
<item row="0" column="7">

View File

@ -95,6 +95,8 @@ StatisticsWindow::StatisticsWindow(QWidget *parent) :
{
ui->setupUi(this);
Settings->loadWidgetInformation(this);
initStackedPage();
connect(ui->stackPages, SIGNAL(currentChanged(int)), this, SLOT(setNewPage(int)));
ui->stackPages->setCurrentIndex(0);
@ -109,6 +111,11 @@ StatisticsWindow::~StatisticsWindow()
mInstance = NULL;
}
void StatisticsWindow::closeEvent (QCloseEvent * /*event*/)
{
Settings->saveWidgetInformation(this);
}
void StatisticsWindow::changeEvent(QEvent *e)
{
QMainWindow::changeEvent(e);

View File

@ -65,7 +65,8 @@ public slots:
protected:
void changeEvent(QEvent *e);
void closeEvent (QCloseEvent * event);
private:
void initStackedPage();