From 80d4a460ea1fac293279679d042dec38bf8ec86d Mon Sep 17 00:00:00 2001 From: osamacis Date: Tue, 8 Nov 2022 16:54:06 +0530 Subject: [PATCH] Added application closing Popup --- src/bitmessagekivy/mpybit.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/bitmessagekivy/mpybit.py b/src/bitmessagekivy/mpybit.py index e02f3326..2c92bfb6 100644 --- a/src/bitmessagekivy/mpybit.py +++ b/src/bitmessagekivy/mpybit.py @@ -39,7 +39,9 @@ from pybitmessage.bitmessagekivy.get_platform import platform from pybitmessage.bitmessagekivy.baseclass.common import toast, load_image_path, get_identity_list from pybitmessage.bitmessagekivy.load_kivy_screens_data import load_screen_json -from pybitmessage.bitmessagekivy.baseclass.popup import AddAddressPopup, AddressChangingLoader +from pybitmessage.bitmessagekivy.baseclass.popup import ( + AddAddressPopup, AppClosingPopup, AddressChangingLoader +) from pybitmessage.bitmessagekivy.baseclass.login import * # noqa: F401, F403 from pybitmessage.bitmessagekivy.uikivysignaler import UIkivySignaler @@ -113,6 +115,7 @@ class NavigateApp(MDApp): '{0}.kv'.format(self.all_data[kv]["kv_string"]), ) ) + Window.bind(on_request_close=self.on_request_close) return Builder.load_file(os.path.join(os.path.dirname(__file__), 'main.kv')) def set_screen(self, screen_name): @@ -301,6 +304,11 @@ class NavigateApp(MDApp): self.root.ids.content_drawer.ids.file_manager.opacity = 1 self.root.ids.content_drawer.ids.file_manager.disabled = False + def on_request_close(self, *args): # pylint: disable=no-self-use + """This method is for app closing request""" + AppClosingPopup().open() + return True + def set_identicon(self, text): """Show identicon in address spinner""" img = identiconGeneration.generate(text)