Browse Source

Remember torrent import dialog geometry and position

adaptive-webui-19844
Christophe Dumez 14 years ago
parent
commit
a39c7f52cf
  1. 14
      src/torrentimportdlg.cpp
  2. 4
      src/torrentimportdlg.h

14
src/torrentimportdlg.cpp

@ -49,10 +49,12 @@ TorrentImportDlg::TorrentImportDlg(QWidget *parent) : @@ -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 @@ -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());
}

4
src/torrentimportdlg.h

@ -69,6 +69,10 @@ private slots: @@ -69,6 +69,10 @@ private slots:
void on_importBtn_clicked();
private:
void loadSettings();
void saveSettings();
private:
Ui::TorrentImportDlg *ui;
boost::intrusive_ptr<libtorrent::torrent_info> t;

Loading…
Cancel
Save