mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-23 21:14:33 +00:00
Fix initial column sizes in torrent addition dialog
This commit is contained in:
parent
7381b0dcf6
commit
d6b5627363
@ -63,7 +63,6 @@ torrentAdditionDialog::torrentAdditionDialog(QWidget *parent) :
|
|||||||
const Preferences pref;
|
const Preferences pref;
|
||||||
setupUi(this);
|
setupUi(this);
|
||||||
setAttribute(Qt::WA_DeleteOnClose);
|
setAttribute(Qt::WA_DeleteOnClose);
|
||||||
loadFilesListState();
|
|
||||||
// Icons
|
// Icons
|
||||||
CancelButton->setIcon(IconProvider::instance()->getIcon("dialog-cancel"));
|
CancelButton->setIcon(IconProvider::instance()->getIcon("dialog-cancel"));
|
||||||
OkButton->setIcon(IconProvider::instance()->getIcon("list-add"));
|
OkButton->setIcon(IconProvider::instance()->getIcon("list-add"));
|
||||||
@ -128,7 +127,6 @@ torrentAdditionDialog::~torrentAdditionDialog() {
|
|||||||
void torrentAdditionDialog::closeEvent(QCloseEvent *event)
|
void torrentAdditionDialog::closeEvent(QCloseEvent *event)
|
||||||
{
|
{
|
||||||
qDebug() << Q_FUNC_INFO;
|
qDebug() << Q_FUNC_INFO;
|
||||||
saveFilesListState();
|
|
||||||
saveSettings();
|
saveSettings();
|
||||||
QDialog::closeEvent(event);
|
QDialog::closeEvent(event);
|
||||||
}
|
}
|
||||||
@ -136,24 +134,16 @@ void torrentAdditionDialog::closeEvent(QCloseEvent *event)
|
|||||||
void torrentAdditionDialog::readSettings() {
|
void torrentAdditionDialog::readSettings() {
|
||||||
QIniSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent"));
|
QIniSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent"));
|
||||||
restoreGeometry(settings.value("TorrentAdditionDlg/dimensions").toByteArray());
|
restoreGeometry(settings.value("TorrentAdditionDlg/dimensions").toByteArray());
|
||||||
|
if(!torrentContentList->header()->restoreState(settings.value("TorrentAdditionDlg/ContentHeaderState").toByteArray())) {
|
||||||
|
qDebug() << Q_FUNC_INFO << "First executation, resize first section to 200px...";
|
||||||
|
torrentContentList->header()->resizeSection(0, 400); //Default
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void torrentAdditionDialog::saveSettings() {
|
void torrentAdditionDialog::saveSettings() {
|
||||||
QIniSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent"));
|
|
||||||
settings.setValue("TorrentAdditionDlg/dimensions", saveGeometry());
|
|
||||||
}
|
|
||||||
|
|
||||||
void torrentAdditionDialog::loadFilesListState() {
|
|
||||||
QIniSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent"));
|
|
||||||
if(!torrentContentList->header()->restoreState(settings.value("TorrentAdditionDlg/ContentHeaderState").toByteArray())) {
|
|
||||||
torrentContentList->header()->resizeSection(0, 200); //Default
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void torrentAdditionDialog::saveFilesListState() {
|
|
||||||
QIniSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent"));
|
QIniSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent"));
|
||||||
settings.setValue("TorrentAdditionDlg/ContentHeaderState", torrentContentList->header()->saveState());
|
settings.setValue("TorrentAdditionDlg/ContentHeaderState", torrentContentList->header()->saveState());
|
||||||
|
settings.setValue("TorrentAdditionDlg/dimensions", saveGeometry());
|
||||||
}
|
}
|
||||||
|
|
||||||
void torrentAdditionDialog::limitDialogWidth() {
|
void torrentAdditionDialog::limitDialogWidth() {
|
||||||
|
@ -74,8 +74,6 @@ protected:
|
|||||||
private:
|
private:
|
||||||
void readSettings();
|
void readSettings();
|
||||||
void saveSettings();
|
void saveSettings();
|
||||||
void loadFilesListState();
|
|
||||||
void saveFilesListState();
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QString fileName;
|
QString fileName;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user