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 | ||||||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Raoul Snyman | Approve | ||
Review via email: mp+10577@code.launchpad.net |
Commit message
Description of the change
To post a comment you must log in.
Revision history for this message
Tim Bentley (trb143) wrote : | # |
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
1 | === modified file 'openlp/core/lib/event.py' | |||
2 | --- openlp/core/lib/event.py 2009-08-12 04:57:24 +0000 | |||
3 | +++ openlp/core/lib/event.py 2009-08-15 07:33:01 +0000 | |||
4 | @@ -45,7 +45,7 @@ | |||
5 | 45 | """ | 45 | """ |
6 | 46 | Provides an Event class to encapsulate events within openlp.org. | 46 | Provides an Event class to encapsulate events within openlp.org. |
7 | 47 | """ | 47 | """ |
9 | 48 | def __init__(self, event_type, sender, payload=None): | 48 | def __init__(self, sender, event_type=EventType.Default, payload=None): |
10 | 49 | self.event_type = event_type | 49 | self.event_type = event_type |
11 | 50 | self.payload = payload | 50 | self.payload = payload |
12 | 51 | self.sender = sender | 51 | self.sender = sender |
13 | 52 | 52 | ||
14 | === modified file 'openlp/core/lib/plugin.py' | |||
15 | --- openlp/core/lib/plugin.py 2009-08-12 04:57:24 +0000 | |||
16 | +++ openlp/core/lib/plugin.py 2009-08-15 11:02:24 +0000 | |||
17 | @@ -122,7 +122,6 @@ | |||
18 | 122 | self.log = logging.getLogger(self.name) | 122 | self.log = logging.getLogger(self.name) |
19 | 123 | self.preview_controller = plugin_helpers[u'preview'] | 123 | self.preview_controller = plugin_helpers[u'preview'] |
20 | 124 | self.live_controller = plugin_helpers[u'live'] | 124 | self.live_controller = plugin_helpers[u'live'] |
21 | 125 | self.theme_manager = plugin_helpers[u'theme'] | ||
22 | 126 | self.event_manager = plugin_helpers[u'event'] | 125 | self.event_manager = plugin_helpers[u'event'] |
23 | 127 | self.render_manager = plugin_helpers[u'render'] | 126 | self.render_manager = plugin_helpers[u'render'] |
24 | 128 | self.service_manager = plugin_helpers[u'service'] | 127 | self.service_manager = plugin_helpers[u'service'] |
25 | @@ -132,6 +131,7 @@ | |||
26 | 132 | def check_pre_conditions(self): | 131 | def check_pre_conditions(self): |
27 | 133 | """ | 132 | """ |
28 | 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. |
29 | 134 | Failing Preconditions does not stop a settings Tab being created | ||
30 | 135 | 135 | ||
31 | 136 | Returns True or False. | 136 | Returns True or False. |
32 | 137 | """ | 137 | """ |
33 | 138 | 138 | ||
34 | === modified file 'openlp/core/lib/pluginmanager.py' | |||
35 | --- openlp/core/lib/pluginmanager.py 2009-08-13 20:02:38 +0000 | |||
36 | +++ openlp/core/lib/pluginmanager.py 2009-08-15 07:55:16 +0000 | |||
37 | @@ -93,18 +93,20 @@ | |||
38 | 93 | for p in plugin_classes: | 93 | for p in plugin_classes: |
39 | 94 | try: | 94 | try: |
40 | 95 | plugin = p(self.plugin_helpers) | 95 | plugin = p(self.plugin_helpers) |
50 | 96 | log.debug(u'loaded plugin %s with helpers', unicode(p)) | 96 | log.debug(u'Loaded plugin %s with helpers', unicode(p)) |
51 | 97 | log.debug(u'Plugin: %s', unicode(p)) | 97 | |
52 | 98 | pList = {u'name': plugin.name, u'version':plugin.version, u'status': u'Inactive'} | 98 | plugin_objects.append(plugin) |
44 | 99 | if plugin.check_pre_conditions(): | ||
45 | 100 | log.debug(u'Appending %s ', unicode(p)) | ||
46 | 101 | plugin_objects.append(plugin) | ||
47 | 102 | eventmanager.register(plugin) | ||
48 | 103 | pList[u'status'] = u'Active' | ||
49 | 104 | self.plugin_list.append(pList) | ||
53 | 105 | except TypeError: | 99 | except TypeError: |
54 | 106 | log.error(u'loaded plugin %s has no helpers', unicode(p)) | 100 | log.error(u'loaded plugin %s has no helpers', unicode(p)) |
56 | 107 | self.plugins = sorted(plugin_objects, self.order_by_weight) | 101 | plugins_list = sorted(plugin_objects, self.order_by_weight) |
57 | 102 | for plugin in plugins_list: | ||
58 | 103 | pList = {u'plugin': plugin, u'status': u'Inactive'} | ||
59 | 104 | if plugin.check_pre_conditions(): | ||
60 | 105 | log.debug(u'Plugin %s active', unicode(plugin.name)) | ||
61 | 106 | eventmanager.register(plugin) | ||
62 | 107 | pList[u'status'] = u'Active' | ||
63 | 108 | self.plugins.append(pList) | ||
64 | 109 | |||
65 | 108 | 110 | ||
66 | 109 | def order_by_weight(self, x, y): | 111 | def order_by_weight(self, x, y): |
67 | 110 | """ | 112 | """ |
68 | @@ -127,10 +129,11 @@ | |||
69 | 127 | The Media Manager itself. | 129 | The Media Manager itself. |
70 | 128 | """ | 130 | """ |
71 | 129 | for plugin in self.plugins: | 131 | for plugin in self.plugins: |
76 | 130 | media_manager_item = plugin.get_media_manager_item() | 132 | if plugin[u'status'] == u'Active': |
77 | 131 | if media_manager_item is not None: | 133 | media_manager_item = plugin[u'plugin'].get_media_manager_item() |
78 | 132 | log.debug(u'Inserting media manager item from %s' % plugin.name) | 134 | if media_manager_item is not None: |
79 | 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) |
80 | 136 | mediatoolbox.addItem(media_manager_item, plugin[u'plugin'].icon, media_manager_item.title) | ||
81 | 134 | 137 | ||
82 | 135 | def hook_settings_tabs(self, settingsform=None): | 138 | def hook_settings_tabs(self, settingsform=None): |
83 | 136 | """ | 139 | """ |
84 | @@ -141,12 +144,12 @@ | |||
85 | 141 | Defaults to *None*. The settings form to add tabs to. | 144 | Defaults to *None*. The settings form to add tabs to. |
86 | 142 | """ | 145 | """ |
87 | 143 | for plugin in self.plugins: | 146 | for plugin in self.plugins: |
89 | 144 | settings_tab = plugin.get_settings_tab() | 147 | settings_tab = plugin[u'plugin'].get_settings_tab() |
90 | 145 | if settings_tab is not None: | 148 | if settings_tab is not None: |
92 | 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) |
93 | 147 | settingsform.addTab(settings_tab) | 150 | settingsform.addTab(settings_tab) |
94 | 148 | else: | 151 | else: |
96 | 149 | log.debug(u'No settings in %s' % plugin.name) | 152 | log.debug(u'No settings in %s' % plugin[u'plugin'].name) |
97 | 150 | 153 | ||
98 | 151 | def hook_import_menu(self, import_menu): | 154 | def hook_import_menu(self, import_menu): |
99 | 152 | """ | 155 | """ |
100 | @@ -157,7 +160,8 @@ | |||
101 | 157 | The Import menu. | 160 | The Import menu. |
102 | 158 | """ | 161 | """ |
103 | 159 | for plugin in self.plugins: | 162 | for plugin in self.plugins: |
105 | 160 | plugin.add_import_menu_item(import_menu) | 163 | if plugin[u'status'] == u'Active': |
106 | 164 | plugin[u'plugin'].add_import_menu_item(import_menu) | ||
107 | 161 | 165 | ||
108 | 162 | def hook_export_menu(self, export_menu): | 166 | def hook_export_menu(self, export_menu): |
109 | 163 | """ | 167 | """ |
110 | @@ -168,7 +172,8 @@ | |||
111 | 168 | The Export menu. | 172 | The Export menu. |
112 | 169 | """ | 173 | """ |
113 | 170 | for plugin in self.plugins: | 174 | for plugin in self.plugins: |
115 | 171 | plugin.add_export_menu_item(export_menu) | 175 | if plugin[u'status'] == u'Active': |
116 | 176 | plugin[u'plugin'].add_export_menu_item(export_menu) | ||
117 | 172 | 177 | ||
118 | 173 | def initialise_plugins(self): | 178 | def initialise_plugins(self): |
119 | 174 | """ | 179 | """ |
120 | @@ -176,7 +181,8 @@ | |||
121 | 176 | initialise themselves. | 181 | initialise themselves. |
122 | 177 | """ | 182 | """ |
123 | 178 | for plugin in self.plugins: | 183 | for plugin in self.plugins: |
125 | 179 | plugin.initialise() | 184 | if plugin[u'status'] == u'Active': |
126 | 185 | plugin[u'plugin'].initialise() | ||
127 | 180 | 186 | ||
128 | 181 | def finalise_plugins(self): | 187 | def finalise_plugins(self): |
129 | 182 | """ | 188 | """ |
130 | @@ -184,4 +190,5 @@ | |||
131 | 184 | clean themselves up | 190 | clean themselves up |
132 | 185 | """ | 191 | """ |
133 | 186 | for plugin in self.plugins: | 192 | for plugin in self.plugins: |
135 | 187 | plugin.finalise() | 193 | if plugin[u'status'] == u'Active': |
136 | 194 | plugin[u'plugin'].finalise() | ||
137 | 188 | 195 | ||
138 | === modified file 'openlp/core/ui/mainwindow.py' | |||
139 | --- openlp/core/ui/mainwindow.py 2009-08-14 19:12:14 +0000 | |||
140 | +++ openlp/core/ui/mainwindow.py 2009-08-15 11:02:24 +0000 | |||
141 | @@ -468,7 +468,6 @@ | |||
142 | 468 | self.plugin_helpers[u'preview'] = self.PreviewController | 468 | self.plugin_helpers[u'preview'] = self.PreviewController |
143 | 469 | self.plugin_helpers[u'live'] = self.LiveController | 469 | self.plugin_helpers[u'live'] = self.LiveController |
144 | 470 | self.plugin_helpers[u'event'] = self.EventManager | 470 | self.plugin_helpers[u'event'] = self.EventManager |
145 | 471 | self.plugin_helpers[u'theme'] = self.ThemeManagerContents | ||
146 | 472 | self.plugin_helpers[u'render'] = self.RenderManager | 471 | self.plugin_helpers[u'render'] = self.RenderManager |
147 | 473 | self.plugin_helpers[u'service'] = self.ServiceManagerContents | 472 | self.plugin_helpers[u'service'] = self.ServiceManagerContents |
148 | 474 | self.plugin_helpers[u'settings'] = self.settingsForm | 473 | self.plugin_helpers[u'settings'] = self.settingsForm |
149 | @@ -596,8 +595,7 @@ | |||
150 | 596 | 595 | ||
151 | 597 | def handle_event(self, event): | 596 | def handle_event(self, event): |
152 | 598 | if event.event_type == EventType.ThemeListChanged: | 597 | if event.event_type == EventType.ThemeListChanged: |
156 | 599 | themes = self.ThemeManagerContents.getThemes() | 598 | self.ServiceManagerContents.updateThemeList(event.payload) |
157 | 600 | self.ServiceManagerContents.updateThemeList(themes) | 599 | self.settingsForm.ThemesTab.updateThemeList(event.payload) |
155 | 601 | self.settingsForm.ThemesTab.updateThemeList(themes) | ||
158 | 602 | self.DefaultThemeLabel.setText(self.defaultThemeText + \ | 600 | self.DefaultThemeLabel.setText(self.defaultThemeText + \ |
159 | 603 | self.ThemeManagerContents.getDefault()) | 601 | self.ThemeManagerContents.getDefault()) |
160 | 604 | 602 | ||
161 | === modified file 'openlp/core/ui/plugindialoglistform.py' | |||
162 | --- openlp/core/ui/plugindialoglistform.py 2009-08-14 16:26:22 +0000 | |||
163 | +++ openlp/core/ui/plugindialoglistform.py 2009-08-15 19:10:59 +0000 | |||
164 | @@ -58,12 +58,14 @@ | |||
165 | 58 | """ | 58 | """ |
166 | 59 | Load the plugin details into the screen | 59 | Load the plugin details into the screen |
167 | 60 | """ | 60 | """ |
169 | 61 | for plugin in self.parent.plugin_manager.plugin_list: | 61 | #self.PluginViewList.clear() |
170 | 62 | self.PluginViewList.setRowCount(0) | ||
171 | 63 | for plugin in self.parent.plugin_manager.plugins: | ||
172 | 62 | row = self.PluginViewList.rowCount() | 64 | row = self.PluginViewList.rowCount() |
173 | 63 | self.PluginViewList.setRowCount(row + 1) | 65 | self.PluginViewList.setRowCount(row + 1) |
175 | 64 | item1 = QtGui.QTableWidgetItem(plugin[u'name']) | 66 | item1 = QtGui.QTableWidgetItem(plugin[u'plugin'].name) |
176 | 65 | item1.setTextAlignment(QtCore.Qt.AlignVCenter) | 67 | item1.setTextAlignment(QtCore.Qt.AlignVCenter) |
178 | 66 | item2 = QtGui.QTableWidgetItem(plugin[u'version']) | 68 | item2 = QtGui.QTableWidgetItem(plugin[u'plugin'].version) |
179 | 67 | item2.setTextAlignment(QtCore.Qt.AlignVCenter) | 69 | item2.setTextAlignment(QtCore.Qt.AlignVCenter) |
180 | 68 | item3 = QtGui.QTableWidgetItem(translate(u'PluginForm', plugin[u'status'])) | 70 | item3 = QtGui.QTableWidgetItem(translate(u'PluginForm', plugin[u'status'])) |
181 | 69 | item3.setTextAlignment(QtCore.Qt.AlignVCenter) | 71 | item3.setTextAlignment(QtCore.Qt.AlignVCenter) |
182 | 70 | 72 | ||
183 | === modified file 'openlp/core/ui/servicemanager.py' | |||
184 | --- openlp/core/ui/servicemanager.py 2009-08-12 04:57:24 +0000 | |||
185 | +++ openlp/core/ui/servicemanager.py 2009-08-15 07:33:01 +0000 | |||
186 | @@ -488,7 +488,7 @@ | |||
187 | 488 | link = event.mimeData() | 488 | link = event.mimeData() |
188 | 489 | if link.hasText(): | 489 | if link.hasText(): |
189 | 490 | plugin = event.mimeData().text() | 490 | plugin = event.mimeData().text() |
191 | 491 | self.parent.EventManager.post_event(Event(EventType.LoadServiceItem, u'ServiceManager', plugin)) | 491 | self.parent.EventManager.post_event(Event(u'ServiceManager', EventType.LoadServiceItem, plugin)) |
192 | 492 | 492 | ||
193 | 493 | def updateThemeList(self, theme_list): | 493 | def updateThemeList(self, theme_list): |
194 | 494 | """ | 494 | """ |
195 | 495 | 495 | ||
196 | === modified file 'openlp/core/ui/thememanager.py' | |||
197 | --- openlp/core/ui/thememanager.py 2009-08-12 04:57:24 +0000 | |||
198 | +++ openlp/core/ui/thememanager.py 2009-08-15 07:33:01 +0000 | |||
199 | @@ -184,7 +184,7 @@ | |||
200 | 184 | self.pushThemes() | 184 | self.pushThemes() |
201 | 185 | 185 | ||
202 | 186 | def pushThemes(self): | 186 | def pushThemes(self): |
204 | 187 | self.parent.EventManager.post_event(Event(EventType.ThemeListChanged,u'ThemeManager')) | 187 | self.parent.EventManager.post_event(Event(u'ThemeManager', EventType.ThemeListChanged, self.getThemes())) |
205 | 188 | 188 | ||
206 | 189 | def getThemes(self): | 189 | def getThemes(self): |
207 | 190 | return self.themelist | 190 | return self.themelist |
208 | 191 | 191 | ||
209 | === modified file 'openlp/plugins/bibles/bibleplugin.py' | |||
210 | --- openlp/plugins/bibles/bibleplugin.py 2009-08-12 04:57:24 +0000 | |||
211 | +++ openlp/plugins/bibles/bibleplugin.py 2009-08-15 07:33:01 +0000 | |||
212 | @@ -81,5 +81,5 @@ | |||
213 | 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)) |
214 | 82 | if event.event_type == EventType.ThemeListChanged: | 82 | if event.event_type == EventType.ThemeListChanged: |
215 | 83 | log.debug(u'New Theme request received') | 83 | log.debug(u'New Theme request received') |
217 | 84 | self.bibles_tab.updateThemeList(self.theme_manager.getThemes()) | 84 | self.bibles_tab.updateThemeList(event.payload) |
218 | 85 | return Plugin.handle_event(self, event) | 85 | return Plugin.handle_event(self, event) |
219 | 86 | 86 | ||
220 | === modified file 'openlp/plugins/bibles/forms/bibleimportform.py' | |||
221 | --- openlp/plugins/bibles/forms/bibleimportform.py 2009-07-09 05:15:26 +0000 | |||
222 | +++ openlp/plugins/bibles/forms/bibleimportform.py 2009-08-15 07:55:16 +0000 | |||
223 | @@ -47,6 +47,7 @@ | |||
224 | 47 | self.bibleplugin = bibleplugin | 47 | self.bibleplugin = bibleplugin |
225 | 48 | self.bible_type = None | 48 | self.bible_type = None |
226 | 49 | self.barmax = 0 | 49 | self.barmax = 0 |
227 | 50 | self.tabWidget.setCurrentIndex(0) | ||
228 | 50 | self.AddressEdit.setText(self.config.get_config(u'proxy_address', u'')) | 51 | self.AddressEdit.setText(self.config.get_config(u'proxy_address', u'')) |
229 | 51 | self.UsernameEdit.setText(self.config.get_config(u'proxy_username',u'')) | 52 | self.UsernameEdit.setText(self.config.get_config(u'proxy_username',u'')) |
230 | 52 | self.PasswordEdit.setText(self.config.get_config(u'proxy_password',u'')) | 53 | self.PasswordEdit.setText(self.config.get_config(u'proxy_password',u'')) |
231 | 53 | 54 | ||
232 | === modified file 'openlp/plugins/bibles/lib/mediaitem.py' | |||
233 | --- openlp/plugins/bibles/lib/mediaitem.py 2009-08-05 17:59:37 +0000 | |||
234 | +++ openlp/plugins/bibles/lib/mediaitem.py 2009-08-15 11:02:24 +0000 | |||
235 | @@ -25,30 +25,14 @@ | |||
236 | 25 | from PyQt4 import QtCore, QtGui | 25 | from PyQt4 import QtCore, QtGui |
237 | 26 | 26 | ||
238 | 27 | from openlp.core.lib import translate, ServiceItem, MediaManagerItem, \ | 27 | from openlp.core.lib import translate, ServiceItem, MediaManagerItem, \ |
240 | 28 | Receiver, contextMenuAction, contextMenuSeparator | 28 | Receiver, contextMenuAction, contextMenuSeparator, BaseListWithDnD |
241 | 29 | from openlp.plugins.bibles.forms import BibleImportForm | 29 | from openlp.plugins.bibles.forms import BibleImportForm |
242 | 30 | from openlp.plugins.bibles.lib.manager import BibleMode | 30 | from openlp.plugins.bibles.lib.manager import BibleMode |
243 | 31 | 31 | ||
264 | 32 | class BibleList(QtGui.QListWidget): | 32 | class BibleListView(BaseListWithDnD): |
265 | 33 | 33 | def __init__(self, parent=None): | |
266 | 34 | def __init__(self,parent=None,name=None): | 34 | self.PluginName = u'Bibles' |
267 | 35 | QtGui.QListView.__init__(self,parent) | 35 | BaseListWithDnD.__init__(self, parent) |
248 | 36 | |||
249 | 37 | def mouseMoveEvent(self, event): | ||
250 | 38 | """ | ||
251 | 39 | Drag and drop event does not care what data is selected | ||
252 | 40 | as the recepient will use events to request the data move | ||
253 | 41 | just tell it what plugin to call | ||
254 | 42 | """ | ||
255 | 43 | if event.buttons() != QtCore.Qt.LeftButton: | ||
256 | 44 | return | ||
257 | 45 | drag = QtGui.QDrag(self) | ||
258 | 46 | mimeData = QtCore.QMimeData() | ||
259 | 47 | drag.setMimeData(mimeData) | ||
260 | 48 | mimeData.setText(u'Bibles') | ||
261 | 49 | dropAction = drag.start(QtCore.Qt.CopyAction) | ||
262 | 50 | if dropAction == QtCore.Qt.CopyAction: | ||
263 | 51 | self.close() | ||
268 | 52 | 36 | ||
269 | 53 | class BibleMediaItem(MediaManagerItem): | 37 | class BibleMediaItem(MediaManagerItem): |
270 | 54 | """ | 38 | """ |
271 | @@ -201,7 +185,7 @@ | |||
272 | 201 | self.SearchTabWidget.addTab(self.AdvancedTab, u'Advanced') | 185 | self.SearchTabWidget.addTab(self.AdvancedTab, u'Advanced') |
273 | 202 | # Add the search tab widget to the page layout | 186 | # Add the search tab widget to the page layout |
274 | 203 | self.PageLayout.addWidget(self.SearchTabWidget) | 187 | self.PageLayout.addWidget(self.SearchTabWidget) |
276 | 204 | self.ListView = BibleList() | 188 | self.ListView = BibleListView() |
277 | 205 | self.ListView.setAlternatingRowColors(True) | 189 | self.ListView.setAlternatingRowColors(True) |
278 | 206 | self.ListView.setSelectionMode(QtGui.QAbstractItemView.ExtendedSelection) | 190 | self.ListView.setSelectionMode(QtGui.QAbstractItemView.ExtendedSelection) |
279 | 207 | self.ListView.setDragEnabled(True) | 191 | self.ListView.setDragEnabled(True) |
280 | 208 | 192 | ||
281 | === modified file 'openlp/plugins/custom/customplugin.py' | |||
282 | --- openlp/plugins/custom/customplugin.py 2009-08-12 04:57:24 +0000 | |||
283 | +++ openlp/plugins/custom/customplugin.py 2009-08-15 07:33:01 +0000 | |||
284 | @@ -57,5 +57,5 @@ | |||
285 | 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)) |
286 | 58 | if event.event_type == EventType.ThemeListChanged: | 58 | if event.event_type == EventType.ThemeListChanged: |
287 | 59 | log.debug(u'New Theme request received') | 59 | log.debug(u'New Theme request received') |
289 | 60 | self.edit_custom_form.loadThemes(self.theme_manager.getThemes()) | 60 | self.edit_custom_form.loadThemes(event.payload) |
290 | 61 | return Plugin.handle_event(self, event) | 61 | return Plugin.handle_event(self, event) |
291 | 62 | 62 | ||
292 | === modified file 'openlp/plugins/custom/lib/mediaitem.py' | |||
293 | --- openlp/plugins/custom/lib/mediaitem.py 2009-07-04 05:52:30 +0000 | |||
294 | +++ openlp/plugins/custom/lib/mediaitem.py 2009-08-15 11:02:24 +0000 | |||
295 | @@ -21,28 +21,12 @@ | |||
296 | 21 | 21 | ||
297 | 22 | from PyQt4 import QtCore, QtGui | 22 | from PyQt4 import QtCore, QtGui |
298 | 23 | 23 | ||
321 | 24 | from openlp.core.lib import MediaManagerItem, SongXMLParser, ServiceItem, translate, contextMenuAction, contextMenuSeparator | 24 | from openlp.core.lib import MediaManagerItem, SongXMLParser, ServiceItem, translate, contextMenuAction, contextMenuSeparator, BaseListWithDnD |
322 | 25 | 25 | ||
323 | 26 | class CustomList(QtGui.QListWidget): | 26 | class CustomListView(BaseListWithDnD): |
324 | 27 | 27 | def __init__(self, parent=None): | |
325 | 28 | def __init__(self,parent=None,name=None): | 28 | self.PluginName = u'Custom' |
326 | 29 | QtGui.QListView.__init__(self,parent) | 29 | BaseListWithDnD.__init__(self, parent) |
305 | 30 | |||
306 | 31 | def mouseMoveEvent(self, event): | ||
307 | 32 | """ | ||
308 | 33 | Drag and drop event does not care what data is selected | ||
309 | 34 | as the recepient will use events to request the data move | ||
310 | 35 | just tell it what plugin to call | ||
311 | 36 | """ | ||
312 | 37 | if event.buttons() != QtCore.Qt.LeftButton: | ||
313 | 38 | return | ||
314 | 39 | drag = QtGui.QDrag(self) | ||
315 | 40 | mimeData = QtCore.QMimeData() | ||
316 | 41 | drag.setMimeData(mimeData) | ||
317 | 42 | mimeData.setText(u'Custom') | ||
318 | 43 | dropAction = drag.start(QtCore.Qt.CopyAction) | ||
319 | 44 | if dropAction == QtCore.Qt.CopyAction: | ||
320 | 45 | self.close() | ||
327 | 46 | 30 | ||
328 | 47 | class CustomMediaItem(MediaManagerItem): | 31 | class CustomMediaItem(MediaManagerItem): |
329 | 48 | """ | 32 | """ |
330 | @@ -95,7 +79,7 @@ | |||
331 | 95 | translate(u'CustomMediaItem',u'Add Custom To Service'), | 79 | translate(u'CustomMediaItem',u'Add Custom To Service'), |
332 | 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'), |
333 | 97 | u':/system/system_add.png', self.onCustomAddClick, u'CustomAddItem') | 81 | u':/system/system_add.png', self.onCustomAddClick, u'CustomAddItem') |
335 | 98 | # Add the Customlist widget | 82 | # Add the CustomListView widget |
336 | 99 | self.CustomWidget = QtGui.QWidget(self) | 83 | self.CustomWidget = QtGui.QWidget(self) |
337 | 100 | sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) | 84 | sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) |
338 | 101 | sizePolicy.setHorizontalStretch(0) | 85 | sizePolicy.setHorizontalStretch(0) |
339 | @@ -105,7 +89,7 @@ | |||
340 | 105 | self.CustomWidget.setObjectName(u'CustomWidget') | 89 | self.CustomWidget.setObjectName(u'CustomWidget') |
341 | 106 | # Add the Custom widget to the page layout | 90 | # Add the Custom widget to the page layout |
342 | 107 | self.PageLayout.addWidget(self.CustomWidget) | 91 | self.PageLayout.addWidget(self.CustomWidget) |
344 | 108 | self.ListView = CustomList() | 92 | self.ListView = CustomListView() |
345 | 109 | self.ListView.setAlternatingRowColors(True) | 93 | self.ListView.setAlternatingRowColors(True) |
346 | 110 | self.ListView.setDragEnabled(True) | 94 | self.ListView.setDragEnabled(True) |
347 | 111 | self.PageLayout.addWidget(self.ListView) | 95 | self.PageLayout.addWidget(self.ListView) |
348 | @@ -129,9 +113,9 @@ | |||
349 | 129 | translate(u'CustomMediaItem',u'&Add to Service'), self.onCustomAddClick)) | 113 | translate(u'CustomMediaItem',u'&Add to Service'), self.onCustomAddClick)) |
350 | 130 | 114 | ||
351 | 131 | def initialise(self): | 115 | def initialise(self): |
353 | 132 | self.loadCustomList(self.parent.custommanager.get_all_slides()) | 116 | self.loadCustomListView(self.parent.custommanager.get_all_slides()) |
354 | 133 | 117 | ||
356 | 134 | def loadCustomList(self, list): | 118 | def loadCustomListView(self, list): |
357 | 135 | self.ListView.clear() | 119 | self.ListView.clear() |
358 | 136 | for CustomSlide in list: | 120 | for CustomSlide in list: |
359 | 137 | custom_name = QtGui.QListWidgetItem(CustomSlide.title) | 121 | custom_name = QtGui.QListWidgetItem(CustomSlide.title) |
360 | 138 | 122 | ||
361 | === modified file 'openlp/plugins/media/lib/mediaitem.py' | |||
362 | --- openlp/plugins/media/lib/mediaitem.py 2009-07-04 05:52:30 +0000 | |||
363 | +++ openlp/plugins/media/lib/mediaitem.py 2009-08-15 11:02:24 +0000 | |||
364 | @@ -32,7 +32,6 @@ | |||
365 | 32 | 32 | ||
366 | 33 | from openlp.plugins.media.lib import MediaTab | 33 | from openlp.plugins.media.lib import MediaTab |
367 | 34 | from openlp.plugins.media.lib import FileListData | 34 | from openlp.plugins.media.lib import FileListData |
368 | 35 | # from listwithpreviews import ListWithPreviews | ||
369 | 36 | from openlp.core.lib import MediaManagerItem, ServiceItem, translate, BaseListWithDnD, buildIcon | 35 | from openlp.core.lib import MediaManagerItem, ServiceItem, translate, BaseListWithDnD, buildIcon |
370 | 37 | 36 | ||
371 | 38 | class MediaListView(BaseListWithDnD): | 37 | class MediaListView(BaseListWithDnD): |
372 | 39 | 38 | ||
373 | === modified file 'openlp/plugins/presentations/lib/presentationtab.py' | |||
374 | --- openlp/plugins/presentations/lib/presentationtab.py 2009-08-14 19:12:14 +0000 | |||
375 | +++ openlp/plugins/presentations/lib/presentationtab.py 2009-08-15 19:10:59 +0000 | |||
376 | @@ -93,4 +93,3 @@ | |||
377 | 93 | def save(self): | 93 | def save(self): |
378 | 94 | self.config.set_config(u'Powerpoint', unicode(self.PowerpointCheckBox.checkState())) | 94 | self.config.set_config(u'Powerpoint', unicode(self.PowerpointCheckBox.checkState())) |
379 | 95 | self.config.set_config(u'Impress', unicode(self.ImpressCheckBox.checkState())) | 95 | self.config.set_config(u'Impress', unicode(self.ImpressCheckBox.checkState())) |
380 | 96 | print self.PowerpointCheckBox.checkState(), unicode(self.PowerpointCheckBox.checkState()) | ||
381 | 97 | 96 | ||
382 | === modified file 'openlp/plugins/presentations/presentationplugin.py' | |||
383 | --- openlp/plugins/presentations/presentationplugin.py 2009-08-14 19:12:14 +0000 | |||
384 | +++ openlp/plugins/presentations/presentationplugin.py 2009-08-15 19:10:59 +0000 | |||
385 | @@ -67,12 +67,12 @@ | |||
386 | 67 | """ | 67 | """ |
387 | 68 | log.debug('check_pre_conditions') | 68 | log.debug('check_pre_conditions') |
388 | 69 | 69 | ||
390 | 70 | if int(self.config.get_config(u'Powerpoint', 0)) == 2: | 70 | if int(self.config.get_config(u'Impress', 0)) == 2: |
391 | 71 | try: | 71 | try: |
392 | 72 | #Check to see if we have uno installed | 72 | #Check to see if we have uno installed |
393 | 73 | import uno | 73 | import uno |
396 | 74 | #openoffice = impressController() | 74 | openoffice = impressController() |
397 | 75 | self.registerControllers(u'Impress', None) | 75 | self.registerControllers(u'Impress', openoffice) |
398 | 76 | except: | 76 | except: |
399 | 77 | pass | 77 | pass |
400 | 78 | #If we have no controllers disable plugin | 78 | #If we have no controllers disable plugin |
401 | @@ -80,3 +80,10 @@ | |||
402 | 80 | return True | 80 | return True |
403 | 81 | else: | 81 | else: |
404 | 82 | return False | 82 | return False |
405 | 83 | |||
406 | 84 | def finalise(self): | ||
407 | 85 | log.debug(u'Finalise') | ||
408 | 86 | print self.controllers | ||
409 | 87 | for controller in self.controllers: | ||
410 | 88 | print controller | ||
411 | 89 | self.controllers[controller].kill() | ||
412 | 83 | 90 | ||
413 | === modified file 'openlp/plugins/remotes/remoteplugin.py' | |||
414 | --- openlp/plugins/remotes/remoteplugin.py 2009-08-14 17:41:29 +0000 | |||
415 | +++ openlp/plugins/remotes/remoteplugin.py 2009-08-15 07:33:01 +0000 | |||
416 | @@ -56,9 +56,9 @@ | |||
417 | 56 | log.info(u'Sending event %s ', datagram) | 56 | log.info(u'Sending event %s ', datagram) |
418 | 57 | pos = datagram.find(u':') | 57 | pos = datagram.find(u':') |
419 | 58 | event = unicode(datagram[:pos].lower()) | 58 | event = unicode(datagram[:pos].lower()) |
421 | 59 | payload = unicode(datagram[pos + 1:]) | 59 | |
422 | 60 | if event == u'alert': | 60 | if event == u'alert': |
424 | 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:]))) |
425 | 62 | 62 | ||
426 | 63 | 63 | ||
427 | 64 | 64 | ||
428 | 65 | 65 | ||
429 | === modified file 'openlp/plugins/songs/forms/editsongform.py' | |||
430 | --- openlp/plugins/songs/forms/editsongform.py 2009-08-14 16:12:40 +0000 | |||
431 | +++ openlp/plugins/songs/forms/editsongform.py 2009-08-15 19:19:34 +0000 | |||
432 | @@ -23,7 +23,7 @@ | |||
433 | 23 | from PyQt4 import Qt, QtCore, QtGui | 23 | from PyQt4 import Qt, QtCore, QtGui |
434 | 24 | 24 | ||
435 | 25 | from openlp.core.lib import SongXMLBuilder, SongXMLParser, Event, \ | 25 | from openlp.core.lib import SongXMLBuilder, SongXMLParser, Event, \ |
437 | 26 | EventType, EventManager | 26 | EventType, EventManager, translate |
438 | 27 | from openlp.plugins.songs.forms import EditVerseForm | 27 | from openlp.plugins.songs.forms import EditVerseForm |
439 | 28 | from openlp.plugins.songs.lib.models import Song | 28 | from openlp.plugins.songs.lib.models import Song |
440 | 29 | from editsongdialog import Ui_EditSongDialog | 29 | from editsongdialog import Ui_EditSongDialog |
441 | @@ -299,22 +299,26 @@ | |||
442 | 299 | log.debug(u'Validate Song') | 299 | log.debug(u'Validate Song') |
443 | 300 | # Lets be nice and assume the data is correct. | 300 | # Lets be nice and assume the data is correct. |
444 | 301 | valid = True | 301 | valid = True |
445 | 302 | message = u'' | ||
446 | 302 | if len(self.TitleEditItem.displayText()) == 0: | 303 | if len(self.TitleEditItem.displayText()) == 0: |
447 | 303 | valid = False | 304 | valid = False |
448 | 304 | self.TitleEditItem.setStyleSheet(u'background-color: red; color: white') | 305 | self.TitleEditItem.setStyleSheet(u'background-color: red; color: white') |
449 | 306 | message = translate(u'SongFormDialog', u'You need to enter a song title \n') | ||
450 | 305 | else: | 307 | else: |
451 | 306 | self.TitleEditItem.setStyleSheet(u'') | 308 | self.TitleEditItem.setStyleSheet(u'') |
452 | 307 | if self.VerseListWidget.count() == 0: | 309 | if self.VerseListWidget.count() == 0: |
453 | 308 | valid = False | 310 | valid = False |
454 | 309 | self.VerseListWidget.setStyleSheet(u'background-color: red; color: white') | 311 | self.VerseListWidget.setStyleSheet(u'background-color: red; color: white') |
455 | 312 | message = message + translate(u'SongFormDialog', u'You need to enter some verse text \n') | ||
456 | 310 | else: | 313 | else: |
457 | 311 | self.VerseListWidget.setStyleSheet(u'') | 314 | self.VerseListWidget.setStyleSheet(u'') |
458 | 312 | if self.AuthorsListView.count() == 0: | 315 | if self.AuthorsListView.count() == 0: |
459 | 313 | valid = False | 316 | valid = False |
460 | 314 | self.AuthorsListView.setStyleSheet(u'background-color: red; color: white') | 317 | self.AuthorsListView.setStyleSheet(u'background-color: red; color: white') |
461 | 318 | message = message + translate(u'SongFormDialog', u'You need to provide an author') | ||
462 | 315 | else: | 319 | else: |
463 | 316 | self.AuthorsListView.setStyleSheet(u'') | 320 | self.AuthorsListView.setStyleSheet(u'') |
465 | 317 | return valid | 321 | return valid, message |
466 | 318 | 322 | ||
467 | 319 | def on_TitleEditItem_lostFocus(self): | 323 | def on_TitleEditItem_lostFocus(self): |
468 | 320 | self.song.title = self.TitleEditItem.text() | 324 | self.song.title = self.TitleEditItem.text() |
469 | @@ -345,7 +349,11 @@ | |||
470 | 345 | 349 | ||
471 | 346 | def accept(self): | 350 | def accept(self): |
472 | 347 | log.debug(u'accept') | 351 | log.debug(u'accept') |
474 | 348 | if not self._validate_song(): | 352 | valid , message = self._validate_song() |
475 | 353 | if not valid: | ||
476 | 354 | QtGui.QMessageBox.critical(self, | ||
477 | 355 | translate(u'SongFormDialog', u'Error'), message, | ||
478 | 356 | QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok)) | ||
479 | 349 | return | 357 | return |
480 | 350 | self.song.title = unicode(self.TitleEditItem.displayText()) | 358 | self.song.title = unicode(self.TitleEditItem.displayText()) |
481 | 351 | self.song.copyright = unicode(self.CopyrightEditItem.displayText()) | 359 | self.song.copyright = unicode(self.CopyrightEditItem.displayText()) |
482 | @@ -356,7 +364,7 @@ | |||
483 | 356 | self.processTitle() | 364 | self.processTitle() |
484 | 357 | self.songmanager.save_song(self.song) | 365 | self.songmanager.save_song(self.song) |
485 | 358 | if self.title_change: | 366 | if self.title_change: |
487 | 359 | self.eventmanager.post_event(Event(EventType.LoadSongList, u'EditSongForm')) | 367 | self.eventmanager.post_event(Event(u'EditSongForm', EventType.LoadSongList)) |
488 | 360 | self.close() | 368 | self.close() |
489 | 361 | 369 | ||
490 | 362 | def processLyrics(self): | 370 | def processLyrics(self): |
491 | 363 | 371 | ||
492 | === modified file 'openlp/plugins/songs/lib/mediaitem.py' | |||
493 | --- openlp/plugins/songs/lib/mediaitem.py 2009-08-06 13:17:36 +0000 | |||
494 | +++ openlp/plugins/songs/lib/mediaitem.py 2009-08-15 11:02:24 +0000 | |||
495 | @@ -22,29 +22,13 @@ | |||
496 | 22 | from PyQt4 import QtCore, QtGui | 22 | from PyQt4 import QtCore, QtGui |
497 | 23 | 23 | ||
498 | 24 | from openlp.core.lib import MediaManagerItem, translate, ServiceItem, \ | 24 | from openlp.core.lib import MediaManagerItem, translate, ServiceItem, \ |
500 | 25 | SongXMLParser, contextMenuAction, contextMenuSeparator | 25 | SongXMLParser, contextMenuAction, contextMenuSeparator, BaseListWithDnD |
501 | 26 | from openlp.plugins.songs.forms import EditSongForm, SongMaintenanceForm | 26 | from openlp.plugins.songs.forms import EditSongForm, SongMaintenanceForm |
502 | 27 | 27 | ||
523 | 28 | class SongList(QtGui.QListWidget): | 28 | class SongListView(BaseListWithDnD): |
524 | 29 | 29 | def __init__(self, parent=None): | |
525 | 30 | def __init__(self, parent=None, name=None): | 30 | self.PluginName = u'Song' |
526 | 31 | QtGui.QListWidget.__init__(self,parent) | 31 | BaseListWithDnD.__init__(self, parent) |
507 | 32 | |||
508 | 33 | def mouseMoveEvent(self, event): | ||
509 | 34 | """ | ||
510 | 35 | Drag and drop event does not care what data is selected | ||
511 | 36 | as the recepient will use events to request the data move | ||
512 | 37 | just tell it what plugin to call | ||
513 | 38 | """ | ||
514 | 39 | if event.buttons() != QtCore.Qt.LeftButton: | ||
515 | 40 | return | ||
516 | 41 | drag = QtGui.QDrag(self) | ||
517 | 42 | mimeData = QtCore.QMimeData() | ||
518 | 43 | drag.setMimeData(mimeData) | ||
519 | 44 | mimeData.setText(u'Song') | ||
520 | 45 | dropAction = drag.start(QtCore.Qt.CopyAction) | ||
521 | 46 | if dropAction == QtCore.Qt.CopyAction: | ||
522 | 47 | self.close() | ||
527 | 48 | 32 | ||
528 | 49 | class SongMediaItem(MediaManagerItem): | 33 | class SongMediaItem(MediaManagerItem): |
529 | 50 | """ | 34 | """ |
530 | @@ -97,7 +81,7 @@ | |||
531 | 97 | self.addToolbarButton(translate(u'SongMediaItem', u'Song Maintenance'), | 81 | self.addToolbarButton(translate(u'SongMediaItem', u'Song Maintenance'), |
532 | 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'), |
533 | 99 | ':/songs/song_maintenance.png', self.onSongMaintenanceClick, 'SongMaintenanceItem') | 83 | ':/songs/song_maintenance.png', self.onSongMaintenanceClick, 'SongMaintenanceItem') |
535 | 100 | ## Add the songlist widget ## | 84 | ## Add the SongListView widget ## |
536 | 101 | # Create the tab widget | 85 | # Create the tab widget |
537 | 102 | self.SongWidget = QtGui.QWidget(self) | 86 | self.SongWidget = QtGui.QWidget(self) |
538 | 103 | sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) | 87 | sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) |
539 | @@ -128,7 +112,7 @@ | |||
540 | 128 | self.SearchLayout.addWidget(self.SearchTextButton, 3, 2, 1, 1) | 112 | self.SearchLayout.addWidget(self.SearchTextButton, 3, 2, 1, 1) |
541 | 129 | # Add the song widget to the page layout | 113 | # Add the song widget to the page layout |
542 | 130 | self.PageLayout.addWidget(self.SongWidget) | 114 | self.PageLayout.addWidget(self.SongWidget) |
544 | 131 | self.ListView = SongList() | 115 | self.ListView = SongListView() |
545 | 132 | self.ListView.setAlternatingRowColors(True) | 116 | self.ListView.setAlternatingRowColors(True) |
546 | 133 | self.ListView.setDragEnabled(True) | 117 | self.ListView.setDragEnabled(True) |
547 | 134 | self.ListView.setObjectName(u'ListView') | 118 | self.ListView.setObjectName(u'ListView') |
548 | 135 | 119 | ||
549 | === modified file 'openlp/plugins/songs/songsplugin.py' | |||
550 | --- openlp/plugins/songs/songsplugin.py 2009-08-12 04:57:24 +0000 | |||
551 | +++ openlp/plugins/songs/songsplugin.py 2009-08-15 07:33:01 +0000 | |||
552 | @@ -136,7 +136,7 @@ | |||
553 | 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) |
554 | 137 | if event.event_type == EventType.ThemeListChanged: | 137 | if event.event_type == EventType.ThemeListChanged: |
555 | 138 | log.debug(u'New Theme request received') | 138 | log.debug(u'New Theme request received') |
557 | 139 | self.media_item.edit_song_form.loadThemes(self.theme_manager.getThemes()) | 139 | self.media_item.edit_song_form.loadThemes(event.payload) |
558 | 140 | if event.event_type == EventType.LoadSongList : | 140 | if event.event_type == EventType.LoadSongList : |
559 | 141 | log.debug(u'Load Load Song List Item received') | 141 | log.debug(u'Load Load Song List Item received') |
560 | 142 | self.media_item.displayResultsSong(self.songmanager.get_songs()) | 142 | self.media_item.displayResultsSong(self.songmanager.get_songs()) |
Changes which have been stacked up for the last week and are still valid.