Merge pull request #109 from Atheros1/master
Support select multiple items in inbox and Sent box
This commit is contained in:
commit
90bd3fcebe
|
@ -4663,36 +4663,36 @@ class MyForm(QtGui.QMainWindow):
|
||||||
|
|
||||||
#Send item on the Inbox tab to trash
|
#Send item on the Inbox tab to trash
|
||||||
def on_action_InboxTrash(self):
|
def on_action_InboxTrash(self):
|
||||||
currentRow = self.ui.tableWidgetInbox.currentRow()
|
while self.ui.tableWidgetInbox.selectedIndexes() != []:
|
||||||
if currentRow >= 0:
|
currentRow = self.ui.tableWidgetInbox.selectedIndexes()[0].row()
|
||||||
inventoryHashToTrash = str(self.ui.tableWidgetInbox.item(currentRow,3).data(Qt.UserRole).toPyObject())
|
inventoryHashToTrash = str(self.ui.tableWidgetInbox.item(currentRow,3).data(Qt.UserRole).toPyObject())
|
||||||
t = (inventoryHashToTrash,)
|
t = (inventoryHashToTrash,)
|
||||||
sqlLock.acquire()
|
sqlLock.acquire()
|
||||||
#sqlSubmitQueue.put('''delete from inbox where msgid=?''')
|
|
||||||
sqlSubmitQueue.put('''UPDATE inbox SET folder='trash' WHERE msgid=?''')
|
sqlSubmitQueue.put('''UPDATE inbox SET folder='trash' WHERE msgid=?''')
|
||||||
sqlSubmitQueue.put(t)
|
sqlSubmitQueue.put(t)
|
||||||
sqlReturnQueue.get()
|
sqlReturnQueue.get()
|
||||||
sqlSubmitQueue.put('commit')
|
|
||||||
sqlLock.release()
|
sqlLock.release()
|
||||||
self.ui.textEditInboxMessage.setText("")
|
self.ui.textEditInboxMessage.setText("")
|
||||||
self.ui.tableWidgetInbox.removeRow(currentRow)
|
self.ui.tableWidgetInbox.removeRow(currentRow)
|
||||||
self.statusBar().showMessage('Moved item to trash. There is no user interface to view your trash, but it is still on disk if you are desperate to get it back.')
|
self.statusBar().showMessage('Moved items to trash. There is no user interface to view your trash, but it is still on disk if you are desperate to get it back.')
|
||||||
|
sqlSubmitQueue.put('commit')
|
||||||
|
|
||||||
#Send item on the Sent tab to trash
|
#Send item on the Sent tab to trash
|
||||||
def on_action_SentTrash(self):
|
def on_action_SentTrash(self):
|
||||||
currentRow = self.ui.tableWidgetSent.currentRow()
|
#currentRow = self.ui.tableWidgetSent.currentRow()
|
||||||
if currentRow >= 0:
|
while self.ui.tableWidgetSent.selectedIndexes() != []:
|
||||||
|
currentRow = self.ui.tableWidgetSent.selectedIndexes()[0].row()
|
||||||
ackdataToTrash = str(self.ui.tableWidgetSent.item(currentRow,3).data(Qt.UserRole).toPyObject())
|
ackdataToTrash = str(self.ui.tableWidgetSent.item(currentRow,3).data(Qt.UserRole).toPyObject())
|
||||||
t = (ackdataToTrash,)
|
t = (ackdataToTrash,)
|
||||||
sqlLock.acquire()
|
sqlLock.acquire()
|
||||||
sqlSubmitQueue.put('''UPDATE sent SET folder='trash' WHERE ackdata=?''')
|
sqlSubmitQueue.put('''UPDATE sent SET folder='trash' WHERE ackdata=?''')
|
||||||
sqlSubmitQueue.put(t)
|
sqlSubmitQueue.put(t)
|
||||||
sqlReturnQueue.get()
|
sqlReturnQueue.get()
|
||||||
sqlSubmitQueue.put('commit')
|
|
||||||
sqlLock.release()
|
sqlLock.release()
|
||||||
self.ui.textEditSentMessage.setPlainText("")
|
self.ui.textEditSentMessage.setPlainText("")
|
||||||
self.ui.tableWidgetSent.removeRow(currentRow)
|
self.ui.tableWidgetSent.removeRow(currentRow)
|
||||||
self.statusBar().showMessage('Moved item to trash. There is no user interface to view your trash, but it is still on disk if you are desperate to get it back.')
|
self.statusBar().showMessage('Moved items to trash. There is no user interface to view your trash, but it is still on disk if you are desperate to get it back.')
|
||||||
|
sqlSubmitQueue.put('commit')
|
||||||
def on_action_SentClipboard(self):
|
def on_action_SentClipboard(self):
|
||||||
currentRow = self.ui.tableWidgetSent.currentRow()
|
currentRow = self.ui.tableWidgetSent.currentRow()
|
||||||
addressAtCurrentRow = str(self.ui.tableWidgetSent.item(currentRow,0).data(Qt.UserRole).toPyObject())
|
addressAtCurrentRow = str(self.ui.tableWidgetSent.item(currentRow,0).data(Qt.UserRole).toPyObject())
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
# Form implementation generated from reading ui file 'bitmessageui.ui'
|
# Form implementation generated from reading ui file 'bitmessageui.ui'
|
||||||
#
|
#
|
||||||
# Created: Wed Mar 27 17:23:59 2013
|
# Created: Fri Apr 05 17:47:21 2013
|
||||||
# by: PyQt4 UI code generator 4.9.4
|
# by: PyQt4 UI code generator 4.9.4
|
||||||
#
|
#
|
||||||
# WARNING! All changes made in this file will be lost!
|
# WARNING! All changes made in this file will be lost!
|
||||||
|
@ -47,7 +47,7 @@ class Ui_MainWindow(object):
|
||||||
self.verticalLayout_2.setObjectName(_fromUtf8("verticalLayout_2"))
|
self.verticalLayout_2.setObjectName(_fromUtf8("verticalLayout_2"))
|
||||||
self.tableWidgetInbox = QtGui.QTableWidget(self.inbox)
|
self.tableWidgetInbox = QtGui.QTableWidget(self.inbox)
|
||||||
self.tableWidgetInbox.setAlternatingRowColors(True)
|
self.tableWidgetInbox.setAlternatingRowColors(True)
|
||||||
self.tableWidgetInbox.setSelectionMode(QtGui.QAbstractItemView.SingleSelection)
|
self.tableWidgetInbox.setSelectionMode(QtGui.QAbstractItemView.ExtendedSelection)
|
||||||
self.tableWidgetInbox.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows)
|
self.tableWidgetInbox.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows)
|
||||||
self.tableWidgetInbox.setWordWrap(False)
|
self.tableWidgetInbox.setWordWrap(False)
|
||||||
self.tableWidgetInbox.setObjectName(_fromUtf8("tableWidgetInbox"))
|
self.tableWidgetInbox.setObjectName(_fromUtf8("tableWidgetInbox"))
|
||||||
|
@ -144,7 +144,7 @@ class Ui_MainWindow(object):
|
||||||
self.tableWidgetSent = QtGui.QTableWidget(self.sent)
|
self.tableWidgetSent = QtGui.QTableWidget(self.sent)
|
||||||
self.tableWidgetSent.setDragDropMode(QtGui.QAbstractItemView.DragDrop)
|
self.tableWidgetSent.setDragDropMode(QtGui.QAbstractItemView.DragDrop)
|
||||||
self.tableWidgetSent.setAlternatingRowColors(True)
|
self.tableWidgetSent.setAlternatingRowColors(True)
|
||||||
self.tableWidgetSent.setSelectionMode(QtGui.QAbstractItemView.SingleSelection)
|
self.tableWidgetSent.setSelectionMode(QtGui.QAbstractItemView.ExtendedSelection)
|
||||||
self.tableWidgetSent.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows)
|
self.tableWidgetSent.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows)
|
||||||
self.tableWidgetSent.setWordWrap(False)
|
self.tableWidgetSent.setWordWrap(False)
|
||||||
self.tableWidgetSent.setObjectName(_fromUtf8("tableWidgetSent"))
|
self.tableWidgetSent.setObjectName(_fromUtf8("tableWidgetSent"))
|
||||||
|
|
|
@ -74,7 +74,7 @@
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
<property name="selectionMode">
|
<property name="selectionMode">
|
||||||
<enum>QAbstractItemView::SingleSelection</enum>
|
<enum>QAbstractItemView::ExtendedSelection</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="selectionBehavior">
|
<property name="selectionBehavior">
|
||||||
<enum>QAbstractItemView::SelectRows</enum>
|
<enum>QAbstractItemView::SelectRows</enum>
|
||||||
|
@ -319,7 +319,7 @@ p, li { white-space: pre-wrap; }
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
<property name="selectionMode">
|
<property name="selectionMode">
|
||||||
<enum>QAbstractItemView::SingleSelection</enum>
|
<enum>QAbstractItemView::ExtendedSelection</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="selectionBehavior">
|
<property name="selectionBehavior">
|
||||||
<enum>QAbstractItemView::SelectRows</enum>
|
<enum>QAbstractItemView::SelectRows</enum>
|
||||||
|
|
|
@ -88,12 +88,12 @@ def takeSentMessagesOutOfTrash():
|
||||||
conn.commit()
|
conn.commit()
|
||||||
print 'done'
|
print 'done'
|
||||||
|
|
||||||
#takeInboxMessagesOutOfTrash()
|
takeInboxMessagesOutOfTrash()
|
||||||
#takeSentMessagesOutOfTrash()
|
#takeSentMessagesOutOfTrash()
|
||||||
#readInbox()
|
#readInbox()
|
||||||
#readSent()
|
#readSent()
|
||||||
#readPubkeys()
|
#readPubkeys()
|
||||||
#readSubscriptions()
|
#readSubscriptions()
|
||||||
readInventory()
|
#readInventory()
|
||||||
|
|
||||||
|
|
||||||
|
|
Reference in New Issue
Block a user