Added application closing Popup

This commit is contained in:
osamacis 2022-11-08 16:54:06 +05:30
parent 3457c0d84b
commit 80d4a460ea
No known key found for this signature in database
GPG Key ID: 15F978BEFADAB9E1

View File

@ -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.baseclass.common import toast, load_image_path, get_identity_list
from pybitmessage.bitmessagekivy.load_kivy_screens_data import load_screen_json 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.baseclass.login import * # noqa: F401, F403
from pybitmessage.bitmessagekivy.uikivysignaler import UIkivySignaler from pybitmessage.bitmessagekivy.uikivysignaler import UIkivySignaler
@ -113,6 +115,7 @@ class NavigateApp(MDApp):
'{0}.kv'.format(self.all_data[kv]["kv_string"]), '{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')) return Builder.load_file(os.path.join(os.path.dirname(__file__), 'main.kv'))
def set_screen(self, screen_name): 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.opacity = 1
self.root.ids.content_drawer.ids.file_manager.disabled = False 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): def set_identicon(self, text):
"""Show identicon in address spinner""" """Show identicon in address spinner"""
img = identiconGeneration.generate(text) img = identiconGeneration.generate(text)