From c1e514d13c3001f2480410f045d4522df75d4138 Mon Sep 17 00:00:00 2001 From: shekhar-cis Date: Tue, 9 Aug 2022 15:33:32 +0530 Subject: [PATCH] Add kivy uisignaler --- src/bitmessagekivy/uikivysignaler.py | 34 ++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 src/bitmessagekivy/uikivysignaler.py diff --git a/src/bitmessagekivy/uikivysignaler.py b/src/bitmessagekivy/uikivysignaler.py new file mode 100644 index 00000000..3acac823 --- /dev/null +++ b/src/bitmessagekivy/uikivysignaler.py @@ -0,0 +1,34 @@ +""" + UI Singnaler for kivy interface +""" + +from threading import Thread +from kivy.app import App +import queues +import state + +from debug import logger +from bitmessagekivy.baseclass.common import kivy_state_variables + + +class UIkivySignaler(Thread): + """Kivy ui signaler""" + + def __init__(self, *args, **kwargs): + super(UIkivySignaler, self).__init__(*args, **kwargs) + self.kivy_state = kivy_state_variables() + + def run(self): + self.kivy_state.kivyui_ready.wait() + while state.shutdown == 0: + try: + command, data = queues.UISignalQueue.get() + if command == 'writeNewAddressToTable': + address = data[1] + App.get_running_app().variable_1.append(address) + elif command == 'updateSentItemStatusByAckdata': + App.get_running_app().status_dispatching(data) + elif command == 'writeNewpaymentAddressToTable': + pass + except Exception as e: + logger.debug(e)