Merge pull request #71 from navjotcis/newwork
worked on implementing screen identifier tag feature
This commit is contained in:
commit
6913fc57ab
|
@ -16,6 +16,7 @@
|
||||||
#:import MDScrollViewRefreshLayout kivymd.refreshlayout.MDScrollViewRefreshLayout
|
#:import MDScrollViewRefreshLayout kivymd.refreshlayout.MDScrollViewRefreshLayout
|
||||||
#:import MDSpinner kivymd.spinner.MDSpinner
|
#:import MDSpinner kivymd.spinner.MDSpinner
|
||||||
#:import NoTransition kivy.uix.screenmanager.NoTransition
|
#:import NoTransition kivy.uix.screenmanager.NoTransition
|
||||||
|
#:import MDSeparator kivymd.card.MDSeparator
|
||||||
|
|
||||||
#:set color_button (0.784, 0.443, 0.216, 1) # brown
|
#:set color_button (0.784, 0.443, 0.216, 1) # brown
|
||||||
#:set color_button_pressed (0.659, 0.522, 0.431, 1) # darker brown
|
#:set color_button_pressed (0.659, 0.522, 0.431, 1) # darker brown
|
||||||
|
@ -202,8 +203,18 @@ NavigationLayout:
|
||||||
transition: NoTransition()
|
transition: NoTransition()
|
||||||
BoxLayout:
|
BoxLayout:
|
||||||
orientation: 'vertical'
|
orientation: 'vertical'
|
||||||
spacing: dp(10)
|
spacing: dp(5)
|
||||||
SearchBar:
|
SearchBar:
|
||||||
|
GridLayout:
|
||||||
|
id: identi_tag
|
||||||
|
padding: [20, 0, 0, 5]
|
||||||
|
cols: 1
|
||||||
|
size_hint_y: None
|
||||||
|
height: self.minimum_height
|
||||||
|
MDLabel:
|
||||||
|
text: ''
|
||||||
|
font_style: 'Body1'
|
||||||
|
bold: True
|
||||||
#FloatLayout:
|
#FloatLayout:
|
||||||
# MDScrollViewRefreshLayout:
|
# MDScrollViewRefreshLayout:
|
||||||
# id: refresh_layout
|
# id: refresh_layout
|
||||||
|
@ -225,7 +236,18 @@ NavigationLayout:
|
||||||
name: 'sent'
|
name: 'sent'
|
||||||
BoxLayout:
|
BoxLayout:
|
||||||
orientation: 'vertical'
|
orientation: 'vertical'
|
||||||
|
spacing: dp(5)
|
||||||
SearchBar:
|
SearchBar:
|
||||||
|
GridLayout:
|
||||||
|
id: identi_tag
|
||||||
|
padding: [20, 0, 0, 5]
|
||||||
|
cols: 1
|
||||||
|
size_hint_y: None
|
||||||
|
height: self.minimum_height
|
||||||
|
MDLabel:
|
||||||
|
text: ''
|
||||||
|
font_style: 'Body1'
|
||||||
|
bold: True
|
||||||
BoxLayout:
|
BoxLayout:
|
||||||
orientation:'vertical'
|
orientation:'vertical'
|
||||||
ScrollView:
|
ScrollView:
|
||||||
|
@ -238,21 +260,52 @@ NavigationLayout:
|
||||||
|
|
||||||
<Trash>:
|
<Trash>:
|
||||||
name: 'trash'
|
name: 'trash'
|
||||||
ScrollView:
|
BoxLayout:
|
||||||
id: scroll_y
|
orientation: 'vertical'
|
||||||
do_scroll_x: False
|
spacing: dp(5)
|
||||||
MDList:
|
GridLayout:
|
||||||
id: ml
|
id: identi_tag
|
||||||
|
padding: [20, 20, 0, 5]
|
||||||
|
spacing: dp(5)
|
||||||
|
cols: 1
|
||||||
|
size_hint_y: None
|
||||||
|
height: self.minimum_height
|
||||||
|
MDLabel:
|
||||||
|
text: ''
|
||||||
|
font_style: 'Body1'
|
||||||
|
bold: True
|
||||||
|
BoxLayout:
|
||||||
|
orientation:'vertical'
|
||||||
|
ScrollView:
|
||||||
|
id: scroll_y
|
||||||
|
do_scroll_x: False
|
||||||
|
MDList:
|
||||||
|
id: ml
|
||||||
Loader:
|
Loader:
|
||||||
ComposerButton:
|
ComposerButton:
|
||||||
|
|
||||||
<Draft>:
|
<Draft>:
|
||||||
name: 'draft'
|
name: 'draft'
|
||||||
ScrollView:
|
BoxLayout:
|
||||||
id: scroll_y
|
orientation: 'vertical'
|
||||||
do_scroll_x: False
|
spacing: dp(5)
|
||||||
MDList:
|
GridLayout:
|
||||||
id: ml
|
id: identi_tag
|
||||||
|
padding: [20, 20, 0, 5]
|
||||||
|
cols: 1
|
||||||
|
size_hint_y: None
|
||||||
|
height: self.minimum_height
|
||||||
|
MDLabel:
|
||||||
|
text: ''
|
||||||
|
font_style: 'Body1'
|
||||||
|
bold: True
|
||||||
|
BoxLayout:
|
||||||
|
orientation:'vertical'
|
||||||
|
ScrollView:
|
||||||
|
id: scroll_y
|
||||||
|
do_scroll_x: False
|
||||||
|
MDList:
|
||||||
|
id: ml
|
||||||
ComposerButton:
|
ComposerButton:
|
||||||
|
|
||||||
<Starred>:
|
<Starred>:
|
||||||
|
@ -289,12 +342,26 @@ NavigationLayout:
|
||||||
# MDList:
|
# MDList:
|
||||||
# id: ml
|
# id: ml
|
||||||
BoxLayout:
|
BoxLayout:
|
||||||
orientation:'vertical'
|
orientation: 'vertical'
|
||||||
ScrollView:
|
spacing: dp(5)
|
||||||
id: scroll_y
|
GridLayout:
|
||||||
do_scroll_x: False
|
id: identi_tag
|
||||||
MDList:
|
padding: [20, 20, 0, 5]
|
||||||
id: ml
|
spacing: dp(5)
|
||||||
|
cols: 1
|
||||||
|
size_hint_y: None
|
||||||
|
height: self.minimum_height
|
||||||
|
MDLabel:
|
||||||
|
text: ''
|
||||||
|
font_style: 'Body1'
|
||||||
|
bold: True
|
||||||
|
BoxLayout:
|
||||||
|
orientation:'vertical'
|
||||||
|
ScrollView:
|
||||||
|
id: scroll_y
|
||||||
|
do_scroll_x: False
|
||||||
|
MDList:
|
||||||
|
id: ml
|
||||||
Loader:
|
Loader:
|
||||||
ComposerButton:
|
ComposerButton:
|
||||||
|
|
||||||
|
@ -495,7 +562,6 @@ NavigationLayout:
|
||||||
BoxLayout:
|
BoxLayout:
|
||||||
AnchorLayout:
|
AnchorLayout:
|
||||||
MDRaisedButton:
|
MDRaisedButton:
|
||||||
size_hint: .5, .35
|
|
||||||
height: dp(40)
|
height: dp(40)
|
||||||
on_press: app.root.ids.scr_mngr.current = 'random'
|
on_press: app.root.ids.scr_mngr.current = 'random'
|
||||||
on_press: app.root.ids.sc7.reset_address_label()
|
on_press: app.root.ids.sc7.reset_address_label()
|
||||||
|
@ -541,7 +607,6 @@ NavigationLayout:
|
||||||
BoxLayout:
|
BoxLayout:
|
||||||
AnchorLayout:
|
AnchorLayout:
|
||||||
MDRaisedButton:
|
MDRaisedButton:
|
||||||
size_hint: .5, None
|
|
||||||
height: dp(40)
|
height: dp(40)
|
||||||
on_release: root.generateaddress(app)
|
on_release: root.generateaddress(app)
|
||||||
opposite_colors: True
|
opposite_colors: True
|
||||||
|
@ -627,7 +692,18 @@ NavigationLayout:
|
||||||
name: 'myaddress'
|
name: 'myaddress'
|
||||||
BoxLayout:
|
BoxLayout:
|
||||||
orientation: 'vertical'
|
orientation: 'vertical'
|
||||||
|
spacing: dp(5)
|
||||||
SearchBar:
|
SearchBar:
|
||||||
|
GridLayout:
|
||||||
|
id: identi_tag
|
||||||
|
padding: [20, 0, 0, 5]
|
||||||
|
cols: 1
|
||||||
|
size_hint_y: None
|
||||||
|
height: self.minimum_height
|
||||||
|
MDLabel:
|
||||||
|
text: 'My Addresses'
|
||||||
|
font_style: 'Body1'
|
||||||
|
bold: True
|
||||||
FloatLayout:
|
FloatLayout:
|
||||||
MDScrollViewRefreshLayout:
|
MDScrollViewRefreshLayout:
|
||||||
id: refresh_layout
|
id: refresh_layout
|
||||||
|
@ -642,7 +718,18 @@ NavigationLayout:
|
||||||
name: 'addressbook'
|
name: 'addressbook'
|
||||||
BoxLayout:
|
BoxLayout:
|
||||||
orientation: 'vertical'
|
orientation: 'vertical'
|
||||||
|
spacing: dp(5)
|
||||||
SearchBar:
|
SearchBar:
|
||||||
|
GridLayout:
|
||||||
|
id: identi_tag
|
||||||
|
padding: [20, 0, 0, 5]
|
||||||
|
cols: 1
|
||||||
|
size_hint_y: None
|
||||||
|
height: self.minimum_height
|
||||||
|
MDLabel:
|
||||||
|
text: ''
|
||||||
|
font_style: 'Body1'
|
||||||
|
bold: True
|
||||||
BoxLayout:
|
BoxLayout:
|
||||||
orientation:'vertical'
|
orientation:'vertical'
|
||||||
ScrollView:
|
ScrollView:
|
||||||
|
@ -803,7 +890,7 @@ NavigationLayout:
|
||||||
id: popup
|
id: popup
|
||||||
size_hint : (None,None)
|
size_hint : (None,None)
|
||||||
height: 2*(label.height + address.height) + 10
|
height: 2*(label.height + address.height) + 10
|
||||||
width :app.window_size[0] - app.window_size[0]/10
|
width :app.window_size[0] - (app.window_size[0]/10 if app.app_platform == 'android' else app.window_size[0]/4)
|
||||||
title: 'add contact\'s'
|
title: 'add contact\'s'
|
||||||
background: './images/popup.jpeg'
|
background: './images/popup.jpeg'
|
||||||
title_size: sp(20)
|
title_size: sp(20)
|
||||||
|
@ -1036,7 +1123,7 @@ NavigationLayout:
|
||||||
id: myadd_popup
|
id: myadd_popup
|
||||||
size_hint : (None,None)
|
size_hint : (None,None)
|
||||||
height: 4.5*(myaddr_label.height+ my_add_btn.children[0].height)
|
height: 4.5*(myaddr_label.height+ my_add_btn.children[0].height)
|
||||||
width :app.window_size[0] - app.window_size[0]/10
|
width :app.window_size[0] - (app.window_size[0]/10 if app.app_platform == 'android' else app.window_size[0]/4)
|
||||||
background: './images/popup.jpeg'
|
background: './images/popup.jpeg'
|
||||||
auto_dismiss: False
|
auto_dismiss: False
|
||||||
separator_height: 0
|
separator_height: 0
|
||||||
|
@ -1116,7 +1203,7 @@ NavigationLayout:
|
||||||
id: addbook_popup
|
id: addbook_popup
|
||||||
size_hint : (None,None)
|
size_hint : (None,None)
|
||||||
height: 4*(add_label.height)
|
height: 4*(add_label.height)
|
||||||
width :app.window_size[0] - app.window_size[0]/10
|
width :app.window_size[0] - (app.window_size[0]/10 if app.app_platform == 'android' else app.window_size[0]/4)
|
||||||
background: './images/popup.jpeg'
|
background: './images/popup.jpeg'
|
||||||
separator_height: 0
|
separator_height: 0
|
||||||
auto_dismiss: False
|
auto_dismiss: False
|
||||||
|
|
|
@ -114,7 +114,9 @@ class Inbox(Screen):
|
||||||
xAddress = 'toaddress'
|
xAddress = 'toaddress'
|
||||||
data = []
|
data = []
|
||||||
self.inboxDataQuery(xAddress, where, what)
|
self.inboxDataQuery(xAddress, where, what)
|
||||||
|
self.ids.identi_tag.children[0].text = ''
|
||||||
if self.queryreturn:
|
if self.queryreturn:
|
||||||
|
self.ids.identi_tag.children[0].text = 'Inbox'
|
||||||
state.kivyapp.get_inbox_count()
|
state.kivyapp.get_inbox_count()
|
||||||
src_mng_obj = state.kivyapp.root.children[2].children[0].ids
|
src_mng_obj = state.kivyapp.root.children[2].children[0].ids
|
||||||
src_mng_obj.inbox_cnt.badge_text = state.inbox_count
|
src_mng_obj.inbox_cnt.badge_text = state.inbox_count
|
||||||
|
@ -261,6 +263,8 @@ class Inbox(Screen):
|
||||||
int(state.trash_count) + 1)
|
int(state.trash_count) + 1)
|
||||||
state.all_count = str(
|
state.all_count = str(
|
||||||
int(state.all_count) - 1)
|
int(state.all_count) - 1)
|
||||||
|
if int(state.inbox_count) <= 0:
|
||||||
|
self.ids.identi_tag.children[0].text = ''
|
||||||
self.ids.ml.remove_widget(
|
self.ids.ml.remove_widget(
|
||||||
instance.parent.parent)
|
instance.parent.parent)
|
||||||
toast('Deleted')
|
toast('Deleted')
|
||||||
|
@ -326,7 +330,9 @@ class MyAddress(Screen):
|
||||||
addr), BMConfigParser().addresses())
|
addr), BMConfigParser().addresses())
|
||||||
self.addresses_list = filtered_list
|
self.addresses_list = filtered_list
|
||||||
self.addresses_list = [obj for obj in reversed(self.addresses_list)]
|
self.addresses_list = [obj for obj in reversed(self.addresses_list)]
|
||||||
|
self.ids.identi_tag.children[0].text = ''
|
||||||
if self.addresses_list:
|
if self.addresses_list:
|
||||||
|
self.ids.identi_tag.children[0].text = 'My Addresses'
|
||||||
self.has_refreshed = True
|
self.has_refreshed = True
|
||||||
self.set_mdList(0, 15)
|
self.set_mdList(0, 15)
|
||||||
self.ids.refresh_layout.bind(scroll_y=self.check_scroll_y)
|
self.ids.refresh_layout.bind(scroll_y=self.check_scroll_y)
|
||||||
|
@ -398,7 +404,7 @@ class MyAddress(Screen):
|
||||||
"""Method used for loading the myaddress screen data"""
|
"""Method used for loading the myaddress screen data"""
|
||||||
state.searcing_text = ''
|
state.searcing_text = ''
|
||||||
state.kivyapp.root.ids.sc10.children[2].active = False
|
state.kivyapp.root.ids.sc10.children[2].active = False
|
||||||
self.children[2].children[1].ids.search_field.text = ''
|
self.children[2].children[2].ids.search_field.text = ''
|
||||||
self.has_refreshed = True
|
self.has_refreshed = True
|
||||||
self.ids.ml.clear_widgets()
|
self.ids.ml.clear_widgets()
|
||||||
self.init_ui()
|
self.init_ui()
|
||||||
|
@ -443,10 +449,12 @@ class AddressBook(Screen):
|
||||||
where = ['label', 'address']
|
where = ['label', 'address']
|
||||||
what = state.searcing_text
|
what = state.searcing_text
|
||||||
xAddress = ''
|
xAddress = ''
|
||||||
|
self.ids.identi_tag.children[0].text = ''
|
||||||
self.queryreturn = kivy_helper_search.search_sql(
|
self.queryreturn = kivy_helper_search.search_sql(
|
||||||
xAddress, account, "addressbook", where, what, False)
|
xAddress, account, "addressbook", where, what, False)
|
||||||
self.queryreturn = [obj for obj in reversed(self.queryreturn)]
|
self.queryreturn = [obj for obj in reversed(self.queryreturn)]
|
||||||
if self.queryreturn:
|
if self.queryreturn:
|
||||||
|
self.ids.identi_tag.children[0].text = 'Address Book'
|
||||||
self.has_refreshed = True
|
self.has_refreshed = True
|
||||||
self.set_mdList(0, 20)
|
self.set_mdList(0, 20)
|
||||||
self.ids.scroll_y.bind(scroll_y=self.check_scroll_y)
|
self.ids.scroll_y.bind(scroll_y=self.check_scroll_y)
|
||||||
|
@ -523,6 +531,8 @@ class AddressBook(Screen):
|
||||||
def delete_address(self, address, instance, *args):
|
def delete_address(self, address, instance, *args):
|
||||||
"""Delete inbox mail from inbox listing"""
|
"""Delete inbox mail from inbox listing"""
|
||||||
self.ids.ml.remove_widget(instance.parent.parent)
|
self.ids.ml.remove_widget(instance.parent.parent)
|
||||||
|
if len(self.ids.ml.children) == 0:
|
||||||
|
self.ids.identi_tag.children[0].text = ''
|
||||||
sqlExecute(
|
sqlExecute(
|
||||||
"DELETE FROM addressbook WHERE address = '{}';".format(address))
|
"DELETE FROM addressbook WHERE address = '{}';".format(address))
|
||||||
|
|
||||||
|
@ -680,9 +690,10 @@ 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):
|
||||||
"""Generates error message"""
|
"""Generates error message"""
|
||||||
|
width = .8 if platform == 'android' else .55
|
||||||
msg_dialog = MDDialog(
|
msg_dialog = MDDialog(
|
||||||
text=msg,
|
text=msg,
|
||||||
title='', size_hint=(.8, .25), text_button_ok='Ok',
|
title='', size_hint=(width, .25), text_button_ok='Ok',
|
||||||
events_callback=self.callback_for_menu_items)
|
events_callback=self.callback_for_menu_items)
|
||||||
msg_dialog.open()
|
msg_dialog.open()
|
||||||
|
|
||||||
|
@ -899,8 +910,10 @@ class Sent(Screen):
|
||||||
what = state.searcing_text
|
what = state.searcing_text
|
||||||
xAddress = 'fromaddress'
|
xAddress = 'fromaddress'
|
||||||
data = []
|
data = []
|
||||||
|
self.ids.identi_tag.children[0].text = ''
|
||||||
self.sentDataQuery(xAddress, where, what)
|
self.sentDataQuery(xAddress, where, what)
|
||||||
if self.queryreturn:
|
if self.queryreturn:
|
||||||
|
self.ids.identi_tag.children[0].text = 'Sent'
|
||||||
self.set_sentCount(state.sent_count)
|
self.set_sentCount(state.sent_count)
|
||||||
for mail in self.queryreturn:
|
for mail in self.queryreturn:
|
||||||
data.append({
|
data.append({
|
||||||
|
@ -1063,6 +1076,8 @@ class Sent(Screen):
|
||||||
state.sent_count = str(int(state.sent_count) - 1)
|
state.sent_count = str(int(state.sent_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)
|
||||||
|
if int(state.sent_count) <= 0:
|
||||||
|
self.ids.identi_tag.children[0].text = ''
|
||||||
sqlExecute(
|
sqlExecute(
|
||||||
"UPDATE sent SET folder = 'trash'"
|
"UPDATE sent SET folder = 'trash'"
|
||||||
" WHERE ackdata = ?;", str(data_index))
|
" WHERE ackdata = ?;", str(data_index))
|
||||||
|
@ -1109,8 +1124,10 @@ class Trash(Screen):
|
||||||
if state.association == '':
|
if state.association == '':
|
||||||
if BMConfigParser().addresses():
|
if BMConfigParser().addresses():
|
||||||
state.association = BMConfigParser().addresses()[0]
|
state.association = BMConfigParser().addresses()[0]
|
||||||
|
self.ids.identi_tag.children[0].text = ''
|
||||||
self.trashDataQuery(0, 20)
|
self.trashDataQuery(0, 20)
|
||||||
if self.trash_messages:
|
if self.trash_messages:
|
||||||
|
self.ids.identi_tag.children[0].text = 'Trash'
|
||||||
src_mng_obj = state.kivyapp.root.children[2].children[0].ids
|
src_mng_obj = state.kivyapp.root.children[2].children[0].ids
|
||||||
src_mng_obj.trash_cnt.badge_text = state.trash_count
|
src_mng_obj.trash_cnt.badge_text = state.trash_count
|
||||||
self.set_mdList()
|
self.set_mdList()
|
||||||
|
@ -1202,11 +1219,12 @@ class Trash(Screen):
|
||||||
|
|
||||||
def delete_confirmation(self):
|
def delete_confirmation(self):
|
||||||
"""Show confirmation delete popup"""
|
"""Show confirmation delete popup"""
|
||||||
|
width = .8 if platform == 'android' else .55
|
||||||
delete_msg_dialog = MDDialog(
|
delete_msg_dialog = MDDialog(
|
||||||
text='Are you sure you want to delete this'
|
text='Are you sure you want to delete this'
|
||||||
' message permanently from trash?',
|
' message permanently from trash?',
|
||||||
title='',
|
title='',
|
||||||
size_hint=(.8, .25),
|
size_hint=(width, .25),
|
||||||
text_button_ok='Yes',
|
text_button_ok='Yes',
|
||||||
text_button_cancel='No',
|
text_button_cancel='No',
|
||||||
events_callback=self.callback_for_delete_msg)
|
events_callback=self.callback_for_delete_msg)
|
||||||
|
@ -1269,6 +1287,7 @@ class NavigateApp(App): # pylint: disable=too-many-public-methods
|
||||||
nav_drawer = ObjectProperty()
|
nav_drawer = ObjectProperty()
|
||||||
state.screen_density = Window.size
|
state.screen_density = Window.size
|
||||||
window_size = state.screen_density
|
window_size = state.screen_density
|
||||||
|
app_platform = platform
|
||||||
title = "PyBitmessage"
|
title = "PyBitmessage"
|
||||||
imgstatus = False
|
imgstatus = False
|
||||||
count = 0
|
count = 0
|
||||||
|
@ -1338,7 +1357,7 @@ class NavigateApp(App): # pylint: disable=too-many-public-methods
|
||||||
self.root.ids.sc1.loadMessagelist(state.association)
|
self.root.ids.sc1.loadMessagelist(state.association)
|
||||||
|
|
||||||
self.root.ids.sc4.ids.ml.clear_widgets()
|
self.root.ids.sc4.ids.ml.clear_widgets()
|
||||||
self.root.ids.sc4.children[2].children[1].ids.search_field.text = ''
|
self.root.ids.sc4.children[2].children[2].ids.search_field.text = ''
|
||||||
self.root.ids.sc4.loadSent(state.association)
|
self.root.ids.sc4.loadSent(state.association)
|
||||||
|
|
||||||
self.root.ids.sc16.clear_widgets()
|
self.root.ids.sc16.clear_widgets()
|
||||||
|
@ -1429,7 +1448,8 @@ class NavigateApp(App): # pylint: disable=too-many-public-methods
|
||||||
elif self.root.ids.scr_mngr.current == "random":
|
elif self.root.ids.scr_mngr.current == "random":
|
||||||
self.root.ids.scr_mngr.current = 'login'
|
self.root.ids.scr_mngr.current = 'login'
|
||||||
else:
|
else:
|
||||||
self.root.ids.scr_mngr.current = 'inbox'
|
if state.kivyapp.variable_1:
|
||||||
|
self.root.ids.scr_mngr.current = '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)
|
||||||
return True
|
return True
|
||||||
|
@ -1643,30 +1663,30 @@ class NavigateApp(App): # pylint: disable=too-many-public-methods
|
||||||
if state.search_screen == 'inbox':
|
if state.search_screen == 'inbox':
|
||||||
try:
|
try:
|
||||||
self.root.ids.sc1.children[
|
self.root.ids.sc1.children[
|
||||||
3].children[1].ids.search_field.text = ''
|
3].children[2].ids.search_field.text = ''
|
||||||
except Exception:
|
except Exception:
|
||||||
self.root.ids.sc1.children[
|
self.root.ids.sc1.children[
|
||||||
2].children[1].ids.search_field.text = ''
|
2].children[2].ids.search_field.text = ''
|
||||||
self.root.ids.sc1.children[1].active = True
|
self.root.ids.sc1.children[1].active = True
|
||||||
Clock.schedule_once(self.search_callback, 0.5)
|
Clock.schedule_once(self.search_callback, 0.5)
|
||||||
elif state.search_screen == 'addressbook':
|
elif state.search_screen == 'addressbook':
|
||||||
self.root.ids.sc11.children[
|
self.root.ids.sc11.children[
|
||||||
2].children[1].ids.search_field.text = ''
|
2].children[2].ids.search_field.text = ''
|
||||||
self.root.ids.sc11.children[
|
self.root.ids.sc11.children[
|
||||||
1].active = True
|
1].active = True
|
||||||
Clock.schedule_once(self.search_callback, 0.5)
|
Clock.schedule_once(self.search_callback, 0.5)
|
||||||
elif state.search_screen == 'myaddress':
|
elif state.search_screen == 'myaddress':
|
||||||
try:
|
try:
|
||||||
self.root.ids.sc10.children[
|
self.root.ids.sc10.children[
|
||||||
3].children[1].ids.search_field.text = ''
|
3].children[2].ids.search_field.text = ''
|
||||||
except Exception:
|
except Exception:
|
||||||
self.root.ids.sc10.children[
|
self.root.ids.sc10.children[
|
||||||
2].children[1].ids.search_field.text = ''
|
2].children[2].ids.search_field.text = ''
|
||||||
self.root.ids.sc10.children[1].active = True
|
self.root.ids.sc10.children[1].active = True
|
||||||
Clock.schedule_once(self.search_callback, 0.5)
|
Clock.schedule_once(self.search_callback, 0.5)
|
||||||
else:
|
else:
|
||||||
self.root.ids.sc4.children[
|
self.root.ids.sc4.children[
|
||||||
2].children[1].ids.search_field.text = ''
|
2].children[2].ids.search_field.text = ''
|
||||||
self.root.ids.sc4.children[1].active = True
|
self.root.ids.sc4.children[1].active = True
|
||||||
Clock.schedule_once(self.search_callback, 0.5)
|
Clock.schedule_once(self.search_callback, 0.5)
|
||||||
return
|
return
|
||||||
|
@ -1760,26 +1780,6 @@ class GrashofPopup(Popup):
|
||||||
self.parent.children[1].ids.scr_mngr.current = 'addressbook'
|
self.parent.children[1].ids.scr_mngr.current = 'addressbook'
|
||||||
toast('Saved')
|
toast('Saved')
|
||||||
|
|
||||||
# pylint: disable=attribute-defined-outside-init
|
|
||||||
def show_error_message(self):
|
|
||||||
"""Showing error message"""
|
|
||||||
content = MDLabel(
|
|
||||||
font_style='Body1',
|
|
||||||
theme_text_color='Secondary',
|
|
||||||
text="Hey you are not allowed to save blank address contact. "
|
|
||||||
"That's wrong!",
|
|
||||||
size_hint_y=None,
|
|
||||||
valign='top')
|
|
||||||
content.bind(texture_size=content.setter('size'))
|
|
||||||
self.dialog = MDDialog(content=content,
|
|
||||||
size_hint=(.8, None),
|
|
||||||
height=dp(200),
|
|
||||||
auto_dismiss=False)
|
|
||||||
|
|
||||||
self.dialog.add_action_button("ok",
|
|
||||||
action=lambda *x: self.dialog.dismiss())
|
|
||||||
self.dialog.open()
|
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def close_pop():
|
def close_pop():
|
||||||
"""Pop is Canceled"""
|
"""Pop is Canceled"""
|
||||||
|
@ -1947,25 +1947,25 @@ class MailDetail(Screen):
|
||||||
self.children[0].children[0].active = True
|
self.children[0].children[0].active = True
|
||||||
if state.detailPageType == 'sent':
|
if state.detailPageType == 'sent':
|
||||||
state.kivyapp.root.ids.sc4.children[
|
state.kivyapp.root.ids.sc4.children[
|
||||||
2].children[1].ids.search_field.text = ''
|
2].children[2].ids.search_field.text = ''
|
||||||
sqlExecute(
|
sqlExecute(
|
||||||
"UPDATE sent SET folder = 'trash' WHERE"
|
"UPDATE sent SET folder = 'trash' WHERE"
|
||||||
" ackdata = ?;", str(state.mail_id))
|
" 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) if int(state.sent_count) else '0'
|
||||||
state.sent_count = str(int(state.sent_count) - 1)
|
state.sent_count = str(int(state.sent_count) - 1) if int(state.sent_count) else '0'
|
||||||
self.parent.screens[3].ids.ml.clear_widgets()
|
self.parent.screens[3].ids.ml.clear_widgets()
|
||||||
self.parent.screens[3].loadSent(state.association)
|
self.parent.screens[3].loadSent(state.association)
|
||||||
elif state.detailPageType == 'inbox':
|
elif state.detailPageType == 'inbox':
|
||||||
state.kivyapp.root.ids.sc1.children[
|
state.kivyapp.root.ids.sc1.children[
|
||||||
2].children[1].ids.search_field.text = ''
|
2].children[2].ids.search_field.text = ''
|
||||||
self.parent.screens[0].children[2].children[
|
self.parent.screens[0].children[2].children[
|
||||||
1].ids.search_field.text = ''
|
2].ids.search_field.text = ''
|
||||||
sqlExecute(
|
sqlExecute(
|
||||||
"UPDATE inbox SET folder = 'trash' WHERE"
|
"UPDATE inbox SET folder = 'trash' WHERE"
|
||||||
" msgid = ?;", str(state.mail_id))
|
" 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) if int(state.inbox_count) else '0'
|
||||||
state.inbox_count = str(int(state.inbox_count) - 1)
|
state.inbox_count = str(int(state.inbox_count) - 1) if int(state.inbox_count) else '0'
|
||||||
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)
|
||||||
|
|
||||||
|
@ -1984,13 +1984,13 @@ class MailDetail(Screen):
|
||||||
msg_count_objs.trash_cnt.badge_text = str(
|
msg_count_objs.trash_cnt.badge_text = str(
|
||||||
int(state.trash_count) + 1)
|
int(state.trash_count) + 1)
|
||||||
msg_count_objs.allmail_cnt.badge_text = str(
|
msg_count_objs.allmail_cnt.badge_text = str(
|
||||||
int(state.all_count) - 1)
|
int(state.all_count) - 1) if int(state.all_count) else '0'
|
||||||
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) if int(state.all_count) else '0'
|
||||||
self.parent.screens[4].clear_widgets()
|
self.parent.screens[4].clear_widgets()
|
||||||
self.parent.screens[4].add_widget(Trash())
|
self.parent.screens[4].add_widget(Trash())
|
||||||
self.parent.screens[16].ids.ml.clear_widgets()
|
self.parent.screens[16].clear_widgets()
|
||||||
self.parent.screens[16].init_ui(dt=0)
|
self.parent.screens[16].add_widget(Allmails())
|
||||||
Clock.schedule_once(self.callback_for_delete, 4)
|
Clock.schedule_once(self.callback_for_delete, 4)
|
||||||
|
|
||||||
def callback_for_delete(self, dt=0):
|
def callback_for_delete(self, dt=0):
|
||||||
|
@ -2182,11 +2182,13 @@ class Draft(Screen):
|
||||||
def loadDraft(self, where="", what=""):
|
def loadDraft(self, where="", what=""):
|
||||||
"""Load draft list for Draft messages."""
|
"""Load draft list for Draft messages."""
|
||||||
xAddress = 'fromaddress'
|
xAddress = 'fromaddress'
|
||||||
|
self.ids.identi_tag.children[0].text = ''
|
||||||
self.draftDataQuery(xAddress, where, what)
|
self.draftDataQuery(xAddress, where, what)
|
||||||
if state.msg_counter_objs:
|
if state.msg_counter_objs:
|
||||||
state.msg_counter_objs.draft_cnt.badge_text = str(
|
state.msg_counter_objs.draft_cnt.badge_text = str(
|
||||||
len(self.queryreturn))
|
len(self.queryreturn))
|
||||||
if self.queryreturn:
|
if self.queryreturn:
|
||||||
|
self.ids.identi_tag.children[0].text = 'Draft'
|
||||||
src_mng_obj = state.kivyapp.root.children[2].children[0].ids
|
src_mng_obj = state.kivyapp.root.children[2].children[0].ids
|
||||||
src_mng_obj.draft_cnt.badge_text = state.draft_count
|
src_mng_obj.draft_cnt.badge_text = state.draft_count
|
||||||
self.set_mdList()
|
self.set_mdList()
|
||||||
|
@ -2297,6 +2299,8 @@ class Draft(Screen):
|
||||||
msg_count_objs.draft_cnt.badge_text = str(
|
msg_count_objs.draft_cnt.badge_text = str(
|
||||||
int(state.draft_count) - 1)
|
int(state.draft_count) - 1)
|
||||||
state.draft_count = str(int(state.draft_count) - 1)
|
state.draft_count = str(int(state.draft_count) - 1)
|
||||||
|
if int(state.draft_count) <= 0:
|
||||||
|
self.ids.identi_tag.children[0].text = ''
|
||||||
self.ids.ml.remove_widget(instance.parent.parent)
|
self.ids.ml.remove_widget(instance.parent.parent)
|
||||||
toast('Deleted')
|
toast('Deleted')
|
||||||
|
|
||||||
|
@ -2376,8 +2380,10 @@ class Allmails(Screen):
|
||||||
def loadMessagelist(self):
|
def loadMessagelist(self):
|
||||||
"""Load Inbox, Sent anf Draft list of messages."""
|
"""Load Inbox, Sent anf Draft list of messages."""
|
||||||
self.account = state.association
|
self.account = state.association
|
||||||
|
self.ids.identi_tag.children[0].text = ''
|
||||||
self.allMessageQuery(0, 20)
|
self.allMessageQuery(0, 20)
|
||||||
if self.all_mails:
|
if self.all_mails:
|
||||||
|
self.ids.identi_tag.children[0].text = 'All Mails'
|
||||||
state.kivyapp.get_inbox_count()
|
state.kivyapp.get_inbox_count()
|
||||||
state.kivyapp.get_sent_count()
|
state.kivyapp.get_sent_count()
|
||||||
state.all_count = str(
|
state.all_count = str(
|
||||||
|
@ -2510,6 +2516,8 @@ class Allmails(Screen):
|
||||||
int(state.all_count) - 1)
|
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)
|
||||||
|
if int(state.all_count) <= 0:
|
||||||
|
self.ids.identi_tag.children[0].text = ''
|
||||||
nav_lay_obj.sc5.clear_widgets()
|
nav_lay_obj.sc5.clear_widgets()
|
||||||
nav_lay_obj.sc5.add_widget(Trash())
|
nav_lay_obj.sc5.add_widget(Trash())
|
||||||
nav_lay_obj.sc17.remove_widget(instance.parent.parent)
|
nav_lay_obj.sc17.remove_widget(instance.parent.parent)
|
||||||
|
|
Reference in New Issue
Block a user