mirror of
https://github.com/KeksPirates/SoftwareManager.git
synced 2026-08-04 09:59:41 +02:00
gui cleanup
This commit is contained in:
+16
-18
@@ -29,15 +29,20 @@ from core.utils.network.download import download_selected
|
|||||||
from core.network.aria2_integration import dlprogress
|
from core.network.aria2_integration import dlprogress
|
||||||
|
|
||||||
|
|
||||||
def create_tab(title, searchbar, software_list, tabs):
|
def create_tab(title, searchbar, software_list, tabs, dlbutton, layout2):
|
||||||
tab = QWidget()
|
tab = QWidget()
|
||||||
layout = QVBoxLayout()
|
layout = QVBoxLayout()
|
||||||
layout.addWidget(searchbar)
|
if searchbar:
|
||||||
layout.addWidget(software_list)
|
layout.addWidget(searchbar)
|
||||||
tab.setLayout(layout)
|
if layout2:
|
||||||
tabs.addTab(tab, title)
|
layout.addLayout(layout2)
|
||||||
|
else:
|
||||||
|
layout.addWidget(software_list)
|
||||||
|
if dlbutton:
|
||||||
|
layout.addWidget(dlbutton)
|
||||||
|
tab.setLayout(layout)
|
||||||
|
tabs.addTab(tab, title)
|
||||||
return tab
|
return tab
|
||||||
|
|
||||||
class MainWindow(QtWidgets.QMainWindow, QWidget):
|
class MainWindow(QtWidgets.QMainWindow, QWidget):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
@@ -82,20 +87,13 @@ class MainWindow(QtWidgets.QMainWindow, QWidget):
|
|||||||
# Tabs
|
# Tabs
|
||||||
self.tabs = QTabWidget()
|
self.tabs = QTabWidget()
|
||||||
|
|
||||||
# Tab 1
|
|
||||||
self.searchtab = QWidget()
|
|
||||||
self.searchtab_layout = QVBoxLayout()
|
|
||||||
self.horizontal_layout = QHBoxLayout()
|
self.horizontal_layout = QHBoxLayout()
|
||||||
self.horizontal_layout.addWidget(self.softwareList, stretch=3)
|
self.horizontal_layout.addWidget(self.softwareList, stretch=3)
|
||||||
self.horizontal_layout.addWidget(self.post_author_list)
|
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.tab1 = create_tab("Search", self.searchbar, self.softwareList, self.tabs, self.dlbutton, self.horizontal_layout)
|
||||||
self.tab3 = create_tab("Downloads", self.emptyDownload, self.downloadList, self.tabs)
|
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)
|
containerLayout.addWidget(self.tabs)
|
||||||
|
|
||||||
|
|||||||
@@ -58,7 +58,6 @@ def send_notification(shutdown_event):
|
|||||||
message = f"{download.name} has finished downloading.",
|
message = f"{download.name} has finished downloading.",
|
||||||
timeout = 4
|
timeout = 4
|
||||||
)
|
)
|
||||||
except Exception as e:
|
except Exception:
|
||||||
if state.debug:
|
pass
|
||||||
print("Notification thread error:", e)
|
|
||||||
time.sleep(5)
|
time.sleep(5)
|
||||||
|
|||||||
Reference in New Issue
Block a user