Add Trash Screen and update id_name

This commit is contained in:
shekhar-cis 2022-08-23 19:11:46 +05:30
parent d9a9e4e6d5
commit 5309466d3f
Signed by untrusted user: shekhar-cis
GPG Key ID: F4F00AB04E83F9A7

View File

@ -9,7 +9,9 @@ import os
import json import json
import importlib import importlib
import logging import logging
from functools import partial
from kivy.clock import Clock
from kivy.lang import Builder from kivy.lang import Builder
from kivy.properties import ( from kivy.properties import (
ListProperty ListProperty
@ -31,7 +33,6 @@ from pybitmessage.bitmessagekivy.base_navigation import (
BaseNavigationDrawerSubheader, BaseContentNavigationDrawer, BaseNavigationDrawerSubheader, BaseContentNavigationDrawer,
BaseIdentitySpinner BaseIdentitySpinner
) )
from pybitmessage.bmconfigparser import config from pybitmessage.bmconfigparser import config
from pybitmessage.bitmessagekivy.get_platform import platform from pybitmessage.bitmessagekivy.get_platform import platform
from pybitmessage.bitmessagekivy.baseclass.common import toast from pybitmessage.bitmessagekivy.baseclass.common import toast
@ -206,6 +207,26 @@ class NavigateApp(MDApp):
else: else:
self.root.ids.id_myaddress.children[1].active = action 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): def reset_login_screen(self):
"""This method is used for clearing the widgets of random screen""" """This method is used for clearing the widgets of random screen"""
if self.root.ids.id_newidentity.ids.add_random_bx.children: if self.root.ids.id_newidentity.ids.add_random_bx.children: