mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-25 14:04:23 +00:00
Remember last viewed page in Options dialog (#15230)
This commit is contained in:
parent
1eb246c98b
commit
2d4d246268
@ -180,6 +180,7 @@ OptionsDialog::OptionsDialog(QWidget *parent)
|
|||||||
, m_ui {new Ui::OptionsDialog}
|
, m_ui {new Ui::OptionsDialog}
|
||||||
, m_storeDialogSize {SETTINGS_KEY("Size")}
|
, m_storeDialogSize {SETTINGS_KEY("Size")}
|
||||||
, m_storeHSplitterSize {SETTINGS_KEY("HorizontalSplitterSizes")}
|
, m_storeHSplitterSize {SETTINGS_KEY("HorizontalSplitterSizes")}
|
||||||
|
, m_storeLastViewedPage {SETTINGS_KEY("LastViewedPage")}
|
||||||
{
|
{
|
||||||
qDebug("-> Constructing Options");
|
qDebug("-> Constructing Options");
|
||||||
m_ui->setupUi(this);
|
m_ui->setupUi(this);
|
||||||
@ -570,6 +571,8 @@ OptionsDialog::OptionsDialog(QWidget *parent)
|
|||||||
for (QSpinBox *widget : asConst(findChildren<QSpinBox *>()))
|
for (QSpinBox *widget : asConst(findChildren<QSpinBox *>()))
|
||||||
widget->installEventFilter(wheelEventEater);
|
widget->installEventFilter(wheelEventEater);
|
||||||
|
|
||||||
|
m_ui->tabSelection->setCurrentRow(m_storeLastViewedPage);
|
||||||
|
|
||||||
Utils::Gui::resize(this, m_storeDialogSize);
|
Utils::Gui::resize(this, m_storeDialogSize);
|
||||||
show();
|
show();
|
||||||
// Have to be called after show(), because splitter width needed
|
// Have to be called after show(), because splitter width needed
|
||||||
@ -619,6 +622,8 @@ OptionsDialog::~OptionsDialog()
|
|||||||
hSplitterSizes.append(QString::number(size));
|
hSplitterSizes.append(QString::number(size));
|
||||||
m_storeHSplitterSize = hSplitterSizes;
|
m_storeHSplitterSize = hSplitterSizes;
|
||||||
|
|
||||||
|
m_storeLastViewedPage = m_ui->tabSelection->currentRow();
|
||||||
|
|
||||||
delete m_ui;
|
delete m_ui;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -181,6 +181,7 @@ private:
|
|||||||
Ui::OptionsDialog *m_ui;
|
Ui::OptionsDialog *m_ui;
|
||||||
SettingValue<QSize> m_storeDialogSize;
|
SettingValue<QSize> m_storeDialogSize;
|
||||||
SettingValue<QStringList> m_storeHSplitterSize;
|
SettingValue<QStringList> m_storeHSplitterSize;
|
||||||
|
SettingValue<int> m_storeLastViewedPage;
|
||||||
|
|
||||||
QPushButton *m_applyButton;
|
QPushButton *m_applyButton;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user