Merge pull request #18 from navjotcis/UiChanges
updated PR changes for kivy part
This commit is contained in:
commit
197f91be95
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -19,4 +19,5 @@ docs/_*/*
|
||||||
docs/autodoc/
|
docs/autodoc/
|
||||||
pyan/
|
pyan/
|
||||||
.buildozer/
|
.buildozer/
|
||||||
bin/
|
bin/
|
||||||
|
src/images/default_identicon/
|
|
@ -1,42 +1,18 @@
|
||||||
|
|
||||||
#:import Toolbar kivymd.toolbar.Toolbar
|
#:import Toolbar kivymd.toolbar.Toolbar
|
||||||
#:import ThemeManager kivymd.theming.ThemeManager
|
|
||||||
#:import MDNavigationDrawer kivymd.navigationdrawer.MDNavigationDrawer
|
|
||||||
#:import NavigationLayout kivymd.navigationdrawer.NavigationLayout
|
#:import NavigationLayout kivymd.navigationdrawer.NavigationLayout
|
||||||
#:import NavigationDrawerDivider kivymd.navigationdrawer.NavigationDrawerDivider
|
#:import NavigationDrawerDivider kivymd.navigationdrawer.NavigationDrawerDivider
|
||||||
#:import NavigationDrawerToolbar kivymd.navigationdrawer.NavigationDrawerToolbar
|
|
||||||
#:import NavigationDrawerSubheader kivymd.navigationdrawer.NavigationDrawerSubheader
|
#:import NavigationDrawerSubheader kivymd.navigationdrawer.NavigationDrawerSubheader
|
||||||
#:import MDCheckbox kivymd.selectioncontrols.MDCheckbox
|
#:import MDCheckbox kivymd.selectioncontrols.MDCheckbox
|
||||||
#:import MDSwitch kivymd.selectioncontrols.MDSwitch
|
|
||||||
#:import MDList kivymd.list.MDList
|
#:import MDList kivymd.list.MDList
|
||||||
#:import OneLineListItem kivymd.list.OneLineListItem
|
#:import OneLineListItem kivymd.list.OneLineListItem
|
||||||
#:import TwoLineListItem kivymd.list.TwoLineListItem
|
|
||||||
#:import ThreeLineListItem kivymd.list.ThreeLineListItem
|
|
||||||
#:import OneLineAvatarListItem kivymd.list.OneLineAvatarListItem
|
|
||||||
#:import OneLineIconListItem kivymd.list.OneLineIconListItem
|
|
||||||
#:import OneLineAvatarIconListItem kivymd.list.OneLineAvatarIconListItem
|
|
||||||
#:import MDTextField kivymd.textfields.MDTextField
|
#:import MDTextField kivymd.textfields.MDTextField
|
||||||
#:import MDSpinner kivymd.spinner.MDSpinner
|
|
||||||
#:import MDCard kivymd.card.MDCard
|
|
||||||
#:import MDSeparator kivymd.card.MDSeparator
|
|
||||||
#:import MDDropdownMenu kivymd.menu.MDDropdownMenu
|
|
||||||
#:import get_color_from_hex kivy.utils.get_color_from_hex
|
#:import get_color_from_hex kivy.utils.get_color_from_hex
|
||||||
#:import colors kivymd.color_definitions.colors
|
#:import colors kivymd.color_definitions.colors
|
||||||
#:import SmartTile kivymd.grid.SmartTile
|
|
||||||
#:import MDSlider kivymd.slider.MDSlider
|
|
||||||
#:import MDTabbedPanel kivymd.tabs.MDTabbedPanel
|
#:import MDTabbedPanel kivymd.tabs.MDTabbedPanel
|
||||||
#:import MDTab kivymd.tabs.MDTab
|
#:import MDTab kivymd.tabs.MDTab
|
||||||
#:import MDProgressBar kivymd.progressbar.MDProgressBar
|
|
||||||
#:import MDAccordion kivymd.accordion.MDAccordion
|
|
||||||
#:import MDAccordionItem kivymd.accordion.MDAccordionItem
|
|
||||||
#:import MDAccordionSubItem kivymd.accordion.MDAccordionSubItem
|
|
||||||
#:import MDThemePicker kivymd.theme_picker.MDThemePicker
|
|
||||||
#:import MDBottomNavigation kivymd.tabs.MDBottomNavigation
|
|
||||||
#:import MDBottomNavigationItem kivymd.tabs.MDBottomNavigationItem
|
|
||||||
#:import MDFloatingActionButton kivymd.button.MDFloatingActionButton
|
#:import MDFloatingActionButton kivymd.button.MDFloatingActionButton
|
||||||
#:import Factory kivy.factory.Factory
|
#:import Factory kivy.factory.Factory
|
||||||
#:import MDTextButton kivymd.button.MDTextButton
|
|
||||||
#:import FadeTransition kivy.uix.screenmanager.FadeTransition
|
|
||||||
#:import MDScrollViewRefreshLayout kivymd.refreshlayout.MDScrollViewRefreshLayout
|
#:import MDScrollViewRefreshLayout kivymd.refreshlayout.MDScrollViewRefreshLayout
|
||||||
|
|
||||||
#:set color_button (0.784, 0.443, 0.216, 1) # brown
|
#:set color_button (0.784, 0.443, 0.216, 1) # brown
|
||||||
|
@ -55,8 +31,7 @@
|
||||||
<ContentNavigationDrawer@Navigatorss>:
|
<ContentNavigationDrawer@Navigatorss>:
|
||||||
drawer_logo: app.address_identicon()
|
drawer_logo: app.address_identicon()
|
||||||
NavigationDrawerDivider:
|
NavigationDrawerDivider:
|
||||||
|
NavigationDrawerSubheader:
|
||||||
NavigationDrawerTwoLineListItem:
|
|
||||||
text: "Accounts"
|
text: "Accounts"
|
||||||
NavigationDrawerIconButton:
|
NavigationDrawerIconButton:
|
||||||
CustomSpinner:
|
CustomSpinner:
|
||||||
|
@ -143,7 +118,7 @@
|
||||||
on_press: app.refreshScreen(self)
|
on_press: app.refreshScreen(self)
|
||||||
NavigationDrawerIconButton:
|
NavigationDrawerIconButton:
|
||||||
text: "Subscriptions/Payment"
|
text: "Subscriptions/Payment"
|
||||||
icon:'wallet'
|
icon:'bell'
|
||||||
on_release: app.root.ids.scr_mngr.current = 'payment'
|
on_release: app.root.ids.scr_mngr.current = 'payment'
|
||||||
on_press: app.refreshScreen(self)
|
on_press: app.refreshScreen(self)
|
||||||
NavigationDrawerIconButton:
|
NavigationDrawerIconButton:
|
||||||
|
@ -417,17 +392,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.reset_composer()
|
|
||||||
MDLabel:
|
|
||||||
font_style: 'Title'
|
|
||||||
text: 'reset'
|
|
||||||
font_size: '13sp'
|
|
||||||
color: (1,1,1,1)
|
|
||||||
halign: 'center'
|
|
||||||
|
|
||||||
<MyTextInput>:
|
<MyTextInput>:
|
||||||
readonly: False
|
readonly: False
|
||||||
|
|
|
@ -61,9 +61,8 @@ import identiconGeneration
|
||||||
|
|
||||||
def toast(text):
|
def toast(text):
|
||||||
"""Method will display the toast message."""
|
"""Method will display the toast message."""
|
||||||
if platform == 'linux':
|
from kivymd.toast.kivytoast import toast # pylint: disable=redefined-outer-name
|
||||||
from kivymd.toast.kivytoast import toast # pylint: disable=redefined-outer-name
|
toast(text)
|
||||||
toast(text)
|
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
|
@ -119,7 +118,7 @@ class Inbox(Screen):
|
||||||
'secondary_text': mail[5][:50] + '........' if len(
|
'secondary_text': mail[5][:50] + '........' if len(
|
||||||
mail[5]) >= 50 else (
|
mail[5]) >= 50 else (
|
||||||
mail[5] + ',' + mail[3].replace('\n', ''))[0:50] + '........',
|
mail[5] + ',' + mail[3].replace('\n', ''))[0:50] + '........',
|
||||||
'receivedTime': mail[6]})
|
'msgid': mail[1]})
|
||||||
for item in data:
|
for item in data:
|
||||||
meny = TwoLineAvatarIconListItem(
|
meny = TwoLineAvatarIconListItem(
|
||||||
text=item['text'],
|
text=item['text'],
|
||||||
|
@ -130,7 +129,7 @@ class Inbox(Screen):
|
||||||
source='./images/text_images/{}.png'.format(
|
source='./images/text_images/{}.png'.format(
|
||||||
avatarImageFirstLetter(item['secondary_text'].strip()))))
|
avatarImageFirstLetter(item['secondary_text'].strip()))))
|
||||||
meny.bind(on_press=partial(
|
meny.bind(on_press=partial(
|
||||||
self.inbox_detail, item['receivedTime']))
|
self.inbox_detail, item['msgid']))
|
||||||
carousel = Carousel(direction='right')
|
carousel = Carousel(direction='right')
|
||||||
carousel.height = meny.height
|
carousel.height = meny.height
|
||||||
carousel.size_hint_y = None
|
carousel.size_hint_y = None
|
||||||
|
@ -141,13 +140,13 @@ class Inbox(Screen):
|
||||||
del_btn.background_normal = ''
|
del_btn.background_normal = ''
|
||||||
del_btn.background_color = (1, 0, 0, 1)
|
del_btn.background_color = (1, 0, 0, 1)
|
||||||
del_btn.bind(on_press=partial(
|
del_btn.bind(on_press=partial(
|
||||||
self.delete, item['receivedTime']))
|
self.delete, item['msgid']))
|
||||||
carousel.add_widget(del_btn)
|
carousel.add_widget(del_btn)
|
||||||
carousel.add_widget(meny)
|
carousel.add_widget(meny)
|
||||||
ach_btn = Button(text='Achieve')
|
ach_btn = Button(text='Achieve')
|
||||||
ach_btn.background_color = (0, 1, 0, 1)
|
ach_btn.background_color = (0, 1, 0, 1)
|
||||||
ach_btn.bind(on_press=partial(
|
ach_btn.bind(on_press=partial(
|
||||||
self.archive, item['receivedTime']))
|
self.archive, item['msgid']))
|
||||||
carousel.add_widget(ach_btn)
|
carousel.add_widget(ach_btn)
|
||||||
carousel.index = 1
|
carousel.index = 1
|
||||||
self.ids.ml.add_widget(carousel)
|
self.ids.ml.add_widget(carousel)
|
||||||
|
@ -163,10 +162,10 @@ class Inbox(Screen):
|
||||||
valign='top')
|
valign='top')
|
||||||
self.ids.ml.add_widget(content)
|
self.ids.ml.add_widget(content)
|
||||||
|
|
||||||
def inbox_detail(self, receivedTime, *args):
|
def inbox_detail(self, msg_id, *args):
|
||||||
"""Load inbox page details."""
|
"""Load inbox page details."""
|
||||||
state.detailPageType = 'inbox'
|
state.detailPageType = 'inbox'
|
||||||
state.sentMailTime = receivedTime
|
state.mail_id = msg_id
|
||||||
if self.manager:
|
if self.manager:
|
||||||
src_mng_obj = self.manager
|
src_mng_obj = self.manager
|
||||||
else:
|
else:
|
||||||
|
@ -178,7 +177,7 @@ class Inbox(Screen):
|
||||||
def delete(self, data_index, instance, *args):
|
def delete(self, data_index, instance, *args):
|
||||||
"""Delete inbox mail from inbox listing."""
|
"""Delete inbox mail from inbox listing."""
|
||||||
sqlExecute(
|
sqlExecute(
|
||||||
"UPDATE inbox SET folder = 'trash' WHERE received = {};".format(
|
"UPDATE inbox SET folder = 'trash' WHERE msgid = ?;", str(
|
||||||
data_index))
|
data_index))
|
||||||
try:
|
try:
|
||||||
msg_count_objs = \
|
msg_count_objs = \
|
||||||
|
@ -207,7 +206,7 @@ class Inbox(Screen):
|
||||||
def archive(self, data_index, instance, *args):
|
def archive(self, data_index, instance, *args):
|
||||||
"""Archive inbox mail from inbox listing."""
|
"""Archive inbox mail from inbox listing."""
|
||||||
sqlExecute(
|
sqlExecute(
|
||||||
"UPDATE inbox SET folder = 'trash' WHERE received = {};".format(
|
"UPDATE inbox SET folder = 'trash' WHERE msgid = ?;", str(
|
||||||
data_index))
|
data_index))
|
||||||
self.ids.ml.remove_widget(instance.parent.parent)
|
self.ids.ml.remove_widget(instance.parent.parent)
|
||||||
self.update_trash()
|
self.update_trash()
|
||||||
|
@ -379,8 +378,9 @@ class AddressBook(Screen):
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def refreshs(*args):
|
def refreshs(*args):
|
||||||
"""Refresh the Widget."""
|
"""Refresh the Widget."""
|
||||||
state.navinstance.ids.sc11.ids.ml.clear_widgets()
|
# state.navinstance.ids.sc11.ids.ml.clear_widgets()
|
||||||
state.navinstance.ids.sc11.loadAddresslist(None, 'All', '')
|
# state.navinstance.ids.sc11.loadAddresslist(None, 'All', '')
|
||||||
|
pass
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def addBook_detail(address, label, *args):
|
def addBook_detail(address, label, *args):
|
||||||
|
@ -465,15 +465,15 @@ class DropDownWidget(BoxLayout):
|
||||||
if status == 'success':
|
if status == 'success':
|
||||||
if state.detailPageType == 'draft' and state.send_draft_mail:
|
if state.detailPageType == 'draft' and state.send_draft_mail:
|
||||||
sqlExecute(
|
sqlExecute(
|
||||||
"UPDATE sent SET toaddress = '{0}' \
|
"UPDATE sent SET toaddress = ? \
|
||||||
, fromaddress ='{1}' , subject = '{2}'\
|
, fromaddress = ? , subject = ?\
|
||||||
, message = '{3}', folder = 'sent'\
|
, message = ?, folder = 'sent'\
|
||||||
WHERE lastactiontime = '{4}';".format(
|
WHERE ackdata = ?;",
|
||||||
toAddress,
|
toAddress,
|
||||||
fromAddress,
|
fromAddress,
|
||||||
subject,
|
subject,
|
||||||
message,
|
message,
|
||||||
state.send_draft_mail))
|
str(state.send_draft_mail))
|
||||||
self.parent.parent.screens[15].clear_widgets()
|
self.parent.parent.screens[15].clear_widgets()
|
||||||
self.parent.parent.screens[15].add_widget(Draft())
|
self.parent.parent.screens[15].add_widget(Draft())
|
||||||
state.detailPageType = ''
|
state.detailPageType = ''
|
||||||
|
@ -558,6 +558,7 @@ class DropDownWidget(BoxLayout):
|
||||||
self.ids.txt_input.text = ''
|
self.ids.txt_input.text = ''
|
||||||
self.ids.subject.text = ''
|
self.ids.subject.text = ''
|
||||||
self.ids.body.text = ''
|
self.ids.body.text = ''
|
||||||
|
toast("Reset message")
|
||||||
|
|
||||||
def auto_fill_fromaddr(self):
|
def auto_fill_fromaddr(self):
|
||||||
"""Mehtod used to fill the text automatically From Address."""
|
"""Mehtod used to fill the text automatically From Address."""
|
||||||
|
@ -690,12 +691,13 @@ class Random(Screen):
|
||||||
label, 1, "", eighteenByteRipe,
|
label, 1, "", eighteenByteRipe,
|
||||||
nonceTrialsPerByte,
|
nonceTrialsPerByte,
|
||||||
payloadLengthExtraBytes))
|
payloadLengthExtraBytes))
|
||||||
self.manager.current = 'myaddress'
|
|
||||||
self.ids.label.text = ''
|
self.ids.label.text = ''
|
||||||
self.parent.parent.parent.parent.ids.toolbar.opacity = 1
|
self.parent.parent.parent.parent.ids.toolbar.opacity = 1
|
||||||
self.parent.parent.parent.parent.ids.toolbar.disabled = False
|
self.parent.parent.parent.parent.ids.toolbar.disabled = False
|
||||||
self.parent.parent.parent.parent.ids.sc10.ids.ml.clear_widgets()
|
self.parent.parent.parent.parent.ids.sc10.ids.ml.clear_widgets()
|
||||||
|
self.manager.current = 'myaddress'
|
||||||
self.parent.parent.parent.parent.ids.sc10.init_ui()
|
self.parent.parent.parent.parent.ids.sc10.init_ui()
|
||||||
|
self.manager.current = 'myaddress'
|
||||||
toast('New address created')
|
toast('New address created')
|
||||||
|
|
||||||
|
|
||||||
|
@ -752,7 +754,7 @@ class Sent(Screen):
|
||||||
'secondary_text': mail[2][:50] + '........' if len(
|
'secondary_text': mail[2][:50] + '........' if len(
|
||||||
mail[2]) >= 50 else (
|
mail[2]) >= 50 else (
|
||||||
mail[2] + ',' + mail[3].replace('\n', ''))[0:50] + '........',
|
mail[2] + ',' + mail[3].replace('\n', ''))[0:50] + '........',
|
||||||
'lastactiontime': mail[6]})
|
'ackdata': mail[5]})
|
||||||
for item in data:
|
for item in data:
|
||||||
meny = TwoLineAvatarIconListItem(
|
meny = TwoLineAvatarIconListItem(
|
||||||
text=item['text'],
|
text=item['text'],
|
||||||
|
@ -763,7 +765,7 @@ class Sent(Screen):
|
||||||
source='./images/text_images/{}.png'.format(
|
source='./images/text_images/{}.png'.format(
|
||||||
avatarImageFirstLetter(item['secondary_text'].strip()))))
|
avatarImageFirstLetter(item['secondary_text'].strip()))))
|
||||||
meny.bind(on_press=partial(
|
meny.bind(on_press=partial(
|
||||||
self.sent_detail, item['lastactiontime']))
|
self.sent_detail, item['ackdata']))
|
||||||
carousel = Carousel(direction='right')
|
carousel = Carousel(direction='right')
|
||||||
carousel.height = meny.height
|
carousel.height = meny.height
|
||||||
carousel.size_hint_y = None
|
carousel.size_hint_y = None
|
||||||
|
@ -774,13 +776,13 @@ class Sent(Screen):
|
||||||
del_btn.background_normal = ''
|
del_btn.background_normal = ''
|
||||||
del_btn.background_color = (1, 0, 0, 1)
|
del_btn.background_color = (1, 0, 0, 1)
|
||||||
del_btn.bind(on_press=partial(
|
del_btn.bind(on_press=partial(
|
||||||
self.delete, item['lastactiontime']))
|
self.delete, item['ackdata']))
|
||||||
carousel.add_widget(del_btn)
|
carousel.add_widget(del_btn)
|
||||||
carousel.add_widget(meny)
|
carousel.add_widget(meny)
|
||||||
ach_btn = Button(text='Achieve')
|
ach_btn = Button(text='Achieve')
|
||||||
ach_btn.background_color = (0, 1, 0, 1)
|
ach_btn.background_color = (0, 1, 0, 1)
|
||||||
ach_btn.bind(on_press=partial(
|
ach_btn.bind(on_press=partial(
|
||||||
self.archive, item['lastactiontime']))
|
self.archive, item['ackdata']))
|
||||||
carousel.add_widget(ach_btn)
|
carousel.add_widget(ach_btn)
|
||||||
carousel.index = 1
|
carousel.index = 1
|
||||||
self.ids.ml.add_widget(carousel)
|
self.ids.ml.add_widget(carousel)
|
||||||
|
@ -796,10 +798,10 @@ class Sent(Screen):
|
||||||
valign='top')
|
valign='top')
|
||||||
self.ids.ml.add_widget(content)
|
self.ids.ml.add_widget(content)
|
||||||
|
|
||||||
def sent_detail(self, lastsenttime, *args):
|
def sent_detail(self, ackdata, *args):
|
||||||
"""Load sent mail details."""
|
"""Load sent mail details."""
|
||||||
state.detailPageType = 'sent'
|
state.detailPageType = 'sent'
|
||||||
state.sentMailTime = lastsenttime
|
state.mail_id = ackdata
|
||||||
if self.manager:
|
if self.manager:
|
||||||
src_mng_obj = self.manager
|
src_mng_obj = self.manager
|
||||||
else:
|
else:
|
||||||
|
@ -828,7 +830,7 @@ class Sent(Screen):
|
||||||
state.all_count = str(int(state.all_count) - 1)
|
state.all_count = str(int(state.all_count) - 1)
|
||||||
sqlExecute(
|
sqlExecute(
|
||||||
"UPDATE sent SET folder = 'trash' \
|
"UPDATE sent SET folder = 'trash' \
|
||||||
WHERE lastactiontime = {};".format(data_index))
|
WHERE ackdata = ?;", str(data_index))
|
||||||
self.ids.ml.remove_widget(instance.parent.parent)
|
self.ids.ml.remove_widget(instance.parent.parent)
|
||||||
toast('Deleted')
|
toast('Deleted')
|
||||||
self.update_trash()
|
self.update_trash()
|
||||||
|
@ -837,7 +839,7 @@ class Sent(Screen):
|
||||||
"""Archive sent mail from sent mail listing."""
|
"""Archive sent mail from sent mail listing."""
|
||||||
sqlExecute(
|
sqlExecute(
|
||||||
"UPDATE sent SET folder = 'trash' \
|
"UPDATE sent SET folder = 'trash' \
|
||||||
WHERE lastactiontime = {};".format(data_index))
|
WHERE ackdata = ?;", str(data_index))
|
||||||
self.ids.ml.remove_widget(instance.parent.parent)
|
self.ids.ml.remove_widget(instance.parent.parent)
|
||||||
self.update_trash()
|
self.update_trash()
|
||||||
|
|
||||||
|
@ -1094,7 +1096,7 @@ class NavigateApp(App): # pylint: disable=too-many-public-methods
|
||||||
"""Getting default image on address"""
|
"""Getting default image on address"""
|
||||||
if BMConfigParser().addresses():
|
if BMConfigParser().addresses():
|
||||||
return './images/default_identicon/{}.png'.format(BMConfigParser().addresses()[0])
|
return './images/default_identicon/{}.png'.format(BMConfigParser().addresses()[0])
|
||||||
return ''
|
return './images/no_identicons.png'
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def addressexist():
|
def addressexist():
|
||||||
|
@ -1158,6 +1160,7 @@ class NavigateApp(App): # pylint: disable=too-many-public-methods
|
||||||
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.toolbar.right_action_items = [
|
self.root.ids.toolbar.right_action_items = [
|
||||||
|
['refresh', lambda x: self.root.ids.sc3.children[0].reset_composer()],
|
||||||
['send', lambda x: self.root.ids.sc3.children[0].send(self)]]
|
['send', lambda x: self.root.ids.sc3.children[0].send(self)]]
|
||||||
|
|
||||||
def back_press(self):
|
def back_press(self):
|
||||||
|
@ -1167,7 +1170,9 @@ class NavigateApp(App): # pylint: disable=too-many-public-methods
|
||||||
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
|
if state.in_composer else 'allmails'\
|
||||||
|
if state.is_allmail else state.detailPageType\
|
||||||
|
if state.detailPageType else 'inbox'
|
||||||
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':
|
if state.is_allmail or state.detailPageType == 'draft':
|
||||||
|
@ -1299,10 +1304,12 @@ class GrashofPopup(Popup):
|
||||||
stored_address = [addr[1] for addr in kivy_helper_search.search_sql(
|
stored_address = [addr[1] for addr in kivy_helper_search.search_sql(
|
||||||
folder="addressbook")]
|
folder="addressbook")]
|
||||||
if label and address and address not in stored_address:
|
if label and address and address not in stored_address:
|
||||||
state.navinstance = self.parent.children[1]
|
# state.navinstance = self.parent.children[1]
|
||||||
queues.UISignalQueue.put(('rerenderAddressBook', ''))
|
queues.UISignalQueue.put(('rerenderAddressBook', ''))
|
||||||
self.dismiss()
|
self.dismiss()
|
||||||
sqlExecute("INSERT INTO addressbook VALUES(?,?)", label, address)
|
sqlExecute("INSERT INTO addressbook VALUES(?,?)", label, address)
|
||||||
|
state.kivyapp.root.ids.sc11.ids.ml.clear_widgets()
|
||||||
|
state.kivyapp.root.ids.sc11.loadAddresslist(None, 'All', '')
|
||||||
self.parent.children[1].ids.scr_mngr.current = 'addressbook'
|
self.parent.children[1].ids.scr_mngr.current = 'addressbook'
|
||||||
toast('Saved')
|
toast('Saved')
|
||||||
|
|
||||||
|
@ -1422,8 +1429,7 @@ class MailDetail(Screen):
|
||||||
if state.detailPageType == 'sent' or state.detailPageType == 'draft':
|
if state.detailPageType == 'sent' or state.detailPageType == 'draft':
|
||||||
data = sqlQuery(
|
data = sqlQuery(
|
||||||
"select toaddress, fromaddress, subject, message, status, \
|
"select toaddress, fromaddress, subject, message, status, \
|
||||||
ackdata from sent where lastactiontime = {};".format(
|
ackdata from sent where ackdata = ?;", state.mail_id)
|
||||||
state.sentMailTime))
|
|
||||||
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)
|
||||||
|
@ -1431,7 +1437,7 @@ class MailDetail(Screen):
|
||||||
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 msgid = ?;", str(state.mail_id))
|
||||||
self.assign_mail_details(data)
|
self.assign_mail_details(data)
|
||||||
state.kivyapp.set_mail_detail_header()
|
state.kivyapp.set_mail_detail_header()
|
||||||
|
|
||||||
|
@ -1455,7 +1461,7 @@ class MailDetail(Screen):
|
||||||
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))
|
ackdata = ?;", str(state.mail_id))
|
||||||
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.screens[3].ids.ml.clear_widgets()
|
self.parent.screens[3].ids.ml.clear_widgets()
|
||||||
|
@ -1463,15 +1469,14 @@ class MailDetail(Screen):
|
||||||
elif state.detailPageType == 'inbox':
|
elif state.detailPageType == 'inbox':
|
||||||
sqlExecute(
|
sqlExecute(
|
||||||
"UPDATE inbox SET folder = 'trash' WHERE \
|
"UPDATE inbox SET folder = 'trash' WHERE \
|
||||||
received = {};".format(state.sentMailTime))
|
msgid = ?;", str(state.mail_id))
|
||||||
# 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.screens[0].ids.ml.clear_widgets()
|
self.parent.screens[0].ids.ml.clear_widgets()
|
||||||
self.parent.screens[0].loadMessagelist(state.association)
|
self.parent.screens[0].loadMessagelist(state.association)
|
||||||
elif state.detailPageType == 'draft':
|
elif state.detailPageType == 'draft':
|
||||||
sqlExecute("DELETE FROM sent WHERE lastactiontime = '{}';".format(
|
sqlExecute("DELETE FROM sent WHERE ackdata = ?;", str(
|
||||||
state.sentMailTime))
|
state.mail_id))
|
||||||
msg_count_objs.draft_cnt.badge_text = str(int(state.draft_count) - 1)
|
msg_count_objs.draft_cnt.badge_text = str(int(state.draft_count) - 1)
|
||||||
state.draft_count = str(int(state.draft_count) - 1)
|
state.draft_count = str(int(state.draft_count) - 1)
|
||||||
self.parent.screens[15].clear_widgets()
|
self.parent.screens[15].clear_widgets()
|
||||||
|
@ -1494,7 +1499,7 @@ class MailDetail(Screen):
|
||||||
"""Method used for replying inbox messages."""
|
"""Method used for replying inbox messages."""
|
||||||
data = sqlQuery(
|
data = sqlQuery(
|
||||||
"select toaddress, fromaddress, subject, message from inbox where \
|
"select toaddress, fromaddress, subject, message from inbox where \
|
||||||
received = {};".format(state.sentMailTime))
|
msgid = ?;", str(state.mail_id))
|
||||||
composer_obj = self.parent.screens[2].children[0].ids
|
composer_obj = self.parent.screens[2].children[0].ids
|
||||||
composer_obj.ti.text = data[0][0]
|
composer_obj.ti.text = data[0][0]
|
||||||
composer_obj.btn.text = data[0][0]
|
composer_obj.btn.text = data[0][0]
|
||||||
|
@ -1511,7 +1516,7 @@ class MailDetail(Screen):
|
||||||
|
|
||||||
def write_msg(self, navApp):
|
def write_msg(self, navApp):
|
||||||
"""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.mail_id
|
||||||
composer_ids = \
|
composer_ids = \
|
||||||
self.parent.parent.parent.parent.ids.sc3.children[0].ids
|
self.parent.parent.parent.parent.ids.sc3.children[0].ids
|
||||||
composer_ids.ti.text = state.write_msg['from_addr']
|
composer_ids.ti.text = state.write_msg['from_addr']
|
||||||
|
@ -1595,7 +1600,7 @@ class AddbookDetailPopup(Popup):
|
||||||
window_obj = self.parent.children[1].ids
|
window_obj = self.parent.children[1].ids
|
||||||
window_obj.sc3.children[0].ids.txt_input.text = self.address
|
window_obj.sc3.children[0].ids.txt_input.text = self.address
|
||||||
window_obj.sc3.children[0].ids.ti.text = ''
|
window_obj.sc3.children[0].ids.ti.text = ''
|
||||||
window_obj.sc3.children[0].ids.btn.text = ''
|
window_obj.sc3.children[0].ids.btn.text = 'Select'
|
||||||
window_obj.sc3.children[0].ids.subject.text = ''
|
window_obj.sc3.children[0].ids.subject.text = ''
|
||||||
window_obj.sc3.children[0].ids.body.text = ''
|
window_obj.sc3.children[0].ids.body.text = ''
|
||||||
window_obj.scr_mngr.current = 'create'
|
window_obj.scr_mngr.current = 'create'
|
||||||
|
@ -1662,7 +1667,7 @@ class Draft(Screen):
|
||||||
mail[2]) > 10 else mail[2] + '\n' + " " + (
|
mail[2]) > 10 else mail[2] + '\n' + " " + (
|
||||||
third_text[:25] + '...!') if len(
|
third_text[:25] + '...!') if len(
|
||||||
third_text) > 25 else third_text,
|
third_text) > 25 else third_text,
|
||||||
'lastactiontime': mail[6]})
|
'ackdata': mail[5]})
|
||||||
for item in self.data:
|
for item in self.data:
|
||||||
meny = TwoLineAvatarIconListItem(
|
meny = TwoLineAvatarIconListItem(
|
||||||
text='Draft',
|
text='Draft',
|
||||||
|
@ -1672,7 +1677,7 @@ class Draft(Screen):
|
||||||
meny.add_widget(AvatarSampleWidget(
|
meny.add_widget(AvatarSampleWidget(
|
||||||
source='./images/avatar.png'))
|
source='./images/avatar.png'))
|
||||||
meny.bind(on_press=partial(
|
meny.bind(on_press=partial(
|
||||||
self.draft_detail, item['lastactiontime']))
|
self.draft_detail, item['ackdata']))
|
||||||
carousel = Carousel(direction='right')
|
carousel = Carousel(direction='right')
|
||||||
carousel.height = meny.height
|
carousel.height = meny.height
|
||||||
carousel.size_hint_y = None
|
carousel.size_hint_y = None
|
||||||
|
@ -1683,7 +1688,7 @@ class Draft(Screen):
|
||||||
del_btn.background_normal = ''
|
del_btn.background_normal = ''
|
||||||
del_btn.background_color = (1, 0, 0, 1)
|
del_btn.background_color = (1, 0, 0, 1)
|
||||||
del_btn.bind(on_press=partial(
|
del_btn.bind(on_press=partial(
|
||||||
self.delete_draft, item['lastactiontime']))
|
self.delete_draft, item['ackdata']))
|
||||||
carousel.add_widget(del_btn)
|
carousel.add_widget(del_btn)
|
||||||
carousel.add_widget(meny)
|
carousel.add_widget(meny)
|
||||||
carousel.index = 1
|
carousel.index = 1
|
||||||
|
@ -1699,10 +1704,10 @@ class Draft(Screen):
|
||||||
valign='top')
|
valign='top')
|
||||||
self.ids.ml.add_widget(content)
|
self.ids.ml.add_widget(content)
|
||||||
|
|
||||||
def draft_detail(self, lastsenttime, *args):
|
def draft_detail(self, ackdata, *args):
|
||||||
"""Method used to show draft Details."""
|
"""Method used to show draft Details."""
|
||||||
state.detailPageType = 'draft'
|
state.detailPageType = 'draft'
|
||||||
state.sentMailTime = lastsenttime
|
state.mail_id = ackdata
|
||||||
if self.manager:
|
if self.manager:
|
||||||
src_mng_obj = self.manager
|
src_mng_obj = self.manager
|
||||||
else:
|
else:
|
||||||
|
@ -1713,7 +1718,7 @@ class Draft(Screen):
|
||||||
|
|
||||||
def delete_draft(self, data_index, instance, *args):
|
def delete_draft(self, data_index, instance, *args):
|
||||||
"""Method used to delete draft message permanently."""
|
"""Method used to delete draft message permanently."""
|
||||||
sqlExecute("DELETE FROM sent WHERE lastactiontime = '{}';".format(
|
sqlExecute("DELETE FROM sent WHERE ackdata = ?;", str(
|
||||||
data_index))
|
data_index))
|
||||||
try:
|
try:
|
||||||
msg_count_objs = \
|
msg_count_objs = \
|
||||||
|
@ -1728,7 +1733,6 @@ class Draft(Screen):
|
||||||
self.ids.ml.remove_widget(instance.parent.parent)
|
self.ids.ml.remove_widget(instance.parent.parent)
|
||||||
toast('Deleted')
|
toast('Deleted')
|
||||||
|
|
||||||
# pylint: disable=unused-variable
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def draft_msg(src_object):
|
def draft_msg(src_object):
|
||||||
"""Method used for saving draft mails."""
|
"""Method used for saving draft mails."""
|
||||||
|
@ -1814,16 +1818,11 @@ class Allmails(Screen):
|
||||||
|
|
||||||
def loadMessagelist(self, account, where="", what=""):
|
def loadMessagelist(self, account, where="", what=""):
|
||||||
"""Load Inbox, Sent anf Draft list of messages."""
|
"""Load Inbox, Sent anf Draft list of messages."""
|
||||||
inbox = sqlQuery(
|
all_mails = sqlQuery(
|
||||||
"SELECT toaddress, fromaddress, subject, message, folder, received from\
|
"SELECT toaddress, fromaddress, subject, message, folder, ackdata As id, DATE(lastactiontime)"
|
||||||
inbox WHERE folder = 'inbox' and toaddress = '{}';".format(
|
" As actionTime FROM sent WHERE folder = 'sent' UNION"
|
||||||
account))
|
" SELECT toaddress, fromaddress, subject, message, folder, msgid As id, DATE(received) As"
|
||||||
sent_and_draft = sqlQuery(
|
" actionTime FROM inbox WHERE folder = 'inbox' ORDER BY actionTime DESC")
|
||||||
"SELECT toaddress, fromaddress, subject, message, folder, lastactiontime from sent \
|
|
||||||
WHERE folder = 'sent' and fromaddress = '{}';".format(
|
|
||||||
account))
|
|
||||||
|
|
||||||
all_mails = inbox + sent_and_draft
|
|
||||||
if all_mails:
|
if all_mails:
|
||||||
state.kivyapp.root.children[2].children[0].ids.allmail_cnt.badge_text = str(len(all_mails))
|
state.kivyapp.root.children[2].children[0].ids.allmail_cnt.badge_text = str(len(all_mails))
|
||||||
state.all_count = str(len(all_mails))
|
state.all_count = str(len(all_mails))
|
||||||
|
@ -1870,7 +1869,7 @@ class Allmails(Screen):
|
||||||
"""Load sent and inbox mail details."""
|
"""Load sent and inbox mail details."""
|
||||||
state.detailPageType = folder
|
state.detailPageType = folder
|
||||||
state.is_allmail = True
|
state.is_allmail = True
|
||||||
state.sentMailTime = unique_id
|
state.mail_id = unique_id
|
||||||
if self.manager:
|
if self.manager:
|
||||||
src_mng_obj = self.manager
|
src_mng_obj = self.manager
|
||||||
else:
|
else:
|
||||||
|
@ -1883,11 +1882,11 @@ class Allmails(Screen):
|
||||||
"""Delete inbox mail from all mail listing listing."""
|
"""Delete inbox mail from all mail listing listing."""
|
||||||
if folder == 'inbox':
|
if folder == 'inbox':
|
||||||
sqlExecute(
|
sqlExecute(
|
||||||
"UPDATE inbox SET folder = 'trash' WHERE received = {};".format(
|
"UPDATE inbox SET folder = 'trash' WHERE msgid = ?;", str(
|
||||||
unique_id))
|
unique_id))
|
||||||
else:
|
else:
|
||||||
sqlExecute(
|
sqlExecute(
|
||||||
"UPDATE sent SET folder = 'trash' WHERE lastactiontime = {};".format(
|
"UPDATE sent SET folder = 'trash' WHERE ackdata = ?;", str(
|
||||||
unique_id))
|
unique_id))
|
||||||
self.ids.ml.remove_widget(instance.parent.parent)
|
self.ids.ml.remove_widget(instance.parent.parent)
|
||||||
try:
|
try:
|
||||||
|
|
|
@ -16,8 +16,9 @@ class UIkivySignaler(Thread):
|
||||||
if command == 'writeNewAddressToTable':
|
if command == 'writeNewAddressToTable':
|
||||||
label, address, streamNumber = data
|
label, address, streamNumber = data
|
||||||
state.kivyapp.variable_1.append(address)
|
state.kivyapp.variable_1.append(address)
|
||||||
elif command == 'rerenderAddressBook':
|
# elif command == 'rerenderAddressBook':
|
||||||
state.kivyapp.obj_1.refreshs()
|
# state.kivyapp.obj_1.refreshs()
|
||||||
|
# Need to discuss this
|
||||||
elif command == 'updateSentItemStatusByAckdata':
|
elif command == 'updateSentItemStatusByAckdata':
|
||||||
state.kivyapp.status_dispatching(data)
|
state.kivyapp.status_dispatching(data)
|
||||||
|
|
||||||
|
|
|
@ -46,7 +46,7 @@ def lookupAppdataFolder():
|
||||||
dataFolder = os.path.join(
|
dataFolder = os.path.join(
|
||||||
os.environ['HOME'],
|
os.environ['HOME'],
|
||||||
'Library/Application Support/', APPNAME
|
'Library/Application Support/', APPNAME
|
||||||
) + '/' # FIXME: should also be os.path.sep
|
) + '/' # ..fixme:: should also be os.path.sep
|
||||||
except KeyError:
|
except KeyError:
|
||||||
sys.exit(
|
sys.exit(
|
||||||
'Could not find home folder, please report this message'
|
'Could not find home folder, please report this message'
|
||||||
|
@ -78,6 +78,7 @@ def lookupAppdataFolder():
|
||||||
|
|
||||||
def codePath():
|
def codePath():
|
||||||
"""Returns path to the program sources"""
|
"""Returns path to the program sources"""
|
||||||
|
# pylint: disable=protected-access
|
||||||
if not frozen:
|
if not frozen:
|
||||||
return os.path.dirname(__file__)
|
return os.path.dirname(__file__)
|
||||||
return (
|
return (
|
||||||
|
@ -85,7 +86,6 @@ def codePath():
|
||||||
if frozen == "macosx_app" else sys._MEIPASS)
|
if frozen == "macosx_app" else sys._MEIPASS)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def tail(f, lines=20):
|
def tail(f, lines=20):
|
||||||
"""Returns last lines in the f file object"""
|
"""Returns last lines in the f file object"""
|
||||||
total_lines_wanted = lines
|
total_lines_wanted = lines
|
||||||
|
|
|
@ -67,7 +67,7 @@ kivyapp = None
|
||||||
|
|
||||||
navinstance = None
|
navinstance = None
|
||||||
|
|
||||||
sentMailTime = 0
|
mail_id = 0
|
||||||
|
|
||||||
myAddressObj = None
|
myAddressObj = None
|
||||||
|
|
||||||
|
|
Reference in New Issue
Block a user