From 9d28e0b70c2160b1563719d714844b78b95f996d Mon Sep 17 00:00:00 2001 From: shekhar-cis Date: Mon, 11 Jul 2022 17:34:35 +0530 Subject: [PATCH] Add trash query for sent screen --- .../baseclass/common_mail_detail.py | 44 +++++++++++++++++++ src/helper_sent.py | 11 +++++ 2 files changed, 55 insertions(+) create mode 100644 src/bitmessagekivy/baseclass/common_mail_detail.py diff --git a/src/bitmessagekivy/baseclass/common_mail_detail.py b/src/bitmessagekivy/baseclass/common_mail_detail.py new file mode 100644 index 00000000..8e804192 --- /dev/null +++ b/src/bitmessagekivy/baseclass/common_mail_detail.py @@ -0,0 +1,44 @@ +# pylint: disable=no-name-in-module, attribute-defined-outside-init, import-error +""" + All Common widgets of kivy are managed here. +""" + +from datetime import datetime + +from kivy.core.window import Window +from kivy.metrics import dp +from kivy.uix.image import Image +from kivy.properties import ( + NumericProperty, + StringProperty +) +from kivy.app import App + +from kivymd.uix.list import ( + ILeftBody, + IRightBodyTouch, +) +from kivymd.uix.label import MDLabel +from kivymd.toast import kivytoast +from kivymd.uix.card import MDCardSwipe +from kivymd.uix.chip import MDChip + +from bitmessagekivy.get_platform import platform + +from bitmessagekivy.baseclass.maildetail import MailDetail +from bitmessagekivy.baseclass.common import kivy_state_variables + + +def mail_detail_screen(screen_name, msg_id, instance, folder, *args): + kivy_state = kivy_state_variables() + if instance.open_progress == 0.0: + import pdb; pdb.set_trace() + kivy_state.detailPageType = folder + kivy_state.mail_id = msg_id + if screen_name.manager: + src_mng_obj = screen_name.manager + else: + src_mng_obj = screen_name.parent.parent + src_mng_obj.screens[11].clear_widgets() + src_mng_obj.screens[11].add_widget(MailDetail()) + src_mng_obj.current = "mailDetail" diff --git a/src/helper_sent.py b/src/helper_sent.py index 31571bcd..93395366 100644 --- a/src/helper_sent.py +++ b/src/helper_sent.py @@ -9,6 +9,7 @@ def insert(t): sqlExecute('''INSERT INTO sent VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)''', *t) def delete(ack_data): + import pdb; pdb.set_trace() """Perform delete ack data""" sqlExecute("DELETE FROM sent WHERE ackdata = ?", ack_data) @@ -19,3 +20,13 @@ def retrieve_message_details(ack_data): " msgid = ?;", ack_data ) return data + +# def trash(msgid): +# # """Mark a message in the `inbox` as `trash`""" +# sqlExecute('''UPDATE sent SET folder='trash' WHERE msgid=?''', msgid) +# # queues.UISignalQueue.put(('removeInboxRowByMsgid', msgid)) + +def trash(ackdata): + # """Mark a message in the `inbox` as `trash`""" + sqlExecute('''UPDATE sent SET folder='trash' WHERE ackdata=?''', ackdata) + # queues.UISignalQueue.put(('removeInboxRowByMsgid', msgid))