add windows size/pos saving

This commit is contained in:
RetroPooh 2017-10-22 13:49:38 +03:00
parent b6f102cabb
commit b48916ca46
8 changed files with 26 additions and 8 deletions

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

@ -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.
@ -66,7 +68,7 @@ GxsGroupDialog::GxsGroupDialog(TokenQueue *tokenExternalQueue, uint32_t enableFl
{ {
/* Invoke the Qt Designer generated object setup routine */ /* Invoke the Qt Designer generated object setup routine */
ui.setupUi(this); ui.setupUi(this);
mInternalTokenQueue = NULL; mInternalTokenQueue = NULL;
init(); init();
@ -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

@ -95,10 +95,12 @@ 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);
int toolSize = Settings->getToolButtonSize(); int toolSize = Settings->getToolButtonSize();
ui->toolBar->setToolButtonStyle(Settings->getToolButtonStyle()); ui->toolBar->setToolButtonStyle(Settings->getToolButtonStyle());
ui->toolBar->setIconSize(QSize(toolSize,toolSize)); ui->toolBar->setIconSize(QSize(toolSize,toolSize));
@ -110,6 +112,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,7 +65,8 @@ public slots:
protected: protected:
void changeEvent(QEvent *e); void changeEvent(QEvent *e);
void closeEvent (QCloseEvent * event);
private: private:
void initStackedPage(); void initStackedPage();