From 5309466d3f7c3239cf151fec85eee2a3217190c2 Mon Sep 17 00:00:00 2001 From: shekhar-cis Date: Tue, 23 Aug 2022 19:11:46 +0530 Subject: [PATCH] Add Trash Screen and update id_name --- src/bitmessagekivy/mpybit.py | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/src/bitmessagekivy/mpybit.py b/src/bitmessagekivy/mpybit.py index 03b69426..3932f4cd 100644 --- a/src/bitmessagekivy/mpybit.py +++ b/src/bitmessagekivy/mpybit.py @@ -9,7 +9,9 @@ import os import json import importlib import logging +from functools import partial +from kivy.clock import Clock from kivy.lang import Builder from kivy.properties import ( ListProperty @@ -31,7 +33,6 @@ from pybitmessage.bitmessagekivy.base_navigation import ( BaseNavigationDrawerSubheader, BaseContentNavigationDrawer, BaseIdentitySpinner ) - from pybitmessage.bmconfigparser import config from pybitmessage.bitmessagekivy.get_platform import platform from pybitmessage.bitmessagekivy.baseclass.common import toast @@ -206,6 +207,26 @@ class NavigateApp(MDApp): else: self.root.ids.id_myaddress.children[1].active = action + def load_screen(self, instance): + """This method is used for loading screen on every click""" + if instance.text == 'Trash': + self.root.ids.scr_mngr.current = 'trash' + try: + self.root.ids.id_trash.children[1].active = True + except Exception as e: + self.root.ids.id_trash.children[0].children[1].active = True + Clock.schedule_once(partial(self.load_screen_callback, instance), 1) + + def load_screen_callback(self, instance, dt=0): + """This method is rotating loader for few seconds""" + if instance.text == 'Trash': + self.root.ids.id_trash.clear_widgets() + self.root.ids.id_trash.add_widget(data_screen_dict['Trash'].Trash()) + try: + self.root.ids.id_trash.children[1].active = False + except Exception as e: + self.root.ids.id_trash.children[0].children[1].active = False + def reset_login_screen(self): """This method is used for clearing the widgets of random screen""" if self.root.ids.id_newidentity.ids.add_random_bx.children: