mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-16 02:03:07 -07:00
- Save files list column width
This commit is contained in:
parent
f9da85ecfe
commit
998b161696
4 changed files with 46 additions and 10 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue