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

Proposed by Tim Bentley
Status: Merged
Merged at revision: not available
Proposed branch: lp:~trb143/openlp/bugfixes
Merge into: lp:openlp
Diff against target: None lines
To merge this branch: bzr merge lp:~trb143/openlp/bugfixes
Reviewer Review Type Date Requested Status
Raoul Snyman Approve
Review via email: mp+10577@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Tim Bentley (trb143) wrote :

Changes which have been stacked up for the last week and are still valid.

Revision history for this message
Raoul Snyman (raoul-snyman) :
review: Approve
lp:~trb143/openlp/bugfixes updated
510. By Tim Bentley

Many fixes and corrections
Adding Presentation code (start)
Add error message to code

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'openlp/core/lib/event.py'
--- openlp/core/lib/event.py 2009-08-12 04:57:24 +0000
+++ openlp/core/lib/event.py 2009-08-15 07:33:01 +0000
@@ -45,7 +45,7 @@
45 """45 """
46 Provides an Event class to encapsulate events within openlp.org.46 Provides an Event class to encapsulate events within openlp.org.
47 """47 """
48 def __init__(self, event_type, sender, payload=None):48 def __init__(self, sender, event_type=EventType.Default, payload=None):
49 self.event_type = event_type49 self.event_type = event_type
50 self.payload = payload50 self.payload = payload
51 self.sender = sender51 self.sender = sender
5252
=== modified file 'openlp/core/lib/plugin.py'
--- openlp/core/lib/plugin.py 2009-08-12 04:57:24 +0000
+++ openlp/core/lib/plugin.py 2009-08-15 11:02:24 +0000
@@ -122,7 +122,6 @@
122 self.log = logging.getLogger(self.name)122 self.log = logging.getLogger(self.name)
123 self.preview_controller = plugin_helpers[u'preview']123 self.preview_controller = plugin_helpers[u'preview']
124 self.live_controller = plugin_helpers[u'live']124 self.live_controller = plugin_helpers[u'live']
125 self.theme_manager = plugin_helpers[u'theme']
126 self.event_manager = plugin_helpers[u'event']125 self.event_manager = plugin_helpers[u'event']
127 self.render_manager = plugin_helpers[u'render']126 self.render_manager = plugin_helpers[u'render']
128 self.service_manager = plugin_helpers[u'service']127 self.service_manager = plugin_helpers[u'service']
@@ -132,6 +131,7 @@
132 def check_pre_conditions(self):131 def check_pre_conditions(self):
133 """132 """
134 Provides the Plugin with a handle to check if it can be loaded.133 Provides the Plugin with a handle to check if it can be loaded.
134 Failing Preconditions does not stop a settings Tab being created
135135
136 Returns True or False.136 Returns True or False.
137 """137 """
138138
=== modified file 'openlp/core/lib/pluginmanager.py'
--- openlp/core/lib/pluginmanager.py 2009-08-13 20:02:38 +0000
+++ openlp/core/lib/pluginmanager.py 2009-08-15 07:55:16 +0000
@@ -93,18 +93,20 @@
93 for p in plugin_classes:93 for p in plugin_classes:
94 try:94 try:
95 plugin = p(self.plugin_helpers)95 plugin = p(self.plugin_helpers)
96 log.debug(u'loaded plugin %s with helpers', unicode(p))96 log.debug(u'Loaded plugin %s with helpers', unicode(p))
97 log.debug(u'Plugin: %s', unicode(p))97
98 pList = {u'name': plugin.name, u'version':plugin.version, u'status': u'Inactive'}98 plugin_objects.append(plugin)
99 if plugin.check_pre_conditions():
100 log.debug(u'Appending %s ', unicode(p))
101 plugin_objects.append(plugin)
102 eventmanager.register(plugin)
103 pList[u'status'] = u'Active'
104 self.plugin_list.append(pList)
105 except TypeError:99 except TypeError:
106 log.error(u'loaded plugin %s has no helpers', unicode(p))100 log.error(u'loaded plugin %s has no helpers', unicode(p))
107 self.plugins = sorted(plugin_objects, self.order_by_weight)101 plugins_list = sorted(plugin_objects, self.order_by_weight)
102 for plugin in plugins_list:
103 pList = {u'plugin': plugin, u'status': u'Inactive'}
104 if plugin.check_pre_conditions():
105 log.debug(u'Plugin %s active', unicode(plugin.name))
106 eventmanager.register(plugin)
107 pList[u'status'] = u'Active'
108 self.plugins.append(pList)
109
108110
109 def order_by_weight(self, x, y):111 def order_by_weight(self, x, y):
110 """112 """
@@ -127,10 +129,11 @@
127 The Media Manager itself.129 The Media Manager itself.
128 """130 """
129 for plugin in self.plugins:131 for plugin in self.plugins:
130 media_manager_item = plugin.get_media_manager_item()132 if plugin[u'status'] == u'Active':
131 if media_manager_item is not None:133 media_manager_item = plugin[u'plugin'].get_media_manager_item()
132 log.debug(u'Inserting media manager item from %s' % plugin.name)134 if media_manager_item is not None:
133 mediatoolbox.addItem(media_manager_item, plugin.icon, media_manager_item.title)135 log.debug(u'Inserting media manager item from %s' % plugin[u'plugin'].name)
136 mediatoolbox.addItem(media_manager_item, plugin[u'plugin'].icon, media_manager_item.title)
134137
135 def hook_settings_tabs(self, settingsform=None):138 def hook_settings_tabs(self, settingsform=None):
136 """139 """
@@ -141,12 +144,12 @@
141 Defaults to *None*. The settings form to add tabs to.144 Defaults to *None*. The settings form to add tabs to.
142 """145 """
143 for plugin in self.plugins:146 for plugin in self.plugins:
144 settings_tab = plugin.get_settings_tab()147 settings_tab = plugin[u'plugin'].get_settings_tab()
145 if settings_tab is not None:148 if settings_tab is not None:
146 log.debug(u'Inserting settings tab item from %s' % plugin.name)149 log.debug(u'Inserting settings tab item from %s' % plugin[u'plugin'].name)
147 settingsform.addTab(settings_tab)150 settingsform.addTab(settings_tab)
148 else:151 else:
149 log.debug(u'No settings in %s' % plugin.name)152 log.debug(u'No settings in %s' % plugin[u'plugin'].name)
150153
151 def hook_import_menu(self, import_menu):154 def hook_import_menu(self, import_menu):
152 """155 """
@@ -157,7 +160,8 @@
157 The Import menu.160 The Import menu.
158 """161 """
159 for plugin in self.plugins:162 for plugin in self.plugins:
160 plugin.add_import_menu_item(import_menu)163 if plugin[u'status'] == u'Active':
164 plugin[u'plugin'].add_import_menu_item(import_menu)
161165
162 def hook_export_menu(self, export_menu):166 def hook_export_menu(self, export_menu):
163 """167 """
@@ -168,7 +172,8 @@
168 The Export menu.172 The Export menu.
169 """173 """
170 for plugin in self.plugins:174 for plugin in self.plugins:
171 plugin.add_export_menu_item(export_menu)175 if plugin[u'status'] == u'Active':
176 plugin[u'plugin'].add_export_menu_item(export_menu)
172177
173 def initialise_plugins(self):178 def initialise_plugins(self):
174 """179 """
@@ -176,7 +181,8 @@
176 initialise themselves.181 initialise themselves.
177 """182 """
178 for plugin in self.plugins:183 for plugin in self.plugins:
179 plugin.initialise()184 if plugin[u'status'] == u'Active':
185 plugin[u'plugin'].initialise()
180186
181 def finalise_plugins(self):187 def finalise_plugins(self):
182 """188 """
@@ -184,4 +190,5 @@
184 clean themselves up190 clean themselves up
185 """191 """
186 for plugin in self.plugins:192 for plugin in self.plugins:
187 plugin.finalise()193 if plugin[u'status'] == u'Active':
194 plugin[u'plugin'].finalise()
188195
=== modified file 'openlp/core/ui/mainwindow.py'
--- openlp/core/ui/mainwindow.py 2009-08-14 19:12:14 +0000
+++ openlp/core/ui/mainwindow.py 2009-08-15 11:02:24 +0000
@@ -468,7 +468,6 @@
468 self.plugin_helpers[u'preview'] = self.PreviewController468 self.plugin_helpers[u'preview'] = self.PreviewController
469 self.plugin_helpers[u'live'] = self.LiveController469 self.plugin_helpers[u'live'] = self.LiveController
470 self.plugin_helpers[u'event'] = self.EventManager470 self.plugin_helpers[u'event'] = self.EventManager
471 self.plugin_helpers[u'theme'] = self.ThemeManagerContents
472 self.plugin_helpers[u'render'] = self.RenderManager471 self.plugin_helpers[u'render'] = self.RenderManager
473 self.plugin_helpers[u'service'] = self.ServiceManagerContents472 self.plugin_helpers[u'service'] = self.ServiceManagerContents
474 self.plugin_helpers[u'settings'] = self.settingsForm473 self.plugin_helpers[u'settings'] = self.settingsForm
@@ -596,8 +595,7 @@
596595
597 def handle_event(self, event):596 def handle_event(self, event):
598 if event.event_type == EventType.ThemeListChanged:597 if event.event_type == EventType.ThemeListChanged:
599 themes = self.ThemeManagerContents.getThemes()598 self.ServiceManagerContents.updateThemeList(event.payload)
600 self.ServiceManagerContents.updateThemeList(themes)599 self.settingsForm.ThemesTab.updateThemeList(event.payload)
601 self.settingsForm.ThemesTab.updateThemeList(themes)
602 self.DefaultThemeLabel.setText(self.defaultThemeText + \600 self.DefaultThemeLabel.setText(self.defaultThemeText + \
603 self.ThemeManagerContents.getDefault())601 self.ThemeManagerContents.getDefault())
604602
=== modified file 'openlp/core/ui/plugindialoglistform.py'
--- openlp/core/ui/plugindialoglistform.py 2009-08-14 16:26:22 +0000
+++ openlp/core/ui/plugindialoglistform.py 2009-08-15 19:10:59 +0000
@@ -58,12 +58,14 @@
58 """58 """
59 Load the plugin details into the screen59 Load the plugin details into the screen
60 """60 """
61 for plugin in self.parent.plugin_manager.plugin_list:61 #self.PluginViewList.clear()
62 self.PluginViewList.setRowCount(0)
63 for plugin in self.parent.plugin_manager.plugins:
62 row = self.PluginViewList.rowCount()64 row = self.PluginViewList.rowCount()
63 self.PluginViewList.setRowCount(row + 1)65 self.PluginViewList.setRowCount(row + 1)
64 item1 = QtGui.QTableWidgetItem(plugin[u'name'])66 item1 = QtGui.QTableWidgetItem(plugin[u'plugin'].name)
65 item1.setTextAlignment(QtCore.Qt.AlignVCenter)67 item1.setTextAlignment(QtCore.Qt.AlignVCenter)
66 item2 = QtGui.QTableWidgetItem(plugin[u'version'])68 item2 = QtGui.QTableWidgetItem(plugin[u'plugin'].version)
67 item2.setTextAlignment(QtCore.Qt.AlignVCenter)69 item2.setTextAlignment(QtCore.Qt.AlignVCenter)
68 item3 = QtGui.QTableWidgetItem(translate(u'PluginForm', plugin[u'status']))70 item3 = QtGui.QTableWidgetItem(translate(u'PluginForm', plugin[u'status']))
69 item3.setTextAlignment(QtCore.Qt.AlignVCenter)71 item3.setTextAlignment(QtCore.Qt.AlignVCenter)
7072
=== modified file 'openlp/core/ui/servicemanager.py'
--- openlp/core/ui/servicemanager.py 2009-08-12 04:57:24 +0000
+++ openlp/core/ui/servicemanager.py 2009-08-15 07:33:01 +0000
@@ -488,7 +488,7 @@
488 link = event.mimeData()488 link = event.mimeData()
489 if link.hasText():489 if link.hasText():
490 plugin = event.mimeData().text()490 plugin = event.mimeData().text()
491 self.parent.EventManager.post_event(Event(EventType.LoadServiceItem, u'ServiceManager', plugin))491 self.parent.EventManager.post_event(Event(u'ServiceManager', EventType.LoadServiceItem, plugin))
492492
493 def updateThemeList(self, theme_list):493 def updateThemeList(self, theme_list):
494 """494 """
495495
=== modified file 'openlp/core/ui/thememanager.py'
--- openlp/core/ui/thememanager.py 2009-08-12 04:57:24 +0000
+++ openlp/core/ui/thememanager.py 2009-08-15 07:33:01 +0000
@@ -184,7 +184,7 @@
184 self.pushThemes()184 self.pushThemes()
185185
186 def pushThemes(self):186 def pushThemes(self):
187 self.parent.EventManager.post_event(Event(EventType.ThemeListChanged,u'ThemeManager'))187 self.parent.EventManager.post_event(Event(u'ThemeManager', EventType.ThemeListChanged, self.getThemes()))
188188
189 def getThemes(self):189 def getThemes(self):
190 return self.themelist190 return self.themelist
191191
=== modified file 'openlp/plugins/bibles/bibleplugin.py'
--- openlp/plugins/bibles/bibleplugin.py 2009-08-12 04:57:24 +0000
+++ openlp/plugins/bibles/bibleplugin.py 2009-08-15 07:33:01 +0000
@@ -81,5 +81,5 @@
81 log.debug(u'Handle event called with event %s with payload %s'%(event.event_type, event.payload))81 log.debug(u'Handle event called with event %s with payload %s'%(event.event_type, event.payload))
82 if event.event_type == EventType.ThemeListChanged:82 if event.event_type == EventType.ThemeListChanged:
83 log.debug(u'New Theme request received')83 log.debug(u'New Theme request received')
84 self.bibles_tab.updateThemeList(self.theme_manager.getThemes())84 self.bibles_tab.updateThemeList(event.payload)
85 return Plugin.handle_event(self, event)85 return Plugin.handle_event(self, event)
8686
=== modified file 'openlp/plugins/bibles/forms/bibleimportform.py'
--- openlp/plugins/bibles/forms/bibleimportform.py 2009-07-09 05:15:26 +0000
+++ openlp/plugins/bibles/forms/bibleimportform.py 2009-08-15 07:55:16 +0000
@@ -47,6 +47,7 @@
47 self.bibleplugin = bibleplugin47 self.bibleplugin = bibleplugin
48 self.bible_type = None48 self.bible_type = None
49 self.barmax = 049 self.barmax = 0
50 self.tabWidget.setCurrentIndex(0)
50 self.AddressEdit.setText(self.config.get_config(u'proxy_address', u''))51 self.AddressEdit.setText(self.config.get_config(u'proxy_address', u''))
51 self.UsernameEdit.setText(self.config.get_config(u'proxy_username',u''))52 self.UsernameEdit.setText(self.config.get_config(u'proxy_username',u''))
52 self.PasswordEdit.setText(self.config.get_config(u'proxy_password',u''))53 self.PasswordEdit.setText(self.config.get_config(u'proxy_password',u''))
5354
=== modified file 'openlp/plugins/bibles/lib/mediaitem.py'
--- openlp/plugins/bibles/lib/mediaitem.py 2009-08-05 17:59:37 +0000
+++ openlp/plugins/bibles/lib/mediaitem.py 2009-08-15 11:02:24 +0000
@@ -25,30 +25,14 @@
25from PyQt4 import QtCore, QtGui25from PyQt4 import QtCore, QtGui
2626
27from openlp.core.lib import translate, ServiceItem, MediaManagerItem, \27from openlp.core.lib import translate, ServiceItem, MediaManagerItem, \
28 Receiver, contextMenuAction, contextMenuSeparator28 Receiver, contextMenuAction, contextMenuSeparator, BaseListWithDnD
29from openlp.plugins.bibles.forms import BibleImportForm29from openlp.plugins.bibles.forms import BibleImportForm
30from openlp.plugins.bibles.lib.manager import BibleMode30from openlp.plugins.bibles.lib.manager import BibleMode
3131
32class BibleList(QtGui.QListWidget):32class BibleListView(BaseListWithDnD):
3333 def __init__(self, parent=None):
34 def __init__(self,parent=None,name=None):34 self.PluginName = u'Bibles'
35 QtGui.QListView.__init__(self,parent)35 BaseListWithDnD.__init__(self, parent)
36
37 def mouseMoveEvent(self, event):
38 """
39 Drag and drop event does not care what data is selected
40 as the recepient will use events to request the data move
41 just tell it what plugin to call
42 """
43 if event.buttons() != QtCore.Qt.LeftButton:
44 return
45 drag = QtGui.QDrag(self)
46 mimeData = QtCore.QMimeData()
47 drag.setMimeData(mimeData)
48 mimeData.setText(u'Bibles')
49 dropAction = drag.start(QtCore.Qt.CopyAction)
50 if dropAction == QtCore.Qt.CopyAction:
51 self.close()
5236
53class BibleMediaItem(MediaManagerItem):37class BibleMediaItem(MediaManagerItem):
54 """38 """
@@ -201,7 +185,7 @@
201 self.SearchTabWidget.addTab(self.AdvancedTab, u'Advanced')185 self.SearchTabWidget.addTab(self.AdvancedTab, u'Advanced')
202 # Add the search tab widget to the page layout186 # Add the search tab widget to the page layout
203 self.PageLayout.addWidget(self.SearchTabWidget)187 self.PageLayout.addWidget(self.SearchTabWidget)
204 self.ListView = BibleList()188 self.ListView = BibleListView()
205 self.ListView.setAlternatingRowColors(True)189 self.ListView.setAlternatingRowColors(True)
206 self.ListView.setSelectionMode(QtGui.QAbstractItemView.ExtendedSelection)190 self.ListView.setSelectionMode(QtGui.QAbstractItemView.ExtendedSelection)
207 self.ListView.setDragEnabled(True)191 self.ListView.setDragEnabled(True)
208192
=== modified file 'openlp/plugins/custom/customplugin.py'
--- openlp/plugins/custom/customplugin.py 2009-08-12 04:57:24 +0000
+++ openlp/plugins/custom/customplugin.py 2009-08-15 07:33:01 +0000
@@ -57,5 +57,5 @@
57 log.debug(u'Handle event called with event %s with payload %s'%(event.event_type, event.payload))57 log.debug(u'Handle event called with event %s with payload %s'%(event.event_type, event.payload))
58 if event.event_type == EventType.ThemeListChanged:58 if event.event_type == EventType.ThemeListChanged:
59 log.debug(u'New Theme request received')59 log.debug(u'New Theme request received')
60 self.edit_custom_form.loadThemes(self.theme_manager.getThemes())60 self.edit_custom_form.loadThemes(event.payload)
61 return Plugin.handle_event(self, event)61 return Plugin.handle_event(self, event)
6262
=== modified file 'openlp/plugins/custom/lib/mediaitem.py'
--- openlp/plugins/custom/lib/mediaitem.py 2009-07-04 05:52:30 +0000
+++ openlp/plugins/custom/lib/mediaitem.py 2009-08-15 11:02:24 +0000
@@ -21,28 +21,12 @@
2121
22from PyQt4 import QtCore, QtGui22from PyQt4 import QtCore, QtGui
2323
24from openlp.core.lib import MediaManagerItem, SongXMLParser, ServiceItem, translate, contextMenuAction, contextMenuSeparator24from openlp.core.lib import MediaManagerItem, SongXMLParser, ServiceItem, translate, contextMenuAction, contextMenuSeparator, BaseListWithDnD
2525
26class CustomList(QtGui.QListWidget):26class CustomListView(BaseListWithDnD):
2727 def __init__(self, parent=None):
28 def __init__(self,parent=None,name=None):28 self.PluginName = u'Custom'
29 QtGui.QListView.__init__(self,parent)29 BaseListWithDnD.__init__(self, parent)
30
31 def mouseMoveEvent(self, event):
32 """
33 Drag and drop event does not care what data is selected
34 as the recepient will use events to request the data move
35 just tell it what plugin to call
36 """
37 if event.buttons() != QtCore.Qt.LeftButton:
38 return
39 drag = QtGui.QDrag(self)
40 mimeData = QtCore.QMimeData()
41 drag.setMimeData(mimeData)
42 mimeData.setText(u'Custom')
43 dropAction = drag.start(QtCore.Qt.CopyAction)
44 if dropAction == QtCore.Qt.CopyAction:
45 self.close()
4630
47class CustomMediaItem(MediaManagerItem):31class CustomMediaItem(MediaManagerItem):
48 """32 """
@@ -95,7 +79,7 @@
95 translate(u'CustomMediaItem',u'Add Custom To Service'),79 translate(u'CustomMediaItem',u'Add Custom To Service'),
96 translate(u'CustomMediaItem',u'Add the selected Custom(s) to the service'),80 translate(u'CustomMediaItem',u'Add the selected Custom(s) to the service'),
97 u':/system/system_add.png', self.onCustomAddClick, u'CustomAddItem')81 u':/system/system_add.png', self.onCustomAddClick, u'CustomAddItem')
98 # Add the Customlist widget82 # Add the CustomListView widget
99 self.CustomWidget = QtGui.QWidget(self)83 self.CustomWidget = QtGui.QWidget(self)
100 sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)84 sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
101 sizePolicy.setHorizontalStretch(0)85 sizePolicy.setHorizontalStretch(0)
@@ -105,7 +89,7 @@
105 self.CustomWidget.setObjectName(u'CustomWidget')89 self.CustomWidget.setObjectName(u'CustomWidget')
106 # Add the Custom widget to the page layout90 # Add the Custom widget to the page layout
107 self.PageLayout.addWidget(self.CustomWidget)91 self.PageLayout.addWidget(self.CustomWidget)
108 self.ListView = CustomList()92 self.ListView = CustomListView()
109 self.ListView.setAlternatingRowColors(True)93 self.ListView.setAlternatingRowColors(True)
110 self.ListView.setDragEnabled(True)94 self.ListView.setDragEnabled(True)
111 self.PageLayout.addWidget(self.ListView)95 self.PageLayout.addWidget(self.ListView)
@@ -129,9 +113,9 @@
129 translate(u'CustomMediaItem',u'&Add to Service'), self.onCustomAddClick))113 translate(u'CustomMediaItem',u'&Add to Service'), self.onCustomAddClick))
130114
131 def initialise(self):115 def initialise(self):
132 self.loadCustomList(self.parent.custommanager.get_all_slides())116 self.loadCustomListView(self.parent.custommanager.get_all_slides())
133117
134 def loadCustomList(self, list):118 def loadCustomListView(self, list):
135 self.ListView.clear()119 self.ListView.clear()
136 for CustomSlide in list:120 for CustomSlide in list:
137 custom_name = QtGui.QListWidgetItem(CustomSlide.title)121 custom_name = QtGui.QListWidgetItem(CustomSlide.title)
138122
=== modified file 'openlp/plugins/media/lib/mediaitem.py'
--- openlp/plugins/media/lib/mediaitem.py 2009-07-04 05:52:30 +0000
+++ openlp/plugins/media/lib/mediaitem.py 2009-08-15 11:02:24 +0000
@@ -32,7 +32,6 @@
3232
33from openlp.plugins.media.lib import MediaTab33from openlp.plugins.media.lib import MediaTab
34from openlp.plugins.media.lib import FileListData34from openlp.plugins.media.lib import FileListData
35# from listwithpreviews import ListWithPreviews
36from openlp.core.lib import MediaManagerItem, ServiceItem, translate, BaseListWithDnD, buildIcon35from openlp.core.lib import MediaManagerItem, ServiceItem, translate, BaseListWithDnD, buildIcon
3736
38class MediaListView(BaseListWithDnD):37class MediaListView(BaseListWithDnD):
3938
=== modified file 'openlp/plugins/presentations/lib/presentationtab.py'
--- openlp/plugins/presentations/lib/presentationtab.py 2009-08-14 19:12:14 +0000
+++ openlp/plugins/presentations/lib/presentationtab.py 2009-08-15 19:10:59 +0000
@@ -93,4 +93,3 @@
93 def save(self):93 def save(self):
94 self.config.set_config(u'Powerpoint', unicode(self.PowerpointCheckBox.checkState()))94 self.config.set_config(u'Powerpoint', unicode(self.PowerpointCheckBox.checkState()))
95 self.config.set_config(u'Impress', unicode(self.ImpressCheckBox.checkState()))95 self.config.set_config(u'Impress', unicode(self.ImpressCheckBox.checkState()))
96 print self.PowerpointCheckBox.checkState(), unicode(self.PowerpointCheckBox.checkState())
9796
=== modified file 'openlp/plugins/presentations/presentationplugin.py'
--- openlp/plugins/presentations/presentationplugin.py 2009-08-14 19:12:14 +0000
+++ openlp/plugins/presentations/presentationplugin.py 2009-08-15 19:10:59 +0000
@@ -67,12 +67,12 @@
67 """67 """
68 log.debug('check_pre_conditions')68 log.debug('check_pre_conditions')
6969
70 if int(self.config.get_config(u'Powerpoint', 0)) == 2:70 if int(self.config.get_config(u'Impress', 0)) == 2:
71 try:71 try:
72 #Check to see if we have uno installed72 #Check to see if we have uno installed
73 import uno73 import uno
74 #openoffice = impressController()74 openoffice = impressController()
75 self.registerControllers(u'Impress', None)75 self.registerControllers(u'Impress', openoffice)
76 except:76 except:
77 pass77 pass
78 #If we have no controllers disable plugin78 #If we have no controllers disable plugin
@@ -80,3 +80,10 @@
80 return True80 return True
81 else:81 else:
82 return False82 return False
83
84 def finalise(self):
85 log.debug(u'Finalise')
86 print self.controllers
87 for controller in self.controllers:
88 print controller
89 self.controllers[controller].kill()
8390
=== modified file 'openlp/plugins/remotes/remoteplugin.py'
--- openlp/plugins/remotes/remoteplugin.py 2009-08-14 17:41:29 +0000
+++ openlp/plugins/remotes/remoteplugin.py 2009-08-15 07:33:01 +0000
@@ -56,9 +56,9 @@
56 log.info(u'Sending event %s ', datagram)56 log.info(u'Sending event %s ', datagram)
57 pos = datagram.find(u':')57 pos = datagram.find(u':')
58 event = unicode(datagram[:pos].lower())58 event = unicode(datagram[:pos].lower())
59 payload = unicode(datagram[pos + 1:])59
60 if event == u'alert':60 if event == u'alert':
61 self.event_manager.post_event(Event(EventType.TriggerAlert, u'RemotePlugin', payload))61 self.event_manager.post_event(Event(u'RemotePlugin', EventType.TriggerAlert , unicode(datagram[pos + 1:])))
6262
6363
6464
6565
=== modified file 'openlp/plugins/songs/forms/editsongform.py'
--- openlp/plugins/songs/forms/editsongform.py 2009-08-14 16:12:40 +0000
+++ openlp/plugins/songs/forms/editsongform.py 2009-08-15 19:19:34 +0000
@@ -23,7 +23,7 @@
23from PyQt4 import Qt, QtCore, QtGui23from PyQt4 import Qt, QtCore, QtGui
2424
25from openlp.core.lib import SongXMLBuilder, SongXMLParser, Event, \25from openlp.core.lib import SongXMLBuilder, SongXMLParser, Event, \
26 EventType, EventManager26 EventType, EventManager, translate
27from openlp.plugins.songs.forms import EditVerseForm27from openlp.plugins.songs.forms import EditVerseForm
28from openlp.plugins.songs.lib.models import Song28from openlp.plugins.songs.lib.models import Song
29from editsongdialog import Ui_EditSongDialog29from editsongdialog import Ui_EditSongDialog
@@ -299,22 +299,26 @@
299 log.debug(u'Validate Song')299 log.debug(u'Validate Song')
300 # Lets be nice and assume the data is correct.300 # Lets be nice and assume the data is correct.
301 valid = True301 valid = True
302 message = u''
302 if len(self.TitleEditItem.displayText()) == 0:303 if len(self.TitleEditItem.displayText()) == 0:
303 valid = False304 valid = False
304 self.TitleEditItem.setStyleSheet(u'background-color: red; color: white')305 self.TitleEditItem.setStyleSheet(u'background-color: red; color: white')
306 message = translate(u'SongFormDialog', u'You need to enter a song title \n')
305 else:307 else:
306 self.TitleEditItem.setStyleSheet(u'')308 self.TitleEditItem.setStyleSheet(u'')
307 if self.VerseListWidget.count() == 0:309 if self.VerseListWidget.count() == 0:
308 valid = False310 valid = False
309 self.VerseListWidget.setStyleSheet(u'background-color: red; color: white')311 self.VerseListWidget.setStyleSheet(u'background-color: red; color: white')
312 message = message + translate(u'SongFormDialog', u'You need to enter some verse text \n')
310 else:313 else:
311 self.VerseListWidget.setStyleSheet(u'')314 self.VerseListWidget.setStyleSheet(u'')
312 if self.AuthorsListView.count() == 0:315 if self.AuthorsListView.count() == 0:
313 valid = False316 valid = False
314 self.AuthorsListView.setStyleSheet(u'background-color: red; color: white')317 self.AuthorsListView.setStyleSheet(u'background-color: red; color: white')
318 message = message + translate(u'SongFormDialog', u'You need to provide an author')
315 else:319 else:
316 self.AuthorsListView.setStyleSheet(u'')320 self.AuthorsListView.setStyleSheet(u'')
317 return valid321 return valid, message
318322
319 def on_TitleEditItem_lostFocus(self):323 def on_TitleEditItem_lostFocus(self):
320 self.song.title = self.TitleEditItem.text()324 self.song.title = self.TitleEditItem.text()
@@ -345,7 +349,11 @@
345349
346 def accept(self):350 def accept(self):
347 log.debug(u'accept')351 log.debug(u'accept')
348 if not self._validate_song():352 valid , message = self._validate_song()
353 if not valid:
354 QtGui.QMessageBox.critical(self,
355 translate(u'SongFormDialog', u'Error'), message,
356 QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok))
349 return357 return
350 self.song.title = unicode(self.TitleEditItem.displayText())358 self.song.title = unicode(self.TitleEditItem.displayText())
351 self.song.copyright = unicode(self.CopyrightEditItem.displayText())359 self.song.copyright = unicode(self.CopyrightEditItem.displayText())
@@ -356,7 +364,7 @@
356 self.processTitle()364 self.processTitle()
357 self.songmanager.save_song(self.song)365 self.songmanager.save_song(self.song)
358 if self.title_change:366 if self.title_change:
359 self.eventmanager.post_event(Event(EventType.LoadSongList, u'EditSongForm'))367 self.eventmanager.post_event(Event(u'EditSongForm', EventType.LoadSongList))
360 self.close()368 self.close()
361369
362 def processLyrics(self):370 def processLyrics(self):
363371
=== modified file 'openlp/plugins/songs/lib/mediaitem.py'
--- openlp/plugins/songs/lib/mediaitem.py 2009-08-06 13:17:36 +0000
+++ openlp/plugins/songs/lib/mediaitem.py 2009-08-15 11:02:24 +0000
@@ -22,29 +22,13 @@
22from PyQt4 import QtCore, QtGui22from PyQt4 import QtCore, QtGui
2323
24from openlp.core.lib import MediaManagerItem, translate, ServiceItem, \24from openlp.core.lib import MediaManagerItem, translate, ServiceItem, \
25 SongXMLParser, contextMenuAction, contextMenuSeparator25 SongXMLParser, contextMenuAction, contextMenuSeparator, BaseListWithDnD
26from openlp.plugins.songs.forms import EditSongForm, SongMaintenanceForm26from openlp.plugins.songs.forms import EditSongForm, SongMaintenanceForm
2727
28class SongList(QtGui.QListWidget):28class SongListView(BaseListWithDnD):
2929 def __init__(self, parent=None):
30 def __init__(self, parent=None, name=None):30 self.PluginName = u'Song'
31 QtGui.QListWidget.__init__(self,parent)31 BaseListWithDnD.__init__(self, parent)
32
33 def mouseMoveEvent(self, event):
34 """
35 Drag and drop event does not care what data is selected
36 as the recepient will use events to request the data move
37 just tell it what plugin to call
38 """
39 if event.buttons() != QtCore.Qt.LeftButton:
40 return
41 drag = QtGui.QDrag(self)
42 mimeData = QtCore.QMimeData()
43 drag.setMimeData(mimeData)
44 mimeData.setText(u'Song')
45 dropAction = drag.start(QtCore.Qt.CopyAction)
46 if dropAction == QtCore.Qt.CopyAction:
47 self.close()
4832
49class SongMediaItem(MediaManagerItem):33class SongMediaItem(MediaManagerItem):
50 """34 """
@@ -97,7 +81,7 @@
97 self.addToolbarButton(translate(u'SongMediaItem', u'Song Maintenance'),81 self.addToolbarButton(translate(u'SongMediaItem', u'Song Maintenance'),
98 translate(u'SongMediaItem', u'Maintain the lists of authors, topics and books'),82 translate(u'SongMediaItem', u'Maintain the lists of authors, topics and books'),
99 ':/songs/song_maintenance.png', self.onSongMaintenanceClick, 'SongMaintenanceItem')83 ':/songs/song_maintenance.png', self.onSongMaintenanceClick, 'SongMaintenanceItem')
100 ## Add the songlist widget ##84 ## Add the SongListView widget ##
101 # Create the tab widget85 # Create the tab widget
102 self.SongWidget = QtGui.QWidget(self)86 self.SongWidget = QtGui.QWidget(self)
103 sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)87 sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
@@ -128,7 +112,7 @@
128 self.SearchLayout.addWidget(self.SearchTextButton, 3, 2, 1, 1)112 self.SearchLayout.addWidget(self.SearchTextButton, 3, 2, 1, 1)
129 # Add the song widget to the page layout113 # Add the song widget to the page layout
130 self.PageLayout.addWidget(self.SongWidget)114 self.PageLayout.addWidget(self.SongWidget)
131 self.ListView = SongList()115 self.ListView = SongListView()
132 self.ListView.setAlternatingRowColors(True)116 self.ListView.setAlternatingRowColors(True)
133 self.ListView.setDragEnabled(True)117 self.ListView.setDragEnabled(True)
134 self.ListView.setObjectName(u'ListView')118 self.ListView.setObjectName(u'ListView')
135119
=== modified file 'openlp/plugins/songs/songsplugin.py'
--- openlp/plugins/songs/songsplugin.py 2009-08-12 04:57:24 +0000
+++ openlp/plugins/songs/songsplugin.py 2009-08-15 07:33:01 +0000
@@ -136,7 +136,7 @@
136 log.debug(u'Handle event called with event %s' % event.event_type)136 log.debug(u'Handle event called with event %s' % event.event_type)
137 if event.event_type == EventType.ThemeListChanged:137 if event.event_type == EventType.ThemeListChanged:
138 log.debug(u'New Theme request received')138 log.debug(u'New Theme request received')
139 self.media_item.edit_song_form.loadThemes(self.theme_manager.getThemes())139 self.media_item.edit_song_form.loadThemes(event.payload)
140 if event.event_type == EventType.LoadSongList :140 if event.event_type == EventType.LoadSongList :
141 log.debug(u'Load Load Song List Item received')141 log.debug(u'Load Load Song List Item received')
142 self.media_item.displayResultsSong(self.songmanager.get_songs())142 self.media_item.displayResultsSong(self.songmanager.get_songs())