This commit is contained in:
Tim Bentley 2014-04-20 21:16:08 +01:00
parent a2c99317c6
commit ce55fd1d57
3 changed files with 15 additions and 8 deletions

View File

@ -30,7 +30,6 @@
The actual plugin view form The actual plugin view form
""" """
import logging import logging
import os
from PyQt4 import QtGui from PyQt4 import QtGui

View File

@ -310,5 +310,5 @@ class RemoteTab(SettingsTab):
painter = QtGui.QPainter(icon) painter = QtGui.QPainter(icon)
painter.drawImage(20, 0, overlay) painter.drawImage(20, 0, overlay)
painter.end() painter.end()
self.remote_server_icon.setIcon(build_icon(icon)) self.remote_server_icon.setPixmap(QtGui.QPixmap.fromImage(icon))
self.remote_server_icon.show() self.remote_server_icon.show()

View File

@ -68,12 +68,20 @@ class RemotesPlugin(Plugin):
log.debug('initialise') log.debug('initialise')
super(RemotesPlugin, self).initialise() super(RemotesPlugin, self).initialise()
self.server = OpenLPServer() self.server = OpenLPServer()
self.remote_server_icon = QtGui.QToolButton(self.main_window.status_bar) if not hasattr(self, 'remote_server_icon'):
self.remote_server_icon.setCheckable(False) self.remote_server_icon = QtGui.QLabel(self.main_window.status_bar)
self.remote_server_icon.setAutoRaise(True) size_policy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)
self.remote_server_icon.setObjectName('remote_server_icon') size_policy.setHorizontalStretch(0)
self.main_window.status_bar.insertPermanentWidget(2, self.remote_server_icon) size_policy.setVerticalStretch(0)
self.settings_tab.remote_server_icon = self.remote_server_icon size_policy.setHeightForWidth(self.remote_server_icon.sizePolicy().hasHeightForWidth())
self.remote_server_icon.setSizePolicy(size_policy)
self.remote_server_icon.setFrameShadow(QtGui.QFrame.Plain)
self.remote_server_icon.setLineWidth(1)
self.remote_server_icon.setScaledContents(True)
self.remote_server_icon.setFixedSize(20, 20)
self.remote_server_icon.setObjectName('remote_server_icon')
self.main_window.status_bar.insertPermanentWidget(2, self.remote_server_icon)
self.settings_tab.remote_server_icon = self.remote_server_icon
self.settings_tab.generate_icon() self.settings_tab.generate_icon()
def finalise(self): def finalise(self):