From 8acd7669e494f5c1dff130aed93c6e9004a2e122 Mon Sep 17 00:00:00 2001 From: nimda Date: Thu, 13 Jun 2013 23:04:11 -0400 Subject: [PATCH 1/4] This grammar bothered me. --- src/bitmessagemain.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bitmessagemain.py b/src/bitmessagemain.py index 6fd42dd1..1a69f516 100755 --- a/src/bitmessagemain.py +++ b/src/bitmessagemain.py @@ -932,7 +932,7 @@ class receiveDataThread(threading.Thread): shared.sqlReturnQueue.get() shared.sqlSubmitQueue.put('commit') shared.sqlLock.release() - shared.UISignalQueue.put(('updateSentItemStatusByAckdata',(encryptedData[readPosition:],'Acknowledgement of the message received just now. '+ unicode(strftime(shared.config.get('bitmessagesettings', 'timeformat'),localtime(int(time.time()))),'utf-8')))) + shared.UISignalQueue.put(('updateSentItemStatusByAckdata',(encryptedData[readPosition:],'Acknowledgement of the message received at'+ unicode(strftime(shared.config.get('bitmessagesettings', 'timeformat'),localtime(int(time.time()))),'utf-8')))) return else: shared.printLock.acquire() -- 2.45.1 From 3865d3cb9f35c17c7e5f739f4bbf6f2df22e4b79 Mon Sep 17 00:00:00 2001 From: nimda Date: Sun, 16 Jun 2013 18:28:18 -0400 Subject: [PATCH 2/4] 'Save message as...' option in Inbox --- src/bitmessageqt/__init__.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/bitmessageqt/__init__.py b/src/bitmessageqt/__init__.py index 195403ea..98d5467a 100644 --- a/src/bitmessageqt/__init__.py +++ b/src/bitmessageqt/__init__.py @@ -104,6 +104,7 @@ class MyForm(QtGui.QMainWindow): self.actionAddSenderToAddressBook = self.ui.inboxContextMenuToolbar.addAction(QtGui.QApplication.translate("MainWindow", "Add sender to your Address Book"), self.on_action_InboxAddSenderToAddressBook) self.actionTrashInboxMessage = self.ui.inboxContextMenuToolbar.addAction(QtGui.QApplication.translate("MainWindow", "Move to Trash"), self.on_action_InboxTrash) self.actionForceHtml = self.ui.inboxContextMenuToolbar.addAction(QtGui.QApplication.translate("MainWindow", "View HTML code as formatted text"), self.on_action_InboxMessageForceHtml) + self.actionSaveMessageAs = self.ui.inboxContextMenuToolbar.addAction(QtGui.QApplication.translate("MainWindow", "Save message as..."), self.on_action_InboxSaveMessageAs) self.ui.tableWidgetInbox.setContextMenuPolicy( QtCore.Qt.CustomContextMenu ) self.connect(self.ui.tableWidgetInbox, QtCore.SIGNAL('customContextMenuRequested(const QPoint&)'), self.on_context_menuInbox) self.popMenuInbox = QtGui.QMenu( self ) @@ -112,6 +113,7 @@ class MyForm(QtGui.QMainWindow): self.popMenuInbox.addAction( self.actionReply ) self.popMenuInbox.addAction( self.actionAddSenderToAddressBook ) self.popMenuInbox.addSeparator() + self.popMenuInbox.addAction( self.actionSaveMessageAs ) self.popMenuInbox.addAction( self.actionTrashInboxMessage ) @@ -1787,6 +1789,24 @@ class MyForm(QtGui.QMainWindow): else: self.ui.tableWidgetInbox.selectRow(currentRow-1) + def on_action_InboxSaveMessageAs(self): + currentInboxRow = self.ui.tableWidgetInbox.currentRow() + subjectAtCurrentInboxRow = str(self.ui.tableWidgetInbox.item(currentInboxRow,2).text()) + defaultFilename = "".join(x for x in subjectAtCurrentInboxRow if x.isalnum()) + '.txt' + data = self.ui.tableWidgetInbox.item(currentInboxRow,2).data(Qt.UserRole).toPyObject() + filename = QFileDialog.getSaveFileName(self, "Save As...", defaultFilename, "Text files (*.txt);;All files (*.*)") + if filename == '': + return + try: + f = open(filename, 'w') + f.write( self.ui.tableWidgetInbox.item(currentInboxRow,2).data(Qt.UserRole).toPyObject() ) + f.close() + except Exception, e: + print 'Write error' + print e + self.statusBar().showMessage(QtGui.QApplication.translate("MainWindow", "Write error.")) + + #Send item on the Sent tab to trash def on_action_SentTrash(self): while self.ui.tableWidgetSent.selectedIndexes() != []: -- 2.45.1 From 5a10d997f90a4afcda5d28bcea49d951a75fb952 Mon Sep 17 00:00:00 2001 From: nimda Date: Sun, 16 Jun 2013 18:38:27 -0400 Subject: [PATCH 3/4] tabs? --- src/bitmessageqt/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bitmessageqt/__init__.py b/src/bitmessageqt/__init__.py index 98d5467a..285fab55 100644 --- a/src/bitmessageqt/__init__.py +++ b/src/bitmessageqt/__init__.py @@ -1799,7 +1799,7 @@ class MyForm(QtGui.QMainWindow): return try: f = open(filename, 'w') - f.write( self.ui.tableWidgetInbox.item(currentInboxRow,2).data(Qt.UserRole).toPyObject() ) + f.write( self.ui.tableWidgetInbox.item(currentInboxRow,2).data(Qt.UserRole).toPyObject() ) f.close() except Exception, e: print 'Write error' -- 2.45.1 From 5dcfa962dd3d1ec1cada8504b27060c955712db8 Mon Sep 17 00:00:00 2001 From: Jonathan Warren Date: Wed, 19 Jun 2013 15:33:42 -0400 Subject: [PATCH 4/4] Added clientStatus API call --- src/bitmessagemain.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/bitmessagemain.py b/src/bitmessagemain.py index 0eec7149..12564393 100755 --- a/src/bitmessagemain.py +++ b/src/bitmessagemain.py @@ -4647,6 +4647,8 @@ class MySimpleXMLRPCRequestHandler(SimpleXMLRPCRequestHandler): shared.UISignalQueue.put(('rerenderInboxFromLabels', '')) shared.UISignalQueue.put(('rerenderSubscriptions', '')) return 'Deleted subscription if it existed.' + elif method == 'clientStatus': + return '{ "networkConnections" : "%s" }' % str(len(shared.connectedHostsList)) else: return 'Invalid Method: %s' % method -- 2.45.1