Update helper_sent trash query, update common.py

This commit is contained in:
shekhar-cis 2022-07-11 18:01:26 +05:30
parent 9d28e0b70c
commit 12675ceefb
Signed by untrusted user: shekhar-cis
GPG Key ID: F4F00AB04E83F9A7
3 changed files with 22 additions and 20 deletions

View File

@ -191,15 +191,15 @@ def mdlist_message_content(queryreturn, data, max_len=25, min_len=10):
'ackdata': mail[5], 'senttime': mail[6]}) 'ackdata': mail[5], 'senttime': mail[6]})
def mail_detail_screen(screen_name, msg_id, instance, folder, *args): # def mail_detail_screen(screen_name, msg_id, instance, folder, *args):
if instance.open_progress == 0.0: # if instance.open_progress == 0.0:
state.detailPageType = folder # state.detailPageType = folder
state.mail_id = msg_id # state.mail_id = msg_id
if screen_name.manager: # if screen_name.manager:
src_mng_obj = screen_name.manager # src_mng_obj = screen_name.manager
else: # else:
src_mng_obj = screen_name.parent.parent # src_mng_obj = screen_name.parent.parent
src_mng_obj.screens[11].clear_widgets() # src_mng_obj.screens[11].clear_widgets()
from bitmessagekivy.baseclass.maildetail import MailDetail # from bitmessagekivy.baseclass.maildetail import MailDetail
src_mng_obj.screens[11].add_widget(MailDetail()) # src_mng_obj.screens[11].add_widget(MailDetail())
src_mng_obj.current = "mailDetail" # src_mng_obj.current = "mailDetail"

View File

@ -32,7 +32,6 @@ from bitmessagekivy.baseclass.common import kivy_state_variables
def mail_detail_screen(screen_name, msg_id, instance, folder, *args): def mail_detail_screen(screen_name, msg_id, instance, folder, *args):
kivy_state = kivy_state_variables() kivy_state = kivy_state_variables()
if instance.open_progress == 0.0: if instance.open_progress == 0.0:
import pdb; pdb.set_trace()
kivy_state.detailPageType = folder kivy_state.detailPageType = folder
kivy_state.mail_id = msg_id kivy_state.mail_id = msg_id
if screen_name.manager: if screen_name.manager:

View File

@ -17,7 +17,7 @@ from bitmessagekivy.baseclass.common import (
toast, SwipeToDeleteItem, ShowTimeHistoy toast, SwipeToDeleteItem, ShowTimeHistoy
) )
from bitmessagekivy.baseclass.maildetail import MailDetail from bitmessagekivy.baseclass.maildetail import MailDetail
import helper_sent
class Sent(Screen): class Sent(Screen):
"""Sent Screen class for kivy Ui""" """Sent Screen class for kivy Ui"""
@ -206,17 +206,20 @@ class Sent(Screen):
state.all_count = str(int(state.all_count) - 1) state.all_count = str(int(state.all_count) - 1)
if int(state.sent_count) <= 0: if int(state.sent_count) <= 0:
self.ids.tag_label.text = '' self.ids.tag_label.text = ''
sqlExecute( # sqlExecute(
"UPDATE sent SET folder = 'trash'" # "UPDATE sent SET folder = 'trash'"
" WHERE ackdata = ?;", data_index) # " WHERE ackdata = ?;", data_index)
helper_sent.trash(data_index)
self.ids.ml.remove_widget(instance.parent.parent) self.ids.ml.remove_widget(instance.parent.parent)
toast('Deleted') toast('Deleted')
def archive(self, data_index, instance, *args): def archive(self, data_index, instance, *args):
"""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 ackdata = ?;", data_index) # " WHERE ackdata = ?;", data_index)
helper_sent.trash(data_index)
self.ids.ml.remove_widget(instance.parent.parent) self.ids.ml.remove_widget(instance.parent.parent)
self.update_trash() self.update_trash()