← Back to team overview

openlp-core team mailing list archive

[Merge] lp:~trb143/openlp/servicing into lp:openlp

 

Tim Bentley has proposed merging lp:~trb143/openlp/servicing into lp:openlp.

Requested reviews:
    openlp.org Core (openlp-core)

 466. By Tim Bentley  2 minutes ago

    Rendering cleanup
465. By Tim Bentley 20 hours ago

    Theme Preview in ThemeTab
464. By Tim Bentley 21 hours ago

    Finish the Theme work to save all themes and replay them on reload
    Add rules as to which theme to use in the RenderManager
463. By Tim Bentley on 2009-05-18

    Fix Bible plugin to handle themes correctly when changed and removed.
462. By Tim Bentley on 2009-05-18

    Change Presentation Plugin to choose presentation software.
    Trial version until superfly gets his hands on it!
461. By Tim Bentley on 2009-05-18

    Fix comments from last merge
    Fix BiblePlugin Theme storage and usage
460. By Tim Bentley on 2009-05-17

    Corrections to Renderer to handle slides not lines
    Fixes to Bibleplugin to renderer multiple verses per slide
    Pass Bible Theme to RenderManager

-- 
https://code.launchpad.net/~trb143/openlp/servicing/+merge/6694
Your team openlp.org Core is subscribed to branch lp:openlp.
=== modified file 'openlp/core/lib/renderer.py'
--- openlp/core/lib/renderer.py	2009-05-17 15:24:02 +0000
+++ openlp/core/lib/renderer.py	2009-05-19 16:27:01 +0000
@@ -78,26 +78,19 @@
 
     def scale_bg_image(self):
         assert self._frame
-        image = QtGui.QImage(self._bg_image_filename)
-        # rescale and offset
-        imw = image.width()
-        imh = image.height()
-        dcw = self._frame.width()+1
-        dch = self._frame.height()
-        imratio = imw/float(imh)
-        dcratio = dcw/float(dch)
-        log.debug(u'Image scaling params %s %s %s %s %s %s', imw, imh, imratio, dcw, dch, dcratio)
-        if imratio > dcratio:
-            scale = dcw/float(imw)
-        elif imratio < dcratio:
-            scale = dch/float(imh)
-        else:
-            scale = dcw/float(imw) # either will do
-        neww = int(round(imw*scale))
-        newh = int(round(imh*scale))
-        self.background_offsetx=(dcw-neww)/2
-        self.background_offsety=(dch-newh)/2
-        self.bg_image=QtGui.QPixmap.fromImage(image.scaled(QtCore.QSize(neww, newh), Qt.Qt.KeepAspectRatio))
+        preview = QtGui.QPixmap(self._bg_image_filename)
+        width = self._frame.width()
+        height = self._frame.height()
+        preview = preview.scaled(width, height, QtCore.Qt.KeepAspectRatio, QtCore.Qt.SmoothTransformation)
+        realwidth = preview.width()
+        realheight = preview.height()
+        # and move it to the centre of the preview space
+        self.bg_image = QtGui.QPixmap(width, height)
+        self.bg_image.fill(QtCore.Qt.transparent)
+        painter = QtGui.QPainter(self.bg_image)
+        self.background_offsetx = (width - realwidth) / 2
+        self.background_offsety = (height - realheight) / 2
+        painter.drawPixmap(self.background_offsetx, self.background_offsety , preview)
 
     def set_frame_dest(self, frame_width, frame_height, preview=False):
         """
@@ -118,6 +111,7 @@
         """
         log.debug(u'format_slide %s', words)
         verses = []
+        words=words.replace("\r\n", "\n")
         verses_text = words.split(u'\n\n')
         for verse in verses_text:
             lines = verse.split(u'\n')

=== modified file 'openlp/core/lib/rendermanager.py'
--- openlp/core/lib/rendermanager.py	2009-05-17 15:24:02 +0000
+++ openlp/core/lib/rendermanager.py	2009-05-18 19:47:18 +0000
@@ -44,8 +44,6 @@
             print "%s:%s: %s" % (name, lineno, line.rstrip())
     return traceit
 
-
-
 class RenderManager:
     """
     Class to pull all Renderer interactions into one place.
@@ -64,14 +62,34 @@
         self.current_display = 0
         self.renderer = Renderer()
         self.calculate_default(self.screen_list[self.current_display]['size'])
+        self.theme = u''
+
+    def set_global_theme(self, global_theme, global_style = u'Global'):
+        self.global_theme = global_theme
+        self.global_style = global_style
+
+    def set_service_theme(self, service_theme):
+        self.service_theme = service_theme
 
     def set_override_theme(self, theme):
         log.debug(u'set override theme to %s',  theme)
-        if theme is not None:
-            self.theme = theme
+        if self.global_style == u'Global':
+            self.theme = self.global_theme
+        elif self.global_style == u'Service':
+            if self.service_theme == u'':
+                self.theme = self.global_theme
+            else:
+                self.theme = self.service_theme
         else:
-            self.theme = self.default_theme
-        if self.theme != self.renderer.theme_name:
+            if theme is not None:
+                self.theme = theme
+            elif self.global_style == u'Service':
+                if self.service_theme == u'':
+                    self.theme = self.global_theme
+                else:
+                    self.theme = self.service_theme
+
+        if self.theme is not self.renderer.theme_name:
             log.debug(u'theme is now %s',  self.theme)
             self.themedata = self.theme_manager.getThemeData(self.theme)
             self.calculate_default(self.screen_list[self.current_display]['size'])

=== modified file 'openlp/core/ui/maindisplay.py'
--- openlp/core/ui/maindisplay.py	2009-05-16 19:47:30 +0000
+++ openlp/core/ui/maindisplay.py	2009-05-18 19:04:25 +0000
@@ -24,7 +24,7 @@
 
 class MainDisplay(QtGui.QWidget):
 
-    def __init__(self, parent, screens):
+    def __init__(self, parent , screens):
         QtGui.QWidget.__init__(self, parent)
         self.setWindowTitle(u'OpenLP Display')
         self.screens = screens

=== modified file 'openlp/core/ui/mainwindow.py'
--- openlp/core/ui/mainwindow.py	2009-05-16 16:38:03 +0000
+++ openlp/core/ui/mainwindow.py	2009-05-18 19:04:25 +0000
@@ -43,7 +43,7 @@
         self.EventManager = EventManager()
         self.alert_form = AlertForm()
         self.about_form = AboutForm()
-        self.settings_form = SettingsForm(self.screen_list)
+        self.settings_form = SettingsForm(self.screen_list, self)
 
         pluginpath = os.path.split(os.path.abspath(__file__))[0]
         pluginpath = os.path.abspath(os.path.join(pluginpath, u'..', u'..', u'plugins'))

=== modified file 'openlp/core/ui/servicemanager.py'
--- openlp/core/ui/servicemanager.py	2009-05-16 16:38:03 +0000
+++ openlp/core/ui/servicemanager.py	2009-05-18 19:04:25 +0000
@@ -21,7 +21,7 @@
 import logging
 
 from PyQt4 import QtCore, QtGui
-
+from openlp.core.lib import PluginConfig
 from openlp.core.lib import OpenLPToolbar
 from openlp.core.lib import ServiceItem
 from openlp.core.lib import RenderManager
@@ -103,6 +103,9 @@
         QtCore.QObject.connect(self.ThemeComboBox,
             QtCore.SIGNAL("activated(int)"), self.onThemeComboBoxSelected)
 
+        self.config = PluginConfig(u'Main')
+        self.service_theme = self.config.get_config(u'theme service theme', u'')
+
     def contextMenuAction(self, base, icon, text, slot):
         """
         Utility method to help build context menus for plugins
@@ -142,7 +145,9 @@
         pass
 
     def onThemeComboBoxSelected(self, currentIndex):
-        self.RenderManager.default_theme = self.ThemeComboBox.currentText()
+        self.service_theme = self.ThemeComboBox.currentText()
+        self.RenderManager.set_service_theme(self.service_theme)
+        self.config.set_config(u'theme service theme', self.service_theme)
 
     def addServiceItem(self, item):
         self.serviceItems.append({u'data': item, u'order': len(self.serviceItems)+1})
@@ -224,7 +229,11 @@
         Called from ThemeManager when the Themes have changed
         """
         self.ThemeComboBox.clear()
+        self.ThemeComboBox.addItem(u'')
         for theme in theme_list:
             self.ThemeComboBox.addItem(theme)
-            self.RenderManager.default_theme = self.ThemeComboBox.currentText()
-
+        id = self.ThemeComboBox.findText(str(self.service_theme), QtCore.Qt.MatchExactly)
+        if id == -1:
+            id = 0 # Not Found
+            self.service_theme = u''
+        self.ThemeComboBox.setCurrentIndex(id)

=== modified file 'openlp/core/ui/settingsform.py'
--- openlp/core/ui/settingsform.py	2009-05-01 11:50:09 +0000
+++ openlp/core/ui/settingsform.py	2009-05-18 19:04:25 +0000
@@ -31,14 +31,14 @@
 
 class SettingsForm(QtGui.QDialog, Ui_SettingsDialog):
 
-    def __init__(self, screen_list, parent=None):
-        QtGui.QDialog.__init__(self, parent)
+    def __init__(self, screen_list, mainWindow, parent=None):
+        QtGui.QDialog.__init__(self, None)
         self.setupUi(self)
         # General tab
         self.GeneralTab = GeneralTab(screen_list)
         self.addTab(self.GeneralTab)
         # Themes tab
-        self.ThemesTab = ThemesTab()
+        self.ThemesTab = ThemesTab(mainWindow)
         self.addTab(self.ThemesTab)
         # Alert tab
         self.AlertsTab = AlertsTab()

=== modified file 'openlp/core/ui/thememanager.py'
--- openlp/core/ui/thememanager.py	2009-05-17 08:25:15 +0000
+++ openlp/core/ui/thememanager.py	2009-05-18 19:47:18 +0000
@@ -367,3 +367,7 @@
         frame = self.RenderManager.generate_preview(themedata)
         return frame
 
+    def getPreviewImage(self, theme):
+        log.debug(u'getPreviewImage %s ', theme)
+        image = os.path.join(self.path, theme + u'.png')
+        return image

=== modified file 'openlp/core/ui/themestab.py'
--- openlp/core/ui/themestab.py	2009-05-16 16:38:03 +0000
+++ openlp/core/ui/themestab.py	2009-05-18 19:47:18 +0000
@@ -3,7 +3,7 @@
 """
 OpenLP - Open Source Lyrics Projection
 Copyright (c) 2008 Raoul Snyman
-Portions copyright (c) 2008 Martin Thompson, Tim Bentley,
+Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley,
 
 This program is free software; you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free Software
@@ -22,13 +22,13 @@
 
 from openlp.core import translate
 from openlp.core.lib import SettingsTab
-from openlp.core.resources import *
 
 class ThemesTab(SettingsTab):
     """
     ThemesTab is the theme settings tab in the settings dialog.
     """
-    def __init__(self):
+    def __init__(self, parent):
+        self.parent = parent
         SettingsTab.__init__(self, u'Themes')
 
     def setupUi(self):
@@ -45,11 +45,8 @@
         self.GlobalGroupBoxLayout.setObjectName(u'GlobalGroupBoxLayout')
         self.DefaultComboBox = QtGui.QComboBox(self.GlobalGroupBox)
         self.DefaultComboBox.setObjectName(u'DefaultComboBox')
-        self.DefaultComboBox.addItem(QtCore.QString())
-        self.DefaultComboBox.addItem(QtCore.QString())
-        self.DefaultComboBox.addItem(QtCore.QString())
         self.GlobalGroupBoxLayout.addWidget(self.DefaultComboBox)
-        self.DefaultListView = QtGui.QListView(self.GlobalGroupBox)
+        self.DefaultListView = QtGui.QLabel(self.GlobalGroupBox)
         self.DefaultListView.setObjectName(u'DefaultListView')
         self.GlobalGroupBoxLayout.addWidget(self.DefaultListView)
         self.ThemesTabLayout.addWidget(self.GlobalGroupBox)
@@ -93,11 +90,20 @@
             self.GlobalLevelLabel)
         self.ThemesTabLayout.addWidget(self.LevelGroupBox)
 
+        QtCore.QObject.connect(self.SongLevelRadioButton,
+            QtCore.SIGNAL("pressed()"), self.onSongLevelButtonPressed)
+        QtCore.QObject.connect(self.ServiceLevelRadioButton,
+            QtCore.SIGNAL("pressed()"), self.onServiceLevelButtonPressed)
+        QtCore.QObject.connect(self.GlobalLevelRadioButton,
+            QtCore.SIGNAL("pressed()"), self.onGlobalLevelButtonPressed)
+
+        QtCore.QObject.connect(self.DefaultComboBox,
+            QtCore.SIGNAL("activated(int)"), self.onDefaultComboBoxChanged)
+
+        #self.DefaultListView.setScaledContents(True)
+
     def retranslateUi(self):
         self.GlobalGroupBox.setTitle(translate(u'ThemesTab', u'Global theme'))
-        self.DefaultComboBox.setItemText(0, translate(u'ThemesTab', u'African Sunset'))
-        self.DefaultComboBox.setItemText(1, translate(u'ThemesTab', u'Snowy Mountains'))
-        self.DefaultComboBox.setItemText(2, translate(u'ThemesTab', u'Wilderness'))
         self.LevelGroupBox.setTitle(translate(u'ThemesTab', u'Theme level'))
         self.SongLevelRadioButton.setText(translate(u'ThemesTab', u'Song level'))
         self.SongLevelLabel.setText(translate(u'ThemesTab', u'Use the theme from each song in the database. If a song doesn\'t have a theme associated with it, then use the service\'s theme. If the service doesn\'t have a theme, then use the global theme.'))
@@ -106,6 +112,40 @@
         self.GlobalLevelRadioButton.setText(translate(u'ThemesTab', u'Global level'))
         self.GlobalLevelLabel.setText(translate(u'ThemesTab', u'Use the global theme, overriding any themes associated wither either the service or the songs.'))
 
+    def load(self):
+        self.global_style = self.config.get_config(u'theme global style', u'Global')
+        self.global_theme = self.config.get_config(u'theme global theme', u'')
+        if self.global_style == u'Global':
+            self.GlobalLevelRadioButton.setChecked(True)
+        elif self.global_style == u'Service':
+            self.ServiceLevelRadioButton.setChecked(True)
+        else:
+            self.SongLevelRadioButton.setChecked(True)
+
+    def save(self):
+        self.config.set_config(u'theme global style', self.global_style )
+        self.config.set_config(u'theme global theme',self.global_theme)
+
+    def onSongLevelButtonPressed(self):
+        self.global_style= u'Song'
+        self.parent.RenderManager.set_global_theme(self.global_theme, self.global_style)
+
+    def onServiceLevelButtonPressed(self):
+        self.global_style= u'Service'
+        self.parent.RenderManager.set_global_theme(self.global_theme, self.global_style)
+
+    def onGlobalLevelButtonPressed(self):
+        self.global_style= u'Global'
+        self.parent.RenderManager.set_global_theme(self.global_theme, self.global_style)
+
+    def onDefaultComboBoxChanged(self, value):
+        self.global_theme = self.DefaultComboBox.currentText()
+        self.parent.RenderManager.set_global_theme(self.global_theme, self.global_style)
+        image = self.parent.ThemeManagerContents.getPreviewImage(str(self.global_theme))
+        preview = QtGui.QPixmap(str(image))
+        display = preview.scaled(300, 255, QtCore.Qt.KeepAspectRatio, QtCore.Qt.SmoothTransformation)
+        self.DefaultListView.setPixmap(display)
+
     def updateThemeList(self, theme_list):
         """
         Called from ThemeManager when the Themes have changed
@@ -113,3 +153,14 @@
         self.DefaultComboBox.clear()
         for theme in theme_list:
             self.DefaultComboBox.addItem(theme)
+        id = self.DefaultComboBox.findText(str(self.global_theme), QtCore.Qt.MatchExactly)
+        if id == -1:
+            id = 0 # Not Found
+            self.global_theme = u''
+        self.DefaultComboBox.setCurrentIndex(id)
+        self.parent.RenderManager.set_global_theme(self.global_theme, self.global_style)
+        if self.global_theme is not u'':
+            image = self.parent.ThemeManagerContents.getPreviewImage(str(self.global_theme))
+            preview = QtGui.QPixmap(str(image))
+            display = preview.scaled(300, 255, QtCore.Qt.KeepAspectRatio, QtCore.Qt.SmoothTransformation)
+            self.DefaultListView.setPixmap(display)

=== modified file 'openlp/plugins/bibles/lib/biblestab.py'
--- openlp/plugins/bibles/lib/biblestab.py	2009-05-17 15:24:02 +0000
+++ openlp/plugins/bibles/lib/biblestab.py	2009-05-18 16:11:59 +0000
@@ -3,7 +3,7 @@
 """
 OpenLP - Open Source Lyrics Projection
 Copyright (c) 2008 Raoul Snyman
-Portions copyright (c) 2008 Martin Thompson, Tim Bentley,
+Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley,
 
 This program is free software; you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free Software
@@ -18,7 +18,7 @@
 Place, Suite 330, Boston, MA 02111-1307 USA
 """
 
-from PyQt4 import QtCore, QtGui
+from PyQt4 import Qt, QtCore, QtGui
 
 from openlp.core import translate
 from openlp import  convertStringToBoolean
@@ -144,6 +144,8 @@
             QtCore.SIGNAL("pressed()"), self.onParagraphRadioButtonPressed)
         QtCore.QObject.connect(self.DisplayStyleComboBox,
             QtCore.SIGNAL("activated(int)"), self.onDisplayStyleComboBoxChanged)
+        QtCore.QObject.connect(self.BibleThemeComboBox,
+            QtCore.SIGNAL("activated(int)"), self.onBibleThemeComboBoxChanged)
 
     def retranslateUi(self):
         self.VerseDisplayGroupBox.setTitle(translate('SettingsForm', 'Verse Display'))
@@ -160,6 +162,9 @@
         self.BibleSearchGroupBox.setTitle(translate('SettingsForm', 'Search'))
         self.BibleSearchCheckBox.setText(translate('SettingsForm', 'Search-as-you-type'))
 
+    def onBibleThemeComboBoxChanged(self):
+        self.bible_theme = self.BibleThemeComboBox.currentText()
+
     def onDisplayStyleComboBoxChanged(self):
         self.display_style = self.DisplayStyleComboBox.currentIndex()
 
@@ -182,11 +187,11 @@
             self.bible_search = True
 
     def load(self):
-        self.paragraph_style = convertStringToBoolean(self.config.get_config('paragraph style', u'True'))
-        self.show_new_chapters = convertStringToBoolean(self.config.get_config('display new chapter', u"False"))
-        self.display_style = int(self.config.get_config('display brackets', '0'))
-        self.bible_theme = int(self.config.get_config('bible theme', '0'))
-        self.bible_search = convertStringToBoolean(self.config.get_config('search as type', u'True'))
+        self.paragraph_style = convertStringToBoolean(self.config.get_config(u'paragraph style', u'True'))
+        self.show_new_chapters = convertStringToBoolean(self.config.get_config(u'display new chapter', u"False"))
+        self.display_style = int(self.config.get_config(u'display brackets', u'0'))
+        self.bible_theme = self.config.get_config(u'bible theme', u'0')
+        self.bible_search = convertStringToBoolean(self.config.get_config(u'search as type', u'True'))
         if self.paragraph_style:
             self.ParagraphRadioButton.setChecked(True)
         else:
@@ -194,23 +199,24 @@
         self.NewChaptersCheckBox.setChecked(self.show_new_chapters)
         self.DisplayStyleComboBox.setCurrentIndex(self.display_style)
         self.BibleSearchCheckBox.setChecked(self.bible_search)
-        if self.bible_theme == 0:  # must be new set to first
-            self.BibleThemeComboBox.setCurrentIndex(self.bible_theme)
-        else:
-            pass # TODO need to code
-        self.bible_theme = None
 
     def save(self):
-        self.config.set_config("paragraph style", str(self.paragraph_style))
-        self.config.set_config("display new chapter", str(self.show_new_chapters))
-        self.config.set_config("display brackets", str(self.display_style))
-        self.config.set_config("search as type", str(self.bible_search))
-        self.config.set_config("bible theme", str(self.bible_theme))
+        self.config.set_config(u'paragraph style', str(self.paragraph_style))
+        self.config.set_config(u'display new chapter', str(self.show_new_chapters))
+        self.config.set_config(u'display brackets', str(self.display_style))
+        self.config.set_config(u'search as type', str(self.bible_search))
+        self.config.set_config(u'bible theme', str(self.bible_theme))
 
     def updateThemeList(self, theme_list):
         """
         Called from ThemeManager when the Themes have changed
         """
         self.BibleThemeComboBox.clear()
+        self.BibleThemeComboBox.addItem(u'')
         for theme in theme_list:
             self.BibleThemeComboBox.addItem(theme)
+        id = self.BibleThemeComboBox.findText(str(self.bible_theme), QtCore.Qt.MatchExactly)
+        if id == -1:
+            id = 0 # Not Found
+            self.bible_theme = u''
+        self.BibleThemeComboBox.setCurrentIndex(id)

=== modified file 'openlp/plugins/bibles/lib/mediaitem.py'
--- openlp/plugins/bibles/lib/mediaitem.py	2009-05-17 15:24:02 +0000
+++ openlp/plugins/bibles/lib/mediaitem.py	2009-05-18 16:11:59 +0000
@@ -398,7 +398,10 @@
             if len(raw_footer) <= 1:
                 raw_footer.append(book)
 
-        service_item.theme = self.parent.bibles_tab.bible_theme
+        if  len(self.parent.bibles_tab.bible_theme)  == 0:
+            service_item.theme = None
+        else:
+            service_item.theme = self.parent.bibles_tab.bible_theme
         raw_slides.append(bible_text)
         service_item.raw_slides = raw_slides
         service_item.raw_footer = raw_footer

=== modified file 'openlp/plugins/media/lib/mediaitem.py'
--- openlp/plugins/media/lib/mediaitem.py	2009-05-16 16:38:03 +0000
+++ openlp/plugins/media/lib/mediaitem.py	2009-05-18 04:41:49 +0000
@@ -100,7 +100,7 @@
         files = QtGui.QFileDialog.getOpenFileNames(None,
             translate('MediaMediaItem', u'Select Media(s) items'),
             self.parent.config.get_last_dir(),
-            u'Images (*.avi *.mpeg);;Audio (*.mp3 *.ogg *.wma);;All files (*)')
+            u'Videos (*.avi *.mpeg);;Audio (*.mp3 *.ogg *.wma);;All files (*)')
         if len(files) > 0:
             self.loadMediaList(files)
             dir, filename = os.path.split(str(files[0]))

=== modified file 'openlp/plugins/presentations/lib/__init__.py'
--- openlp/plugins/presentations/lib/__init__.py	2009-03-19 17:31:33 +0000
+++ openlp/plugins/presentations/lib/__init__.py	2009-05-18 16:04:34 +0000
@@ -20,5 +20,6 @@
 
 from filelistdata import FileListData
 from mediaitem import PresentationMediaItem
+from presentationtab import PresentationTab
 
-__all__ = ['PresentationMediaItem', 'FileListData']
+__all__ = ['PresentationMediaItem', 'FileListData', 'PresentationTab']

=== modified file 'openlp/plugins/presentations/lib/mediaitem.py'
--- openlp/plugins/presentations/lib/mediaitem.py	2009-03-19 17:31:33 +0000
+++ openlp/plugins/presentations/lib/mediaitem.py	2009-05-18 19:04:25 +0000
@@ -39,87 +39,111 @@
     def __init__(self, parent, icon, title):
         MediaManagerItem.__init__(self, parent, icon, title)
 
-    def setupUi(self):        
+    def setupUi(self):
                 # Add a toolbar
         self.addToolbar()
         # Create buttons for the toolbar
         ## New Presentation Button ##
         self.addToolbarButton(
-            translate('PresentationsMediaItem',u'New presentations'), 
+            translate('PresentationsMediaItem',u'New presentations'),
             translate('PresentationsMediaItem',u'Load presentations into openlp.org'),
             ':/presentations/presentation_load.png', self.onPresentationNewClick, 'PresentationNewItem')
         ## Delete Presentation Button ##
         self.addToolbarButton(
-            translate('PresentationsMediaItem',u'Delete Presentation'), 
+            translate('PresentationsMediaItem',u'Delete Presentation'),
             translate('PresentationsMediaItem',u'Delete the selected presentation'),
             ':/presentations/presentation_delete.png', self.onPresentationDeleteClick, 'PresentationDeleteItem')
         ## Separator Line ##
         self.addToolbarSeparator()
         ## Preview Presentation Button ##
         self.addToolbarButton(
-            translate('PresentationsMediaItem',u'Preview Presentation'), 
+            translate('PresentationsMediaItem',u'Preview Presentation'),
             translate('PresentationsMediaItem',u'Preview the selected Presentation'),
             ':/system/system_preview.png', self.onPresentationPreviewClick, 'PresentationPreviewItem')
         ## Live Presentation Button ##
         self.addToolbarButton(
-            translate('PresentationsMediaItem',u'Go Live'), 
+            translate('PresentationsMediaItem',u'Go Live'),
             translate('PresentationsMediaItem',u'Send the selected presentation live'),
             ':/system/system_live.png', self.onPresentationLiveClick, 'PresentationLiveItem')
         ## Add Presentation Button ##
         self.addToolbarButton(
             translate('PresentationsMediaItem',u'Add Presentation To Service'),
-            translate('PresentationsMediaItem',u'Add the selected Presentations(s) to the service'), 
+            translate('PresentationsMediaItem',u'Add the selected Presentations(s) to the service'),
             ':/system/system_add.png',self.onPresentationAddClick, 'PresentationsAddItem')
         ## Add the Presentationlist widget ##
-        
+
+        self.PresentationWidget = QtGui.QWidget(self)
+        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
+        sizePolicy.setHorizontalStretch(0)
+        sizePolicy.setVerticalStretch(0)
+        sizePolicy.setHeightForWidth(self.PresentationWidget.sizePolicy().hasHeightForWidth())
+        self.PresentationWidget.setSizePolicy(sizePolicy)
+        self.PresentationWidget.setObjectName('PresentationWidget')
+        self.DisplayLayout = QtGui.QGridLayout(self.PresentationWidget)
+        self.DisplayLayout.setObjectName('DisplayLayout')
+        self.DisplayTypeComboBox = QtGui.QComboBox(self.PresentationWidget)
+        self.DisplayTypeComboBox.setObjectName('DisplayTypeComboBox')
+        self.DisplayLayout.addWidget(self.DisplayTypeComboBox, 0, 1, 1, 2)
+        self.DisplayTypeLabel = QtGui.QLabel(self.PresentationWidget)
+        self.DisplayTypeLabel.setObjectName('SearchTypeLabel')
+        self.DisplayLayout.addWidget(self.DisplayTypeLabel, 0, 0, 1, 1)
+
+        self.DisplayTypeLabel.setText(translate('PresentationMediaItem', u'Present using:'))
+
+        # Add the song widget to the page layout
+        self.PageLayout.addWidget(self.PresentationWidget)
+
         self.PresentationsListView = QtGui.QListView()
         self.PresentationsListView.setAlternatingRowColors(True)
         self.PresentationsListData = FileListData()
         self.PresentationsListView.setModel(self.PresentationsListData)
-        
+
         self.PageLayout.addWidget(self.PresentationsListView)
-        
+
         #define and add the context menu
         self.PresentationsListView.setContextMenuPolicy(QtCore.Qt.ActionsContextMenu)
 
         self.PresentationsListView.addAction(self.contextMenuAction(
-            self.PresentationsListView, ':/system/system_preview.png', 
+            self.PresentationsListView, ':/system/system_preview.png',
             translate('PresentationsMediaItem',u'&Preview presentations'), self.onPresentationPreviewClick))
         self.PresentationsListView.addAction(self.contextMenuAction(
-            self.PresentationsListView, ':/system/system_live.png', 
+            self.PresentationsListView, ':/system/system_live.png',
             translate('PresentationsMediaItem',u'&Show Live'), self.onPresentationLiveClick))
         self.PresentationsListView.addAction(self.contextMenuAction(
-            self.PresentationsListView, ':/system/system_add.png', 
+            self.PresentationsListView, ':/system/system_add.png',
             translate('PresentationsMediaItem',u'&Add to Service'), self.onPresentationAddClick))
-        
+
     def initialise(self):
         list = self.parent.config.load_list(u'presentations')
         self.loadPresentationList(list)
+        self.DisplayTypeComboBox.addItem(u'Impress')
+        self.DisplayTypeComboBox.addItem(u'Powerpoint')
+        self.DisplayTypeComboBox.addItem(u'Keynote')
 
     def onPresentationNewClick(self):
-        files = QtGui.QFileDialog.getOpenFileNames(None, 
-            translate('PresentationsMediaItem', u'Select presentations(s)'), 
+        files = QtGui.QFileDialog.getOpenFileNames(None,
+            translate('PresentationsMediaItem', u'Select presentations(s)'),
             self.parent.config.get_last_dir(), u'Presentations (*.ppt *.pps *.odi)')
         if len(files) > 0:
             self.loadPresentationList(files)
             dir, filename = os.path.split(str(files[0]))
             self.parent.config.set_last_dir(dir)
             self.parent.config.set_list(u'Presentations', self.PresentationsListData.getFileList())
-            
+
     def getFileList(self):
         filelist = [item[0] for item in self.PresentationsListView];
-        return filelist            
+        return filelist
 
     def loadPresentationList(self, list):
         for files in list:
             self.PresentationsListData.addRow(files)
-            
+
     def onPresentationDeleteClick(self):
         indexes = self.PresentationsListView.selectedIndexes()
         for index in indexes:
             current_row = int(index.row())
             self.PresentationsListData.removeRow(current_row)
-        self.parent.config.set_list(u'Presentations', self.PresentationsListData.getFileList())            
+        self.parent.config.set_list(u'Presentations', self.PresentationsListData.getFileList())
 
     def onPresentationPreviewClick(self):
         pass
@@ -128,4 +152,4 @@
         pass
 
     def onPresentationAddClick(self):
-        pass        
+        pass

=== modified file 'openlp/plugins/presentations/presentationplugin.py'
--- openlp/plugins/presentations/presentationplugin.py	2009-03-22 07:13:34 +0000
+++ openlp/plugins/presentations/presentationplugin.py	2009-05-18 16:04:34 +0000
@@ -3,7 +3,7 @@
 """
 OpenLP - Open Source Lyrics Projection
 Copyright (c) 2008 Raoul Snyman
-Portions copyright (c) 2008 Martin Thompson, Tim Bentley,
+Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley,
 
 This program is free software; you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free Software
@@ -22,9 +22,8 @@
 
 from PyQt4 import QtCore, QtGui
 
-from openlp.core.resources import *
 from openlp.core.lib import Plugin,  MediaManagerItem
-from openlp.plugins.presentations.lib import PresentationMediaItem
+from openlp.plugins.presentations.lib import PresentationMediaItem, PresentationTab
 
 class PresentationPlugin(Plugin):
 
@@ -38,7 +37,8 @@
             QtGui.QIcon.Normal, QtGui.QIcon.Off)
 
     def get_settings_tab(self):
-        pass
+        self.presentation_tab = PresentationTab()
+        return self.presentation_tab
 
     def get_media_manager_item(self):
         # Create the MediaManagerItem object


Follow ups