mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-12-21 08:09:35 +08: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_storeDialogSize {SETTINGS_KEY("Size")}
|
||||
, m_storeHSplitterSize {SETTINGS_KEY("HorizontalSplitterSizes")}
|
||||
, m_storeLastViewedPage {SETTINGS_KEY("LastViewedPage")}
|
||||
{
|
||||
qDebug("-> Constructing Options");
|
||||
m_ui->setupUi(this);
|
||||
@ -570,6 +571,8 @@ OptionsDialog::OptionsDialog(QWidget *parent)
|
||||
for (QSpinBox *widget : asConst(findChildren<QSpinBox *>()))
|
||||
widget->installEventFilter(wheelEventEater);
|
||||
|
||||
m_ui->tabSelection->setCurrentRow(m_storeLastViewedPage);
|
||||
|
||||
Utils::Gui::resize(this, m_storeDialogSize);
|
||||
show();
|
||||
// Have to be called after show(), because splitter width needed
|
||||
@ -619,6 +622,8 @@ OptionsDialog::~OptionsDialog()
|
||||
hSplitterSizes.append(QString::number(size));
|
||||
m_storeHSplitterSize = hSplitterSizes;
|
||||
|
||||
m_storeLastViewedPage = m_ui->tabSelection->currentRow();
|
||||
|
||||
delete m_ui;
|
||||
}
|
||||
|
||||
|
@ -181,6 +181,7 @@ private:
|
||||
Ui::OptionsDialog *m_ui;
|
||||
SettingValue<QSize> m_storeDialogSize;
|
||||
SettingValue<QStringList> m_storeHSplitterSize;
|
||||
SettingValue<int> m_storeLastViewedPage;
|
||||
|
||||
QPushButton *m_applyButton;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user