openlp-core team mailing list archive
-
openlp-core team
-
Mailing list archive
-
Message #00038
[Merge] lp:~raoul-snyman/openlp/dualdisplay into lp:openlp
Raoul Snyman has proposed merging lp:~raoul-snyman/openlp/dualdisplay into lp:openlp.
Requested reviews:
openlp.org Core (openlp-core)
--
https://code.launchpad.net/~raoul-snyman/openlp/dualdisplay/+merge/6086
Your team openlp.org Core is subscribed to branch lp:openlp.
=== modified file 'openlp.pyw'
--- openlp.pyw 2009-04-28 19:40:51 +0000
+++ openlp.pyw 2009-05-01 11:50:09 +0000
@@ -52,9 +52,11 @@
self.processEvents()
screens = []
# Decide how many screens we have and their size
- for screen in xrange (0 , self.desktop().numScreens()):
- screens.insert(screen, (screen+1, self.desktop().availableGeometry(screen+1)))
- log.info(u'Screen %d found with resolution %s', screen+1, self.desktop().availableGeometry(screen+1))
+ for screen in xrange(0, self.desktop().numScreens()):
+ screens.append({u'number': screen,
+ u'size': self.desktop().availableGeometry(screen),
+ u'primary': (self.desktop().primaryScreen() == screen)})
+ log.info(u'Screen %d found with resolution %s', screen, self.desktop().availableGeometry(screen))
# start the main app window
self.main_window = MainWindow(screens)
self.main_window.show()
=== modified file 'openlp/core/lib/rendermanager.py'
--- openlp/core/lib/rendermanager.py 2009-04-25 06:38:21 +0000
+++ openlp/core/lib/rendermanager.py 2009-05-01 11:50:09 +0000
@@ -38,9 +38,9 @@
self.screen_list = screen_list
self.theme_manager = theme_manager
self.displays = len(screen_list)
- self.current_display = 1
+ self.current_display = 0
self.renderer = Renderer(None)
- self.calculate_default(self.screen_list[self.current_display-1][1])
+ self.calculate_default(self.screen_list[self.current_display]['size'])
self.frame = None
def set_default_theme(self, theme):
=== modified file 'openlp/core/lib/settingstab.py'
--- openlp/core/lib/settingstab.py 2009-04-15 04:58:51 +0000
+++ openlp/core/lib/settingstab.py 2009-05-01 11:50:09 +0000
@@ -33,26 +33,51 @@
self.tabTitle = title
self.setupUi()
self.retranslateUi()
+ self.initialise()
if title == None:
- self.config = PluginConfig(u"Main")
+ self.config = PluginConfig(u'Main')
else:
self.config = PluginConfig(str(title))
self.load()
def setTitle(self, title):
+ """
+ Set the title of the tab.
+ """
self.tabTitle = title
def title(self):
+ """
+ Get the title of the tab.
+ """
return self.tabTitle
def setupUi(self):
+ """
+ Setup the tab's interface.
+ """
pass
def retranslateUi(self):
+ """
+ Setup the interface translation strings.
+ """
+ pass
+
+ def initialise(self):
+ """
+ Do any extra initialisation here.
+ """
pass
def load(self):
+ """
+ Load settings from disk.
+ """
pass
def save(self):
+ """
+ Save settings to disk.
+ """
pass
=== modified file 'openlp/core/ui/generaltab.py'
--- openlp/core/ui/generaltab.py 2009-04-10 05:59:40 +0000
+++ openlp/core/ui/generaltab.py 2009-05-01 11:50:09 +0000
@@ -29,8 +29,8 @@
GeneralTab is the general settings tab in the settings dialog.
"""
def __init__(self, screen_list):
+ self.screen_list = screen_list
SettingsTab.__init__(self, translate(u'GeneralTab', u'General'))
- self.screen_list = screen_list
def setupUi(self):
self.setObjectName(u'GeneralTab')
@@ -55,8 +55,6 @@
self.MonitorLayout.addWidget(self.MonitorLabel)
self.MonitorComboBox = QtGui.QComboBox(self.MonitorGroupBox)
self.MonitorComboBox.setObjectName(u'MonitorComboBox')
- self.MonitorComboBox.addItem(QtCore.QString())
- self.MonitorComboBox.addItem(QtCore.QString())
self.MonitorLayout.addWidget(self.MonitorComboBox)
self.GeneralLeftLayout.addWidget(self.MonitorGroupBox)
self.BlankScreenGroupBox = QtGui.QGroupBox(self.GeneralLeftWidget)
@@ -121,8 +119,6 @@
def retranslateUi(self):
self.MonitorGroupBox.setTitle(translate(u'GeneralTab', u'Monitors'))
self.MonitorLabel.setText(translate(u'GeneralTab', u'Select monitor for output display:'))
- self.MonitorComboBox.setItemText(0, translate(u'GeneralTab', u'Monitor 1 on X11 Windowing System'))
- self.MonitorComboBox.setItemText(1, translate(u'GeneralTab', u'Monitor 2 on X11 Windowing System'))
self.BlankScreenGroupBox.setTitle(translate(u'GeneralTab', u'Blank Screen'))
self.WarningCheckBox.setText(translate(u'GeneralTab', u'Show warning on startup'))
self.AutoOpenGroupBox.setTitle(translate(u'GeneralTab', u'Auto Open Last Service'))
@@ -132,3 +128,11 @@
self.UsernameLabel.setText(translate(u'GeneralTab', u'SongSelect Username:'))
self.PasswordLabel.setText(translate(u'GeneralTab', u'SongSelect Password:'))
+ def initialise(self):
+ for screen in self.screen_list:
+ screen_name = translate(u'GeneralTab', u'Screen') + u' ' + \
+ str(screen['number'] + 1)
+ if screen['primary']:
+ screen_name = screen_name + u' (' + \
+ translate(u'GeneralTab', u'primary') + u')'
+ self.MonitorComboBox.addItem(screen_name)
=== modified file 'openlp/core/ui/maindisplay.py'
--- openlp/core/ui/maindisplay.py 2009-04-28 19:40:51 +0000
+++ openlp/core/ui/maindisplay.py 2009-05-01 11:50:09 +0000
@@ -24,32 +24,35 @@
class MainDisplay(QtGui.QWidget):
- def __init__(self, screens, parent=None):
- QtGui.QWidget.__init__(self, parent)
- self.setWindowTitle(u'OpenLP Display')
- self.screens = screens
- self.imagesize = screens[0][1]
- self.display = QtGui.QLabel(self)
- #self.showMinimized()
+ def __init__(self, parent, screens):
+ QtGui.QWidget.__init__(self, parent)
+ self.setWindowTitle(u'OpenLP Display')
+ self.screens = screens
+ self.display = QtGui.QLabel(self)
- def initialView(self):
- self.display.setGeometry((self.imagesize.width()-429)/2, (self.imagesize.height()-429)/2, 429, 429)
- self.display.setPixmap(QtGui.QPixmap("openlp2.png"))
- self.showMaximized()
- print len(self.screens)
- print self.isEnabled()
- print self.isVisible()
- print self.geometry()
- #if len(self.screens) > 0:
+ def setup(self, screenNumber):
+ """
+ Sets up the screen on a particular screen.
+ @param (integer) screen This is the screen number.
+ """
+ screen = self.screens[screenNumber]
+ if screen['number'] != screenNumber:
+ # We will most probably never actually hit this bit, but just in
+ # case the index in the list doesn't match the screen number, we
+ # search for it.
+ for scrn in self.screens:
+ if scrn['number'] == screenNumber:
+ screen = scrn
+ break
+ self.setGeometry(screen['size'])
+ if not screen['primary']:
self.showFullScreen()
- self.show()
+ else:
+ self.hide()
def frameView(self, frame):
- self.display.setGeometry(0, 0, imagesize.width(), imagesize.height())
- self.display.setPixmap(QtGui.QPixmap(frame))
+ self.display.setGeometry(0, 0, imagesize.width(), imagesize.height())
+ self.display.setPixmap(QtGui.QPixmap(frame))
def kill(self):
pass
-
-
-
=== modified file 'openlp/core/ui/mainwindow.py'
--- openlp/core/ui/mainwindow.py 2009-04-28 19:20:03 +0000
+++ openlp/core/ui/mainwindow.py 2009-05-01 12:32:08 +0000
@@ -37,7 +37,7 @@
def __init__(self, screens):
self.main_window = QtGui.QMainWindow()
- self.main_display = MainDisplay(screens, self.main_window)
+ self.main_display = MainDisplay(None, screens)
self.screen_list = screens
self.EventManager = EventManager()
self.alert_form = AlertForm()
@@ -421,7 +421,7 @@
def show(self):
self.main_window.showMaximized()
- self.main_display.initialView()
+ self.main_display.setup(0)
self.main_display.show()
def onHelpAboutItemClicked(self):
=== modified file 'openlp/core/ui/settingsform.py'
--- openlp/core/ui/settingsform.py 2009-04-09 18:50:20 +0000
+++ openlp/core/ui/settingsform.py 2009-05-01 11:50:09 +0000
@@ -29,7 +29,7 @@
log = logging.getLogger('SettingsForm')
-class SettingsForm(QtGui.QDialog, Ui_SettingsDialog):
+class SettingsForm(QtGui.QDialog, Ui_SettingsDialog):
def __init__(self, screen_list, parent=None):
QtGui.QDialog.__init__(self, parent)
Follow ups