more projector
@ -50,25 +50,6 @@ log = logging.getLogger(__name__)
|
|||||||
log.debug('projectormanager loaded')
|
log.debug('projectormanager loaded')
|
||||||
|
|
||||||
|
|
||||||
# Dict for matching projector status to display icon
|
|
||||||
STATUS_ICONS = {
|
|
||||||
S_NOT_CONNECTED: ':/projector/projector_item_disconnect.png',
|
|
||||||
S_CONNECTING: ':/projector/projector_item_connect.png',
|
|
||||||
S_CONNECTED: ':/projector/projector_off.png',
|
|
||||||
S_OFF: ':/projector/projector_off.png',
|
|
||||||
S_INITIALIZE: ':/projector/projector_off.png',
|
|
||||||
S_STANDBY: ':/projector/projector_off.png',
|
|
||||||
S_WARMUP: ':/projector/projector_warmup.png',
|
|
||||||
S_ON: ':/projector/projector_on.png',
|
|
||||||
S_COOLDOWN: ':/projector/projector_cooldown.png',
|
|
||||||
E_ERROR: ':/projector/projector_error.png',
|
|
||||||
E_NETWORK: ':/projector/projector_not_connected_error.png',
|
|
||||||
E_AUTHENTICATION: ':/projector/projector_not_connected_error.png',
|
|
||||||
E_UNKNOWN_SOCKET_ERROR: ':/projector/projector_not_connected_error.png',
|
|
||||||
E_NOT_CONNECTED: ':/projector/projector_not_connected_error.png'
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
class UiProjectorManager(object):
|
class UiProjectorManager(object):
|
||||||
"""
|
"""
|
||||||
UI part of the Projector Manager
|
UI part of the Projector Manager
|
||||||
@ -295,6 +276,23 @@ class ProjectorManager(QtWidgets.QWidget, RegistryBase, UiProjectorManager, LogM
|
|||||||
self.projectordb = projectordb
|
self.projectordb = projectordb
|
||||||
self.projector_list = []
|
self.projector_list = []
|
||||||
self.source_select_form = None
|
self.source_select_form = None
|
||||||
|
# Dict for matching projector status to display icon
|
||||||
|
self.self.status_icons = {
|
||||||
|
S_NOT_CONNECTED: UiIcons().projector_disconnect,
|
||||||
|
S_CONNECTING: UiIcons().projector_connect,
|
||||||
|
S_CONNECTED: UiIcons().projector_off,
|
||||||
|
S_OFF: UiIcons().projector_off,
|
||||||
|
S_INITIALIZE: UiIcons().projector_on,
|
||||||
|
S_STANDBY: UiIcons().projector_off,
|
||||||
|
S_WARMUP: UiIcons().projector_warmup,
|
||||||
|
S_ON: UiIcons().projector_off,
|
||||||
|
S_COOLDOWN: UiIcons().projector_cooldown,
|
||||||
|
E_ERROR: UiIcons().projector_error,
|
||||||
|
E_NETWORK: ':/projector/projector_not_connected_error.png',
|
||||||
|
E_AUTHENTICATION: ':/projector/projector_not_connected_error.png',
|
||||||
|
E_UNKNOWN_SOCKET_ERROR: ':/projector/projector_not_connected_error.png',
|
||||||
|
E_NOT_CONNECTED: ':/projector/projector_not_connected_error.png'
|
||||||
|
}
|
||||||
|
|
||||||
def bootstrap_initialise(self):
|
def bootstrap_initialise(self):
|
||||||
"""
|
"""
|
||||||
@ -715,7 +713,7 @@ class ProjectorManager(QtWidgets.QWidget, RegistryBase, UiProjectorManager, LogM
|
|||||||
"""
|
"""
|
||||||
item = ProjectorItem(link=self._add_projector(projector))
|
item = ProjectorItem(link=self._add_projector(projector))
|
||||||
item.db_item = projector
|
item.db_item = projector
|
||||||
item.icon = QtGui.QIcon(QtGui.QPixmap(STATUS_ICONS[S_NOT_CONNECTED]))
|
item.icon = QtGui.QIcon(QtGui.QPixmap(self.status_icons[S_NOT_CONNECTED]))
|
||||||
widget = QtWidgets.QListWidgetItem(item.icon,
|
widget = QtWidgets.QListWidgetItem(item.icon,
|
||||||
item.link.name,
|
item.link.name,
|
||||||
self.projector_list_widget
|
self.projector_list_widget
|
||||||
@ -802,7 +800,7 @@ class ProjectorManager(QtWidgets.QWidget, RegistryBase, UiProjectorManager, LogM
|
|||||||
return
|
return
|
||||||
|
|
||||||
item.status = status
|
item.status = status
|
||||||
item.icon = QtGui.QIcon(QtGui.QPixmap(STATUS_ICONS[status]))
|
item.icon = QtGui.QIcon(QtGui.QPixmap(self.status_icons[status]))
|
||||||
log.debug('({name}) Updating icon with {code}'.format(name=item.link.name, code=STATUS_CODE[status]))
|
log.debug('({name}) Updating icon with {code}'.format(name=item.link.name, code=STATUS_CODE[status]))
|
||||||
item.widget.setIcon(item.icon)
|
item.widget.setIcon(item.icon)
|
||||||
return self.update_icons()
|
return self.update_icons()
|
||||||
|
@ -115,9 +115,9 @@ class UiIcons(object):
|
|||||||
'projector_cooldown': {'icon': 'fa.video', 'attr': 'blue'},
|
'projector_cooldown': {'icon': 'fa.video', 'attr': 'blue'},
|
||||||
'projector_disconnect': {'icon': 'fa.plug', 'attr': 'lightGray'},
|
'projector_disconnect': {'icon': 'fa.plug', 'attr': 'lightGray'},
|
||||||
'projector_error': {'icon': 'fa.video', 'attr': 'red'},
|
'projector_error': {'icon': 'fa.video', 'attr': 'red'},
|
||||||
'projector_off': {'icon': 'fa.video', 'attr': 'red'},
|
'projector_off': {'icon': 'fa.video', 'attr': 'black'},
|
||||||
'projector_on': {'icon': 'fa.video', 'attr': 'green'},
|
'projector_on': {'icon': 'fa.video', 'attr': 'green'},
|
||||||
'projector_warm': {'icon': 'fa.video', 'attr': 'yellow'},
|
'projector_warmup': {'icon': 'fa.video', 'attr': 'yellow'},
|
||||||
'picture': {'icon': 'fa.picture-o'},
|
'picture': {'icon': 'fa.picture-o'},
|
||||||
'print': {'icon': 'fa.print'},
|
'print': {'icon': 'fa.print'},
|
||||||
'remote': {'icon': 'fa.rss'},
|
'remote': {'icon': 'fa.rss'},
|
||||||
@ -161,6 +161,7 @@ class UiIcons(object):
|
|||||||
except Exception:
|
except Exception:
|
||||||
import sys
|
import sys
|
||||||
print("Unexpected error:", sys.exc_info())
|
print("Unexpected error:", sys.exc_info())
|
||||||
|
setattr(self, key, qta.icon('fa.plus-circle', color='red'))
|
||||||
except:
|
except:
|
||||||
setattr(self, key, qta.icon('fa.plus-circle', color='red'))
|
setattr(self, key, qta.icon('fa.plus-circle', color='red'))
|
||||||
|
|
||||||
|
@ -59,22 +59,15 @@
|
|||||||
<file>projector_connect.png</file>
|
<file>projector_connect.png</file>
|
||||||
<file>projector_connect_tiled.png</file>
|
<file>projector_connect_tiled.png</file>
|
||||||
<file>projector_hdmi.png</file>
|
<file>projector_hdmi.png</file>
|
||||||
<file>projector_cooldown.png</file>
|
|
||||||
<file>projector_disconnect.png</file>
|
<file>projector_disconnect.png</file>
|
||||||
<file>projector_disconnect_tiled.png</file>
|
<file>projector_disconnect_tiled.png</file>
|
||||||
<file>projector_error.png</file>
|
|
||||||
<file>projector_item_connect.png</file>
|
|
||||||
<file>projector_item_disconnect.png</file>
|
|
||||||
<file>projector_not_connected_error.png</file>
|
<file>projector_not_connected_error.png</file>
|
||||||
<file>projector_off.png</file>
|
|
||||||
<file>projector_on.png</file>
|
|
||||||
<file>projector_power_off.png</file>
|
<file>projector_power_off.png</file>
|
||||||
<file>projector_power_off_tiled.png</file>
|
<file>projector_power_off_tiled.png</file>
|
||||||
<file>projector_power_on.png</file>
|
<file>projector_power_on.png</file>
|
||||||
<file>projector_power_on_tiled.png</file>
|
<file>projector_power_on_tiled.png</file>
|
||||||
<file>projector_show.png</file>
|
<file>projector_show.png</file>
|
||||||
<file>projector_show_tiled.png</file>
|
<file>projector_show_tiled.png</file>
|
||||||
<file>projector_warmup.png</file>
|
|
||||||
</qresource>
|
</qresource>
|
||||||
<qresource prefix="remotes">
|
<qresource prefix="remotes">
|
||||||
<file>app_qr.svg</file>
|
<file>app_qr.svg</file>
|
||||||
|
Before Width: | Height: | Size: 4.4 KiB |
Before Width: | Height: | Size: 4.2 KiB |
Before Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 4.2 KiB |
Before Width: | Height: | Size: 4.4 KiB |