From bef8369e860f24fafe27475de1e8cf12fe0502d7 Mon Sep 17 00:00:00 2001 From: Martin Thompson Date: Wed, 4 Mar 2009 21:52:32 +0000 Subject: [PATCH] Started splitting out the service manager bzr-revno: 366 --- openlp/core/lib/serviceitem.py | 2 +- openlp/core/ui/servicemanager.py | 17 +++++++++++++++++ openlp/plugins/images/imageplugin.py | 5 ++--- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/openlp/core/lib/serviceitem.py b/openlp/core/lib/serviceitem.py index c9a96b1d7..4a0447f82 100644 --- a/openlp/core/lib/serviceitem.py +++ b/openlp/core/lib/serviceitem.py @@ -41,7 +41,7 @@ class ServiceItem(): def get_parent_node(self): """ This method returns a parent node to be inserted into the Service - Manager. + Manager. At the moment this has to be a QAbstractListModel based class """ pass diff --git a/openlp/core/ui/servicemanager.py b/openlp/core/ui/servicemanager.py index 64c0bc7dc..2522605b5 100644 --- a/openlp/core/ui/servicemanager.py +++ b/openlp/core/ui/servicemanager.py @@ -22,14 +22,23 @@ import os from time import sleep from PyQt4 import * from PyQt4 import QtCore, QtGui +from PyQt4.QtCore import * from PyQt4.QtGui import * # from openlp.core.resources import * # from openlp.core.ui import AboutForm, AlertForm, SettingsForm, SlideController from openlp.core.lib import OpenLPToolbar +from openlp.core.lib import ServiceItem # from openlp.core import PluginManager import logging +class ServiceData(QAbstractListModel): + """ + Tree of items for an order of service. + Includes methods for reading and writing the contents to an OOS file + Root contains a list of ServiceItems + """ + class ServiceManager(QWidget): """Manages the orders of service. Currently this involves taking @@ -63,3 +72,11 @@ class ServiceManager(QWidget): self.Layout.addWidget(self.Toolbar) self.ListView = QtGui.QListView(self) self.Layout.addWidget(self.ListView) + + + def addServiceItem(self, item): + """Adds service item""" + + def removeServiceItem(self): + """Remove currently selected item""" + diff --git a/openlp/plugins/images/imageplugin.py b/openlp/plugins/images/imageplugin.py index 0f87b3adf..6f31c3731 100644 --- a/openlp/plugins/images/imageplugin.py +++ b/openlp/plugins/images/imageplugin.py @@ -37,7 +37,7 @@ class ListWithPreviews(QtCore.QAbstractListModel): def __init__(self): QtCore.QAbstractListModel.__init__(self) - self.items=[] # will be a list of (filename, QPixmap) tuples + self.items=[] # will be a list of (full filename, QPixmap, shortname) tuples self.rowheight=50 self.maximagewidth=self.rowheight*16/9.0; @@ -156,8 +156,7 @@ class ImagePlugin(Plugin, PluginUtils): self.MediaManagerItem.PageLayout.addWidget(self.ImageListPreview) self.ImageListView.setGeometry(QtCore.QRect(10, 100, 256, 591)) - - return self.MediaManagerItem +# return self.MediaManagerItem def initialise(self): log.info("Plugin Initialising")