Date: 04/11/2013
Add & Remove Star for Inbox Inserted. Add & Remove Star for Sent Inserted. But Still not fully working TO DO: Finalize add/remove for sent change bool(1/0) to check box.
This commit is contained in:
parent
5fb08efe00
commit
e8258ec3a3
|
@ -177,6 +177,11 @@ class MyForm(QtGui.QMainWindow):
|
|||
"MainWindow", "Save message as..."), self.on_action_InboxSaveMessageAs)
|
||||
self.actionMarkUnread = self.ui.inboxContextMenuToolbar.addAction(_translate(
|
||||
"MainWindow", "Mark Unread"), self.on_action_InboxMarkUnread)
|
||||
self.actionAddStar = self.ui.inboxContextMenuToolbar.addAction(_translate(
|
||||
"MainWindow", "Add Star"), self.on_action_InboxAddStar)
|
||||
self.actionRemoveStar = self.ui.inboxContextMenuToolbar.addAction(_translate(
|
||||
"MainWindow", "Remove Star"), self.on_action_InboxRemoveStar)
|
||||
|
||||
self.ui.tableWidgetInbox.setContextMenuPolicy(
|
||||
QtCore.Qt.CustomContextMenu)
|
||||
self.connect(self.ui.tableWidgetInbox, QtCore.SIGNAL(
|
||||
|
@ -184,6 +189,8 @@ class MyForm(QtGui.QMainWindow):
|
|||
self.popMenuInbox = QtGui.QMenu(self)
|
||||
self.popMenuInbox.addAction(self.actionForceHtml)
|
||||
self.popMenuInbox.addAction(self.actionMarkUnread)
|
||||
self.popMenuInbox.addAction(self.actionAddStar)
|
||||
self.popMenuInbox.addAction(self.actionRemoveStar)
|
||||
self.popMenuInbox.addSeparator()
|
||||
self.popMenuInbox.addAction(self.actionReply)
|
||||
self.popMenuInbox.addAction(self.actionAddSenderToAddressBook)
|
||||
|
@ -281,6 +288,12 @@ class MyForm(QtGui.QMainWindow):
|
|||
QtCore.Qt.CustomContextMenu)
|
||||
self.connect(self.ui.tableWidgetSent, QtCore.SIGNAL(
|
||||
'customContextMenuRequested(const QPoint&)'), self.on_context_menuSent)
|
||||
|
||||
self.actionSentAddStar = self.ui.sentContextMenuToolbar.addAction(_translate(
|
||||
"MainWindow", "Add Star"), self.on_action_SentAddStar)
|
||||
self.actionSentRemoveStar = self.ui.sentContextMenuToolbar.addAction(_translate(
|
||||
"MainWindow", "Remove Star"), self.on_action_SentRemoveStar)
|
||||
|
||||
# self.popMenuSent = QtGui.QMenu( self )
|
||||
# self.popMenuSent.addAction( self.actionSentClipboard )
|
||||
# self.popMenuSent.addAction( self.actionTrashSentMessage )
|
||||
|
@ -556,11 +569,14 @@ class MyForm(QtGui.QMainWindow):
|
|||
where = "subject"
|
||||
elif where == "Message":
|
||||
where = "message"
|
||||
elif where == "Starred":
|
||||
where = "starred"
|
||||
|
||||
else:
|
||||
where = "toaddress || fromaddress || subject || message"
|
||||
where = "toaddress || fromaddress || subject || message || starred"
|
||||
|
||||
sqlStatement = '''
|
||||
SELECT toaddress, fromaddress, subject, message, status, ackdata, lastactiontime
|
||||
SELECT toaddress, fromaddress, subject, message, status, ackdata, lastactiontime, starred
|
||||
FROM sent WHERE folder="sent" AND %s LIKE ?
|
||||
ORDER BY lastactiontime
|
||||
''' % (where,)
|
||||
|
@ -570,7 +586,7 @@ class MyForm(QtGui.QMainWindow):
|
|||
|
||||
queryreturn = sqlQuery(sqlStatement, what)
|
||||
for row in queryreturn:
|
||||
toAddress, fromAddress, subject, message, status, ackdata, lastactiontime = row
|
||||
toAddress, fromAddress, subject, message, status, ackdata, lastactiontime, starred = row
|
||||
subject = shared.fixPotentiallyInvalidUTF8Data(subject)
|
||||
message = shared.fixPotentiallyInvalidUTF8Data(message)
|
||||
try:
|
||||
|
@ -662,6 +678,13 @@ class MyForm(QtGui.QMainWindow):
|
|||
newItem.setFlags(
|
||||
QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEnabled)
|
||||
self.ui.tableWidgetSent.setItem(0, 3, newItem)
|
||||
|
||||
newItem = QtGui.QTableWidgetItem(str(starred))
|
||||
#if not read:
|
||||
# newItem.setFont(font)
|
||||
self.ui.tableWidgetSent.setItem(0, 4, newItem)
|
||||
|
||||
|
||||
self.ui.tableWidgetSent.sortItems(3, Qt.DescendingOrder)
|
||||
self.ui.tableWidgetSent.keyPressEvent = self.tableWidgetSentKeyPressEvent
|
||||
|
||||
|
@ -676,11 +699,13 @@ class MyForm(QtGui.QMainWindow):
|
|||
where = "subject"
|
||||
elif where == "Message":
|
||||
where = "message"
|
||||
elif where == "Starred":
|
||||
where = "starred"
|
||||
else:
|
||||
where = "toaddress || fromaddress || subject || message"
|
||||
where = "toaddress || fromaddress || subject || message || starred"
|
||||
|
||||
sqlStatement = '''
|
||||
SELECT msgid, toaddress, fromaddress, subject, received, message, read
|
||||
SELECT msgid, toaddress, fromaddress, subject, received, message, read, starred
|
||||
FROM inbox WHERE folder="inbox" AND %s LIKE ?
|
||||
ORDER BY received
|
||||
''' % (where,)
|
||||
|
@ -692,7 +717,7 @@ class MyForm(QtGui.QMainWindow):
|
|||
font.setBold(True)
|
||||
queryreturn = sqlQuery(sqlStatement, what)
|
||||
for row in queryreturn:
|
||||
msgid, toAddress, fromAddress, subject, received, message, read = row
|
||||
msgid, toAddress, fromAddress, subject, received, message, read, starred = row
|
||||
subject = shared.fixPotentiallyInvalidUTF8Data(subject)
|
||||
message = shared.fixPotentiallyInvalidUTF8Data(message)
|
||||
try:
|
||||
|
@ -767,6 +792,12 @@ class MyForm(QtGui.QMainWindow):
|
|||
if not read:
|
||||
newItem.setFont(font)
|
||||
self.ui.tableWidgetInbox.setItem(0, 3, newItem)
|
||||
|
||||
newItem = QtGui.QTableWidgetItem(str(starred))
|
||||
if not read:
|
||||
newItem.setFont(font)
|
||||
self.ui.tableWidgetInbox.setItem(0, 4, newItem)
|
||||
|
||||
self.ui.tableWidgetInbox.sortItems(3, Qt.DescendingOrder)
|
||||
self.ui.tableWidgetInbox.keyPressEvent = self.tableWidgetInboxKeyPressEvent
|
||||
|
||||
|
@ -2297,6 +2328,38 @@ class MyForm(QtGui.QMainWindow):
|
|||
content = content.replace('\n\n', '<br><br>')
|
||||
self.ui.textEditInboxMessage.setHtml(QtCore.QString(content))
|
||||
|
||||
def on_action_InboxAddStar(self):
|
||||
currentRow = self.ui.tableWidgetInbox.currentRow()
|
||||
inventoryHashToAddStar = str(self.ui.tableWidgetInbox.item(
|
||||
currentRow, 3).data(Qt.UserRole).toPyObject())
|
||||
sqlExecute('''UPDATE inbox SET starred=1 WHERE msgid=?''', inventoryHashToAddStar)
|
||||
|
||||
self.loadInbox()
|
||||
|
||||
def on_action_InboxRemoveStar(self):
|
||||
currentRow = self.ui.tableWidgetInbox.currentRow()
|
||||
inventoryHashToRemoveStar = str(self.ui.tableWidgetInbox.item(
|
||||
currentRow, 3).data(Qt.UserRole).toPyObject())
|
||||
sqlExecute('''UPDATE inbox SET starred=0 WHERE msgid=?''', inventoryHashToRemoveStar)
|
||||
|
||||
self.loadInbox()
|
||||
|
||||
def on_action_SentAddStar(self):
|
||||
currentRow = self.ui.tableWidgetSent.currentRow()
|
||||
inventoryHashToAddStar = str(self.ui.tableWidgetSent.item(
|
||||
currentRow, 2).data(Qt.UserRole).toPyObject())
|
||||
sqlExecute('''UPDATE sent SET starred=1 WHERE msgid=?''', inventoryHashToAddStar)
|
||||
|
||||
self.loadSent()
|
||||
|
||||
def on_action_SentRemoveStar(self):
|
||||
currentRow = self.ui.tableWidgetSent.currentRow()
|
||||
inventoryHashToRemoveStar = str(self.ui.tableWidgetSent.item(
|
||||
currentRow, 3).data(Qt.UserRole).toPyObject())
|
||||
sqlExecute('''UPDATE sent SET starred=0 WHERE msgid=?''', inventoryHashToRemoveStar)
|
||||
|
||||
self.loadSent()
|
||||
|
||||
def on_action_InboxMarkUnread(self):
|
||||
font = QFont()
|
||||
font.setBold(True)
|
||||
|
@ -2309,6 +2372,7 @@ class MyForm(QtGui.QMainWindow):
|
|||
self.ui.tableWidgetInbox.item(currentRow, 1).setFont(font)
|
||||
self.ui.tableWidgetInbox.item(currentRow, 2).setFont(font)
|
||||
self.ui.tableWidgetInbox.item(currentRow, 3).setFont(font)
|
||||
self.ui.tableWidgetInbox.item(currentRow, 4).setFont(font)
|
||||
# self.ui.tableWidgetInbox.selectRow(currentRow + 1)
|
||||
# This doesn't de-select the last message if you try to mark it unread, but that doesn't interfere. Might not be necessary.
|
||||
# We could also select upwards, but then our problem would be with the topmost message.
|
||||
|
@ -2708,6 +2772,9 @@ class MyForm(QtGui.QMainWindow):
|
|||
self.popMenuSent.addAction(self.actionSentClipboard)
|
||||
self.popMenuSent.addAction(self.actionTrashSentMessage)
|
||||
|
||||
self.popMenuSent.addAction(self.actionSentAddStar)
|
||||
self.popMenuSent.addAction(self.actionSentRemoveStar)
|
||||
|
||||
# Check to see if this item is toodifficult and display an additional
|
||||
# menu option (Force Send) if it is.
|
||||
currentRow = self.ui.tableWidgetSent.currentRow()
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
|
||||
# Form implementation generated from reading ui file 'bitmessageui.ui'
|
||||
#
|
||||
# Created: Tue Sep 03 15:17:26 2013
|
||||
# by: PyQt4 UI code generator 4.10.2
|
||||
# Created: Mon Nov 04 01:47:29 2013
|
||||
# by: PyQt4 UI code generator 4.10.3
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
|
||||
|
@ -26,7 +26,7 @@ except AttributeError:
|
|||
class Ui_MainWindow(object):
|
||||
def setupUi(self, MainWindow):
|
||||
MainWindow.setObjectName(_fromUtf8("MainWindow"))
|
||||
MainWindow.resize(885, 580)
|
||||
MainWindow.resize(795, 580)
|
||||
icon = QtGui.QIcon()
|
||||
icon.addPixmap(QtGui.QPixmap(_fromUtf8(":/newPrefix/images/can-icon-24px.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
||||
MainWindow.setWindowIcon(icon)
|
||||
|
@ -78,9 +78,9 @@ class Ui_MainWindow(object):
|
|||
self.tableWidgetInbox.setSelectionMode(QtGui.QAbstractItemView.ExtendedSelection)
|
||||
self.tableWidgetInbox.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows)
|
||||
self.tableWidgetInbox.setWordWrap(False)
|
||||
self.tableWidgetInbox.setObjectName(_fromUtf8("tableWidgetInbox"))
|
||||
self.tableWidgetInbox.setColumnCount(4)
|
||||
self.tableWidgetInbox.setRowCount(0)
|
||||
self.tableWidgetInbox.setColumnCount(5)
|
||||
self.tableWidgetInbox.setObjectName(_fromUtf8("tableWidgetInbox"))
|
||||
item = QtGui.QTableWidgetItem()
|
||||
self.tableWidgetInbox.setHorizontalHeaderItem(0, item)
|
||||
item = QtGui.QTableWidgetItem()
|
||||
|
@ -89,14 +89,18 @@ class Ui_MainWindow(object):
|
|||
self.tableWidgetInbox.setHorizontalHeaderItem(2, item)
|
||||
item = QtGui.QTableWidgetItem()
|
||||
self.tableWidgetInbox.setHorizontalHeaderItem(3, item)
|
||||
item = QtGui.QTableWidgetItem()
|
||||
item.setTextAlignment(QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
|
||||
self.tableWidgetInbox.setHorizontalHeaderItem(4, item)
|
||||
self.tableWidgetInbox.horizontalHeader().setCascadingSectionResizes(True)
|
||||
self.tableWidgetInbox.horizontalHeader().setDefaultSectionSize(200)
|
||||
self.tableWidgetInbox.horizontalHeader().setDefaultSectionSize(170)
|
||||
self.tableWidgetInbox.horizontalHeader().setHighlightSections(False)
|
||||
self.tableWidgetInbox.horizontalHeader().setMinimumSectionSize(27)
|
||||
self.tableWidgetInbox.horizontalHeader().setMinimumSectionSize(50)
|
||||
self.tableWidgetInbox.horizontalHeader().setSortIndicatorShown(False)
|
||||
self.tableWidgetInbox.horizontalHeader().setStretchLastSection(True)
|
||||
self.tableWidgetInbox.verticalHeader().setVisible(False)
|
||||
self.tableWidgetInbox.verticalHeader().setDefaultSectionSize(26)
|
||||
self.tableWidgetInbox.verticalHeader().setDefaultSectionSize(30)
|
||||
self.tableWidgetInbox.verticalHeader().setMinimumSectionSize(19)
|
||||
self.textEditInboxMessage = QtGui.QTextEdit(self.splitter)
|
||||
self.textEditInboxMessage.setBaseSize(QtCore.QSize(0, 500))
|
||||
self.textEditInboxMessage.setReadOnly(True)
|
||||
|
@ -208,7 +212,7 @@ class Ui_MainWindow(object):
|
|||
self.tableWidgetSent.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows)
|
||||
self.tableWidgetSent.setWordWrap(False)
|
||||
self.tableWidgetSent.setObjectName(_fromUtf8("tableWidgetSent"))
|
||||
self.tableWidgetSent.setColumnCount(4)
|
||||
self.tableWidgetSent.setColumnCount(5)
|
||||
self.tableWidgetSent.setRowCount(0)
|
||||
item = QtGui.QTableWidgetItem()
|
||||
self.tableWidgetSent.setHorizontalHeaderItem(0, item)
|
||||
|
@ -218,9 +222,12 @@ class Ui_MainWindow(object):
|
|||
self.tableWidgetSent.setHorizontalHeaderItem(2, item)
|
||||
item = QtGui.QTableWidgetItem()
|
||||
self.tableWidgetSent.setHorizontalHeaderItem(3, item)
|
||||
item = QtGui.QTableWidgetItem()
|
||||
self.tableWidgetSent.setHorizontalHeaderItem(4, item)
|
||||
self.tableWidgetSent.horizontalHeader().setCascadingSectionResizes(True)
|
||||
self.tableWidgetSent.horizontalHeader().setDefaultSectionSize(130)
|
||||
self.tableWidgetSent.horizontalHeader().setDefaultSectionSize(170)
|
||||
self.tableWidgetSent.horizontalHeader().setHighlightSections(False)
|
||||
self.tableWidgetSent.horizontalHeader().setMinimumSectionSize(50)
|
||||
self.tableWidgetSent.horizontalHeader().setSortIndicatorShown(False)
|
||||
self.tableWidgetSent.horizontalHeader().setStretchLastSection(True)
|
||||
self.tableWidgetSent.verticalHeader().setVisible(False)
|
||||
|
@ -439,7 +446,7 @@ class Ui_MainWindow(object):
|
|||
self.gridLayout.addWidget(self.tabWidget, 0, 0, 1, 1)
|
||||
MainWindow.setCentralWidget(self.centralwidget)
|
||||
self.menubar = QtGui.QMenuBar(MainWindow)
|
||||
self.menubar.setGeometry(QtCore.QRect(0, 0, 795, 18))
|
||||
self.menubar.setGeometry(QtCore.QRect(0, 0, 795, 21))
|
||||
self.menubar.setObjectName(_fromUtf8("menubar"))
|
||||
self.menuFile = QtGui.QMenu(self.menubar)
|
||||
self.menuFile.setObjectName(_fromUtf8("menuFile"))
|
||||
|
@ -548,6 +555,8 @@ class Ui_MainWindow(object):
|
|||
item.setText(_translate("MainWindow", "Subject", None))
|
||||
item = self.tableWidgetInbox.horizontalHeaderItem(3)
|
||||
item.setText(_translate("MainWindow", "Received", None))
|
||||
item = self.tableWidgetInbox.horizontalHeaderItem(4)
|
||||
item.setText(_translate("MainWindow", "Starred", None))
|
||||
self.tabWidget.setTabText(self.tabWidget.indexOf(self.inbox), _translate("MainWindow", "Inbox", None))
|
||||
self.pushButtonLoadFromAddressBook.setText(_translate("MainWindow", "Load from Address book", None))
|
||||
self.pushButtonFetchNamecoinID.setText(_translate("MainWindow", "Fetch Namecoin ID", None))
|
||||
|
@ -580,6 +589,8 @@ class Ui_MainWindow(object):
|
|||
item.setText(_translate("MainWindow", "Subject", None))
|
||||
item = self.tableWidgetSent.horizontalHeaderItem(3)
|
||||
item.setText(_translate("MainWindow", "Status", None))
|
||||
item = self.tableWidgetSent.horizontalHeaderItem(4)
|
||||
item.setText(_translate("MainWindow", "Starred", None))
|
||||
self.tabWidget.setTabText(self.tabWidget.indexOf(self.sent), _translate("MainWindow", "Sent", None))
|
||||
self.pushButtonNewAddress.setText(_translate("MainWindow", "New", None))
|
||||
self.tableWidgetYourIdentities.setSortingEnabled(True)
|
||||
|
@ -642,3 +653,13 @@ class Ui_MainWindow(object):
|
|||
self.actionJoinChan.setText(_translate("MainWindow", "Join / Create chan", None))
|
||||
|
||||
import bitmessage_icons_rc
|
||||
|
||||
if __name__ == "__main__":
|
||||
import sys
|
||||
app = QtGui.QApplication(sys.argv)
|
||||
MainWindow = QtGui.QMainWindow()
|
||||
ui = Ui_MainWindow()
|
||||
ui.setupUi(MainWindow)
|
||||
MainWindow.show()
|
||||
sys.exit(app.exec_())
|
||||
|
||||
|
|
|
@ -135,17 +135,23 @@
|
|||
<property name="wordWrap">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="rowCount">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="columnCount">
|
||||
<number>5</number>
|
||||
</property>
|
||||
<attribute name="horizontalHeaderCascadingSectionResizes">
|
||||
<bool>true</bool>
|
||||
</attribute>
|
||||
<attribute name="horizontalHeaderDefaultSectionSize">
|
||||
<number>200</number>
|
||||
<number>170</number>
|
||||
</attribute>
|
||||
<attribute name="horizontalHeaderHighlightSections">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
<attribute name="horizontalHeaderMinimumSectionSize">
|
||||
<number>27</number>
|
||||
<number>50</number>
|
||||
</attribute>
|
||||
<attribute name="horizontalHeaderShowSortIndicator" stdset="0">
|
||||
<bool>false</bool>
|
||||
|
@ -157,7 +163,10 @@
|
|||
<bool>false</bool>
|
||||
</attribute>
|
||||
<attribute name="verticalHeaderDefaultSectionSize">
|
||||
<number>26</number>
|
||||
<number>30</number>
|
||||
</attribute>
|
||||
<attribute name="verticalHeaderMinimumSectionSize">
|
||||
<number>19</number>
|
||||
</attribute>
|
||||
<column>
|
||||
<property name="text">
|
||||
|
@ -179,6 +188,14 @@
|
|||
<string>Received</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Starred</string>
|
||||
</property>
|
||||
<property name="textAlignment">
|
||||
<set>AlignLeft|AlignVCenter</set>
|
||||
</property>
|
||||
</column>
|
||||
</widget>
|
||||
<widget class="QTextEdit" name="textEditInboxMessage">
|
||||
<property name="baseSize">
|
||||
|
@ -448,11 +465,14 @@ p, li { white-space: pre-wrap; }
|
|||
<bool>true</bool>
|
||||
</attribute>
|
||||
<attribute name="horizontalHeaderDefaultSectionSize">
|
||||
<number>130</number>
|
||||
<number>170</number>
|
||||
</attribute>
|
||||
<attribute name="horizontalHeaderHighlightSections">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
<attribute name="horizontalHeaderMinimumSectionSize">
|
||||
<number>50</number>
|
||||
</attribute>
|
||||
<attribute name="horizontalHeaderShowSortIndicator" stdset="0">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
|
@ -485,6 +505,11 @@ p, li { white-space: pre-wrap; }
|
|||
<string>Status</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Starred</string>
|
||||
</property>
|
||||
</column>
|
||||
</widget>
|
||||
<widget class="QTextEdit" name="textEditSentMessage">
|
||||
<property name="readOnly">
|
||||
|
@ -1055,7 +1080,7 @@ p, li { white-space: pre-wrap; }
|
|||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>795</width>
|
||||
<height>18</height>
|
||||
<height>21</height>
|
||||
</rect>
|
||||
</property>
|
||||
<widget class="QMenu" name="menuFile">
|
||||
|
@ -1265,8 +1290,8 @@ p, li { white-space: pre-wrap; }
|
|||
<y>84</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>177</x>
|
||||
<y>519</y>
|
||||
<x>218</x>
|
||||
<y>546</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
|
|
|
@ -100,6 +100,34 @@ class sqlThread(threading.Thread):
|
|||
with open(shared.appdata + 'keys.dat', 'wb') as configfile:
|
||||
shared.config.write(configfile)
|
||||
|
||||
# Since starred column is a newly added one to the inbox and sent tables,
|
||||
# it doesn't exist in most versions of the Bitmessage application
|
||||
# So, we have to add it if it is not existing in the tables.
|
||||
|
||||
# Retrieves all columns information from the inbox and sent tables
|
||||
# and stores them in inbox_columns and sent_columns.
|
||||
# It then stores the starred column information in inbox_starred and sent_starred
|
||||
|
||||
# 1. For inbox table
|
||||
inbox_columns = self.cur.execute("PRAGMA table_info(inbox)")
|
||||
inbox_starred = [(a, b, c, d, e, f) for a, b, c, d, e, f in inbox_columns if b == 'starred' ]
|
||||
|
||||
# 2. For sent table
|
||||
sent_columns = self.cur.execute("PRAGMA table_info(sent)")
|
||||
sent_starred = [(a, b, c, d, e, f) for a, b, c, d, e, f in sent_columns if b == 'starred']
|
||||
|
||||
#If the column is not already added to the inbox table, ALTER TABLE command is called.
|
||||
if inbox_starred.__len__() == 0:
|
||||
item = '''ALTER TABLE inbox ADD starred bool DEFAULT '0' '''
|
||||
parameters = ''
|
||||
self.cur.execute(item, parameters)
|
||||
|
||||
#If the column is not already added to the sent table, ALTER TABLE command is called.
|
||||
if sent_starred.__len__() == 0:
|
||||
item = '''ALTER TABLE sent ADD starred bool DEFAULT '0' '''
|
||||
parameters = ''
|
||||
self.cur.execute(item, parameters)
|
||||
|
||||
# People running earlier versions of PyBitmessage do not have the
|
||||
# encodingtype field in their inbox and sent tables or the read field
|
||||
# in the inbox table. Let's add them.
|
||||
|
|
Reference in New Issue
Block a user