Started splitting out the service manager

bzr-revno: 366
This commit is contained in:
Martin Thompson 2009-03-04 21:52:32 +00:00
parent c451048355
commit bef8369e86
3 changed files with 20 additions and 4 deletions

View File

@ -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

View File

@ -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"""

View File

@ -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")