diff --git a/src/tribler/core/components/libtorrent/settings.py b/src/tribler/core/components/libtorrent/settings.py index 12a369aaace..1b6270bc7b5 100644 --- a/src/tribler/core/components/libtorrent/settings.py +++ b/src/tribler/core/components/libtorrent/settings.py @@ -88,6 +88,8 @@ class DownloadDefaultsSettings(TriblerConfigSection): seeding_time: float = 60 channel_download: bool = False add_download_to_channel: bool = False + remember_columns: bool = False + columns: str = "" @validator('number_hops') def validate_number_hops(cls, v): diff --git a/src/tribler/gui/widgets/downloadspage.py b/src/tribler/gui/widgets/downloadspage.py index 98ff0499610..17ab49a85e9 100644 --- a/src/tribler/gui/widgets/downloadspage.py +++ b/src/tribler/gui/widgets/downloadspage.py @@ -77,6 +77,7 @@ def showEvent(self, QShowEvent): """ super().showEvent(QShowEvent) self.schedule_downloads_refresh(REFRESH_DOWNLOADS_SOON_INTERVAL_MSEC) + request_manager.get("settings", self.initialize_with_settings) def hideEvent(self, QHideEvent): super().hideEvent(QHideEvent) @@ -105,6 +106,15 @@ def initialize_downloads_page(self): self.background_refresh_downloads_timer.setSingleShot(True) connect(self.background_refresh_downloads_timer.timeout, self.on_background_refresh_downloads_timer) + def initialize_with_settings(self, settings): + if not settings: + return + self.settings = settings = settings["settings"] + if settings['download_defaults']['remember_columns']: + for kv in settings['download_defaults']['columns'].split(","): + key, value = kv.split(":") + self.window().downloads_list.header().resizeSection(int(key), int(value)) + def on_filter_text_changed(self, text): self.window().downloads_list.clearSelection() self.window().download_details_widget.hide()