Icon/tranlate fixes

This commit is contained in:
Ken Roberts 2014-10-08 18:43:34 -07:00
parent d4b6c067ef
commit 853826a501
8 changed files with 16 additions and 12 deletions

View File

@ -45,7 +45,7 @@ The :mod:`projector.pjlink1` module provides the necessary functions
import logging import logging
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
log.debug('projectorpjlink1 loaded') log.debug('rpjlink1 loaded')
__all__ = ['PJLink1'] __all__ = ['PJLink1']
@ -188,10 +188,10 @@ class PJLink1(QTcpSocket):
log.debug('(%s) Updating projector status' % self.ip) log.debug('(%s) Updating projector status' % self.ip)
# Reset timer in case we were called from a set command # Reset timer in case we were called from a set command
self.timer.start() self.timer.start()
for i in ['POWR', 'ERST', 'LAMP', 'AVMT', 'INPT']: for command in ['POWR', 'ERST', 'LAMP', 'AVMT', 'INPT']:
self.send_command(i) self.send_command(command)
self.waitForReadyRead() self.waitForReadyRead()
if self.source_available is None: if self.power == S_ON and self.source_available is None:
self.send_command('INST') self.send_command('INST')
def _get_status(self, status): def _get_status(self, status):
@ -204,14 +204,14 @@ class PJLink1(QTcpSocket):
elif status in STATUS_STRING: elif status in STATUS_STRING:
return (STATUS_STRING[status], ERROR_MSG[status]) return (STATUS_STRING[status], ERROR_MSG[status])
else: else:
return (status, 'Unknown status') return (status, translate('OpenLP.PJLink1', 'Unknown status'))
def change_status(self, status, msg=None): def change_status(self, status, msg=None):
""" """
Check connection/error status, set status for projector, then emit status change signal Check connection/error status, set status for projector, then emit status change signal
for gui to allow changing the icons. for gui to allow changing the icons.
""" """
message = 'No message' if msg is None else msg message = translate('OpenLP.PJLink1', 'No message') if msg is None else msg
(code, message) = self._get_status(status) (code, message) = self._get_status(status)
if msg is not None: if msg is not None:
message = msg message = msg
@ -275,8 +275,8 @@ class PJLink1(QTcpSocket):
self.waitForReadyRead() self.waitForReadyRead()
# These should never change once we get this information # These should never change once we get this information
if self.manufacturer is None: if self.manufacturer is None:
for i in ['INF1', 'INF2', 'INFO', 'NAME', 'INST']: for command in ['INF1', 'INF2', 'INFO', 'NAME', 'INST']:
self.send_command(cmd=i) self.send_command(cmd=command)
self.waitForReadyRead() self.waitForReadyRead()
self.change_status(S_CONNECTED) self.change_status(S_CONNECTED)
if not self.new_wizard: if not self.new_wizard:
@ -364,7 +364,8 @@ class PJLink1(QTcpSocket):
if sent == -1: if sent == -1:
# Network error? # Network error?
self.projectorNetwork.emit(S_NETWORK_RECEIVED) self.projectorNetwork.emit(S_NETWORK_RECEIVED)
self.change_status(E_NETWORK, 'Error while sending data to projector') self.change_status(E_NETWORK,
translate('OpenLP.PJLink1', 'Error while sending data to projector'))
def process_command(self, cmd, data): def process_command(self, cmd, data):
""" """
@ -379,7 +380,8 @@ class PJLink1(QTcpSocket):
return return
elif data.upper() == 'ERR1': elif data.upper() == 'ERR1':
# Undefined command # Undefined command
self.change_status(E_UNDEFINED, 'Undefined command: "%s"' % cmd) self.change_status(E_UNDEFINED, '%s "%s"' %
(translate('OpenLP.PJLink1', 'Undefined command:'), cmd))
return return
elif data.upper() == 'ERR2': elif data.upper() == 'ERR2':
# Invalid parameter # Invalid parameter

View File

@ -51,8 +51,8 @@ from openlp.core.ui.projector.wizard import ProjectorWizard
from openlp.core.lib.projector.constants import * from openlp.core.lib.projector.constants import *
# Dict for matching projector status to display icon # Dict for matching projector status to display icon
STATUS_ICONS = {S_NOT_CONNECTED: ':/projector/projector_disconnect.png', STATUS_ICONS = {S_NOT_CONNECTED: ':/projector/projector_item_disconnect.png',
S_CONNECTING: ':/projector/projector_connect.png', S_CONNECTING: ':/projector/projector_item_connect.png',
S_CONNECTED: ':/projector/projector_off.png', S_CONNECTED: ':/projector/projector_off.png',
S_OFF: ':/projector/projector_off.png', S_OFF: ':/projector/projector_off.png',
S_INITIALIZE: ':/projector/projector_off.png', S_INITIALIZE: ':/projector/projector_off.png',

View File

@ -178,6 +178,8 @@
<file>projector_disconnect.png</file> <file>projector_disconnect.png</file>
<file>projector_edit.png</file> <file>projector_edit.png</file>
<file>projector_error.png</file> <file>projector_error.png</file>
<file>projector_item_connect.png</file>
<file>projector_item_disconnect.png</file>
<file>projector_manager.png</file> <file>projector_manager.png</file>
<file>projector_new.png</file> <file>projector_new.png</file>
<file>projector_not_connected.png</file> <file>projector_not_connected.png</file>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.3 KiB

After

Width:  |  Height:  |  Size: 842 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 720 B

After

Width:  |  Height:  |  Size: 781 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB