diff --git a/src/tribler/core/components/libtorrent/settings.py b/src/tribler/core/components/libtorrent/settings.py index 1b6270bc7b5..12a369aaace 100644 --- a/src/tribler/core/components/libtorrent/settings.py +++ b/src/tribler/core/components/libtorrent/settings.py @@ -88,8 +88,6 @@ 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 17ab49a85e9..fa71a0bd683 100644 --- a/src/tribler/gui/widgets/downloadspage.py +++ b/src/tribler/gui/widgets/downloadspage.py @@ -77,7 +77,6 @@ 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) @@ -101,20 +100,17 @@ def initialize_downloads_page(self): connect(self.window().downloads_filter_input.textChanged, self.on_filter_text_changed) self.window().downloads_list.header().setSortIndicator(12, Qt.AscendingOrder) - self.window().downloads_list.header().resizeSection(12, 146) + columns = self.window().gui_settings.value("remember_columns", "") + if columns == "": + self.window().downloads_list.header().resizeSection(12, 146) + else: + for kv in columns.split(","): + key, value = kv.split(":") + self.window().downloads_list.header().resizeSection(int(key), int(value)) 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()