From 22aec0159b6632577ae22650940c25ee8bf0c81f Mon Sep 17 00:00:00 2001 From: shekhar-cis Date: Thu, 27 Oct 2022 13:27:30 +0530 Subject: [PATCH] Update variable association to selected_address --- src/bitmessagekivy/baseclass/maildetail.py | 4 ++-- src/bitmessagekivy/baseclass/myaddress.py | 2 +- src/bitmessagekivy/kivy_state.py | 2 +- src/bitmessagekivy/mpybit.py | 10 +++++----- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/bitmessagekivy/baseclass/maildetail.py b/src/bitmessagekivy/baseclass/maildetail.py index 34a62a70..e2a886c8 100644 --- a/src/bitmessagekivy/baseclass/maildetail.py +++ b/src/bitmessagekivy/baseclass/maildetail.py @@ -152,7 +152,7 @@ class MailDetail(Screen): # pylint: disable=too-many-instance-attributes msg_count_objs.send_cnt.ids.badge_txt.text = str(int(self.kivy_state.sent_count) - 1) self.kivy_state.sent_count = str(int(self.kivy_state.sent_count) - 1) self.parent.screens[2].ids.ml.clear_widgets() - self.parent.screens[2].loadSent(self.kivy_state.association) + self.parent.screens[2].loadSent(self.kivy_state.selected_address) elif self.kivy_state.detail_page_type == 'inbox': App.get_running_app().root.ids.sc1.ids.inbox_search.ids.search_field.text = '' trash(self.kivy_state.mail_id) @@ -160,7 +160,7 @@ class MailDetail(Screen): # pylint: disable=too-many-instance-attributes int(self.kivy_state.inbox_count) - 1) self.kivy_state.inbox_count = str(int(self.kivy_state.inbox_count) - 1) self.parent.screens[0].ids.ml.clear_widgets() - self.parent.screens[0].loadMessagelist(self.kivy_state.association) + self.parent.screens[0].loadMessagelist(self.kivy_state.selected_address) elif self.kivy_state.detail_page_type == 'draft': delete(self.kivy_state.mail_id) diff --git a/src/bitmessagekivy/baseclass/myaddress.py b/src/bitmessagekivy/baseclass/myaddress.py index 5db5f7d6..13a68272 100644 --- a/src/bitmessagekivy/baseclass/myaddress.py +++ b/src/bitmessagekivy/baseclass/myaddress.py @@ -131,7 +131,7 @@ class MyAddress(Screen, HelperMyAddress): def set_address_status(self, item, meny, is_enable): """Setting the identity status enable/disable on UI""" - if self.kivy_state.association == item['secondary_text'] and is_enable: + if self.kivy_state.selected_address == item['secondary_text'] and is_enable: meny.add_widget(self.is_active_badge()) else: meny.add_widget(ToggleBtn(active=True if is_enable else False)) diff --git a/src/bitmessagekivy/kivy_state.py b/src/bitmessagekivy/kivy_state.py index 77d65c5f..42051ff9 100644 --- a/src/bitmessagekivy/kivy_state.py +++ b/src/bitmessagekivy/kivy_state.py @@ -13,7 +13,7 @@ class KivyStateVariables(object): """This Class hold all the kivy state variables""" def __init__(self): - self.association = '' + self.selected_address = '' self.navinstance = None self.mail_id = 0 self.my_address_obj = None diff --git a/src/bitmessagekivy/mpybit.py b/src/bitmessagekivy/mpybit.py index d527d0ae..8eb1f9fe 100644 --- a/src/bitmessagekivy/mpybit.py +++ b/src/bitmessagekivy/mpybit.py @@ -253,15 +253,15 @@ class NavigateApp(MDApp): if not os.path.exists(os.path.join(android_path, 'default_identicon')): os.makedirs(os.path.join(android_path, 'default_identicon')) newImg.save(os.path.join(android_path, 'default_identicon', '{}.png'.format( - self.kivy_state_obj.association)) + self.kivy_state_obj.selected_address)) ) else: if not os.path.exists(os.path.join(self.image_dir, 'default_identicon')): os.makedirs(os.path.join(self.image_dir, 'default_identicon')) newImg.save(os.path.join(self.image_dir, 'default_identicon', '{0}.png'.format( - self.kivy_state_obj.association)) + self.kivy_state_obj.selected_address)) ) - self.load_selected_Image(self.kivy_state_obj.association) + self.load_selected_Image(self.kivy_state_obj.selected_address) toast('Image changed') except Exception: toast('Exit') @@ -282,9 +282,9 @@ class NavigateApp(MDApp): def rest_default_avatar_img(self): """set default avatar generated image""" - self.set_identicon(self.kivy_state_obj.association) + self.set_identicon(self.kivy_state_obj.selected_address) img_path = os.path.join( - self.image_dir, 'default_identicon', '{}.png'.format(self.kivy_state_obj.association) + self.image_dir, 'default_identicon', '{}.png'.format(self.kivy_state_obj.selected_address) ) try: if os.path.exists(img_path):