Moved start screen to Frames module
This commit is contained in:
@@ -181,7 +181,7 @@ class PyQt5Gui(Gui):
|
|||||||
|
|
||||||
self._p.handleKeypressEvent = lambda event : None
|
self._p.handleKeypressEvent = lambda event : None
|
||||||
self._lastState = self.showStart
|
self._lastState = self.showStart
|
||||||
self._p.setCentralWidget(PyQt5Start(self))
|
self._p.setCentralWidget(Frames.Start(self.showStartPhotobooth, self.showSettings, self.close))
|
||||||
if QtWidgets.QApplication.overrideCursor() != 0:
|
if QtWidgets.QApplication.overrideCursor() != 0:
|
||||||
QtWidgets.QApplication.restoreOverrideCursor()
|
QtWidgets.QApplication.restoreOverrideCursor()
|
||||||
|
|
||||||
@@ -191,7 +191,6 @@ class PyQt5Gui(Gui):
|
|||||||
global cfg
|
global cfg
|
||||||
self._p.handleKeypressEvent = lambda event : None
|
self._p.handleKeypressEvent = lambda event : None
|
||||||
self._lastState = self.showSettings
|
self._lastState = self.showSettings
|
||||||
# self._p.setCentralWidget(PyQt5Settings(self))
|
|
||||||
self._p.setCentralWidget(Frames.Settings(cfg, self.showSettings, self.showStart, self.restart))
|
self._p.setCentralWidget(Frames.Settings(cfg, self.showSettings, self.showStart, self.restart))
|
||||||
|
|
||||||
|
|
||||||
@@ -311,37 +310,6 @@ class PyQt5MainWindow(QtWidgets.QMainWindow):
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
class PyQt5Start(QtWidgets.QFrame):
|
|
||||||
|
|
||||||
def __init__(self, gui):
|
|
||||||
|
|
||||||
super().__init__()
|
|
||||||
|
|
||||||
self.initFrame(gui)
|
|
||||||
|
|
||||||
|
|
||||||
def initFrame(self, gui):
|
|
||||||
|
|
||||||
grid = QtWidgets.QGridLayout()
|
|
||||||
grid.setSpacing(100)
|
|
||||||
self.setLayout(grid)
|
|
||||||
|
|
||||||
btnStart = QtWidgets.QPushButton('Start Photobooth')
|
|
||||||
btnStart.resize(btnStart.sizeHint())
|
|
||||||
btnStart.clicked.connect(gui.showStartPhotobooth)
|
|
||||||
grid.addWidget(btnStart, 0, 0)
|
|
||||||
|
|
||||||
btnSettings = QtWidgets.QPushButton('Settings')
|
|
||||||
btnSettings.resize(btnSettings.sizeHint())
|
|
||||||
btnSettings.clicked.connect(gui.showSettings)
|
|
||||||
grid.addWidget(btnSettings, 0, 1)
|
|
||||||
|
|
||||||
btnQuit = QtWidgets.QPushButton('Quit')
|
|
||||||
btnQuit.resize(btnQuit.sizeHint())
|
|
||||||
btnQuit.clicked.connect(gui.close)
|
|
||||||
grid.addWidget(btnQuit, 0, 2)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class PyQt5WaitMessage(QtWidgets.QFrame):
|
class PyQt5WaitMessage(QtWidgets.QFrame):
|
||||||
# With spinning wait clock, inspired by
|
# With spinning wait clock, inspired by
|
||||||
|
|||||||
@@ -10,6 +10,32 @@ from ... import camera
|
|||||||
from ... import printer
|
from ... import printer
|
||||||
|
|
||||||
|
|
||||||
|
class Start(QtWidgets.QFrame):
|
||||||
|
|
||||||
|
def __init__(self, start_action, settings_action, exit_action):
|
||||||
|
|
||||||
|
super().__init__()
|
||||||
|
|
||||||
|
self.initFrame(start_action, settings_action, exit_action)
|
||||||
|
|
||||||
|
def initFrame(self, start_action, settings_action, exit_action):
|
||||||
|
|
||||||
|
btnStart = QtWidgets.QPushButton('Start Photobooth')
|
||||||
|
btnStart.clicked.connect(start_action)
|
||||||
|
|
||||||
|
btnSettings = QtWidgets.QPushButton('Settings')
|
||||||
|
btnSettings.clicked.connect(settings_action)
|
||||||
|
|
||||||
|
btnQuit = QtWidgets.QPushButton('Quit')
|
||||||
|
btnQuit.clicked.connect(exit_action)
|
||||||
|
|
||||||
|
lay = QtWidgets.QHBoxLayout()
|
||||||
|
lay.addWidget(btnStart)
|
||||||
|
lay.addWidget(btnSettings)
|
||||||
|
lay.addWidget(btnQuit)
|
||||||
|
self.setLayout(lay)
|
||||||
|
|
||||||
|
|
||||||
class Settings(QtWidgets.QFrame):
|
class Settings(QtWidgets.QFrame):
|
||||||
|
|
||||||
def __init__(self, config, reload_action, cancel_action, restart_action):
|
def __init__(self, config, reload_action, cancel_action, restart_action):
|
||||||
|
|||||||
Reference in New Issue
Block a user