From c2096e2ecd9a9f8b66067f68028ecc887d9638f2 Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Tue, 3 Jul 2012 18:51:48 +0300 Subject: [PATCH] Remember torrent addition dialog width --- src/addnewtorrentdialog.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/addnewtorrentdialog.cpp b/src/addnewtorrentdialog.cpp index bf710d75f..3fe4bf980 100644 --- a/src/addnewtorrentdialog.cpp +++ b/src/addnewtorrentdialog.cpp @@ -100,6 +100,12 @@ void AddNewTorrentDialog::loadState() QByteArray state = settings.value("treeHeaderState").toByteArray(); if (!state.isEmpty()) 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() @@ -109,6 +115,7 @@ void AddNewTorrentDialog::saveState() if (m_contentModel) settings.setValue("treeHeaderState", ui->content_tree->header()->saveState()); settings.setValue("y", pos().y()); + settings.setValue("width", width()); } void AddNewTorrentDialog::showTorrent(const QString &torrent_path, const QString& from_url)