mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-08 22:07:53 +00:00
Several dimension saving fixes
This commit is contained in:
parent
a39c7f52cf
commit
45f0383ee2
@ -38,6 +38,7 @@
|
||||
#include <QApplication>
|
||||
#include <QDesktopWidget>
|
||||
#include <QInputDialog>
|
||||
#include <QDebug>
|
||||
|
||||
#include <libtorrent/version.hpp>
|
||||
#include <libtorrent/session.hpp>
|
||||
@ -112,11 +113,17 @@ torrentAdditionDialog::torrentAdditionDialog(QWidget *parent) :
|
||||
}
|
||||
|
||||
torrentAdditionDialog::~torrentAdditionDialog() {
|
||||
saveSettings();
|
||||
delete PropDelegate;
|
||||
delete PropListModel;
|
||||
}
|
||||
|
||||
void torrentAdditionDialog::closeEvent(QCloseEvent *event)
|
||||
{
|
||||
qDebug() << Q_FUNC_INFO;
|
||||
saveSettings();
|
||||
QDialog::closeEvent(event);
|
||||
}
|
||||
|
||||
void torrentAdditionDialog::readSettings() {
|
||||
QIniSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent"));
|
||||
restoreGeometry(settings.value("TorrentAdditionDlg/dimensions").toByteArray());
|
||||
|
@ -71,6 +71,9 @@ public slots:
|
||||
void updateSavePathCurrentText();
|
||||
void resetComboLabelIndex(QString text);
|
||||
|
||||
protected:
|
||||
void closeEvent(QCloseEvent *event);
|
||||
|
||||
private:
|
||||
QString fileName;
|
||||
QString hash;
|
||||
|
@ -51,6 +51,7 @@ TorrentCreatorDlg::TorrentCreatorDlg(QWidget *parent): QDialog(parent), creatorT
|
||||
loadTrackerList();
|
||||
// Piece sizes
|
||||
m_piece_sizes << 32 << 64 << 128 << 256 << 512 << 1024 << 2048 << 4096;
|
||||
loadSettings();
|
||||
show();
|
||||
}
|
||||
|
||||
@ -182,7 +183,7 @@ void TorrentCreatorDlg::on_cancelButton_clicked() {
|
||||
creatorThread->wait();
|
||||
}
|
||||
// Close the dialog
|
||||
reject();
|
||||
close();
|
||||
}
|
||||
|
||||
void TorrentCreatorDlg::updateProgressBar(int progress) {
|
||||
@ -255,3 +256,22 @@ void TorrentCreatorDlg::loadTrackerList()
|
||||
QIniSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent"));
|
||||
trackers_list->setPlainText(settings.value("CreateTorrent/TrackerList", "").toString());
|
||||
}
|
||||
|
||||
void TorrentCreatorDlg::saveSettings()
|
||||
{
|
||||
QIniSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent"));
|
||||
settings.setValue("CreateTorrent/dimensions", saveGeometry());
|
||||
}
|
||||
|
||||
void TorrentCreatorDlg::loadSettings()
|
||||
{
|
||||
QIniSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent"));
|
||||
restoreGeometry(settings.value("CreateTorrent/dimensions").toByteArray());
|
||||
}
|
||||
|
||||
void TorrentCreatorDlg::closeEvent(QCloseEvent *event)
|
||||
{
|
||||
qDebug() << Q_FUNC_INFO;
|
||||
saveSettings();
|
||||
QDialog::closeEvent(event);
|
||||
}
|
||||
|
@ -37,31 +37,38 @@ class TorrentCreatorThread;
|
||||
|
||||
class TorrentCreatorDlg : public QDialog, private Ui::createTorrentDialog{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
TorrentCreatorDlg(QWidget *parent = 0);
|
||||
~TorrentCreatorDlg();
|
||||
int getPieceSize() const;
|
||||
|
||||
signals:
|
||||
void torrent_to_seed(QString path);
|
||||
public:
|
||||
TorrentCreatorDlg(QWidget *parent = 0);
|
||||
~TorrentCreatorDlg();
|
||||
int getPieceSize() const;
|
||||
|
||||
public slots:
|
||||
void updateProgressBar(int progress);
|
||||
void on_cancelButton_clicked();
|
||||
signals:
|
||||
void torrent_to_seed(QString path);
|
||||
|
||||
protected slots:
|
||||
void on_createButton_clicked();
|
||||
void on_addFile_button_clicked();
|
||||
void on_addFolder_button_clicked();
|
||||
void handleCreationFailure(QString msg);
|
||||
void handleCreationSuccess(QString path, QString branch_path);
|
||||
void setInteractionEnabled(bool enabled);
|
||||
void showProgressBar(bool show);
|
||||
void on_checkAutoPieceSize_clicked(bool checked);
|
||||
void updateOptimalPieceSize();
|
||||
void saveTrackerList();
|
||||
void loadTrackerList();
|
||||
public slots:
|
||||
void updateProgressBar(int progress);
|
||||
void on_cancelButton_clicked();
|
||||
|
||||
protected slots:
|
||||
void on_createButton_clicked();
|
||||
void on_addFile_button_clicked();
|
||||
void on_addFolder_button_clicked();
|
||||
void handleCreationFailure(QString msg);
|
||||
void handleCreationSuccess(QString path, QString branch_path);
|
||||
void setInteractionEnabled(bool enabled);
|
||||
void showProgressBar(bool show);
|
||||
void on_checkAutoPieceSize_clicked(bool checked);
|
||||
void updateOptimalPieceSize();
|
||||
void saveTrackerList();
|
||||
void loadTrackerList();
|
||||
|
||||
protected:
|
||||
void closeEvent(QCloseEvent *event);
|
||||
|
||||
private:
|
||||
void saveSettings();
|
||||
void loadSettings();
|
||||
|
||||
private:
|
||||
TorrentCreatorThread *creatorThread;
|
||||
|
@ -30,6 +30,7 @@
|
||||
|
||||
#include <QFileDialog>
|
||||
#include <QMessageBox>
|
||||
#include <QDebug>
|
||||
|
||||
#include "torrentimportdlg.h"
|
||||
#include "ui_torrentimportdlg.h"
|
||||
@ -54,7 +55,6 @@ TorrentImportDlg::TorrentImportDlg(QWidget *parent) :
|
||||
|
||||
TorrentImportDlg::~TorrentImportDlg()
|
||||
{
|
||||
saveSettings();
|
||||
delete ui;
|
||||
}
|
||||
|
||||
@ -180,7 +180,7 @@ void TorrentImportDlg::on_browseContentBtn_clicked()
|
||||
|
||||
void TorrentImportDlg::on_importBtn_clicked()
|
||||
{
|
||||
accept();
|
||||
close();
|
||||
}
|
||||
|
||||
QString TorrentImportDlg::getTorrentPath() const
|
||||
@ -283,11 +283,18 @@ bool TorrentImportDlg::skipFileChecking() const
|
||||
void TorrentImportDlg::loadSettings()
|
||||
{
|
||||
QIniSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent"));
|
||||
settings.setValue("TorrentImportDlg/dimensions", saveGeometry());
|
||||
restoreGeometry(settings.value("TorrentImportDlg/dimensions").toByteArray());
|
||||
}
|
||||
|
||||
void TorrentImportDlg::saveSettings()
|
||||
{
|
||||
QIniSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent"));
|
||||
restoreGeometry(settings.value("TorrentImportDlg/dimensions").toByteArray());
|
||||
settings.setValue("TorrentImportDlg/dimensions", saveGeometry());
|
||||
}
|
||||
|
||||
void TorrentImportDlg::closeEvent(QCloseEvent *event)
|
||||
{
|
||||
qDebug() << Q_FUNC_INFO;
|
||||
saveSettings();
|
||||
QDialog::closeEvent(event);
|
||||
}
|
||||
|
@ -69,6 +69,9 @@ private slots:
|
||||
|
||||
void on_importBtn_clicked();
|
||||
|
||||
protected:
|
||||
void closeEvent(QCloseEvent *event);
|
||||
|
||||
private:
|
||||
void loadSettings();
|
||||
void saveSettings();
|
||||
|
Loading…
Reference in New Issue
Block a user