mirror of
https://github.com/brmlab/edubrm.git
synced 2025-06-08 12:53:59 +02:00
start/stop modules
This commit is contained in:
parent
3aa8986d49
commit
0cce0afdc2
3 changed files with 14 additions and 4 deletions
|
@ -24,6 +24,8 @@ class ModuleButton(QPushButton):
|
||||||
self.form.ui.lblTitle.setText(self.mod.title)
|
self.form.ui.lblTitle.setText(self.mod.title)
|
||||||
self.form.ui.areaModule.setWidget(self.mod.widget)
|
self.form.ui.areaModule.setWidget(self.mod.widget)
|
||||||
self.form.ui.areaModule.show()
|
self.form.ui.areaModule.show()
|
||||||
|
self.form.mod = self.mod
|
||||||
|
self.mod.start()
|
||||||
|
|
||||||
class Main(QMainWindow):
|
class Main(QMainWindow):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
@ -40,6 +42,7 @@ class Main(QMainWindow):
|
||||||
|
|
||||||
@pyqtSlot()
|
@pyqtSlot()
|
||||||
def on_btnBack_clicked(self):
|
def on_btnBack_clicked(self):
|
||||||
|
self.mod.stop()
|
||||||
self.ui.lblTitle.setText('EduBRM')
|
self.ui.lblTitle.setText('EduBRM')
|
||||||
# TODO: erase everything from self.ui.areaModule
|
# TODO: erase everything from self.ui.areaModule
|
||||||
self.ui.areaChoose.show()
|
self.ui.areaChoose.show()
|
||||||
|
|
|
@ -4,5 +4,8 @@ class ModuleA():
|
||||||
self.title = 'A'
|
self.title = 'A'
|
||||||
self.widget = None
|
self.widget = None
|
||||||
|
|
||||||
def run(self):
|
def start(self):
|
||||||
print 'run A'
|
print 'start A'
|
||||||
|
|
||||||
|
def stop(self):
|
||||||
|
print 'stop A'
|
||||||
|
|
|
@ -151,5 +151,9 @@ class ModuleDebug():
|
||||||
self.title = 'Debug'
|
self.title = 'Debug'
|
||||||
self.widget = ModuleDebugWidget()
|
self.widget = ModuleDebugWidget()
|
||||||
|
|
||||||
def run(self):
|
def start(self):
|
||||||
print 'run Debug'
|
print 'start Debug'
|
||||||
|
|
||||||
|
def stop(self):
|
||||||
|
print 'stop Debug'
|
||||||
|
self.widget.timer.stop()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue