From 7a7385496e5fbffc2a3fe3435295b2625b80d26c Mon Sep 17 00:00:00 2001 From: Jonathan Warren Date: Wed, 6 Nov 2013 23:03:36 -0500 Subject: [PATCH 1/3] Fix #472 --- COPYING | 3 ++- LICENSE | 3 ++- src/bitmessageqt/about.py | 31 ++++++++++++++++++++----------- src/bitmessageqt/about.ui | 6 +++--- 4 files changed, 27 insertions(+), 16 deletions(-) diff --git a/COPYING b/COPYING index e386f371..547f5487 100644 --- a/COPYING +++ b/COPYING @@ -1,4 +1,5 @@ -Copyright (c) 2012 Jonathan Warren +Copyright (c) 2012-2013 Jonathan Warren +Copyright (c) 2013 The Bitmessage Developers Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/LICENSE b/LICENSE index de7d6159..cac11fcf 100644 --- a/LICENSE +++ b/LICENSE @@ -1,5 +1,6 @@ The MIT License (MIT) -Copyright (c) 2013 Bitmessage +Copyright (c) 2012-2013 Jonathan Warren +Copyright (c) 2013 The Bitmessage Developers Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in diff --git a/src/bitmessageqt/about.py b/src/bitmessageqt/about.py index 3ede6a15..34f4c27b 100644 --- a/src/bitmessageqt/about.py +++ b/src/bitmessageqt/about.py @@ -2,8 +2,8 @@ # Form implementation generated from reading ui file 'about.ui' # -# Created: Mon Mar 11 11:19:35 2013 -# by: PyQt4 UI code generator 4.9.4 +# Created: Wed Nov 06 23:01:43 2013 +# by: PyQt4 UI code generator 4.10.2 # # WARNING! All changes made in this file will be lost! @@ -12,7 +12,16 @@ from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUtf8 except AttributeError: - _fromUtf8 = lambda s: s + def _fromUtf8(s): + return s + +try: + _encoding = QtGui.QApplication.UnicodeUTF8 + def _translate(context, text, disambig): + return QtGui.QApplication.translate(context, text, disambig, _encoding) +except AttributeError: + def _translate(context, text, disambig): + return QtGui.QApplication.translate(context, text, disambig) class Ui_aboutDialog(object): def setupUi(self, aboutDialog): @@ -35,7 +44,7 @@ class Ui_aboutDialog(object): self.labelVersion.setGeometry(QtCore.QRect(190, 126, 161, 20)) self.labelVersion.setObjectName(_fromUtf8("labelVersion")) self.label_2 = QtGui.QLabel(aboutDialog) - self.label_2.setGeometry(QtCore.QRect(10, 150, 341, 20)) + self.label_2.setGeometry(QtCore.QRect(10, 150, 341, 41)) self.label_2.setAlignment(QtCore.Qt.AlignCenter) self.label_2.setObjectName(_fromUtf8("label_2")) self.label_3 = QtGui.QLabel(aboutDialog) @@ -44,7 +53,7 @@ class Ui_aboutDialog(object): self.label_3.setOpenExternalLinks(True) self.label_3.setObjectName(_fromUtf8("label_3")) self.label_5 = QtGui.QLabel(aboutDialog) - self.label_5.setGeometry(QtCore.QRect(10, 180, 341, 20)) + self.label_5.setGeometry(QtCore.QRect(10, 190, 341, 20)) self.label_5.setAlignment(QtCore.Qt.AlignCenter) self.label_5.setObjectName(_fromUtf8("label_5")) @@ -54,10 +63,10 @@ class Ui_aboutDialog(object): QtCore.QMetaObject.connectSlotsByName(aboutDialog) def retranslateUi(self, aboutDialog): - aboutDialog.setWindowTitle(QtGui.QApplication.translate("aboutDialog", "About", None, QtGui.QApplication.UnicodeUTF8)) - self.label.setText(QtGui.QApplication.translate("aboutDialog", "PyBitmessage", None, QtGui.QApplication.UnicodeUTF8)) - self.labelVersion.setText(QtGui.QApplication.translate("aboutDialog", "version ?", None, QtGui.QApplication.UnicodeUTF8)) - self.label_2.setText(QtGui.QApplication.translate("aboutDialog", "Copyright © 2013 Jonathan Warren", None, QtGui.QApplication.UnicodeUTF8)) - self.label_3.setText(QtGui.QApplication.translate("aboutDialog", "

Distributed under the MIT/X11 software license; see http://www.opensource.org/licenses/mit-license.php

", None, QtGui.QApplication.UnicodeUTF8)) - self.label_5.setText(QtGui.QApplication.translate("aboutDialog", "This is Beta software.", None, QtGui.QApplication.UnicodeUTF8)) + aboutDialog.setWindowTitle(_translate("aboutDialog", "About", None)) + self.label.setText(_translate("aboutDialog", "PyBitmessage", None)) + self.labelVersion.setText(_translate("aboutDialog", "version ?", None)) + self.label_2.setText(_translate("aboutDialog", "

Copyright © 2012-2013 Jonathan Warren
Copyright © 2013 The Bitmessage Developers

", None)) + self.label_3.setText(_translate("aboutDialog", "

Distributed under the MIT/X11 software license; see http://www.opensource.org/licenses/mit-license.php

", None)) + self.label_5.setText(_translate("aboutDialog", "This is Beta software.", None)) diff --git a/src/bitmessageqt/about.ui b/src/bitmessageqt/about.ui index 58a0bc36..1bf89fd9 100644 --- a/src/bitmessageqt/about.ui +++ b/src/bitmessageqt/about.ui @@ -70,11 +70,11 @@ 10 150 341 - 20 + 41 - Copyright © 2013 Jonathan Warren + <html><head/><body><p>Copyright © 2012-2013 Jonathan Warren<br/>Copyright © 2013 The Bitmessage Developers</p></body></html> Qt::AlignCenter @@ -103,7 +103,7 @@ 10 - 180 + 190 341 20 From d34114d14c8cf2595199c2fab03f8b4b7d518de1 Mon Sep 17 00:00:00 2001 From: Jonathan Warren Date: Wed, 6 Nov 2013 23:38:19 -0500 Subject: [PATCH 2/3] Fix #541 --- src/class_singleWorker.py | 35 ++++++++++++++++++++++++++--------- 1 file changed, 26 insertions(+), 9 deletions(-) diff --git a/src/class_singleWorker.py b/src/class_singleWorker.py index 2680f307..59d72ac3 100644 --- a/src/class_singleWorker.py +++ b/src/class_singleWorker.py @@ -147,17 +147,26 @@ class singleWorker(threading.Thread): shared.broadcastToSendDataQueues(( streamNumber, 'advertiseobject', inventoryHash)) shared.UISignalQueue.put(('updateStatusBar', '')) - shared.config.set( - myAddress, 'lastpubkeysendtime', str(int(time.time()))) - with open(shared.appdata + 'keys.dat', 'wb') as configfile: - shared.config.write(configfile) + try: + shared.config.set( + myAddress, 'lastpubkeysendtime', str(int(time.time()))) + with open(shared.appdata + 'keys.dat', 'wb') as configfile: + shared.config.write(configfile) + except: + # The user deleted the address out of the keys.dat file before this + # finished. + pass # If this isn't a chan address, this function assembles the pubkey data, # does the necessary POW and sends it out. If it *is* a chan then it # assembles the pubkey and stores is in the pubkey table so that we can # send messages to "ourselves". def sendOutOrStoreMyV3Pubkey(self, hash): - myAddress = shared.myAddressesByHash[hash] + try: + myAddress = shared.myAddressesByHash[hash] + except: + #The address has been deleted. + return if shared.safeConfigGetBoolean(myAddress, 'chan'): with shared.printLock: print 'This is a chan address. Not sending pubkey.' @@ -224,14 +233,22 @@ class singleWorker(threading.Thread): shared.broadcastToSendDataQueues(( streamNumber, 'advertiseobject', inventoryHash)) shared.UISignalQueue.put(('updateStatusBar', '')) - shared.config.set( - myAddress, 'lastpubkeysendtime', str(int(time.time()))) - with open(shared.appdata + 'keys.dat', 'wb') as configfile: - shared.config.write(configfile) + try: + shared.config.set( + myAddress, 'lastpubkeysendtime', str(int(time.time()))) + with open(shared.appdata + 'keys.dat', 'wb') as configfile: + shared.config.write(configfile) + except: + # The user deleted the address out of the keys.dat file before this + # finished. + pass # If this isn't a chan address, this function assembles the pubkey data, # does the necessary POW and sends it out. def sendOutOrStoreMyV4Pubkey(self, myAddress): + if not shared.config.has_section(myAddress): + #The address has been deleted. + return if shared.safeConfigGetBoolean(myAddress, 'chan'): with shared.printLock: print 'This is a chan address. Not sending pubkey.' From 74c7c99511bead99c5b58ba5a03d444e8240418f Mon Sep 17 00:00:00 2001 From: Jonathan Warren Date: Wed, 6 Nov 2013 23:41:37 -0500 Subject: [PATCH 3/3] Fix #544 --- src/bitmessageqt/__init__.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/bitmessageqt/__init__.py b/src/bitmessageqt/__init__.py index 55887b7a..96172742 100644 --- a/src/bitmessageqt/__init__.py +++ b/src/bitmessageqt/__init__.py @@ -1218,7 +1218,14 @@ class MyForm(QtGui.QMainWindow): if withMessagingMenu: n = Notify.Notification.new( title, subtitle, 'notification-message-email') - n.show() + try: + n.show() + except: + # n.show() has been known to throw this exception: + # gi._glib.GError: GDBus.Error:org.freedesktop.Notifications. + # MaxNotificationsExceeded: Exceeded maximum number of + # notifications + pass return else: self.tray.showMessage(title, subtitle, 1, 2000)