Add Trash Screen

This commit is contained in:
shekhar-cis 2022-07-07 21:40:26 +05:30
parent 1b9ff22abb
commit 0f53c1e03c
Signed by untrusted user: shekhar-cis
GPG Key ID: F4F00AB04E83F9A7
3 changed files with 40 additions and 0 deletions

View File

@ -0,0 +1,33 @@
# pylint: disable=unused-argument, consider-using-f-string, import-error, attribute-defined-outside-init
# pylint: disable=unnecessary-comprehension, no-member, no-name-in-module, too-few-public-methods
"""
Trash screen
"""
from kivy.properties import (
ListProperty,
StringProperty
)
from kivy.uix.screenmanager import Screen
from kivy.app import App
from pybitmessage.bitmessagekivy.baseclass.common import kivy_state_variables
class Trash(Screen):
"""Trash Screen class for kivy Ui"""
trash_messages = ListProperty()
has_refreshed = True
delete_index = None
table_name = StringProperty()
no_msg_found_str = "Yet no trashed message for this account!"
def __init__(self, *args, **kwargs):
"""Trash method, delete sent message and add in Trash"""
super(Trash, self).__init__(*args, **kwargs)
self.kivy_state = kivy_state_variables()
if self.kivy_state.selected_address == '':
if App.get_running_app().identity_list:
self.kivy_state.selected_address = App.get_running_app().identity_list[0]

View File

@ -231,6 +231,8 @@ MDNavigationLayout:
id:id_inbox id:id_inbox
Sent: Sent:
id:id_sent id:id_sent
Trash:
id:id_trash
MDNavigationDrawer: MDNavigationDrawer:
id: nav_drawer id: nav_drawer

View File

@ -41,5 +41,10 @@
"kv_string": "sent", "kv_string": "sent",
"name_screen": "sent", "name_screen": "sent",
"Import": "from pybitmessage.bitmessagekivy.baseclass.sent import Sent" "Import": "from pybitmessage.bitmessagekivy.baseclass.sent import Sent"
},
"Trash": {
"kv_string": "trash",
"name_screen": "trash",
"Import": "from pybitmessage.bitmessagekivy.baseclass.trash import Trash"
} }
} }