Compare commits
2 Commits
2b42999008
...
db796e4d66
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
db796e4d66 | ||
|
|
5843bb5215 |
@@ -1 +0,0 @@
|
|||||||
User requested exit via password
|
|
||||||
|
Before Width: | Height: | Size: 282 KiB After Width: | Height: | Size: 282 KiB |
33
src/main.py
33
src/main.py
@@ -276,6 +276,7 @@ class CardSwipePopup(Popup):
|
|||||||
def __init__(self, callback, resources_path, **kwargs):
|
def __init__(self, callback, resources_path, **kwargs):
|
||||||
super(CardSwipePopup, self).__init__(**kwargs)
|
super(CardSwipePopup, self).__init__(**kwargs)
|
||||||
self.callback = callback
|
self.callback = callback
|
||||||
|
self.resources_path = resources_path
|
||||||
self.timeout_event = None
|
self.timeout_event = None
|
||||||
|
|
||||||
# Popup settings
|
# Popup settings
|
||||||
@@ -287,15 +288,15 @@ class CardSwipePopup(Popup):
|
|||||||
# Main layout
|
# Main layout
|
||||||
layout = BoxLayout(orientation='vertical', padding=20, spacing=20)
|
layout = BoxLayout(orientation='vertical', padding=20, spacing=20)
|
||||||
|
|
||||||
# Card swipe icon (using image)
|
# Card swipe icon (using async image to prevent "X" during load)
|
||||||
icon_path = os.path.join(resources_path, 'access-card.png')
|
icon_path = os.path.join(resources_path, 'access-card.png')
|
||||||
icon_image = Image(
|
self.icon_image = AsyncImage(
|
||||||
source=icon_path,
|
source=icon_path,
|
||||||
size_hint=(1, 0.4),
|
size_hint=(1, 0.4),
|
||||||
allow_stretch=True,
|
allow_stretch=True,
|
||||||
keep_ratio=True
|
keep_ratio=True
|
||||||
)
|
)
|
||||||
layout.add_widget(icon_image)
|
layout.add_widget(self.icon_image)
|
||||||
|
|
||||||
# Message
|
# Message
|
||||||
self.message_label = Label(
|
self.message_label = Label(
|
||||||
@@ -348,10 +349,24 @@ class CardSwipePopup(Popup):
|
|||||||
def card_received(self, card_data):
|
def card_received(self, card_data):
|
||||||
"""Called when card data is received"""
|
"""Called when card data is received"""
|
||||||
Logger.info(f"CardSwipePopup: Card received: {card_data}")
|
Logger.info(f"CardSwipePopup: Card received: {card_data}")
|
||||||
self.message_label.text = '✓ Card detected'
|
|
||||||
|
# Change icon to card-checked.png
|
||||||
|
checked_icon_path = os.path.join(self.resources_path, 'card-checked.png')
|
||||||
|
Logger.info(f"CardSwipePopup: Loading checked icon from {checked_icon_path}")
|
||||||
|
|
||||||
|
# Verify file exists
|
||||||
|
if os.path.exists(checked_icon_path):
|
||||||
|
self.icon_image.source = checked_icon_path
|
||||||
|
self.icon_image.reload() # Force reload the image
|
||||||
|
Logger.info("CardSwipePopup: Card-checked icon loaded")
|
||||||
|
else:
|
||||||
|
Logger.warning(f"CardSwipePopup: card-checked.png not found at {checked_icon_path}")
|
||||||
|
|
||||||
|
self.message_label.text = 'Card detected'
|
||||||
self.countdown_label.text = '✓'
|
self.countdown_label.text = '✓'
|
||||||
self.countdown_label.color = (0.2, 0.9, 0.3, 1)
|
self.countdown_label.color = (0.2, 0.9, 0.3, 1)
|
||||||
Clock.schedule_once(lambda dt: self.finish(card_data), 0.5)
|
# Increase delay to 1 second to give time for image to display
|
||||||
|
Clock.schedule_once(lambda dt: self.finish(card_data), 1.0)
|
||||||
|
|
||||||
def cancel(self, instance):
|
def cancel(self, instance):
|
||||||
"""Cancel button pressed"""
|
"""Cancel button pressed"""
|
||||||
@@ -1722,10 +1737,8 @@ class SignagePlayer(Widget):
|
|||||||
source=intro_path,
|
source=intro_path,
|
||||||
state='play',
|
state='play',
|
||||||
options={'eos': 'stop'},
|
options={'eos': 'stop'},
|
||||||
allow_stretch=True,
|
size_hint=(1, 1),
|
||||||
keep_ratio=True,
|
pos_hint={'center_x': 0.5, 'center_y': 0.5}
|
||||||
size=self.size,
|
|
||||||
pos=(0, 0)
|
|
||||||
)
|
)
|
||||||
|
|
||||||
# Bind to video end event
|
# Bind to video end event
|
||||||
@@ -1903,8 +1916,6 @@ class SignagePlayer(Widget):
|
|||||||
options={
|
options={
|
||||||
'eos': 'stop', # Stop at end of stream
|
'eos': 'stop', # Stop at end of stream
|
||||||
},
|
},
|
||||||
allow_stretch=True,
|
|
||||||
keep_ratio=True, # Maintain aspect ratio
|
|
||||||
size_hint=(1, 1),
|
size_hint=(1, 1),
|
||||||
pos_hint={'center_x': 0.5, 'center_y': 0.5}
|
pos_hint={'center_x': 0.5, 'center_y': 0.5}
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user