mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-11-23 17:56:50 +03:00
- Save files list column width
This commit is contained in:
parent
f9da85ecfe
commit
998b161696
4 changed files with 46 additions and 10 deletions
|
@ -247,6 +247,7 @@ GUI::GUI(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent), dis
|
|||
|
||||
// Load Window state and sizes
|
||||
readSettings();
|
||||
properties->readSettings();
|
||||
|
||||
if(settings.value(QString::fromUtf8("Preferences/General/StartMinimized"), false).toBool()) {
|
||||
this->setWindowState(Qt::WindowMinimized);
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>756</width>
|
||||
<height>333</height>
|
||||
<height>303</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
|
@ -19,13 +19,22 @@
|
|||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>333</height>
|
||||
<height>303</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string/>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QStackedWidget" name="stackedProperties">
|
||||
<property name="currentIndex">
|
||||
|
@ -821,12 +830,6 @@
|
|||
<property name="expandsOnDoubleClick">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<attribute name="headerStretchLastSection">
|
||||
<bool>true</bool>
|
||||
</attribute>
|
||||
<attribute name="headerStretchLastSection">
|
||||
<bool>true</bool>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
|
@ -886,6 +889,15 @@
|
|||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<property name="leftMargin">
|
||||
<number>5</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>5</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QPushButton" name="main_infos_button">
|
||||
<property name="styleSheet">
|
||||
|
|
|
@ -116,8 +116,7 @@ PropertiesWidget::PropertiesWidget(QWidget *parent, TransferListWidget *transfer
|
|||
}
|
||||
|
||||
PropertiesWidget::~PropertiesWidget() {
|
||||
QSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent"));
|
||||
settings.setValue("TorrentProperties/Visible", state==VISIBLE);
|
||||
saveSettings();
|
||||
delete refreshTimer;
|
||||
if(progressBarUpdater)
|
||||
delete progressBarUpdater;
|
||||
|
@ -218,6 +217,28 @@ void PropertiesWidget::loadTorrentInfos(QTorrentHandle &_h) {
|
|||
loadDynamicData();
|
||||
}
|
||||
|
||||
void PropertiesWidget::readSettings() {
|
||||
QSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent"));
|
||||
QVariantList contentColsWidths = settings.value(QString::fromUtf8("TorrentProperties/filesColsWidth"), QVariantList()).toList();
|
||||
if(contentColsWidths.empty()) {
|
||||
filesList->header()->resizeSection(0, filesList->width()/2.);
|
||||
} else {
|
||||
for(int i=0; i<contentColsWidths.size(); ++i) {
|
||||
filesList->setColumnWidth(i, contentColsWidths.at(i).toInt());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void PropertiesWidget::saveSettings() {
|
||||
QSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent"));
|
||||
settings.setValue("TorrentProperties/Visible", state==VISIBLE);
|
||||
QVariantList contentColsWidths;
|
||||
for(int i=0; i<PropListModel->columnCount()-1; ++i) {
|
||||
contentColsWidths.append(filesList->columnWidth(i));
|
||||
}
|
||||
settings.setValue(QString::fromUtf8("TorrentProperties/filesColsWidth"), contentColsWidths);
|
||||
}
|
||||
|
||||
void PropertiesWidget::loadDynamicData() {
|
||||
if(!h.is_valid()) return;
|
||||
try {
|
||||
|
|
|
@ -112,6 +112,8 @@ public slots:
|
|||
void reduce();
|
||||
void slide();
|
||||
void clear();
|
||||
void readSettings();
|
||||
void saveSettings();
|
||||
|
||||
public:
|
||||
PropertiesWidget(QWidget *parent, TransferListWidget *transferList, bittorrent* BTSession);
|
||||
|
|
Loading…
Reference in a new issue