Remember dialog sizes

This applies to "About Dialog", "Ban List Options Dialog", "Download From URL Dialog", "IP Subnet
Whitelist Options Dialog", "Search Plugin Select Dialog", "Search Plugin Source Dialog",
"Statistics Dialog", "Speed Limit Dialog" and "Torrent Options Dialog".

Also unifies storing the dialog size under the key "Size".
This commit is contained in:
Chocobo1 2020-12-28 11:59:36 +08:00 committed by sledgehammer999
parent d7afad835e
commit c6d9ab6810
No known key found for this signature in database
GPG key ID: 6E4A2D025B7CC9A2
21 changed files with 95 additions and 31 deletions

View file

@ -40,9 +40,12 @@
#include "ui_statsdialog.h"
#include "utils.h"
#define SETTINGS_KEY(name) "StatisticsDialog/" name
StatsDialog::StatsDialog(QWidget *parent)
: QDialog(parent)
, m_ui(new Ui::StatsDialog)
, m_storeDialogSize(SETTINGS_KEY("Size"))
{
m_ui->setupUi(this);
setAttribute(Qt::WA_DeleteOnClose);
@ -57,12 +60,13 @@ StatsDialog::StatsDialog(QWidget *parent)
m_ui->labelCacheHits->hide();
#endif
Utils::Gui::resize(this);
Utils::Gui::resize(this, m_storeDialogSize);
show();
}
StatsDialog::~StatsDialog()
{
m_storeDialogSize = size();
delete m_ui;
}