Fix alerts and screen resizing

bzr-revno: 982
This commit is contained in:
Jon Tibble 2010-08-01 09:35:17 +01:00
commit 65c95057b7
3 changed files with 15 additions and 13 deletions

View File

@ -38,6 +38,7 @@ class GeneralTab(SettingsTab):
"""
self.screens = screens
self.monitorNumber = 0
self.overrideChanged = False
SettingsTab.__init__(self, u'General')
def preLoad(self):
@ -473,16 +474,18 @@ class GeneralTab(SettingsTab):
Receiver.send_message(u'slidecontroller_live_spin_delay',
self.timeoutSpinBox.value())
# Reset screens after initial definition
self.screens.override[u'size'] = QtCore.QRect(
int(self.customXValueEdit.text()),
int(self.customYValueEdit.text()),
int(self.customWidthValueEdit.text()),
int(self.customHeightValueEdit.text()))
if self.overrideCheckBox.isChecked():
self.screens.set_override_display()
Receiver.send_message(u'config_screen_changed')
else:
self.screens.reset_current_display()
if self.overrideChanged:
self.screens.override[u'size'] = QtCore.QRect(
int(self.customXValueEdit.text()),
int(self.customYValueEdit.text()),
int(self.customWidthValueEdit.text()),
int(self.customHeightValueEdit.text()))
if self.overrideCheckBox.isChecked():
self.screens.set_override_display()
Receiver.send_message(u'config_screen_changed')
else:
self.screens.reset_current_display()
Receiver.send_message(u'config_screen_changed')
def onOverrideCheckBoxToggled(self, checked):
"""

View File

@ -252,6 +252,7 @@ class MainDisplay(DisplayWidget):
self.size().height())
self.webView.setGeometry(0, 0, self.size().width(),
self.size().height())
self.alertText.setTextWidth(self.size().width())
#Build a custom splash screen
self.initialFrame = QtGui.QImage(
self.screen[u'size'].width(),
@ -322,7 +323,6 @@ class MainDisplay(DisplayWidget):
def setupAlert(self):
self.alertText = QtGui.QGraphicsTextItem()
self.alertText.setTextWidth(self.size().width())
self.alertText.setZValue(8)
self.scene.addItem(self.alertText)

View File

@ -88,8 +88,7 @@ class AlertsPlugin(Plugin):
def toggleAlertsState(self):
self.alertsActive = not self.alertsActive
QtCore.QSettings().setValue(
self.settingsSection + u'/active',
QtCore.QSettings().setValue(self.settingsSection + u'/active',
QtCore.QVariant(self.alertsActive))
def onAlertsTrigger(self):