Fix up some strings and come bugs in the alerts plugin.

This commit is contained in:
Raoul Snyman 2010-07-06 17:26:52 +02:00
parent 6fe8ecf0c3
commit 419b21a2b1
3 changed files with 11 additions and 8 deletions

View File

@ -35,7 +35,7 @@ from openlp.plugins.alerts.forms import AlertForm
log = logging.getLogger(__name__)
class alertsPlugin(Plugin):
class AlertsPlugin(Plugin):
log.info(u'Alerts Plugin loaded')
def __init__(self, plugin_helpers):
@ -88,7 +88,7 @@ class alertsPlugin(Plugin):
Plugin.finalise(self)
self.toolsAlertItem.setVisible(False)
def togglealertsState(self):
def toggleAlertsState(self):
self.alertsActive = not self.alertsActive
QtCore.QSettings().setValue(
self.settingsSection + u'/active',
@ -102,4 +102,5 @@ class alertsPlugin(Plugin):
about_text = translate('AlertsPlugin',
'<b>Alerts Plugin</b><br>This plugin '
'controls the displaying of alerts on the presentations screen')
return about_text
return about_text

View File

@ -88,13 +88,14 @@ class AlertForm(QtGui.QDialog, Ui_AlertDialog):
self.AlertTextEdit.setText(u'')
self.SaveButton.setEnabled(False)
self.DeleteButton.setEnabled(False)
self.EditButton.setEnabled(False)
def onNewClick(self):
if len(self.AlertTextEdit.text()) == 0:
QtGui.QMessageBox.information(self,
translate('AlertsPlugin.AlertForm', 'Item selected to Add'),
translate('AlertsPlugin.AlertForm', 'Missing data'))
translate('AlertsPlugin.AlertForm', 'New Alert'),
translate('AlertsPlugin.AlertForm', 'You haven\'t specified '
'any text for your alert. Please type in some text before '
'clicking New.'))
else:
alert = AlertItem()
alert.text = unicode(self.AlertTextEdit.text())

View File

@ -95,7 +95,7 @@ class AlertsManager(QtCore.QObject):
alertTab = self.parent.alertsTab
text = HTMLCODE % (alertTab.font_color, alertTab.bg_color,
alertTab.font_face, alertTab.font_size, text)
self.parent.preview_controller.parent.displayManager.addAlert(text,
self.parent.previewController.parent.displayManager.addAlert(text,
alertTab.location)
# check to see if we have a timer running
if self.timer_id == 0:
@ -112,8 +112,9 @@ class AlertsManager(QtCore.QObject):
log.debug(u'timer event')
alertTab = self.parent.alertsTab
if event.timerId() == self.timer_id:
self.parent.preview_controller.parent.displayManager.addAlert(u'',
self.parent.previewController.parent.displayManager.addAlert(u'',
alertTab.location)
self.killTimer(self.timer_id)
self.timer_id = 0
self.generateAlert()