fix alerts more

This commit is contained in:
Tim Bentley 2014-01-01 09:57:06 +00:00
parent 2755aad4c6
commit db6ba7c780
5 changed files with 13 additions and 16 deletions

View File

@ -365,7 +365,7 @@ class ServiceManager(OpenLPMixin, RegistryMixin, QtGui.QWidget, Ui_ServiceManage
def set_file_name(self, file_name): def set_file_name(self, file_name):
""" """
Setter for service file. Setter for service file.
:param file_name: The service file name :param file_name: The service file name
""" """
self._file_name = str(file_name) self._file_name = str(file_name)

View File

@ -148,8 +148,7 @@ class AlertsPlugin(Plugin):
""" """
Give the alerts plugin the opportunity to add items to the **Tools** menu. Give the alerts plugin the opportunity to add items to the **Tools** menu.
:param tools_menu: :param tools_menu: The actual **Tools** menu item, so that your actions can use it as their parent.
The actual **Tools** menu item, so that your actions can use it as their parent.
""" """
log.info('add tools menu') log.info('add tools menu')
self.tools_alert_item = create_action(tools_menu, 'toolsAlertItem', self.tools_alert_item = create_action(tools_menu, 'toolsAlertItem',
@ -240,10 +239,9 @@ class AlertsPlugin(Plugin):
def refresh_css(self, frame): def refresh_css(self, frame):
""" """
Trigger an update of the CSS in the maindisplay. Trigger an update of the CSS in the main display.
``frame`` :param frame: The Web frame holding the page.
The Web frame holding the page.
""" """
align = VerticalType.Names[self.settings_tab.location] align = VerticalType.Names[self.settings_tab.location]
frame.evaluateJavaScript('update_css("%s", "%s", "%s", "%s", "%s")' % frame.evaluateJavaScript('update_css("%s", "%s", "%s", "%s", "%s")' %

View File

@ -39,7 +39,7 @@ class Ui_AlertDialog(object):
""" """
Setup the Alert UI dialog Setup the Alert UI dialog
:param alert_dialog: :param alert_dialog: The dialog
""" """
alert_dialog.setObjectName('alert_dialog') alert_dialog.setObjectName('alert_dialog')
alert_dialog.resize(400, 300) alert_dialog.resize(400, 300)
@ -93,7 +93,8 @@ class Ui_AlertDialog(object):
def retranslateUi(self, alert_dialog): def retranslateUi(self, alert_dialog):
""" """
Retranslate the UI strings Retranslate the UI strings
:param alert_dialog:
:param alert_dialog: The dialog
""" """
alert_dialog.setWindowTitle(translate('AlertsPlugin.AlertForm', 'Alert Message')) alert_dialog.setWindowTitle(translate('AlertsPlugin.AlertForm', 'Alert Message'))
self.alert_entry_label.setText(translate('AlertsPlugin.AlertForm', 'Alert &text:')) self.alert_entry_label.setText(translate('AlertsPlugin.AlertForm', 'Alert &text:'))

View File

@ -177,8 +177,7 @@ class AlertForm(QtGui.QDialog, Ui_AlertDialog):
""" """
Prepares the alert text for displaying. Prepares the alert text for displaying.
``text`` :param text: The alert text.
The alert text (unicode).
""" """
if not text: if not text:
return False return False
@ -213,8 +212,7 @@ class AlertForm(QtGui.QDialog, Ui_AlertDialog):
Called when the *alert_list_widget*'s current row has been changed. This enables or disables buttons which Called when the *alert_list_widget*'s current row has been changed. This enables or disables buttons which
require an item to act on. require an item to act on.
``row`` :param row: The row (int). If there is no current row, the value is -1.
The row (int). If there is no current row, the value is -1.
""" """
if row == -1: if row == -1:
self.display_button.setEnabled(False) self.display_button.setEnabled(False)

View File

@ -59,6 +59,8 @@ class AlertsManager(QtCore.QObject):
def alert_text(self, message): def alert_text(self, message):
""" """
Called via a alerts_text event. Message is single element array containing text. Called via a alerts_text event. Message is single element array containing text.
:param message: The message text to be displayed
""" """
if message: if message:
self.display_alert(message[0]) self.display_alert(message[0])
@ -67,8 +69,7 @@ class AlertsManager(QtCore.QObject):
""" """
Called from the Alert Tab to display an alert. Called from the Alert Tab to display an alert.
:param text: :param text: The text to display
The text to display
""" """
log.debug('display alert called %s' % text) log.debug('display alert called %s' % text)
if text: if text:
@ -98,8 +99,7 @@ class AlertsManager(QtCore.QObject):
""" """
Time has finished so if our time then request the next Alert if there is one and reset the timer. Time has finished so if our time then request the next Alert if there is one and reset the timer.
:param event: :param event: the QT event that has been triggered.
the QT event that has been triggered.
""" """
log.debug('timer event') log.debug('timer event')
if event.timerId() == self.timer_id: if event.timerId() == self.timer_id: