mirror of
https://github.com/janishutz/BiogasControllerApp.git
synced 2025-11-25 13:54:24 +00:00
Popups done, Readout Screen prepared, Small fixes
This commit is contained in:
@@ -37,10 +37,10 @@
|
||||
font_size: 13
|
||||
pos_hint: {"y": -0.45, "x":0.05}
|
||||
Button:
|
||||
text: "Settings"
|
||||
text: "About"
|
||||
font_size: 13
|
||||
size_hint: 0.07, 0.06
|
||||
pos_hint: {"x":0.01, "y":0.01}
|
||||
background_color: (50, 0, 0, 0.2)
|
||||
on_release:
|
||||
root.to_settings()
|
||||
root.to_about()
|
||||
|
||||
@@ -1,16 +1,29 @@
|
||||
from kivy.uix.screenmanager import Screen
|
||||
from kivy.lang import Builder
|
||||
|
||||
from gui.popups.popups import QuitPopup, SingleRowPopup, TwoActionPopup
|
||||
from lib.com import Com
|
||||
|
||||
class HomeScreen(Screen):
|
||||
def __init__(self, com: Com, **kw):
|
||||
self._com = com;
|
||||
super().__init__(**kw)
|
||||
|
||||
def start(self):
|
||||
pass
|
||||
if self._com.connect(19200):
|
||||
self.manager.current = 'main'
|
||||
self.manager.transition.direction = 'right'
|
||||
else:
|
||||
TwoActionPopup().open('Failed to connect', 'Details', self.open_details_popup)
|
||||
print('ERROR connecting')
|
||||
|
||||
def open_details_popup(self):
|
||||
print( 'Details' )
|
||||
|
||||
def quit(self):
|
||||
pass
|
||||
QuitPopup(self._com).open()
|
||||
|
||||
def to_settings(self):
|
||||
self.manager.current = 'settings'
|
||||
def to_about(self):
|
||||
self.manager.current = 'about'
|
||||
self.manager.transition.direction = 'down'
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user