Merge lp:~trb143/openlp/trb143 into lp:openlp

Proposed by Tim Bentley
Status: Merged
Approved by: Tim Bentley
Approved revision: 433
Merged at revision: 433
Proposed branch: lp:~trb143/openlp/trb143
Merge into: lp:openlp
Diff against target: None lines
To merge this branch: bzr merge lp:~trb143/openlp/trb143
Reviewer Review Type Date Requested Status
Tim Bentley Approve
Raoul Snyman rereview Approve
Review via email: mp+4948@code.launchpad.net

This proposal supersedes a proposal from 2009-03-22.

To post a comment you must log in.
Revision history for this message
Tim Bentley (trb143) wrote : Posted in a previous version of this proposal

This is my first attempt at merge request please be nice ;-)
The code added eventmanager and thememanager (based on service manager)
Tidies up the plugin interface to make it generic for passing objects in and fixes all plugins.
Refactor the AlertDialog and Tab so the Dialog can see the Tab. Update SettingsManager.
Create a Event calling chain based on the Alert Display button. (See the log file for output)
Clean up MainWindow and PluginManager
Other small formatting tidyups.

Revision history for this message
Michael Gorven (mgorven) wrote : Posted in a previous version of this proposal

Just two minor suggestions. The get_payload() and set_payload() methods aren't really necessary. If you later want to control access to payload you can always use a property to do so. Secondly, I think there should be blank lines between the methods in the ThemeData class.

review: Approve
Revision history for this message
Tim Bentley (trb143) wrote : Posted in a previous version of this proposal

Add more changes in revision 429 to deal with Theme Management and use of events,

Revision history for this message
Raoul Snyman (raoul-snyman) wrote : Posted in a previous version of this proposal

Just noticed a few things (yes, the code monster is here)...

- Various places:
  * Incorrect spacing:
     foo=bar
    Should be:
     foo = bar
  * All classes inherited from Qt classes must use Qt naming conventions.

- In openlp/core/lib/plugin.py
   if plugin_helpers != None:
  Better:
   if plugin_helpers is not None:

- In openlp/core/pluginmanager.py
  * You have:
     log.info(u'"Plugin manager loaded')
    It's got a " that shouldn't be there...
  * Method initialise_plugins needs it's documentation updated.

- In openlp/core/ui/alertform.py
  * This whole dialog needs to be redone in the same format as the other dialogs, with multiple inheritance.

review: Needs Fixing
Revision history for this message
Raoul Snyman (raoul-snyman) wrote :

A few small issues, nothing major though. You can just change your local branch so that it comes in the next merge.

Remember your spaces:

    log.debug(u'plugin %s registered with EventManager'%plugin)

  should be

    log.debug(u'plugin %s registered with EventManager' % plugin)

Remember your unicode, even in the "translate" function:

    AlertForm.setWindowTitle(translate("AlertForm", u'Alert Message'))

  should be

    AlertForm.setWindowTitle(translate(u'AlertForm', u'Alert Message'))

As we finish up, we should work through all of our forms, and replace the Qt translate function with our core translate function. It is simply a wrapper, but this gives us more flexibility.

    self.FileNewItem.setText(QtGui.QApplication.translate("main_window", "&New", None, QtGui.QApplication.UnicodeUTF8))

  will change to

    self.FileNewItem.setText(translate(u'MainWindow', u'&New'))

In AlertForm:

    QtCore.QObject.connect(self.CancelButton, QtCore.SIGNAL("clicked()"), AlertForm.close)
    QtCore.QObject.connect(self.DisplayButton, QtCore.SIGNAL("clicked()"), self.onDisplayClicked)

  QDialog has "accepted" and "rejected" slots, you should connect the cancel button to "rejected" rather than "close" - this allows the dialog to do any cleanup and other stuff necessary, and returns the "rejected" status to exec_()
  Possibly also look into calling the "accepted" slot in onDisplayClicked()

review: Approve (rereview)
Revision history for this message
Michael Gorven (mgorven) wrote :

On Friday 27 March 2009 10:14:53 Raoul Snyman wrote:
> should be
> log.debug(u'plugin %s registered with EventManager' % plugin)

Actually it should be:
    log.debug(u'plugin %s registered with EventManager', plugin)

Revision history for this message
Tim Bentley (trb143) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'openlp/core/lib/__init__.py'
2--- openlp/core/lib/__init__.py 2009-03-19 17:36:06 +0000
3+++ openlp/core/lib/__init__.py 2009-03-23 20:18:06 +0000
4@@ -22,6 +22,8 @@
5 from settingstab import SettingsTab
6 from mediamanageritem import MediaManagerItem
7 from event import Event
8+from event import EventType
9+from eventmanager import EventManager
10 from xmlrootclass import XmlRootClass
11 from serviceitem import ServiceItem
12 from eventreceiver import Receiver
13@@ -30,6 +32,6 @@
14 from songxmlhandler import SongXMLBuilder
15 from songxmlhandler import SongXMLParser
16
17-__all__ = ['PluginConfig', 'Plugin', 'SettingsTab', 'MediaManagerItem', 'Event',
18+__all__ = ['PluginConfig', 'Plugin', 'SettingsTab', 'MediaManagerItem', 'Event', 'EventType'
19 'XmlRootClass', 'ServiceItem', 'Receiver', 'OpenLPToolbar', 'SongXMLBuilder',
20- 'SongXMLParser']
21+ 'SongXMLParser', 'EventManager']
22
23=== modified file 'openlp/core/lib/event.py'
24--- openlp/core/lib/event.py 2008-12-01 09:33:16 +0000
25+++ openlp/core/lib/event.py 2009-03-23 20:18:06 +0000
26@@ -3,7 +3,7 @@
27 """
28 OpenLP - Open Source Lyrics Projection
29 Copyright (c) 2008 Raoul Snyman
30-Portions copyright (c) 2008 Martin Thompson, Tim Bentley, Scott Guerreri,
31+Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley, Scott Guerreri,
32 Carsten Tingaard, Jonathan Corwin
33
34 This program is free software; you can redistribute it and/or modify it under
35@@ -46,6 +46,9 @@
36 """
37 Provides an Event class to encapsulate events within openlp.org.
38 """
39-
40- def __init__(self, event_type=EventType.Default):
41- self.type = event_type
42+ def __init__(self, event_type=EventType.Default, payload=None):
43+ self.event_type = event_type
44+ self.payload = payload
45+
46+ def get_type(self):
47+ return self.event_type
48
49=== added file 'openlp/core/lib/eventmanager.py'
50--- openlp/core/lib/eventmanager.py 1970-01-01 00:00:00 +0000
51+++ openlp/core/lib/eventmanager.py 2009-03-25 20:30:48 +0000
52@@ -0,0 +1,46 @@
53+# -*- coding: utf-8 -*-
54+# vim: autoindent shiftwidth=4 expandtab textwidth=80
55+"""
56+OpenLP - Open Source Lyrics Projection
57+Copyright (c) 2008 Raoul Snyman
58+Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley, Scott Guerreri,
59+ Carsten Tingaard, Jonathan Corwin
60+
61+This program is free software; you can redistribute it and/or modify it under
62+the terms of the GNU General Public License as published by the Free Software
63+Foundation; version 2 of the License.
64+
65+This program is distributed in the hope that it will be useful, but WITHOUT ANY
66+WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
67+PARTICULAR PURPOSE. See the GNU General Public License for more details.
68+
69+You should have received a copy of the GNU General Public License along with
70+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
71+Place, Suite 330, Boston, MA 02111-1307 USA
72+"""
73+import os
74+import logging
75+
76+class EventManager(object):
77+ """
78+ A mechanism to send events to all registered endpoints
79+ the endpoints are registered and listen with a handle_event method
80+ the endpoint will decide whether to do somthing with the event or ignore it
81+
82+ """
83+ global log
84+ log=logging.getLogger(u'EventManager')
85+
86+ def __init__(self):
87+ self.endpoints=[]
88+ log.info(u'Initialising')
89+
90+ def register(self, plugin):
91+ log.debug(u'plugin %s registered with EventManager'%plugin)
92+ self.endpoints.append(plugin)
93+
94+ def post_event(self, event):
95+ log.debug(u'post event called for event %s'%event.get_type)
96+ for point in self.endpoints:
97+ point.handle_event(event)
98+
99
100=== modified file 'openlp/core/lib/plugin.py'
101--- openlp/core/lib/plugin.py 2009-03-01 09:13:27 +0000
102+++ openlp/core/lib/plugin.py 2009-03-23 20:18:06 +0000
103@@ -67,7 +67,7 @@
104 and screen number.
105 """
106
107- def __init__(self, name=None, version=None, preview_controller=None, live_controller=None):
108+ def __init__(self, name=None, version=None, plugin_helpers=None):
109 """
110 This is the constructor for the plugin object. This provides an easy
111 way for descendent plugins to populate common data. This method *must*
112@@ -88,8 +88,10 @@
113 self.weight = 0
114 # Set up logging
115 self.log = logging.getLogger(self.name)
116- self.preview_controller=preview_controller
117- self.live_controller=live_controller
118+ self.preview_controller=plugin_helpers[u'preview']
119+ self.live_controller=plugin_helpers[u'live']
120+ self.theme_manager=plugin_helpers[u'theme']
121+ self.event_manager=plugin_helpers[u'event']
122
123 def check_pre_conditions(self):
124 """
125
126=== modified file 'openlp/core/pluginmanager.py'
127--- openlp/core/pluginmanager.py 2009-03-12 20:19:24 +0000
128+++ openlp/core/pluginmanager.py 2009-03-25 20:30:48 +0000
129@@ -3,7 +3,7 @@
130 """
131 OpenLP - Open Source Lyrics Projection
132 Copyright (c) 2008 Raoul Snyman
133-Portions copyright (c) 2008 Martin Thompson, Tim Bentley,
134+Portions copyright (c) 2008 - 2009 Martin Thompson, Tim Bentley,
135
136 This program is free software; you can redistribute it and/or modify it under
137 the terms of the GNU General Public License as published by the Free Software
138@@ -22,7 +22,7 @@
139 import sys
140 import logging
141
142-from openlp.core.lib import Plugin
143+from openlp.core.lib import Plugin, EventManager
144
145 class PluginManager(object):
146 """
147@@ -30,15 +30,15 @@
148 and executes all the hooks, as and when necessary.
149 """
150 global log
151- log=logging.getLogger("PluginMgr")
152- log.info("Plugin manager loaded")
153+ log=logging.getLogger(u'PluginMgr')
154+ log.info(u'Plugin manager loaded')
155
156 def __init__(self, dir):
157 """
158 The constructor for the plugin manager.
159 Passes the controllers on to the plugins for them to interact with via their ServiceItems
160 """
161- log.info("Plugin manager initing")
162+ log.info(u'Plugin manager initing')
163 if not dir in sys.path:
164 log.debug("Inserting %s into sys.path", dir)
165 sys.path.insert(0, dir)
166@@ -48,12 +48,11 @@
167 # this has to happen after the UI is sorted self.find_plugins(dir)
168 log.info("Plugin manager done init")
169
170- def find_plugins(self, dir, preview_controller, live_controller): # xxx shouldn't dir come from self.basepath
171+ def find_plugins(self, dir, plugin_helpers, eventmanager): # TODO shouldn't dir come from self.basepath
172 """
173 Scan the directory dir for objects inheriting from openlp.plugin
174 """
175- self.preview_controller=preview_controller
176- self.live_controller=live_controller
177+ self.plugin_helpers = plugin_helpers
178 startdepth=len(os.path.abspath(dir).split(os.sep))
179 log.debug("find plugins %s at depth %d" %( str(dir), startdepth))
180
181@@ -80,16 +79,15 @@
182 plugin_objects = []
183 for p in self.plugin_classes:
184 try:
185- plugin = p(self.preview_controller, self.live_controller)
186- log.debug('loaded plugin' + str(p) + ' with controllers'+str(self.preview_controller)+str(self.live_controller))
187+ plugin = p(self.plugin_helpers)
188+ log.debug(u'loaded plugin %s with helpers'%str(p))
189+ log.debug("Plugin="+str(p))
190+ if plugin.check_pre_conditions():
191+ log.debug("Appending "+str(p))
192+ plugin_objects.append(plugin)
193+ eventmanager.register(plugin)
194 except TypeError:
195- # TODO: need to get rid of this once all plugins are up to date
196- plugin = p()
197- log.debug('loaded plugin' + str(p) + ' with no controllers')
198- log.debug("Plugin="+str(p))
199- if plugin.check_pre_conditions():
200- log.debug("Appending "+str(p))
201- plugin_objects.append(plugin)
202+ log.error(u'loaded plugin %s has no helpers'%str(p))
203 self.plugins = sorted(plugin_objects, self.order_by_weight)
204
205 def order_by_weight(self, x, y):
206@@ -105,8 +103,6 @@
207 if media_manager_item is not None:
208 log.debug('Inserting media manager item from %s' % plugin.name)
209 mediatoolbox.addItem(media_manager_item, plugin.icon, media_manager_item.title)
210- # TODO: These shouldn't be called here...
211- plugin.initialise()
212
213 def hook_settings_tabs(self, settingsform=None):
214 """
215@@ -137,5 +133,19 @@
216 for plugin in self.plugins:
217 plugin.add_export_menu_item(export_menu)
218
219- def hook_handle_event(self, event):
220- pass
221+ def hook_handle_event(self, eventmanager):
222+ for plugin in self.plugins:
223+ handle_event = plugin.handle_event(None)
224+ print plugin, handle_event
225+# if settings_tab is not None:
226+# log.debug('Inserting settings tab item from %s' % plugin.name)
227+# settingsform.addTab(settings_tab)
228+# else:
229+# log.debug('No settings in %s' % plugin.name)
230+ def initialise_plugins(self):
231+ """
232+ Loop through all the plugins and give them an opportunity to add an item
233+ to the export menu.
234+ """
235+ for plugin in self.plugins:
236+ plugin.initialise()
237
238=== modified file 'openlp/core/render.py'
239--- openlp/core/render.py 2009-03-12 20:19:24 +0000
240+++ openlp/core/render.py 2009-03-22 07:13:34 +0000
241@@ -44,8 +44,10 @@
242 self._theme=None
243 self._bg_image_filename=None
244 self._paint=None
245+
246 def set_debug(self, debug):
247 self._debug=debug
248+
249 def set_theme(self, theme):
250 self._theme=theme
251 if theme.BackgroundType == 2:
252@@ -56,6 +58,7 @@
253 self._bg_image_filename=filename
254 if self._paint is not None:
255 self.scale_bg_image()
256+
257 def scale_bg_image(self):
258 assert self._paint
259 i=QtGui.QImage(self._bg_image_filename)
260@@ -81,6 +84,7 @@
261 self._paint=p
262 if self._bg_image_filename is not None:
263 self.scale_bg_image()
264+
265 def set_words_openlp(self, words):
266 # print "set words openlp", words
267 verses=[]
268@@ -95,6 +99,7 @@
269 verses_text.append('\n'.join(v).lstrip()) # remove first \n
270
271 return verses_text
272+
273 def render_screen(self, screennum):
274 print "render screen\n", screennum, self.words[screennum]
275 import time
276@@ -106,6 +111,7 @@
277 def set_text_rectangle(self, rect):
278 """ Sets the rectangle within which text should be rendered"""
279 self._rect=rect
280+
281 def _render_background(self):
282 # xxx may have to prerender to a memdc when set theme is called for use on slow machines
283 # takes 26ms on mijiti's machine!
284@@ -149,6 +155,7 @@
285 p.drawPixmap(self.background_offsetx,self.background_offsety, self.img)
286 p.end()
287 print "render background done"
288+
289 def split_set_of_lines(self, lines):
290
291 """Given a list of lines, decide how to split them best if they don't all fit on the screen
292@@ -212,7 +219,6 @@
293
294 return retval
295
296-
297 def _render_lines(self, lines):
298 """render a set of lines according to the theme, return bounding box"""
299 print "_render_lines", lines
300@@ -234,6 +240,7 @@
301 print "render lines DONE"
302
303 return bbox
304+
305 def _render_lines_unaligned(self, lines, tlcorner=(0,0)):
306
307 """Given a list of lines to render, render each one in turn
308@@ -265,7 +272,6 @@
309
310 return retval
311
312-
313 def _render_single_line(self, line, tlcorner=(0,0)):
314
315 """render a single line of words onto the DC, top left corner
316@@ -402,8 +408,3 @@
317 p.drawText(x,y+metrics.height()-metrics.descent()-1, line)
318 p.end()
319 return (w, h)
320-
321-
322-
323-
324-
325
326=== modified file 'openlp/core/theme/theme.py'
327--- openlp/core/theme/theme.py 2009-03-12 20:19:24 +0000
328+++ openlp/core/theme/theme.py 2009-03-22 07:13:34 +0000
329@@ -15,7 +15,8 @@
330 '''<?xml version="1.0" encoding="iso-8859-1"?>
331 <Theme>
332 <Name>BlankStyle</Name>
333- <BackgroundType>0</BackgroundType>
334+ <BackgroundMode>1</BackgroundMode>
335+ <BackgroundType>0</BackgroundType>
336 <BackgroundParameter1>$000000</BackgroundParameter1>
337 <BackgroundParameter2/>
338 <BackgroundParameter3/>
339@@ -37,6 +38,9 @@
340 attributes:
341 name : theme name
342
343+ BackgroundMode : 1 - Transparent
344+ 1 - Opaque
345+
346 BackgroundType : 0 - solid color
347 1 - gradient color
348 2 - image
349
350=== modified file 'openlp/core/ui/__init__.py'
351--- openlp/core/ui/__init__.py 2009-03-01 09:13:27 +0000
352+++ openlp/core/ui/__init__.py 2009-03-22 07:11:05 +0000
353@@ -27,7 +27,8 @@
354 from alertform import AlertForm
355 from settingsform import SettingsForm
356 from servicemanager import ServiceManager
357+from thememanager import ThemeManager
358 from mainwindow import MainWindow
359
360 __all__ = ['SplashScreen', 'AboutForm', 'SettingsForm',
361- 'MainWindow', 'SlideController', 'ServiceManager']
362+ 'MainWindow', 'SlideController', 'ServiceManager', 'ThemeManager']
363
364=== modified file 'openlp/core/ui/alertform.py'
365--- openlp/core/ui/alertform.py 2009-03-01 09:13:27 +0000
366+++ openlp/core/ui/alertform.py 2009-03-23 19:17:07 +0000
367@@ -17,7 +17,7 @@
368 this program; if not, write to the Free Software Foundation, Inc., 59 Temple
369 Place, Suite 330, Boston, MA 02111-1307 USA
370 """
371-
372+import logging
373 from PyQt4 import QtCore, QtGui
374 from PyQt4.QtGui import QDialog
375
376@@ -25,14 +25,17 @@
377 from openlp.core.resources import *
378
379 class AlertForm(QDialog):
380-
381+ global log
382+ log=logging.getLogger(u'AlertForm')
383+
384 def __init__(self, parent=None):
385 QDialog.__init__(self, parent)
386 self.setupUi(self)
387+ log.info(u'Defined')
388
389 def setupUi(self, AlertForm):
390 AlertForm.setObjectName("AlertForm")
391- AlertForm.resize(370, 105)
392+ AlertForm.resize(370, 110)
393 icon = QtGui.QIcon()
394 icon.addPixmap(QtGui.QPixmap(":/icon/openlp.org-icon-32.bmp"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
395 AlertForm.setWindowIcon(icon)
396@@ -56,7 +59,7 @@
397 self.AlertEntryLabel.setSizePolicy(sizePolicy)
398 self.AlertEntryLabel.setObjectName("AlertEntryLabel")
399 self.AlertEntryEditItem = QtGui.QLineEdit(self.AlertEntryWidget)
400- self.AlertEntryEditItem.setGeometry(QtCore.QRect(0, 20, 353, 21))
401+ self.AlertEntryEditItem.setGeometry(QtCore.QRect(0, 20, 353, 26))
402 self.AlertEntryEditItem.setObjectName("AlertEntryEditItem")
403 self.AlertFormLayout.addWidget(self.AlertEntryWidget)
404 self.ButtonBoxWidget = QtGui.QWidget(AlertForm)
405@@ -83,20 +86,21 @@
406 self.retranslateUi(AlertForm)
407
408 QtCore.QObject.connect(self.CancelButton, QtCore.SIGNAL("clicked()"), AlertForm.close)
409+ QtCore.QObject.connect(self.DisplayButton, QtCore.SIGNAL("clicked()"), self.onDisplayClicked)
410 QtCore.QMetaObject.connectSlotsByName(AlertForm)
411
412 def retranslateUi(self, AlertForm):
413- AlertForm.setWindowTitle(translate("AlertForm", "Alert Message"))
414- self.AlertEntryLabel.setText(translate("AlertForm", "Alert Text:"))
415- self.DisplayButton.setText(translate("AlertForm", "Display"))
416- self.CancelButton.setText(translate("AlertForm", "Cancel"))
417+ AlertForm.setWindowTitle(translate("AlertForm", u'Alert Message'))
418+ self.AlertEntryLabel.setText(translate("AlertForm", u'Alert Text:'))
419+ self.DisplayButton.setText(translate("AlertForm", u'Display'))
420+ self.CancelButton.setText(translate("AlertForm", u'Cancel'))
421
422-# def show(self):
423-# self.AlertForm.show()
424-
425
426 def load_settings(self):
427 pass
428
429 def save_settings(self):
430 pass
431+
432+ def onDisplayClicked(self):
433+ pass
434
435=== modified file 'openlp/core/ui/mainwindow.py'
436--- openlp/core/ui/mainwindow.py 2009-03-05 10:52:55 +0000
437+++ openlp/core/ui/mainwindow.py 2009-03-23 19:17:07 +0000
438@@ -3,7 +3,7 @@
439 """
440 OpenLP - Open Source Lyrics Projection
441 Copyright (c) 2008 Raoul Snyman
442-Portions copyright (c) 2008 Martin Thompson, Tim Bentley,
443+Portions copyright (c) 2008 - 2009 Martin Thompson, Tim Bentley,
444
445 This program is free software; you can redistribute it and/or modify it under
446 the terms of the GNU General Public License as published by the Free Software
447@@ -18,54 +18,68 @@
448 Place, Suite 330, Boston, MA 02111-1307 USA
449 """
450 import os
451-
452+import logging
453 from time import sleep
454+
455 from PyQt4 import *
456 from PyQt4 import QtCore, QtGui
457
458 from openlp.core.resources import *
459
460 from openlp.core.ui import AboutForm, SettingsForm, AlertForm, \
461- SlideController, ServiceManager
462-from openlp.core.lib import Plugin, MediaManagerItem, SettingsTab
463+ SlideController, ServiceManager, ThemeManager
464+from openlp.core.lib import Plugin, MediaManagerItem, SettingsTab, EventManager
465
466 from openlp.core import PluginManager
467-import logging
468+
469 class MainWindow(object):
470 global log
471- log=logging.getLogger("MainWindow")
472- log.info("MainWindow loaded")
473+ log=logging.getLogger(u'MainWindow')
474+ log.info(u'MainWindow loaded')
475
476 def __init__(self):
477 self.main_window = QtGui.QMainWindow()
478+ self.EventManager = EventManager()
479 self.alert_form = AlertForm()
480 self.about_form = AboutForm()
481 self.settings_form = SettingsForm()
482+
483 pluginpath = os.path.split(os.path.abspath(__file__))[0]
484 pluginpath = os.path.abspath(os.path.join(pluginpath, '..', '..','plugins'))
485 self.plugin_manager = PluginManager(pluginpath)
486+ self.plugin_helpers = {}
487+
488 self.setupUi()
489
490- log.info('')
491- self.plugin_manager.find_plugins(pluginpath, self.PreviewController, self.LiveController)
492+ log.info(u'Load Plugins')
493+ self.plugin_helpers[u'preview'] = self.PreviewController
494+ self.plugin_helpers[u'live'] = self.LiveController
495+ self.plugin_helpers[u'event'] = self.EventManager
496+ self.plugin_helpers[u'theme'] = self.ThemeManagerContents # Theme manger
497+
498+ self.plugin_manager.find_plugins(pluginpath, self.plugin_helpers, self.EventManager)
499 # hook methods have to happen after find_plugins. Find plugins needs the controllers
500 # hence the hooks have moved from setupUI() to here
501
502 # Find and insert media manager items
503- log.info("hook media")
504+ log.info(u'hook media')
505 self.plugin_manager.hook_media_manager(self.MediaToolBox)
506
507 # Find and insert settings tabs
508- log.info("hook settings")
509+ log.info(u'hook settings')
510 self.plugin_manager.hook_settings_tabs(self.settings_form)
511
512 # Call the hook method to pull in import menus.
513- log.info("hook menus")
514+ log.info(u'hook menus')
515 self.plugin_manager.hook_import_menu(self.FileImportMenu)
516
517 # Call the hook method to pull in export menus.
518- self.plugin_manager.hook_import_menu(self.FileExportMenu)
519+ self.plugin_manager.hook_export_menu(self.FileExportMenu)
520
521+ # Call the initialise method to setup plugins.
522+ log.info(u'initialise plugins')
523+ self.plugin_manager.initialise_plugins()
524+
525 def setupUi(self):
526 self.main_window.setObjectName("main_window")
527 self.main_window.resize(1087, 847)
528@@ -151,7 +165,7 @@
529 self.MediaManagerLayout.addWidget(self.MediaToolBox)
530 self.MediaManagerDock.setWidget(self.MediaManagerContents)
531 self.main_window.addDockWidget(QtCore.Qt.DockWidgetArea(1), self.MediaManagerDock)
532-
533+ #Sevice Manager Defined
534 self.ServiceManagerDock = QtGui.QDockWidget(self.main_window)
535 ServiceManagerIcon = QtGui.QIcon()
536 ServiceManagerIcon.addPixmap(QtGui.QPixmap(":/system/system_servicemanager.png"),
537@@ -162,6 +176,7 @@
538 self.ServiceManagerContents = ServiceManager(self)
539 self.ServiceManagerDock.setWidget(self.ServiceManagerContents)
540 self.main_window.addDockWidget(QtCore.Qt.DockWidgetArea(2), self.ServiceManagerDock)
541+ #Theme Manager Defined
542 self.ThemeManagerDock = QtGui.QDockWidget(self.main_window)
543 ThemeManagerIcon = QtGui.QIcon()
544 ThemeManagerIcon.addPixmap(QtGui.QPixmap(":/system/system_thememanager.png"),
545@@ -169,41 +184,46 @@
546 self.ThemeManagerDock.setWindowIcon(ThemeManagerIcon)
547 self.ThemeManagerDock.setFloating(False)
548 self.ThemeManagerDock.setObjectName("ThemeManagerDock")
549- self.ThemeManagerContents = QtGui.QWidget()
550- self.ThemeManagerContents.setObjectName("ThemeManagerContents")
551- self.ThemeManagerLayout = QtGui.QVBoxLayout(self.ThemeManagerContents)
552- self.ThemeManagerLayout.setSpacing(0)
553- self.ThemeManagerLayout.setMargin(0)
554- self.ThemeManagerLayout.setObjectName("ThemeManagerLayout")
555- self.ThemeManagerToolbar = QtGui.QToolBar(self.ThemeManagerContents)
556- self.ThemeManagerToolbar.setObjectName("ThemeManagerToolbar")
557- NewThemeIcon = QtGui.QIcon()
558- NewThemeIcon.addPixmap(QtGui.QPixmap(":/themes/theme_new.png"),
559- QtGui.QIcon.Normal, QtGui.QIcon.Off)
560- self.ThemeNewItem = self.ThemeManagerToolbar.addAction(NewThemeIcon, 'New theme')
561- EditThemeIcon = QtGui.QIcon()
562- EditThemeIcon.addPixmap(QtGui.QPixmap(":/themes/theme_edit.png"),
563- QtGui.QIcon.Normal, QtGui.QIcon.Off)
564- self.ThemeEditItem = self.ThemeManagerToolbar.addAction(EditThemeIcon, 'Edit theme')
565- DeleteThemeIcon = QtGui.QIcon()
566- DeleteThemeIcon.addPixmap(QtGui.QPixmap(":/themes/theme_delete.png"),
567- QtGui.QIcon.Normal, QtGui.QIcon.Off)
568- self.ThemeDeleteButton = self.ThemeManagerToolbar.addAction(DeleteThemeIcon, 'Delete theme')
569- self.ThemeManagerToolbar.addSeparator()
570- ImportThemeIcon = QtGui.QIcon()
571- ImportThemeIcon.addPixmap(QtGui.QPixmap(":/themes/theme_import.png"),
572- QtGui.QIcon.Normal, QtGui.QIcon.Off)
573- self.ThemeImportButton = self.ThemeManagerToolbar.addAction(ImportThemeIcon, 'Import theme')
574- ExportThemeIcon = QtGui.QIcon()
575- ExportThemeIcon.addPixmap(QtGui.QPixmap(":/themes/theme_export.png"),
576- QtGui.QIcon.Normal, QtGui.QIcon.Off)
577- self.ThemeExportButton = self.ThemeManagerToolbar.addAction(ExportThemeIcon, 'Export theme')
578- self.ThemeManagerLayout.addWidget(self.ThemeManagerToolbar)
579- self.ThemeManagerListView = QtGui.QListView(self.ThemeManagerContents)
580- self.ThemeManagerListView.setObjectName("ThemeManagerListView")
581- self.ThemeManagerLayout.addWidget(self.ThemeManagerListView)
582+
583+ self.ThemeManagerContents = ThemeManager(self)
584+
585+# self.ThemeManagerContents = QtGui.QWidget()
586+# self.ThemeManagerContents.setObjectName("ThemeManagerContents")
587+# self.ThemeManagerLayout = QtGui.QVBoxLayout(self.ThemeManagerContents)
588+# self.ThemeManagerLayout.setSpacing(0)
589+# self.ThemeManagerLayout.setMargin(0)
590+# self.ThemeManagerLayout.setObjectName("ThemeManagerLayout")
591+# self.ThemeManagerToolbar = QtGui.QToolBar(self.ThemeManagerContents)
592+# self.ThemeManagerToolbar.setObjectName("ThemeManagerToolbar")
593+# NewThemeIcon = QtGui.QIcon()
594+# NewThemeIcon.addPixmap(QtGui.QPixmap(":/themes/theme_new.png"),
595+# QtGui.QIcon.Normal, QtGui.QIcon.Off)
596+# self.ThemeNewItem = self.ThemeManagerToolbar.addAction(NewThemeIcon, 'New theme')
597+# EditThemeIcon = QtGui.QIcon()
598+# EditThemeIcon.addPixmap(QtGui.QPixmap(":/themes/theme_edit.png"),
599+# QtGui.QIcon.Normal, QtGui.QIcon.Off)
600+# self.ThemeEditItem = self.ThemeManagerToolbar.addAction(EditThemeIcon, 'Edit theme')
601+# DeleteThemeIcon = QtGui.QIcon()
602+# DeleteThemeIcon.addPixmap(QtGui.QPixmap(":/themes/theme_delete.png"),
603+# QtGui.QIcon.Normal, QtGui.QIcon.Off)
604+# self.ThemeDeleteButton = self.ThemeManagerToolbar.addAction(DeleteThemeIcon, 'Delete theme')
605+# self.ThemeManagerToolbar.addSeparator()
606+# ImportThemeIcon = QtGui.QIcon()
607+# ImportThemeIcon.addPixmap(QtGui.QPixmap(":/themes/theme_import.png"),
608+# QtGui.QIcon.Normal, QtGui.QIcon.Off)
609+# self.ThemeImportButton = self.ThemeManagerToolbar.addAction(ImportThemeIcon, 'Import theme')
610+# ExportThemeIcon = QtGui.QIcon()
611+# ExportThemeIcon.addPixmap(QtGui.QPixmap(":/themes/theme_export.png"),
612+# QtGui.QIcon.Normal, QtGui.QIcon.Off)
613+# self.ThemeExportButton = self.ThemeManagerToolbar.addAction(ExportThemeIcon, 'Export theme')
614+# self.ThemeManagerLayout.addWidget(self.ThemeManagerToolbar)
615+# self.ThemeManagerListView = QtGui.QListView(self.ThemeManagerContents)
616+# self.ThemeManagerListView.setObjectName("ThemeManagerListView")
617+# self.ThemeManagerLayout.addWidget(self.ThemeManagerListView)
618+
619 self.ThemeManagerDock.setWidget(self.ThemeManagerContents)
620 self.main_window.addDockWidget(QtCore.Qt.DockWidgetArea(2), self.ThemeManagerDock)
621+
622 self.FileNewItem = QtGui.QAction(self.main_window)
623 self.FileNewItem.setIcon(self.ServiceManagerContents.Toolbar.getIconFromTitle("New Service"))
624 self.FileNewItem.setObjectName("FileNewItem")
625@@ -359,11 +379,11 @@
626 # self.ServiceManagerContents.ThemeComboBox.setItemText(1, QtGui.QApplication.translate("main_window", "Snowy Mountains", None, QtGui.QApplication.UnicodeUTF8))
627 # self.ServiceManagerContents.ThemeComboBox.setItemText(2, QtGui.QApplication.translate("main_window", "Wilderness", None, QtGui.QApplication.UnicodeUTF8))
628 self.ThemeManagerDock.setWindowTitle(QtGui.QApplication.translate("main_window", "Theme Manager", None, QtGui.QApplication.UnicodeUTF8))
629- self.ThemeNewItem.setText(QtGui.QApplication.translate("main_window", "New Theme", None, QtGui.QApplication.UnicodeUTF8))
630- self.ThemeEditItem.setText(QtGui.QApplication.translate("main_window", "Edit Theme", None, QtGui.QApplication.UnicodeUTF8))
631- self.ThemeDeleteButton.setText(QtGui.QApplication.translate("main_window", "Delete Theme", None, QtGui.QApplication.UnicodeUTF8))
632- self.ThemeImportButton.setText(QtGui.QApplication.translate("main_window", "Import Theme", None, QtGui.QApplication.UnicodeUTF8))
633- self.ThemeExportButton.setText(QtGui.QApplication.translate("main_window", "Export Theme", None, QtGui.QApplication.UnicodeUTF8))
634+# self.ThemeNewItem.setText(QtGui.QApplication.translate("main_window", "New Theme", None, QtGui.QApplication.UnicodeUTF8))
635+# self.ThemeEditItem.setText(QtGui.QApplication.translate("main_window", "Edit Theme", None, QtGui.QApplication.UnicodeUTF8))
636+# self.ThemeDeleteButton.setText(QtGui.QApplication.translate("main_window", "Delete Theme", None, QtGui.QApplication.UnicodeUTF8))
637+# self.ThemeImportButton.setText(QtGui.QApplication.translate("main_window", "Import Theme", None, QtGui.QApplication.UnicodeUTF8))
638+# self.ThemeExportButton.setText(QtGui.QApplication.translate("main_window", "Export Theme", None, QtGui.QApplication.UnicodeUTF8))
639 self.FileNewItem.setText(QtGui.QApplication.translate("main_window", "&New", None, QtGui.QApplication.UnicodeUTF8))
640 self.FileNewItem.setToolTip(QtGui.QApplication.translate("main_window", "New Service", None, QtGui.QApplication.UnicodeUTF8))
641 self.FileNewItem.setStatusTip(QtGui.QApplication.translate("main_window", "Create a new Service", None, QtGui.QApplication.UnicodeUTF8))
642
643=== modified file 'openlp/core/ui/servicemanager.py'
644--- openlp/core/ui/servicemanager.py 2009-03-04 21:56:27 +0000
645+++ openlp/core/ui/servicemanager.py 2009-03-23 19:17:07 +0000
646@@ -40,7 +40,7 @@
647 Root contains a list of ServiceItems
648 """
649 global log
650- log=logging.getLogger("ServiceData")
651+ log=logging.getLogger(u'ServiceData')
652 def __init__(self):
653 QAbstractItemModel.__init__(self)
654 self.items=[]
655@@ -108,6 +108,8 @@
656 one lump.
657 Also handles the UI tasks of moving things up and down etc.
658 """
659+ global log
660+ log=logging.getLogger(u'ServiceManager')
661
662 def __init__(self, parent):
663 QWidget.__init__(self)
664@@ -163,6 +165,7 @@
665 self.service_data.addRow(item)
666 else:
667 self.service_data.insertRow(row+1, item)
668+
669 def removeServiceItem(self):
670 """Remove currently selected item"""
671 pass
672
673=== modified file 'openlp/core/ui/settingsform.py'
674--- openlp/core/ui/settingsform.py 2009-03-05 20:31:17 +0000
675+++ openlp/core/ui/settingsform.py 2009-03-23 19:17:07 +0000
676@@ -40,9 +40,9 @@
677 # Themes tab
678 self.ThemesTab = ThemesTab()
679 self.addTab(self.ThemesTab)
680- # Alerts tab
681+ # Alert tab
682 self.AlertsTab = AlertsTab()
683- self.addTab(self.AlertsTab)
684+ self.addTab(self.AlertsTab)
685
686 def addTab(self, tab):
687 log.info(u'Inserting %s' % tab.title())
688
689=== added file 'openlp/core/ui/thememanager.py'
690--- openlp/core/ui/thememanager.py 1970-01-01 00:00:00 +0000
691+++ openlp/core/ui/thememanager.py 2009-03-23 20:18:06 +0000
692@@ -0,0 +1,191 @@
693+# -*- coding: utf-8 -*-
694+# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
695+"""
696+OpenLP - Open Source Lyrics Projection
697+Copyright (c) 2009 Raoul Snyman
698+Portions copyright (c) 2009 Martin Thompson, Tim Bentley,
699+
700+This program is free software; you can redistribute it and/or modify it under
701+the terms of the GNU General Public License as published by the Free Software
702+Foundation; version 2 of the License.
703+
704+This program is distributed in the hope that it will be useful, but WITHOUT ANY
705+WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
706+PARTICULAR PURPOSE. See the GNU General Public License for more details.
707+
708+You should have received a copy of the GNU General Public License along with
709+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
710+Place, Suite 330, Boston, MA 02111-1307 USA
711+"""
712+import os
713+
714+from time import sleep
715+from copy import deepcopy
716+from PyQt4 import *
717+from PyQt4 import QtCore, QtGui
718+from PyQt4.QtCore import *
719+from PyQt4.QtGui import *
720+# from openlp.core.resources import *
721+# from openlp.core.ui import AboutForm, AlertForm, SettingsForm, SlideController
722+from openlp.core.lib import OpenLPToolbar
723+#from openlp.core.lib import ThemeItem
724+
725+# from openlp.core import PluginManager
726+import logging
727+
728+class ThemeData(QAbstractItemModel):
729+ """
730+ Tree of items for an order of Theme.
731+ Includes methods for reading and writing the contents to an OOS file
732+ Root contains a list of ThemeItems
733+ """
734+ global log
735+ log=logging.getLogger(u'ThemeData')
736+ def __init__(self):
737+ QAbstractItemModel.__init__(self)
738+ self.items=[]
739+ log.info("Starting")
740+ def columnCount(self, parent):
741+ return 1; # always only a single column (for now)
742+ def rowCount(self, parent):
743+ return len(self.items)
744+ def insertRow(self, row, Theme_item):
745+# self.beginInsertRows(QModelIndex(),row,row)
746+ log.info("insert row %d:%s"%(row,Theme_item))
747+ self.items.insert(row, Theme_item)
748+ log.info("Items: %s" % self.items)
749+# self.endInsertRows()
750+ def removeRow(self, row):
751+ self.beginRemoveRows(QModelIndex(), row,row)
752+ self.items.pop(row)
753+ self.endRemoveRows()
754+ def addRow(self, item):
755+ self.insertRow(len(self.items), item)
756+
757+ def index(self, row, col, parent = QModelIndex()):
758+ return self.createIndex(row,col)
759+
760+ def parent(self, index=QModelIndex()):
761+ return QModelIndex() # no children as yet
762+ def data(self, index, role):
763+ """
764+ Called by the Theme manager to draw us in the Theme window
765+ """
766+ row=index.row()
767+ if row > len(self.items): # if the last row is selected and deleted, we then get called with an empty row!
768+ return QVariant()
769+ item=self.items[row]
770+ if role==Qt.DisplayRole:
771+ retval= item.pluginname + ":" + item.shortname
772+ elif role == Qt.DecorationRole:
773+ retval = item.iconic_representation
774+ elif role == Qt.ToolTipRole:
775+ retval= None
776+ else:
777+ retval= None
778+ if retval == None:
779+ retval=QVariant()
780+# log.info("Returning"+ str(retval))
781+ if type(retval) is not type(QVariant):
782+ return QVariant(retval)
783+ else:
784+ return retval
785+
786+ def __iter__(self):
787+ for i in self.items:
788+ yield i
789+
790+ def item(self, row):
791+ log.info("Get Item:%d -> %s" %(row, str(self.items)))
792+ return self.items[row]
793+
794+
795+class ThemeManager(QWidget):
796+
797+ """Manages the orders of Theme. Currently this involves taking
798+ text strings from plugins and adding them to an OOS file. In
799+ future, it will also handle zipping up all the resources used into
800+ one lump.
801+ Also handles the UI tasks of moving things up and down etc.
802+ """
803+ global log
804+ log=logging.getLogger(u'ThemeManager')
805+
806+ def __init__(self, parent):
807+ QWidget.__init__(self)
808+ self.parent=parent
809+ self.Layout = QtGui.QVBoxLayout(self)
810+ self.Layout.setSpacing(0)
811+ self.Layout.setMargin(0)
812+ self.Toolbar = OpenLPToolbar(self)
813+ self.Toolbar.addToolbarButton("New Theme", ":/themes/theme_new.png")
814+ self.Toolbar.addToolbarButton("Edit Theme", ":/themes/theme_edit.png")
815+ self.Toolbar.addToolbarButton("Delete Theme", ":/themes/theme_delete.png")
816+ self.Toolbar.addSeparator()
817+ self.Toolbar.addToolbarButton("Import Theme", ":/themes/theme_import.png")
818+ self.Toolbar.addToolbarButton("Export Theme", ":/themes/theme_export.png")
819+ self.ThemeWidget = QtGui.QWidgetAction(self.Toolbar)
820+ self.Toolbar.addAction(self.ThemeWidget)
821+
822+ self.Layout.addWidget(self.Toolbar)
823+
824+ self.TreeView = QtGui.QTreeView(self)
825+ self.Theme_data=ThemeData()
826+ self.TreeView.setModel(self.Theme_data)
827+ self.Layout.addWidget(self.TreeView)
828+ self.themelist= []
829+
830+# def addThemeItem(self, item):
831+# """Adds Theme item"""
832+# log.info("addThemeItem")
833+# indexes=self.TreeView.selectedIndexes()
834+# assert len(indexes) <= 1 # can only have one selected index in this view
835+# if indexes == []:
836+# log.info("No row")
837+# row = None
838+# selected_item = None
839+# else:
840+# row=indexes[0].row()
841+# # if currently selected is of correct type, add it to it
842+# log.info("row:%d"%row)
843+# selected_item=self.Theme_data.item(row)
844+# if type(selected_item) == type(item):
845+# log.info("Add to existing item")
846+# selected_item.add(item)
847+# else:
848+# log.info("Create new item")
849+# if row is None:
850+# self.Theme_data.addRow(item)
851+# else:
852+# self.Theme_data.insertRow(row+1, item)
853+#
854+# def removeThemeItem(self):
855+# """Remove currently selected item"""
856+# pass
857+#
858+# def oos_as_text(self):
859+# text=[]
860+# log.info( "oos as text")
861+# log.info("Data:"+str(self.Theme_data))
862+# for i in self.Theme_data:
863+# text.append("# " + str(i))
864+# text.append(i.get_oos_text())
865+# return '\n'.join(text)
866+#
867+# def write_oos(self, filename):
868+# """
869+# Write a full OOS file out - iterate over plugins and call their respective methods
870+# This format is totally arbitrary testing purposes - something sensible needs to go in here!
871+# """
872+# oosfile=open(filename, "w")
873+# oosfile.write("# BEGIN OOS\n")
874+# oosfile.write(self.oos_as_text)
875+# oosfile.write("# END OOS\n")
876+# oosfile.close()
877+
878+ def load(self):
879+ log.debug(u'Load')
880+ self.themelist = [u'African Sunset', u'Snowy Mountains', u'Wilderness', u'Wet and Windy London']
881+
882+ def getThemes(self):
883+ return self.themelist
884
885=== modified file 'openlp/plugins/bibles/bibleplugin.py'
886--- openlp/plugins/bibles/bibleplugin.py 2009-03-18 17:19:30 +0000
887+++ openlp/plugins/bibles/bibleplugin.py 2009-03-22 07:13:34 +0000
888@@ -35,9 +35,9 @@
889 log=logging.getLogger(u'BiblePlugin')
890 log.info(u'Bible Plugin loaded')
891
892- def __init__(self):
893+ def __init__(self, plugin_helpers):
894 # Call the parent constructor
895- Plugin.__init__(self, u'Bibles', u'1.9.0')
896+ Plugin.__init__(self, u'Bibles', u'1.9.0', plugin_helpers)
897 self.weight = -9
898 # Create the plugin icon
899 self.icon = QtGui.QIcon()
900
901=== modified file 'openlp/plugins/custom/customplugin.py'
902--- openlp/plugins/custom/customplugin.py 2009-03-17 05:05:04 +0000
903+++ openlp/plugins/custom/customplugin.py 2009-03-25 20:30:48 +0000
904@@ -22,7 +22,7 @@
905 from PyQt4 import QtCore, QtGui
906
907 from openlp.core.resources import *
908-from openlp.core.lib import Plugin
909+from openlp.core.lib import Plugin, Event
910 from forms import EditCustomForm
911 from openlp.plugins.custom.lib import CustomManager, CustomTab, CustomMediaItem, CustomServiceItem
912
913@@ -31,10 +31,10 @@
914 global log
915 log=logging.getLogger(u'CustomPlugin')
916 log.info(u'Custom Plugin loaded')
917-
918- def __init__(self, preview_controller, live_controller):
919+
920+ def __init__(self, plugin_helpers):
921 # Call the parent constructor
922- Plugin.__init__(self, u'Custom', u'1.9.0', preview_controller, live_controller)
923+ Plugin.__init__(self, u'Custom', u'1.9.0', plugin_helpers)
924 self.weight = -5
925 self.custommanager = CustomManager(self.config)
926 self.edit_custom_form = EditCustomForm(self.custommanager)
927@@ -42,18 +42,16 @@
928 self.icon = QtGui.QIcon()
929 self.icon.addPixmap(QtGui.QPixmap(':/media/media_custom.png'),
930 QtGui.QIcon.Normal, QtGui.QIcon.Off)
931-
932- self.preview_service_item = CustomServiceItem(preview_controller)
933- self.live_service_item = CustomServiceItem(live_controller)
934+ self.preview_service_item = CustomServiceItem(self.preview_controller)
935+ self.live_service_item = CustomServiceItem(self.live_controller)
936
937 def get_media_manager_item(self):
938 # Create the CustomManagerItem object
939 self.media_item = CustomMediaItem(self, self.icon, u'Custom Slides')
940 return self.media_item
941
942- def get_settings_tab(self):
943- pass
944-
945- def initialise(self):
946- pass
947-
948+ def handle_event(self, event):
949+ """
950+ Handle the event contained in the event object.
951+ """
952+ log.debug(u'Handle event called with event %s' %event.get_type())
953
954=== modified file 'openlp/plugins/custom/forms/editcustomform.py'
955--- openlp/plugins/custom/forms/editcustomform.py 2009-03-14 08:11:25 +0000
956+++ openlp/plugins/custom/forms/editcustomform.py 2009-03-25 20:30:48 +0000
957@@ -32,6 +32,7 @@
958 Constructor
959 """
960 QtGui.QDialog.__init__(self, parent)
961+ #self.parent = parent
962 self.setupUi(self)
963 # Connecting signals and slots
964 QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("rejected()"), self.rejected)
965@@ -52,8 +53,7 @@
966 # Create other objects and forms
967 self.custommanager = custommanager
968 self.initialise()
969- self.VerseListView.setAlternatingRowColors(True)
970- #self.savebutton = self.ButtonBox.button(QtGui.QDialogButtonBox.Save)
971+ self.VerseListView.setAlternatingRowColors(True)
972
973 def initialise(self):
974 self.valid = True
975@@ -65,7 +65,9 @@
976 self.VerseTextEdit.clear()
977 self.VerseListView.clear()
978 #make sure we have a new item
979- self.customSlide = CustomSlide()
980+ self.customSlide = CustomSlide()
981+ self.ThemecomboBox.addItem(u'')
982+ #self.theme_manager.getThemes()
983
984 def loadCustom(self, id):
985 self.customSlide = CustomSlide()
986
987=== modified file 'openlp/plugins/images/imageplugin.py'
988--- openlp/plugins/images/imageplugin.py 2009-03-18 17:19:30 +0000
989+++ openlp/plugins/images/imageplugin.py 2009-03-22 07:13:34 +0000
990@@ -31,17 +31,17 @@
991 log=logging.getLogger(u'ImagePlugin')
992 log.info(u'Image Plugin loaded')
993
994- def __init__(self, preview_controller, live_controller):
995+ def __init__(self, plugin_helpers):
996 # Call the parent constructor
997- Plugin.__init__(self, u'Images', u'1.9.0', preview_controller, live_controller)
998+ Plugin.__init__(self, u'Images', u'1.9.0', plugin_helpers)
999 self.weight = -7
1000 # Create the plugin icon
1001 self.icon = QtGui.QIcon()
1002 self.icon.addPixmap(QtGui.QPixmap(':/media/media_image.png'),
1003 QtGui.QIcon.Normal, QtGui.QIcon.Off)
1004
1005- self.preview_service_item = ImageServiceItem(preview_controller)
1006- self.live_service_item = ImageServiceItem(live_controller)
1007+ self.preview_service_item = ImageServiceItem(self.preview_controller)
1008+ self.live_service_item = ImageServiceItem(self.live_controller)
1009
1010 def get_media_manager_item(self):
1011 # Create the MediaManagerItem object
1012
1013=== modified file 'openlp/plugins/images/lib/__init__.py'
1014--- openlp/plugins/images/lib/__init__.py 2009-03-08 12:41:07 +0000
1015+++ openlp/plugins/images/lib/__init__.py 2009-03-24 06:07:03 +0000
1016@@ -17,6 +17,6 @@
1017 this program; if not, write to the Free Software Foundation, Inc., 59 Temple
1018 Place, Suite 330, Boston, MA 02111-1307 USA
1019 """
1020+from listwithpreviews import ListWithPreviews
1021 from imageserviceitem import ImageServiceItem
1022-from listwithpreviews import ListWithPreviews
1023 from mediaitem import ImageMediaItem
1024
1025=== modified file 'openlp/plugins/presentations/presentationplugin.py'
1026--- openlp/plugins/presentations/presentationplugin.py 2009-03-19 17:31:33 +0000
1027+++ openlp/plugins/presentations/presentationplugin.py 2009-03-22 07:13:34 +0000
1028@@ -28,9 +28,9 @@
1029
1030 class PresentationPlugin(Plugin):
1031
1032- def __init__(self):
1033+ def __init__(self, plugin_helpers):
1034 # Call the parent constructor
1035- Plugin.__init__(self, u'Presentations', u'1.9.0')
1036+ Plugin.__init__(self, u'Presentations', u'1.9.0', plugin_helpers)
1037 self.weight = -8
1038 # Create the plugin icon
1039 self.icon = QtGui.QIcon()
1040
1041=== modified file 'openlp/plugins/songs/songsplugin.py'
1042--- openlp/plugins/songs/songsplugin.py 2009-03-18 17:19:30 +0000
1043+++ openlp/plugins/songs/songsplugin.py 2009-03-22 07:13:34 +0000
1044@@ -33,9 +33,9 @@
1045 log=logging.getLogger(u'SongsPlugin')
1046 log.info(u'Song Plugin loaded')
1047
1048- def __init__(self):
1049+ def __init__(self, plugin_helpers):
1050 # Call the parent constructor
1051- Plugin.__init__(self, u'Songs', u'1.9.0')
1052+ Plugin.__init__(self, u'Songs', u'1.9.0', plugin_helpers)
1053 self.weight = -10
1054 self.songmanager = SongManager(self.config)
1055 self.openlp_import_form = OpenLPImportForm()
1056
1057=== modified file 'openlp/plugins/videos/videoplugin.py'
1058--- openlp/plugins/videos/videoplugin.py 2009-03-19 17:31:33 +0000
1059+++ openlp/plugins/videos/videoplugin.py 2009-03-22 07:13:34 +0000
1060@@ -26,9 +26,9 @@
1061
1062 class VideoPlugin(Plugin):
1063
1064- def __init__(self):
1065+ def __init__(self, plugin_helpers):
1066 # Call the parent constructor
1067- Plugin.__init__(self, u'Videos', u'1.9.0')
1068+ Plugin.__init__(self, u'Videos', u'1.9.0', plugin_helpers)
1069 self.weight = -6
1070 # Create the plugin icon
1071 self.icon = QtGui.QIcon()