forked from openlp/openlp
Fix up some strings and come bugs in the alerts plugin.
This commit is contained in:
parent
6fe8ecf0c3
commit
419b21a2b1
@ -35,7 +35,7 @@ from openlp.plugins.alerts.forms import AlertForm
|
|||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
class alertsPlugin(Plugin):
|
class AlertsPlugin(Plugin):
|
||||||
log.info(u'Alerts Plugin loaded')
|
log.info(u'Alerts Plugin loaded')
|
||||||
|
|
||||||
def __init__(self, plugin_helpers):
|
def __init__(self, plugin_helpers):
|
||||||
@ -88,7 +88,7 @@ class alertsPlugin(Plugin):
|
|||||||
Plugin.finalise(self)
|
Plugin.finalise(self)
|
||||||
self.toolsAlertItem.setVisible(False)
|
self.toolsAlertItem.setVisible(False)
|
||||||
|
|
||||||
def togglealertsState(self):
|
def toggleAlertsState(self):
|
||||||
self.alertsActive = not self.alertsActive
|
self.alertsActive = not self.alertsActive
|
||||||
QtCore.QSettings().setValue(
|
QtCore.QSettings().setValue(
|
||||||
self.settingsSection + u'/active',
|
self.settingsSection + u'/active',
|
||||||
@ -103,3 +103,4 @@ class alertsPlugin(Plugin):
|
|||||||
'<b>Alerts Plugin</b><br>This plugin '
|
'<b>Alerts Plugin</b><br>This plugin '
|
||||||
'controls the displaying of alerts on the presentations screen')
|
'controls the displaying of alerts on the presentations screen')
|
||||||
return about_text
|
return about_text
|
||||||
|
|
||||||
|
@ -88,13 +88,14 @@ class AlertForm(QtGui.QDialog, Ui_AlertDialog):
|
|||||||
self.AlertTextEdit.setText(u'')
|
self.AlertTextEdit.setText(u'')
|
||||||
self.SaveButton.setEnabled(False)
|
self.SaveButton.setEnabled(False)
|
||||||
self.DeleteButton.setEnabled(False)
|
self.DeleteButton.setEnabled(False)
|
||||||
self.EditButton.setEnabled(False)
|
|
||||||
|
|
||||||
def onNewClick(self):
|
def onNewClick(self):
|
||||||
if len(self.AlertTextEdit.text()) == 0:
|
if len(self.AlertTextEdit.text()) == 0:
|
||||||
QtGui.QMessageBox.information(self,
|
QtGui.QMessageBox.information(self,
|
||||||
translate('AlertsPlugin.AlertForm', 'Item selected to Add'),
|
translate('AlertsPlugin.AlertForm', 'New Alert'),
|
||||||
translate('AlertsPlugin.AlertForm', 'Missing data'))
|
translate('AlertsPlugin.AlertForm', 'You haven\'t specified '
|
||||||
|
'any text for your alert. Please type in some text before '
|
||||||
|
'clicking New.'))
|
||||||
else:
|
else:
|
||||||
alert = AlertItem()
|
alert = AlertItem()
|
||||||
alert.text = unicode(self.AlertTextEdit.text())
|
alert.text = unicode(self.AlertTextEdit.text())
|
||||||
|
@ -95,7 +95,7 @@ class AlertsManager(QtCore.QObject):
|
|||||||
alertTab = self.parent.alertsTab
|
alertTab = self.parent.alertsTab
|
||||||
text = HTMLCODE % (alertTab.font_color, alertTab.bg_color,
|
text = HTMLCODE % (alertTab.font_color, alertTab.bg_color,
|
||||||
alertTab.font_face, alertTab.font_size, text)
|
alertTab.font_face, alertTab.font_size, text)
|
||||||
self.parent.preview_controller.parent.displayManager.addAlert(text,
|
self.parent.previewController.parent.displayManager.addAlert(text,
|
||||||
alertTab.location)
|
alertTab.location)
|
||||||
# check to see if we have a timer running
|
# check to see if we have a timer running
|
||||||
if self.timer_id == 0:
|
if self.timer_id == 0:
|
||||||
@ -112,8 +112,9 @@ class AlertsManager(QtCore.QObject):
|
|||||||
log.debug(u'timer event')
|
log.debug(u'timer event')
|
||||||
alertTab = self.parent.alertsTab
|
alertTab = self.parent.alertsTab
|
||||||
if event.timerId() == self.timer_id:
|
if event.timerId() == self.timer_id:
|
||||||
self.parent.preview_controller.parent.displayManager.addAlert(u'',
|
self.parent.previewController.parent.displayManager.addAlert(u'',
|
||||||
alertTab.location)
|
alertTab.location)
|
||||||
self.killTimer(self.timer_id)
|
self.killTimer(self.timer_id)
|
||||||
self.timer_id = 0
|
self.timer_id = 0
|
||||||
self.generateAlert()
|
self.generateAlert()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user