From a041d48375ee788173179093fae239eebcf4e533 Mon Sep 17 00:00:00 2001 From: Francis Chong Date: Tue, 14 May 2013 00:45:03 +0800 Subject: [PATCH 1/3] [OSX] Try to seek homebrew installation of openssl, fixes #76 --- src/pyelliptic/openssl.py | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/src/pyelliptic/openssl.py b/src/pyelliptic/openssl.py index 6a7dedbc..59a0d324 100644 --- a/src/pyelliptic/openssl.py +++ b/src/pyelliptic/openssl.py @@ -415,17 +415,21 @@ except: OpenSSL = _OpenSSL('libcrypto.dylib') except: try: - from os import path - lib_path = path.join(sys._MEIPASS, "libeay32.dll") - OpenSSL = _OpenSSL(lib_path) + # try homebrew installation + OpenSSL = _OpenSSL('/usr/local/opt/openssl/lib/libcrypto.dylib') except: - if 'linux' in sys.platform or 'darwin' in sys.platform: - try: - from ctypes.util import find_library - OpenSSL = _OpenSSL(find_library('ssl')) - except Exception, err: - sys.stderr.write('(On Linux) Couldn\'t find and load the OpenSSL library. You must install it. If you believe that you already have it installed, this exception information might be of use:\n') - from ctypes.util import find_library - OpenSSL = _OpenSSL(find_library('ssl')) - else: - raise Exception("Couldn't find and load the OpenSSL library. You must install it.") + try: + from os import path + lib_path = path.join(sys._MEIPASS, "libeay32.dll") + OpenSSL = _OpenSSL(lib_path) + except: + if 'linux' in sys.platform or 'darwin' in sys.platform: + try: + from ctypes.util import find_library + OpenSSL = _OpenSSL(find_library('ssl')) + except Exception, err: + sys.stderr.write('(On Linux) Couldn\'t find and load the OpenSSL library. You must install it. If you believe that you already have it installed, this exception information might be of use:\n') + from ctypes.util import find_library + OpenSSL = _OpenSSL(find_library('ssl')) + else: + raise Exception("Couldn't find and load the OpenSSL library. You must install it.") -- 2.45.1 From 28a9d4741c0c1ad0a335dda676590626bb4b0b8a Mon Sep 17 00:00:00 2001 From: Jonathan Warren Date: Tue, 14 May 2013 12:02:56 -0400 Subject: [PATCH 2/3] show Connected notification when going from red to green status also --- src/bitmessageqt/__init__.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/bitmessageqt/__init__.py b/src/bitmessageqt/__init__.py index 31c89ea6..e8bc6b58 100644 --- a/src/bitmessageqt/__init__.py +++ b/src/bitmessageqt/__init__.py @@ -909,7 +909,7 @@ class MyForm(QtGui.QMainWindow): shared.statusIconColor = 'red' # if the connection is lost then show a notification if self.connected: - self.notifierShow('PyBitmessage','Connection lost') + self.notifierShow('Bitmessage','Connection lost') self.connected = False if self.actionStatus != None: @@ -923,7 +923,7 @@ class MyForm(QtGui.QMainWindow): shared.statusIconColor = 'yellow' # if a new connection has been established then show a notification if not self.connected: - self.notifierShow('PyBitmessage','Connected') + self.notifierShow('Bitmessage','Connected') self.connected = True if self.actionStatus != None: @@ -934,6 +934,8 @@ class MyForm(QtGui.QMainWindow): self.statusBar().showMessage('') self.ui.pushButtonStatusIcon.setIcon(QIcon(":/newPrefix/images/greenicon.png")) shared.statusIconColor = 'green' + if not self.connected: + self.notifierShow('Bitmessage','Connected') self.connected = True if self.actionStatus != None: -- 2.45.1 From 6371b338a62a97df0c6667c51ea627124d1d136d Mon Sep 17 00:00:00 2001 From: fuzzgun Date: Tue, 14 May 2013 17:32:10 +0100 Subject: [PATCH 3/3] Avoid an unnecessary query if there are no items in the messaging menu --- src/bitmessageqt/__init__.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/bitmessageqt/__init__.py b/src/bitmessageqt/__init__.py index 31c89ea6..d83c0fa4 100644 --- a/src/bitmessageqt/__init__.py +++ b/src/bitmessageqt/__init__.py @@ -626,6 +626,11 @@ class MyForm(QtGui.QMainWindow): if not withMessagingMenu: return + # if there are no items on the messaging menu then + # the subsequent query can be avoided + if not (self.mmapp.has_source("Subscriptions") or self.mmapp.has_source("Messages")): + return + shared.sqlLock.acquire() shared.sqlSubmitQueue.put('''SELECT toaddress, read FROM inbox WHERE msgid=?''') shared.sqlSubmitQueue.put(inventoryHash) -- 2.45.1