Created a UI independent function
This commit is contained in:
parent
b772b2ce9b
commit
0ec38b43f8
|
@ -162,11 +162,5 @@ class AddressBook(Screen, HelperAddressBook):
|
||||||
def send_message_to(self, instance):
|
def send_message_to(self, instance):
|
||||||
"""Method used to fill to_address of composer autofield"""
|
"""Method used to fill to_address of composer autofield"""
|
||||||
state.kivyapp.set_navbar_for_composer()
|
state.kivyapp.set_navbar_for_composer()
|
||||||
window_obj = state.kivyapp.root.ids
|
self.compose_message(None, self.address)
|
||||||
window_obj.sc3.children[1].ids.txt_input.text = self.address
|
|
||||||
window_obj.sc3.children[1].ids.ti.text = ''
|
|
||||||
window_obj.sc3.children[1].ids.btn.text = 'Select'
|
|
||||||
window_obj.sc3.children[1].ids.subject.text = ''
|
|
||||||
window_obj.sc3.children[1].ids.body.text = ''
|
|
||||||
window_obj.scr_mngr.current = 'create'
|
|
||||||
self.addbook_popup.dismiss()
|
self.addbook_popup.dismiss()
|
||||||
|
|
|
@ -50,3 +50,17 @@ class HelperAddressBook(object):
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
return show_dialogue
|
return show_dialogue
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def compose_message(from_addr=None, to_addr=None):
|
||||||
|
"""This UI independent method for message sending to reciever"""
|
||||||
|
window_obj = state.kivyapp.root.ids
|
||||||
|
if to_addr:
|
||||||
|
window_obj.sc3.children[1].ids.txt_input.text = to_addr
|
||||||
|
if from_addr:
|
||||||
|
window_obj.sc3.children[1].ids.txt_input.text = from_addr
|
||||||
|
window_obj.sc3.children[1].ids.ti.text = ''
|
||||||
|
window_obj.sc3.children[1].ids.btn.text = 'Select'
|
||||||
|
window_obj.sc3.children[1].ids.subject.text = ''
|
||||||
|
window_obj.sc3.children[1].ids.body.text = ''
|
||||||
|
window_obj.scr_mngr.current = 'create'
|
||||||
|
|
Reference in New Issue
Block a user