OOPing it more: Removed gui_communication/menu_bar.py
This commit is contained in:
parent
5e5521bc67
commit
07e53ef2e7
4 changed files with 7 additions and 22 deletions
|
@ -9,7 +9,7 @@ class GUI:
|
|||
def __init__(self, app):
|
||||
self.app = app
|
||||
|
||||
self.window = MainWindow()
|
||||
self.window = MainWindow(app)
|
||||
self.settings = self.window.settings
|
||||
|
||||
self.window.addDockWidget(Qt.DockWidgetArea.RightDockWidgetArea, self.app.library.main_library_dock)
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
#!/usr/bin/python3
|
||||
|
||||
from .menu_bar import MenuBar
|
||||
from .track_control import TrackControl
|
||||
|
||||
|
||||
|
@ -12,7 +11,6 @@ class GUICommunication:
|
|||
def __init__(self, app):
|
||||
self.app = app
|
||||
|
||||
self.menu_bar = MenuBar(self.app)
|
||||
self.track_control = TrackControl(self.app)
|
||||
|
||||
def on_track_change(self, previous_track=None, track=None):
|
||||
|
|
|
@ -1,17 +0,0 @@
|
|||
#!/usr/bin/python3
|
||||
|
||||
|
||||
class MenuBar:
|
||||
def __init__(self, app):
|
||||
self.app = app
|
||||
self.window = self.app.gui.window
|
||||
self.settings_action = self.window.settings_action
|
||||
|
||||
self.connect()
|
||||
|
||||
def connect(self):
|
||||
self.settings_action.triggered.connect(self.show_settings)
|
||||
|
||||
def show_settings(self):
|
||||
self.window.settings.show()
|
||||
|
|
@ -7,9 +7,11 @@ from .settings import Settings
|
|||
|
||||
|
||||
class MainWindow(QMainWindow):
|
||||
def __init__(self, parent=None):
|
||||
def __init__(self, app, parent=None):
|
||||
super().__init__(parent)
|
||||
|
||||
self.app = app
|
||||
|
||||
self.setWindowTitle("Wobuzz")
|
||||
|
||||
self.menu_bar = self.menuBar()
|
||||
|
@ -25,7 +27,9 @@ class MainWindow(QMainWindow):
|
|||
self.track_control = TrackControl()
|
||||
self.addToolBar(self.track_control)
|
||||
|
||||
self.settings = Settings()
|
||||
self.settings = Settings(app)
|
||||
self.settings.hide()
|
||||
self.addDockWidget(Qt.DockWidgetArea.LeftDockWidgetArea, self.settings)
|
||||
|
||||
self.settings_action.triggered.connect(self.settings.show)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue