Merge pull request #24 from cis-navjot-g/newwork

Newwork
This commit is contained in:
cis-navjot-g 2019-09-11 20:44:47 +05:30 committed by GitHub
commit ae55d8ed1c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 135 additions and 135 deletions

View File

@ -63,7 +63,7 @@
id: btn id: btn
pos_hint:{"x":0,"y":.25} pos_hint:{"x":0,"y":.25}
option_cls: Factory.get("MySpinnerOption") option_cls: Factory.get("MySpinnerOption")
font_size: '12.5sp' font_size: '11.9sp'
text: app.getDefaultAccData() text: app.getDefaultAccData()
background_color: color_button if self.state == 'normal' else color_button_pressed background_color: color_button if self.state == 'normal' else color_button_pressed
background_down: 'atlas://data/images/defaulttheme/spinner' background_down: 'atlas://data/images/defaulttheme/spinner'
@ -180,19 +180,7 @@ NavigationLayout:
background_palette: 'Primary' background_palette: 'Primary'
background_hue: '500' background_hue: '500'
left_action_items: [['menu', lambda x: app.root.toggle_nav_drawer()]] left_action_items: [['menu', lambda x: app.root.toggle_nav_drawer()]]
Button: right_action_items: [['account-plus', lambda x: app.addingtoaddressbook()]]
id: myButton
size_hint_y: 0.35
size_hint_x: 0.2
pos_hint: {'x': .1, 'y': 0.3}
color: 0,0,0,1
background_color: (0,0,0,0)
on_press:app.addingtoaddressbook()
Image:
source: './images/addressbookadd.png'
center_x: self.parent.center_x
center_y: self.parent.center_y
size: 55, 55
BoxLayout: BoxLayout:
id: search_bar id: search_bar
size_hint_y: None size_hint_y: None
@ -350,7 +338,7 @@ NavigationLayout:
id: txt_input id: txt_input
size_hint_y: None size_hint_y: None
font_size: '13sp' font_size: '13sp'
height: 70 height: 50
hint_text: 'type or search recipients address starting with BM-' hint_text: 'type or search recipients address starting with BM-'
RV: RV:
id: rv id: rv
@ -374,17 +362,6 @@ NavigationLayout:
helper_text_mode: "on_error" helper_text_mode: "on_error"
BoxLayout: BoxLayout:
spacing:50 spacing:50
AnchorLayout:
MDRaisedButton:
size_hint: 1, None
height: dp(40)
on_press: root.send(app)
MDLabel:
font_style: 'Title'
text: 'send'
font_size: '13sp'
color: (1,1,1,1)
halign: 'center'
AnchorLayout: AnchorLayout:
MDRaisedButton: MDRaisedButton:
size_hint: 1, None size_hint: 1, None
@ -643,9 +620,11 @@ NavigationLayout:
ScrollView: ScrollView:
do_scroll_x: False do_scroll_x: False
BoxLayout: BoxLayout:
orientation: 'horizontal' orientation: 'vertical'
padding: dp(20) padding: dp(20)
spacing: 10 spacing: 10
size_hint_y: None
height: self.minimum_height + dp(app.window_size[1]) if app.window_size[1] > app.window_size[0] else dp(app.window_size[0])
BoxLayout: BoxLayout:
orientation: 'vertical' orientation: 'vertical'
padding: dp(5) padding: dp(5)
@ -665,7 +644,7 @@ NavigationLayout:
MDLabel: MDLabel:
font_style: 'Subhead' font_style: 'Subhead'
theme_text_color: 'Primary' theme_text_color: 'Primary'
text: 'We provide subscriptions to real-time streaming market data directly from exchanges, quote aggregators and index providers. The Market Data Subscriptions page lets you sign up for additional market data subscriptions such as NASDAQ TotalView and NYSE Open Book or unsubscribe from market data. ' text: 'We provide subscriptions for proof of work calculation for first month. '
halign: 'center' halign: 'center'
MDLabel: MDLabel:
font_style: 'Headline' font_style: 'Headline'
@ -677,7 +656,7 @@ NavigationLayout:
height: dp(40) height: dp(40)
MDLabel: MDLabel:
font_style: 'Title' font_style: 'Title'
text: 'Select' text: 'Get Credits'
font_size: '13sp' font_size: '13sp'
color: (1,1,1,1) color: (1,1,1,1)
halign: 'center' halign: 'center'
@ -700,7 +679,7 @@ NavigationLayout:
MDLabel: MDLabel:
font_style: 'Subhead' font_style: 'Subhead'
theme_text_color: 'Primary' theme_text_color: 'Primary'
text: 'We provide subscriptions to real-time streaming market data directly from exchanges, quote aggregators and index providers. The Market Data Subscriptions page lets you sign up for additional market data subscriptions such as NASDAQ TotalView and NYSE Open Book or unsubscribe from market data. ' text: 'We provide for proof of work calculation for six month. '
halign: 'center' halign: 'center'
MDLabel: MDLabel:
font_style: 'Headline' font_style: 'Headline'
@ -712,7 +691,7 @@ NavigationLayout:
height: dp(40) height: dp(40)
MDLabel: MDLabel:
font_style: 'Title' font_style: 'Title'
text: 'Select' text: 'Get Credits'
font_size: '13sp' font_size: '13sp'
color: (1,1,1,1) color: (1,1,1,1)
halign: 'center' halign: 'center'
@ -735,7 +714,7 @@ NavigationLayout:
MDLabel: MDLabel:
font_style: 'Subhead' font_style: 'Subhead'
theme_text_color: 'Primary' theme_text_color: 'Primary'
text: 'We provide subscriptions to real-time streaming market data directly from exchanges, quote aggregators and index providers. The Market Data Subscriptions page lets you sign up for additional market data subscriptions such as NASDAQ TotalView and NYSE Open Book or unsubscribe from market data. ' text: 'We provide for proof of work calculation for 1years. '
halign: 'center' halign: 'center'
MDLabel: MDLabel:
font_style: 'Headline' font_style: 'Headline'
@ -747,7 +726,7 @@ NavigationLayout:
height: dp(40) height: dp(40)
MDLabel: MDLabel:
font_style: 'Title' font_style: 'Title'
text: 'Select' text: 'Get Credits'
font_size: '13sp' font_size: '13sp'
color: (1,1,1,1) color: (1,1,1,1)
halign: 'center' halign: 'center'
@ -915,7 +894,7 @@ NavigationLayout:
BoxLayout: BoxLayout:
orientation: 'vertical' orientation: 'vertical'
size_hint_y: None size_hint_y: None
height: dp(400) + self.minimum_height height: dp(500) + self.minimum_height
padding: dp(32) padding: dp(32)
MDLabel: MDLabel:
font_style: 'Headline' font_style: 'Headline'
@ -952,28 +931,6 @@ NavigationLayout:
orientation: 'vertical' orientation: 'vertical'
size_hint_y: None size_hint_y: None
height: dp(100) + self.minimum_height height: dp(100) + self.minimum_height
BoxLayout:
spacing:20
MDRaisedButton:
size_hint: 1, None
height: dp(40)
on_press: root.inbox_reply() if root.page_type == 'inbox' else root.write_msg(app) if root.page_type == 'draft' else root.copy_sent_mail()
MDLabel:
font_style: 'Title'
text: 'Reply' if root.page_type == 'inbox' else 'Copy' if root.page_type == 'sent' else 'Write'
font_size: '13sp'
color: (1,1,1,1)
halign: 'center'
MDRaisedButton:
size_hint: 1, None
height: dp(40)
on_press: root.delete_mail()
MDLabel:
font_style: 'Title'
text: 'Delete'
font_size: '13sp'
color: (1,1,1,1)
halign: 'center'
<CopyTextBtn@Button>: <CopyTextBtn@Button>:
id: cpyButton id: cpyButton

View File

@ -51,7 +51,10 @@ import queues
from semaphores import kivyuisignaler from semaphores import kivyuisignaler
import state import state
from uikivysignaler import UIkivySignaler from uikivysignaler import UIkivySignaler
if platform == 'linux':
import identiconGeneration import identiconGeneration
import os import os
from kivy.core.clipboard import Clipboard from kivy.core.clipboard import Clipboard
# pylint: disable=unused-argument, too-few-public-methods # pylint: disable=unused-argument, too-few-public-methods
@ -529,6 +532,7 @@ class DropDownWidget(BoxLayout):
queues.workerQueue.put(('sendmessage', toAddress)) queues.workerQueue.put(('sendmessage', toAddress))
print "sqlExecute successfully #######################" print "sqlExecute successfully #######################"
self.parent.parent.current = 'inbox' self.parent.parent.current = 'inbox'
state.in_composer = True
navApp.back_press() navApp.back_press()
toast('send') toast('send')
return None return None
@ -543,29 +547,15 @@ class DropDownWidget(BoxLayout):
# pylint: disable=attribute-defined-outside-init # pylint: disable=attribute-defined-outside-init
def address_error_message(self, msg): def address_error_message(self, msg):
"""Show Error Message.""" """Show Error Message."""
self.box = FloatLayout() msg_dialog = MDDialog(
self.lab = (Label(
text=msg, text=msg,
font_size=25, title='', size_hint=(.8, .25), text_button_ok='Ok',
size_hint=(None, None), events_callback=self.callback_for_menu_items)
pos_hint={'x': .25, 'y': .6})) msg_dialog.open()
self.box.add_widget(self.lab)
self.but = (Button( def callback_for_menu_items(self, text_item):
text="dismiss", """Method is used for getting the callback of alert box"""
size_hint=(None, None), toast(text_item)
width=200,
height=50,
pos_hint={'x': .3, 'y': 0}))
self.box.add_widget(self.but)
self.main_pop = Popup(
title="Error",
content=self.box,
size_hint=(None, None),
size=(550, 400),
auto_dismiss=False,
title_size=30)
self.but.bind(on_press=self.main_pop.dismiss)
self.main_pop.open()
def reset_composer(self): def reset_composer(self):
"""Method will reset composer.""" """Method will reset composer."""
@ -966,6 +956,7 @@ class NavigateApp(App): # pylint: disable=too-many-public-methods
variable_1 = ListProperty(BMConfigParser().addresses()) variable_1 = ListProperty(BMConfigParser().addresses())
nav_drawer = ObjectProperty() nav_drawer = ObjectProperty()
state.screen_density = Window.size state.screen_density = Window.size
window_size = state.screen_density
title = "PyBitmessage" title = "PyBitmessage"
imgstatus = False imgstatus = False
count = 0 count = 0
@ -1019,21 +1010,22 @@ class NavigateApp(App): # pylint: disable=too-many-public-methods
def getCurrentAccountData(self, text): def getCurrentAccountData(self, text):
"""Get Current Address Account Data.""" """Get Current Address Account Data."""
if platform == 'linux':
self.set_identicon(text) self.set_identicon(text)
address_label = self.current_address_label( address_label = self.current_address_label(
BMConfigParser().get(text, 'label'), text) BMConfigParser().get(text, 'label'), text)
self.root_window.children[1].ids.toolbar.title = address_label self.root_window.children[1].ids.toolbar.title = address_label
state.association = text state.association = text
self.root.ids.sc1.clear_widgets() self.root.ids.sc1.clear_widgets()
self.root.ids.sc4.clear_widgets()
self.root.ids.sc5.clear_widgets()
self.root.ids.sc16.clear_widgets()
self.root.ids.sc17.clear_widgets()
self.root.ids.sc1.add_widget(Inbox()) self.root.ids.sc1.add_widget(Inbox())
self.root.ids.sc4.add_widget(Sent()) # self.root.ids.sc4.clear_widgets()
self.root.ids.sc5.add_widget(Trash()) # self.root.ids.sc5.clear_widgets()
self.root.ids.sc16.add_widget(Draft()) # self.root.ids.sc16.clear_widgets()
self.root.ids.sc17.add_widget(Allmails()) # self.root.ids.sc17.clear_widgets()
# self.root.ids.sc4.add_widget(Sent())
# self.root.ids.sc5.add_widget(Trash())
# self.root.ids.sc16.add_widget(Draft())
# self.root.ids.sc17.add_widget(Allmails())
self.root.ids.scr_mngr.current = 'inbox' self.root.ids.scr_mngr.current = 'inbox'
msg_counter_objs = \ msg_counter_objs = \
@ -1079,6 +1071,7 @@ class NavigateApp(App): # pylint: disable=too-many-public-methods
def getDefaultAccData(self): def getDefaultAccData(self):
"""Getting Default Account Data.""" """Getting Default Account Data."""
if BMConfigParser().addresses(): if BMConfigParser().addresses():
if platform == 'linux':
img = identiconGeneration.generate(BMConfigParser().addresses()[0]) img = identiconGeneration.generate(BMConfigParser().addresses()[0])
self.createFolder('./images/default_identicon/') self.createFolder('./images/default_identicon/')
img.texture.save('./images/default_identicon/{}.png'.format(BMConfigParser().addresses()[0])) img.texture.save('./images/default_identicon/{}.png'.format(BMConfigParser().addresses()[0]))
@ -1098,7 +1091,7 @@ class NavigateApp(App): # pylint: disable=too-many-public-methods
def get_default_image(): def get_default_image():
"""Getting default image on address""" """Getting default image on address"""
if BMConfigParser().addresses(): if BMConfigParser().addresses():
# BMConfigParser().addresses()[0] if platform == 'linux':
return './images/default_identicon/{}.png'.format(BMConfigParser().addresses()[0]) return './images/default_identicon/{}.png'.format(BMConfigParser().addresses()[0])
return '' return ''
@ -1116,8 +1109,9 @@ class NavigateApp(App): # pylint: disable=too-many-public-methods
self.root.ids.scr_mngr.current = 'sent'\ self.root.ids.scr_mngr.current = 'sent'\
if state.detailPageType == 'sent' else 'inbox' \ if state.detailPageType == 'sent' else 'inbox' \
if state.detailPageType == 'inbox' else 'draft' if state.detailPageType == 'inbox' else 'draft'
if state.detailPageType in ['sent', 'inbox']: # if state.detailPageType in ['sent', 'inbox']:
self.add_search_bar() # self.add_search_bar()
self.back_press()
elif self.root.ids.scr_mngr.current == "create": elif self.root.ids.scr_mngr.current == "create":
composer_objs = self.root composer_objs = self.root
from_addr = str(self.root.ids.sc3.children[0].ids.ti.text) from_addr = str(self.root.ids.sc3.children[0].ids.ti.text)
@ -1125,7 +1119,6 @@ class NavigateApp(App): # pylint: disable=too-many-public-methods
if from_addr and to_addr and state.detailPageType != 'draft': if from_addr and to_addr and state.detailPageType != 'draft':
Draft().draft_msg(composer_objs) Draft().draft_msg(composer_objs)
self.root.ids.scr_mngr.current = 'inbox' self.root.ids.scr_mngr.current = 'inbox'
self.add_search_bar()
self.back_press() self.back_press()
elif self.root.ids.scr_mngr.current == "showqrcode": elif self.root.ids.scr_mngr.current == "showqrcode":
self.root.ids.scr_mngr.current = 'myaddress' self.root.ids.scr_mngr.current = 'myaddress'
@ -1160,25 +1153,30 @@ class NavigateApp(App): # pylint: disable=too-many-public-methods
composer_obj.txt_input.text = '' composer_obj.txt_input.text = ''
composer_obj.subject.text = '' composer_obj.subject.text = ''
composer_obj.body.text = '' composer_obj.body.text = ''
state.in_composer = True
def set_navbar_for_composer(self): def set_navbar_for_composer(self):
"""This method is used for clearing toolbar data when composer open""" """This method is used for clearing toolbar data when composer open"""
self.root.ids.toolbar.left_action_items = [ self.root.ids.toolbar.left_action_items = [
['arrow-left', lambda x: self.back_press()]] ['arrow-left', lambda x: self.back_press()]]
self.root.ids.myButton.opacity = 0 self.root.ids.toolbar.right_action_items = [
self.root.ids.myButton.disabled = True ['send', lambda x: self.root.ids.sc3.children[0].send(self)]]
def back_press(self): def back_press(self):
"""Method used for going back from composer to previous page.""" """Method used for going back from composer to previous page."""
self.root.ids.myButton.opacity = 1 self.root.ids.toolbar.right_action_items = \
self.root.ids.myButton.disabled = False [['account-plus', lambda x: self.addingtoaddressbook()]]
self.root.ids.toolbar.left_action_items = \ self.root.ids.toolbar.left_action_items = \
[['menu', lambda x: self.root.toggle_nav_drawer()]] [['menu', lambda x: self.root.toggle_nav_drawer()]]
self.root.ids.scr_mngr.current = 'inbox' self.root.ids.scr_mngr.current = 'inbox' if state.in_composer else 'allmails' if state.is_allmail else state.detailPageType
self.root.ids.scr_mngr.transition.direction = 'right' self.root.ids.scr_mngr.transition.direction = 'right'
self.root.ids.scr_mngr.transition.bind(on_complete=self.reset) self.root.ids.scr_mngr.transition.bind(on_complete=self.reset)
if state.is_allmail or state.detailPageType == 'draft':
state.is_allmail = False
else:
self.add_search_bar() self.add_search_bar()
state.detailPageType = '' state.detailPageType = ''
state.in_composer = False
@staticmethod @staticmethod
def on_stop(): def on_stop():
@ -1260,8 +1258,24 @@ class NavigateApp(App): # pylint: disable=too-many-public-methods
self.root.ids.sc4.add_widget(Sent()) self.root.ids.sc4.add_widget(Sent())
self.root.ids.scr_mngr.current = state.search_screen self.root.ids.scr_mngr.current = state.search_screen
def clearSreeen(self, text):
if text == 'Sent':
self.root.ids.sc4.clear_widgets()
self.root.ids.sc4.add_widget(Sent())
elif text == 'Draft':
self.root.ids.sc16.clear_widgets()
self.root.ids.sc16.add_widget(Draft())
elif text == 'Trash':
self.root.ids.sc5.clear_widgets()
self.root.ids.sc5.add_widget(Trash())
elif text == 'All Mails':
self.root.ids.sc17.clear_widgets()
self.root.ids.sc17.add_widget(Allmails())
def check_search_screen(self, instance): def check_search_screen(self, instance):
"""Method show search button only on inbox or sent screen.""" """Method show search button only on inbox or sent screen."""
if instance.text in ['Sent', 'Draft', 'Trash', 'All Mails']:
self.clearSreeen(instance.text)
if instance.text in ['Inbox', 'Sent', 'Address Book', 'My Addresses']: if instance.text in ['Inbox', 'Sent', 'Address Book', 'My Addresses']:
if not self.root.ids.search_bar.children: if not self.root.ids.search_bar.children:
self.root.ids.search_bar.add_widget( self.root.ids.search_bar.add_widget(
@ -1298,6 +1312,19 @@ class NavigateApp(App): # pylint: disable=too-many-public-methods
"""Address identicon""" """Address identicon"""
return './images/drawer_logo1.png' return './images/drawer_logo1.png'
def set_mail_detail_header(self):
toolbar_obj = self.root.ids.toolbar
toolbar_obj.left_action_items = [['arrow-left', lambda x: self.back_press()]]
delete_btn = ['delete-forever', lambda x: self.root.ids.sc14.delete_mail()]
dynamic_list = []
if state.detailPageType == 'inbox':
dynamic_list = [['reply', lambda x: self.root.ids.sc14.inbox_reply()], delete_btn]
elif state.detailPageType == 'sent':
dynamic_list = [delete_btn]
elif state.detailPageType == 'draft':
dynamic_list = [['pencil', lambda x: self.root.ids.sc14.write_msg(self)], delete_btn]
toolbar_obj.right_action_items = dynamic_list
class GrashofPopup(Popup): class GrashofPopup(Popup):
"""Methods for saving contacts, error messages.""" """Methods for saving contacts, error messages."""
@ -1455,11 +1482,13 @@ class MailDetail(Screen):
state.status = self state.status = self
state.ackdata = data[0][5] state.ackdata = data[0][5]
self.assign_mail_details(data) self.assign_mail_details(data)
state.kivyapp.set_mail_detail_header()
elif state.detailPageType == 'inbox': elif state.detailPageType == 'inbox':
data = sqlQuery( data = sqlQuery(
"select toaddress, fromaddress, subject, message from inbox \ "select toaddress, fromaddress, subject, message from inbox \
where received = {};".format(state.sentMailTime)) where received = {};".format(state.sentMailTime))
self.assign_mail_details(data) self.assign_mail_details(data)
state.kivyapp.set_mail_detail_header()
def assign_mail_details(self, data): def assign_mail_details(self, data):
"""Assigning mail details.""" """Assigning mail details."""
@ -1470,19 +1499,22 @@ class MailDetail(Screen):
self.message = data[0][3] self.message = data[0][3]
if len(data[0]) == 6: if len(data[0]) == 6:
self.status = data[0][4] self.status = data[0][4]
state.write_msg = {'to_addr': self.to_addr,
'from_addr': self.from_addr,
'subject': self.subject,
'message': self.message}
def delete_mail(self): def delete_mail(self):
"""Method for mail delete.""" """Method for mail delete."""
msg_count_objs = \ msg_count_objs = state.kivyapp.root.children[2].children[0].ids
self.parent.parent.parent.parent.parent.children[2].children[0].ids
if state.detailPageType == 'sent': if state.detailPageType == 'sent':
sqlExecute( sqlExecute(
"UPDATE sent SET folder = 'trash' WHERE \ "UPDATE sent SET folder = 'trash' WHERE \
lastactiontime = {};".format(state.sentMailTime)) lastactiontime = {};".format(state.sentMailTime))
msg_count_objs.send_cnt.badge_text = str(int(state.sent_count) - 1) msg_count_objs.send_cnt.badge_text = str(int(state.sent_count) - 1)
state.sent_count = str(int(state.sent_count) - 1) state.sent_count = str(int(state.sent_count) - 1)
self.parent.parent.screens[3].clear_widgets() self.parent.screens[3].clear_widgets()
self.parent.parent.screens[3].add_widget(Sent()) self.parent.screens[3].add_widget(Sent())
elif state.detailPageType == 'inbox': elif state.detailPageType == 'inbox':
sqlExecute( sqlExecute(
"UPDATE inbox SET folder = 'trash' WHERE \ "UPDATE inbox SET folder = 'trash' WHERE \
@ -1490,21 +1522,27 @@ class MailDetail(Screen):
msg_count_objs.inbox_cnt.badge_text = str( msg_count_objs.inbox_cnt.badge_text = str(
int(state.inbox_count) - 1) int(state.inbox_count) - 1)
state.inbox_count = str(int(state.inbox_count) - 1) state.inbox_count = str(int(state.inbox_count) - 1)
self.parent.parent.screens[0].clear_widgets() self.parent.screens[0].clear_widgets()
self.parent.parent.screens[0].add_widget(Inbox()) self.parent.screens[0].add_widget(Inbox())
if state.is_allmail: elif state.detailPageType == 'draft':
self.parent.parent.current = 'allmails' sqlExecute("DELETE FROM sent WHERE lastactiontime = '{}';".format(
state.is_allmail = False state.sentMailTime))
else: msg_count_objs.draft_cnt.badge_text = str(int(state.draft_count) - 1)
self.parent.parent.current = state.detailPageType state.draft_count = str(int(state.draft_count) - 1)
self.parent.screens[15].clear_widgets()
self.parent.screens[15].add_widget(Draft())
self.parent.current = 'allmails' if state.is_allmail else state.detailPageType
if state.detailPageType != 'draft':
msg_count_objs.trash_cnt.badge_text = str(int(state.trash_count) + 1) msg_count_objs.trash_cnt.badge_text = str(int(state.trash_count) + 1)
msg_count_objs.allmail_cnt.badge_text = str(int(state.all_count) - 1) msg_count_objs.allmail_cnt.badge_text = str(int(state.all_count) - 1)
state.trash_count = str(int(state.trash_count) + 1) state.trash_count = str(int(state.trash_count) + 1)
state.all_count = str(int(state.all_count) - 1) state.all_count = str(int(state.all_count) - 1)
self.parent.parent.screens[4].clear_widgets() self.parent.screens[4].clear_widgets()
self.parent.parent.screens[4].add_widget(Trash()) self.parent.screens[4].add_widget(Trash())
self.parent.parent.screens[16].clear_widgets() self.parent.screens[16].clear_widgets()
self.parent.parent.screens[16].add_widget(Allmails()) self.parent.screens[16].add_widget(Allmails())
state.kivyapp.back_press()
toast('Deleted') toast('Deleted')
def inbox_reply(self): def inbox_reply(self):
@ -1512,12 +1550,14 @@ class MailDetail(Screen):
data = sqlQuery( data = sqlQuery(
"select toaddress, fromaddress, subject, message from inbox where \ "select toaddress, fromaddress, subject, message from inbox where \
received = {};".format(state.sentMailTime)) received = {};".format(state.sentMailTime))
composer_obj = self.parent.parent.screens[2].children[0].ids composer_obj = self.parent.screens[2].children[0].ids
composer_obj.ti.text = data[0][1] composer_obj.ti.text = data[0][0]
composer_obj.btn.text = data[0][1] composer_obj.btn.text = data[0][0]
composer_obj.txt_input.text = data[0][0] composer_obj.txt_input.text = data[0][1]
composer_obj.subject.text = data[0][2] composer_obj.subject.text = data[0][2]
self.parent.parent.current = 'create' state.kivyapp.root.ids.sc3.children[0].ids.rv.data = ''
self.parent.current = 'create'
state.kivyapp.set_navbar_for_composer()
def copy_sent_mail(self): def copy_sent_mail(self):
"""Method used for copying sent mail to the composer.""" """Method used for copying sent mail to the composer."""
@ -1527,14 +1567,13 @@ class MailDetail(Screen):
"""Method used to write on draft mail.""" """Method used to write on draft mail."""
state.send_draft_mail = state.sentMailTime state.send_draft_mail = state.sentMailTime
composer_ids = \ composer_ids = \
self.parent.parent.parent.parent.parent.ids.sc3.children[0].ids self.parent.parent.parent.parent.ids.sc3.children[0].ids
composer_ids.ti.text = self.from_addr composer_ids.ti.text = state.write_msg['from_addr']
composer_ids.btn.text = self.from_addr composer_ids.btn.text = state.write_msg['from_addr']
composer_ids.txt_input.text = self.to_addr composer_ids.txt_input.text = state.write_msg['to_addr']
composer_ids.subject.text = '' \ composer_ids.subject.text = state.write_msg['subject']
if self.subject == '(no subject)' else self.subject.lower() composer_ids.body.text = state.write_msg['message']
composer_ids.body.text = self.message self.parent.current = 'create'
self.parent.parent.current = 'create'
navApp.set_navbar_for_composer() navApp.set_navbar_for_composer()
@staticmethod @staticmethod

View File

@ -107,3 +107,7 @@ search_screen = ''
send_draft_mail = None send_draft_mail = None
is_allmail = False is_allmail = False
in_composer = False
write_msg = {}