diff --git a/openlp/core/ui/__init__.py b/openlp/core/ui/__init__.py index 7d2dfa0ba..f5fece1f0 100644 --- a/openlp/core/ui/__init__.py +++ b/openlp/core/ui/__init__.py @@ -52,6 +52,24 @@ class HideMode(object): Theme = 2 Screen = 3 +class Location(object): + """ + This is an enumeration class which specifies the different modes of hiding + the display. + + ``Top`` + Place the text at the top of the screen. + + ``Middle`` + Place the text in the middle of the screen. + + ``Bottom`` + Place the text at the bottom of the screen. + """ + Top = 0 + Middle = 1 + Bottom = 2 + from firsttimeform import FirstTimeForm from firsttimelanguageform import FirstTimeLanguageForm from themelayoutform import ThemeLayoutForm diff --git a/openlp/core/ui/maindisplay.py b/openlp/core/ui/maindisplay.py index 4077181ab..90203922f 100644 --- a/openlp/core/ui/maindisplay.py +++ b/openlp/core/ui/maindisplay.py @@ -37,7 +37,7 @@ from PyQt4.phonon import Phonon from openlp.core.lib import Receiver, build_html, ServiceItem, image_to_byte, \ translate, PluginManager -from openlp.core.ui import HideMode, ScreenList +from openlp.core.ui import HideMode, ScreenList, Location log = logging.getLogger(__name__) @@ -241,10 +241,10 @@ class MainDisplay(QtGui.QGraphicsView): alert_height = int(height.toString()) shrinkItem.resize(self.width(), alert_height) shrinkItem.setVisible(True) - if location == 1: + if location == Location.Middle: shrinkItem.move(self.screen[u'size'].left(), (self.screen[u'size'].height() - alert_height) / 2) - elif location == 2: + elif location == Location.Bottom: shrinkItem.move(self.screen[u'size'].left(), self.screen[u'size'].height() - alert_height) else: diff --git a/openlp/plugins/alerts/lib/alertstab.py b/openlp/plugins/alerts/lib/alertstab.py index 8fd2cb3aa..10bec702d 100644 --- a/openlp/plugins/alerts/lib/alertstab.py +++ b/openlp/plugins/alerts/lib/alertstab.py @@ -28,6 +28,7 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import SettingsTab, translate, Receiver +from openlp.core.ui import Location from openlp.core.lib.ui import UiStrings, create_valign_combo class AlertsTab(SettingsTab): @@ -159,7 +160,7 @@ class AlertsTab(SettingsTab): self.font_face = unicode(settings.value( u'font face', QtCore.QVariant(QtGui.QFont().family())).toString()) self.location = settings.value( - u'location', QtCore.QVariant(2)).toInt()[0] + u'location', QtCore.QVariant(Location.Bottom)).toInt()[0] settings.endGroup() self.fontSizeSpinBox.setValue(self.font_size) self.timeoutSpinBox.setValue(self.timeout)