From a39c7f52cf6ba35c842fe5c87532ee0bdd3f7720 Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Sat, 4 Dec 2010 10:10:05 +0000 Subject: [PATCH] Remember torrent import dialog geometry and position --- src/torrentimportdlg.cpp | 14 ++++++++++++++ src/torrentimportdlg.h | 4 ++++ 2 files changed, 18 insertions(+) diff --git a/src/torrentimportdlg.cpp b/src/torrentimportdlg.cpp index 99b6bb465..79dbcad2e 100644 --- a/src/torrentimportdlg.cpp +++ b/src/torrentimportdlg.cpp @@ -49,10 +49,12 @@ TorrentImportDlg::TorrentImportDlg(QWidget *parent) : #if LIBTORRENT_VERSION_MINOR < 15 ui->checkSkipCheck->setVisible(false); #endif + loadSettings(); } TorrentImportDlg::~TorrentImportDlg() { + saveSettings(); delete ui; } @@ -277,3 +279,15 @@ bool TorrentImportDlg::skipFileChecking() const return ui->checkSkipCheck->isChecked(); } #endif + +void TorrentImportDlg::loadSettings() +{ + QIniSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent")); + settings.setValue("TorrentImportDlg/dimensions", saveGeometry()); +} + +void TorrentImportDlg::saveSettings() +{ + QIniSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent")); + restoreGeometry(settings.value("TorrentImportDlg/dimensions").toByteArray()); +} diff --git a/src/torrentimportdlg.h b/src/torrentimportdlg.h index f1808524f..94cae6a34 100644 --- a/src/torrentimportdlg.h +++ b/src/torrentimportdlg.h @@ -69,6 +69,10 @@ private slots: void on_importBtn_clicked(); +private: + void loadSettings(); + void saveSettings(); + private: Ui::TorrentImportDlg *ui; boost::intrusive_ptr t;