From 863ecdc6fbdecae74dcc634a2bbd2e61c875fbb3 Mon Sep 17 00:00:00 2001 From: fuzzgun Date: Thu, 9 May 2013 22:31:26 +0100 Subject: [PATCH 01/17] Changed install location of desktop file --- Makefile | 3 +-- debian/rules | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 91c682c9..6c3632e7 100755 --- a/Makefile +++ b/Makefile @@ -13,7 +13,6 @@ source: install: mkdir -m 755 -p $(DEST_APP) mkdir -m 755 -p $(DEST_SHARE)/applications - mkdir -m 755 -p $(DEST_SHARE)/applications/$(APP) mkdir -m 755 -p $(DEST_APP)/images mkdir -m 755 -p $(DEST_APP)/pyelliptic mkdir -m 755 -p $(DEST_APP)/socks @@ -37,7 +36,7 @@ install: install -m 644 src/bitmessageqt/*.py $(DEST_APP)/bitmessageqt install -m 755 debian/pybm /usr/bin/pybitmessage - install -m 644 desktop/$(APP).desktop $(DEST_SHARE)/applications/$(APP)/$(APP).desktop + install -m 644 desktop/$(APP).desktop $(DEST_SHARE)/applications/$(APP).desktop install -m 644 src/images/can-icon-24px.png $(DEST_SHARE)/icons/hicolor/24x24/apps/$(APP).png install -m 644 desktop/can-icon.svg $(DEST_SHARE)/icons/hicolor/scalable/apps/$(APP).svg install -m 644 desktop/can-icon.svg $(DEST_SHARE)/pixmaps/$(APP).svg diff --git a/debian/rules b/debian/rules index a5e5f162..2e245018 100755 --- a/debian/rules +++ b/debian/rules @@ -24,7 +24,6 @@ install: build clean mkdir -m 755 -p $(CURDIR)/debian/$(APP)/usr/bin mkdir -m 755 -p $(DEST_APP) mkdir -m 755 -p $(DEST_SHARE)/applications - mkdir -m 755 -p $(DEST_SHARE)/applications/$(APP) mkdir -m 755 -p $(DEST_APP)/images mkdir -m 755 -p $(DEST_APP)/pyelliptic mkdir -m 755 -p $(DEST_APP)/socks @@ -48,7 +47,7 @@ install: build clean install -m 644 $(CURDIR)/src/bitmessageqt/*.py $(DEST_APP)/bitmessageqt install -m 755 $(CURDIR)/debian/pybm $(DEST_MAIN)/pybitmessage - install -m 644 $(CURDIR)/desktop/$(APP).desktop $(DEST_SHARE)/applications/$(APP)/$(APP).desktop + install -m 644 $(CURDIR)/desktop/$(APP).desktop $(DEST_SHARE)/applications/$(APP).desktop install -m 644 $(CURDIR)/src/images/can-icon-24px.png $(DEST_SHARE)/icons/hicolor/24x24/apps/$(APP).png install -m 644 $(CURDIR)/desktop/can-icon.svg $(DEST_SHARE)/icons/hicolor/scalable/apps/$(APP).svg install -m 644 $(CURDIR)/desktop/can-icon.svg $(DEST_SHARE)/pixmaps/$(APP).svg From 0d81e01157f6707c2307a6fb3df311a7a512f90f Mon Sep 17 00:00:00 2001 From: fuzzgun Date: Thu, 9 May 2013 23:57:46 +0100 Subject: [PATCH 02/17] Application indicator colour changes with connection status --- debian/source/include-binaries | 3 +++ src/bitmessageqt/__init__.py | 14 +++++++++++--- src/images/can-icon-24px-green.png | Bin 0 -> 4254 bytes src/images/can-icon-24px-red.png | Bin 0 -> 4240 bytes src/images/can-icon-24px-yellow.png | Bin 0 -> 4262 bytes 5 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 src/images/can-icon-24px-green.png create mode 100644 src/images/can-icon-24px-red.png create mode 100644 src/images/can-icon-24px-yellow.png diff --git a/debian/source/include-binaries b/debian/source/include-binaries index 8569d576..f676fce8 100644 --- a/debian/source/include-binaries +++ b/debian/source/include-binaries @@ -6,6 +6,9 @@ src/images/redicon.png src/images/subscriptions.png src/images/blacklist.png src/images/can-icon-24px.png +src/images/can-icon-24px-red.png +src/images/can-icon-24px-yellow.png +src/images/can-icon-24px-green.png src/images/identities.png src/images/yellowicon.png src/images/inbox.png diff --git a/src/bitmessageqt/__init__.py b/src/bitmessageqt/__init__.py index 352f9091..bd1c5bba 100644 --- a/src/bitmessageqt/__init__.py +++ b/src/bitmessageqt/__init__.py @@ -466,6 +466,9 @@ class MyForm(QtGui.QMainWindow): # an appindicator action which shows of hides the program window actionShow = None + # pointer to the application + app = None + # show the application window def appIndicatorShow(self): if self.actionShow == None: @@ -502,7 +505,8 @@ class MyForm(QtGui.QMainWindow): # create application indicator def createAppIndicator(self,app): - app.tray = QSystemTrayIcon(QtGui.QIcon("images/can-icon-24px.png"), app) + self.app = app + self.app.tray = QSystemTrayIcon(QtGui.QIcon("images/can-icon-24px-red.png"), self.app) m = QMenu() self.actionStatus = QtGui.QAction('Not Connected',m,checkable=False) @@ -541,8 +545,8 @@ class MyForm(QtGui.QMainWindow): # Quit m.addAction("Quit", self.close) - app.tray.setContextMenu(m) - app.tray.show() + self.app.tray.setContextMenu(m) + self.app.tray.show() def tableWidgetInboxKeyPressEvent(self,event): if event.key() == QtCore.Qt.Key_Delete: @@ -687,6 +691,8 @@ class MyForm(QtGui.QMainWindow): shared.statusIconColor = 'red' if self.actionStatus != None: self.actionStatus.setText('Not Connected') + self.app.tray.setIcon(QtGui.QIcon("images/can-icon-24px-red.png")) + self.trayIcon.show() if color == 'yellow': if self.statusBar().currentMessage() == 'Warning: You are currently not connected. Bitmessage will do the work necessary to send the message but it won\'t send until you connect.': self.statusBar().showMessage('') @@ -694,6 +700,7 @@ class MyForm(QtGui.QMainWindow): shared.statusIconColor = 'yellow' if self.actionStatus != None: self.actionStatus.setText('Connection Ok') + self.app.tray.setIcon(QtGui.QIcon("images/can-icon-24px-yellow.png")) if color == 'green': if self.statusBar().currentMessage() == 'Warning: You are currently not connected. Bitmessage will do the work necessary to send the message but it won\'t send until you connect.': self.statusBar().showMessage('') @@ -701,6 +708,7 @@ class MyForm(QtGui.QMainWindow): shared.statusIconColor = 'green' if self.actionStatus != None: self.actionStatus.setText('Connection Good') + self.app.tray.setIcon(QtGui.QIcon("images/can-icon-24px-green.png")) def updateSentItemStatusByHash(self,toRipe,textToDisplay): for i in range(self.ui.tableWidgetSent.rowCount()): diff --git a/src/images/can-icon-24px-green.png b/src/images/can-icon-24px-green.png new file mode 100644 index 0000000000000000000000000000000000000000..e72f0bf682370f1a3177b382f866c5cf8cd3ae11 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S`NtF&6}X{F?sh2-u+ zzOZrN!2VwsM)LobN}!eI?z=vUF=kkryMJ~52f5)_N95Lg4gdfE07*qoM6N<$g3X*g A`~Uy| literal 0 HcmV?d00001 diff --git a/src/images/can-icon-24px-red.png b/src/images/can-icon-24px-red.png new file mode 100644 index 0000000000000000000000000000000000000000..13b15a08d3e6893d228d9546ddfe279448bc15f7 GIT binary patch literal 4240 zcmV;B5O42^P)StO&>uS)ve< z0AYj>5AR{$W90N^4L=L-RlQUJ&DC0@ZjPh;=*jPLSYvv5M~MFBAl0-BNIsH15C~g000{K(ZT*W zKal6<?_01!^k@7iDG<<3=fuAC~28EsPoqkpK{9 zG%|Vj005J}`Hw&=0RYXHq~ibpyyzHQsFW8>#s~laM4*8xut5h5!4#~(4xGUqyucR% zVFpA%3?#rj5JCpzfE)^;7?wd9RKPme1hudO8lVxH;SjXJF*pt9;1XPc>u?taU>Kgl z7`%oF1VP9M6Ja4bh!J9r*dopd7nzO(B4J20l7OTj>4+3jBE`sZqynizYLQ(?Bl0bB z6giDtK>Co|$RIL`{EECsF_eL_Q3KQhbwIhO9~z3rpmWi5G!I>XmZEFX8nhlgfVQHi z(M#xcbO3#dj$?q)F%D*o*1Pf{>6$SWH+$s3q(pv=X`qR|$iJF~TPzlc-O$C3+J1#CT#lv5;6stS0Uu z9wDA3UMCI{Uz12A4#|?_P6{CkNG+sOq(0IRX`DyT~9-sA|ffUF>w zk++Z!kWZ5P$;0Hg6gtI-;!FvmBvPc55=u2?Kjj3apE5$3psG>Lsh-pbs)#zDT1jo7 zc2F-(3)vyY4>O^>2$gY-Gd%Qm(Z8eYv>2*=jns=cMJ`N z4THx>VkjAF8G9M07`GWOnM|ey)0dgZR4~^v8<}UA514ONSSt1^d=-((5|uiYR+WC0 z=c-gyb5%dpd8!Lkt5pxHURHgkMpd&=fR^vEcAI*_=wwAG2sV%zY%w@v@XU~7=xdm1xY6*0;iwVIXu6TaXrs|dqbIl~?uTdNHFy_3W~^@< zVyraYW!!5#V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J?Sr`JAtJPgPIXi!2@yU(Nt;+uWcVSIWYhw-87(8Q9N+X3J%X4#`-jzP^^@gtnJ5e~R-=u=XoE2pt#q$9 zfKIzjwOVDfv57#UwPvI;La9{zvV(H2E@G2izoCPjpjXrs_tqm98B zjZ|`&*!7Kds?{2}UM|8g#Ax$+v)TOP+S(e!2%K<)K|s6J{%<`P^ zu>(wf_=Ntk-r_*7jUT3AY3P?OJpja%j+1U6=o@ak+Y&8gi;8p~0 zym9IA=YIUcv+L{c(M+49X^JtH`wrd5=`VhPQ>Pxq^DF?JPKV9LCJXZmwA&qg-zSPf zTCL_>v$^wpp6A4I%*4dRtxmprsglnLI}maefx=`kUYVMH-W`0dNT;~#&&NSqW10-t8HdCnMp?);Hs;lYPaR1bXMpxcNl z)t|*zsdOD-;UD`VYg9AP5M2AJ6wll7!WjISMuMN)`=NucGTUnN6q-o09+8V7^ zds->^86mm1R4lDeP9FSaX;1N=QVF!u-21_MFvbi^bN5x}zw~TYOiQ7!v;Y7A07*qo IM6N<$f^oq=ga7~l literal 0 HcmV?d00001 From 24094949cf20ac1dc6b62e2b141da68969dd0464 Mon Sep 17 00:00:00 2001 From: fuzzgun Date: Fri, 10 May 2013 20:47:01 +0100 Subject: [PATCH 03/17] Beginning of integration with Ubuntu Messaging Menu --- debian/control | 2 +- debian/rules | 1 + desktop/pybitmessage.desktop | 8 ++- src/bitmessagemain.py | 1 - src/bitmessageqt/__init__.py | 126 +++++++++++++++++++++++++++++++++-- 5 files changed, 129 insertions(+), 9 deletions(-) diff --git a/debian/control b/debian/control index 92a4eb15..b0b0ea53 100644 --- a/debian/control +++ b/debian/control @@ -10,7 +10,7 @@ Vcs-Git: https://github.com/Bitmessage/PyBitmessage.git Package: pybitmessage Architecture: all -Depends: ${misc:Depends}, python (>= 2.7.0), openssl, python-qt4, libqt4-dev (>= 4.8.0), python-qt4-dev, sqlite3, libsqlite3-dev +Depends: ${misc:Depends}, python (>= 2.7.0), openssl, python-qt4, libqt4-dev (>= 4.8.0), python-qt4-dev, sqlite3, libsqlite3-dev, libmessaging-menu-dev Description: Send encrypted messages to another person or to many subscribers Bitmessage is a P2P communications protocol used to send encrypted messages to another person or to many subscribers. It is decentralized and trustless, diff --git a/debian/rules b/debian/rules index 2e245018..0f873425 100755 --- a/debian/rules +++ b/debian/rules @@ -20,6 +20,7 @@ install: build clean dh_testroot dh_prep dh_installdirs + mkdir -m 755 -p $(CURDIR)/debian/$(APP)/usr mkdir -m 755 -p $(CURDIR)/debian/$(APP)/usr/bin mkdir -m 755 -p $(DEST_APP) diff --git a/desktop/pybitmessage.desktop b/desktop/pybitmessage.desktop index 83da32cd..e5ad4295 100644 --- a/desktop/pybitmessage.desktop +++ b/desktop/pybitmessage.desktop @@ -2,8 +2,12 @@ Type=Application Name=PyBitmessage GenericName=PyBitmessage +X-GNOME-FullName=PyBitmessage Secure Messaging Comment=Send encrypted messages to another person or to many subscribers -Exec=pybitmessage %U +Exec=pybitmessage Icon=pybitmessage Terminal=false -Categories=Network +Categories=Network;Email;Application +Keywords=Email;E-mail;Newsgroup;Messaging +X-MessagingMenu-UsesChatSection=true +X-Ubuntu-Gettext-Domain=pybitmessage diff --git a/src/bitmessagemain.py b/src/bitmessagemain.py index f781b774..ca3ef1a4 100755 --- a/src/bitmessagemain.py +++ b/src/bitmessagemain.py @@ -48,7 +48,6 @@ from SimpleXMLRPCServer import * import json from subprocess import call #used when the API must execute an outside program - #For each stream to which we connect, several outgoingSynSender threads will exist and will collectively create 8 connections with peers. class outgoingSynSender(threading.Thread): def __init__(self): diff --git a/src/bitmessageqt/__init__.py b/src/bitmessageqt/__init__.py index bd1c5bba..8423d572 100644 --- a/src/bitmessageqt/__init__.py +++ b/src/bitmessageqt/__init__.py @@ -5,6 +5,15 @@ except Exception, err: print 'PyBitmessage requires PyQt. You can download it from http://www.riverbankcomputing.com/software/pyqt/download or by searching Google for \'PyQt Download\' (without quotes).' print 'Error message:', err sys.exit() + +try: + from gi.repository import MessagingMenu +except ImportError: + MessagingMenu = None + with_messagingmenu = False +else: + with_messagingmenu = True + from addresses import * import shared from bitmessageui import * @@ -24,6 +33,7 @@ from pyelliptic.openssl import OpenSSL import pickle class MyForm(QtGui.QMainWindow): + def __init__(self, parent=None): QtGui.QWidget.__init__(self, parent) self.ui = Ui_MainWindow() @@ -228,12 +238,13 @@ class MyForm(QtGui.QMainWindow): shared.sqlSubmitQueue.put('') queryreturn = shared.sqlReturnQueue.get() shared.sqlLock.release() + str_broadcast_subscribers = '[Broadcast subscribers]' for row in queryreturn: msgid, toAddress, fromAddress, subject, received, message, read = row try: - if toAddress == '[Broadcast subscribers]': - toLabel = '[Broadcast subscribers]' + if toAddress == str_broadcast_subscribers: + toLabel = str_broadcast_subscribers else: toLabel = shared.config.get(toAddress, 'label') except: @@ -488,6 +499,11 @@ class MyForm(QtGui.QMainWindow): self.show() self.setWindowState(self.windowState() & QtCore.Qt.WindowMaximized) + # Show the program window and select inbox tab + def appIndicatorInbox(self): + self.appIndicatorShow() + self.ui.tabWidget.setCurrentIndex(0) + # Show the program window and select send tab def appIndicatorSend(self): self.appIndicatorShow() @@ -548,6 +564,104 @@ class MyForm(QtGui.QMainWindow): self.app.tray.setContextMenu(m) self.app.tray.show() + # Ubuntu Messaging menu object + mmapp = None + + # is the operating system Ubuntu? + def isUbuntu(self): + if "Ubuntu" in str(os.uname()): + return True + return False + + # returns the number of unread messages and subscriptions + def getUnread(self): + str_broadcast_subscribers = '[Broadcast subscribers]' + + unreadMessages = 0 + unreadSubscriptions = 0 + + shared.sqlLock.acquire() + shared.sqlSubmitQueue.put('''SELECT msgid, toaddress, read FROM inbox where folder='inbox' ''') + shared.sqlSubmitQueue.put('') + queryreturn = shared.sqlReturnQueue.get() + shared.sqlLock.release() + for row in queryreturn: + msgid, toAddress, read = row + + try: + if toAddress == str_broadcast_subscribers: + toLabel = str_broadcast_subscribers + else: + toLabel = shared.config.get(toAddress, 'label') + except: + toLabel = '' + if toLabel == '': + toLabel = toAddress + + if not read: + if toLabel == str_broadcast_subscribers: + # increment the unread subscriptions + unreadSubscriptions = unreadSubscriptions + 1 + else: + # increment the unread messages + unreadMessages = unreadMessages + 1 + return unreadMessages, unreadSubscriptions + + # show the number of unread messages and subscriptions on the messaging menu + def ubuntuMessagingMenuUnread(self, drawAttention): + unreadMessages, unreadSubscriptions = self.getUnread() + # unread messages + if unreadMessages > 0: + self.mmapp.append_source("Messages", None, "Messages (" + str(unreadMessages) + ")") + if drawAttention: + self.mmapp.draw_attention("Messages") + + # unread subscriptions + if unreadSubscriptions > 0: + self.mmapp.append_source("Subscriptions", None, "Subscriptions (" + str(unreadSubscriptions) + ")") + if drawAttention: + self.mmapp.draw_attention("Subscriptions") + + # initialise the Ubuntu messaging menu + def ubuntuMessagingMenuInit(self): + # if this isn't ubuntu then don't do anything + if not self.isUbuntu(): + return + + # has messageing menu been installed + if not with_messagingmenu: + print 'WARNING: libmessaging-menu-dev not installed' + return + + # create the menu server + if with_messagingmenu: + self.mmapp = MessagingMenu.App(desktop_id='pybitmessage.desktop') + self.mmapp.register() + self.mmapp.connect('activate-source', self.appIndicatorInbox) + self.ubuntuMessagingMenuUnread(True) + + # update the Ubuntu messaging menu + def ubuntuMessagingMenuUpdate(self, drawAttention): + # if this isn't ubuntu then don't do anything + if not self.isUbuntu(): + return + + # has messageing menu been installed + if not with_messagingmenu: + print 'WARNING: libmessaging-menu-dev not installed' + return + + # Remove previous messages and subscriptions entries, then recreate them + # There might be a better way to do it than this + if self.mmapp.has_source("Messages"): + self.mmapp.remove_source("Messages") + + if self.mmapp.has_source("Subscriptions"): + self.mmapp.remove_source("Subscriptions") + + # update the menu entries + self.ubuntuMessagingMenuUnread(drawAttention) + def tableWidgetInboxKeyPressEvent(self,event): if event.key() == QtCore.Qt.Key_Delete: self.on_action_InboxTrash() @@ -1084,7 +1198,7 @@ class MyForm(QtGui.QMainWindow): newItem.setData(Qt.UserRole,unicode(message,'utf-8)')) newItem.setFont(font) self.ui.tableWidgetInbox.setItem(0,2,newItem) - newItem = myTableWidgetItem(unicode(strftime(shared.config.get('bitmessagesettings', 'timeformat'),localtime(int(time.time()))),'utf-8')) + newItem = myTableWidgetItem(unicode(strftime(shared.config.get('bitmessagesettings', 'timeformat'),localtime(int(time.time()))),'utf-8')) newItem.setData(Qt.UserRole,QByteArray(inventoryHash)) newItem.setData(33,int(time.time())) newItem.setFont(font) @@ -1096,6 +1210,7 @@ class MyForm(QtGui.QMainWindow): else: self.ui.textEditInboxMessage.setPlainText(self.ui.tableWidgetInbox.item(0,2).data(Qt.UserRole).toPyObject())""" self.ui.tableWidgetInbox.setSortingEnabled(True) + self.ubuntuMessagingMenuUpdate(True) def click_pushButtonAddAddressBook(self): self.NewSubscriptionDialogInstance = NewSubscriptionDialog(self) @@ -1503,6 +1618,7 @@ class MyForm(QtGui.QMainWindow): self.ui.tableWidgetInbox.selectRow(currentRow) else: self.ui.tableWidgetInbox.selectRow(currentRow-1) + self.ubuntuMessagingMenuUpdate(False) #Send item on the Sent tab to trash def on_action_SentTrash(self): @@ -1766,6 +1882,7 @@ class MyForm(QtGui.QMainWindow): shared.sqlReturnQueue.get() shared.sqlSubmitQueue.put('commit') shared.sqlLock.release() + self.ubuntuMessagingMenuUpdate(False) def tableWidgetSentItemClicked(self): currentRow = self.ui.tableWidgetSent.currentRow() @@ -2042,8 +2159,6 @@ class UISignaler(QThread): else: sys.stderr.write('Command sent to UISignaler not recognized: %s\n' % command) - - def run(): app = QtGui.QApplication(sys.argv) app.setStyleSheet("QStatusBar::item { border: 0px solid black }") @@ -2058,5 +2173,6 @@ def run(): if 'win32' in sys.platform or 'win64' in sys.platform: myapp.setWindowFlags(Qt.ToolTip) myapp.createAppIndicator(app) + myapp.ubuntuMessagingMenuInit() sys.exit(app.exec_()) From 7825a3511b3045aceb0b06ab2a5223252a7cc932 Mon Sep 17 00:00:00 2001 From: fuzzgun Date: Sat, 11 May 2013 17:33:16 +0100 Subject: [PATCH 04/17] Notification when new mail arrives in Ubuntu --- debian/control | 2 +- src/bitmessageqt/__init__.py | 62 +++++++++++++++++++++++++----------- 2 files changed, 44 insertions(+), 20 deletions(-) diff --git a/debian/control b/debian/control index b0b0ea53..2dd19194 100644 --- a/debian/control +++ b/debian/control @@ -2,7 +2,7 @@ Source: pybitmessage Section: contrib/comm Priority: extra Maintainer: Jonathan Warren -Build-Depends: debhelper (>= 8.0.0), python (>= 2.7.0), openssl, python-qt4, libqt4-dev (>= 4.8.0), python-qt4-dev, sqlite3, libsqlite3-dev +Build-Depends: debhelper (>= 8.0.0), python (>= 2.7.0), openssl, python-qt4, libqt4-dev (>= 4.8.0), python-qt4-dev, sqlite3, libsqlite3-dev, libmessaging-menu-dev Standards-Version: 3.9.2 Homepage: https://bitmessage.org/ Vcs-Browser: https://github.com/Bitmessage/PyBitmessage diff --git a/src/bitmessageqt/__init__.py b/src/bitmessageqt/__init__.py index 8423d572..3bb87ae9 100644 --- a/src/bitmessageqt/__init__.py +++ b/src/bitmessageqt/__init__.py @@ -1,3 +1,4 @@ + try: from PyQt4.QtCore import * from PyQt4.QtGui import * @@ -6,13 +7,13 @@ except Exception, err: print 'Error message:', err sys.exit() +withMessagingMenu = False try: from gi.repository import MessagingMenu + from gi.repository import Notify + withMessagingMenu = True except ImportError: MessagingMenu = None - with_messagingmenu = False -else: - with_messagingmenu = True from addresses import * import shared @@ -519,8 +520,8 @@ class MyForm(QtGui.QMainWindow): self.appIndicatorShow() self.ui.tabWidget.setCurrentIndex(5) - # create application indicator - def createAppIndicator(self,app): + # initialise application indicator + def appIndicatorInit(self,app): self.app = app self.app.tray = QSystemTrayIcon(QtGui.QIcon("images/can-icon-24px-red.png"), self.app) m = QMenu() @@ -624,31 +625,39 @@ class MyForm(QtGui.QMainWindow): # initialise the Ubuntu messaging menu def ubuntuMessagingMenuInit(self): + global withMessagingMenu + # if this isn't ubuntu then don't do anything if not self.isUbuntu(): return # has messageing menu been installed - if not with_messagingmenu: - print 'WARNING: libmessaging-menu-dev not installed' + if not withMessagingMenu: + print 'WARNING: MessagingMenu is not available. Is libmessaging-menu-dev installed?' return # create the menu server - if with_messagingmenu: - self.mmapp = MessagingMenu.App(desktop_id='pybitmessage.desktop') - self.mmapp.register() - self.mmapp.connect('activate-source', self.appIndicatorInbox) - self.ubuntuMessagingMenuUnread(True) + if withMessagingMenu: + try: + self.mmapp = MessagingMenu.App(desktop_id='pybitmessage.desktop') + self.mmapp.register() + self.mmapp.connect('activate-source', self.appIndicatorInbox) + self.ubuntuMessagingMenuUnread(True) + except Exception: + withMessagingMenu = False + print 'WARNING: messaging menu disabled' # update the Ubuntu messaging menu def ubuntuMessagingMenuUpdate(self, drawAttention): + global withMessagingMenu + # if this isn't ubuntu then don't do anything if not self.isUbuntu(): return # has messageing menu been installed - if not with_messagingmenu: - print 'WARNING: libmessaging-menu-dev not installed' + if not withMessagingMenu: + print 'WARNING: messaging menu disabled or libmessaging-menu-dev not installed' return # Remove previous messages and subscriptions entries, then recreate them @@ -662,6 +671,22 @@ class MyForm(QtGui.QMainWindow): # update the menu entries self.ubuntuMessagingMenuUnread(drawAttention) + # initialise the message notifier + def notifierInit(self): + global withMessagingMenu + if withMessagingMenu: + Notify.init('pybitmessage') + + # shows a notification + def notifierShow(self, title, subtitle): + global withMessagingMenu + if withMessagingMenu: + n = Notify.Notification.new(title, subtitle,'notification-message-email') + n.show() + return + # Show with tray + self.trayIcon.showMessage(title, subtitle, 1, 2000) + def tableWidgetInboxKeyPressEvent(self,event): if event.key() == QtCore.Qt.Key_Delete: self.on_action_InboxTrash() @@ -1186,11 +1211,11 @@ class MyForm(QtGui.QMainWindow): if fromLabel == '': newItem = QtGui.QTableWidgetItem(unicode(fromAddress,'utf-8')) if shared.config.getboolean('bitmessagesettings', 'showtraynotifications'): - self.trayIcon.showMessage('New Message', 'New message from '+ fromAddress, 1, 2000) + self.notifierShow('New Message', 'From '+ fromAddress) else: newItem = QtGui.QTableWidgetItem(unicode(fromLabel,'utf-8')) if shared.config.getboolean('bitmessagesettings', 'showtraynotifications'): - self.trayIcon.showMessage('New Message', 'New message from '+fromLabel, 1, 2000) + self.notifierShow('New Message', 'From ' + fromLabel) newItem.setData(Qt.UserRole,str(fromAddress)) newItem.setFont(font) self.ui.tableWidgetInbox.setItem(0,1,newItem) @@ -1618,7 +1643,6 @@ class MyForm(QtGui.QMainWindow): self.ui.tableWidgetInbox.selectRow(currentRow) else: self.ui.tableWidgetInbox.selectRow(currentRow-1) - self.ubuntuMessagingMenuUpdate(False) #Send item on the Sent tab to trash def on_action_SentTrash(self): @@ -1882,7 +1906,6 @@ class MyForm(QtGui.QMainWindow): shared.sqlReturnQueue.get() shared.sqlSubmitQueue.put('commit') shared.sqlLock.release() - self.ubuntuMessagingMenuUpdate(False) def tableWidgetSentItemClicked(self): currentRow = self.ui.tableWidgetSent.currentRow() @@ -2172,7 +2195,8 @@ def run(): #self.hide() if 'win32' in sys.platform or 'win64' in sys.platform: myapp.setWindowFlags(Qt.ToolTip) - myapp.createAppIndicator(app) + myapp.appIndicatorInit(app) myapp.ubuntuMessagingMenuInit() + myapp.notifierInit() sys.exit(app.exec_()) From 2b9817f827b62c4d02c45c729c099019cb03ad69 Mon Sep 17 00:00:00 2001 From: fuzzgun Date: Sat, 11 May 2013 17:46:21 +0100 Subject: [PATCH 05/17] Show connected or connection lost notifications --- src/bitmessageqt/__init__.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/bitmessageqt/__init__.py b/src/bitmessageqt/__init__.py index 3bb87ae9..e158d3c7 100644 --- a/src/bitmessageqt/__init__.py +++ b/src/bitmessageqt/__init__.py @@ -823,11 +823,21 @@ class MyForm(QtGui.QMainWindow): elif len(shared.connectedHostsList) == 0: self.setStatusIcon('red') + # Indicates whether or not there is a connection to the Bitmessage network + connected = False + def setStatusIcon(self,color): + global withMessagingMenu #print 'setting status icon color' if color == 'red': self.ui.pushButtonStatusIcon.setIcon(QIcon(":/newPrefix/images/redicon.png")) shared.statusIconColor = 'red' + + # if the connection is lost then show a notification + if self.connected: + self.notifierShow('PyBitmessage','Connection lost') + self.connected = False + if self.actionStatus != None: self.actionStatus.setText('Not Connected') self.app.tray.setIcon(QtGui.QIcon("images/can-icon-24px-red.png")) @@ -837,6 +847,12 @@ class MyForm(QtGui.QMainWindow): self.statusBar().showMessage('') self.ui.pushButtonStatusIcon.setIcon(QIcon(":/newPrefix/images/yellowicon.png")) shared.statusIconColor = 'yellow' + + # if a new connection has been established then show a notification + if not self.connected: + self.notifierShow('PyBitmessage','Connected') + self.connected = True + if self.actionStatus != None: self.actionStatus.setText('Connection Ok') self.app.tray.setIcon(QtGui.QIcon("images/can-icon-24px-yellow.png")) @@ -845,6 +861,9 @@ class MyForm(QtGui.QMainWindow): self.statusBar().showMessage('') self.ui.pushButtonStatusIcon.setIcon(QIcon(":/newPrefix/images/greenicon.png")) shared.statusIconColor = 'green' + + self.connected = True + if self.actionStatus != None: self.actionStatus.setText('Connection Good') self.app.tray.setIcon(QtGui.QIcon("images/can-icon-24px-green.png")) From 9e21a980ccd3fcab5a21153e073167457d2eddac Mon Sep 17 00:00:00 2001 From: fuzzgun Date: Sat, 11 May 2013 18:18:43 +0100 Subject: [PATCH 06/17] Unregister messaging menu entry on exit --- src/bitmessageqt/__init__.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/bitmessageqt/__init__.py b/src/bitmessageqt/__init__.py index e158d3c7..02e5741b 100644 --- a/src/bitmessageqt/__init__.py +++ b/src/bitmessageqt/__init__.py @@ -1569,6 +1569,9 @@ class MyForm(QtGui.QMainWindow): else: event.ignore()''' shared.doCleanShutdown() + # unregister the messaging system + if self.mmapp is not None: + self.mmapp.unregister() self.trayIcon.hide() self.statusBar().showMessage('All done. Closing user interface...') event.accept() From 415762d4e4057dd4fb624dbf46d908ddd0e614c3 Mon Sep 17 00:00:00 2001 From: fuzzgun Date: Sat, 11 May 2013 18:30:49 +0100 Subject: [PATCH 07/17] Messaging menu opens inbox --- 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 02e5741b..ebc8adec 100644 --- a/src/bitmessageqt/__init__.py +++ b/src/bitmessageqt/__init__.py @@ -501,7 +501,7 @@ class MyForm(QtGui.QMainWindow): self.setWindowState(self.windowState() & QtCore.Qt.WindowMaximized) # Show the program window and select inbox tab - def appIndicatorInbox(self): + def appIndicatorInbox(self, mm_app, source_id): self.appIndicatorShow() self.ui.tabWidget.setCurrentIndex(0) From 3db67530a94aec46c6aeaa755eedb4a4b76127df Mon Sep 17 00:00:00 2001 From: fuzzgun Date: Sat, 11 May 2013 19:07:44 +0100 Subject: [PATCH 08/17] Unity lanucher shortcuts --- desktop/pybitmessage.desktop | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/desktop/pybitmessage.desktop b/desktop/pybitmessage.desktop index e5ad4295..363908dd 100644 --- a/desktop/pybitmessage.desktop +++ b/desktop/pybitmessage.desktop @@ -4,10 +4,27 @@ Name=PyBitmessage GenericName=PyBitmessage X-GNOME-FullName=PyBitmessage Secure Messaging Comment=Send encrypted messages to another person or to many subscribers -Exec=pybitmessage +Exec=pybitmessage %U Icon=pybitmessage Terminal=false Categories=Network;Email;Application Keywords=Email;E-mail;Newsgroup;Messaging X-MessagingMenu-UsesChatSection=true X-Ubuntu-Gettext-Domain=pybitmessage + +Actions=Send;Subscribe;AddressBook + +[Desktop Action Send] +Name=Send +Exec=pybitmessage -s +OnlyShowIn=Unity; + +[Desktop Action Subscribe] +Name=Subscribe +Exec=pybitmessage -b +OnlyShowIn=Unity; + +[Desktop Action AddressBook] +Name=Address Book +Exec=pybitmessage -a +OnlyShowIn=Unity; \ No newline at end of file From 5caced3c6bdd6bf179fb47e8a84344455a1310af Mon Sep 17 00:00:00 2001 From: fuzzgun Date: Sat, 11 May 2013 23:16:04 +0100 Subject: [PATCH 09/17] Operating system detection --- src/bitmessageqt/__init__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/bitmessageqt/__init__.py b/src/bitmessageqt/__init__.py index ebc8adec..c190db57 100644 --- a/src/bitmessageqt/__init__.py +++ b/src/bitmessageqt/__init__.py @@ -570,8 +570,9 @@ class MyForm(QtGui.QMainWindow): # is the operating system Ubuntu? def isUbuntu(self): - if "Ubuntu" in str(os.uname()): - return True + for entry in os.uname(): + if "Ubuntu" in entry: + return True return False # returns the number of unread messages and subscriptions From 1f4052a0c0a343bc80f8b4dfb6fca7bedbcf1625 Mon Sep 17 00:00:00 2001 From: fuzzgun Date: Sun, 12 May 2013 13:52:37 +0100 Subject: [PATCH 10/17] Modified Debian run script based on issue #145 --- debian/pybm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/pybm b/debian/pybm index d806eedd..95e61e54 100644 --- a/debian/pybm +++ b/debian/pybm @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh cd /usr/share/pybitmessage -python bitmessagemain.py +exec python bitmessagemain.py From a81876072eba6e913952456c984f0e5c9bda27f6 Mon Sep 17 00:00:00 2001 From: fuzzgun Date: Mon, 13 May 2013 10:29:14 +0100 Subject: [PATCH 11/17] Prevent multiple instances of the application from running (issue #142) --- src/bitmessagemain.py | 4 +++ src/singleton.py | 61 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+) create mode 100644 src/singleton.py diff --git a/src/bitmessagemain.py b/src/bitmessagemain.py index ca3ef1a4..64bcea50 100755 --- a/src/bitmessagemain.py +++ b/src/bitmessagemain.py @@ -47,6 +47,7 @@ import signal #Used to capture a Ctrl-C keypress so that Bitmessage can shutdown from SimpleXMLRPCServer import * import json from subprocess import call #used when the API must execute an outside program +import singleton #For each stream to which we connect, several outgoingSynSender threads will exist and will collectively create 8 connections with peers. class outgoingSynSender(threading.Thread): @@ -3762,6 +3763,9 @@ if useVeryEasyProofOfWorkForTesting: shared.networkDefaultPayloadLengthExtraBytes = int(shared.networkDefaultPayloadLengthExtraBytes / 7000) if __name__ == "__main__": + # is the application already running? If yes then exit. + thisapp = singleton.singleinstance() + signal.signal(signal.SIGINT, signal_handler) #signal.signal(signal.SIGINT, signal.SIG_DFL) diff --git a/src/singleton.py b/src/singleton.py new file mode 100644 index 00000000..7ecca3b7 --- /dev/null +++ b/src/singleton.py @@ -0,0 +1,61 @@ +#! /usr/bin/env python + +import sys +import os +import errno +import tempfile +from multiprocessing import Process + + +class singleinstance: + """ + Implements a single instance application by creating a lock file based on the full path to the script file. + + This is based upon the singleton class from tendo https://github.com/pycontribs/tendo + which is under the Python Software Foundation License version 2 + """ + def __init__(self, flavor_id=""): + import sys + self.initialized = False + basename = os.path.splitext(os.path.abspath(sys.argv[0]))[0].replace("/", "-").replace(":", "").replace("\\", "-") + '-%s' % flavor_id + '.lock' + self.lockfile = os.path.normpath(tempfile.gettempdir() + '/' + basename) + + if sys.platform == 'win32': + try: + # file already exists, we try to remove (in case previous execution was interrupted) + if os.path.exists(self.lockfile): + os.unlink(self.lockfile) + self.fd = os.open(self.lockfile, os.O_CREAT | os.O_EXCL | os.O_RDWR) + except OSError: + type, e, tb = sys.exc_info() + if e.errno == 13: + print 'Another instance of this application is already running' + sys.exit(-1) + print(e.errno) + raise + else: # non Windows + import fcntl + self.fp = open(self.lockfile, 'w') + try: + fcntl.lockf(self.fp, fcntl.LOCK_EX | fcntl.LOCK_NB) + except IOError: + print 'Another instance of this application is already running' + sys.exit(-1) + self.initialized = True + + def __del__(self): + import sys + if not self.initialized: + return + try: + if sys.platform == 'win32': + if hasattr(self, 'fd'): + os.close(self.fd) + os.unlink(self.lockfile) + else: + import fcntl + fcntl.lockf(self.fp, fcntl.LOCK_UN) + if os.path.isfile(self.lockfile): + os.unlink(self.lockfile) + except Exception, e: + sys.exit(-1) From 47e7795903424155f4f3408fb132f27fa9d8c144 Mon Sep 17 00:00:00 2001 From: fuzzgun Date: Mon, 13 May 2013 11:51:48 +0100 Subject: [PATCH 12/17] startintray works correctly in Ubuntu (issue #144) --- src/bitmessageqt/__init__.py | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/bitmessageqt/__init__.py b/src/bitmessageqt/__init__.py index c190db57..0b7c9aa9 100644 --- a/src/bitmessageqt/__init__.py +++ b/src/bitmessageqt/__init__.py @@ -536,7 +536,7 @@ class MyForm(QtGui.QMainWindow): # show bitmessage self.actionShow = QtGui.QAction('Show Bitmessage',m,checkable=True) - self.actionShow.setChecked(True) + self.actionShow.setChecked(not shared.config.getboolean('bitmessagesettings', 'startintray')) self.actionShow.triggered.connect(self.appIndicatorShowBitmessage) m.addAction(self.actionShow) @@ -740,7 +740,6 @@ class MyForm(QtGui.QMainWindow): if self.windowState() & QtCore.Qt.WindowMinimized: self.hide() self.trayIcon.show() - #self.hidden = True if 'win32' in sys.platform or 'win64' in sys.platform: self.setWindowFlags(Qt.ToolTip) elif event.oldState() & QtCore.Qt.WindowMinimized: @@ -2209,15 +2208,15 @@ def run(): app = QtGui.QApplication(sys.argv) app.setStyleSheet("QStatusBar::item { border: 0px solid black }") myapp = MyForm() - myapp.show() + if shared.config.getboolean('bitmessagesettings', 'startintray'): - myapp.hide() - myapp.trayIcon.show() - #self.hidden = True - #self.setWindowState(self.windowState() & QtCore.Qt.WindowMinimized) - #self.hide() - if 'win32' in sys.platform or 'win64' in sys.platform: - myapp.setWindowFlags(Qt.ToolTip) + if not myapp.isUbuntu(): + myapp.trayIcon.show() + if 'win32' in sys.platform or 'win64' in sys.platform: + myapp.setWindowFlags(Qt.ToolTip) + else: + myapp.show() + myapp.appIndicatorInit(app) myapp.ubuntuMessagingMenuInit() myapp.notifierInit() From 8973d348ad4432ff6104a6d88e5f573256311b95 Mon Sep 17 00:00:00 2001 From: fuzzgun Date: Mon, 13 May 2013 12:20:29 +0100 Subject: [PATCH 13/17] Application indicator show status is cleared when the application window is minimized --- src/bitmessageqt/__init__.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/bitmessageqt/__init__.py b/src/bitmessageqt/__init__.py index 0b7c9aa9..ab02bc59 100644 --- a/src/bitmessageqt/__init__.py +++ b/src/bitmessageqt/__init__.py @@ -489,6 +489,14 @@ class MyForm(QtGui.QMainWindow): self.show() self.setWindowState(self.windowState() & QtCore.Qt.WindowMaximized) + # unchecks the show item on the application indicator + def appIndicatorHide(self): + if self.actionShow == None: + return + self.actionShow.setChecked(False) + self.hide() + self.setWindowState(self.windowState() & QtCore.Qt.WindowMinimized) + # application indicator show or hide def appIndicatorShowBitmessage(self): if self.actionShow == None: @@ -738,8 +746,7 @@ class MyForm(QtGui.QMainWindow): if shared.config.getboolean('bitmessagesettings', 'minimizetotray') and not 'darwin' in sys.platform: if event.type() == QtCore.QEvent.WindowStateChange: if self.windowState() & QtCore.Qt.WindowMinimized: - self.hide() - self.trayIcon.show() + self.appIndicatorHide() if 'win32' in sys.platform or 'win64' in sys.platform: self.setWindowFlags(Qt.ToolTip) elif event.oldState() & QtCore.Qt.WindowMinimized: From d154e2495c77732d9a676724cbf22f0443b50ceb Mon Sep 17 00:00:00 2001 From: fuzzgun Date: Mon, 13 May 2013 14:02:10 +0100 Subject: [PATCH 14/17] minimiseonclose option to minimize the application when the window is closed --- src/bitmessagemain.py | 1 + src/bitmessageqt/__init__.py | 37 ++++++++++++++++++++++++++---------- 2 files changed, 28 insertions(+), 10 deletions(-) diff --git a/src/bitmessagemain.py b/src/bitmessagemain.py index 64bcea50..3275dadb 100755 --- a/src/bitmessagemain.py +++ b/src/bitmessagemain.py @@ -3813,6 +3813,7 @@ if __name__ == "__main__": shared.config.set('bitmessagesettings','messagesencrypted','false') shared.config.set('bitmessagesettings','defaultnoncetrialsperbyte',str(shared.networkDefaultProofOfWorkNonceTrialsPerByte)) shared.config.set('bitmessagesettings','defaultpayloadlengthextrabytes',str(shared.networkDefaultPayloadLengthExtraBytes)) + shared.config.set('bitmessagesettings','minimizeonclose','true') if storeConfigFilesInSameDirectoryAsProgramByDefault: #Just use the same directory as the program and forget about the appdata folder diff --git a/src/bitmessageqt/__init__.py b/src/bitmessageqt/__init__.py index ab02bc59..338384f3 100644 --- a/src/bitmessageqt/__init__.py +++ b/src/bitmessageqt/__init__.py @@ -73,7 +73,7 @@ class MyForm(QtGui.QMainWindow): traySignal = "activated(QSystemTrayIcon::ActivationReason)" QtCore.QObject.connect(self.trayIcon, QtCore.SIGNAL(traySignal), self.__icon_activated) menu = QtGui.QMenu() - self.exitAction = menu.addAction("Exit", self.close) + self.exitAction = menu.addAction("Exit", self.quit) self.trayIcon.setContextMenu(menu) #I'm currently under the impression that Mac users have different expectations for the tray icon. They don't necessairly expect it to open the main window when clicked and they still expect a program showing a tray icon to also be in the dock. if 'darwin' in sys.platform: @@ -82,7 +82,7 @@ class MyForm(QtGui.QMainWindow): self.ui.labelSendBroadcastWarning.setVisible(False) #FILE MENU and other buttons - QtCore.QObject.connect(self.ui.actionExit, QtCore.SIGNAL("triggered()"), self.close) + QtCore.QObject.connect(self.ui.actionExit, QtCore.SIGNAL("triggered()"), self.quit) QtCore.QObject.connect(self.ui.actionManageKeys, QtCore.SIGNAL("triggered()"), self.click_actionManageKeys) QtCore.QObject.connect(self.ui.actionRegenerateDeterministicAddresses, QtCore.SIGNAL("triggered()"), self.click_actionRegenerateDeterministicAddresses) QtCore.QObject.connect(self.ui.pushButtonNewAddress, QtCore.SIGNAL("clicked()"), self.click_NewAddressDialog) @@ -569,7 +569,7 @@ class MyForm(QtGui.QMainWindow): m.addAction(actionSeparator) # Quit - m.addAction("Quit", self.close) + m.addAction("Quit", self.quit) self.app.tray.setContextMenu(m) self.app.tray.show() @@ -1566,25 +1566,42 @@ class MyForm(QtGui.QMainWindow): else: print 'new address dialog box rejected' - def closeEvent(self, event): + + # Quit selected from menu or application indicator + def quit(self): '''quit_msg = "Are you sure you want to exit Bitmessage?" reply = QtGui.QMessageBox.question(self, 'Message', quit_msg, QtGui.QMessageBox.Yes, QtGui.QMessageBox.No) - if reply == QtGui.QMessageBox.Yes: - event.accept() - else: - event.ignore()''' + if reply is QtGui.QMessageBox.No: + return + ''' shared.doCleanShutdown() # unregister the messaging system if self.mmapp is not None: self.mmapp.unregister() self.trayIcon.hide() self.statusBar().showMessage('All done. Closing user interface...') - event.accept() - print 'Done. (passed event.accept())' os._exit(0) + # window close event + def closeEvent(self, event): + self.appIndicatorHide() + minimizeonclose = True + + try: + minimizeonclose = shared.config.getboolean('bitmessagesettings', 'minimizeonclose') + except Exception: + print 'Is there a minimizeonclose entry in keys.dat?' + + if minimizeonclose: + # minimize the application + event.ignore() + else: + # quit the application + event.accept() + self.quit() + def on_action_InboxMessageForceHtml(self): currentInboxRow = self.ui.tableWidgetInbox.currentRow() lines = self.ui.tableWidgetInbox.item(currentInboxRow,2).data(Qt.UserRole).toPyObject().split('\n') From 501a8243650540194aa6352e040c5185e8848730 Mon Sep 17 00:00:00 2001 From: fuzzgun Date: Mon, 13 May 2013 19:49:39 +0100 Subject: [PATCH 15/17] New tray icons --- debian/changelog | 2 +- debian/files | 1 - src/images/can-icon-24px-green.png | Bin 4254 -> 885 bytes src/images/can-icon-24px-red.png | Bin 4240 -> 867 bytes src/images/can-icon-24px-yellow.png | Bin 4262 -> 872 bytes 5 files changed, 1 insertion(+), 2 deletions(-) delete mode 100644 debian/files diff --git a/debian/changelog b/debian/changelog index 8e8ed8c0..c90ca319 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -pybitmessage (0.3.0-1) unstable; urgency=low +pybitmessage (0.3.0-1) raring; urgency=low * Added new API function: getStatus diff --git a/debian/files b/debian/files deleted file mode 100644 index 881a3f20..00000000 --- a/debian/files +++ /dev/null @@ -1 +0,0 @@ -pybitmessage_0.3.0-1_all.deb contrib/comm extra diff --git a/src/images/can-icon-24px-green.png b/src/images/can-icon-24px-green.png index e72f0bf682370f1a3177b382f866c5cf8cd3ae11..5e7e52ec5db725d3838086b0be80bc465e8c18b0 100644 GIT binary patch delta 863 zcmV-l1EBn#A@v53BYyw{b3#c}2nYxWd4^O0GVm>8I0|isT*OQPT){Nz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jGIC0`QuIm8M>2%ntZLx5Dfp)ut=Xr!- zK&#c9Z#EmJvMeKtBBrLMb~^d;rOTh|b~{8-L>$Ew3I&W~n4O*Fn~y)ivEwJWFnh5V zk=B&Ut89F*f#W#Dag6IZY}e~Q2Fjl2F*!MjQoF1oj`QcV*269}{c?=sn9*X9bLYl~;aGGfCL4Z{vABxhNtCJ?h)_H`6rxl@N;Y@qL70K$c}Y027lFza1aHy_{tk zuIplS-)oG6>$sFgi)0o~e(O6t`@`q3mOeE;X`0eZnmQzE)vwc8+$t{TpM< zKl&s0(VKkp(Onq`YzBevHxC`U_pzf79{uXn{;37W>6NDAIQV^_FboNTfE!CoHLdl_ zVHnasclsuP(>r!;2Qxs*Fc;c8r|x`pq&V{WjT<+PFD)%SQmIrw-Dos4LV&eQ9hhny zK78n;5aJzx(c&n;Q@bKRJ@^*ZTHbi$@54D`tz~m-J5AG+BuS`NtF&6}X{F?sh2-u+ zzOZrN!2VwsM)LobN}!eI?z=vUF=kkryMJ~52f5)_N95Lg4gdfE07*qoM6N<$g3X*g A`~Uy| diff --git a/src/images/can-icon-24px-red.png b/src/images/can-icon-24px-red.png index 13b15a08d3e6893d228d9546ddfe279448bc15f7..942daa7eed549356acbf5ccf05178bed0d53a69f 100644 GIT binary patch delta 845 zcmV-T1G4;(A>#&+BYyw{b3#c}2nYxWd^Vw*yUe*i2%mI;jg_Z0Rf`IUAM7xVgffpv`WAwzkr{X-Ui3FwKHPUl$IK--U$Wzs`@{YR5?2O>!aeU!gMwt(Aww%**ZEJ ze4ZSA*@?jgyL5Vdd}3fjknlj4p7lfly#^2jxk=>`PAMhoOAY-Cj>WeQhsTR-b_vt9 zN;Mt;eTiWJObKmmjZsR;;-u~J)Uhisv47zYAlm5@002;jTn}NsV>BAWeF5?e z2D{7Yv;bftRO`|YjI0yh0iu2YlOSsG2`DN$J|m0nI*lmZd-42PoG*ye<(?zp=I+#N zlUJw;Kn4H;Pzj<8K;gqN8jax^mF+5shh&x9TwHu|9soL9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XZmwA&qg-zSPf zTCL_>v$^wpp6A4I%*4dRtxmprsglnLI}maefx=`kUYVMH-W`0dNT;~#&&NSqW10-t8HdCnMp?);Hs;lYPaR1bXMpxcNl z)t|*zsdOD-;UD`VYg9AP5M2AJ6wll7!WjISMuMN)`=NucGTUnN6q-o09+8V7^ zds->^86mm1R4lDeP9FSaX;1N=QVF!u-21_MFvbi^bN5x}zw~TYOiQ7!v;Y7A07*qo IM6N<$f^oq=ga7~l From 3b2382262a97de8f19e5164219b587cbf31b77ea Mon Sep 17 00:00:00 2001 From: fuzzgun Date: Mon, 13 May 2013 20:38:37 +0100 Subject: [PATCH 16/17] Standardise on 'Quit' rather than 'Exit' --- src/bitmessageqt/__init__.py | 2 +- src/bitmessageui.py | 2 +- src/bitmessageui.ui | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/bitmessageqt/__init__.py b/src/bitmessageqt/__init__.py index 338384f3..c72762b4 100644 --- a/src/bitmessageqt/__init__.py +++ b/src/bitmessageqt/__init__.py @@ -73,7 +73,7 @@ class MyForm(QtGui.QMainWindow): traySignal = "activated(QSystemTrayIcon::ActivationReason)" QtCore.QObject.connect(self.trayIcon, QtCore.SIGNAL(traySignal), self.__icon_activated) menu = QtGui.QMenu() - self.exitAction = menu.addAction("Exit", self.quit) + self.exitAction = menu.addAction("Quit", self.quit) self.trayIcon.setContextMenu(menu) #I'm currently under the impression that Mac users have different expectations for the tray icon. They don't necessairly expect it to open the main window when clicked and they still expect a program showing a tray icon to also be in the dock. if 'darwin' in sys.platform: diff --git a/src/bitmessageui.py b/src/bitmessageui.py index 20e5b973..a7c85206 100644 --- a/src/bitmessageui.py +++ b/src/bitmessageui.py @@ -515,7 +515,7 @@ class Ui_MainWindow(object): self.menuHelp.setTitle(QtGui.QApplication.translate("MainWindow", "Help", None, QtGui.QApplication.UnicodeUTF8)) self.actionImport_keys.setText(QtGui.QApplication.translate("MainWindow", "Import keys", None, QtGui.QApplication.UnicodeUTF8)) self.actionManageKeys.setText(QtGui.QApplication.translate("MainWindow", "Manage keys", None, QtGui.QApplication.UnicodeUTF8)) - self.actionExit.setText(QtGui.QApplication.translate("MainWindow", "Exit", None, QtGui.QApplication.UnicodeUTF8)) + self.actionExit.setText(QtGui.QApplication.translate("MainWindow", "Quit", None, QtGui.QApplication.UnicodeUTF8)) self.actionHelp.setText(QtGui.QApplication.translate("MainWindow", "Help", None, QtGui.QApplication.UnicodeUTF8)) self.actionAbout.setText(QtGui.QApplication.translate("MainWindow", "About", None, QtGui.QApplication.UnicodeUTF8)) self.actionSettings.setText(QtGui.QApplication.translate("MainWindow", "Settings", None, QtGui.QApplication.UnicodeUTF8)) diff --git a/src/bitmessageui.ui b/src/bitmessageui.ui index e1b1e319..cef8cd69 100644 --- a/src/bitmessageui.ui +++ b/src/bitmessageui.ui @@ -979,7 +979,7 @@ p, li { white-space: pre-wrap; } - Exit + Quit From 4c006d123de110973556cafc11c4ec94fb20d23e Mon Sep 17 00:00:00 2001 From: fuzzgun Date: Mon, 13 May 2013 22:34:08 +0100 Subject: [PATCH 17/17] Messaging menu item selects the oldest unread message --- src/bitmessageqt/__init__.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/bitmessageqt/__init__.py b/src/bitmessageqt/__init__.py index c72762b4..49b9ac2d 100644 --- a/src/bitmessageqt/__init__.py +++ b/src/bitmessageqt/__init__.py @@ -508,10 +508,30 @@ class MyForm(QtGui.QMainWindow): self.show() self.setWindowState(self.windowState() & QtCore.Qt.WindowMaximized) + # returns the index of the oldest unread message + def getUnreadMessageIndex(self): + shared.sqlLock.acquire() + shared.sqlSubmitQueue.put('''SELECT msgid, received, read FROM inbox where folder='inbox' ORDER BY received DESC ''') + shared.sqlSubmitQueue.put('') + queryreturn = shared.sqlReturnQueue.get() + shared.sqlLock.release() + i = 0 + index = 0 + for row in queryreturn: + msgid, received, read = row + if not read: + index = i + i = i + 1 + return index + # Show the program window and select inbox tab def appIndicatorInbox(self, mm_app, source_id): self.appIndicatorShow() + # select inbox self.ui.tabWidget.setCurrentIndex(0) + # select unread message + self.ui.tableWidgetInbox.selectRow(self.getUnreadMessageIndex()) + self.tableWidgetInboxItemClicked() # Show the program window and select send tab def appIndicatorSend(self):