mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-12 08:16:16 -07:00
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:
parent
cfb55d9d77
commit
757ab3dc92
21 changed files with 95 additions and 31 deletions
|
@ -36,9 +36,12 @@
|
||||||
#include "uithememanager.h"
|
#include "uithememanager.h"
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
|
|
||||||
|
#define SETTINGS_KEY(name) "AboutDialog/" name
|
||||||
|
|
||||||
AboutDialog::AboutDialog(QWidget *parent)
|
AboutDialog::AboutDialog(QWidget *parent)
|
||||||
: QDialog(parent)
|
: QDialog(parent)
|
||||||
, m_ui(new Ui::AboutDialog)
|
, m_ui(new Ui::AboutDialog)
|
||||||
|
, m_storeDialogSize(SETTINGS_KEY("Size"))
|
||||||
{
|
{
|
||||||
m_ui->setupUi(this);
|
m_ui->setupUi(this);
|
||||||
setAttribute(Qt::WA_DeleteOnClose);
|
setAttribute(Qt::WA_DeleteOnClose);
|
||||||
|
@ -107,11 +110,12 @@ AboutDialog::AboutDialog(QWidget *parent)
|
||||||
"The database is licensed under the Creative Commons Attribution 4.0 International License"));
|
"The database is licensed under the Creative Commons Attribution 4.0 International License"));
|
||||||
m_ui->labelDBIP->setText(DBIPText);
|
m_ui->labelDBIP->setText(DBIPText);
|
||||||
|
|
||||||
Utils::Gui::resize(this);
|
Utils::Gui::resize(this, m_storeDialogSize);
|
||||||
show();
|
show();
|
||||||
}
|
}
|
||||||
|
|
||||||
AboutDialog::~AboutDialog()
|
AboutDialog::~AboutDialog()
|
||||||
{
|
{
|
||||||
|
m_storeDialogSize = size();
|
||||||
delete m_ui;
|
delete m_ui;
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,12 +30,14 @@
|
||||||
|
|
||||||
#include <QDialog>
|
#include <QDialog>
|
||||||
|
|
||||||
|
#include "base/settingvalue.h"
|
||||||
|
|
||||||
namespace Ui
|
namespace Ui
|
||||||
{
|
{
|
||||||
class AboutDialog;
|
class AboutDialog;
|
||||||
}
|
}
|
||||||
|
|
||||||
class AboutDialog : public QDialog
|
class AboutDialog final : public QDialog
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
Q_DISABLE_COPY(AboutDialog)
|
Q_DISABLE_COPY(AboutDialog)
|
||||||
|
@ -46,4 +48,5 @@ public:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::AboutDialog *m_ui;
|
Ui::AboutDialog *m_ui;
|
||||||
|
SettingValue<QSize> m_storeDialogSize;
|
||||||
};
|
};
|
||||||
|
|
|
@ -38,11 +38,13 @@
|
||||||
#include "ui_banlistoptionsdialog.h"
|
#include "ui_banlistoptionsdialog.h"
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
|
|
||||||
|
#define SETTINGS_KEY(name) "BanListOptionsDialog/" name
|
||||||
|
|
||||||
BanListOptionsDialog::BanListOptionsDialog(QWidget *parent)
|
BanListOptionsDialog::BanListOptionsDialog(QWidget *parent)
|
||||||
: QDialog(parent)
|
: QDialog(parent)
|
||||||
, m_ui(new Ui::BanListOptionsDialog)
|
, m_ui(new Ui::BanListOptionsDialog)
|
||||||
|
, m_storeDialogSize(SETTINGS_KEY("Size"))
|
||||||
, m_model(new QStringListModel(BitTorrent::Session::instance()->bannedIPs(), this))
|
, m_model(new QStringListModel(BitTorrent::Session::instance()->bannedIPs(), this))
|
||||||
, m_modified(false)
|
|
||||||
{
|
{
|
||||||
m_ui->setupUi(this);
|
m_ui->setupUi(this);
|
||||||
|
|
||||||
|
@ -54,11 +56,12 @@ BanListOptionsDialog::BanListOptionsDialog(QWidget *parent)
|
||||||
m_ui->bannedIPList->sortByColumn(0, Qt::AscendingOrder);
|
m_ui->bannedIPList->sortByColumn(0, Qt::AscendingOrder);
|
||||||
m_ui->buttonBanIP->setEnabled(false);
|
m_ui->buttonBanIP->setEnabled(false);
|
||||||
|
|
||||||
Utils::Gui::resize(this);
|
Utils::Gui::resize(this, m_storeDialogSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
BanListOptionsDialog::~BanListOptionsDialog()
|
BanListOptionsDialog::~BanListOptionsDialog()
|
||||||
{
|
{
|
||||||
|
m_storeDialogSize = size();
|
||||||
delete m_ui;
|
delete m_ui;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -30,6 +30,8 @@
|
||||||
|
|
||||||
#include <QDialog>
|
#include <QDialog>
|
||||||
|
|
||||||
|
#include "base/settingvalue.h"
|
||||||
|
|
||||||
class QSortFilterProxyModel;
|
class QSortFilterProxyModel;
|
||||||
class QStringListModel;
|
class QStringListModel;
|
||||||
|
|
||||||
|
@ -38,13 +40,14 @@ namespace Ui
|
||||||
class BanListOptionsDialog;
|
class BanListOptionsDialog;
|
||||||
}
|
}
|
||||||
|
|
||||||
class BanListOptionsDialog : public QDialog
|
class BanListOptionsDialog final : public QDialog
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
Q_DISABLE_COPY(BanListOptionsDialog)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit BanListOptionsDialog(QWidget *parent = nullptr);
|
explicit BanListOptionsDialog(QWidget *parent = nullptr);
|
||||||
~BanListOptionsDialog();
|
~BanListOptionsDialog() override;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void on_buttonBox_accepted();
|
void on_buttonBox_accepted();
|
||||||
|
@ -54,7 +57,8 @@ private slots:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::BanListOptionsDialog *m_ui;
|
Ui::BanListOptionsDialog *m_ui;
|
||||||
|
SettingValue<QSize> m_storeDialogSize;
|
||||||
QStringListModel *m_model;
|
QStringListModel *m_model;
|
||||||
QSortFilterProxyModel *m_sortFilter;
|
QSortFilterProxyModel *m_sortFilter;
|
||||||
bool m_modified;
|
bool m_modified = false;
|
||||||
};
|
};
|
||||||
|
|
|
@ -39,6 +39,8 @@
|
||||||
#include "ui_downloadfromurldialog.h"
|
#include "ui_downloadfromurldialog.h"
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
|
|
||||||
|
#define SETTINGS_KEY(name) "DownloadFromURLDialog/" name
|
||||||
|
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
bool isDownloadable(const QString &str)
|
bool isDownloadable(const QString &str)
|
||||||
|
@ -55,6 +57,7 @@ namespace
|
||||||
DownloadFromURLDialog::DownloadFromURLDialog(QWidget *parent)
|
DownloadFromURLDialog::DownloadFromURLDialog(QWidget *parent)
|
||||||
: QDialog(parent)
|
: QDialog(parent)
|
||||||
, m_ui(new Ui::DownloadFromURLDialog)
|
, m_ui(new Ui::DownloadFromURLDialog)
|
||||||
|
, m_storeDialogSize(SETTINGS_KEY("Size"))
|
||||||
{
|
{
|
||||||
m_ui->setupUi(this);
|
m_ui->setupUi(this);
|
||||||
setAttribute(Qt::WA_DeleteOnClose);
|
setAttribute(Qt::WA_DeleteOnClose);
|
||||||
|
@ -82,12 +85,13 @@ DownloadFromURLDialog::DownloadFromURLDialog(QWidget *parent)
|
||||||
}
|
}
|
||||||
m_ui->textUrls->setText(uniqueURLs.values().join('\n'));
|
m_ui->textUrls->setText(uniqueURLs.values().join('\n'));
|
||||||
|
|
||||||
Utils::Gui::resize(this);
|
Utils::Gui::resize(this, m_storeDialogSize);
|
||||||
show();
|
show();
|
||||||
}
|
}
|
||||||
|
|
||||||
DownloadFromURLDialog::~DownloadFromURLDialog()
|
DownloadFromURLDialog::~DownloadFromURLDialog()
|
||||||
{
|
{
|
||||||
|
m_storeDialogSize = size();
|
||||||
delete m_ui;
|
delete m_ui;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -30,19 +30,21 @@
|
||||||
|
|
||||||
#include <QDialog>
|
#include <QDialog>
|
||||||
|
|
||||||
|
#include "base/settingvalue.h"
|
||||||
|
|
||||||
namespace Ui
|
namespace Ui
|
||||||
{
|
{
|
||||||
class DownloadFromURLDialog;
|
class DownloadFromURLDialog;
|
||||||
}
|
}
|
||||||
|
|
||||||
class DownloadFromURLDialog : public QDialog
|
class DownloadFromURLDialog final : public QDialog
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
Q_DISABLE_COPY(DownloadFromURLDialog)
|
Q_DISABLE_COPY(DownloadFromURLDialog)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit DownloadFromURLDialog(QWidget *parent);
|
explicit DownloadFromURLDialog(QWidget *parent);
|
||||||
~DownloadFromURLDialog();
|
~DownloadFromURLDialog() override;
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void urlsReadyToBeDownloaded(const QStringList &torrentURLs);
|
void urlsReadyToBeDownloaded(const QStringList &torrentURLs);
|
||||||
|
@ -52,4 +54,5 @@ private slots:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::DownloadFromURLDialog *m_ui;
|
Ui::DownloadFromURLDialog *m_ui;
|
||||||
|
SettingValue<QSize> m_storeDialogSize;
|
||||||
};
|
};
|
||||||
|
|
|
@ -38,10 +38,12 @@
|
||||||
#include "ui_ipsubnetwhitelistoptionsdialog.h"
|
#include "ui_ipsubnetwhitelistoptionsdialog.h"
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
|
|
||||||
|
#define SETTINGS_KEY(name) "IPSubnetWhitelistOptionsDialog/" name
|
||||||
|
|
||||||
IPSubnetWhitelistOptionsDialog::IPSubnetWhitelistOptionsDialog(QWidget *parent)
|
IPSubnetWhitelistOptionsDialog::IPSubnetWhitelistOptionsDialog(QWidget *parent)
|
||||||
: QDialog(parent)
|
: QDialog(parent)
|
||||||
, m_ui(new Ui::IPSubnetWhitelistOptionsDialog)
|
, m_ui(new Ui::IPSubnetWhitelistOptionsDialog)
|
||||||
, m_modified(false)
|
, m_storeDialogSize(SETTINGS_KEY("Size"))
|
||||||
{
|
{
|
||||||
m_ui->setupUi(this);
|
m_ui->setupUi(this);
|
||||||
|
|
||||||
|
@ -58,11 +60,12 @@ IPSubnetWhitelistOptionsDialog::IPSubnetWhitelistOptionsDialog(QWidget *parent)
|
||||||
m_ui->whitelistedIPSubnetList->sortByColumn(0, Qt::AscendingOrder);
|
m_ui->whitelistedIPSubnetList->sortByColumn(0, Qt::AscendingOrder);
|
||||||
m_ui->buttonWhitelistIPSubnet->setEnabled(false);
|
m_ui->buttonWhitelistIPSubnet->setEnabled(false);
|
||||||
|
|
||||||
Utils::Gui::resize(this);
|
Utils::Gui::resize(this, m_storeDialogSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
IPSubnetWhitelistOptionsDialog::~IPSubnetWhitelistOptionsDialog()
|
IPSubnetWhitelistOptionsDialog::~IPSubnetWhitelistOptionsDialog()
|
||||||
{
|
{
|
||||||
|
m_storeDialogSize = size();
|
||||||
delete m_ui;
|
delete m_ui;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -30,6 +30,8 @@
|
||||||
|
|
||||||
#include <QDialog>
|
#include <QDialog>
|
||||||
|
|
||||||
|
#include "base/settingvalue.h"
|
||||||
|
|
||||||
class QSortFilterProxyModel;
|
class QSortFilterProxyModel;
|
||||||
class QStringListModel;
|
class QStringListModel;
|
||||||
|
|
||||||
|
@ -38,14 +40,14 @@ namespace Ui
|
||||||
class IPSubnetWhitelistOptionsDialog;
|
class IPSubnetWhitelistOptionsDialog;
|
||||||
}
|
}
|
||||||
|
|
||||||
class IPSubnetWhitelistOptionsDialog : public QDialog
|
class IPSubnetWhitelistOptionsDialog final : public QDialog
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
Q_DISABLE_COPY(IPSubnetWhitelistOptionsDialog)
|
Q_DISABLE_COPY(IPSubnetWhitelistOptionsDialog)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit IPSubnetWhitelistOptionsDialog(QWidget *parent = nullptr);
|
explicit IPSubnetWhitelistOptionsDialog(QWidget *parent = nullptr);
|
||||||
~IPSubnetWhitelistOptionsDialog();
|
~IPSubnetWhitelistOptionsDialog() override;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void on_buttonBox_accepted();
|
void on_buttonBox_accepted();
|
||||||
|
@ -55,7 +57,9 @@ private slots:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::IPSubnetWhitelistOptionsDialog *m_ui;
|
Ui::IPSubnetWhitelistOptionsDialog *m_ui;
|
||||||
|
SettingValue<QSize> m_storeDialogSize;
|
||||||
|
|
||||||
QStringListModel *m_model;
|
QStringListModel *m_model;
|
||||||
QSortFilterProxyModel *m_sortFilter;
|
QSortFilterProxyModel *m_sortFilter;
|
||||||
bool m_modified;
|
bool m_modified = false;
|
||||||
};
|
};
|
||||||
|
|
|
@ -51,7 +51,7 @@ PreviewSelectDialog::PreviewSelectDialog(QWidget *parent, const BitTorrent::Torr
|
||||||
: QDialog(parent)
|
: QDialog(parent)
|
||||||
, m_ui(new Ui::PreviewSelectDialog)
|
, m_ui(new Ui::PreviewSelectDialog)
|
||||||
, m_torrent(torrent)
|
, m_torrent(torrent)
|
||||||
, m_storeDialogSize(SETTINGS_KEY("Dimension"))
|
, m_storeDialogSize(SETTINGS_KEY("Size"))
|
||||||
, m_storeTreeHeaderState(SETTINGS_KEY("HeaderState"))
|
, m_storeTreeHeaderState(SETTINGS_KEY("HeaderState"))
|
||||||
{
|
{
|
||||||
m_ui->setupUi(this);
|
m_ui->setupUi(this);
|
||||||
|
|
|
@ -49,6 +49,8 @@
|
||||||
#include "searchwidget.h"
|
#include "searchwidget.h"
|
||||||
#include "ui_pluginselectdialog.h"
|
#include "ui_pluginselectdialog.h"
|
||||||
|
|
||||||
|
#define SETTINGS_KEY(name) "SearchPluginSelectDialog/" name
|
||||||
|
|
||||||
enum PluginColumns
|
enum PluginColumns
|
||||||
{
|
{
|
||||||
PLUGIN_NAME,
|
PLUGIN_NAME,
|
||||||
|
@ -60,10 +62,9 @@ enum PluginColumns
|
||||||
|
|
||||||
PluginSelectDialog::PluginSelectDialog(SearchPluginManager *pluginManager, QWidget *parent)
|
PluginSelectDialog::PluginSelectDialog(SearchPluginManager *pluginManager, QWidget *parent)
|
||||||
: QDialog(parent)
|
: QDialog(parent)
|
||||||
, m_ui(new Ui::PluginSelectDialog())
|
, m_ui(new Ui::PluginSelectDialog)
|
||||||
|
, m_storeDialogSize(SETTINGS_KEY("Size"))
|
||||||
, m_pluginManager(pluginManager)
|
, m_pluginManager(pluginManager)
|
||||||
, m_asyncOps(0)
|
|
||||||
, m_pendingUpdates(0)
|
|
||||||
{
|
{
|
||||||
m_ui->setupUi(this);
|
m_ui->setupUi(this);
|
||||||
setAttribute(Qt::WA_DeleteOnClose);
|
setAttribute(Qt::WA_DeleteOnClose);
|
||||||
|
@ -94,12 +95,13 @@ PluginSelectDialog::PluginSelectDialog(SearchPluginManager *pluginManager, QWidg
|
||||||
connect(m_pluginManager, &SearchPluginManager::checkForUpdatesFinished, this, &PluginSelectDialog::checkForUpdatesFinished);
|
connect(m_pluginManager, &SearchPluginManager::checkForUpdatesFinished, this, &PluginSelectDialog::checkForUpdatesFinished);
|
||||||
connect(m_pluginManager, &SearchPluginManager::checkForUpdatesFailed, this, &PluginSelectDialog::checkForUpdatesFailed);
|
connect(m_pluginManager, &SearchPluginManager::checkForUpdatesFailed, this, &PluginSelectDialog::checkForUpdatesFailed);
|
||||||
|
|
||||||
Utils::Gui::resize(this);
|
Utils::Gui::resize(this, m_storeDialogSize);
|
||||||
show();
|
show();
|
||||||
}
|
}
|
||||||
|
|
||||||
PluginSelectDialog::~PluginSelectDialog()
|
PluginSelectDialog::~PluginSelectDialog()
|
||||||
{
|
{
|
||||||
|
m_storeDialogSize = size();
|
||||||
delete m_ui;
|
delete m_ui;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -33,6 +33,7 @@
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
|
|
||||||
#include "base/search/searchpluginmanager.h"
|
#include "base/search/searchpluginmanager.h"
|
||||||
|
#include "base/settingvalue.h"
|
||||||
|
|
||||||
class QDropEvent;
|
class QDropEvent;
|
||||||
class QTreeWidgetItem;
|
class QTreeWidgetItem;
|
||||||
|
@ -91,8 +92,9 @@ private:
|
||||||
void finishPluginUpdate();
|
void finishPluginUpdate();
|
||||||
|
|
||||||
Ui::PluginSelectDialog *m_ui;
|
Ui::PluginSelectDialog *m_ui;
|
||||||
|
SettingValue<QSize> m_storeDialogSize;
|
||||||
SearchPluginManager *m_pluginManager;
|
SearchPluginManager *m_pluginManager;
|
||||||
QStringList m_updatedPlugins;
|
QStringList m_updatedPlugins;
|
||||||
int m_asyncOps;
|
int m_asyncOps = 0;
|
||||||
int m_pendingUpdates;
|
int m_pendingUpdates = 0;
|
||||||
};
|
};
|
||||||
|
|
|
@ -31,19 +31,23 @@
|
||||||
#include "gui/utils.h"
|
#include "gui/utils.h"
|
||||||
#include "ui_pluginsourcedialog.h"
|
#include "ui_pluginsourcedialog.h"
|
||||||
|
|
||||||
|
#define SETTINGS_KEY(name) "SearchPluginSourceDialog/" name
|
||||||
|
|
||||||
PluginSourceDialog::PluginSourceDialog(QWidget *parent)
|
PluginSourceDialog::PluginSourceDialog(QWidget *parent)
|
||||||
: QDialog(parent)
|
: QDialog(parent)
|
||||||
, m_ui(new Ui::PluginSourceDialog())
|
, m_ui(new Ui::PluginSourceDialog)
|
||||||
|
, m_storeDialogSize(SETTINGS_KEY("Size"))
|
||||||
{
|
{
|
||||||
m_ui->setupUi(this);
|
m_ui->setupUi(this);
|
||||||
setAttribute(Qt::WA_DeleteOnClose);
|
setAttribute(Qt::WA_DeleteOnClose);
|
||||||
|
|
||||||
Utils::Gui::resize(this);
|
Utils::Gui::resize(this, m_storeDialogSize);
|
||||||
show();
|
show();
|
||||||
}
|
}
|
||||||
|
|
||||||
PluginSourceDialog::~PluginSourceDialog()
|
PluginSourceDialog::~PluginSourceDialog()
|
||||||
{
|
{
|
||||||
|
m_storeDialogSize = size();
|
||||||
delete m_ui;
|
delete m_ui;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -30,18 +30,21 @@
|
||||||
|
|
||||||
#include <QDialog>
|
#include <QDialog>
|
||||||
|
|
||||||
|
#include "base/settingvalue.h"
|
||||||
|
|
||||||
namespace Ui
|
namespace Ui
|
||||||
{
|
{
|
||||||
class PluginSourceDialog;
|
class PluginSourceDialog;
|
||||||
}
|
}
|
||||||
|
|
||||||
class PluginSourceDialog : public QDialog
|
class PluginSourceDialog final : public QDialog
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
Q_DISABLE_COPY(PluginSourceDialog)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit PluginSourceDialog(QWidget *parent = nullptr);
|
explicit PluginSourceDialog(QWidget *parent = nullptr);
|
||||||
~PluginSourceDialog();
|
~PluginSourceDialog() override;
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void askForUrl();
|
void askForUrl();
|
||||||
|
@ -53,4 +56,5 @@ private slots:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::PluginSourceDialog *m_ui;
|
Ui::PluginSourceDialog *m_ui;
|
||||||
|
SettingValue<QSize> m_storeDialogSize;
|
||||||
};
|
};
|
||||||
|
|
|
@ -35,6 +35,8 @@
|
||||||
#include "uithememanager.h"
|
#include "uithememanager.h"
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
|
|
||||||
|
#define SETTINGS_KEY(name) "SpeedLimitDialog/" name
|
||||||
|
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
void updateSliderValue(QSlider *slider, const int value)
|
void updateSliderValue(QSlider *slider, const int value)
|
||||||
|
@ -48,6 +50,7 @@ namespace
|
||||||
SpeedLimitDialog::SpeedLimitDialog(QWidget *parent)
|
SpeedLimitDialog::SpeedLimitDialog(QWidget *parent)
|
||||||
: QDialog {parent}
|
: QDialog {parent}
|
||||||
, m_ui {new Ui::SpeedLimitDialog}
|
, m_ui {new Ui::SpeedLimitDialog}
|
||||||
|
, m_storeDialogSize {SETTINGS_KEY("Size")}
|
||||||
{
|
{
|
||||||
m_ui->setupUi(this);
|
m_ui->setupUi(this);
|
||||||
|
|
||||||
|
@ -103,11 +106,12 @@ SpeedLimitDialog::SpeedLimitDialog(QWidget *parent)
|
||||||
connect(m_ui->spinAltDownloadLimit, qOverload<int>(&QSpinBox::valueChanged)
|
connect(m_ui->spinAltDownloadLimit, qOverload<int>(&QSpinBox::valueChanged)
|
||||||
, this, [this](const int value) { updateSliderValue(m_ui->sliderAltDownloadLimit, value); });
|
, this, [this](const int value) { updateSliderValue(m_ui->sliderAltDownloadLimit, value); });
|
||||||
|
|
||||||
Utils::Gui::resize(this);
|
Utils::Gui::resize(this, m_storeDialogSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
SpeedLimitDialog::~SpeedLimitDialog()
|
SpeedLimitDialog::~SpeedLimitDialog()
|
||||||
{
|
{
|
||||||
|
m_storeDialogSize = size();
|
||||||
delete m_ui;
|
delete m_ui;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -30,6 +30,8 @@
|
||||||
|
|
||||||
#include <QDialog>
|
#include <QDialog>
|
||||||
|
|
||||||
|
#include "base/settingvalue.h"
|
||||||
|
|
||||||
namespace Ui
|
namespace Ui
|
||||||
{
|
{
|
||||||
class SpeedLimitDialog;
|
class SpeedLimitDialog;
|
||||||
|
@ -38,6 +40,7 @@ namespace Ui
|
||||||
class SpeedLimitDialog final : public QDialog
|
class SpeedLimitDialog final : public QDialog
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
Q_DISABLE_COPY(SpeedLimitDialog)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit SpeedLimitDialog(QWidget *parent);
|
explicit SpeedLimitDialog(QWidget *parent);
|
||||||
|
@ -48,6 +51,7 @@ public slots:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::SpeedLimitDialog *m_ui;
|
Ui::SpeedLimitDialog *m_ui;
|
||||||
|
SettingValue<QSize> m_storeDialogSize;
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
int uploadSpeedLimit;
|
int uploadSpeedLimit;
|
||||||
|
|
|
@ -40,9 +40,12 @@
|
||||||
#include "ui_statsdialog.h"
|
#include "ui_statsdialog.h"
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
|
|
||||||
|
#define SETTINGS_KEY(name) "StatisticsDialog/" name
|
||||||
|
|
||||||
StatsDialog::StatsDialog(QWidget *parent)
|
StatsDialog::StatsDialog(QWidget *parent)
|
||||||
: QDialog(parent)
|
: QDialog(parent)
|
||||||
, m_ui(new Ui::StatsDialog)
|
, m_ui(new Ui::StatsDialog)
|
||||||
|
, m_storeDialogSize(SETTINGS_KEY("Size"))
|
||||||
{
|
{
|
||||||
m_ui->setupUi(this);
|
m_ui->setupUi(this);
|
||||||
setAttribute(Qt::WA_DeleteOnClose);
|
setAttribute(Qt::WA_DeleteOnClose);
|
||||||
|
@ -57,12 +60,13 @@ StatsDialog::StatsDialog(QWidget *parent)
|
||||||
m_ui->labelCacheHits->hide();
|
m_ui->labelCacheHits->hide();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
Utils::Gui::resize(this);
|
Utils::Gui::resize(this, m_storeDialogSize);
|
||||||
show();
|
show();
|
||||||
}
|
}
|
||||||
|
|
||||||
StatsDialog::~StatsDialog()
|
StatsDialog::~StatsDialog()
|
||||||
{
|
{
|
||||||
|
m_storeDialogSize = size();
|
||||||
delete m_ui;
|
delete m_ui;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -30,6 +30,8 @@
|
||||||
|
|
||||||
#include <QDialog>
|
#include <QDialog>
|
||||||
|
|
||||||
|
#include "base/settingvalue.h"
|
||||||
|
|
||||||
namespace Ui
|
namespace Ui
|
||||||
{
|
{
|
||||||
class StatsDialog;
|
class StatsDialog;
|
||||||
|
@ -38,6 +40,7 @@ namespace Ui
|
||||||
class StatsDialog final : public QDialog
|
class StatsDialog final : public QDialog
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
Q_DISABLE_COPY(StatsDialog)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit StatsDialog(QWidget *parent);
|
explicit StatsDialog(QWidget *parent);
|
||||||
|
@ -48,4 +51,5 @@ private slots:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::StatsDialog *m_ui;
|
Ui::StatsDialog *m_ui;
|
||||||
|
SettingValue<QSize> m_storeDialogSize;
|
||||||
};
|
};
|
||||||
|
|
|
@ -48,7 +48,7 @@ TorrentCreatorDialog::TorrentCreatorDialog(QWidget *parent, const QString &defau
|
||||||
: QDialog(parent)
|
: QDialog(parent)
|
||||||
, m_ui(new Ui::TorrentCreatorDialog)
|
, m_ui(new Ui::TorrentCreatorDialog)
|
||||||
, m_creatorThread(new BitTorrent::TorrentCreatorThread(this))
|
, m_creatorThread(new BitTorrent::TorrentCreatorThread(this))
|
||||||
, m_storeDialogSize(SETTINGS_KEY("Dimension"))
|
, m_storeDialogSize(SETTINGS_KEY("Size"))
|
||||||
, m_storePieceSize(SETTINGS_KEY("PieceSize"))
|
, m_storePieceSize(SETTINGS_KEY("PieceSize"))
|
||||||
, m_storePrivateTorrent(SETTINGS_KEY("PrivateTorrent"))
|
, m_storePrivateTorrent(SETTINGS_KEY("PrivateTorrent"))
|
||||||
, m_storeStartSeeding(SETTINGS_KEY("StartSeeding"))
|
, m_storeStartSeeding(SETTINGS_KEY("StartSeeding"))
|
||||||
|
|
|
@ -39,6 +39,8 @@
|
||||||
#include "ui_torrentoptionsdialog.h"
|
#include "ui_torrentoptionsdialog.h"
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
|
|
||||||
|
#define SETTINGS_KEY(name) "TorrentOptionsDialog/" name
|
||||||
|
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
const int MIXED_SHARE_LIMITS = -9;
|
const int MIXED_SHARE_LIMITS = -9;
|
||||||
|
@ -54,6 +56,7 @@ namespace
|
||||||
TorrentOptionsDialog::TorrentOptionsDialog(QWidget *parent, const QVector<BitTorrent::TorrentHandle *> &torrents)
|
TorrentOptionsDialog::TorrentOptionsDialog(QWidget *parent, const QVector<BitTorrent::TorrentHandle *> &torrents)
|
||||||
: QDialog {parent}
|
: QDialog {parent}
|
||||||
, m_ui {new Ui::TorrentOptionsDialog}
|
, m_ui {new Ui::TorrentOptionsDialog}
|
||||||
|
, m_storeDialogSize {SETTINGS_KEY("Size")}
|
||||||
{
|
{
|
||||||
m_ui->setupUi(this);
|
m_ui->setupUi(this);
|
||||||
|
|
||||||
|
@ -265,11 +268,12 @@ TorrentOptionsDialog::TorrentOptionsDialog(QWidget *parent, const QVector<BitTor
|
||||||
, this, &TorrentOptionsDialog::handleRatioTypeChanged);
|
, this, &TorrentOptionsDialog::handleRatioTypeChanged);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
Utils::Gui::resize(this);
|
Utils::Gui::resize(this, m_storeDialogSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
TorrentOptionsDialog::~TorrentOptionsDialog()
|
TorrentOptionsDialog::~TorrentOptionsDialog()
|
||||||
{
|
{
|
||||||
|
m_storeDialogSize = size();
|
||||||
delete m_ui;
|
delete m_ui;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -30,6 +30,8 @@
|
||||||
|
|
||||||
#include <QDialog>
|
#include <QDialog>
|
||||||
|
|
||||||
|
#include "base/settingvalue.h"
|
||||||
|
|
||||||
namespace BitTorrent
|
namespace BitTorrent
|
||||||
{
|
{
|
||||||
class InfoHash;
|
class InfoHash;
|
||||||
|
@ -44,6 +46,7 @@ namespace Ui
|
||||||
class TorrentOptionsDialog final : public QDialog
|
class TorrentOptionsDialog final : public QDialog
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
Q_DISABLE_COPY(TorrentOptionsDialog)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit TorrentOptionsDialog(QWidget *parent, const QVector<BitTorrent::TorrentHandle *> &torrents);
|
explicit TorrentOptionsDialog(QWidget *parent, const QVector<BitTorrent::TorrentHandle *> &torrents);
|
||||||
|
@ -64,6 +67,7 @@ private:
|
||||||
|
|
||||||
QVector<BitTorrent::InfoHash> m_torrentHashes;
|
QVector<BitTorrent::InfoHash> m_torrentHashes;
|
||||||
Ui::TorrentOptionsDialog *m_ui;
|
Ui::TorrentOptionsDialog *m_ui;
|
||||||
|
SettingValue<QSize> m_storeDialogSize;
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
qreal ratio;
|
qreal ratio;
|
||||||
|
|
|
@ -42,7 +42,7 @@
|
||||||
TrackerEntriesDialog::TrackerEntriesDialog(QWidget *parent)
|
TrackerEntriesDialog::TrackerEntriesDialog(QWidget *parent)
|
||||||
: QDialog(parent)
|
: QDialog(parent)
|
||||||
, m_ui(new Ui::TrackerEntriesDialog)
|
, m_ui(new Ui::TrackerEntriesDialog)
|
||||||
, m_storeDialogSize(SETTINGS_KEY("Dimension"))
|
, m_storeDialogSize(SETTINGS_KEY("Size"))
|
||||||
{
|
{
|
||||||
m_ui->setupUi(this);
|
m_ui->setupUi(this);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue