Reused mail_detail_screen() from common.py

This commit is contained in:
shekhar-cis 2022-07-07 18:02:06 +05:30
parent d9edc2a19c
commit a4d173cc11
Signed by untrusted user: shekhar-cis
GPG Key ID: F4F00AB04E83F9A7

View File

@ -14,7 +14,7 @@ import state
from bitmessagekivy.baseclass.common import ( from bitmessagekivy.baseclass.common import (
showLimitedCnt, toast, ThemeClsColor, showLimitedCnt, toast, ThemeClsColor,
avatarImageFirstLetter, CutsomSwipeToDeleteItem, avatarImageFirstLetter, CutsomSwipeToDeleteItem,
ShowTimeHistoy ShowTimeHistoy, mail_detail_screen
) )
from bitmessagekivy.baseclass.maildetail import MailDetail from bitmessagekivy.baseclass.maildetail import MailDetail
# from bitmessagekivy.baseclass.trash import Trash # from bitmessagekivy.baseclass.trash import Trash
@ -144,19 +144,22 @@ class Allmails(Screen):
def mail_detail(self, unique_id, folder, instance, *args): def mail_detail(self, unique_id, folder, instance, *args):
"""Load sent and inbox mail details""" """Load sent and inbox mail details"""
# import pdb;pdb.set_trace()
if instance.state == 'closed': if instance.state == 'closed':
instance.ids.delete_msg.disabled = True instance.ids.delete_msg.disabled = True
if instance.open_progress == 0.0: state.is_allmail = True
state.detailPageType = folder mail_detail_screen(self, unique_id, instance, folder, *args)
state.is_allmail = True
state.mail_id = unique_id # if instance.open_progress == 0.0:
if self.manager: # state.detailPageType = folder
src_mng_obj = self.manager # state.mail_id = unique_id
else: # if self.manager:
src_mng_obj = self.parent.parent # src_mng_obj = self.manager
src_mng_obj.screens[11].clear_widgets() # else:
src_mng_obj.screens[11].add_widget(MailDetail()) # src_mng_obj = self.parent.parent
src_mng_obj.current = 'mailDetail' # src_mng_obj.screens[11].clear_widgets()
# src_mng_obj.screens[11].add_widget(MailDetail())
# src_mng_obj.current = 'mailDetail'
else: else:
instance.ids.delete_msg.disabled = False instance.ids.delete_msg.disabled = False