mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-17 22:18:05 -06:00
Remember torrent addition dialog width
This commit is contained in:
@@ -100,6 +100,12 @@ void AddNewTorrentDialog::loadState()
|
|||||||
QByteArray state = settings.value("treeHeaderState").toByteArray();
|
QByteArray state = settings.value("treeHeaderState").toByteArray();
|
||||||
if (!state.isEmpty())
|
if (!state.isEmpty())
|
||||||
ui->content_tree->header()->restoreState(state);
|
ui->content_tree->header()->restoreState(state);
|
||||||
|
int width = settings.value("width", -1).toInt();
|
||||||
|
if (width >= 0) {
|
||||||
|
QRect geo = geometry();
|
||||||
|
geo.setWidth(width);
|
||||||
|
setGeometry(geo);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void AddNewTorrentDialog::saveState()
|
void AddNewTorrentDialog::saveState()
|
||||||
@@ -109,6 +115,7 @@ void AddNewTorrentDialog::saveState()
|
|||||||
if (m_contentModel)
|
if (m_contentModel)
|
||||||
settings.setValue("treeHeaderState", ui->content_tree->header()->saveState());
|
settings.setValue("treeHeaderState", ui->content_tree->header()->saveState());
|
||||||
settings.setValue("y", pos().y());
|
settings.setValue("y", pos().y());
|
||||||
|
settings.setValue("width", width());
|
||||||
}
|
}
|
||||||
|
|
||||||
void AddNewTorrentDialog::showTorrent(const QString &torrent_path, const QString& from_url)
|
void AddNewTorrentDialog::showTorrent(const QString &torrent_path, const QString& from_url)
|
||||||
|
|||||||
Reference in New Issue
Block a user