Update images and rename some.

More changes to slidecontroller and friends
This commit is contained in:
Tim Bentley 2009-07-03 20:08:21 +01:00
parent 2e818e8fd6
commit f586d9bf5e
11 changed files with 65 additions and 37 deletions

View File

@ -257,7 +257,7 @@ class MediaManagerItem(QtGui.QWidget):
raise NotImplementedError(u'MediaManagerItem.generateSlideData needs to be defined by the plugin') raise NotImplementedError(u'MediaManagerItem.generateSlideData needs to be defined by the plugin')
def onPreviewClick(self): def onPreviewClick(self):
log.debug(self.PluginTextShort+u'Preview Requested') log.debug(self.PluginTextShort+u' Preview Requested')
service_item = ServiceItem(self.parent) service_item = ServiceItem(self.parent)
service_item.addIcon(u':/media/media_'+self.PluginTextShort.lower()+u'.png') service_item.addIcon(u':/media/media_'+self.PluginTextShort.lower()+u'.png')
self.generateSlideData(service_item) self.generateSlideData(service_item)

View File

@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License along with
this program; if not, write to the Free Software Foundation, Inc., 59 Temple this program; if not, write to the Free Software Foundation, Inc., 59 Temple
Place, Suite 330, Boston, MA 02111-1307 USA Place, Suite 330, Boston, MA 02111-1307 USA
""" """
from slidecontroller import BaseToolbar from slidecontroller import MasterToolbar
from slidecontrollermanager import SlideControllerManager from slidecontrollermanager import SlideControllerManager
from maindisplay import MainDisplay from maindisplay import MainDisplay
from amendthemeform import AmendThemeForm from amendthemeform import AmendThemeForm
@ -33,5 +33,5 @@ from servicemanager import ServiceManager
from thememanager import ThemeManager from thememanager import ThemeManager
from mainwindow import MainWindow from mainwindow import MainWindow
__all__ = ['SplashScreen', 'AboutForm', 'SettingsForm', 'BaseToolbar' __all__ = ['SplashScreen', 'AboutForm', 'SettingsForm', 'MasterToolbar'
'MainWindow', 'MainDisplay', 'SlideController', 'ServiceManager', 'ThemeManager', 'AmendThemeForm'] 'MainWindow', 'MainDisplay', 'SlideController', 'ServiceManager', 'ThemeManager', 'AmendThemeForm']

View File

@ -78,7 +78,7 @@ class MainDisplay(QtGui.QWidget):
def blankDisplay(self): def blankDisplay(self):
if not self.displayBlank: if not self.displayBlank:
self.displayBlank = True self.displayBlank = True
self.display.setPixmap(self.blankFrame) self.display.setPixmap(QtGui.QPixmap.fromImage(self.blankFrame))
else: else:
self.displayBlank = False self.displayBlank = False
self.frameView(self.frame) self.frameView(self.frame)

View File

@ -205,7 +205,7 @@ class MainWindow(object):
self.MediaManagerDock.setWindowIcon(icon) self.MediaManagerDock.setWindowIcon(icon)
self.MediaManagerDock.setFloating(False) self.MediaManagerDock.setFloating(False)
self.MediaManagerDock.setObjectName(u'MediaManagerDock') self.MediaManagerDock.setObjectName(u'MediaManagerDock')
self.MediaManagerDock.setMinimumWidth(250) self.MediaManagerDock.setMinimumWidth(300)
self.MediaManagerContents = QtGui.QWidget() self.MediaManagerContents = QtGui.QWidget()
self.MediaManagerContents.setObjectName(u'MediaManagerContents') self.MediaManagerContents.setObjectName(u'MediaManagerContents')
self.MediaManagerLayout = QtGui.QHBoxLayout(self.MediaManagerContents) self.MediaManagerLayout = QtGui.QHBoxLayout(self.MediaManagerContents)
@ -227,7 +227,7 @@ class MainWindow(object):
self.ServiceManagerDock.setFeatures( self.ServiceManagerDock.setFeatures(
QtGui.QDockWidget.AllDockWidgetFeatures) QtGui.QDockWidget.AllDockWidgetFeatures)
self.ServiceManagerDock.setObjectName(u'ServiceManagerDock') self.ServiceManagerDock.setObjectName(u'ServiceManagerDock')
self.ServiceManagerDock.setMinimumWidth(250) self.ServiceManagerDock.setMinimumWidth(300)
self.ServiceManagerContents = ServiceManager(self) self.ServiceManagerContents = ServiceManager(self)
self.ServiceManagerDock.setWidget(self.ServiceManagerContents) self.ServiceManagerDock.setWidget(self.ServiceManagerContents)
self.mainWindow.addDockWidget( self.mainWindow.addDockWidget(

View File

@ -33,16 +33,16 @@ class SlideList(QtGui.QTableWidget):
if type(event) == QtGui.QKeyEvent: if type(event) == QtGui.QKeyEvent:
#here accept the event and do something #here accept the event and do something
if event.key() == QtCore.Qt.Key_Up: if event.key() == QtCore.Qt.Key_Up:
self.parent.onSlideSelectedPrevious() self.parent.BaseToolbar.onSlideSelectedPrevious()
event.accept() event.accept()
elif event.key() == QtCore.Qt.Key_Down: elif event.key() == QtCore.Qt.Key_Down:
self.parent.onSlideSelectedNext() self.parent.BaseToolbar.onSlideSelectedNext()
event.accept() event.accept()
elif event.key() == QtCore.Qt.Key_PageUp: elif event.key() == QtCore.Qt.Key_PageUp:
self.parent.onSlideSelectedFirst() self.parent.BaseToolbar.onSlideSelectedFirst()
event.accept() event.accept()
elif event.key() == QtCore.Qt.Key_PageDown: elif event.key() == QtCore.Qt.Key_PageDown:
self.parent.onSlideSelectedLast() self.parent.BaseToolbar.onSlideSelectedLast()
event.accept() event.accept()
event.ignore() event.ignore()
else: else:
@ -60,6 +60,7 @@ class SlideController(QtGui.QWidget):
""" """
Set up the Slide Controller. Set up the Slide Controller.
""" """
self.toolbarList = {}
QtGui.QWidget.__init__(self, parent.mainWindow) QtGui.QWidget.__init__(self, parent.mainWindow)
self.isLive = isLive self.isLive = isLive
self.parent = parent self.parent = parent
@ -90,7 +91,8 @@ class SlideController(QtGui.QWidget):
self.PreviewListWidget.setObjectName(u'PreviewListWidget') self.PreviewListWidget.setObjectName(u'PreviewListWidget')
self.ControllerLayout.addWidget(self.PreviewListWidget) self.ControllerLayout.addWidget(self.PreviewListWidget)
# Plugin the Base Toolbar class # Plugin the Base Toolbar class
self.BaseToolbar = BaseToolbar(self.isLive) self.BaseToolbar = MasterToolbar(self.isLive)
self.registerToolbar(u'master', self.BaseToolbar)
self.Toolbar = self.BaseToolbar.getToolbar() self.Toolbar = self.BaseToolbar.getToolbar()
self.ControllerLayout.addWidget(self.Toolbar) self.ControllerLayout.addWidget(self.Toolbar)
sizeToolbarPolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, sizeToolbarPolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed,
@ -137,16 +139,46 @@ class SlideController(QtGui.QWidget):
self.BaseToolbar.SlidePreview = self.SlidePreview self.BaseToolbar.SlidePreview = self.SlidePreview
self.BaseToolbar.mainDisplay = self.parent.mainDisplay self.BaseToolbar.mainDisplay = self.parent.mainDisplay
def registerToolbar(self, handle,controller):
#store the handle name in lower case so no probems later
self.toolbarList[handle.lower()] = controller
def retrieveToolbar(self, handle):
print handle
print self.toolbarList
try:
toolbar = self.toolbarList[handle.lower()]
except:
toolbar = self.toolbarList[u'master']
toolbar.PreviewListWidget = self.PreviewListWidget
toolbar.SlidePreview = self.SlidePreview
toolbar.mainDisplay = self.parent.mainDisplay
print toolbar
return toolbar
def addServiceItem(self, item): def addServiceItem(self, item):
"""
helper method to pass item to correct toolbar
"""
self.BaseToolbar = self.retrieveToolbar(item.shortname)
self.ControllerLayout.removeWidget(self.Toolbar)
self.Toolbar = self.BaseToolbar.getToolbar()
self.ControllerLayout.addWidget(self.Toolbar)
self.BaseToolbar.addServiceItem(item) self.BaseToolbar.addServiceItem(item)
def addServiceManagerItem(self, item, slideno): def addServiceManagerItem(self, item, slideno):
"""
helper method to pass item to correct toolbar
"""
self.BaseToolbar.addServiceManagerItem(item, slideno) self.BaseToolbar.addServiceManagerItem(item, slideno)
class BaseToolbar(object): class MasterToolbar(QtCore.QObject):
"""
Class from which all tollbars should extend
"""
def __init__(self, isLive): def __init__(self, isLive):
self.Toolbar = None self.Toolbar = None
QtCore.QObject.__init__(self)
self.PreviewListWidget = QtGui.QListWidget() self.PreviewListWidget = QtGui.QListWidget()
self.isLive = isLive self.isLive = isLive
self.defineToolbar() self.defineToolbar()
@ -156,7 +188,6 @@ class BaseToolbar(object):
def defineToolbar(self): def defineToolbar(self):
# Controller toolbar # Controller toolbar
#self.Toolbar = OpenLPToolbar(self.Controller)
self.Toolbar = OpenLPToolbar(self) self.Toolbar = OpenLPToolbar(self)
sizeToolbarPolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, sizeToolbarPolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed,
QtGui.QSizePolicy.Fixed) QtGui.QSizePolicy.Fixed)
@ -171,11 +202,11 @@ class BaseToolbar(object):
u':/slides/slide_first.png', u':/slides/slide_first.png',
translate(u'SlideController', u'Move to first'), translate(u'SlideController', u'Move to first'),
self.onSlideSelectedFirst) self.onSlideSelectedFirst)
self.Toolbar.addToolbarButton(u'Last Slide', self.Toolbar.addToolbarButton(u'Previous Slide',
u':/slides/slide_previous.png', u':/slides/slide_previous.png',
translate(u'SlideController', u'Move to previous'), translate(u'SlideController', u'Move to previous'),
self.onSlideSelectedPrevious) self.onSlideSelectedPrevious)
self.Toolbar.addToolbarButton(u'First Slide', self.Toolbar.addToolbarButton(u'Next Slide',
u':/slides/slide_next.png', u':/slides/slide_next.png',
translate(u'SlideController', u'Move to next'), translate(u'SlideController', u'Move to next'),
self.onSlideSelectedNext) self.onSlideSelectedNext)
@ -221,7 +252,7 @@ class BaseToolbar(object):
""" """
Go to the last slide. Go to the last slide.
""" """
self.PreviewListWidget.selectRow(self.PreviewListWidget.rowCount()) self.PreviewListWidget.selectRow(self.PreviewListWidget.rowCount() - 1)
self.onSlideSelected() self.onSlideSelected()
def onBlankScreen(self): def onBlankScreen(self):
@ -244,7 +275,7 @@ class BaseToolbar(object):
if self.isLive: if self.isLive:
self.mainDisplay.frameView(frame) self.mainDisplay.frameView(frame)
def addServiceItem(self, serviceitem, slideno= 1): def addServiceItem(self, serviceitem, slideno = 1):
""" """
Loads a ServiceItem into the system from plugins Loads a ServiceItem into the system from plugins
Display the first slide Display the first slide

View File

@ -22,22 +22,19 @@ import os
from PyQt4 import QtCore, QtGui from PyQt4 import QtCore, QtGui
from openlp.core.lib import OpenLPToolbar, translate from openlp.core.lib import OpenLPToolbar, translate
from openlp.core.ui.slidecontroller import BaseToolbar from openlp.core.ui.slidecontroller import MasterToolbar
class ImageToolbar(BaseToolbar): class ImageToolbar(MasterToolbar):
def __init__(self, isLive): def __init__(self, isLive):
MasterToolbar.__init__(self, isLive)
self.Toolbar = None self.Toolbar = None
self.PreviewListView = QtGui.QListWidget()
self.isLive = isLive self.isLive = isLive
self.defineToolbar() self.defineToolbar()
def getToolbar(self):
return self.Toolbar
def defineToolbar(self): def defineToolbar(self):
# Controller toolbar # Controller toolbar
#self.Toolbar = OpenLPToolbar(self.Controller) self.Toolbar = OpenLPToolbar(self)
sizeToolbarPolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, sizeToolbarPolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed,
QtGui.QSizePolicy.Fixed) QtGui.QSizePolicy.Fixed)
sizeToolbarPolicy.setHorizontalStretch(0) sizeToolbarPolicy.setHorizontalStretch(0)
@ -49,11 +46,11 @@ class ImageToolbar(BaseToolbar):
u':/slides/slide_first.png', u':/slides/slide_first.png',
translate(u'SlideController', u'Move to first'), translate(u'SlideController', u'Move to first'),
self.onSlideSelectedFirst) self.onSlideSelectedFirst)
self.Toolbar.addToolbarButton(u'Last Slide', self.Toolbar.addToolbarButton(u'Previous Slide',
u':/slides/slide_previous.png', u':/slides/slide_previous.png',
translate(u'SlideController', u'Move to previous'), translate(u'SlideController', u'Move to previous'),
self.onSlideSelectedPrevious) self.onSlideSelectedPrevious)
self.Toolbar.addToolbarButton(u'First Slide', self.Toolbar.addToolbarButton(u'Next Slide',
u':/slides/slide_next.png', u':/slides/slide_next.png',
translate(u'SlideController', u'Move to next'), translate(u'SlideController', u'Move to next'),
self.onSlideSelectedNext) self.onSlideSelectedNext)
@ -69,24 +66,23 @@ class ImageToolbar(BaseToolbar):
self.onBlankScreen) self.onBlankScreen)
self.Toolbar.addSeparator() self.Toolbar.addSeparator()
self.Toolbar.addToolbarButton(u'Start Loop', self.Toolbar.addToolbarButton(u'Start Loop',
u':/slides/slide_last.png', u':/media/media_time.png',
translate(u'SlideController', u'Start continuous loop'), translate(u'SlideController', u'Start continuous loop'),
self.onStartLoop) self.onStartLoop)
self.Toolbar.addToolbarButton(u'Stop Loop', self.Toolbar.addToolbarButton(u'Stop Loop',
u':/slides/slide_last.png', u':/media/media_stop.png',
translate(u'SlideController', u'Start continuous loop'), translate(u'SlideController', u'Start continuous loop'),
self.onStopLoop) self.onStopLoop)
self.Toolbar.setSizePolicy(sizeToolbarPolicy) self.Toolbar.setSizePolicy(sizeToolbarPolicy)
self.ControllerLayout.addWidget(self.Toolbar)
def onStartLoop(self): def onStartLoop(self):
""" """
Go to the last slide. Go to the last slide.
""" """
pass print "onStartLoop"
def onStopLoop(self): def onStopLoop(self):
""" """
Go to the last slide. Go to the last slide.
""" """
pass print "onStopLoop"

View File

@ -54,10 +54,9 @@ class ImageMediaItem(MediaManagerItem):
# be instanced by the base MediaManagerItem # be instanced by the base MediaManagerItem
self.ListViewWithDnD_class = ImageListView self.ListViewWithDnD_class = ImageListView
MediaManagerItem.__init__(self, parent, icon, title) MediaManagerItem.__init__(self, parent, icon, title)
#create and install our own slide controllers #create and install our own slide controller toolbar
# live_controller = ImageSlideController(self.parent.slideManager.parent, True) imageToolbar = ImageToolbar(True)
# preview_controller = ImageSlideController(self.parent.slideManager.parent) parent.live_controller.registerToolbar(self.ConfigSection, imageToolbar)
# self.parent.slideManager.add_controllers(u'image', preview_controller, live_controller)
def initialise(self): def initialise(self):
self.ListView.setSelectionMode(QtGui.QAbstractItemView.ExtendedSelection) self.ListView.setSelectionMode(QtGui.QAbstractItemView.ExtendedSelection)

View File

Before

Width:  |  Height:  |  Size: 590 B

After

Width:  |  Height:  |  Size: 590 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 722 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 975 B

View File

@ -86,8 +86,10 @@
<file>media_presentation.png</file> <file>media_presentation.png</file>
<file>media_image.png</file> <file>media_image.png</file>
<file>media_song.png</file> <file>media_song.png</file>
<file>media_verse.png</file> <file>media_bible.png</file>
<file>media_video.png</file> <file>media_video.png</file>
<file>media_time.png</file>
<file>media_stop.png</file>
</qresource> </qresource>
<qresource prefix="messagebox" > <qresource prefix="messagebox" >
<file>messagebox_critical.png</file> <file>messagebox_critical.png</file>