From c163001ee834d0b5a1274de64526a8e8602c18d1 Mon Sep 17 00:00:00 2001 From: surbhi Date: Tue, 7 Aug 2018 11:44:14 +0530 Subject: [PATCH] Loadmessage list feature with current account get and ngletters images icon --- src/bitmessagekivy/kivy_helper_search.py | 41 +++++++++ src/bitmessagekivy/main.kv | 8 +- src/bitmessagekivy/mpybit.py | 78 ++++++++++++------ src/images/ngletteravatar/16.png | Bin 483 -> 0 bytes .../Galleryr_rcirclelogo_Small.jpg | Bin 0 -> 36701 bytes src/images/ngletteravatar/i.png | Bin 397 -> 483 bytes src/images/ngletteravatar/{2.jpg => t.jpg} | Bin src/images/ngletteravatar/t.png | Bin 449 -> 0 bytes src/images/ngletteravatar/x.jpg | Bin 0 -> 9071 bytes 9 files changed, 97 insertions(+), 30 deletions(-) create mode 100644 src/bitmessagekivy/kivy_helper_search.py delete mode 100644 src/images/ngletteravatar/16.png create mode 100644 src/images/ngletteravatar/Galleryr_rcirclelogo_Small.jpg rename src/images/ngletteravatar/{2.jpg => t.jpg} (100%) delete mode 100644 src/images/ngletteravatar/t.png create mode 100644 src/images/ngletteravatar/x.jpg diff --git a/src/bitmessagekivy/kivy_helper_search.py b/src/bitmessagekivy/kivy_helper_search.py new file mode 100644 index 00000000..c9c93685 --- /dev/null +++ b/src/bitmessagekivy/kivy_helper_search.py @@ -0,0 +1,41 @@ +from helper_sql import * + + +def search_sql(xAddress = "toaddress", account = None, folder = "inbox", where = None, what = None, unreadOnly = False): + if what is not None and what != "": + what = "%" + what + "%" + else: + what = None + + sqlStatementBase = '''SELECT folder, msgid, toaddress, fromaddress, subject, received, read + FROM inbox ''' + + sqlStatementParts = [] + sqlArguments = [] + if account is not None: + if xAddress == 'both': + sqlStatementParts.append("(fromaddress = ? OR toaddress = ?)") + sqlArguments.append(account) + sqlArguments.append(account) + else: + sqlStatementParts.append(xAddress + " = ? ") + sqlArguments.append(account) + if folder is not None: + if folder == "new": + folder = "inbox" + unreadOnly = True + sqlStatementParts.append("folder = ? ") + sqlArguments.append(folder) + else: + sqlStatementParts.append("folder != ?") + sqlArguments.append("trash") + if what is not None: + sqlStatementParts.append("%s LIKE ?" % (where)) + sqlArguments.append(what) + if unreadOnly: + sqlStatementParts.append("read = 0") + if len(sqlStatementParts) > 0: + sqlStatementBase += "WHERE " + " AND ".join(sqlStatementParts) + if folder == "sent": + sqlStatementBase += " ORDER BY lastactiontime" + return sqlQuery(sqlStatementBase, sqlArguments) \ No newline at end of file diff --git a/src/bitmessagekivy/main.kv b/src/bitmessagekivy/main.kv index c678331a..b859f987 100644 --- a/src/bitmessagekivy/main.kv +++ b/src/bitmessagekivy/main.kv @@ -10,8 +10,8 @@ pos_hint:{"x":0,"y":.3} id: btn background_color: app.theme_cls.primary_dark - text: '
' - values: app.showmeaddresses() + text: app.showmeaddresses(name='text') + values: app.showmeaddresses(name='values') NavigationDrawerIconButton: icon: 'email-open' @@ -148,8 +148,8 @@ BoxLayout: pos_hint: {"x":0,"top":1.} pos: 10,10 id: spinner_id - text: '