|
|
@ -67,7 +67,7 @@ TransferListWidget::TransferListWidget(QWidget *parent, MainWindow *main_window, |
|
|
|
QTreeView(parent), BTSession(_BTSession), main_window(main_window) { |
|
|
|
QTreeView(parent), BTSession(_BTSession), main_window(main_window) { |
|
|
|
|
|
|
|
|
|
|
|
// Load settings
|
|
|
|
// Load settings
|
|
|
|
loadSettings(); |
|
|
|
bool column_loaded = loadSettings(); |
|
|
|
|
|
|
|
|
|
|
|
// Create and apply delegate
|
|
|
|
// Create and apply delegate
|
|
|
|
listDelegate = new TransferListDelegate(this); |
|
|
|
listDelegate = new TransferListDelegate(this); |
|
|
@ -107,6 +107,7 @@ TransferListWidget::TransferListWidget(QWidget *parent, MainWindow *main_window, |
|
|
|
setDragDropMode(QAbstractItemView::DragOnly); |
|
|
|
setDragDropMode(QAbstractItemView::DragOnly); |
|
|
|
|
|
|
|
|
|
|
|
// Default hidden columns
|
|
|
|
// Default hidden columns
|
|
|
|
|
|
|
|
if(!column_loaded) { |
|
|
|
setColumnHidden(TorrentModelItem::TR_PRIORITY, true); |
|
|
|
setColumnHidden(TorrentModelItem::TR_PRIORITY, true); |
|
|
|
setColumnHidden(TorrentModelItem::TR_ADD_DATE, true); |
|
|
|
setColumnHidden(TorrentModelItem::TR_ADD_DATE, true); |
|
|
|
setColumnHidden(TorrentModelItem::TR_SEED_DATE, true); |
|
|
|
setColumnHidden(TorrentModelItem::TR_SEED_DATE, true); |
|
|
@ -116,6 +117,7 @@ TransferListWidget::TransferListWidget(QWidget *parent, MainWindow *main_window, |
|
|
|
setColumnHidden(TorrentModelItem::TR_AMOUNT_DOWNLOADED, true); |
|
|
|
setColumnHidden(TorrentModelItem::TR_AMOUNT_DOWNLOADED, true); |
|
|
|
setColumnHidden(TorrentModelItem::TR_AMOUNT_LEFT, true); |
|
|
|
setColumnHidden(TorrentModelItem::TR_AMOUNT_LEFT, true); |
|
|
|
setColumnHidden(TorrentModelItem::TR_TIME_ELAPSED, true); |
|
|
|
setColumnHidden(TorrentModelItem::TR_TIME_ELAPSED, true); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
setContextMenuPolicy(Qt::CustomContextMenu); |
|
|
|
setContextMenuPolicy(Qt::CustomContextMenu); |
|
|
|
|
|
|
|
|
|
|
@ -901,10 +903,13 @@ void TransferListWidget::saveSettings() |
|
|
|
settings.setValue("TransferList/HeaderState", header()->saveState()); |
|
|
|
settings.setValue("TransferList/HeaderState", header()->saveState()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void TransferListWidget::loadSettings() |
|
|
|
bool TransferListWidget::loadSettings() |
|
|
|
{ |
|
|
|
{ |
|
|
|
QIniSettings settings("qBittorrent", "qBittorrent"); |
|
|
|
QIniSettings settings("qBittorrent", "qBittorrent"); |
|
|
|
|
|
|
|
bool ok = header()->restoreState(settings.value("TransferList/HeaderState").toByteArray()); |
|
|
|
|
|
|
|
if(!ok) { |
|
|
|
header()->resizeSection(0, 200); // Default
|
|
|
|
header()->resizeSection(0, 200); // Default
|
|
|
|
header()->restoreState(settings.value("TransferList/HeaderState").toByteArray()); |
|
|
|
} |
|
|
|
|
|
|
|
return ok; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|