Add Trash Screen
This commit is contained in:
parent
1b9ff22abb
commit
0f53c1e03c
33
src/bitmessagekivy/baseclass/trash.py
Normal file
33
src/bitmessagekivy/baseclass/trash.py
Normal 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]
|
|
@ -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
|
||||||
|
|
|
@ -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"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Reference in New Issue
Block a user