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->listWidget, SIGNAL(currentRowChanged(int)), this, SLOT(setNewPage(int)));
connect(ui->stackPages, SIGNAL(currentChanged(int)), this, SLOT(setNewPage(int))); connect(ui->stackPages, SIGNAL(currentChanged(int)), this, SLOT(setNewPage(int)));
//ui->stackPages->setCurrentIndex(Settings->getLastPageInMainWindow()); int lastpageindex = Settings->getLastPageInMainWindow();
setNewPage(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(0, 0);
ui->splitter->setStretchFactor(1, 1); ui->splitter->setStretchFactor(1, 1);

View file

@ -1116,7 +1116,7 @@ static bool addFeedItemIfUniqueCallback(FeedItem *feedItem, void *data)
if (findData->mSecurityIpItem) { if (findData->mSecurityIpItem) {
SecurityIpItem *securityIpItem = dynamic_cast<SecurityIpItem*>(feedItem); 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 true;
} }
return false; return false;

View file

@ -27,6 +27,8 @@
#include "util/TokenQueue.h" #include "util/TokenQueue.h"
#include "gui/settings/rsharesettings.h"
#include <iostream> #include <iostream>
PostedCreatePostDialog::PostedCreatePostDialog(TokenQueue* tokenQ, RsPosted *posted, const RsGxsGroupId& grpId, QWidget *parent): 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(new Ui::PostedCreatePostDialog)
{ {
ui->setupUi(this); ui->setupUi(this);
Settings->loadWidgetInformation(this);
connect(ui->submitButton, SIGNAL(clicked()), this, SLOT(createPost())); connect(ui->submitButton, SIGNAL(clicked()), this, SLOT(createPost()));
connect(ui->buttonBox, SIGNAL(rejected()), this, SLOT(close())); connect(ui->buttonBox, SIGNAL(rejected()), this, SLOT(close()));
@ -50,6 +52,7 @@ PostedCreatePostDialog::PostedCreatePostDialog(TokenQueue* tokenQ, RsPosted *pos
PostedCreatePostDialog::~PostedCreatePostDialog() PostedCreatePostDialog::~PostedCreatePostDialog()
{ {
Settings->saveWidgetInformation(this);
delete ui; 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 */ /* Invoke Qt Designer generated QObject setup routine */
ui.setupUi(this); ui.setupUi(this);
Settings->loadWidgetInformation(this);
ui.headerFrame->setHeaderImage(QPixmap(":/images/user/identityinfo64.png")); ui.headerFrame->setHeaderImage(QPixmap(":/images/user/identityinfo64.png"));
//ui.headerFrame->setHeaderText(tr("Friend node details")); //ui.headerFrame->setHeaderText(tr("Friend node details"));
@ -105,6 +105,7 @@ ConfCertDialog::ConfCertDialog(const RsPeerId& id, const RsPgpId &pgp_id, QWidge
ConfCertDialog::~ConfCertDialog() ConfCertDialog::~ConfCertDialog()
{ {
Settings->saveWidgetInformation(this);
QMap<RsPeerId, ConfCertDialog*>::iterator it = instances_ssl.find(peerId); QMap<RsPeerId, ConfCertDialog*>::iterator it = instances_ssl.find(peerId);
if (it != instances_ssl.end()) if (it != instances_ssl.end())
instances_ssl.erase(it); 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 */ /* Invoke Qt Designer generated QObject setup routine */
ui.setupUi(this); ui.setupUi(this);
Settings->loadWidgetInformation(this);
// if(id.isNull()) // if(id.isNull())
// ui._useOldFormat_CB->setChecked(true) ; // ui._useOldFormat_CB->setChecked(true) ;
// else // else
@ -100,6 +100,7 @@ PGPKeyDialog::PGPKeyDialog(const RsPeerId& id, const RsPgpId &pgp_id, QWidget *p
PGPKeyDialog::~PGPKeyDialog() PGPKeyDialog::~PGPKeyDialog()
{ {
Settings->saveWidgetInformation(this);
QMap<RsPgpId, PGPKeyDialog*>::iterator it = instances_pgp.find(pgpId); QMap<RsPgpId, PGPKeyDialog*>::iterator it = instances_pgp.find(pgpId);
if (it != instances_pgp.end()) if (it != instances_pgp.end())
instances_pgp.erase(it); instances_pgp.erase(it);

View file

@ -79,9 +79,9 @@ void SecurityIpItem::setup()
updateItem(); 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; return true;
} }

View file

@ -44,7 +44,7 @@ public:
void updateItemStatic(); 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: protected:
/* FeedItem */ /* FeedItem */

View file

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

View file

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

View file

@ -60,7 +60,7 @@
<bool>false</bool> <bool>false</bool>
</property> </property>
<property name="currentIndex"> <property name="currentIndex">
<number>1</number> <number>0</number>
</property> </property>
<widget class="QWidget" name="channelPostTab"> <widget class="QWidget" name="channelPostTab">
<attribute name="title"> <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(ui->subscribeToolButton, SIGNAL(subscribe(bool)), this, SLOT(subscribeGroup(bool)));
connect(NotifyQt::getInstance(), SIGNAL(settingsChanged()), this, SLOT(settingsChanged())); connect(NotifyQt::getInstance(), SIGNAL(settingsChanged()), this, SLOT(settingsChanged()));
ui->postButton->setText(tr("Add new post"));
/* add filter actions */ /* add filter actions */
ui->filterLineEdit->addFilter(QIcon(), tr("Title"), FILTER_TITLE, tr("Search Title")); ui->filterLineEdit->addFilter(QIcon(), tr("Title"), FILTER_TITLE, tr("Search Title"));
ui->filterLineEdit->addFilter(QIcon(), tr("Message"), FILTER_MSG, tr("Search Message")); ui->filterLineEdit->addFilter(QIcon(), tr("Message"), FILTER_MSG, tr("Search Message"));

View file

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

View file

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

View file

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

View file

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

View file

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