From 92a6fbc9b5ca1774fc4164f8565d62055804bcd9 Mon Sep 17 00:00:00 2001 From: Vxrtrauter Date: Sat, 11 Oct 2025 21:39:12 +0200 Subject: [PATCH] gui cleanup --- core/interface/gui.py | 34 +++++++++++++++---------------- core/network/aria2_integration.py | 5 ++--- 2 files changed, 18 insertions(+), 21 deletions(-) diff --git a/core/interface/gui.py b/core/interface/gui.py index 012f929..4c29c77 100644 --- a/core/interface/gui.py +++ b/core/interface/gui.py @@ -29,15 +29,20 @@ from core.utils.network.download import download_selected from core.network.aria2_integration import dlprogress -def create_tab(title, searchbar, software_list, tabs): - tab = QWidget() - layout = QVBoxLayout() - layout.addWidget(searchbar) - layout.addWidget(software_list) - tab.setLayout(layout) - tabs.addTab(tab, title) +def create_tab(title, searchbar, software_list, tabs, dlbutton, layout2): + tab = QWidget() + layout = QVBoxLayout() + if searchbar: + layout.addWidget(searchbar) + if layout2: + layout.addLayout(layout2) + else: + layout.addWidget(software_list) + if dlbutton: + layout.addWidget(dlbutton) + tab.setLayout(layout) + tabs.addTab(tab, title) return tab - class MainWindow(QtWidgets.QMainWindow, QWidget): def __init__(self): super().__init__() @@ -82,20 +87,13 @@ class MainWindow(QtWidgets.QMainWindow, QWidget): # Tabs self.tabs = QTabWidget() - # Tab 1 - self.searchtab = QWidget() - self.searchtab_layout = QVBoxLayout() self.horizontal_layout = QHBoxLayout() self.horizontal_layout.addWidget(self.softwareList, stretch=3) self.horizontal_layout.addWidget(self.post_author_list) - self.searchtab_layout.addWidget(self.searchbar) - self.searchtab_layout.addWidget(self.dlbutton) - self.searchtab_layout.addLayout(self.horizontal_layout) - self.searchtab.setLayout(self.searchtab_layout) - self.tabs.addTab(self.searchtab,"Search") - self.tab2 = create_tab("Library", self.emptyLibrary, self.libraryList, self.tabs) - self.tab3 = create_tab("Downloads", self.emptyDownload, self.downloadList, self.tabs) + self.tab1 = create_tab("Search", self.searchbar, self.softwareList, self.tabs, self.dlbutton, self.horizontal_layout) + self.tab2 = create_tab("Library", self.emptyLibrary, self.libraryList, self.tabs, None, None) + self.tab3 = create_tab("Downloads", self.emptyDownload, self.downloadList, self.tabs, None, None) containerLayout.addWidget(self.tabs) diff --git a/core/network/aria2_integration.py b/core/network/aria2_integration.py index 37a5b1c..d585ac4 100644 --- a/core/network/aria2_integration.py +++ b/core/network/aria2_integration.py @@ -58,7 +58,6 @@ def send_notification(shutdown_event): message = f"{download.name} has finished downloading.", timeout = 4 ) - except Exception as e: - if state.debug: - print("Notification thread error:", e) + except Exception: + pass time.sleep(5)