Application indicator colour changes with connection status
This commit is contained in:
parent
863ecdc6fb
commit
0d81e01157
3
debian/source/include-binaries
vendored
3
debian/source/include-binaries
vendored
|
@ -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
|
||||
|
|
|
@ -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()):
|
||||
|
|
BIN
src/images/can-icon-24px-green.png
Normal file
BIN
src/images/can-icon-24px-green.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.2 KiB |
BIN
src/images/can-icon-24px-red.png
Normal file
BIN
src/images/can-icon-24px-red.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.1 KiB |
BIN
src/images/can-icon-24px-yellow.png
Normal file
BIN
src/images/can-icon-24px-yellow.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.2 KiB |
Loading…
Reference in New Issue
Block a user