kivy new updates
This commit is contained in:
parent
3549330dce
commit
4904f8d3ee
|
@ -42,4 +42,4 @@ def search_sql(xAddress="toaddress", account=None, folder="inbox", where=None, w
|
|||
sqlStatementBase += "WHERE " + " AND ".join(sqlStatementParts)
|
||||
if folder == "sent":
|
||||
sqlStatementBase += " ORDER BY lastactiontime"
|
||||
return sqlQuery(sqlStatementBase, sqlArguments)
|
||||
return sqlQuery(sqlStatementBase, sqlArguments)
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
#:import Toolbar kivymd.toolbar.Toolbar
|
||||
#:import ThemeManager kivymd.theming.ThemeManager
|
||||
#:import MDNavigationDrawer kivymd.navigationdrawer.MDNavigationDrawer
|
||||
|
@ -34,10 +33,14 @@
|
|||
#:import MDBottomNavigation kivymd.tabs.MDBottomNavigation
|
||||
#:import MDBottomNavigationItem kivymd.tabs.MDBottomNavigationItem
|
||||
#:import MDFloatingActionButton kivymd.button.MDFloatingActionButton
|
||||
#:import Factory kivy.factory.Factory
|
||||
|
||||
<MyNavigationDrawerIconButton@NavigationDrawerIconButton>:
|
||||
icon: 'checkbox-blank-circle'
|
||||
|
||||
<MySpinnerOption@SpinnerOption>:
|
||||
font_size: '12.5sp'
|
||||
|
||||
<ContentNavigationDrawer@Navigatorss>:
|
||||
drawer_logo: './images/drawer_logo1.png'
|
||||
NavigationDrawerDivider:
|
||||
|
@ -48,6 +51,8 @@
|
|||
Spinner:
|
||||
pos_hint:{"x":0,"y":.25}
|
||||
id: btn
|
||||
option_cls: Factory.get("MySpinnerOption")
|
||||
font_size: '12.5sp'
|
||||
text: app.getDefaultAccData()
|
||||
values: app.variable_1
|
||||
on_text:app.getCurrentAccountData(self.text)
|
||||
|
@ -175,7 +180,7 @@ NavigationLayout:
|
|||
id:sc12
|
||||
NetworkStat:
|
||||
id:sc13
|
||||
SentDetail:
|
||||
MailDetail:
|
||||
id:sc14
|
||||
|
||||
<Inbox>:
|
||||
|
@ -184,20 +189,8 @@ NavigationLayout:
|
|||
do_scroll_x: False
|
||||
MDList:
|
||||
id: ml
|
||||
BoxLayout:
|
||||
size_hint_y: None
|
||||
height: dp(56)
|
||||
spacing: '10dp'
|
||||
pos_hint: {'center_x':0.45, 'center_y': .1}
|
||||
|
||||
Widget:
|
||||
|
||||
MDFloatingActionButton:
|
||||
icon: 'plus'
|
||||
opposite_colors: True
|
||||
elevation_normal: 8
|
||||
md_bg_color: [0.941, 0, 0,1]
|
||||
on_press: app.root.ids.scr_mngr.current = 'create'
|
||||
ComposerButton:
|
||||
|
||||
<Sent>:
|
||||
name: 'sent'
|
||||
|
@ -205,20 +198,7 @@ NavigationLayout:
|
|||
do_scroll_x: False
|
||||
MDList:
|
||||
id: ml
|
||||
BoxLayout:
|
||||
size_hint_y: None
|
||||
height: dp(56)
|
||||
spacing: '10dp'
|
||||
pos_hint: {'center_x':0.45, 'center_y': .1}
|
||||
|
||||
Widget:
|
||||
|
||||
MDFloatingActionButton:
|
||||
icon: 'plus'
|
||||
opposite_colors: True
|
||||
elevation_normal: 8
|
||||
md_bg_color: [0.941, 0, 0,1]
|
||||
on_press: app.root.ids.scr_mngr.current = 'create'
|
||||
ComposerButton:
|
||||
|
||||
<Trash>:
|
||||
name: 'trash'
|
||||
|
@ -226,21 +206,8 @@ NavigationLayout:
|
|||
do_scroll_x: False
|
||||
MDList:
|
||||
id: ml
|
||||
BoxLayout:
|
||||
size_hint_y: None
|
||||
height: dp(56)
|
||||
spacing: '10dp'
|
||||
pos_hint: {'center_x':0.45, 'center_y': .1}
|
||||
|
||||
Widget:
|
||||
|
||||
MDFloatingActionButton:
|
||||
icon: 'plus'
|
||||
opposite_colors: True
|
||||
elevation_normal: 8
|
||||
md_bg_color: [0.941, 0, 0,1]
|
||||
on_press: app.root.ids.scr_mngr.current = 'create'
|
||||
|
||||
ComposerButton:
|
||||
|
||||
<Draft>:
|
||||
name: 'draft'
|
||||
Label:
|
||||
|
@ -289,6 +256,8 @@ NavigationLayout:
|
|||
text: 'select'
|
||||
values: app.variable_1
|
||||
on_text: ti.text = self.text
|
||||
option_cls: Factory.get("MySpinnerOption")
|
||||
font_size: '12.5sp'
|
||||
|
||||
BoxLayout:
|
||||
orientation: 'vertical'
|
||||
|
@ -530,6 +499,7 @@ NavigationLayout:
|
|||
do_scroll_x: False
|
||||
MDList:
|
||||
id: ml
|
||||
ComposerButton:
|
||||
|
||||
<AddressBook>:
|
||||
name: 'addressbook'
|
||||
|
@ -539,6 +509,7 @@ NavigationLayout:
|
|||
do_scroll_x: False
|
||||
MDList:
|
||||
id: ml
|
||||
ComposerButton:
|
||||
|
||||
<Payment>:
|
||||
name: 'payment'
|
||||
|
@ -648,8 +619,8 @@ NavigationLayout:
|
|||
size_hint: .8, .6
|
||||
text: root.text_variable_5
|
||||
|
||||
<SentDetail>:
|
||||
name: 'sentdetail'
|
||||
<MailDetail>:
|
||||
name: 'mailDetail'
|
||||
ScrollView:
|
||||
do_scroll_x: False
|
||||
BoxLayout:
|
||||
|
@ -662,6 +633,11 @@ NavigationLayout:
|
|||
theme_text_color: 'Primary'
|
||||
text: root.subject
|
||||
halign: 'left'
|
||||
MDLabel:
|
||||
font_style: 'Subhead'
|
||||
theme_text_color: 'Primary'
|
||||
text: "From: " + root.from_addr
|
||||
halign: 'left'
|
||||
MDLabel:
|
||||
font_style: 'Subhead'
|
||||
theme_text_color: 'Primary'
|
||||
|
@ -670,11 +646,81 @@ NavigationLayout:
|
|||
MDLabel:
|
||||
font_style: 'Subhead'
|
||||
theme_text_color: 'Primary'
|
||||
text: "From: " + root.from_addr
|
||||
text: root.status
|
||||
halign: 'left'
|
||||
MDLabel:
|
||||
font_style: 'Subhead'
|
||||
theme_text_color: 'Primary'
|
||||
text: root.message
|
||||
halign: 'left'
|
||||
bold: True
|
||||
bold: True
|
||||
BoxLayout:
|
||||
spacing:50
|
||||
MDRaisedButton:
|
||||
size_hint: 1, None
|
||||
height: dp(40)
|
||||
text: 'Copy'
|
||||
MDRaisedButton:
|
||||
size_hint: 1, None
|
||||
height: dp(40)
|
||||
text: 'Delete'
|
||||
on_press: root.delete_mail()
|
||||
|
||||
<ComposerButton@BoxLayout>:
|
||||
size_hint_y: None
|
||||
height: dp(56)
|
||||
spacing: '10dp'
|
||||
pos_hint: {'center_x':0.45, 'center_y': .1}
|
||||
|
||||
Widget:
|
||||
|
||||
MDFloatingActionButton:
|
||||
icon: 'plus'
|
||||
opposite_colors: True
|
||||
elevation_normal: 8
|
||||
md_bg_color: [0.941, 0, 0,1]
|
||||
on_press: app.root.ids.scr_mngr.current = 'create'
|
||||
|
||||
<MyaddDetailPopup>:
|
||||
id: myadd_popup
|
||||
background: './images/popup.jpeg'
|
||||
separator_height: 0
|
||||
auto_dismiss: False
|
||||
BoxLayout:
|
||||
size_hint_y: None
|
||||
spacing:50
|
||||
id: popup_box
|
||||
orientation: 'vertical'
|
||||
MDLabel:
|
||||
font_style: 'Title'
|
||||
theme_text_color: 'Primary'
|
||||
text: "Label"
|
||||
halign: 'left'
|
||||
MDLabel:
|
||||
font_style: 'Subhead'
|
||||
theme_text_color: 'Primary'
|
||||
text: root.address_label
|
||||
halign: 'left'
|
||||
MDLabel:
|
||||
font_style: 'Title'
|
||||
theme_text_color: 'Primary'
|
||||
text: "Address"
|
||||
halign: 'left'
|
||||
MDLabel:
|
||||
font_style: 'Subhead'
|
||||
theme_text_color: 'Primary'
|
||||
text: root.address
|
||||
halign: 'left'
|
||||
MDRaisedButton:
|
||||
size_hint: 1, None
|
||||
height: dp(40)
|
||||
text: 'Save'
|
||||
MDRaisedButton:
|
||||
size_hint: 1, None
|
||||
height: dp(40)
|
||||
text: 'Cancel'
|
||||
on_press: root.dismiss()
|
||||
MDRaisedButton:
|
||||
size_hint: 1, None
|
||||
height: dp(40)
|
||||
text: 'Scan QR code'
|
|
@ -46,6 +46,7 @@ from kivy.uix.button import Button
|
|||
import kivy_helper_search
|
||||
from kivy.core.window import Window
|
||||
from functools import partial
|
||||
from kivy.uix.carousel import Carousel
|
||||
|
||||
|
||||
class Navigatorss(MDNavigationDrawer):
|
||||
|
@ -56,6 +57,8 @@ class Navigatorss(MDNavigationDrawer):
|
|||
|
||||
class Inbox(Screen):
|
||||
"""Inbox Screen uses screen to show widgets of screens."""
|
||||
data = ListProperty()
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(Inbox, self).__init__(*args, **kwargs)
|
||||
if state.association == '':
|
||||
|
@ -64,7 +67,7 @@ class Inbox(Screen):
|
|||
Clock.schedule_once(self.init_ui, 0)
|
||||
|
||||
def init_ui(self, dt=0):
|
||||
"""Clock Schdule for method sent accounts."""
|
||||
"""Clock Schdule for method inbox accounts."""
|
||||
self.inboxaccounts()
|
||||
print(dt)
|
||||
|
||||
|
@ -74,7 +77,7 @@ class Inbox(Screen):
|
|||
self.loadMessagelist(account, 'All', '')
|
||||
|
||||
def loadMessagelist(self, account, where="", what=""):
|
||||
"""Load Sent list for Sent messages."""
|
||||
"""Load Inbox list for Inbox messages."""
|
||||
xAddress = 'toaddress'
|
||||
data = []
|
||||
queryreturn = kivy_helper_search.search_sql(
|
||||
|
@ -82,11 +85,29 @@ class Inbox(Screen):
|
|||
if queryreturn:
|
||||
for mail in queryreturn:
|
||||
third_text = mail[3].replace('\n', ' ')
|
||||
data.append({'text': mail[2].strip(), 'secondary_text': mail[5][:10] + '...........' if len(mail[2]) > 10 else mail[2] + '\n' + " " + (third_text[:25] + '...!') if len(third_text) > 25 else third_text })
|
||||
# ('inbox', 'j\xe5(M\xcfPbe\rl\x0f\xa3\r\xef>\xf0\x0b&\t\'}"RYg\x03\x80\x14\x82\xeb&,', 'BM-2cXpNNd7dhTjsv7LHNfmphfUabZk958sA3', 'hello', 'BM-2cWyUfBdY2FbgyuCb7abFZ49JYxSzUhNFe', 'test from peter', '1559121770', 0)
|
||||
data.append({'text': mail[4].strip(), 'secondary_text': mail[5][:10] + '...........' if len(mail[3]) > 10 else mail[3] + '\n' + " " + (third_text[:25] + '...!') if len(third_text) > 25 else third_text, 'receivedTime': mail[6] })
|
||||
for item in data:
|
||||
meny = ThreeLineAvatarIconListItem(text=item['text'], secondary_text=item['secondary_text'], theme_text_color= 'Custom', text_color=NavigateApp().theme_cls.primary_color)
|
||||
meny.add_widget(AvatarSampleWidget(source='./images/avatar.png'))
|
||||
self.ids.ml.add_widget(meny)
|
||||
meny.bind(on_press = partial(self.inbox_detail, item['receivedTime']))
|
||||
carousel = Carousel(direction='right')
|
||||
carousel.height = 150
|
||||
carousel.size_hint_y = None
|
||||
carousel.ignore_perpendicular_swipes = True
|
||||
carousel.data_index = 0
|
||||
carousel.min_move = 0.2
|
||||
del_btn = Button(text='Delete')
|
||||
del_btn.background_color = (1, 0, 0, .5)
|
||||
del_btn.bind(on_press=partial(self.delete, item['receivedTime']))
|
||||
carousel.add_widget(del_btn)
|
||||
carousel.add_widget(meny)
|
||||
ach_btn = Button(text='Achieve')
|
||||
ach_btn.background_color = (0,1,0,1)
|
||||
ach_btn.bind(on_press=partial(self.archive, item['receivedTime']))
|
||||
carousel.add_widget(ach_btn)
|
||||
carousel.index=1
|
||||
self.ids.ml.add_widget(carousel)
|
||||
else:
|
||||
content = MDLabel(font_style='Body1',
|
||||
theme_text_color='Primary',
|
||||
|
@ -97,6 +118,40 @@ class Inbox(Screen):
|
|||
valign='top')
|
||||
self.ids.ml.add_widget(content)
|
||||
|
||||
def inbox_detail(self, receivedTime, *args):
|
||||
"""Load inbox page details"""
|
||||
state.detailPageType = 'inbox'
|
||||
state.sentMailTime = receivedTime
|
||||
if self.manager:
|
||||
src_mng_obj = self.manager
|
||||
else:
|
||||
src_mng_obj = self.parent.parent
|
||||
src_mng_obj.screens[13].clear_widgets()
|
||||
src_mng_obj.screens[13].add_widget(MailDetail())
|
||||
src_mng_obj.current = 'mailDetail'
|
||||
|
||||
def delete(self, data_index, instance, *args):
|
||||
"""Delete inbox mail from inbox listing"""
|
||||
sqlExecute("UPDATE inbox SET folder = 'trash' WHERE received = {};".format(data_index))
|
||||
self.ids.ml.remove_widget(instance.parent.parent)
|
||||
self.update_trash()
|
||||
|
||||
def archive(self, data_index, instance, *args):
|
||||
"""Archive inbox mail from inbox listing"""
|
||||
sqlExecute("UPDATE inbox SET folder = 'trash' WHERE received = {};".format(data_index))
|
||||
self.ids.ml.remove_widget(instance.parent.parent)
|
||||
self.update_trash()
|
||||
|
||||
def update_trash(self):
|
||||
"""Update trash screen mails which is deleted from inbox"""
|
||||
try:
|
||||
self.parent.screens[4].clear_widgets()
|
||||
self.parent.screens[4].add_widget(Trash())
|
||||
except Exception as e:
|
||||
self.parent.parent.screens[4].clear_widgets()
|
||||
self.parent.parent.screens[4].add_widget(Trash())
|
||||
|
||||
|
||||
|
||||
class MyAddress(Screen):
|
||||
"""MyAddress Screen uses screen to show widgets of screens."""
|
||||
|
@ -106,13 +161,14 @@ class MyAddress(Screen):
|
|||
|
||||
def init_ui(self, dt=0):
|
||||
"""Clock Schdule for method inbox accounts."""
|
||||
if BMConfigParser().addresses() or state.kivyapp.variable_1:
|
||||
if BMConfigParser().addresses() or ContentNavigationDrawer().ids.btn.values:
|
||||
data = []
|
||||
for address in state.kivyapp.variable_1:
|
||||
for address in ContentNavigationDrawer().ids.btn.values:
|
||||
data.append({'text': BMConfigParser().get(address, 'label'), 'secondary_text': address})
|
||||
for item in data:
|
||||
meny = TwoLineAvatarIconListItem(text=item['text'], secondary_text=item['secondary_text'], theme_text_color= 'Custom',text_color=NavigateApp().theme_cls.primary_color)
|
||||
meny.add_widget(AvatarSampleWidget(source='./images/avatar.png'))
|
||||
meny.bind(on_press = partial(self.myadd_detail, item['secondary_text']))
|
||||
self.ids.ml.add_widget(meny)
|
||||
else:
|
||||
content = MDLabel(font_style='Body1',
|
||||
|
@ -128,6 +184,11 @@ class MyAddress(Screen):
|
|||
except Exception as e:
|
||||
pass
|
||||
|
||||
def myadd_detail(self, fromaddress, *args):
|
||||
p = MyaddDetailPopup()
|
||||
p.open()
|
||||
p.get_address(fromaddress)
|
||||
|
||||
|
||||
class AddressBook(Screen):
|
||||
"""AddressBook Screen uses screen to show widgets of screens."""
|
||||
|
@ -278,6 +339,7 @@ class DropDownWidget(BoxLayout):
|
|||
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.background = './images/popup.jpeg'
|
||||
self.main_pop.open()
|
||||
|
||||
|
||||
|
@ -370,13 +432,16 @@ class Random(Screen):
|
|||
nonceTrialsPerByte,
|
||||
payloadLengthExtraBytes)
|
||||
)
|
||||
self.manager.current = 'add_sucess'
|
||||
# self.manager.current = 'add_sucess'
|
||||
self.manager.current = 'myaddress'
|
||||
self.ids.label.text = ''
|
||||
self.parent.parent.parent.parent.ids.toolbar.opacity = 1
|
||||
self.parent.parent.parent.parent.ids.toolbar.disabled = False
|
||||
self.parent.parent.parent.parent.ids.sc10.clear_widgets()
|
||||
self.parent.parent.parent.parent.ids.sc10.add_widget(MyAddress())
|
||||
|
||||
state.myAddressObj = self.parent.parent.parent.parent.ids.sc10
|
||||
# self.parent.parent.parent.parent.ids.sc10.clear_widgets()
|
||||
# self.parent.parent.parent.parent.ids.sc10.add_widget(MyAddress())
|
||||
|
||||
|
||||
class AddressSuccessful(Screen):
|
||||
pass
|
||||
|
@ -410,18 +475,35 @@ class Sent(Screen):
|
|||
def loadSent(self, account, where="", what=""):
|
||||
"""Load Sent list for Sent messages."""
|
||||
xAddress = 'fromaddress'
|
||||
data = []
|
||||
queryreturn = kivy_helper_search.search_sql(
|
||||
xAddress, account, "sent", where, what, False)
|
||||
state.totalSentMail = len(queryreturn)
|
||||
if queryreturn:
|
||||
for mail in queryreturn:
|
||||
third_text = mail[3].replace('\n', ' ')
|
||||
data.append({'text': mail[0].strip(), 'secondary_text': mail[2][:10] + '...........' if len(mail[2]) > 10 else mail[2] + '\n' + " " + (third_text[:25] + '...!') if len(third_text) > 25 else third_text, 'lastactiontime': mail[6]})
|
||||
for item in data:
|
||||
self.data.append({'text': mail[1].strip(), 'secondary_text': mail[2][:10] + '...........' if len(mail[2]) > 10 else mail[2] + '\n' + " " + (third_text[:25] + '...!') if len(third_text) > 25 else third_text, 'lastactiontime': mail[6]})
|
||||
for item in self.data:
|
||||
meny = ThreeLineAvatarIconListItem(text=item['text'], secondary_text=item['secondary_text'], theme_text_color= 'Custom', text_color=NavigateApp().theme_cls.primary_color)
|
||||
meny.add_widget(AvatarSampleWidget(source='./images/avatar.png'))
|
||||
meny.bind(on_press = partial(self.sent_detail, item['lastactiontime']))
|
||||
self.ids.ml.add_widget(meny)
|
||||
carousel = Carousel(direction='right')
|
||||
carousel.height = 150
|
||||
carousel.size_hint_y = None
|
||||
carousel.ignore_perpendicular_swipes = True
|
||||
carousel.data_index = 0
|
||||
carousel.min_move = 0.2
|
||||
del_btn = Button(text='Delete')
|
||||
del_btn.background_color = (1, 0, 0, .5)
|
||||
del_btn.bind(on_press=partial(self.delete, item['lastactiontime']))
|
||||
carousel.add_widget(del_btn)
|
||||
carousel.add_widget(meny)
|
||||
ach_btn = Button(text='Achieve')
|
||||
ach_btn.background_color = (0,1,0,1)
|
||||
ach_btn.bind(on_press=partial(self.archive, item['lastactiontime']))
|
||||
carousel.add_widget(ach_btn)
|
||||
carousel.index=1
|
||||
self.ids.ml.add_widget(carousel)
|
||||
# self.ids.ml.add_widget(meny)
|
||||
else:
|
||||
content = MDLabel(font_style='Body1',
|
||||
theme_text_color='Primary',
|
||||
|
@ -433,14 +515,37 @@ class Sent(Screen):
|
|||
self.ids.ml.add_widget(content)
|
||||
|
||||
def sent_detail(self, lastsenttime, *args):
|
||||
"""Load sent mail details"""
|
||||
state.detailPageType = 'sent'
|
||||
state.sentMailTime = lastsenttime
|
||||
if self.manager:
|
||||
src_mng_obj = self.manager
|
||||
else:
|
||||
src_mng_obj = self.parent.parent
|
||||
src_mng_obj.screens[13].clear_widgets()
|
||||
src_mng_obj.screens[13].add_widget(SentDetail())
|
||||
src_mng_obj.current = 'sentdetail'
|
||||
src_mng_obj.screens[13].add_widget(MailDetail())
|
||||
src_mng_obj.current = 'mailDetail'
|
||||
|
||||
def delete(self, data_index, instance, *args):
|
||||
"""delete sent mail from sent mail listing"""
|
||||
sqlExecute("UPDATE sent SET folder = 'trash' WHERE lastactiontime = {};".format(data_index))
|
||||
self.ids.ml.remove_widget(instance.parent.parent)
|
||||
self.update_trash()
|
||||
|
||||
def archive(self, data_index, instance, *args):
|
||||
"""archive sent mail from sent mail listing"""
|
||||
sqlExecute("UPDATE sent SET folder = 'trash' WHERE lastactiontime = {};".format(data_index))
|
||||
self.ids.ml.remove_widget(instance.parent.parent)
|
||||
self.update_trash()
|
||||
|
||||
def update_trash(self):
|
||||
"""Update trash screen mails which is deleted from inbox"""
|
||||
try:
|
||||
self.parent.screens[4].clear_widgets()
|
||||
self.parent.screens[4].add_widget(Trash())
|
||||
except Exception as e:
|
||||
self.parent.parent.screens[4].clear_widgets()
|
||||
self.parent.parent.screens[4].add_widget(Trash())
|
||||
|
||||
|
||||
class Trash(Screen):
|
||||
|
@ -451,22 +556,14 @@ class Trash(Screen):
|
|||
|
||||
def init_ui(self, dt=0):
|
||||
"""Clock Schdule for method inbox accounts."""
|
||||
data = [{'text': "neha cis", 'secondary_text': "party invitation..........." + '\n' + " " + "lets gather for party on 1st JANUARY...!"},
|
||||
{'text': "onkar", 'secondary_text': "party invitation..........." + '\n' + " " + "lets gather for party on 1st JANUARY...!"},
|
||||
{'text': "amazon", 'secondary_text': "party invitation..........." + '\n' + " " + "lets gather for party on 1st JANUARY...!"},
|
||||
{'text': "paytm", 'secondary_text': "party invitation..........." + '\n' + " " + "lets gather for party on 1st JANUARY...!"},
|
||||
{'text': "pol", 'secondary_text': "party invitation..........." + '\n' + " " + "lets gather for party on 1st JANUARY...!"},
|
||||
{'text': "akshayaura", 'secondary_text': "party invitation..........." + '\n' + " " + "lets gather for party on 1st JANUARY...!"},
|
||||
{'text': "codementor", 'secondary_text': "party invitation..........." + '\n' + " " + "lets gather for party on 1st JANUARY...!"},
|
||||
{'text': "yatra", 'secondary_text': "party invitation..........." + '\n' + " " + "lets gather for party on 1st JANUARY...!"},
|
||||
{'text': "mdtezm", 'secondary_text': "party invitation..........." + '\n' + " " + "lets gather for party on 1st JANUARY...!"},
|
||||
{'text': "crewqt", 'secondary_text': "party invitation..........." + '\n' + " " + "lets gather for party on 1st JANUARY...!"}]
|
||||
for item in data:
|
||||
meny = ThreeLineAvatarIconListItem(text=item['text'], secondary_text=item['secondary_text'], theme_text_color= 'Custom',text_color=NavigateApp().theme_cls.primary_color)
|
||||
inbox = sqlQuery("SELECT toaddress, fromaddress, subject, message from inbox WHERE folder = 'trash';")
|
||||
sent = sqlQuery("SELECT toaddress, fromaddress, subject, message from sent WHERE folder = 'trash';")
|
||||
trash_data = inbox + sent
|
||||
for item in trash_data:
|
||||
meny = ThreeLineAvatarIconListItem(text=item[1], secondary_text=item[2], theme_text_color= 'Custom',text_color=NavigateApp().theme_cls.primary_color)
|
||||
meny.add_widget(AvatarSampleWidget(source='./images/avatar.png'))
|
||||
self.ids.ml.add_widget(meny)
|
||||
|
||||
|
||||
class Page(Screen):
|
||||
pass
|
||||
|
||||
|
@ -493,7 +590,7 @@ class NavigateApp(App):
|
|||
theme_cls = ThemeManager()
|
||||
previous_date = ObjectProperty()
|
||||
obj_1 = ObjectProperty()
|
||||
# obj_2 = ObjectProperty()
|
||||
obj_2 = ObjectProperty()
|
||||
variable_1 = ListProperty(BMConfigParser().addresses())
|
||||
nav_drawer = ObjectProperty()
|
||||
total_sentmail = str(state.totalSentMail)
|
||||
|
@ -523,10 +620,11 @@ class NavigateApp(App):
|
|||
os.path.join(os.path.dirname(__file__), 'main.kv'))
|
||||
self.nav_drawer = Navigatorss()
|
||||
self.obj_1 = AddressBook()
|
||||
# self.obj_2 = MyAddress()
|
||||
self.obj_2 = MyAddress()
|
||||
kivysignalthread = UIkivySignaler()
|
||||
kivysignalthread.daemon = True
|
||||
kivysignalthread.start()
|
||||
Window.bind(on_keyboard=self.on_key)
|
||||
return main_widget
|
||||
|
||||
def run(self):
|
||||
|
@ -541,7 +639,6 @@ class NavigateApp(App):
|
|||
shutdown.doCleanShutdown()
|
||||
|
||||
def show_address_success(self):
|
||||
print("9062 I am pressed...............................................................")
|
||||
content = MDLabel(font_style='Body1',
|
||||
theme_text_color='Secondary',
|
||||
text="Successfully Saved your contact address. "
|
||||
|
@ -555,6 +652,7 @@ class NavigateApp(App):
|
|||
def showmeaddresses(name="text"):
|
||||
"""Show the addresses in spinner to make as dropdown."""
|
||||
if name == "text":
|
||||
# return BMConfigParser().get(BMConfigParser().addresses()[0], 'label')[:12] + '..'
|
||||
if bmconfigparserigParser().addresses():
|
||||
return BMConfigParser().addresses()[0][:16] + '..'
|
||||
else:
|
||||
|
@ -574,6 +672,7 @@ class NavigateApp(App):
|
|||
self.root.ids.sc1.add_widget(Inbox())
|
||||
self.root.ids.sc4.add_widget(Sent())
|
||||
self.root.ids.sc5.add_widget(Trash())
|
||||
self.root.ids.scr_mngr.current = 'inbox'
|
||||
|
||||
def getInboxMessageDetail(self, instance):
|
||||
"""It will get message detail after make selected message description."""
|
||||
|
@ -605,14 +704,29 @@ class NavigateApp(App):
|
|||
return True
|
||||
return False
|
||||
|
||||
def prnttttttttttttt(self):
|
||||
pass
|
||||
|
||||
def limit_spinner(self):
|
||||
max = 2.8
|
||||
spinner_obj =ContentNavigationDrawer().ids.btn
|
||||
spinner_obj = ContentNavigationDrawer().ids.btn
|
||||
spinner_obj.dropdown_cls.max_height = spinner_obj.height* max + max * 4
|
||||
|
||||
def on_key(self, window, key, *args):
|
||||
if key == 27: # the esc key
|
||||
if self.root.ids.scr_mngr.current_screen.name == "mailDetail":
|
||||
self.root.ids.scr_mngr.current = 'sent'
|
||||
# this is for direction of the screen comesup
|
||||
# self.root.ids.scr_mngr.transition.direction = 'right'
|
||||
return True
|
||||
elif self.root.ids.scr_mngr.current_screen.name == "create":
|
||||
self.root.ids.scr_mngr.current = 'inbox'
|
||||
return True
|
||||
else:
|
||||
return True
|
||||
|
||||
def status_dispatching(self, data):
|
||||
ackData, message = data
|
||||
if state.ackdata == ackData:
|
||||
state.status.status = message
|
||||
|
||||
|
||||
class GrashofPopup(Popup):
|
||||
def __init__(self, **kwargs):
|
||||
|
@ -685,22 +799,58 @@ class NavigationDrawerTwoLineListItem(
|
|||
pass
|
||||
|
||||
|
||||
class SentDetail(Screen):
|
||||
"""SentDetail Screen uses to show the detail of mails."""
|
||||
class MailDetail(Screen):
|
||||
"""MailDetail Screen uses to show the detail of mails."""
|
||||
to_addr = StringProperty()
|
||||
from_addr = StringProperty()
|
||||
subject = StringProperty()
|
||||
message = StringProperty()
|
||||
status = StringProperty()
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(SentDetail, self).__init__(*args, **kwargs)
|
||||
super(MailDetail, self).__init__(*args, **kwargs)
|
||||
Clock.schedule_once(self.init_ui, 0)
|
||||
|
||||
def init_ui(self, dt=0):
|
||||
"""Clock Schdule for method SentDetail mails."""
|
||||
data = sqlQuery("select toaddress, fromaddress, subject, message from sent where lastactiontime = {};".format(state.sentMailTime))
|
||||
if data:
|
||||
self.to_addr = data[0][0]
|
||||
self.from_addr = data[0][1]
|
||||
self.subject = data[0][2].upper()
|
||||
self.message = data[0][3]
|
||||
"""Clock Schdule for method MailDetail mails."""
|
||||
if state.detailPageType == 'sent':
|
||||
data = sqlQuery("select toaddress, fromaddress, subject, message , status, ackdata from sent where lastactiontime = {};".format(state.sentMailTime))
|
||||
state.status = self
|
||||
state.ackdata = data[0][5]
|
||||
self.assign_mail_details(data)
|
||||
elif state.detailPageType == 'inbox':
|
||||
data = sqlQuery("select toaddress, fromaddress, subject, message from inbox where received = {};".format(state.sentMailTime))
|
||||
self.assign_mail_details(data)
|
||||
|
||||
def assign_mail_details(self, data):
|
||||
self.to_addr = data[0][0]
|
||||
self.from_addr = data[0][1]
|
||||
self.subject = data[0][2].upper()
|
||||
self.message = data[0][3]
|
||||
if len(data[0]) == 6:
|
||||
self.status = data[0][4]
|
||||
|
||||
def delete_mail(self):
|
||||
if state.detailPageType == 'sent':
|
||||
sqlExecute("UPDATE sent SET folder = 'trash' WHERE lastactiontime = {};".format(state.sentMailTime))
|
||||
self.parent.parent.screens[3].clear_widgets()
|
||||
self.parent.parent.screens[3].add_widget(Sent())
|
||||
self.parent.parent.current = 'sent'
|
||||
self.parent.parent.screens[4].clear_widgets()
|
||||
self.parent.parent.screens[4].add_widget(Trash())
|
||||
|
||||
|
||||
class MyaddDetailPopup(Popup):
|
||||
"""MyaddDetailPopup pop is used for showing my address detail"""
|
||||
address_label = StringProperty()
|
||||
address = StringProperty()
|
||||
|
||||
def __init__(self, **kwargs):
|
||||
super(MyaddDetailPopup, self).__init__(**kwargs)
|
||||
self.size_hint_y = 0.4
|
||||
self.size_hint_x = 0.9
|
||||
|
||||
def get_address(self, address):
|
||||
"""Getting address for displaying details on popup"""
|
||||
self.address_label = BMConfigParser().get(address, 'label') if BMConfigParser().get(address, 'label') else ''
|
||||
self.address = address
|
|
@ -18,6 +18,8 @@ class UIkivySignaler(Thread):
|
|||
state.kivyapp.variable_1.append(address)
|
||||
elif command == 'rerenderAddressBook':
|
||||
state.kivyapp.obj_1.refreshs()
|
||||
elif command == 'updateSentItemStatusByAckdata':
|
||||
state.kivyapp.status_dispatching(data)
|
||||
|
||||
except Exception as e:
|
||||
print(e)
|
||||
|
|
|
@ -78,6 +78,10 @@ totalSentMail = 0
|
|||
|
||||
sentMailTime = 0
|
||||
|
||||
dynamicAddressList = []
|
||||
myAddressObj = None
|
||||
|
||||
myAddressObj = None
|
||||
detailPageType = None
|
||||
|
||||
ackdata = None
|
||||
|
||||
status = None
|
|
@ -13,8 +13,11 @@ class translateClass:
|
|||
else:
|
||||
return self.text
|
||||
|
||||
# def _translate(context, text, disambiguation = None, encoding = None, n = None):
|
||||
# return translateText(context, text, n)
|
||||
|
||||
def _translate(context, text, disambiguation = None, encoding = None, n = None):
|
||||
return translateText(context, text, n)
|
||||
return text
|
||||
|
||||
def translateText(context, text, n = None):
|
||||
try:
|
||||
|
|
Reference in New Issue
Block a user