move display to core

This commit is contained in:
Tim Bentley 2010-04-27 20:59:44 +01:00
parent b0763714c8
commit d0c6cf9639
8 changed files with 309 additions and 155 deletions

View File

@ -33,6 +33,7 @@ from maindisplay import DisplayManager
from amendthemeform import AmendThemeForm from amendthemeform import AmendThemeForm
from slidecontroller import SlideController from slidecontroller import SlideController
from splashscreen import SplashScreen from splashscreen import SplashScreen
from displaytab import DisplayTab
from generaltab import GeneralTab from generaltab import GeneralTab
from themestab import ThemesTab from themestab import ThemesTab
from aboutform import AboutForm from aboutform import AboutForm

View File

@ -172,7 +172,7 @@ class GeneralTab(SettingsTab):
def retranslateUi(self): def retranslateUi(self):
self.MonitorGroupBox.setTitle(self.trUtf8('Monitors')) self.MonitorGroupBox.setTitle(self.trUtf8('Monitors'))
self.MonitorLabel.setText(self.trUtf8('Select monitor for output display:')) self.MonitorLabel.setText(self.trUtf8('Select monitor for output display:'))
self.DisplayOnMonitorCheck.setText(self.trUtf8('Display if in single screen')) self.DisplayOnMonitorCheck.setText(self.trUtf8('Display if a single screen'))
self.StartupGroupBox.setTitle(self.trUtf8('Application Startup')) self.StartupGroupBox.setTitle(self.trUtf8('Application Startup'))
self.WarningCheckBox.setText(self.trUtf8('Show blank screen warning')) self.WarningCheckBox.setText(self.trUtf8('Show blank screen warning'))
self.AutoOpenCheckBox.setText(self.trUtf8('Automatically open the last service')) self.AutoOpenCheckBox.setText(self.trUtf8('Automatically open the last service'))

View File

@ -214,7 +214,6 @@ class MainDisplay(DisplayWidget):
def hideThemeDisplay(self): def hideThemeDisplay(self):
log.debug(u'hideDisplay') log.debug(u'hideDisplay')
a=c
self.display_image.setPixmap(self.transparent) self.display_image.setPixmap(self.transparent)
self.display_alert.setPixmap(self.transparent) self.display_alert.setPixmap(self.transparent)
self.display_text.setPixmap(self.transparent) self.display_text.setPixmap(self.transparent)
@ -336,6 +335,8 @@ class VideoDisplay(Phonon.VideoWidget):
self.audioObject = Phonon.AudioOutput(Phonon.VideoCategory) self.audioObject = Phonon.AudioOutput(Phonon.VideoCategory)
Phonon.createPath(self.mediaObject, self) Phonon.createPath(self.mediaObject, self)
Phonon.createPath(self.mediaObject, self.audioObject) Phonon.createPath(self.mediaObject, self.audioObject)
self.setWindowFlags(QtCore.Qt.WindowStaysOnTopHint \
| QtCore.Qt.FramelessWindowHint | QtCore.Qt.Dialog)
QtCore.QObject.connect(Receiver.get_receiver(), QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'videodisplay_start'), self.onMediaQueue) QtCore.SIGNAL(u'videodisplay_start'), self.onMediaQueue)
QtCore.QObject.connect(Receiver.get_receiver(), QtCore.QObject.connect(Receiver.get_receiver(),

View File

@ -80,6 +80,10 @@ class ScreenList(object):
""" """
log.debug(u'set_override_display') log.debug(u'set_override_display')
self.current = copy.deepcopy(self.override) self.current = copy.deepcopy(self.override)
print self.screen_list
print self.current
self.current[u'primary'] = True
print self.current
self.preview = copy.deepcopy(self.current) self.preview = copy.deepcopy(self.current)
def reset_current_display(self): def reset_current_display(self):

View File

@ -27,7 +27,7 @@ import logging
from PyQt4 import QtGui from PyQt4 import QtGui
from openlp.core.ui import GeneralTab, ThemesTab from openlp.core.ui import GeneralTab, ThemesTab, DisplayTab
from settingsdialog import Ui_SettingsDialog from settingsdialog import Ui_SettingsDialog
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
@ -43,6 +43,9 @@ class SettingsForm(QtGui.QDialog, Ui_SettingsDialog):
# Themes tab # Themes tab
self.ThemesTab = ThemesTab(mainWindow) self.ThemesTab = ThemesTab(mainWindow)
self.addTab(u'Themes', self.ThemesTab) self.addTab(u'Themes', self.ThemesTab)
# Display tab
self.DisplayTab = DisplayTab(screens)
self.addTab(u'Display', self.DisplayTab)
def addTab(self, name, tab): def addTab(self, name, tab):
log.info(u'Adding %s tab' % tab.tabTitle) log.info(u'Adding %s tab' % tab.tabTitle)

View File

@ -44,7 +44,8 @@ class DisplayForm(QtGui.QDialog, Ui_DisplaysDialog):
self.setupUi(self) self.setupUi(self)
def initialise(self): def initialise(self):
self.Xpos.setText(unicode(self.screens.current[u'size'].x())) xpos = int(self.config.get_config(u'x position', unicode(self.screens.current[u'size'].x())))
self.Xpos.setText(xpos)
self.Ypos.setText(unicode(self.screens.current[u'size'].y())) self.Ypos.setText(unicode(self.screens.current[u'size'].y()))
self.Height.setText(unicode(self.screens.current[u'size'].height())) self.Height.setText(unicode(self.screens.current[u'size'].height()))
self.Width.setText(unicode(self.screens.current[u'size'].width())) self.Width.setText(unicode(self.screens.current[u'size'].width()))

View File

@ -1,151 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>DisplaysDialog</class>
<widget class="QWidget" name="DisplaysDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>327</width>
<height>224</height>
</rect>
</property>
<property name="windowTitle">
<string>Amend Display Settings</string>
</property>
<widget class="QPushButton" name="OkpushButton">
<property name="geometry">
<rect>
<x>210</x>
<y>200</y>
<width>97</width>
<height>24</height>
</rect>
</property>
<property name="text">
<string>Ok</string>
</property>
</widget>
<widget class="QWidget" name="">
<property name="geometry">
<rect>
<x>10</x>
<y>0</y>
<width>301</width>
<height>191</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QGroupBox" name="CurrentGroupBox">
<property name="title">
<string>Default Settings</string>
</property>
<widget class="QWidget" name="layoutWidget">
<property name="geometry">
<rect>
<x>20</x>
<y>30</y>
<width>261</width>
<height>17</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="Xpos">
<property name="text">
<string>0</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="Ypos">
<property name="text">
<string>0</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="Height">
<property name="text">
<string>0</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="Width">
<property name="text">
<string>0</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
<item>
<widget class="QGroupBox" name="CurrentGroupBox_2">
<property name="title">
<string>Amend Settings</string>
</property>
<widget class="QWidget" name="layoutWidget">
<property name="geometry">
<rect>
<x>20</x>
<y>30</y>
<width>261</width>
<height>27</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLineEdit" name="XposEdit"/>
</item>
<item>
<widget class="QLineEdit" name="YposEdit"/>
</item>
<item>
<widget class="QLineEdit" name="HeightEdit"/>
</item>
<item>
<widget class="QLineEdit" name="WidthEdit"/>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
</widget>
</widget>
<resources/>
<connections>
<connection>
<sender>OkpushButton</sender>
<signal>pressed()</signal>
<receiver>DisplaysDialog</receiver>
<slot>close()</slot>
<hints>
<hint type="sourcelabel">
<x>258</x>
<y>211</y>
</hint>
<hint type="destinationlabel">
<x>163</x>
<y>111</y>
</hint>
</hints>
</connection>
</connections>
</ui>

View File

@ -0,0 +1,295 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>DisplaysDialog</class>
<widget class="QWidget" name="DisplaysDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>620</width>
<height>716</height>
</rect>
</property>
<property name="windowTitle">
<string>Amend Display Settings</string>
</property>
<widget class="QWidget" name="layoutWidget">
<property name="geometry">
<rect>
<x>0</x>
<y>40</y>
<width>241</width>
<height>79</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QGroupBox" name="CurrentGroupBox">
<property name="title">
<string>Default Settings</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<layout class="QVBoxLayout" name="verticalLayout_6">
<item>
<widget class="QLabel" name="XLabel">
<property name="text">
<string>X</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="Xpos">
<property name="text">
<string>0</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_7">
<item>
<widget class="QLabel" name="YLabel">
<property name="text">
<string>Y</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="Ypos">
<property name="text">
<string>0</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_9">
<item>
<widget class="QLabel" name="HeightLabel">
<property name="maximumSize">
<size>
<width>100</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>Height</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="Height">
<property name="text">
<string>0</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_8">
<item>
<widget class="QLabel" name="WidthLabel">
<property name="text">
<string>Width</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="Width">
<property name="text">
<string>0</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<widget class="QGroupBox" name="CurrentGroupBox_2">
<property name="geometry">
<rect>
<x>0</x>
<y>130</y>
<width>248</width>
<height>87</height>
</rect>
</property>
<property name="maximumSize">
<size>
<width>500</width>
<height>16777215</height>
</size>
</property>
<property name="title">
<string>Amend Settings</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QLabel" name="XAmendLabel">
<property name="text">
<string>X</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="XposEdit">
<property name="maximumSize">
<size>
<width>50</width>
<height>16777215</height>
</size>
</property>
<property name="maxLength">
<number>4</number>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="QLabel" name="YAmendLabel">
<property name="text">
<string>Y</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="YposEdit">
<property name="maximumSize">
<size>
<width>50</width>
<height>16777215</height>
</size>
</property>
<property name="maxLength">
<number>4</number>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<widget class="QLabel" name="HeightAmendLabel">
<property name="text">
<string>Height</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="HeightEdit">
<property name="maximumSize">
<size>
<width>50</width>
<height>16777215</height>
</size>
</property>
<property name="maxLength">
<number>4</number>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_5">
<property name="sizeConstraint">
<enum>QLayout::SetMinimumSize</enum>
</property>
<item>
<widget class="QLabel" name="WidthAmendLabel">
<property name="maximumSize">
<size>
<width>100</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>Width</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="WidthEdit">
<property name="maximumSize">
<size>
<width>60</width>
<height>16777215</height>
</size>
</property>
</widget>
</item>
</layout>
</item>
</layout>
<zorder>layoutWidget</zorder>
<zorder>YAmendLabel</zorder>
<zorder>HeightAmendLabel</zorder>
<zorder>WidthAmendLabel</zorder>
<zorder>YAmendLabel</zorder>
</widget>
<widget class="QCheckBox" name="OverrideCheckBox">
<property name="geometry">
<rect>
<x>0</x>
<y>10</y>
<width>191</width>
<height>23</height>
</rect>
</property>
<property name="text">
<string>Override Output Display</string>
</property>
</widget>
</widget>
<resources/>
<connections/>
</ui>