Status: | Merged |
---|---|
Merged at revision: | not available |
Proposed branch: | lp:~trb143/openlp/servicing |
Merge into: | lp:openlp |
Diff against target: | None lines |
To merge this branch: | bzr merge lp:~trb143/openlp/servicing |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Tim Bentley | Approve | ||
Raoul Snyman | Approve | ||
Review via email:
|
Commit message
Description of the change
To post a comment you must log in.
Revision history for this message
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Tim Bentley (trb143) wrote : | # |
Revision history for this message
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Raoul Snyman (raoul-snyman) wrote : | # |
A BFA.
(Big Fat Approve)
review:
Approve
Revision history for this message
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
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.pyw' | |||
2 | --- openlp.pyw 2009-05-11 05:09:43 +0000 | |||
3 | +++ openlp.pyw 2009-05-20 20:17:20 +0000 | |||
4 | @@ -4,7 +4,7 @@ | |||
5 | 4 | """ | 4 | """ |
6 | 5 | OpenLP - Open Source Lyrics Projection | 5 | OpenLP - Open Source Lyrics Projection |
7 | 6 | Copyright (c) 2008 Raoul Snyman | 6 | Copyright (c) 2008 Raoul Snyman |
9 | 7 | Portions copyright (c) 2008 Martin Thompson, Tim Bentley, | 7 | Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley, |
10 | 8 | 8 | ||
11 | 9 | This program is free software; you can redistribute it and/or modify it under | 9 | This program is free software; you can redistribute it and/or modify it under |
12 | 10 | the terms of the GNU General Public License as published by the Free Software | 10 | the terms of the GNU General Public License as published by the Free Software |
13 | @@ -26,17 +26,15 @@ | |||
14 | 26 | from openlp.core.lib import Receiver | 26 | from openlp.core.lib import Receiver |
15 | 27 | 27 | ||
16 | 28 | logging.basicConfig(level=logging.DEBUG, | 28 | logging.basicConfig(level=logging.DEBUG, |
21 | 29 | format=u'%(asctime)s %(msecs)d %(name)-12s %(levelname)-8s %(message)s', | 29 | format=u'%(asctime)s %(msecs)d %(name)-12s %(levelname)-8s %(message)s', |
22 | 30 | datefmt=u'%m-%d %H:%M:%S', | 30 | datefmt=u'%m-%d %H:%M:%S', filename=u'openlp.log', filemode=u'w') |
19 | 31 | filename=u'openlp.log', | ||
20 | 32 | filemode=u'w') | ||
23 | 33 | 31 | ||
24 | 34 | from openlp.core.resources import * | 32 | from openlp.core.resources import * |
25 | 35 | from openlp.core.ui import MainWindow, SplashScreen | 33 | from openlp.core.ui import MainWindow, SplashScreen |
26 | 36 | 34 | ||
27 | 37 | class OpenLP(QtGui.QApplication): | 35 | class OpenLP(QtGui.QApplication): |
28 | 38 | global log | 36 | global log |
30 | 39 | log=logging.getLogger(u'OpenLP Application') | 37 | log = logging.getLogger(u'OpenLP Application') |
31 | 40 | log.info(u'Application Loaded') | 38 | log.info(u'Application Loaded') |
32 | 41 | 39 | ||
33 | 42 | def run(self): | 40 | def run(self): |
34 | @@ -56,15 +54,16 @@ | |||
35 | 56 | screens.append({u'number': screen, | 54 | screens.append({u'number': screen, |
36 | 57 | u'size': self.desktop().availableGeometry(screen), | 55 | u'size': self.desktop().availableGeometry(screen), |
37 | 58 | u'primary': (self.desktop().primaryScreen() == screen)}) | 56 | u'primary': (self.desktop().primaryScreen() == screen)}) |
39 | 59 | log.info(u'Screen %d found with resolution %s', screen, self.desktop().availableGeometry(screen)) | 57 | log.info(u'Screen %d found with resolution %s', |
40 | 58 | screen, self.desktop().availableGeometry(screen)) | ||
41 | 60 | # start the main app window | 59 | # start the main app window |
44 | 61 | self.main_window = MainWindow(screens) | 60 | self.mainWindow = MainWindow(screens) |
45 | 62 | self.main_window.show() | 61 | self.mainWindow.show() |
46 | 63 | # now kill the splashscreen | 62 | # now kill the splashscreen |
48 | 64 | self.splash.finish(self.main_window.main_window) | 63 | self.splash.finish(self.mainWindow.mainWindow) |
49 | 65 | sys.exit(app.exec_()) | 64 | sys.exit(app.exec_()) |
50 | 66 | 65 | ||
52 | 67 | if __name__ == '__main__': | 66 | if __name__ == u'__main__': |
53 | 68 | app = OpenLP(sys.argv) | 67 | app = OpenLP(sys.argv) |
54 | 69 | app.run() | 68 | app.run() |
55 | 70 | 69 | ||
56 | 71 | 70 | ||
57 | === modified file 'openlp/__init__.py' | |||
58 | --- openlp/__init__.py 2009-05-13 19:47:25 +0000 | |||
59 | +++ openlp/__init__.py 2009-05-21 05:15:51 +0000 | |||
60 | @@ -1,7 +1,7 @@ | |||
61 | 1 | """ | 1 | """ |
62 | 2 | OpenLP - Open Source Lyrics Projection | 2 | OpenLP - Open Source Lyrics Projection |
63 | 3 | Copyright (c) 2008 Raoul Snyman | 3 | Copyright (c) 2008 Raoul Snyman |
65 | 4 | Portions copyright (c) 2008 Martin Thompson, Tim Bentley | 4 | Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley |
66 | 5 | 5 | ||
67 | 6 | This program is free software; you can redistribute it and/or modify it under | 6 | This program is free software; you can redistribute it and/or modify it under |
68 | 7 | the terms of the GNU General Public License as published by the Free Software | 7 | the terms of the GNU General Public License as published by the Free Software |
69 | @@ -15,24 +15,3 @@ | |||
70 | 15 | this program; if not, write to the Free Software Foundation, Inc., 59 Temple | 15 | this program; if not, write to the Free Software Foundation, Inc., 59 Temple |
71 | 16 | Place, Suite 330, Boston, MA 02111-1307 USA | 16 | Place, Suite 330, Boston, MA 02111-1307 USA |
72 | 17 | """ | 17 | """ |
73 | 18 | import types | ||
74 | 19 | from PyQt4 import QtCore, QtGui | ||
75 | 20 | |||
76 | 21 | __all__ = ['convertStringToBoolean','buildIcon',] | ||
77 | 22 | |||
78 | 23 | def convertStringToBoolean(stringvalue): | ||
79 | 24 | return stringvalue.strip().lower() in (u'true', u'yes', u'y') | ||
80 | 25 | |||
81 | 26 | def buildIcon(icon): | ||
82 | 27 | ButtonIcon = None | ||
83 | 28 | if type(icon) is QtGui.QIcon: | ||
84 | 29 | ButtonIcon = icon | ||
85 | 30 | elif type(icon) is types.StringType or type(icon) is types.UnicodeType: | ||
86 | 31 | ButtonIcon = QtGui.QIcon() | ||
87 | 32 | if icon.startswith(u':/'): | ||
88 | 33 | ButtonIcon.addPixmap(QtGui.QPixmap(icon), QtGui.QIcon.Normal, | ||
89 | 34 | QtGui.QIcon.Off) | ||
90 | 35 | else: | ||
91 | 36 | ButtonIcon.addPixmap(QtGui.QPixmap.fromImage(QImage(icon)), | ||
92 | 37 | QtGui.QIcon.Normal, QtGui.QIcon.Off) | ||
93 | 38 | return ButtonIcon | ||
94 | 39 | 18 | ||
95 | === modified file 'openlp/core/__init__.py' | |||
96 | --- openlp/core/__init__.py 2009-04-20 18:22:42 +0000 | |||
97 | +++ openlp/core/__init__.py 2009-05-21 05:15:51 +0000 | |||
98 | @@ -17,16 +17,8 @@ | |||
99 | 17 | this program; if not, write to the Free Software Foundation, Inc., 59 Temple | 17 | this program; if not, write to the Free Software Foundation, Inc., 59 Temple |
100 | 18 | Place, Suite 330, Boston, MA 02111-1307 USA | 18 | Place, Suite 330, Boston, MA 02111-1307 USA |
101 | 19 | """ | 19 | """ |
102 | 20 | from PyQt4 import QtCore, QtGui | ||
103 | 21 | |||
104 | 22 | from settingsmanager import SettingsManager | 20 | from settingsmanager import SettingsManager |
105 | 23 | from openlp.core.lib.pluginmanager import PluginManager | 21 | from openlp.core.lib.pluginmanager import PluginManager |
106 | 24 | 22 | ||
115 | 25 | __all__ = ['SettingsManager', 'PluginManager', 'translate', | 23 | __all__ = ['SettingsManager', 'PluginManager' ] |
116 | 26 | 'fileToXML' ] | 24 | |
109 | 27 | |||
110 | 28 | def translate(context, text): | ||
111 | 29 | return QtGui.QApplication.translate(context, text, None, QtGui.QApplication.UnicodeUTF8) | ||
112 | 30 | |||
113 | 31 | def fileToXML(xmlfile): | ||
114 | 32 | return open(xmlfile).read() | ||
117 | 33 | 25 | ||
118 | === modified file 'openlp/core/lib/__init__.py' | |||
119 | --- openlp/core/lib/__init__.py 2009-04-22 19:46:10 +0000 | |||
120 | +++ openlp/core/lib/__init__.py 2009-05-22 18:30:25 +0000 | |||
121 | @@ -17,6 +17,46 @@ | |||
122 | 17 | this program; if not, write to the Free Software Foundation, Inc., 59 Temple | 17 | this program; if not, write to the Free Software Foundation, Inc., 59 Temple |
123 | 18 | Place, Suite 330, Boston, MA 02111-1307 USA | 18 | Place, Suite 330, Boston, MA 02111-1307 USA |
124 | 19 | """ | 19 | """ |
125 | 20 | import types | ||
126 | 21 | from PyQt4 import QtCore, QtGui | ||
127 | 22 | |||
128 | 23 | def translate(context, text): | ||
129 | 24 | return QtGui.QApplication.translate(context, text, None, QtGui.QApplication.UnicodeUTF8) | ||
130 | 25 | |||
131 | 26 | def file_to_xml(xmlfile): | ||
132 | 27 | return open(xmlfile).read() | ||
133 | 28 | |||
134 | 29 | def str_to_bool(stringvalue): | ||
135 | 30 | return stringvalue.strip().lower() in (u'true', u'yes', u'y') | ||
136 | 31 | |||
137 | 32 | def buildIcon(icon): | ||
138 | 33 | ButtonIcon = None | ||
139 | 34 | if type(icon) is QtGui.QIcon: | ||
140 | 35 | ButtonIcon = icon | ||
141 | 36 | elif type(icon) is types.StringType or type(icon) is types.UnicodeType: | ||
142 | 37 | ButtonIcon = QtGui.QIcon() | ||
143 | 38 | if icon.startswith(u':/'): | ||
144 | 39 | ButtonIcon.addPixmap(QtGui.QPixmap(icon), QtGui.QIcon.Normal, | ||
145 | 40 | QtGui.QIcon.Off) | ||
146 | 41 | else: | ||
147 | 42 | ButtonIcon.addPixmap(QtGui.QPixmap.fromImage(QImage(icon)), | ||
148 | 43 | QtGui.QIcon.Normal, QtGui.QIcon.Off) | ||
149 | 44 | return ButtonIcon | ||
150 | 45 | |||
151 | 46 | def contextMenuAction(base, icon, text, slot): | ||
152 | 47 | """ | ||
153 | 48 | Utility method to help build context menus for plugins | ||
154 | 49 | """ | ||
155 | 50 | action = QtGui.QAction(text, base) | ||
156 | 51 | action .setIcon(buildIcon(icon)) | ||
157 | 52 | QtCore.QObject.connect(action, QtCore.SIGNAL("triggered()"), slot) | ||
158 | 53 | return action | ||
159 | 54 | |||
160 | 55 | def contextMenuSeparator(base): | ||
161 | 56 | action = QtGui.QAction("", base) | ||
162 | 57 | action.setSeparator(True) | ||
163 | 58 | return action | ||
164 | 59 | |||
165 | 20 | from pluginconfig import PluginConfig | 60 | from pluginconfig import PluginConfig |
166 | 21 | from plugin import Plugin | 61 | from plugin import Plugin |
167 | 22 | from settingstab import SettingsTab | 62 | from settingstab import SettingsTab |
168 | @@ -35,6 +75,11 @@ | |||
169 | 35 | from renderer import Renderer | 75 | from renderer import Renderer |
170 | 36 | from rendermanager import RenderManager | 76 | from rendermanager import RenderManager |
171 | 37 | 77 | ||
175 | 38 | __all__ = ['Renderer','PluginConfig', 'Plugin', 'SettingsTab', 'MediaManagerItem', 'Event', 'EventType' | 78 | #__all__ = ['Renderer','PluginConfig', 'Plugin', 'SettingsTab', 'MediaManagerItem', 'Event', 'EventType' |
176 | 39 | 'XmlRootClass', 'ServiceItem', 'Receiver', 'OpenLPToolbar', 'SongXMLBuilder', | 79 | # 'XmlRootClass', 'ServiceItem', 'Receiver', 'OpenLPToolbar', 'SongXMLBuilder', |
177 | 40 | 'SongXMLParser', 'EventManager', 'ThemeXML', 'RenderManager'] | 80 | # 'SongXMLParser', 'EventManager', 'ThemeXML', 'RenderManager'] |
178 | 81 | |||
179 | 82 | __all__ = [ 'translate', 'file_to_xml', 'str_to_bool', 'contextMenuAction', 'contextMenuSeparator'] | ||
180 | 83 | |||
181 | 84 | |||
182 | 85 | |||
183 | 41 | 86 | ||
184 | === modified file 'openlp/core/lib/event.py' | |||
185 | --- openlp/core/lib/event.py 2009-05-16 16:38:03 +0000 | |||
186 | +++ openlp/core/lib/event.py 2009-05-20 20:17:20 +0000 | |||
187 | @@ -44,6 +44,7 @@ | |||
188 | 44 | #PreviewBeforeShow = 13 | 44 | #PreviewBeforeShow = 13 |
189 | 45 | #PreviewAfterShow = 14 | 45 | #PreviewAfterShow = 14 |
190 | 46 | 46 | ||
191 | 47 | #Theme Related Events | ||
192 | 47 | ThemeListChanged = 15 | 48 | ThemeListChanged = 15 |
193 | 48 | 49 | ||
194 | 49 | 50 | ||
195 | 50 | 51 | ||
196 | === modified file 'openlp/core/lib/eventmanager.py' | |||
197 | --- openlp/core/lib/eventmanager.py 2009-05-16 16:38:03 +0000 | |||
198 | +++ openlp/core/lib/eventmanager.py 2009-05-20 20:17:20 +0000 | |||
199 | @@ -29,10 +29,10 @@ | |||
200 | 29 | 29 | ||
201 | 30 | """ | 30 | """ |
202 | 31 | global log | 31 | global log |
204 | 32 | log=logging.getLogger(u'EventManager') | 32 | log = logging.getLogger(u'EventManager') |
205 | 33 | 33 | ||
206 | 34 | def __init__(self): | 34 | def __init__(self): |
208 | 35 | self.endpoints=[] | 35 | self.endpoints = [] |
209 | 36 | log.info(u'Initialising') | 36 | log.info(u'Initialising') |
210 | 37 | 37 | ||
211 | 38 | def register(self, plugin): | 38 | def register(self, plugin): |
212 | 39 | 39 | ||
213 | === modified file 'openlp/core/lib/eventreceiver.py' | |||
214 | --- openlp/core/lib/eventreceiver.py 2009-03-10 16:46:25 +0000 | |||
215 | +++ openlp/core/lib/eventreceiver.py 2009-05-20 20:17:20 +0000 | |||
216 | @@ -2,7 +2,7 @@ | |||
217 | 2 | """ | 2 | """ |
218 | 3 | OpenLP - Open Source Lyrics Projection | 3 | OpenLP - Open Source Lyrics Projection |
219 | 4 | Copyright (c) 2008 Raoul Snyman | 4 | Copyright (c) 2008 Raoul Snyman |
221 | 5 | Portions copyright (c) 2008 Martin Thompson, Tim Bentley, | 5 | Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley, |
222 | 6 | 6 | ||
223 | 7 | This program is free software; you can redistribute it and/or modify it under | 7 | This program is free software; you can redistribute it and/or modify it under |
224 | 8 | the terms of the GNU General Public License as published by the Free Software | 8 | the terms of the GNU General Public License as published by the Free Software |
225 | @@ -17,15 +17,15 @@ | |||
226 | 17 | Place, Suite 330, Boston, MA 02111-1307 USA | 17 | Place, Suite 330, Boston, MA 02111-1307 USA |
227 | 18 | """ | 18 | """ |
228 | 19 | 19 | ||
230 | 20 | from PyQt4.QtCore import * | 20 | from PyQt4 import QtCore |
231 | 21 | 21 | ||
233 | 22 | class EventReceiver(QObject): | 22 | class EventReceiver(QtCore.QObject): |
234 | 23 | """ | 23 | """ |
235 | 24 | Class to allow events to be passed from different parts of the system. | 24 | Class to allow events to be passed from different parts of the system. |
236 | 25 | This is a private class and should not be used directly but via the Receiver class | 25 | This is a private class and should not be used directly but via the Receiver class |
237 | 26 | """ | 26 | """ |
238 | 27 | def __init__(self): | 27 | def __init__(self): |
240 | 28 | QObject.__init__(self) | 28 | QtCore.QObject.__init__(self) |
241 | 29 | 29 | ||
242 | 30 | def send_message(self, event, msg=None): | 30 | def send_message(self, event, msg=None): |
243 | 31 | self.emit(SIGNAL(event), msg) | 31 | self.emit(SIGNAL(event), msg) |
244 | 32 | 32 | ||
245 | === modified file 'openlp/core/lib/mediamanageritem.py' | |||
246 | --- openlp/core/lib/mediamanageritem.py 2009-05-13 19:47:25 +0000 | |||
247 | +++ openlp/core/lib/mediamanageritem.py 2009-05-20 20:17:20 +0000 | |||
248 | @@ -64,7 +64,7 @@ | |||
249 | 64 | item. | 64 | item. |
250 | 65 | """ | 65 | """ |
251 | 66 | if self.Toolbar is None: | 66 | if self.Toolbar is None: |
253 | 67 | self.Toolbar=OpenLPToolbar(self) | 67 | self.Toolbar = OpenLPToolbar(self) |
254 | 68 | self.PageLayout.addWidget(self.Toolbar) | 68 | self.PageLayout.addWidget(self.Toolbar) |
255 | 69 | 69 | ||
256 | 70 | def addToolbarButton(self, title, tooltip, icon, slot=None, objectname=None): | 70 | def addToolbarButton(self, title, tooltip, icon, slot=None, objectname=None): |
257 | @@ -82,7 +82,7 @@ | |||
258 | 82 | self.Toolbar.addSeparator() | 82 | self.Toolbar.addSeparator() |
259 | 83 | 83 | ||
260 | 84 | def contextMenuSeparator(self, base): | 84 | def contextMenuSeparator(self, base): |
262 | 85 | action = QtGui.QAction("", base) | 85 | action = QtGui.QAction(u'', base) |
263 | 86 | action.setSeparator(True) | 86 | action.setSeparator(True) |
264 | 87 | return action | 87 | return action |
265 | 88 | 88 | ||
266 | @@ -94,7 +94,7 @@ | |||
267 | 94 | ButtonIcon = icon | 94 | ButtonIcon = icon |
268 | 95 | elif type(icon) is types.StringType: | 95 | elif type(icon) is types.StringType: |
269 | 96 | ButtonIcon = QtGui.QIcon() | 96 | ButtonIcon = QtGui.QIcon() |
271 | 97 | if icon.startswith(':/'): | 97 | if icon.startswith(u':/'): |
272 | 98 | ButtonIcon.addPixmap(QtGui.QPixmap(icon), QtGui.QIcon.Normal, | 98 | ButtonIcon.addPixmap(QtGui.QPixmap(icon), QtGui.QIcon.Normal, |
273 | 99 | QtGui.QIcon.Off) | 99 | QtGui.QIcon.Off) |
274 | 100 | else: | 100 | else: |
275 | @@ -103,6 +103,6 @@ | |||
276 | 103 | 103 | ||
277 | 104 | action = QtGui.QAction(text, base) | 104 | action = QtGui.QAction(text, base) |
278 | 105 | action .setIcon(ButtonIcon) | 105 | action .setIcon(ButtonIcon) |
280 | 106 | QtCore.QObject.connect(action, QtCore.SIGNAL("triggered()"), slot) | 106 | QtCore.QObject.connect(action, QtCore.SIGNAL(u'triggered()'), slot) |
281 | 107 | return action | 107 | return action |
282 | 108 | 108 | ||
283 | 109 | 109 | ||
284 | === modified file 'openlp/core/lib/plugin.py' | |||
285 | --- openlp/core/lib/plugin.py 2009-05-02 18:56:27 +0000 | |||
286 | +++ openlp/core/lib/plugin.py 2009-05-20 20:17:20 +0000 | |||
287 | @@ -80,7 +80,7 @@ | |||
288 | 80 | if name is not None: | 80 | if name is not None: |
289 | 81 | self.name = name | 81 | self.name = name |
290 | 82 | else: | 82 | else: |
292 | 83 | self.name = 'Plugin' | 83 | self.name = u'Plugin' |
293 | 84 | if version is not None: | 84 | if version is not None: |
294 | 85 | self.version = version | 85 | self.version = version |
295 | 86 | self.icon = None | 86 | self.icon = None |
296 | @@ -88,12 +88,12 @@ | |||
297 | 88 | self.weight = 0 | 88 | self.weight = 0 |
298 | 89 | # Set up logging | 89 | # Set up logging |
299 | 90 | self.log = logging.getLogger(self.name) | 90 | self.log = logging.getLogger(self.name) |
306 | 91 | self.preview_controller=plugin_helpers[u'preview'] | 91 | self.preview_controller = plugin_helpers[u'preview'] |
307 | 92 | self.live_controller=plugin_helpers[u'live'] | 92 | self.live_controller = plugin_helpers[u'live'] |
308 | 93 | self.theme_manager=plugin_helpers[u'theme'] | 93 | self.theme_manager = plugin_helpers[u'theme'] |
309 | 94 | self.event_manager=plugin_helpers[u'event'] | 94 | self.event_manager = plugin_helpers[u'event'] |
310 | 95 | self.render_manager=plugin_helpers[u'render'] | 95 | self.render_manager = plugin_helpers[u'render'] |
311 | 96 | self.service_manager=plugin_helpers[u'service'] | 96 | self.service_manager = plugin_helpers[u'service'] |
312 | 97 | 97 | ||
313 | 98 | def check_pre_conditions(self): | 98 | def check_pre_conditions(self): |
314 | 99 | """ | 99 | """ |
315 | 100 | 100 | ||
316 | === modified file 'openlp/core/lib/pluginconfig.py' | |||
317 | --- openlp/core/lib/pluginconfig.py 2009-03-15 19:31:33 +0000 | |||
318 | +++ openlp/core/lib/pluginconfig.py 2009-05-20 20:17:20 +0000 | |||
319 | @@ -37,12 +37,12 @@ | |||
320 | 37 | Get a configuration value from the configuration registry. | 37 | Get a configuration value from the configuration registry. |
321 | 38 | """ | 38 | """ |
322 | 39 | return ConfigHelper.get_config(self.section, key, default) | 39 | return ConfigHelper.get_config(self.section, key, default) |
324 | 40 | 40 | ||
325 | 41 | def delete_config(self, key): | 41 | def delete_config(self, key): |
326 | 42 | """ | 42 | """ |
327 | 43 | Delete a configuration value from the configuration registry. | 43 | Delete a configuration value from the configuration registry. |
328 | 44 | """ | 44 | """ |
330 | 45 | return ConfigHelper.delete_config(self.section, key) | 45 | return ConfigHelper.delete_config(self.section, key) |
331 | 46 | 46 | ||
332 | 47 | def set_config(self, key, value): | 47 | def set_config(self, key, value): |
333 | 48 | """ | 48 | """ |
334 | @@ -64,26 +64,28 @@ | |||
335 | 64 | 64 | ||
336 | 65 | def set_data_path(self, path): | 65 | def set_data_path(self, path): |
337 | 66 | return self.set_config(u'data path', os.path.basename(path)) | 66 | return self.set_config(u'data path', os.path.basename(path)) |
339 | 67 | 67 | ||
340 | 68 | def get_files(self, suffix=None): | 68 | def get_files(self, suffix=None): |
341 | 69 | returnfiles = [] | ||
342 | 70 | #suffix = self.get_config("suffix name", default_suffixes) | 69 | #suffix = self.get_config("suffix name", default_suffixes) |
343 | 71 | try: | 70 | try: |
345 | 72 | files = os.listdir(self.get_data_path()) | 71 | files = os.listdir(self.get_data_path()) |
346 | 73 | except: | 72 | except: |
348 | 74 | return returnfiles | 73 | return [] |
349 | 75 | if suffix != None: | 74 | if suffix != None: |
350 | 75 | return_files = [] | ||
351 | 76 | for f in files: | 76 | for f in files: |
352 | 77 | if f.find('.') != -1: | 77 | if f.find('.') != -1: |
353 | 78 | nme = f.split('.') | 78 | nme = f.split('.') |
354 | 79 | bname = nme[0] | 79 | bname = nme[0] |
355 | 80 | sfx = nme[1].lower() | 80 | sfx = nme[1].lower() |
356 | 81 | sfx = sfx.lower() | 81 | sfx = sfx.lower() |
360 | 82 | if suffix.find(sfx) > -1 : # only load files with the correct suffix | 82 | # only load files with the correct suffix |
361 | 83 | returnfiles.append(f) | 83 | if suffix.find(sfx) > -1 : |
362 | 84 | return returnfiles | 84 | return_files.append(f) |
363 | 85 | return return_files | ||
364 | 85 | else: | 86 | else: |
366 | 86 | return files # no filtering required | 87 | # no filtering required |
367 | 88 | return files | ||
368 | 87 | 89 | ||
369 | 88 | def load_list(self, name): | 90 | def load_list(self, name): |
370 | 89 | """ | 91 | """ |
371 | 90 | 92 | ||
372 | === modified file 'openlp/core/lib/pluginmanager.py' | |||
373 | --- openlp/core/lib/pluginmanager.py 2009-04-20 18:22:42 +0000 | |||
374 | +++ openlp/core/lib/pluginmanager.py 2009-05-20 20:17:20 +0000 | |||
375 | @@ -29,7 +29,7 @@ | |||
376 | 29 | and executes all the hooks, as and when necessary. | 29 | and executes all the hooks, as and when necessary. |
377 | 30 | """ | 30 | """ |
378 | 31 | global log | 31 | global log |
380 | 32 | log=logging.getLogger(u'PluginMgr') | 32 | log = logging.getLogger(u'PluginMgr') |
381 | 33 | log.info(u'Plugin manager loaded') | 33 | log.info(u'Plugin manager loaded') |
382 | 34 | 34 | ||
383 | 35 | def __init__(self, dir): | 35 | def __init__(self, dir): |
384 | @@ -42,25 +42,26 @@ | |||
385 | 42 | log.debug("Inserting %s into sys.path", dir) | 42 | log.debug("Inserting %s into sys.path", dir) |
386 | 43 | sys.path.insert(0, dir) | 43 | sys.path.insert(0, dir) |
387 | 44 | self.basepath = os.path.abspath(dir) | 44 | self.basepath = os.path.abspath(dir) |
389 | 45 | log.debug("Base path %s ", self.basepath) | 45 | log.debug(u'Base path %s ', self.basepath) |
390 | 46 | self.plugins = [] | 46 | self.plugins = [] |
391 | 47 | # this has to happen after the UI is sorted self.find_plugins(dir) | 47 | # this has to happen after the UI is sorted self.find_plugins(dir) |
393 | 48 | log.info("Plugin manager done init") | 48 | log.info(u'Plugin manager done init') |
394 | 49 | 49 | ||
396 | 50 | def find_plugins(self, dir, plugin_helpers, eventmanager): # TODO shouldn't dir come from self.basepath | 50 | def find_plugins(self, dir, plugin_helpers, eventmanager): |
397 | 51 | """ | 51 | """ |
398 | 52 | Scan the directory dir for objects inheriting from openlp.plugin | 52 | Scan the directory dir for objects inheriting from openlp.plugin |
399 | 53 | """ | 53 | """ |
400 | 54 | self.plugin_helpers = plugin_helpers | 54 | self.plugin_helpers = plugin_helpers |
403 | 55 | startdepth=len(os.path.abspath(dir).split(os.sep)) | 55 | startdepth = len(os.path.abspath(dir).split(os.sep)) |
404 | 56 | log.debug("find plugins %s at depth %d" %( str(dir), startdepth)) | 56 | log.debug(u'find plugins %s at depth %d' %( str(dir), startdepth)) |
405 | 57 | 57 | ||
406 | 58 | for root, dirs, files in os.walk(dir): | 58 | for root, dirs, files in os.walk(dir): |
407 | 59 | for name in files: | 59 | for name in files: |
409 | 60 | if name.endswith(".py") and not name.startswith("__"): | 60 | if name.endswith(u'.py') and not name.startswith(u'__'): |
410 | 61 | path = os.path.abspath(os.path.join(root, name)) | 61 | path = os.path.abspath(os.path.join(root, name)) |
413 | 62 | thisdepth=len(path.split(os.sep)) | 62 | thisdepth = len(path.split(os.sep)) |
414 | 63 | if thisdepth-startdepth > 2: # skip anything lower down | 63 | if thisdepth-startdepth > 2: |
415 | 64 | # skip anything lower down | ||
416 | 64 | continue | 65 | continue |
417 | 65 | modulename, pyext = os.path.splitext(path) | 66 | modulename, pyext = os.path.splitext(path) |
418 | 66 | prefix = os.path.commonprefix([self.basepath, path]) | 67 | prefix = os.path.commonprefix([self.basepath, path]) |
419 | @@ -68,11 +69,11 @@ | |||
420 | 68 | modulename = modulename[len(prefix) + 1:] | 69 | modulename = modulename[len(prefix) + 1:] |
421 | 69 | modulename = modulename.replace(os.path.sep, '.') | 70 | modulename = modulename.replace(os.path.sep, '.') |
422 | 70 | # import the modules | 71 | # import the modules |
424 | 71 | log.debug("Importing %s from %s. Depth %d" % (modulename, path, thisdepth)) | 72 | log.debug(u'Importing %s from %s. Depth %d' % (modulename, path, thisdepth)) |
425 | 72 | try: | 73 | try: |
426 | 73 | __import__(modulename, globals(), locals(), []) | 74 | __import__(modulename, globals(), locals(), []) |
427 | 74 | except ImportError, e: | 75 | except ImportError, e: |
429 | 75 | log.error("Failed to import module %s on path %s for reason %s", modulename, path, e.message) | 76 | log.error(u'Failed to import module %s on path %s for reason %s', modulename, path, e.message) |
430 | 76 | self.plugin_classes = Plugin.__subclasses__() | 77 | self.plugin_classes = Plugin.__subclasses__() |
431 | 77 | self.plugins = [] | 78 | self.plugins = [] |
432 | 78 | plugin_objects = [] | 79 | plugin_objects = [] |
433 | @@ -80,9 +81,9 @@ | |||
434 | 80 | try: | 81 | try: |
435 | 81 | plugin = p(self.plugin_helpers) | 82 | plugin = p(self.plugin_helpers) |
436 | 82 | log.debug(u'loaded plugin %s with helpers'%str(p)) | 83 | log.debug(u'loaded plugin %s with helpers'%str(p)) |
438 | 83 | log.debug("Plugin="+str(p)) | 84 | log.debug(u'Plugin: %s', str(p)) |
439 | 84 | if plugin.check_pre_conditions(): | 85 | if plugin.check_pre_conditions(): |
441 | 85 | log.debug("Appending "+str(p)) | 86 | log.debug(u'Appending %s ', str(p)) |
442 | 86 | plugin_objects.append(plugin) | 87 | plugin_objects.append(plugin) |
443 | 87 | eventmanager.register(plugin) | 88 | eventmanager.register(plugin) |
444 | 88 | except TypeError: | 89 | except TypeError: |
445 | @@ -100,7 +101,7 @@ | |||
446 | 100 | for plugin in self.plugins: | 101 | for plugin in self.plugins: |
447 | 101 | media_manager_item = plugin.get_media_manager_item() | 102 | media_manager_item = plugin.get_media_manager_item() |
448 | 102 | if media_manager_item is not None: | 103 | if media_manager_item is not None: |
450 | 103 | log.debug('Inserting media manager item from %s' % plugin.name) | 104 | log.debug(u'Inserting media manager item from %s' % plugin.name) |
451 | 104 | mediatoolbox.addItem(media_manager_item, plugin.icon, media_manager_item.title) | 105 | mediatoolbox.addItem(media_manager_item, plugin.icon, media_manager_item.title) |
452 | 105 | 106 | ||
453 | 106 | def hook_settings_tabs(self, settingsform=None): | 107 | def hook_settings_tabs(self, settingsform=None): |
454 | @@ -111,10 +112,10 @@ | |||
455 | 111 | for plugin in self.plugins: | 112 | for plugin in self.plugins: |
456 | 112 | settings_tab = plugin.get_settings_tab() | 113 | settings_tab = plugin.get_settings_tab() |
457 | 113 | if settings_tab is not None: | 114 | if settings_tab is not None: |
459 | 114 | log.debug('Inserting settings tab item from %s' % plugin.name) | 115 | log.debug(u'Inserting settings tab item from %s' % plugin.name) |
460 | 115 | settingsform.addTab(settings_tab) | 116 | settingsform.addTab(settings_tab) |
461 | 116 | else: | 117 | else: |
463 | 117 | log.debug('No settings in %s' % plugin.name) | 118 | log.debug(u'No settings in %s' % plugin.name) |
464 | 118 | 119 | ||
465 | 119 | def hook_import_menu(self, import_menu): | 120 | def hook_import_menu(self, import_menu): |
466 | 120 | """ | 121 | """ |
467 | @@ -132,15 +133,6 @@ | |||
468 | 132 | for plugin in self.plugins: | 133 | for plugin in self.plugins: |
469 | 133 | plugin.add_export_menu_item(export_menu) | 134 | plugin.add_export_menu_item(export_menu) |
470 | 134 | 135 | ||
471 | 135 | def hook_handle_event(self, eventmanager): | ||
472 | 136 | for plugin in self.plugins: | ||
473 | 137 | handle_event = plugin.handle_event(None) | ||
474 | 138 | print plugin, handle_event | ||
475 | 139 | # if settings_tab is not None: | ||
476 | 140 | # log.debug('Inserting settings tab item from %s' % plugin.name) | ||
477 | 141 | # settingsform.addTab(settings_tab) | ||
478 | 142 | # else: | ||
479 | 143 | # log.debug('No settings in %s' % plugin.name) | ||
480 | 144 | def initialise_plugins(self): | 136 | def initialise_plugins(self): |
481 | 145 | """ | 137 | """ |
482 | 146 | Loop through all the plugins and give them an opportunity to add an item | 138 | Loop through all the plugins and give them an opportunity to add an item |
483 | 147 | 139 | ||
484 | === modified file 'openlp/core/lib/renderer.py' | |||
485 | --- openlp/core/lib/renderer.py 2009-05-19 16:27:01 +0000 | |||
486 | +++ openlp/core/lib/renderer.py 2009-05-30 18:44:16 +0000 | |||
487 | @@ -177,13 +177,11 @@ | |||
488 | 177 | painter.drawPath(rectPath) | 177 | painter.drawPath(rectPath) |
489 | 178 | 178 | ||
490 | 179 | elif self._theme.background_type== u'image': # image | 179 | elif self._theme.background_type== u'image': # image |
496 | 180 | r = self._frame.rect() | 180 | #r = self._frame.rect() |
497 | 181 | log.debug(u'Image size details %d %d %d %d ', r.x(), r.y(), r.width(),r.height()) | 181 | #log.debug(u'Image size details %d %d %d %d ', r.x(), r.y(), r.width(),r.height()) |
493 | 182 | #log.debug(u' Background Parameter %d ', self._theme.background_color1) | ||
494 | 183 | #if self._theme.background_color1 is not None: | ||
495 | 184 | # p.fillRect(self._frame.rect(), self._theme.background_borderColor) | ||
498 | 185 | if self.bg_image is not None: | 182 | if self.bg_image is not None: |
500 | 186 | painter.drawPixmap(self.background_offsetx,self.background_offsety, self.bg_image) | 183 | #painter.drawPixmap(self.background_offsetx,self.background_offsety, self.bg_image) |
501 | 184 | painter.drawPixmap(0 ,0 , self.bg_image) | ||
502 | 187 | else: | 185 | else: |
503 | 188 | painter.fillRect(self._frame.rect(), QtGui.QColor(u'#000000')) | 186 | painter.fillRect(self._frame.rect(), QtGui.QColor(u'#000000')) |
504 | 189 | painter.end() | 187 | painter.end() |
505 | @@ -204,24 +202,29 @@ | |||
506 | 204 | bboxes = [] | 202 | bboxes = [] |
507 | 205 | for line in lines: | 203 | for line in lines: |
508 | 206 | bboxes.append(self._render_single_line(line, footer)) | 204 | bboxes.append(self._render_single_line(line, footer)) |
509 | 205 | #print line, bboxes | ||
510 | 207 | 206 | ||
511 | 208 | numlines = len(lines) | 207 | numlines = len(lines) |
512 | 209 | bottom = self._rect.bottom() | 208 | bottom = self._rect.bottom() |
527 | 210 | for ratio in (numlines, numlines/2, numlines/3, numlines/4): | 209 | #for ratio in (numlines): #, numlines/2, numlines/3, numlines/4): |
528 | 211 | good = 1 | 210 | ratio = numlines |
529 | 212 | startline = 0 | 211 | good = 1 |
530 | 213 | endline = startline + ratio | 212 | startline = 0 |
531 | 214 | while (endline <= numlines): | 213 | endline = startline + ratio |
532 | 215 | by = 0 | 214 | while (endline <= numlines): |
533 | 216 | for (x, y) in bboxes[startline:endline]: | 215 | by = 0 |
534 | 217 | by += y | 216 | for (x, y) in bboxes[startline:endline]: |
535 | 218 | if by > bottom: | 217 | by += y |
536 | 219 | good=0 | 218 | #print by |
537 | 220 | break | 219 | #print by , bottom |
538 | 221 | startline += ratio | 220 | if by > bottom: |
539 | 222 | endline = startline+ratio | 221 | good=0 |
526 | 223 | if good == 1: | ||
540 | 224 | break | 222 | break |
541 | 223 | startline += ratio | ||
542 | 224 | endline = startline+ratio | ||
543 | 225 | # if good == 1: | ||
544 | 226 | # break | ||
545 | 227 | #print "---------" | ||
546 | 225 | 228 | ||
547 | 226 | retval = [] | 229 | retval = [] |
548 | 227 | numlines_per_page = ratio | 230 | numlines_per_page = ratio |
549 | 228 | 231 | ||
550 | === modified file 'openlp/core/lib/rendermanager.py' | |||
551 | --- openlp/core/lib/rendermanager.py 2009-05-18 19:47:18 +0000 | |||
552 | +++ openlp/core/lib/rendermanager.py 2009-05-22 18:30:25 +0000 | |||
553 | @@ -63,6 +63,7 @@ | |||
554 | 63 | self.renderer = Renderer() | 63 | self.renderer = Renderer() |
555 | 64 | self.calculate_default(self.screen_list[self.current_display]['size']) | 64 | self.calculate_default(self.screen_list[self.current_display]['size']) |
556 | 65 | self.theme = u'' | 65 | self.theme = u'' |
557 | 66 | self.service_theme = u'' | ||
558 | 66 | 67 | ||
559 | 67 | def set_global_theme(self, global_theme, global_style = u'Global'): | 68 | def set_global_theme(self, global_theme, global_style = u'Global'): |
560 | 68 | self.global_theme = global_theme | 69 | self.global_theme = global_theme |
561 | @@ -83,11 +84,13 @@ | |||
562 | 83 | else: | 84 | else: |
563 | 84 | if theme is not None: | 85 | if theme is not None: |
564 | 85 | self.theme = theme | 86 | self.theme = theme |
566 | 86 | elif self.global_style == u'Service': | 87 | elif self.global_style == u'Song' or self.global_style == u'Service': |
567 | 87 | if self.service_theme == u'': | 88 | if self.service_theme == u'': |
568 | 88 | self.theme = self.global_theme | 89 | self.theme = self.global_theme |
569 | 89 | else: | 90 | else: |
570 | 90 | self.theme = self.service_theme | 91 | self.theme = self.service_theme |
571 | 92 | else: | ||
572 | 93 | self.theme = self.global_theme | ||
573 | 91 | 94 | ||
574 | 92 | if self.theme is not self.renderer.theme_name: | 95 | if self.theme is not self.renderer.theme_name: |
575 | 93 | log.debug(u'theme is now %s', self.theme) | 96 | log.debug(u'theme is now %s', self.theme) |
576 | @@ -117,7 +120,7 @@ | |||
577 | 117 | 120 | ||
578 | 118 | def generate_preview(self, themedata): | 121 | def generate_preview(self, themedata): |
579 | 119 | log.debug(u'generate preview') | 122 | log.debug(u'generate preview') |
581 | 120 | self.calculate_default(QtCore.QSize(800, 600)) | 123 | self.calculate_default(QtCore.QSize(1024, 768)) |
582 | 121 | self.renderer.set_theme(themedata) | 124 | self.renderer.set_theme(themedata) |
583 | 122 | self.build_text_rectangle(themedata) | 125 | self.build_text_rectangle(themedata) |
584 | 123 | 126 | ||
585 | 124 | 127 | ||
586 | === modified file 'openlp/core/lib/serviceitem.py' | |||
587 | --- openlp/core/lib/serviceitem.py 2009-05-17 15:24:02 +0000 | |||
588 | +++ openlp/core/lib/serviceitem.py 2009-05-22 18:30:25 +0000 | |||
589 | @@ -19,10 +19,8 @@ | |||
590 | 19 | """ | 19 | """ |
591 | 20 | import logging | 20 | import logging |
592 | 21 | import time | 21 | import time |
597 | 22 | from openlp import buildIcon | 22 | from openlp.core.lib import buildIcon |
598 | 23 | from PyQt4.QtCore import * | 23 | from PyQt4 import QtCore, QtGui |
595 | 24 | from PyQt4.QtGui import * | ||
596 | 25 | |||
599 | 26 | 24 | ||
600 | 27 | class ServiceItem(): | 25 | class ServiceItem(): |
601 | 28 | """ | 26 | """ |
602 | @@ -44,6 +42,8 @@ | |||
603 | 44 | self.items = [] | 42 | self.items = [] |
604 | 45 | self.iconic_representation = None | 43 | self.iconic_representation = None |
605 | 46 | self.raw_slides = None | 44 | self.raw_slides = None |
606 | 45 | self.frame_titles = [] | ||
607 | 46 | self.command_files = [] | ||
608 | 47 | self.frames = [] | 47 | self.frames = [] |
609 | 48 | self.raw_footer = None | 48 | self.raw_footer = None |
610 | 49 | self.theme = None | 49 | self.theme = None |
611 | @@ -62,11 +62,14 @@ | |||
612 | 62 | else: | 62 | else: |
613 | 63 | self.render_manager.set_override_theme(self.theme) | 63 | self.render_manager.set_override_theme(self.theme) |
614 | 64 | log.debug(u'Formatting slides') | 64 | log.debug(u'Formatting slides') |
616 | 65 | if len(self.frames) == 0 : | 65 | if len(self.frames) == 0 and len(self.raw_slides) > 0 : |
617 | 66 | for slide in self.raw_slides: | 66 | for slide in self.raw_slides: |
618 | 67 | formated = self.render_manager.format_slide(slide, False) | 67 | formated = self.render_manager.format_slide(slide, False) |
619 | 68 | frame = self.render_manager.generate_slide(formated, self.raw_footer) | 68 | frame = self.render_manager.generate_slide(formated, self.raw_footer) |
621 | 69 | self.frames.append({u'formatted': formated, u'image': frame}) | 69 | self.frames.append({u'title': formated, u'image': frame}) |
622 | 70 | else: | ||
623 | 71 | if len(self.command_files) > 0: | ||
624 | 72 | pass | ||
625 | 70 | 73 | ||
626 | 71 | 74 | ||
627 | 72 | def get_parent_node(self): | 75 | def get_parent_node(self): |
628 | 73 | 76 | ||
629 | === modified file 'openlp/core/lib/themexmlhandler.py' | |||
630 | --- openlp/core/lib/themexmlhandler.py 2009-05-16 19:47:30 +0000 | |||
631 | +++ openlp/core/lib/themexmlhandler.py 2009-05-22 05:14:55 +0000 | |||
632 | @@ -22,7 +22,7 @@ | |||
633 | 22 | For XML Schema see wiki.openlp.org | 22 | For XML Schema see wiki.openlp.org |
634 | 23 | """ | 23 | """ |
635 | 24 | import os, os.path | 24 | import os, os.path |
637 | 25 | from openlp import convertStringToBoolean | 25 | from openlp.core.lib import str_to_bool |
638 | 26 | from xml.dom.minidom import Document | 26 | from xml.dom.minidom import Document |
639 | 27 | from xml.etree.ElementTree import ElementTree, XML, dump | 27 | from xml.etree.ElementTree import ElementTree, XML, dump |
640 | 28 | 28 | ||
641 | @@ -69,12 +69,14 @@ | |||
642 | 69 | # Create the minidom document | 69 | # Create the minidom document |
643 | 70 | self.theme_xml = Document() | 70 | self.theme_xml = Document() |
644 | 71 | 71 | ||
646 | 72 | def extend_filename(self, path): | 72 | def extend_image_filename(self, path): |
647 | 73 | """ | ||
648 | 74 | Add the path name to the image name so the background can be rendered. | ||
649 | 75 | """ | ||
650 | 73 | if self.background_filename is not None: | 76 | if self.background_filename is not None: |
651 | 74 | self.background_filename = os.path.join(path, self.theme_name, self.background_filename) | 77 | self.background_filename = os.path.join(path, self.theme_name, self.background_filename) |
652 | 75 | 78 | ||
653 | 76 | def new_document(self, name): | 79 | def new_document(self, name): |
654 | 77 | # Create the <song> base element | ||
655 | 78 | self.theme = self.theme_xml.createElement(u'theme') | 80 | self.theme = self.theme_xml.createElement(u'theme') |
656 | 79 | self.theme_xml.appendChild(self.theme) | 81 | self.theme_xml.appendChild(self.theme) |
657 | 80 | self.theme.setAttribute(u'version', u'1.0') | 82 | self.theme.setAttribute(u'version', u'1.0') |
658 | @@ -85,89 +87,92 @@ | |||
659 | 85 | self.theme.appendChild(self.name) | 87 | self.theme.appendChild(self.name) |
660 | 86 | 88 | ||
661 | 87 | def add_background_transparent(self): | 89 | def add_background_transparent(self): |
663 | 88 | # Create the main <lyrics> element | 90 | """ |
664 | 91 | Add a transparent background. | ||
665 | 92 | """ | ||
666 | 89 | background = self.theme_xml.createElement(u'background') | 93 | background = self.theme_xml.createElement(u'background') |
667 | 90 | background.setAttribute(u'mode', u'transparent') | 94 | background.setAttribute(u'mode', u'transparent') |
668 | 91 | self.theme.appendChild(background) | 95 | self.theme.appendChild(background) |
669 | 92 | 96 | ||
670 | 93 | def add_background_solid(self, bkcolor): | 97 | def add_background_solid(self, bkcolor): |
671 | 98 | """ | ||
672 | 99 | Add a Solid background. | ||
673 | 100 | """ | ||
674 | 94 | background = self.theme_xml.createElement(u'background') | 101 | background = self.theme_xml.createElement(u'background') |
675 | 95 | background.setAttribute(u'mode', u'opaque') | 102 | background.setAttribute(u'mode', u'opaque') |
676 | 96 | background.setAttribute(u'type', u'solid') | 103 | background.setAttribute(u'type', u'solid') |
677 | 97 | self.theme.appendChild(background) | 104 | self.theme.appendChild(background) |
678 | 98 | 105 | ||
683 | 99 | color = self.theme_xml.createElement(u'color') | 106 | self.child_element(background, u'color', bkcolor) |
680 | 100 | bkc = self.theme_xml.createTextNode(bkcolor) | ||
681 | 101 | color.appendChild(bkc) | ||
682 | 102 | background.appendChild(color) | ||
684 | 103 | 107 | ||
685 | 104 | def add_background_gradient(self, startcolor, endcolor, direction): | 108 | def add_background_gradient(self, startcolor, endcolor, direction): |
686 | 109 | """ | ||
687 | 110 | Add a gradient background. | ||
688 | 111 | """ | ||
689 | 105 | background = self.theme_xml.createElement(u'background') | 112 | background = self.theme_xml.createElement(u'background') |
690 | 106 | background.setAttribute(u'mode', u'opaque') | 113 | background.setAttribute(u'mode', u'opaque') |
691 | 107 | background.setAttribute(u'type', u'gradient') | 114 | background.setAttribute(u'type', u'gradient') |
692 | 108 | self.theme.appendChild(background) | 115 | self.theme.appendChild(background) |
693 | 109 | 116 | ||
708 | 110 | color = self.theme_xml.createElement(u'startColor') | 117 | # Create startColor element |
709 | 111 | bkc = self.theme_xml.createTextNode(startcolor) | 118 | self.child_element(background, u'startColor', startcolor) |
710 | 112 | color.appendChild(bkc) | 119 | # Create endColor element |
711 | 113 | background.appendChild(color) | 120 | self.child_element(background, u'endColor', endcolor) |
712 | 114 | 121 | # Create direction element | |
713 | 115 | color = self.theme_xml.createElement(u'endColor') | 122 | self.child_element(background, u'direction', direction) |
700 | 116 | bkc = self.theme_xml.createTextNode(endcolor) | ||
701 | 117 | color.appendChild(bkc) | ||
702 | 118 | background.appendChild(color) | ||
703 | 119 | |||
704 | 120 | color = self.theme_xml.createElement(u'direction') | ||
705 | 121 | bkc = self.theme_xml.createTextNode(direction) | ||
706 | 122 | color.appendChild(bkc) | ||
707 | 123 | background.appendChild(color) | ||
714 | 124 | 123 | ||
715 | 125 | def add_background_image(self, filename): | 124 | def add_background_image(self, filename): |
716 | 125 | """ | ||
717 | 126 | Add a image background. | ||
718 | 127 | """ | ||
719 | 126 | background = self.theme_xml.createElement(u'background') | 128 | background = self.theme_xml.createElement(u'background') |
720 | 127 | background.setAttribute(u'mode', u'opaque') | 129 | background.setAttribute(u'mode', u'opaque') |
721 | 128 | background.setAttribute(u'type', u'image') | 130 | background.setAttribute(u'type', u'image') |
722 | 129 | self.theme.appendChild(background) | 131 | self.theme.appendChild(background) |
723 | 130 | 132 | ||
728 | 131 | color = self.theme_xml.createElement(u'filename') | 133 | #Create Filename element |
729 | 132 | bkc = self.theme_xml.createCDATASection(filename) | 134 | self.child_element(background, u'filename', filename) |
726 | 133 | color.appendChild(bkc) | ||
727 | 134 | background.appendChild(color) | ||
730 | 135 | 135 | ||
731 | 136 | def add_font(self, name, color, proportion, override, fonttype=u'main', xpos=0, ypos=0 ,width=0, height=0): | 136 | def add_font(self, name, color, proportion, override, fonttype=u'main', xpos=0, ypos=0 ,width=0, height=0): |
732 | 137 | """ | ||
733 | 138 | Add a Font. | ||
734 | 139 | """ | ||
735 | 137 | background = self.theme_xml.createElement(u'font') | 140 | background = self.theme_xml.createElement(u'font') |
736 | 138 | background.setAttribute(u'type',fonttype) | 141 | background.setAttribute(u'type',fonttype) |
737 | 139 | self.theme.appendChild(background) | 142 | self.theme.appendChild(background) |
738 | 140 | 143 | ||
754 | 141 | element = self.theme_xml.createElement(u'name') | 144 | #Create Font name element |
755 | 142 | fn = self.theme_xml.createTextNode(name) | 145 | self.child_element(background, u'name', name) |
756 | 143 | element.appendChild(fn) | 146 | |
757 | 144 | background.appendChild(element) | 147 | #Create Font color element |
758 | 145 | 148 | self.child_element(background, u'color', color) | |
759 | 146 | element = self.theme_xml.createElement(u'color') | 149 | |
760 | 147 | fn = self.theme_xml.createTextNode(color) | 150 | #Create Proportion name element |
761 | 148 | element.appendChild(fn) | 151 | self.child_element(background, u'proportion', proportion) |
762 | 149 | background.appendChild(element) | 152 | |
763 | 150 | 153 | #Create Proportion name element | |
764 | 151 | element = self.theme_xml.createElement(u'proportion') | 154 | self.child_element(background, u'proportion', proportion) |
765 | 152 | fn = self.theme_xml.createTextNode(proportion) | 155 | |
766 | 153 | element.appendChild(fn) | 156 | #Create Location element |
752 | 154 | background.appendChild(element) | ||
753 | 155 | |||
767 | 156 | element = self.theme_xml.createElement(u'location') | 157 | element = self.theme_xml.createElement(u'location') |
768 | 157 | element.setAttribute(u'override',override) | 158 | element.setAttribute(u'override',override) |
769 | 158 | 159 | ||
770 | 159 | if override == u'True': | 160 | if override == u'True': |
775 | 160 | element.setAttribute(u'x',xpos) | 161 | element.setAttribute(u'x', xpos) |
776 | 161 | element.setAttribute(u'y',ypos) | 162 | element.setAttribute(u'y', ypos) |
777 | 162 | element.setAttribute(u'width',width) | 163 | element.setAttribute(u'width', width) |
778 | 163 | element.setAttribute(u'height',height) | 164 | element.setAttribute(u'height', height) |
779 | 164 | background.appendChild(element) | 165 | background.appendChild(element) |
780 | 165 | 166 | ||
781 | 166 | def add_display(self, shadow, shadowColor, outline, outlineColor, horizontal, vertical, wrap): | 167 | def add_display(self, shadow, shadowColor, outline, outlineColor, horizontal, vertical, wrap): |
782 | 168 | """ | ||
783 | 169 | Add a Display options. | ||
784 | 170 | """ | ||
785 | 167 | background = self.theme_xml.createElement(u'display') | 171 | background = self.theme_xml.createElement(u'display') |
786 | 168 | self.theme.appendChild(background) | 172 | self.theme.appendChild(background) |
787 | 169 | 173 | ||
788 | 170 | tagElement = self.theme_xml.createElement(u'shadow') | 174 | tagElement = self.theme_xml.createElement(u'shadow') |
789 | 175 | |||
790 | 171 | tagElement.setAttribute(u'color',shadowColor) | 176 | tagElement.setAttribute(u'color',shadowColor) |
791 | 172 | tagValue = self.theme_xml.createTextNode(shadow) | 177 | tagValue = self.theme_xml.createTextNode(shadow) |
792 | 173 | tagElement.appendChild(tagValue) | 178 | tagElement.appendChild(tagValue) |
793 | @@ -194,15 +199,15 @@ | |||
794 | 194 | tagElement.appendChild(tagValue) | 199 | tagElement.appendChild(tagValue) |
795 | 195 | background.appendChild(tagElement) | 200 | background.appendChild(tagElement) |
796 | 196 | 201 | ||
802 | 197 | def child_element(self, tag, value): | 202 | def child_element(self, element, tag, value): |
803 | 198 | tagElement = self.theme_xml.createElement(tag) | 203 | child = self.theme_xml.createElement(tag) |
804 | 199 | tagValue = self.theme_xml.createTextNode(value) | 204 | child.appendChild(self.theme_xml.createTextNode(value)) |
805 | 200 | tagElement.appendChild(ftagValue) | 205 | element.appendChild(child) |
806 | 201 | self.background.appendChild(tagElement) | 206 | return child |
807 | 202 | 207 | ||
808 | 203 | def dump_xml(self): | 208 | def dump_xml(self): |
809 | 204 | # Debugging aid to see what we have | 209 | # Debugging aid to see what we have |
811 | 205 | print self.theme_xml.toprettyxml(indent=" ") | 210 | print self.theme_xml.toprettyxml(indent=u' ') |
812 | 206 | 211 | ||
813 | 207 | def extract_xml(self): | 212 | def extract_xml(self): |
814 | 208 | # Print our newly created XML | 213 | # Print our newly created XML |
815 | @@ -211,18 +216,19 @@ | |||
816 | 211 | def parse(self, xml): | 216 | def parse(self, xml): |
817 | 212 | self.baseParseXml() | 217 | self.baseParseXml() |
818 | 213 | self.parse_xml(xml) | 218 | self.parse_xml(xml) |
819 | 219 | self.theme_filename_extended = False | ||
820 | 214 | 220 | ||
821 | 215 | def baseParseXml(self): | 221 | def baseParseXml(self): |
822 | 216 | self.parse_xml(blankthemexml) | 222 | self.parse_xml(blankthemexml) |
823 | 217 | 223 | ||
824 | 218 | def parse_xml(self, xml): | 224 | def parse_xml(self, xml): |
825 | 219 | theme_xml = ElementTree(element=XML(xml)) | 225 | theme_xml = ElementTree(element=XML(xml)) |
827 | 220 | iter=theme_xml.getiterator() | 226 | iter = theme_xml.getiterator() |
828 | 221 | master = u'' | 227 | master = u'' |
829 | 222 | for element in iter: | 228 | for element in iter: |
830 | 223 | #print element.tag, element.text | 229 | #print element.tag, element.text |
831 | 224 | if len(element.getchildren()) > 0: | 230 | if len(element.getchildren()) > 0: |
833 | 225 | master= element.tag + u'_' | 231 | master = element.tag + u'_' |
834 | 226 | if len(element.attrib) > 0: | 232 | if len(element.attrib) > 0: |
835 | 227 | #print "D", element.tag , element.attrib | 233 | #print "D", element.tag , element.attrib |
836 | 228 | for e in element.attrib.iteritems(): | 234 | for e in element.attrib.iteritems(): |
837 | @@ -231,18 +237,18 @@ | |||
838 | 231 | master += e[1] + u'_' | 237 | master += e[1] + u'_' |
839 | 232 | elif master == u'display_' and (element.tag == u'shadow' or element.tag == u'outline'): | 238 | elif master == u'display_' and (element.tag == u'shadow' or element.tag == u'outline'): |
840 | 233 | #print "b", master, element.tag, element.text, e[0], e[1] | 239 | #print "b", master, element.tag, element.text, e[0], e[1] |
842 | 234 | et = convertStringToBoolean(element.text) | 240 | et = str_to_bool(element.text) |
843 | 235 | setattr(self, master + element.tag , et) | 241 | setattr(self, master + element.tag , et) |
845 | 236 | setattr(self, master + element.tag +u'_'+ e[0], e[1]) | 242 | setattr(self, master + element.tag + u'_'+ e[0], e[1]) |
846 | 237 | else: | 243 | else: |
847 | 238 | field = master + e[0] | 244 | field = master + e[0] |
848 | 239 | e1 = e[1] | 245 | e1 = e[1] |
849 | 240 | if e[1] == u'True' or e[1] == u'False': | 246 | if e[1] == u'True' or e[1] == u'False': |
851 | 241 | e1 = convertStringToBoolean(e[1]) | 247 | e1 = str_to_bool(e[1]) |
852 | 242 | setattr(self, field, e1) | 248 | setattr(self, field, e1) |
853 | 243 | else: | 249 | else: |
854 | 244 | #print "c", element.tag, element.text | 250 | #print "c", element.tag, element.text |
856 | 245 | if element.tag is not None : | 251 | if element.tag is not None: |
857 | 246 | field = master + element.tag | 252 | field = master + element.tag |
858 | 247 | setattr(self, field, element.text) | 253 | setattr(self, field, element.text) |
859 | 248 | 254 | ||
860 | @@ -250,5 +256,5 @@ | |||
861 | 250 | s = u'' | 256 | s = u'' |
862 | 251 | for k in dir(self): | 257 | for k in dir(self): |
863 | 252 | if k[0:1] != u'_': | 258 | if k[0:1] != u'_': |
865 | 253 | s+= u'%30s : %s\n' %(k,getattr(self,k)) | 259 | s += u'%30s : %s\n' %(k,getattr(self,k)) |
866 | 254 | return s | 260 | return s |
867 | 255 | 261 | ||
868 | === modified file 'openlp/core/lib/xmlrootclass.py' | |||
869 | --- openlp/core/lib/xmlrootclass.py 2008-12-10 21:40:19 +0000 | |||
870 | +++ openlp/core/lib/xmlrootclass.py 2009-05-20 20:17:20 +0000 | |||
871 | @@ -22,13 +22,9 @@ | |||
872 | 22 | import sys | 22 | import sys |
873 | 23 | import os | 23 | import os |
874 | 24 | from types import StringType, NoneType, UnicodeType | 24 | from types import StringType, NoneType, UnicodeType |
876 | 25 | sys.path.append(os.path.abspath("./../..")) | 25 | sys.path.append(os.path.abspath(u'./../..')) |
877 | 26 | 26 | ||
883 | 27 | ver = platform.python_version() | 27 | from xml.etree.ElementTree import ElementTree, XML |
879 | 28 | if ver >= '2.5': | ||
880 | 29 | from xml.etree.ElementTree import ElementTree, XML | ||
881 | 30 | else: | ||
882 | 31 | from elementtree import ElementTree, XML | ||
884 | 32 | 28 | ||
885 | 33 | 29 | ||
886 | 34 | class XmlRootClass(object): | 30 | class XmlRootClass(object): |
887 | @@ -47,23 +43,27 @@ | |||
888 | 47 | xml (string) -- formatted as xml tags and values | 43 | xml (string) -- formatted as xml tags and values |
889 | 48 | rootTag -- main tag of the xml | 44 | rootTag -- main tag of the xml |
890 | 49 | """ | 45 | """ |
893 | 50 | root=ElementTree(element=XML(xml)) | 46 | root = ElementTree(element=XML(xml)) |
894 | 51 | iter=root.getiterator() | 47 | iter = root.getiterator() |
895 | 52 | for element in iter: | 48 | for element in iter: |
896 | 53 | if element.tag != rootTag: | 49 | if element.tag != rootTag: |
898 | 54 | t=element.text | 50 | t = element.text |
899 | 55 | #print element.tag, t, type(t) | 51 | #print element.tag, t, type(t) |
901 | 56 | if type(t) == NoneType: # easy! | 52 | if type(t) == NoneType: |
902 | 53 | # easy! | ||
903 | 57 | val=t | 54 | val=t |
904 | 58 | elif type(t) == UnicodeType : | 55 | elif type(t) == UnicodeType : |
905 | 59 | val=t | 56 | val=t |
907 | 60 | elif type(t) == StringType: # strings need special handling to sort the colours out | 57 | elif type(t) == StringType: |
908 | 58 | # strings need special handling to sort the colours out | ||
909 | 61 | #print "str", | 59 | #print "str", |
911 | 62 | if t[0] == "$": # might be a hex number | 60 | if t[0] == '$': |
912 | 61 | # might be a hex number | ||
913 | 63 | #print "hex", | 62 | #print "hex", |
914 | 64 | try: | 63 | try: |
917 | 65 | val=int(t[1:], 16) | 64 | val = int(t[1:], 16) |
918 | 66 | except ValueError: # nope | 65 | except ValueError: |
919 | 66 | # nope | ||
920 | 67 | #print "nope", | 67 | #print "nope", |
921 | 68 | pass | 68 | pass |
922 | 69 | else: | 69 | else: |
923 | @@ -74,9 +74,9 @@ | |||
924 | 74 | except ValueError: | 74 | except ValueError: |
925 | 75 | #print "give up", | 75 | #print "give up", |
926 | 76 | val=t | 76 | val=t |
928 | 77 | if hasattr(self, "post_tag_hook"): | 77 | if hasattr(self, u'post_tag_hook'): |
929 | 78 | (element.tag, val) = self.post_tag_hook(element.tag, val) | 78 | (element.tag, val) = self.post_tag_hook(element.tag, val) |
931 | 79 | setattr(self,element.tag, val) | 79 | setattr(self, element.tag, val) |
932 | 80 | pass | 80 | pass |
933 | 81 | 81 | ||
934 | 82 | def __str__(self): | 82 | def __str__(self): |
935 | @@ -88,15 +88,15 @@ | |||
936 | 88 | """ | 88 | """ |
937 | 89 | l = [] | 89 | l = [] |
938 | 90 | for k in dir(self): | 90 | for k in dir(self): |
942 | 91 | if not k.startswith("_"): | 91 | if not k.startswith(u'_'): |
943 | 92 | l.append("%30s : %s" %(k,getattr(self,k))) | 92 | l.append(u'%30s : %s' %(k,getattr(self,k))) |
944 | 93 | return "\n".join(l) | 93 | return u'\n'.join(l) |
945 | 94 | 94 | ||
946 | 95 | def _get_as_string(self): | 95 | def _get_as_string(self): |
947 | 96 | """Return one string with all public attributes""" | 96 | """Return one string with all public attributes""" |
948 | 97 | s="" | 97 | s="" |
949 | 98 | for k in dir(self): | 98 | for k in dir(self): |
952 | 99 | if not k.startswith("_"): | 99 | if not k.startswith(u'_'): |
953 | 100 | s+= "_%s_" %(getattr(self,k)) | 100 | s+= u'_%s_' %(getattr(self,k)) |
954 | 101 | return s | 101 | return s |
955 | 102 | 102 | ||
956 | 103 | 103 | ||
957 | === modified file 'openlp/core/ui/about.py' | |||
958 | --- openlp/core/ui/about.py 2009-05-01 22:26:43 +0000 | |||
959 | +++ openlp/core/ui/about.py 2009-05-22 18:30:25 +0000 | |||
960 | @@ -19,135 +19,129 @@ | |||
961 | 19 | """ | 19 | """ |
962 | 20 | 20 | ||
963 | 21 | from PyQt4 import QtCore, QtGui | 21 | from PyQt4 import QtCore, QtGui |
970 | 22 | from PyQt4.QtGui import QDialog | 22 | |
971 | 23 | 23 | from openlp.core.lib import translate | |
972 | 24 | from openlp.core import translate | 24 | |
973 | 25 | from openlp.core.resources import * | 25 | class AboutForm(QtGui.QDialog): |
968 | 26 | |||
969 | 27 | class AboutForm(QDialog): | ||
974 | 28 | 26 | ||
975 | 29 | def __init__(self, parent=None): | 27 | def __init__(self, parent=None): |
977 | 30 | QDialog.__init__(self, parent) | 28 | QtGui.QDialog.__init__(self, parent) |
978 | 31 | self.setupUi(self) | 29 | self.setupUi(self) |
979 | 32 | 30 | ||
980 | 33 | def setupUi(self, AboutForm): | 31 | def setupUi(self, AboutForm): |
982 | 34 | AboutForm.setObjectName("AboutForm") | 32 | AboutForm.setObjectName(u'AboutForm') |
983 | 35 | AboutForm.resize(470, 481) | 33 | AboutForm.resize(470, 481) |
984 | 36 | icon = QtGui.QIcon() | 34 | icon = QtGui.QIcon() |
986 | 37 | icon.addPixmap(QtGui.QPixmap(":/icon/openlp-logo-16x16.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) | 35 | icon.addPixmap(QtGui.QPixmap(u':/icon/openlp-logo-16x16.png'), QtGui.QIcon.Normal, QtGui.QIcon.Off) |
987 | 38 | AboutForm.setWindowIcon(icon) | 36 | AboutForm.setWindowIcon(icon) |
988 | 39 | AboutFormLayout = QtGui.QVBoxLayout(AboutForm) | 37 | AboutFormLayout = QtGui.QVBoxLayout(AboutForm) |
989 | 40 | AboutFormLayout.setSpacing(8) | 38 | AboutFormLayout.setSpacing(8) |
990 | 41 | AboutFormLayout.setMargin(8) | 39 | AboutFormLayout.setMargin(8) |
992 | 42 | AboutFormLayout.setObjectName("AboutDialogLayout") | 40 | AboutFormLayout.setObjectName(u'AboutDialogLayout') |
993 | 43 | self.Logo = QtGui.QLabel(AboutForm) | 41 | self.Logo = QtGui.QLabel(AboutForm) |
994 | 44 | self.Logo.setAutoFillBackground(False) | 42 | self.Logo.setAutoFillBackground(False) |
996 | 45 | self.Logo.setStyleSheet("background-color: rgb(255, 255, 255);") | 43 | self.Logo.setStyleSheet(u'background-color: rgb(255, 255, 255);') |
997 | 46 | self.Logo.setFrameShape(QtGui.QFrame.StyledPanel) | 44 | self.Logo.setFrameShape(QtGui.QFrame.StyledPanel) |
998 | 47 | self.Logo.setLineWidth(1) | 45 | self.Logo.setLineWidth(1) |
1000 | 48 | self.Logo.setPixmap(QtGui.QPixmap(":/graphics/openlp-about-logo.png")) | 46 | self.Logo.setPixmap(QtGui.QPixmap(u':/graphics/openlp-about-logo.png')) |
1001 | 49 | self.Logo.setScaledContents(False) | 47 | self.Logo.setScaledContents(False) |
1002 | 50 | self.Logo.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter) | 48 | self.Logo.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter) |
1004 | 51 | self.Logo.setObjectName("Logo") | 49 | self.Logo.setObjectName(u'Logo') |
1005 | 52 | AboutFormLayout.addWidget(self.Logo) | 50 | AboutFormLayout.addWidget(self.Logo) |
1006 | 53 | self.AboutNotebook = QtGui.QTabWidget(AboutForm) | 51 | self.AboutNotebook = QtGui.QTabWidget(AboutForm) |
1008 | 54 | self.AboutNotebook.setObjectName("AboutNotebook") | 52 | self.AboutNotebook.setObjectName(u'AboutNotebook') |
1009 | 55 | self.LicenseTab = QtGui.QWidget() | 53 | self.LicenseTab = QtGui.QWidget() |
1011 | 56 | self.LicenseTab.setObjectName("LicenseTab") | 54 | self.LicenseTab.setObjectName(u'LicenseTab') |
1012 | 57 | self.LicenseTabLayout = QtGui.QVBoxLayout(self.LicenseTab) | 55 | self.LicenseTabLayout = QtGui.QVBoxLayout(self.LicenseTab) |
1013 | 58 | self.LicenseTabLayout.setSpacing(8) | 56 | self.LicenseTabLayout.setSpacing(8) |
1014 | 59 | self.LicenseTabLayout.setMargin(8) | 57 | self.LicenseTabLayout.setMargin(8) |
1016 | 60 | self.LicenseTabLayout.setObjectName("LicenseTabLayout") | 58 | self.LicenseTabLayout.setObjectName(u'LicenseTabLayout') |
1017 | 61 | self.CopyrightLabel = QtGui.QLabel(self.LicenseTab) | 59 | self.CopyrightLabel = QtGui.QLabel(self.LicenseTab) |
1019 | 62 | self.CopyrightLabel.setObjectName("CopyrightLabel") | 60 | self.CopyrightLabel.setObjectName(u'CopyrightLabel') |
1020 | 63 | self.LicenseTabLayout.addWidget(self.CopyrightLabel) | 61 | self.LicenseTabLayout.addWidget(self.CopyrightLabel) |
1021 | 64 | self.AboutAuthors = QtGui.QLabel(self.LicenseTab) | 62 | self.AboutAuthors = QtGui.QLabel(self.LicenseTab) |
1022 | 65 | self.AboutAuthors.setAlignment(QtCore.Qt.AlignJustify|QtCore.Qt.AlignVCenter) | 63 | self.AboutAuthors.setAlignment(QtCore.Qt.AlignJustify|QtCore.Qt.AlignVCenter) |
1023 | 66 | self.AboutAuthors.setWordWrap(True) | 64 | self.AboutAuthors.setWordWrap(True) |
1025 | 67 | self.AboutAuthors.setObjectName("AboutAuthors") | 65 | self.AboutAuthors.setObjectName(u'AboutAuthors') |
1026 | 68 | self.LicenseTabLayout.addWidget(self.AboutAuthors) | 66 | self.LicenseTabLayout.addWidget(self.AboutAuthors) |
1027 | 69 | self.License1Label = QtGui.QLabel(self.LicenseTab) | 67 | self.License1Label = QtGui.QLabel(self.LicenseTab) |
1028 | 70 | self.License1Label.setAlignment(QtCore.Qt.AlignJustify|QtCore.Qt.AlignVCenter) | 68 | self.License1Label.setAlignment(QtCore.Qt.AlignJustify|QtCore.Qt.AlignVCenter) |
1029 | 71 | self.License1Label.setWordWrap(True) | 69 | self.License1Label.setWordWrap(True) |
1031 | 72 | self.License1Label.setObjectName("License1Label") | 70 | self.License1Label.setObjectName(u'License1Label') |
1032 | 73 | self.LicenseTabLayout.addWidget(self.License1Label) | 71 | self.LicenseTabLayout.addWidget(self.License1Label) |
1033 | 74 | self.License2Label = QtGui.QLabel(self.LicenseTab) | 72 | self.License2Label = QtGui.QLabel(self.LicenseTab) |
1034 | 75 | self.License2Label.setAlignment(QtCore.Qt.AlignJustify|QtCore.Qt.AlignVCenter) | 73 | self.License2Label.setAlignment(QtCore.Qt.AlignJustify|QtCore.Qt.AlignVCenter) |
1035 | 76 | self.License2Label.setWordWrap(True) | 74 | self.License2Label.setWordWrap(True) |
1037 | 77 | self.License2Label.setObjectName("License2Label") | 75 | self.License2Label.setObjectName(u'License2Label') |
1038 | 78 | self.LicenseTabLayout.addWidget(self.License2Label) | 76 | self.LicenseTabLayout.addWidget(self.License2Label) |
1039 | 79 | self.License3Label = QtGui.QLabel(self.LicenseTab) | 77 | self.License3Label = QtGui.QLabel(self.LicenseTab) |
1040 | 80 | self.License3Label.setAlignment(QtCore.Qt.AlignJustify|QtCore.Qt.AlignVCenter) | 78 | self.License3Label.setAlignment(QtCore.Qt.AlignJustify|QtCore.Qt.AlignVCenter) |
1041 | 81 | self.License3Label.setWordWrap(True) | 79 | self.License3Label.setWordWrap(True) |
1043 | 82 | self.License3Label.setObjectName("License3Label") | 80 | self.License3Label.setObjectName(u'License3Label') |
1044 | 83 | self.LicenseTabLayout.addWidget(self.License3Label) | 81 | self.LicenseTabLayout.addWidget(self.License3Label) |
1046 | 84 | self.AboutNotebook.addTab(self.LicenseTab, "License") | 82 | self.AboutNotebook.addTab(self.LicenseTab, u'License') |
1047 | 85 | self.CreditsTab = QtGui.QWidget() | 83 | self.CreditsTab = QtGui.QWidget() |
1049 | 86 | self.CreditsTab.setObjectName("CreditsTab") | 84 | self.CreditsTab.setObjectName(u'CreditsTab') |
1050 | 87 | self.CreditsTabLayout = QtGui.QVBoxLayout(self.CreditsTab) | 85 | self.CreditsTabLayout = QtGui.QVBoxLayout(self.CreditsTab) |
1051 | 88 | self.CreditsTabLayout.setSpacing(0) # | 86 | self.CreditsTabLayout.setSpacing(0) # |
1052 | 89 | self.CreditsTabLayout.setMargin(8) # | 87 | self.CreditsTabLayout.setMargin(8) # |
1054 | 90 | self.CreditsTabLayout.setObjectName("CreditsTabLayout") | 88 | self.CreditsTabLayout.setObjectName(u'CreditsTabLayout') |
1055 | 91 | self.CreditsTextEdit = QtGui.QTextEdit(self.CreditsTab) | 89 | self.CreditsTextEdit = QtGui.QTextEdit(self.CreditsTab) |
1056 | 92 | self.CreditsTextEdit.setReadOnly(True) | 90 | self.CreditsTextEdit.setReadOnly(True) |
1058 | 93 | self.CreditsTextEdit.setObjectName("CreditsTextEdit") | 91 | self.CreditsTextEdit.setObjectName(u'CreditsTextEdit') |
1059 | 94 | self.CreditsTabLayout.addWidget(self.CreditsTextEdit) | 92 | self.CreditsTabLayout.addWidget(self.CreditsTextEdit) |
1061 | 95 | self.AboutNotebook.addTab(self.CreditsTab, "Credits") | 93 | self.AboutNotebook.addTab(self.CreditsTab, u'Credits') |
1062 | 96 | AboutFormLayout.addWidget(self.AboutNotebook) | 94 | AboutFormLayout.addWidget(self.AboutNotebook) |
1063 | 97 | self.ButtonWidget = QtGui.QWidget(AboutForm) | 95 | self.ButtonWidget = QtGui.QWidget(AboutForm) |
1065 | 98 | self.ButtonWidget.setObjectName("ButtonWidget") | 96 | self.ButtonWidget.setObjectName(u'ButtonWidget') |
1066 | 99 | self.ButtonWidgetLayout = QtGui.QHBoxLayout(self.ButtonWidget) | 97 | self.ButtonWidgetLayout = QtGui.QHBoxLayout(self.ButtonWidget) |
1067 | 100 | self.ButtonWidgetLayout.setSpacing(8) | 98 | self.ButtonWidgetLayout.setSpacing(8) |
1068 | 101 | self.ButtonWidgetLayout.setMargin(0) | 99 | self.ButtonWidgetLayout.setMargin(0) |
1070 | 102 | self.ButtonWidgetLayout.setObjectName("ButtonWidgetLayout") | 100 | self.ButtonWidgetLayout.setObjectName(u'ButtonWidgetLayout') |
1071 | 103 | spacerItem = QtGui.QSpacerItem(275, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) | 101 | spacerItem = QtGui.QSpacerItem(275, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) |
1072 | 104 | self.ButtonWidgetLayout.addItem(spacerItem) | 102 | self.ButtonWidgetLayout.addItem(spacerItem) |
1073 | 105 | self.ContributeButton = QtGui.QPushButton(self.ButtonWidget) | 103 | self.ContributeButton = QtGui.QPushButton(self.ButtonWidget) |
1075 | 106 | self.ContributeButton.setObjectName("ContributeButton") | 104 | self.ContributeButton.setObjectName(u'ContributeButton') |
1076 | 107 | self.ButtonWidgetLayout.addWidget(self.ContributeButton) | 105 | self.ButtonWidgetLayout.addWidget(self.ContributeButton) |
1077 | 108 | self.CloseButton = QtGui.QPushButton(self.ButtonWidget) | 106 | self.CloseButton = QtGui.QPushButton(self.ButtonWidget) |
1079 | 109 | self.CloseButton.setObjectName("CloseButton") | 107 | self.CloseButton.setObjectName(u'CloseButton') |
1080 | 110 | self.ButtonWidgetLayout.addWidget(self.CloseButton) | 108 | self.ButtonWidgetLayout.addWidget(self.CloseButton) |
1081 | 111 | AboutFormLayout.addWidget(self.ButtonWidget) | 109 | AboutFormLayout.addWidget(self.ButtonWidget) |
1082 | 112 | self.extContributeItem = QtGui.QAction(AboutForm) | 110 | self.extContributeItem = QtGui.QAction(AboutForm) |
1084 | 113 | self.extContributeItem.setObjectName("extContributeItem") | 111 | self.extContributeItem.setObjectName(u'extContributeItem') |
1085 | 114 | 112 | ||
1086 | 115 | self.retranslateUi(AboutForm) | 113 | self.retranslateUi(AboutForm) |
1087 | 116 | self.AboutNotebook.setCurrentIndex(0) | 114 | self.AboutNotebook.setCurrentIndex(0) |
1089 | 117 | QtCore.QObject.connect(self.CloseButton, QtCore.SIGNAL("clicked()"), AboutForm.close) | 115 | QtCore.QObject.connect(self.CloseButton, QtCore.SIGNAL(u'clicked()'), AboutForm.close) |
1090 | 118 | QtCore.QMetaObject.connectSlotsByName(AboutForm) | 116 | QtCore.QMetaObject.connectSlotsByName(AboutForm) |
1091 | 119 | 117 | ||
1093 | 120 | QtCore.QObject.connect(self.ContributeButton, QtCore.SIGNAL("clicked()"), self.onContributeButtonClicked) | 118 | QtCore.QObject.connect(self.ContributeButton, QtCore.SIGNAL(u'clicked()'), self.onContributeButtonClicked) |
1094 | 121 | 119 | ||
1095 | 122 | def retranslateUi(self, AboutForm): | 120 | def retranslateUi(self, AboutForm): |
1117 | 123 | AboutForm.setWindowTitle(translate("AboutDialog", "About openlp.org",)) | 121 | AboutForm.setWindowTitle(translate(u'AboutDialog', u'About openlp.org',)) |
1118 | 124 | self.CopyrightLabel.setText(translate("AboutDialog", "Copyright © 2004-2009 openlp.org Foundation")) | 122 | self.CopyrightLabel.setText(translate(u'AboutDialog', u'Copyright © 2004-2009 openlp.org Foundation')) |
1119 | 125 | self.AboutAuthors.setText(translate("AboutDialog", "openlp.org is written and maintained by volunteers. If you would like to see more free Christian software being written, please consider contributing by using the button below.")) | 123 | self.AboutAuthors.setText(translate(u'AboutDialog', u'openlp.org is written and maintained by volunteers. If you would like to see more free Christian software being written, please consider contributing by using the button below.')) |
1120 | 126 | self.License1Label.setText(translate("AboutDialog", "This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.")) | 124 | self.License1Label.setText(translate(u'AboutDialog', u'This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.')) |
1121 | 127 | self.License2Label.setText(translate("AboutDialog", "You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.")) | 125 | self.License2Label.setText(translate(u'AboutDialog', u'You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.')) |
1122 | 128 | self.License3Label.setText(translate("AboutDialog", "This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.")) | 126 | self.License3Label.setText(translate(u'AboutDialog', u'This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.')) |
1123 | 129 | self.AboutNotebook.setTabText(self.AboutNotebook.indexOf(self.LicenseTab), QtGui.QApplication.translate("AboutDialog", "License", None, QtGui.QApplication.UnicodeUTF8)) | 127 | self.AboutNotebook.setTabText(self.AboutNotebook.indexOf(self.LicenseTab), translate(u'AboutDialog', u'License')) |
1124 | 130 | self.CreditsTextEdit.setPlainText(translate("AboutDialog", "Project Lead\n" | 128 | self.CreditsTextEdit.setPlainText(translate(u'AboutDialog', |
1125 | 131 | " Raoul \"superfly\" Snyman\n" | 129 | u'Project Lead\n' |
1126 | 132 | "\n" | 130 | u' Raoul \"superfly\" Snyman\n' |
1127 | 133 | "Developers\n" | 131 | u'\n' |
1128 | 134 | " Tim \"TRB143\" Bentley\n" | 132 | u'Developers\n' |
1129 | 135 | " Jonathan \"gushie\" Corwin\n" | 133 | u' Tim \"TRB143\" Bentley\n' |
1130 | 136 | " Scott \"sguerrieri\" Guerrieri\n" | 134 | u' Jonathan \"gushie\" Corwin\n' |
1131 | 137 | " Raoul \"superfly\" Snyman\n" | 135 | u' Scott \"sguerrieri\" Guerrieri\n' |
1132 | 138 | " Martin \"mijiti\" Thompson\n" | 136 | u' Raoul \"superfly\" Snyman\n' |
1133 | 139 | " Carsten \"catini\" Tingaard")) | 137 | u' Martin \"mijiti\" Thompson\n' |
1134 | 140 | self.AboutNotebook.setTabText(self.AboutNotebook.indexOf(self.CreditsTab), translate("AboutDialog", "Credits")) | 138 | u' Carsten \"catini\" Tingaard')) |
1135 | 141 | self.ContributeButton.setText(translate("AboutDialog", "Contribute")) | 139 | self.AboutNotebook.setTabText(self.AboutNotebook.indexOf(self.CreditsTab), translate(u'AboutDialog', u'Credits')) |
1136 | 142 | self.CloseButton.setText(translate("AboutDialog", "Close")) | 140 | self.ContributeButton.setText(translate(u'AboutDialog', u'Contribute')) |
1137 | 143 | self.extContributeItem.setText(translate("AboutDialog", "&Contribute")) | 141 | self.CloseButton.setText(translate(u'AboutDialog', u'Close')) |
1138 | 142 | self.extContributeItem.setText(translate(u'AboutDialog', u'&Contribute')) | ||
1139 | 144 | 143 | ||
1140 | 145 | def onContributeButtonClicked(self): | 144 | def onContributeButtonClicked(self): |
1141 | 146 | ''' This routine will open the default | ||
1142 | 147 | web-browser to the contribute page | ||
1143 | 148 | of openlp.org as did the original | ||
1144 | 149 | button on the About form | ||
1145 | 150 | ''' | ||
1146 | 151 | import webbrowser | 145 | import webbrowser |
1147 | 152 | url = "http://www.openlp.org/en/documentation/introduction/contributing.html" | 146 | url = "http://www.openlp.org/en/documentation/introduction/contributing.html" |
1148 | 153 | webbrowser.open_new(url) | 147 | webbrowser.open_new(url) |
1149 | 154 | 148 | ||
1150 | === modified file 'openlp/core/ui/alertform.py' | |||
1151 | --- openlp/core/ui/alertform.py 2009-05-01 22:26:43 +0000 | |||
1152 | +++ openlp/core/ui/alertform.py 2009-05-20 20:17:20 +0000 | |||
1153 | @@ -19,17 +19,14 @@ | |||
1154 | 19 | """ | 19 | """ |
1155 | 20 | import logging | 20 | import logging |
1156 | 21 | from PyQt4 import QtCore, QtGui | 21 | from PyQt4 import QtCore, QtGui |
1163 | 22 | from PyQt4.QtGui import QDialog | 22 | from openlp.core.lib import translate |
1164 | 23 | 23 | ||
1165 | 24 | from openlp.core import translate | 24 | class AlertForm(QtGui.QDialog): |
1160 | 25 | from openlp.core.resources import * | ||
1161 | 26 | |||
1162 | 27 | class AlertForm(QDialog): | ||
1166 | 28 | global log | 25 | global log |
1167 | 29 | log=logging.getLogger(u'AlertForm') | 26 | log=logging.getLogger(u'AlertForm') |
1168 | 30 | 27 | ||
1169 | 31 | def __init__(self, parent=None): | 28 | def __init__(self, parent=None): |
1171 | 32 | QDialog.__init__(self, parent) | 29 | QtGui.QDialog.__init__(self, parent) |
1172 | 33 | self.setupUi(self) | 30 | self.setupUi(self) |
1173 | 34 | log.info(u'Defined') | 31 | log.info(u'Defined') |
1174 | 35 | 32 | ||
1175 | 36 | 33 | ||
1176 | === modified file 'openlp/core/ui/alertstab.py' | |||
1177 | --- openlp/core/ui/alertstab.py 2009-03-05 20:31:17 +0000 | |||
1178 | +++ openlp/core/ui/alertstab.py 2009-05-20 20:17:20 +0000 | |||
1179 | @@ -19,11 +19,8 @@ | |||
1180 | 19 | """ | 19 | """ |
1181 | 20 | 20 | ||
1182 | 21 | from PyQt4 import QtCore, QtGui | 21 | from PyQt4 import QtCore, QtGui |
1183 | 22 | from PyQt4.QtGui import QColor, QFont | ||
1184 | 23 | 22 | ||
1188 | 24 | from openlp.core import translate | 23 | from openlp.core.lib import SettingsTab, translate |
1186 | 25 | from openlp.core.lib import SettingsTab | ||
1187 | 26 | from openlp.core.resources import * | ||
1189 | 27 | 24 | ||
1190 | 28 | class AlertsTab(SettingsTab): | 25 | class AlertsTab(SettingsTab): |
1191 | 29 | """ | 26 | """ |
1192 | @@ -175,7 +172,7 @@ | |||
1193 | 175 | self.timeout = int(self.config.get_config('timeout', 5)) | 172 | self.timeout = int(self.config.get_config('timeout', 5)) |
1194 | 176 | self.font_color = str(self.config.get_config('font color', u'#ffffff')) | 173 | self.font_color = str(self.config.get_config('font color', u'#ffffff')) |
1195 | 177 | self.bg_color = str(self.config.get_config('background color', u'#660000')) | 174 | self.bg_color = str(self.config.get_config('background color', u'#660000')) |
1197 | 178 | self.font_face = str(self.config.get_config('font face', QFont().family())) | 175 | self.font_face = str(self.config.get_config('font face', QtGui.QFont().family())) |
1198 | 179 | self.TimeoutSpinBox.setValue(self.timeout) | 176 | self.TimeoutSpinBox.setValue(self.timeout) |
1199 | 180 | self.FontColorButton.setStyleSheet('background-color: %s' % self.font_color) | 177 | self.FontColorButton.setStyleSheet('background-color: %s' % self.font_color) |
1200 | 181 | self.BackgroundColorButton.setStyleSheet('background-color: %s' % self.bg_color) | 178 | self.BackgroundColorButton.setStyleSheet('background-color: %s' % self.bg_color) |
1201 | @@ -192,7 +189,7 @@ | |||
1202 | 192 | self.config.set_config('timeout', str(self.timeout)) | 189 | self.config.set_config('timeout', str(self.timeout)) |
1203 | 193 | 190 | ||
1204 | 194 | def updateDisplay(self): | 191 | def updateDisplay(self): |
1206 | 195 | font = QFont() | 192 | font = QtGui.QFont() |
1207 | 196 | font.setFamily(self.FontComboBox.currentFont().family()) | 193 | font.setFamily(self.FontComboBox.currentFont().family()) |
1208 | 197 | font.setBold(True) | 194 | font.setBold(True) |
1209 | 198 | font.setPointSize(16) | 195 | font.setPointSize(16) |
1210 | 199 | 196 | ||
1211 | === modified file 'openlp/core/ui/amendthemedialog.py' | |||
1212 | --- openlp/core/ui/amendthemedialog.py 2009-05-01 22:26:43 +0000 | |||
1213 | +++ openlp/core/ui/amendthemedialog.py 2009-05-22 18:30:25 +0000 | |||
1214 | @@ -456,7 +456,7 @@ | |||
1215 | 456 | self.ThemePreviewLayout.setSpacing(8) | 456 | self.ThemePreviewLayout.setSpacing(8) |
1216 | 457 | self.ThemePreviewLayout.setMargin(8) | 457 | self.ThemePreviewLayout.setMargin(8) |
1217 | 458 | self.ThemePreviewLayout.setObjectName("ThemePreviewLayout") | 458 | self.ThemePreviewLayout.setObjectName("ThemePreviewLayout") |
1219 | 459 | spacerItem7 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) | 459 | spacerItem7 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding) |
1220 | 460 | self.ThemePreviewLayout.addItem(spacerItem7) | 460 | self.ThemePreviewLayout.addItem(spacerItem7) |
1221 | 461 | self.ThemePreview = QtGui.QLabel(self.PreviewGroupBox) | 461 | self.ThemePreview = QtGui.QLabel(self.PreviewGroupBox) |
1222 | 462 | sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed) | 462 | sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed) |
1223 | @@ -464,14 +464,14 @@ | |||
1224 | 464 | sizePolicy.setVerticalStretch(0) | 464 | sizePolicy.setVerticalStretch(0) |
1225 | 465 | sizePolicy.setHeightForWidth(self.ThemePreview.sizePolicy().hasHeightForWidth()) | 465 | sizePolicy.setHeightForWidth(self.ThemePreview.sizePolicy().hasHeightForWidth()) |
1226 | 466 | self.ThemePreview.setSizePolicy(sizePolicy) | 466 | self.ThemePreview.setSizePolicy(sizePolicy) |
1228 | 467 | self.ThemePreview.setMinimumSize(QtCore.QSize(300, 225)) | 467 | self.ThemePreview.setMaximumSize(QtCore.QSize(300, 225)) |
1229 | 468 | self.ThemePreview.setFrameShape(QtGui.QFrame.WinPanel) | 468 | self.ThemePreview.setFrameShape(QtGui.QFrame.WinPanel) |
1230 | 469 | self.ThemePreview.setFrameShadow(QtGui.QFrame.Sunken) | 469 | self.ThemePreview.setFrameShadow(QtGui.QFrame.Sunken) |
1231 | 470 | self.ThemePreview.setLineWidth(1) | 470 | self.ThemePreview.setLineWidth(1) |
1232 | 471 | self.ThemePreview.setScaledContents(True) | 471 | self.ThemePreview.setScaledContents(True) |
1233 | 472 | self.ThemePreview.setObjectName("ThemePreview") | 472 | self.ThemePreview.setObjectName("ThemePreview") |
1234 | 473 | self.ThemePreviewLayout.addWidget(self.ThemePreview) | 473 | self.ThemePreviewLayout.addWidget(self.ThemePreview) |
1236 | 474 | spacerItem8 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) | 474 | spacerItem8 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding) |
1237 | 475 | self.ThemePreviewLayout.addItem(spacerItem8) | 475 | self.ThemePreviewLayout.addItem(spacerItem8) |
1238 | 476 | self.AmendThemeLayout.addWidget(self.PreviewGroupBox) | 476 | self.AmendThemeLayout.addWidget(self.PreviewGroupBox) |
1239 | 477 | self.ThemeButtonBox = QtGui.QDialogButtonBox(AmendThemeDialog) | 477 | self.ThemeButtonBox = QtGui.QDialogButtonBox(AmendThemeDialog) |
1240 | @@ -517,7 +517,7 @@ | |||
1241 | 517 | AmendThemeDialog.setTabOrder(self.HorizontalComboBox, self.VerticalComboBox) | 517 | AmendThemeDialog.setTabOrder(self.HorizontalComboBox, self.VerticalComboBox) |
1242 | 518 | 518 | ||
1243 | 519 | def retranslateUi(self, AmendThemeDialog): | 519 | def retranslateUi(self, AmendThemeDialog): |
1245 | 520 | AmendThemeDialog.setWindowTitle(QtGui.QApplication.translate("AmendThemeDialog", "Theme Maintance", None, QtGui.QApplication.UnicodeUTF8)) | 520 | AmendThemeDialog.setWindowTitle(QtGui.QApplication.translate("AmendThemeDialog", "Theme Maintenance", None, QtGui.QApplication.UnicodeUTF8)) |
1246 | 521 | self.ThemeNameLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Theme Name:", None, QtGui.QApplication.UnicodeUTF8)) | 521 | self.ThemeNameLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Theme Name:", None, QtGui.QApplication.UnicodeUTF8)) |
1247 | 522 | self.BackgroundLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Background:", None, QtGui.QApplication.UnicodeUTF8)) | 522 | self.BackgroundLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Background:", None, QtGui.QApplication.UnicodeUTF8)) |
1248 | 523 | self.BackgroundComboBox.setItemText(0, QtGui.QApplication.translate("AmendThemeDialog", "Opaque", None, QtGui.QApplication.UnicodeUTF8)) | 523 | self.BackgroundComboBox.setItemText(0, QtGui.QApplication.translate("AmendThemeDialog", "Opaque", None, QtGui.QApplication.UnicodeUTF8)) |
1249 | 524 | 524 | ||
1250 | === modified file 'openlp/core/ui/amendthemeform.py' | |||
1251 | --- openlp/core/ui/amendthemeform.py 2009-05-16 19:47:30 +0000 | |||
1252 | +++ openlp/core/ui/amendthemeform.py 2009-05-22 05:14:55 +0000 | |||
1253 | @@ -21,9 +21,7 @@ | |||
1254 | 21 | import os, os.path | 21 | import os, os.path |
1255 | 22 | 22 | ||
1256 | 23 | from PyQt4 import QtCore, QtGui | 23 | from PyQt4 import QtCore, QtGui |
1260 | 24 | from PyQt4.QtGui import QColor, QFont | 24 | from openlp.core.lib import ThemeXML, Renderer, file_to_xml, translate |
1258 | 25 | from openlp.core.lib import ThemeXML, Renderer | ||
1259 | 26 | from openlp.core import fileToXML, translate | ||
1261 | 27 | 25 | ||
1262 | 28 | from amendthemedialog import Ui_AmendThemeDialog | 26 | from amendthemedialog import Ui_AmendThemeDialog |
1263 | 29 | 27 | ||
1264 | @@ -34,7 +32,9 @@ | |||
1265 | 34 | def __init__(self, thememanager, parent=None): | 32 | def __init__(self, thememanager, parent=None): |
1266 | 35 | QtGui.QDialog.__init__(self, parent) | 33 | QtGui.QDialog.__init__(self, parent) |
1267 | 36 | self.thememanager = thememanager | 34 | self.thememanager = thememanager |
1269 | 37 | self.theme = ThemeXML() # Needed here as UI setup generates Events | 35 | # Needed here as UI setup generates Events |
1270 | 36 | self.path = None | ||
1271 | 37 | self.theme = ThemeXML() | ||
1272 | 38 | self.setupUi(self) | 38 | self.setupUi(self) |
1273 | 39 | 39 | ||
1274 | 40 | #define signals | 40 | #define signals |
1275 | @@ -113,15 +113,15 @@ | |||
1276 | 113 | else: | 113 | else: |
1277 | 114 | (path, filename) =os.path.split(str(self.theme.background_filename)) | 114 | (path, filename) =os.path.split(str(self.theme.background_filename)) |
1278 | 115 | new_theme.add_background_image(filename) | 115 | new_theme.add_background_image(filename) |
1280 | 116 | save_to= os.path.join(self.path, theme_name,filename ) | 116 | save_to= os.path.join(self.path, theme_name, filename ) |
1281 | 117 | save_from = self.theme.background_filename | 117 | save_from = self.theme.background_filename |
1282 | 118 | 118 | ||
1283 | 119 | new_theme.add_font(str(self.theme.font_main_name), str(self.theme.font_main_color), | 119 | new_theme.add_font(str(self.theme.font_main_name), str(self.theme.font_main_color), |
1285 | 120 | str(self.theme.font_main_proportion), str(self.theme.font_main_override),u'main', | 120 | str(self.theme.font_main_proportion), str(self.theme.font_main_override), u'main', |
1286 | 121 | str(self.theme.font_main_x), str(self.theme.font_main_y), str(self.theme.font_main_width), | 121 | str(self.theme.font_main_x), str(self.theme.font_main_y), str(self.theme.font_main_width), |
1287 | 122 | str(self.theme.font_main_height)) | 122 | str(self.theme.font_main_height)) |
1288 | 123 | new_theme.add_font(str(self.theme.font_footer_name), str(self.theme.font_footer_color), | 123 | new_theme.add_font(str(self.theme.font_footer_name), str(self.theme.font_footer_color), |
1290 | 124 | str(self.theme.font_footer_proportion), str(self.theme.font_footer_override),u'footer', | 124 | str(self.theme.font_footer_proportion), str(self.theme.font_footer_override), u'footer', |
1291 | 125 | str(self.theme.font_footer_x), str(self.theme.font_footer_y), str(self.theme.font_footer_width), | 125 | str(self.theme.font_footer_x), str(self.theme.font_footer_y), str(self.theme.font_footer_width), |
1292 | 126 | str(self.theme.font_footer_height) ) | 126 | str(self.theme.font_footer_height) ) |
1293 | 127 | new_theme.add_display(str(self.theme.display_shadow), str(self.theme.display_shadow_color), | 127 | new_theme.add_display(str(self.theme.display_shadow), str(self.theme.display_shadow_color), |
1294 | @@ -134,17 +134,15 @@ | |||
1295 | 134 | self.thememanager.saveTheme(theme_name, theme, save_from, save_to) | 134 | self.thememanager.saveTheme(theme_name, theme, save_from, save_to) |
1296 | 135 | return QtGui.QDialog.accept(self) | 135 | return QtGui.QDialog.accept(self) |
1297 | 136 | 136 | ||
1298 | 137 | def themePath(self, path): | ||
1299 | 138 | self.path = path | ||
1300 | 139 | |||
1301 | 140 | def loadTheme(self, theme): | 137 | def loadTheme(self, theme): |
1303 | 141 | log.debug(u'LoadTheme %s ', theme) | 138 | log.debug(u'LoadTheme %s', theme) |
1304 | 142 | if theme == None: | 139 | if theme == None: |
1305 | 143 | self.theme.parse(self.baseTheme()) | 140 | self.theme.parse(self.baseTheme()) |
1306 | 144 | else: | 141 | else: |
1309 | 145 | xml_file = os.path.join(self.path, theme, theme+u'.xml') | 142 | xml_file = os.path.join(self.path, theme, theme + u'.xml') |
1310 | 146 | xml = fileToXML(xml_file) | 143 | xml = file_to_xml(xml_file) |
1311 | 147 | self.theme.parse(xml) | 144 | self.theme.parse(xml) |
1312 | 145 | self.theme.extend_image_filename(self.path) | ||
1313 | 148 | self.allowPreview = False | 146 | self.allowPreview = False |
1314 | 149 | self.paintUi(self.theme) | 147 | self.paintUi(self.theme) |
1315 | 150 | self.allowPreview = True | 148 | self.allowPreview = True |
1316 | @@ -165,10 +163,10 @@ | |||
1317 | 165 | 163 | ||
1318 | 166 | def onFontMainColorPushButtonClicked(self): | 164 | def onFontMainColorPushButtonClicked(self): |
1319 | 167 | self.theme.font_main_color = QtGui.QColorDialog.getColor( | 165 | self.theme.font_main_color = QtGui.QColorDialog.getColor( |
1321 | 168 | QColor(self.theme.font_main_color), self).name() | 166 | QtGui.QColor(self.theme.font_main_color), self).name() |
1322 | 169 | 167 | ||
1323 | 170 | self.FontMainColorPushButton.setStyleSheet( | 168 | self.FontMainColorPushButton.setStyleSheet( |
1325 | 171 | 'background-color: %s' % str(self.theme.font_main_color)) | 169 | u'background-color: %s' % str(self.theme.font_main_color)) |
1326 | 172 | self.previewTheme(self.theme) | 170 | self.previewTheme(self.theme) |
1327 | 173 | 171 | ||
1328 | 174 | def onFontMainSizeSpinBoxChanged(self, value): | 172 | def onFontMainSizeSpinBoxChanged(self, value): |
1329 | @@ -218,7 +216,7 @@ | |||
1330 | 218 | 216 | ||
1331 | 219 | def onFontFooterColorPushButtonClicked(self): | 217 | def onFontFooterColorPushButtonClicked(self): |
1332 | 220 | self.theme.font_footer_color = QtGui.QColorDialog.getColor( | 218 | self.theme.font_footer_color = QtGui.QColorDialog.getColor( |
1334 | 221 | QColor(self.theme.font_footer_color), self).name() | 219 | QtGui.QColor(self.theme.font_footer_color), self).name() |
1335 | 222 | 220 | ||
1336 | 223 | self.FontFooterColorPushButton.setStyleSheet( | 221 | self.FontFooterColorPushButton.setStyleSheet( |
1337 | 224 | 'background-color: %s' % str(self.theme.font_footer_color)) | 222 | 'background-color: %s' % str(self.theme.font_footer_color)) |
1338 | @@ -307,22 +305,22 @@ | |||
1339 | 307 | def onColor1PushButtonClicked(self): | 305 | def onColor1PushButtonClicked(self): |
1340 | 308 | if self.theme.background_type == u'solid': | 306 | if self.theme.background_type == u'solid': |
1341 | 309 | self.theme.background_color = QtGui.QColorDialog.getColor( | 307 | self.theme.background_color = QtGui.QColorDialog.getColor( |
1343 | 310 | QColor(self.theme.background_color), self).name() | 308 | QtGui.QColor(self.theme.background_color), self).name() |
1344 | 311 | self.Color1PushButton.setStyleSheet( | 309 | self.Color1PushButton.setStyleSheet( |
1346 | 312 | 'background-color: %s' % str(self.theme.background_color)) | 310 | u'background-color: %s' % str(self.theme.background_color)) |
1347 | 313 | else: | 311 | else: |
1348 | 314 | self.theme.background_startColor = QtGui.QColorDialog.getColor( | 312 | self.theme.background_startColor = QtGui.QColorDialog.getColor( |
1350 | 315 | QColor(self.theme.background_startColor), self).name() | 313 | QtGui.QColor(self.theme.background_startColor), self).name() |
1351 | 316 | self.Color1PushButton.setStyleSheet( | 314 | self.Color1PushButton.setStyleSheet( |
1353 | 317 | 'background-color: %s' % str(self.theme.background_startColor)) | 315 | u'background-color: %s' % str(self.theme.background_startColor)) |
1354 | 318 | 316 | ||
1355 | 319 | self.previewTheme(self.theme) | 317 | self.previewTheme(self.theme) |
1356 | 320 | 318 | ||
1357 | 321 | def onColor2PushButtonClicked(self): | 319 | def onColor2PushButtonClicked(self): |
1358 | 322 | self.theme.background_endColor = QtGui.QColorDialog.getColor( | 320 | self.theme.background_endColor = QtGui.QColorDialog.getColor( |
1360 | 323 | QColor(self.theme.background_endColor), self).name() | 321 | QtGui.QColor(self.theme.background_endColor), self).name() |
1361 | 324 | self.Color2PushButton.setStyleSheet( | 322 | self.Color2PushButton.setStyleSheet( |
1363 | 325 | 'background-color: %s' % str(self.theme.background_endColor)) | 323 | u'background-color: %s' % str(self.theme.background_endColor)) |
1364 | 326 | 324 | ||
1365 | 327 | self.previewTheme(self.theme) | 325 | self.previewTheme(self.theme) |
1366 | 328 | # | 326 | # |
1367 | @@ -338,9 +336,9 @@ | |||
1368 | 338 | 336 | ||
1369 | 339 | def onOutlineColorPushButtonClicked(self): | 337 | def onOutlineColorPushButtonClicked(self): |
1370 | 340 | self.theme.display_outline_color = QtGui.QColorDialog.getColor( | 338 | self.theme.display_outline_color = QtGui.QColorDialog.getColor( |
1372 | 341 | QColor(self.theme.display_outline_color), self).name() | 339 | QtGui.QColor(self.theme.display_outline_color), self).name() |
1373 | 342 | self.OutlineColorPushButton.setStyleSheet( | 340 | self.OutlineColorPushButton.setStyleSheet( |
1375 | 343 | 'background-color: %s' % str(self.theme.display_outline_color)) | 341 | u'background-color: %s' % str(self.theme.display_outline_color)) |
1376 | 344 | self.previewTheme(self.theme) | 342 | self.previewTheme(self.theme) |
1377 | 345 | 343 | ||
1378 | 346 | def onShadowCheckBoxChanged(self, value): | 344 | def onShadowCheckBoxChanged(self, value): |
1379 | @@ -353,9 +351,9 @@ | |||
1380 | 353 | 351 | ||
1381 | 354 | def onShadowColorPushButtonClicked(self): | 352 | def onShadowColorPushButtonClicked(self): |
1382 | 355 | self.theme.display_shadow_color = QtGui.QColorDialog.getColor( | 353 | self.theme.display_shadow_color = QtGui.QColorDialog.getColor( |
1384 | 356 | QColor(self.theme.display_shadow_color), self).name() | 354 | QtGui.QColor(self.theme.display_shadow_color), self).name() |
1385 | 357 | self.ShadowColorPushButton.setStyleSheet( | 355 | self.ShadowColorPushButton.setStyleSheet( |
1387 | 358 | 'background-color: %s' % str(self.theme.display_shadow_color)) | 356 | u'background-color: %s' % str(self.theme.display_shadow_color)) |
1388 | 359 | self.previewTheme(self.theme) | 357 | self.previewTheme(self.theme) |
1389 | 360 | 358 | ||
1390 | 361 | def onHorizontalComboBoxSelected(self, currentIndex): | 359 | def onHorizontalComboBoxSelected(self, currentIndex): |
1391 | @@ -375,8 +373,8 @@ | |||
1392 | 375 | newtheme = ThemeXML() | 373 | newtheme = ThemeXML() |
1393 | 376 | newtheme.new_document(u'New Theme') | 374 | newtheme.new_document(u'New Theme') |
1394 | 377 | newtheme.add_background_solid(str(u'#000000')) | 375 | newtheme.add_background_solid(str(u'#000000')) |
1397 | 378 | newtheme.add_font(str(QFont().family()), str(u'#FFFFFF'), str(30), u'False') | 376 | newtheme.add_font(str(QtGui.QFont().family()), str(u'#FFFFFF'), str(30), u'False') |
1398 | 379 | newtheme.add_font(str(QFont().family()), str(u'#FFFFFF'), str(12), u'False', u'footer') | 377 | newtheme.add_font(str(QtGui.QFont().family()), str(u'#FFFFFF'), str(12), u'False', u'footer') |
1399 | 380 | newtheme.add_display(u'False', str(u'#FFFFFF'), u'False', str(u'#FFFFFF'), | 378 | newtheme.add_display(u'False', str(u'#FFFFFF'), u'False', str(u'#FFFFFF'), |
1400 | 381 | str(0), str(0), str(0)) | 379 | str(0), str(0), str(0)) |
1401 | 382 | 380 | ||
1402 | @@ -415,9 +413,9 @@ | |||
1403 | 415 | self.FontFooterWidthSpinBox.setValue(int(self.theme.font_footer_width)) | 413 | self.FontFooterWidthSpinBox.setValue(int(self.theme.font_footer_width)) |
1404 | 416 | self.FontFooterHeightSpinBox.setValue(int(self.theme.font_footer_height)) | 414 | self.FontFooterHeightSpinBox.setValue(int(self.theme.font_footer_height)) |
1405 | 417 | self.FontMainColorPushButton.setStyleSheet( | 415 | self.FontMainColorPushButton.setStyleSheet( |
1407 | 418 | 'background-color: %s' % str(theme.font_main_color)) | 416 | u'background-color: %s' % str(theme.font_main_color)) |
1408 | 419 | self.FontFooterColorPushButton.setStyleSheet( | 417 | self.FontFooterColorPushButton.setStyleSheet( |
1410 | 420 | 'background-color: %s' % str(theme.font_footer_color)) | 418 | u'background-color: %s' % str(theme.font_footer_color)) |
1411 | 421 | 419 | ||
1412 | 422 | if self.theme.font_main_override == False: | 420 | if self.theme.font_main_override == False: |
1413 | 423 | self.FontMainDefaultCheckBox.setChecked(True) | 421 | self.FontMainDefaultCheckBox.setChecked(True) |
1414 | @@ -430,9 +428,9 @@ | |||
1415 | 430 | self.FontFooterDefaultCheckBox.setChecked(False) | 428 | self.FontFooterDefaultCheckBox.setChecked(False) |
1416 | 431 | 429 | ||
1417 | 432 | self.OutlineColorPushButton.setStyleSheet( | 430 | self.OutlineColorPushButton.setStyleSheet( |
1419 | 433 | 'background-color: %s' % str(theme.display_outline_color)) | 431 | u'background-color: %s' % str(theme.display_outline_color)) |
1420 | 434 | self.ShadowColorPushButton.setStyleSheet( | 432 | self.ShadowColorPushButton.setStyleSheet( |
1422 | 435 | 'background-color: %s' % str(theme.display_shadow_color)) | 433 | u'background-color: %s' % str(theme.display_shadow_color)) |
1423 | 436 | 434 | ||
1424 | 437 | if self.theme.display_outline: | 435 | if self.theme.display_outline: |
1425 | 438 | self.OutlineCheckBox.setChecked(True) | 436 | self.OutlineCheckBox.setChecked(True) |
1426 | @@ -454,7 +452,7 @@ | |||
1427 | 454 | def stateChanging(self, theme): | 452 | def stateChanging(self, theme): |
1428 | 455 | if theme.background_type == u'solid': | 453 | if theme.background_type == u'solid': |
1429 | 456 | self.Color1PushButton.setStyleSheet( | 454 | self.Color1PushButton.setStyleSheet( |
1431 | 457 | 'background-color: %s' % str(theme.background_color)) | 455 | u'background-color: %s' % str(theme.background_color)) |
1432 | 458 | self.Color1Label.setText(translate(u'ThemeManager', u'Background Color:')) | 456 | self.Color1Label.setText(translate(u'ThemeManager', u'Background Color:')) |
1433 | 459 | self.Color1Label.setVisible(True) | 457 | self.Color1Label.setVisible(True) |
1434 | 460 | self.Color1PushButton.setVisible(True) | 458 | self.Color1PushButton.setVisible(True) |
1435 | @@ -467,9 +465,9 @@ | |||
1436 | 467 | self.GradientComboBox.setVisible(False) | 465 | self.GradientComboBox.setVisible(False) |
1437 | 468 | elif theme.background_type == u'gradient': | 466 | elif theme.background_type == u'gradient': |
1438 | 469 | self.Color1PushButton.setStyleSheet( | 467 | self.Color1PushButton.setStyleSheet( |
1440 | 470 | 'background-color: %s' % str(theme.background_startColor)) | 468 | u'background-color: %s' % str(theme.background_startColor)) |
1441 | 471 | self.Color2PushButton.setStyleSheet( | 469 | self.Color2PushButton.setStyleSheet( |
1443 | 472 | 'background-color: %s' % str(theme.background_endColor)) | 470 | u'background-color: %s' % str(theme.background_endColor)) |
1444 | 473 | self.Color1Label.setText(translate(u'ThemeManager', u'First Color:')) | 471 | self.Color1Label.setText(translate(u'ThemeManager', u'First Color:')) |
1445 | 474 | self.Color2Label.setText(translate(u'ThemeManager', u'Second Color:')) | 472 | self.Color2Label.setText(translate(u'ThemeManager', u'Second Color:')) |
1446 | 475 | self.Color1Label.setVisible(True) | 473 | self.Color1Label.setVisible(True) |
1447 | 476 | 474 | ||
1448 | === modified file 'openlp/core/ui/generaltab.py' | |||
1449 | --- openlp/core/ui/generaltab.py 2009-05-01 11:50:09 +0000 | |||
1450 | +++ openlp/core/ui/generaltab.py 2009-05-20 20:17:20 +0000 | |||
1451 | @@ -20,9 +20,7 @@ | |||
1452 | 20 | 20 | ||
1453 | 21 | from PyQt4 import QtCore, QtGui | 21 | from PyQt4 import QtCore, QtGui |
1454 | 22 | 22 | ||
1458 | 23 | from openlp.core import translate | 23 | from openlp.core.lib import SettingsTab, translate |
1456 | 24 | from openlp.core.lib import SettingsTab | ||
1457 | 25 | from openlp.core.resources import * | ||
1459 | 26 | 24 | ||
1460 | 27 | class GeneralTab(SettingsTab): | 25 | class GeneralTab(SettingsTab): |
1461 | 28 | """ | 26 | """ |
1462 | 29 | 27 | ||
1463 | === modified file 'openlp/core/ui/maindisplay.py' | |||
1464 | --- openlp/core/ui/maindisplay.py 2009-05-18 19:04:25 +0000 | |||
1465 | +++ openlp/core/ui/maindisplay.py 2009-05-20 20:17:20 +0000 | |||
1466 | @@ -20,7 +20,7 @@ | |||
1467 | 20 | 20 | ||
1468 | 21 | from PyQt4 import QtCore, QtGui | 21 | from PyQt4 import QtCore, QtGui |
1469 | 22 | 22 | ||
1471 | 23 | from openlp.core import translate | 23 | from openlp.core.lib import translate |
1472 | 24 | 24 | ||
1473 | 25 | class MainDisplay(QtGui.QWidget): | 25 | class MainDisplay(QtGui.QWidget): |
1474 | 26 | 26 | ||
1475 | 27 | 27 | ||
1476 | === modified file 'openlp/core/ui/mainwindow.py' | |||
1477 | --- openlp/core/ui/mainwindow.py 2009-05-18 19:04:25 +0000 | |||
1478 | +++ openlp/core/ui/mainwindow.py 2009-05-20 20:17:20 +0000 | |||
1479 | @@ -21,29 +21,28 @@ | |||
1480 | 21 | import logging | 21 | import logging |
1481 | 22 | from time import sleep | 22 | from time import sleep |
1482 | 23 | 23 | ||
1483 | 24 | from PyQt4 import * | ||
1484 | 25 | from PyQt4 import QtCore, QtGui | 24 | from PyQt4 import QtCore, QtGui |
1485 | 26 | 25 | ||
1486 | 27 | from openlp.core.ui import AboutForm, SettingsForm, AlertForm, \ | 26 | from openlp.core.ui import AboutForm, SettingsForm, AlertForm, \ |
1487 | 28 | SlideController, ServiceManager, ThemeManager, MainDisplay | 27 | SlideController, ServiceManager, ThemeManager, MainDisplay |
1489 | 29 | from openlp.core.lib import Plugin, MediaManagerItem, SettingsTab, EventManager, RenderManager | 28 | from openlp.core.lib import Plugin, MediaManagerItem, SettingsTab, EventManager, RenderManager, translate |
1490 | 30 | 29 | ||
1492 | 31 | from openlp.core import PluginManager, translate | 30 | from openlp.core import PluginManager |
1493 | 32 | 31 | ||
1494 | 33 | class MainWindow(object): | 32 | class MainWindow(object): |
1495 | 34 | global log | 33 | global log |
1497 | 35 | log=logging.getLogger(u'MainWindow') | 34 | log = logging.getLogger(u'MainWindow') |
1498 | 36 | log.info(u'MainWindow loaded') | 35 | log.info(u'MainWindow loaded') |
1499 | 37 | 36 | ||
1500 | 38 | def __init__(self, screens): | 37 | def __init__(self, screens): |
1505 | 39 | self.main_window = QtGui.QMainWindow() | 38 | self.mainWindow = QtGui.QMainWindow() |
1506 | 40 | self.main_window.__class__.closeEvent = self.onCloseEvent | 39 | self.mainWindow.__class__.closeEvent = self.onCloseEvent |
1507 | 41 | self.main_display = MainDisplay(None, screens) | 40 | self.mainDisplay = MainDisplay(None, screens) |
1508 | 42 | self.screen_list = screens | 41 | self.screenList = screens |
1509 | 43 | self.EventManager = EventManager() | 42 | self.EventManager = EventManager() |
1513 | 44 | self.alert_form = AlertForm() | 43 | self.alertForm = AlertForm() |
1514 | 45 | self.about_form = AboutForm() | 44 | self.aboutForm = AboutForm() |
1515 | 46 | self.settings_form = SettingsForm(self.screen_list, self) | 45 | self.settingsForm = SettingsForm(self.screenList, self) |
1516 | 47 | 46 | ||
1517 | 48 | pluginpath = os.path.split(os.path.abspath(__file__))[0] | 47 | pluginpath = os.path.split(os.path.abspath(__file__))[0] |
1518 | 49 | pluginpath = os.path.abspath(os.path.join(pluginpath, u'..', u'..', u'plugins')) | 48 | pluginpath = os.path.abspath(os.path.join(pluginpath, u'..', u'..', u'plugins')) |
1519 | @@ -55,7 +54,7 @@ | |||
1520 | 55 | #warning cyclic dependency | 54 | #warning cyclic dependency |
1521 | 56 | #RenderManager needs to call ThemeManager and | 55 | #RenderManager needs to call ThemeManager and |
1522 | 57 | #ThemeManager needs to call RenderManager | 56 | #ThemeManager needs to call RenderManager |
1524 | 58 | self.RenderManager = RenderManager(self.ThemeManagerContents, self.screen_list) | 57 | self.RenderManager = RenderManager(self.ThemeManagerContents, self.screenList) |
1525 | 59 | 58 | ||
1526 | 60 | log.info(u'Load Plugins') | 59 | log.info(u'Load Plugins') |
1527 | 61 | self.plugin_helpers[u'preview'] = self.PreviewController | 60 | self.plugin_helpers[u'preview'] = self.PreviewController |
1528 | @@ -75,7 +74,7 @@ | |||
1529 | 75 | 74 | ||
1530 | 76 | # Find and insert settings tabs | 75 | # Find and insert settings tabs |
1531 | 77 | log.info(u'hook settings') | 76 | log.info(u'hook settings') |
1533 | 78 | self.plugin_manager.hook_settings_tabs(self.settings_form) | 77 | self.plugin_manager.hook_settings_tabs(self.settingsForm) |
1534 | 79 | 78 | ||
1535 | 80 | # Call the hook method to pull in import menus. | 79 | # Call the hook method to pull in import menus. |
1536 | 81 | log.info(u'hook menus') | 80 | log.info(u'hook menus') |
1537 | @@ -107,29 +106,29 @@ | |||
1538 | 107 | 106 | ||
1539 | 108 | # Initialise SlideControllers | 107 | # Initialise SlideControllers |
1540 | 109 | log.info(u'Set Up SlideControllers') | 108 | log.info(u'Set Up SlideControllers') |
1542 | 110 | self.LiveController.mainDisplay = self.main_display | 109 | self.LiveController.mainDisplay = self.mainDisplay |
1543 | 111 | 110 | ||
1544 | 112 | def onCloseEvent(self, event): | 111 | def onCloseEvent(self, event): |
1545 | 113 | """ | 112 | """ |
1546 | 114 | Hook to close the main window and display windows on exit | 113 | Hook to close the main window and display windows on exit |
1547 | 115 | """ | 114 | """ |
1549 | 116 | self.main_display.close() | 115 | self.mainDisplay.close() |
1550 | 117 | event.accept() | 116 | event.accept() |
1551 | 118 | 117 | ||
1552 | 119 | def setupUi(self): | 118 | def setupUi(self): |
1555 | 120 | self.main_window.setObjectName(u'main_window') | 119 | self.mainWindow.setObjectName(u'mainWindow') |
1556 | 121 | self.main_window.resize(1087, 847) | 120 | self.mainWindow.resize(1087, 847) |
1557 | 122 | sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, | 121 | sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, |
1558 | 123 | QtGui.QSizePolicy.Expanding) | 122 | QtGui.QSizePolicy.Expanding) |
1559 | 124 | sizePolicy.setHorizontalStretch(0) | 123 | sizePolicy.setHorizontalStretch(0) |
1560 | 125 | sizePolicy.setVerticalStretch(0) | 124 | sizePolicy.setVerticalStretch(0) |
1563 | 126 | sizePolicy.setHeightForWidth(self.main_window.sizePolicy().hasHeightForWidth()) | 125 | sizePolicy.setHeightForWidth(self.mainWindow.sizePolicy().hasHeightForWidth()) |
1564 | 127 | self.main_window.setSizePolicy(sizePolicy) | 126 | self.mainWindow.setSizePolicy(sizePolicy) |
1565 | 128 | main_icon = QtGui.QIcon() | 127 | main_icon = QtGui.QIcon() |
1566 | 129 | main_icon.addPixmap(QtGui.QPixmap(u':/icon/openlp-logo-16x16.png'), | 128 | main_icon.addPixmap(QtGui.QPixmap(u':/icon/openlp-logo-16x16.png'), |
1567 | 130 | QtGui.QIcon.Normal, QtGui.QIcon.Off) | 129 | QtGui.QIcon.Normal, QtGui.QIcon.Off) |
1570 | 131 | self.main_window.setWindowIcon(main_icon) | 130 | self.mainWindow.setWindowIcon(main_icon) |
1571 | 132 | self.MainContent = QtGui.QWidget(self.main_window) | 131 | self.MainContent = QtGui.QWidget(self.mainWindow) |
1572 | 133 | sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding) | 132 | sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding) |
1573 | 134 | sizePolicy.setHorizontalStretch(0) | 133 | sizePolicy.setHorizontalStretch(0) |
1574 | 135 | sizePolicy.setVerticalStretch(0) | 134 | sizePolicy.setVerticalStretch(0) |
1575 | @@ -140,14 +139,14 @@ | |||
1576 | 140 | self.MainContentLayout.setSpacing(0) | 139 | self.MainContentLayout.setSpacing(0) |
1577 | 141 | self.MainContentLayout.setMargin(0) | 140 | self.MainContentLayout.setMargin(0) |
1578 | 142 | self.MainContentLayout.setObjectName(u'MainContentLayout') | 141 | self.MainContentLayout.setObjectName(u'MainContentLayout') |
1580 | 143 | self.main_window.setCentralWidget(self.MainContent) | 142 | self.mainWindow.setCentralWidget(self.MainContent) |
1581 | 144 | self.ControlSplitter = QtGui.QSplitter(self.MainContent) | 143 | self.ControlSplitter = QtGui.QSplitter(self.MainContent) |
1582 | 145 | self.ControlSplitter.setOrientation(QtCore.Qt.Horizontal) | 144 | self.ControlSplitter.setOrientation(QtCore.Qt.Horizontal) |
1583 | 146 | self.ControlSplitter.setObjectName(u'ControlSplitter') | 145 | self.ControlSplitter.setObjectName(u'ControlSplitter') |
1584 | 147 | self.MainContentLayout.addWidget(self.ControlSplitter) | 146 | self.MainContentLayout.addWidget(self.ControlSplitter) |
1585 | 148 | self.PreviewController = SlideController(self.ControlSplitter, False) | 147 | self.PreviewController = SlideController(self.ControlSplitter, False) |
1586 | 149 | self.LiveController = SlideController(self.ControlSplitter, True) | 148 | self.LiveController = SlideController(self.ControlSplitter, True) |
1588 | 150 | self.MenuBar = QtGui.QMenuBar(self.main_window) | 149 | self.MenuBar = QtGui.QMenuBar(self.mainWindow) |
1589 | 151 | self.MenuBar.setGeometry(QtCore.QRect(0, 0, 1087, 27)) | 150 | self.MenuBar.setGeometry(QtCore.QRect(0, 0, 1087, 27)) |
1590 | 152 | self.MenuBar.setObjectName(u'MenuBar') | 151 | self.MenuBar.setObjectName(u'MenuBar') |
1591 | 153 | self.FileMenu = QtGui.QMenu(self.MenuBar) | 152 | self.FileMenu = QtGui.QMenu(self.MenuBar) |
1592 | @@ -169,11 +168,11 @@ | |||
1593 | 169 | self.ToolsMenu.setObjectName(u'ToolsMenu') | 168 | self.ToolsMenu.setObjectName(u'ToolsMenu') |
1594 | 170 | self.HelpMenu = QtGui.QMenu(self.MenuBar) | 169 | self.HelpMenu = QtGui.QMenu(self.MenuBar) |
1595 | 171 | self.HelpMenu.setObjectName(u'HelpMenu') | 170 | self.HelpMenu.setObjectName(u'HelpMenu') |
1598 | 172 | self.main_window.setMenuBar(self.MenuBar) | 171 | self.mainWindow.setMenuBar(self.MenuBar) |
1599 | 173 | self.StatusBar = QtGui.QStatusBar(self.main_window) | 172 | self.StatusBar = QtGui.QStatusBar(self.mainWindow) |
1600 | 174 | self.StatusBar.setObjectName(u'StatusBar') | 173 | self.StatusBar.setObjectName(u'StatusBar') |
1603 | 175 | self.main_window.setStatusBar(self.StatusBar) | 174 | self.mainWindow.setStatusBar(self.StatusBar) |
1604 | 176 | self.MediaManagerDock = QtGui.QDockWidget(self.main_window) | 175 | self.MediaManagerDock = QtGui.QDockWidget(self.mainWindow) |
1605 | 177 | sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding) | 176 | sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding) |
1606 | 178 | sizePolicy.setHorizontalStretch(0) | 177 | sizePolicy.setHorizontalStretch(0) |
1607 | 179 | sizePolicy.setVerticalStretch(0) | 178 | sizePolicy.setVerticalStretch(0) |
1608 | @@ -202,9 +201,9 @@ | |||
1609 | 202 | 201 | ||
1610 | 203 | self.MediaManagerLayout.addWidget(self.MediaToolBox) | 202 | self.MediaManagerLayout.addWidget(self.MediaToolBox) |
1611 | 204 | self.MediaManagerDock.setWidget(self.MediaManagerContents) | 203 | self.MediaManagerDock.setWidget(self.MediaManagerContents) |
1613 | 205 | self.main_window.addDockWidget(QtCore.Qt.DockWidgetArea(1), self.MediaManagerDock) | 204 | self.mainWindow.addDockWidget(QtCore.Qt.DockWidgetArea(1), self.MediaManagerDock) |
1614 | 206 | #Sevice Manager Defined | 205 | #Sevice Manager Defined |
1616 | 207 | self.ServiceManagerDock = QtGui.QDockWidget(self.main_window) | 206 | self.ServiceManagerDock = QtGui.QDockWidget(self.mainWindow) |
1617 | 208 | ServiceManagerIcon = QtGui.QIcon() | 207 | ServiceManagerIcon = QtGui.QIcon() |
1618 | 209 | ServiceManagerIcon.addPixmap(QtGui.QPixmap(u':/system/system_servicemanager.png'), | 208 | ServiceManagerIcon.addPixmap(QtGui.QPixmap(u':/system/system_servicemanager.png'), |
1619 | 210 | QtGui.QIcon.Normal, QtGui.QIcon.Off) | 209 | QtGui.QIcon.Normal, QtGui.QIcon.Off) |
1620 | @@ -213,9 +212,9 @@ | |||
1621 | 213 | self.ServiceManagerDock.setObjectName(u'ServiceManagerDock') | 212 | self.ServiceManagerDock.setObjectName(u'ServiceManagerDock') |
1622 | 214 | self.ServiceManagerContents = ServiceManager(self) | 213 | self.ServiceManagerContents = ServiceManager(self) |
1623 | 215 | self.ServiceManagerDock.setWidget(self.ServiceManagerContents) | 214 | self.ServiceManagerDock.setWidget(self.ServiceManagerContents) |
1625 | 216 | self.main_window.addDockWidget(QtCore.Qt.DockWidgetArea(2), self.ServiceManagerDock) | 215 | self.mainWindow.addDockWidget(QtCore.Qt.DockWidgetArea(2), self.ServiceManagerDock) |
1626 | 217 | #Theme Manager Defined | 216 | #Theme Manager Defined |
1628 | 218 | self.ThemeManagerDock = QtGui.QDockWidget(self.main_window) | 217 | self.ThemeManagerDock = QtGui.QDockWidget(self.mainWindow) |
1629 | 219 | ThemeManagerIcon = QtGui.QIcon() | 218 | ThemeManagerIcon = QtGui.QIcon() |
1630 | 220 | ThemeManagerIcon.addPixmap(QtGui.QPixmap(u':/system/system_thememanager.png'), | 219 | ThemeManagerIcon.addPixmap(QtGui.QPixmap(u':/system/system_thememanager.png'), |
1631 | 221 | QtGui.QIcon.Normal, QtGui.QIcon.Off) | 220 | QtGui.QIcon.Normal, QtGui.QIcon.Off) |
1632 | @@ -226,96 +225,96 @@ | |||
1633 | 226 | self.ThemeManagerContents = ThemeManager(self) | 225 | self.ThemeManagerContents = ThemeManager(self) |
1634 | 227 | 226 | ||
1635 | 228 | self.ThemeManagerDock.setWidget(self.ThemeManagerContents) | 227 | self.ThemeManagerDock.setWidget(self.ThemeManagerContents) |
1637 | 229 | self.main_window.addDockWidget(QtCore.Qt.DockWidgetArea(2), self.ThemeManagerDock) | 228 | self.mainWindow.addDockWidget(QtCore.Qt.DockWidgetArea(2), self.ThemeManagerDock) |
1638 | 230 | 229 | ||
1640 | 231 | self.FileNewItem = QtGui.QAction(self.main_window) | 230 | self.FileNewItem = QtGui.QAction(self.mainWindow) |
1641 | 232 | self.FileNewItem.setIcon( | 231 | self.FileNewItem.setIcon( |
1642 | 233 | self.ServiceManagerContents.Toolbar.getIconFromTitle(u'New Service')) | 232 | self.ServiceManagerContents.Toolbar.getIconFromTitle(u'New Service')) |
1643 | 234 | self.FileNewItem.setObjectName(u'FileNewItem') | 233 | self.FileNewItem.setObjectName(u'FileNewItem') |
1645 | 235 | self.FileOpenItem = QtGui.QAction(self.main_window) | 234 | self.FileOpenItem = QtGui.QAction(self.mainWindow) |
1646 | 236 | self.FileOpenItem.setIcon( | 235 | self.FileOpenItem.setIcon( |
1647 | 237 | self.ServiceManagerContents.Toolbar.getIconFromTitle(u'Open Service')) | 236 | self.ServiceManagerContents.Toolbar.getIconFromTitle(u'Open Service')) |
1648 | 238 | self.FileOpenItem.setObjectName(u'FileOpenItem') | 237 | self.FileOpenItem.setObjectName(u'FileOpenItem') |
1650 | 239 | self.FileSaveItem = QtGui.QAction(self.main_window) | 238 | self.FileSaveItem = QtGui.QAction(self.mainWindow) |
1651 | 240 | self.FileSaveItem.setIcon( | 239 | self.FileSaveItem.setIcon( |
1652 | 241 | self.ServiceManagerContents.Toolbar.getIconFromTitle(u'Save Service')) | 240 | self.ServiceManagerContents.Toolbar.getIconFromTitle(u'Save Service')) |
1653 | 242 | self.FileSaveItem.setObjectName(u'FileSaveItem') | 241 | self.FileSaveItem.setObjectName(u'FileSaveItem') |
1655 | 243 | self.FileSaveAsItem = QtGui.QAction(self.main_window) | 242 | self.FileSaveAsItem = QtGui.QAction(self.mainWindow) |
1656 | 244 | self.FileSaveAsItem.setObjectName(u'FileSaveAsItem') | 243 | self.FileSaveAsItem.setObjectName(u'FileSaveAsItem') |
1658 | 245 | self.FileExitItem = QtGui.QAction(self.main_window) | 244 | self.FileExitItem = QtGui.QAction(self.mainWindow) |
1659 | 246 | ExitIcon = QtGui.QIcon() | 245 | ExitIcon = QtGui.QIcon() |
1660 | 247 | ExitIcon.addPixmap(QtGui.QPixmap(u':/system/system_exit.png'), | 246 | ExitIcon.addPixmap(QtGui.QPixmap(u':/system/system_exit.png'), |
1661 | 248 | QtGui.QIcon.Normal, QtGui.QIcon.Off) | 247 | QtGui.QIcon.Normal, QtGui.QIcon.Off) |
1662 | 249 | self.FileExitItem.setIcon(ExitIcon) | 248 | self.FileExitItem.setIcon(ExitIcon) |
1663 | 250 | self.FileExitItem.setObjectName(u'FileExitItem') | 249 | self.FileExitItem.setObjectName(u'FileExitItem') |
1665 | 251 | self.ImportThemeItem = QtGui.QAction(self.main_window) | 250 | self.ImportThemeItem = QtGui.QAction(self.mainWindow) |
1666 | 252 | self.ImportThemeItem.setObjectName(u'ImportThemeItem') | 251 | self.ImportThemeItem.setObjectName(u'ImportThemeItem') |
1668 | 253 | self.ImportLanguageItem = QtGui.QAction(self.main_window) | 252 | self.ImportLanguageItem = QtGui.QAction(self.mainWindow) |
1669 | 254 | self.ImportLanguageItem.setObjectName(u'ImportLanguageItem') | 253 | self.ImportLanguageItem.setObjectName(u'ImportLanguageItem') |
1671 | 255 | self.ExportThemeItem = QtGui.QAction(self.main_window) | 254 | self.ExportThemeItem = QtGui.QAction(self.mainWindow) |
1672 | 256 | self.ExportThemeItem.setObjectName(u'ExportThemeItem') | 255 | self.ExportThemeItem.setObjectName(u'ExportThemeItem') |
1674 | 257 | self.ExportLanguageItem = QtGui.QAction(self.main_window) | 256 | self.ExportLanguageItem = QtGui.QAction(self.mainWindow) |
1675 | 258 | self.ExportLanguageItem.setObjectName(u'ExportLanguageItem') | 257 | self.ExportLanguageItem.setObjectName(u'ExportLanguageItem') |
1677 | 259 | self.actionLook_Feel = QtGui.QAction(self.main_window) | 258 | self.actionLook_Feel = QtGui.QAction(self.mainWindow) |
1678 | 260 | self.actionLook_Feel.setObjectName(u'actionLook_Feel') | 259 | self.actionLook_Feel.setObjectName(u'actionLook_Feel') |
1680 | 261 | self.OptionsSettingsItem = QtGui.QAction(self.main_window) | 260 | self.OptionsSettingsItem = QtGui.QAction(self.mainWindow) |
1681 | 262 | SettingsIcon = QtGui.QIcon() | 261 | SettingsIcon = QtGui.QIcon() |
1682 | 263 | SettingsIcon.addPixmap(QtGui.QPixmap(u':/system/system_settings.png'), | 262 | SettingsIcon.addPixmap(QtGui.QPixmap(u':/system/system_settings.png'), |
1683 | 264 | QtGui.QIcon.Normal, QtGui.QIcon.Off) | 263 | QtGui.QIcon.Normal, QtGui.QIcon.Off) |
1684 | 265 | self.OptionsSettingsItem.setIcon(SettingsIcon) | 264 | self.OptionsSettingsItem.setIcon(SettingsIcon) |
1685 | 266 | self.OptionsSettingsItem.setObjectName(u'OptionsSettingsItem') | 265 | self.OptionsSettingsItem.setObjectName(u'OptionsSettingsItem') |
1687 | 267 | self.ViewMediaManagerItem = QtGui.QAction(self.main_window) | 266 | self.ViewMediaManagerItem = QtGui.QAction(self.mainWindow) |
1688 | 268 | self.ViewMediaManagerItem.setCheckable(True) | 267 | self.ViewMediaManagerItem.setCheckable(True) |
1689 | 269 | self.ViewMediaManagerItem.setChecked(True) | 268 | self.ViewMediaManagerItem.setChecked(True) |
1690 | 270 | self.ViewMediaManagerItem.setIcon(icon) | 269 | self.ViewMediaManagerItem.setIcon(icon) |
1691 | 271 | self.ViewMediaManagerItem.setObjectName(u'ViewMediaManagerItem') | 270 | self.ViewMediaManagerItem.setObjectName(u'ViewMediaManagerItem') |
1693 | 272 | self.ViewThemeManagerItem = QtGui.QAction(self.main_window) | 271 | self.ViewThemeManagerItem = QtGui.QAction(self.mainWindow) |
1694 | 273 | self.ViewThemeManagerItem.setCheckable(True) | 272 | self.ViewThemeManagerItem.setCheckable(True) |
1695 | 274 | self.ViewThemeManagerItem.setChecked(True) | 273 | self.ViewThemeManagerItem.setChecked(True) |
1696 | 275 | self.ViewThemeManagerItem.setIcon(ThemeManagerIcon) | 274 | self.ViewThemeManagerItem.setIcon(ThemeManagerIcon) |
1697 | 276 | self.ViewThemeManagerItem.setObjectName(u'ViewThemeManagerItem') | 275 | self.ViewThemeManagerItem.setObjectName(u'ViewThemeManagerItem') |
1699 | 277 | self.ViewServiceManagerItem = QtGui.QAction(self.main_window) | 276 | self.ViewServiceManagerItem = QtGui.QAction(self.mainWindow) |
1700 | 278 | self.ViewServiceManagerItem.setCheckable(True) | 277 | self.ViewServiceManagerItem.setCheckable(True) |
1701 | 279 | self.ViewServiceManagerItem.setChecked(True) | 278 | self.ViewServiceManagerItem.setChecked(True) |
1702 | 280 | self.ViewServiceManagerItem.setIcon(ServiceManagerIcon) | 279 | self.ViewServiceManagerItem.setIcon(ServiceManagerIcon) |
1703 | 281 | self.ViewServiceManagerItem.setObjectName(u'ViewServiceManagerItem') | 280 | self.ViewServiceManagerItem.setObjectName(u'ViewServiceManagerItem') |
1705 | 282 | self.ToolsAlertItem = QtGui.QAction(self.main_window) | 281 | self.ToolsAlertItem = QtGui.QAction(self.mainWindow) |
1706 | 283 | AlertIcon = QtGui.QIcon() | 282 | AlertIcon = QtGui.QIcon() |
1707 | 284 | AlertIcon.addPixmap(QtGui.QPixmap(u':/tools/tools_alert.png'), | 283 | AlertIcon.addPixmap(QtGui.QPixmap(u':/tools/tools_alert.png'), |
1708 | 285 | QtGui.QIcon.Normal, QtGui.QIcon.Off) | 284 | QtGui.QIcon.Normal, QtGui.QIcon.Off) |
1709 | 286 | self.ToolsAlertItem.setIcon(AlertIcon) | 285 | self.ToolsAlertItem.setIcon(AlertIcon) |
1710 | 287 | self.ToolsAlertItem.setObjectName(u'ToolsAlertItem') | 286 | self.ToolsAlertItem.setObjectName(u'ToolsAlertItem') |
1712 | 288 | self.HelpDocumentationItem = QtGui.QAction(self.main_window) | 287 | self.HelpDocumentationItem = QtGui.QAction(self.mainWindow) |
1713 | 289 | ContentsIcon = QtGui.QIcon() | 288 | ContentsIcon = QtGui.QIcon() |
1714 | 290 | ContentsIcon.addPixmap(QtGui.QPixmap(u':/system/system_help_contents.png'), | 289 | ContentsIcon.addPixmap(QtGui.QPixmap(u':/system/system_help_contents.png'), |
1715 | 291 | QtGui.QIcon.Normal, QtGui.QIcon.Off) | 290 | QtGui.QIcon.Normal, QtGui.QIcon.Off) |
1716 | 292 | self.HelpDocumentationItem.setIcon(ContentsIcon) | 291 | self.HelpDocumentationItem.setIcon(ContentsIcon) |
1717 | 293 | self.HelpDocumentationItem.setObjectName(u'HelpDocumentationItem') | 292 | self.HelpDocumentationItem.setObjectName(u'HelpDocumentationItem') |
1719 | 294 | self.HelpAboutItem = QtGui.QAction(self.main_window) | 293 | self.HelpAboutItem = QtGui.QAction(self.mainWindow) |
1720 | 295 | AboutIcon = QtGui.QIcon() | 294 | AboutIcon = QtGui.QIcon() |
1721 | 296 | AboutIcon.addPixmap(QtGui.QPixmap(u':/system/system_about.png'), | 295 | AboutIcon.addPixmap(QtGui.QPixmap(u':/system/system_about.png'), |
1722 | 297 | QtGui.QIcon.Normal, QtGui.QIcon.Off) | 296 | QtGui.QIcon.Normal, QtGui.QIcon.Off) |
1723 | 298 | self.HelpAboutItem.setIcon(AboutIcon) | 297 | self.HelpAboutItem.setIcon(AboutIcon) |
1724 | 299 | self.HelpAboutItem.setObjectName(u'HelpAboutItem') | 298 | self.HelpAboutItem.setObjectName(u'HelpAboutItem') |
1726 | 300 | self.HelpOnlineHelpItem = QtGui.QAction(self.main_window) | 299 | self.HelpOnlineHelpItem = QtGui.QAction(self.mainWindow) |
1727 | 301 | self.HelpOnlineHelpItem.setObjectName(u'HelpOnlineHelpItem') | 300 | self.HelpOnlineHelpItem.setObjectName(u'HelpOnlineHelpItem') |
1729 | 302 | self.HelpWebSiteItem = QtGui.QAction(self.main_window) | 301 | self.HelpWebSiteItem = QtGui.QAction(self.mainWindow) |
1730 | 303 | self.HelpWebSiteItem.setObjectName(u'HelpWebSiteItem') | 302 | self.HelpWebSiteItem.setObjectName(u'HelpWebSiteItem') |
1732 | 304 | self.LanguageTranslateItem = QtGui.QAction(self.main_window) | 303 | self.LanguageTranslateItem = QtGui.QAction(self.mainWindow) |
1733 | 305 | self.LanguageTranslateItem.setObjectName(u'LanguageTranslateItem') | 304 | self.LanguageTranslateItem.setObjectName(u'LanguageTranslateItem') |
1735 | 306 | self.LanguageEnglishItem = QtGui.QAction(self.main_window) | 305 | self.LanguageEnglishItem = QtGui.QAction(self.mainWindow) |
1736 | 307 | self.LanguageEnglishItem.setObjectName(u'LanguageEnglishItem') | 306 | self.LanguageEnglishItem.setObjectName(u'LanguageEnglishItem') |
1738 | 308 | self.ToolsAddToolItem = QtGui.QAction(self.main_window) | 307 | self.ToolsAddToolItem = QtGui.QAction(self.mainWindow) |
1739 | 309 | AddToolIcon = QtGui.QIcon() | 308 | AddToolIcon = QtGui.QIcon() |
1740 | 310 | AddToolIcon.addPixmap(QtGui.QPixmap(u':/tools/tools_add.png'), | 309 | AddToolIcon.addPixmap(QtGui.QPixmap(u':/tools/tools_add.png'), |
1741 | 311 | QtGui.QIcon.Normal, QtGui.QIcon.Off) | 310 | QtGui.QIcon.Normal, QtGui.QIcon.Off) |
1742 | 312 | self.ToolsAddToolItem.setIcon(AddToolIcon) | 311 | self.ToolsAddToolItem.setIcon(AddToolIcon) |
1743 | 313 | self.ToolsAddToolItem.setObjectName(u'ToolsAddToolItem') | 312 | self.ToolsAddToolItem.setObjectName(u'ToolsAddToolItem') |
1745 | 314 | self.action_Preview_Panel = QtGui.QAction(self.main_window) | 313 | self.action_Preview_Panel = QtGui.QAction(self.mainWindow) |
1746 | 315 | self.action_Preview_Panel.setCheckable(True) | 314 | self.action_Preview_Panel.setCheckable(True) |
1747 | 316 | self.action_Preview_Panel.setChecked(True) | 315 | self.action_Preview_Panel.setChecked(True) |
1748 | 317 | self.action_Preview_Panel.setObjectName(u'action_Preview_Panel') | 316 | self.action_Preview_Panel.setObjectName(u'action_Preview_Panel') |
1750 | 318 | self.ModeLiveItem = QtGui.QAction(self.main_window) | 317 | self.ModeLiveItem = QtGui.QAction(self.mainWindow) |
1751 | 319 | self.ModeLiveItem.setObjectName(u'ModeLiveItem') | 318 | self.ModeLiveItem.setObjectName(u'ModeLiveItem') |
1752 | 320 | self.FileImportMenu.addAction(self.ImportThemeItem) | 319 | self.FileImportMenu.addAction(self.ImportThemeItem) |
1753 | 321 | self.FileImportMenu.addAction(self.ImportLanguageItem) | 320 | self.FileImportMenu.addAction(self.ImportLanguageItem) |
1754 | @@ -361,7 +360,7 @@ | |||
1755 | 361 | self.retranslateUi() | 360 | self.retranslateUi() |
1756 | 362 | self.MediaToolBox.setCurrentIndex(0) | 361 | self.MediaToolBox.setCurrentIndex(0) |
1757 | 363 | QtCore.QObject.connect(self.FileExitItem, | 362 | QtCore.QObject.connect(self.FileExitItem, |
1759 | 364 | QtCore.SIGNAL(u'triggered()'), self.main_window.close) | 363 | QtCore.SIGNAL(u'triggered()'), self.mainWindow.close) |
1760 | 365 | QtCore.QObject.connect(self.ViewMediaManagerItem, | 364 | QtCore.QObject.connect(self.ViewMediaManagerItem, |
1761 | 366 | QtCore.SIGNAL(u'triggered(bool)'), self.MediaManagerDock.setVisible) | 365 | QtCore.SIGNAL(u'triggered(bool)'), self.MediaManagerDock.setVisible) |
1762 | 367 | QtCore.QObject.connect(self.ViewServiceManagerItem, | 366 | QtCore.QObject.connect(self.ViewServiceManagerItem, |
1763 | @@ -382,103 +381,103 @@ | |||
1764 | 382 | QtCore.SIGNAL(u'triggered()'), self.onToolsAlertItemClicked) | 381 | QtCore.SIGNAL(u'triggered()'), self.onToolsAlertItemClicked) |
1765 | 383 | QtCore.QObject.connect(self.OptionsSettingsItem, | 382 | QtCore.QObject.connect(self.OptionsSettingsItem, |
1766 | 384 | QtCore.SIGNAL(u'triggered()'), self.onOptionsSettingsItemClicked) | 383 | QtCore.SIGNAL(u'triggered()'), self.onOptionsSettingsItemClicked) |
1768 | 385 | QtCore.QMetaObject.connectSlotsByName(self.main_window) | 384 | QtCore.QMetaObject.connectSlotsByName(self.mainWindow) |
1769 | 386 | 385 | ||
1770 | 387 | 386 | ||
1771 | 388 | def retranslateUi(self): | 387 | def retranslateUi(self): |
1854 | 389 | self.main_window.setWindowTitle(translate(u'main_window', u'openlp.org 2.0')) | 388 | self.mainWindow.setWindowTitle(translate(u'mainWindow', u'openlp.org 2.0')) |
1855 | 390 | self.FileMenu.setTitle(translate(u'main_window', u'&File')) | 389 | self.FileMenu.setTitle(translate(u'mainWindow', u'&File')) |
1856 | 391 | self.FileImportMenu.setTitle(translate(u'main_window', u'&Import')) | 390 | self.FileImportMenu.setTitle(translate(u'mainWindow', u'&Import')) |
1857 | 392 | self.FileExportMenu.setTitle(translate(u'main_window', u'&Export')) | 391 | self.FileExportMenu.setTitle(translate(u'mainWindow', u'&Export')) |
1858 | 393 | self.OptionsMenu.setTitle(translate(u'main_window', u'&Options')) | 392 | self.OptionsMenu.setTitle(translate(u'mainWindow', u'&Options')) |
1859 | 394 | self.OptionsViewMenu.setTitle(translate(u'main_window', u'&View')) | 393 | self.OptionsViewMenu.setTitle(translate(u'mainWindow', u'&View')) |
1860 | 395 | self.ViewModeMenu.setTitle(translate(u'main_window', u'M&ode')) | 394 | self.ViewModeMenu.setTitle(translate(u'mainWindow', u'M&ode')) |
1861 | 396 | self.OptionsLanguageMenu.setTitle(translate(u'main_window', u'&Language')) | 395 | self.OptionsLanguageMenu.setTitle(translate(u'mainWindow', u'&Language')) |
1862 | 397 | self.ToolsMenu.setTitle(translate(u'main_window', u'&Tools')) | 396 | self.ToolsMenu.setTitle(translate(u'mainWindow', u'&Tools')) |
1863 | 398 | self.HelpMenu.setTitle(translate(u'main_window', u'&Help')) | 397 | self.HelpMenu.setTitle(translate(u'mainWindow', u'&Help')) |
1864 | 399 | self.MediaManagerDock.setWindowTitle(translate(u'main_window', u'Media Manager')) | 398 | self.MediaManagerDock.setWindowTitle(translate(u'mainWindow', u'Media Manager')) |
1865 | 400 | self.ServiceManagerDock.setWindowTitle(translate(u'main_window', u'Service Manager')) | 399 | self.ServiceManagerDock.setWindowTitle(translate(u'mainWindow', u'Service Manager')) |
1866 | 401 | # self.ServiceManagerContents.MoveTopButton.setText(translate(u'main_window', u'Move To Top')) | 400 | # self.ServiceManagerContents.MoveTopButton.setText(translate(u'mainWindow', u'Move To Top')) |
1867 | 402 | # self.ServiceManagerContents.MoveUpButton.setText(translate(u'main_window', u'Move Up')) | 401 | # self.ServiceManagerContents.MoveUpButton.setText(translate(u'mainWindow', u'Move Up')) |
1868 | 403 | # self.ServiceManagerContents.MoveDownButton.setText(translate(u'main_window', u'Move Down')) | 402 | # self.ServiceManagerContents.MoveDownButton.setText(translate(u'mainWindow', u'Move Down')) |
1869 | 404 | # self.ServiceManagerContents.MoveBottomButton.setText(translate(u'main_window', u'Move To Bottom')) | 403 | # self.ServiceManagerContents.MoveBottomButton.setText(translate(u'mainWindow', u'Move To Bottom')) |
1870 | 405 | # self.ServiceManagerContents.NewItem.setText(translate(u'main_window', u'New Service')) | 404 | # self.ServiceManagerContents.NewItem.setText(translate(u'mainWindow', u'New Service')) |
1871 | 406 | # self.ServiceManagerContents.OpenItem.setText(translate(u'main_window', u'Open Service')) | 405 | # self.ServiceManagerContents.OpenItem.setText(translate(u'mainWindow', u'Open Service')) |
1872 | 407 | # self.ServiceManagerContents.SaveItem.setText(translate(u'main_window', u'Save Service')) | 406 | # self.ServiceManagerContents.SaveItem.setText(translate(u'mainWindow', u'Save Service')) |
1873 | 408 | # self.ServiceManagerContents.ThemeComboBox.setItemText(0, translate(u'main_window', u'African Sunset')) | 407 | # self.ServiceManagerContents.ThemeComboBox.setItemText(0, translate(u'mainWindow', u'African Sunset')) |
1874 | 409 | # self.ServiceManagerContents.ThemeComboBox.setItemText(1, translate(u'main_window', u'Snowy Mountains')) | 408 | # self.ServiceManagerContents.ThemeComboBox.setItemText(1, translate(u'mainWindow', u'Snowy Mountains')) |
1875 | 410 | # self.ServiceManagerContents.ThemeComboBox.setItemText(2, translate(u'main_window', u'Wilderness')) | 409 | # self.ServiceManagerContents.ThemeComboBox.setItemText(2, translate(u'mainWindow', u'Wilderness')) |
1876 | 411 | self.ThemeManagerDock.setWindowTitle(translate(u'main_window', u'Theme Manager')) | 410 | self.ThemeManagerDock.setWindowTitle(translate(u'mainWindow', u'Theme Manager')) |
1877 | 412 | # self.ThemeNewItem.setText(translate(u'main_window', u'New Theme')) | 411 | # self.ThemeNewItem.setText(translate(u'mainWindow', u'New Theme')) |
1878 | 413 | # self.ThemeEditItem.setText(translate(u'main_window', u'Edit Theme')) | 412 | # self.ThemeEditItem.setText(translate(u'mainWindow', u'Edit Theme')) |
1879 | 414 | # self.ThemeDeleteButton.setText(translate(u'main_window', u'Delete Theme')) | 413 | # self.ThemeDeleteButton.setText(translate(u'mainWindow', u'Delete Theme')) |
1880 | 415 | # self.ThemeImportButton.setText(translate(u'main_window', u'Import Theme')) | 414 | # self.ThemeImportButton.setText(translate(u'mainWindow', u'Import Theme')) |
1881 | 416 | # self.ThemeExportButton.setText(translate(u'main_window', u'Export Theme')) | 415 | # self.ThemeExportButton.setText(translate(u'mainWindow', u'Export Theme')) |
1882 | 417 | self.FileNewItem.setText(translate(u'main_window', u'&New')) | 416 | self.FileNewItem.setText(translate(u'mainWindow', u'&New')) |
1883 | 418 | self.FileNewItem.setToolTip(translate(u'main_window', u'New Service')) | 417 | self.FileNewItem.setToolTip(translate(u'mainWindow', u'New Service')) |
1884 | 419 | self.FileNewItem.setStatusTip(translate(u'main_window', u'Create a new Service')) | 418 | self.FileNewItem.setStatusTip(translate(u'mainWindow', u'Create a new Service')) |
1885 | 420 | self.FileNewItem.setShortcut(translate(u'main_window', u'Ctrl+N')) | 419 | self.FileNewItem.setShortcut(translate(u'mainWindow', u'Ctrl+N')) |
1886 | 421 | self.FileOpenItem.setText(translate(u'main_window', u'&Open')) | 420 | self.FileOpenItem.setText(translate(u'mainWindow', u'&Open')) |
1887 | 422 | self.FileOpenItem.setToolTip(translate(u'main_window', u'Open Service')) | 421 | self.FileOpenItem.setToolTip(translate(u'mainWindow', u'Open Service')) |
1888 | 423 | self.FileOpenItem.setStatusTip(translate(u'main_window', u'Open an existing service')) | 422 | self.FileOpenItem.setStatusTip(translate(u'mainWindow', u'Open an existing service')) |
1889 | 424 | self.FileOpenItem.setShortcut(translate(u'main_window', u'Ctrl+O')) | 423 | self.FileOpenItem.setShortcut(translate(u'mainWindow', u'Ctrl+O')) |
1890 | 425 | self.FileSaveItem.setText(translate(u'main_window', u'&Save')) | 424 | self.FileSaveItem.setText(translate(u'mainWindow', u'&Save')) |
1891 | 426 | self.FileSaveItem.setToolTip(translate(u'main_window', u'Save Service')) | 425 | self.FileSaveItem.setToolTip(translate(u'mainWindow', u'Save Service')) |
1892 | 427 | self.FileSaveItem.setStatusTip(translate(u'main_window', u'Save the current service to disk')) | 426 | self.FileSaveItem.setStatusTip(translate(u'mainWindow', u'Save the current service to disk')) |
1893 | 428 | self.FileSaveItem.setShortcut(translate(u'main_window', u'Ctrl+S')) | 427 | self.FileSaveItem.setShortcut(translate(u'mainWindow', u'Ctrl+S')) |
1894 | 429 | self.FileSaveAsItem.setText(translate(u'main_window', u'Save &As...')) | 428 | self.FileSaveAsItem.setText(translate(u'mainWindow', u'Save &As...')) |
1895 | 430 | self.FileSaveAsItem.setToolTip(translate(u'main_window', u'Save Service As')) | 429 | self.FileSaveAsItem.setToolTip(translate(u'mainWindow', u'Save Service As')) |
1896 | 431 | self.FileSaveAsItem.setStatusTip(translate(u'main_window', u'Save the current service under a new name')) | 430 | self.FileSaveAsItem.setStatusTip(translate(u'mainWindow', u'Save the current service under a new name')) |
1897 | 432 | self.FileSaveAsItem.setShortcut(translate(u'main_window', u'F12')) | 431 | self.FileSaveAsItem.setShortcut(translate(u'mainWindow', u'F12')) |
1898 | 433 | self.FileExitItem.setText(translate(u'main_window', u'E&xit')) | 432 | self.FileExitItem.setText(translate(u'mainWindow', u'E&xit')) |
1899 | 434 | self.FileExitItem.setStatusTip(translate(u'main_window', u'Quit OpenLP 2.0')) | 433 | self.FileExitItem.setStatusTip(translate(u'mainWindow', u'Quit OpenLP 2.0')) |
1900 | 435 | self.FileExitItem.setShortcut(translate(u'main_window', u'Alt+F4')) | 434 | self.FileExitItem.setShortcut(translate(u'mainWindow', u'Alt+F4')) |
1901 | 436 | self.ImportThemeItem.setText(translate(u'main_window', u'&Theme')) | 435 | self.ImportThemeItem.setText(translate(u'mainWindow', u'&Theme')) |
1902 | 437 | self.ImportLanguageItem.setText(translate(u'main_window', u'&Language')) | 436 | self.ImportLanguageItem.setText(translate(u'mainWindow', u'&Language')) |
1903 | 438 | self.ExportThemeItem.setText(translate(u'main_window', u'&Theme')) | 437 | self.ExportThemeItem.setText(translate(u'mainWindow', u'&Theme')) |
1904 | 439 | self.ExportLanguageItem.setText(translate(u'main_window', u'&Language')) | 438 | self.ExportLanguageItem.setText(translate(u'mainWindow', u'&Language')) |
1905 | 440 | self.actionLook_Feel.setText(translate(u'main_window', u'Look && &Feel')) | 439 | self.actionLook_Feel.setText(translate(u'mainWindow', u'Look && &Feel')) |
1906 | 441 | self.OptionsSettingsItem.setText(translate(u'main_window', u'&Settings')) | 440 | self.OptionsSettingsItem.setText(translate(u'mainWindow', u'&Settings')) |
1907 | 442 | self.ViewMediaManagerItem.setText(translate(u'main_window', u'&Media Manager')) | 441 | self.ViewMediaManagerItem.setText(translate(u'mainWindow', u'&Media Manager')) |
1908 | 443 | self.ViewMediaManagerItem.setToolTip(translate(u'main_window', u'Toggle Media Manager')) | 442 | self.ViewMediaManagerItem.setToolTip(translate(u'mainWindow', u'Toggle Media Manager')) |
1909 | 444 | self.ViewMediaManagerItem.setStatusTip(translate(u'main_window', u'Toggle the visibility of the Media Manager')) | 443 | self.ViewMediaManagerItem.setStatusTip(translate(u'mainWindow', u'Toggle the visibility of the Media Manager')) |
1910 | 445 | self.ViewMediaManagerItem.setShortcut(translate(u'main_window', u'F8')) | 444 | self.ViewMediaManagerItem.setShortcut(translate(u'mainWindow', u'F8')) |
1911 | 446 | self.ViewThemeManagerItem.setText(translate(u'main_window', u'&Theme Manager')) | 445 | self.ViewThemeManagerItem.setText(translate(u'mainWindow', u'&Theme Manager')) |
1912 | 447 | self.ViewThemeManagerItem.setToolTip(translate(u'main_window', u'Toggle Theme Manager')) | 446 | self.ViewThemeManagerItem.setToolTip(translate(u'mainWindow', u'Toggle Theme Manager')) |
1913 | 448 | self.ViewThemeManagerItem.setStatusTip(translate(u'main_window', u'Toggle the visibility of the Theme Manager')) | 447 | self.ViewThemeManagerItem.setStatusTip(translate(u'mainWindow', u'Toggle the visibility of the Theme Manager')) |
1914 | 449 | self.ViewThemeManagerItem.setShortcut(translate(u'main_window', u'F10')) | 448 | self.ViewThemeManagerItem.setShortcut(translate(u'mainWindow', u'F10')) |
1915 | 450 | self.ViewServiceManagerItem.setText(translate(u'main_window', u'&Service Manager')) | 449 | self.ViewServiceManagerItem.setText(translate(u'mainWindow', u'&Service Manager')) |
1916 | 451 | self.ViewServiceManagerItem.setToolTip(translate(u'main_window', u'Toggle Service Manager')) | 450 | self.ViewServiceManagerItem.setToolTip(translate(u'mainWindow', u'Toggle Service Manager')) |
1917 | 452 | self.ViewServiceManagerItem.setStatusTip(translate(u'main_window', u'Toggle the visibility of the Service Manager')) | 451 | self.ViewServiceManagerItem.setStatusTip(translate(u'mainWindow', u'Toggle the visibility of the Service Manager')) |
1918 | 453 | self.ViewServiceManagerItem.setShortcut(translate(u'main_window', u'F9')) | 452 | self.ViewServiceManagerItem.setShortcut(translate(u'mainWindow', u'F9')) |
1919 | 454 | self.ToolsAlertItem.setText(translate(u'main_window', u'&Alert')) | 453 | self.ToolsAlertItem.setText(translate(u'mainWindow', u'&Alert')) |
1920 | 455 | self.ToolsAlertItem.setStatusTip(translate(u'main_window', u'Show an alert message')) | 454 | self.ToolsAlertItem.setStatusTip(translate(u'mainWindow', u'Show an alert message')) |
1921 | 456 | self.ToolsAlertItem.setShortcut(translate(u'main_window', u'F7')) | 455 | self.ToolsAlertItem.setShortcut(translate(u'mainWindow', u'F7')) |
1922 | 457 | self.HelpDocumentationItem.setText(translate(u'main_window', u'&User Guide')) | 456 | self.HelpDocumentationItem.setText(translate(u'mainWindow', u'&User Guide')) |
1923 | 458 | self.HelpAboutItem.setText(translate(u'main_window', u'&About')) | 457 | self.HelpAboutItem.setText(translate(u'mainWindow', u'&About')) |
1924 | 459 | self.HelpAboutItem.setStatusTip(translate(u'main_window', u'More information about OpenLP')) | 458 | self.HelpAboutItem.setStatusTip(translate(u'mainWindow', u'More information about OpenLP')) |
1925 | 460 | self.HelpAboutItem.setShortcut(translate(u'main_window', u'Ctrl+F1')) | 459 | self.HelpAboutItem.setShortcut(translate(u'mainWindow', u'Ctrl+F1')) |
1926 | 461 | self.HelpOnlineHelpItem.setText(translate(u'main_window', u'&Online Help')) | 460 | self.HelpOnlineHelpItem.setText(translate(u'mainWindow', u'&Online Help')) |
1927 | 462 | self.HelpWebSiteItem.setText(translate(u'main_window', u'&Web Site')) | 461 | self.HelpWebSiteItem.setText(translate(u'mainWindow', u'&Web Site')) |
1928 | 463 | self.LanguageTranslateItem.setText(translate(u'main_window', u'&Translate')) | 462 | self.LanguageTranslateItem.setText(translate(u'mainWindow', u'&Translate')) |
1929 | 464 | self.LanguageTranslateItem.setStatusTip(translate(u'main_window', u'Translate the interface to your language')) | 463 | self.LanguageTranslateItem.setStatusTip(translate(u'mainWindow', u'Translate the interface to your language')) |
1930 | 465 | self.LanguageEnglishItem.setText(translate(u'main_window', u'English')) | 464 | self.LanguageEnglishItem.setText(translate(u'mainWindow', u'English')) |
1931 | 466 | self.LanguageEnglishItem.setStatusTip(translate(u'main_window', u'Set the interface language to English')) | 465 | self.LanguageEnglishItem.setStatusTip(translate(u'mainWindow', u'Set the interface language to English')) |
1932 | 467 | self.ToolsAddToolItem.setText(translate(u'main_window', u'&Add Tool...')) | 466 | self.ToolsAddToolItem.setText(translate(u'mainWindow', u'&Add Tool...')) |
1933 | 468 | self.ToolsAddToolItem.setStatusTip(translate(u'main_window', u'Add an application to the list of tools')) | 467 | self.ToolsAddToolItem.setStatusTip(translate(u'mainWindow', u'Add an application to the list of tools')) |
1934 | 469 | self.action_Preview_Panel.setText(translate(u'main_window', u'&Preview Pane')) | 468 | self.action_Preview_Panel.setText(translate(u'mainWindow', u'&Preview Pane')) |
1935 | 470 | self.ModeLiveItem.setText(translate(u'main_window', u'&Live')) | 469 | self.ModeLiveItem.setText(translate(u'mainWindow', u'&Live')) |
1936 | 471 | 470 | ||
1937 | 472 | def show(self): | 471 | def show(self): |
1941 | 473 | self.main_window.showMaximized() | 472 | self.mainWindow.showMaximized() |
1942 | 474 | self.main_display.setup(0) | 473 | self.mainDisplay.setup(0) |
1943 | 475 | self.main_display.show() | 474 | self.mainDisplay.show() |
1944 | 476 | 475 | ||
1945 | 477 | def onHelpAboutItemClicked(self): | 476 | def onHelpAboutItemClicked(self): |
1947 | 478 | self.about_form.exec_() | 477 | self.aboutForm.exec_() |
1948 | 479 | 478 | ||
1949 | 480 | def onToolsAlertItemClicked(self): | 479 | def onToolsAlertItemClicked(self): |
1951 | 481 | self.alert_form.exec_() | 480 | self.alertForm.exec_() |
1952 | 482 | 481 | ||
1953 | 483 | def onOptionsSettingsItemClicked(self): | 482 | def onOptionsSettingsItemClicked(self): |
1955 | 484 | self.settings_form.exec_() | 483 | self.settingsForm.exec_() |
1956 | 485 | 484 | ||
1957 | === modified file 'openlp/core/ui/servicemanager.py' | |||
1958 | --- openlp/core/ui/servicemanager.py 2009-05-18 19:04:25 +0000 | |||
1959 | +++ openlp/core/ui/servicemanager.py 2009-05-22 18:30:25 +0000 | |||
1960 | @@ -21,13 +21,7 @@ | |||
1961 | 21 | import logging | 21 | import logging |
1962 | 22 | 22 | ||
1963 | 23 | from PyQt4 import QtCore, QtGui | 23 | from PyQt4 import QtCore, QtGui |
1971 | 24 | from openlp.core.lib import PluginConfig | 24 | from openlp.core.lib import PluginConfig, OpenLPToolbar, ServiceItem, RenderManager, Event, EventType, EventManager, translate, buildIcon, contextMenuAction, contextMenuSeparator |
1965 | 25 | from openlp.core.lib import OpenLPToolbar | ||
1966 | 26 | from openlp.core.lib import ServiceItem | ||
1967 | 27 | from openlp.core.lib import RenderManager | ||
1968 | 28 | from openlp.core import translate | ||
1969 | 29 | from openlp import buildIcon | ||
1970 | 30 | from openlp.core.lib import Event, EventType, EventManager | ||
1972 | 31 | 25 | ||
1973 | 32 | class ServiceManager(QtGui.QWidget): | 26 | class ServiceManager(QtGui.QWidget): |
1974 | 33 | 27 | ||
1975 | @@ -38,12 +32,12 @@ | |||
1976 | 38 | Also handles the UI tasks of moving things up and down etc. | 32 | Also handles the UI tasks of moving things up and down etc. |
1977 | 39 | """ | 33 | """ |
1978 | 40 | global log | 34 | global log |
1980 | 41 | log=logging.getLogger(u'ServiceManager') | 35 | log = logging.getLogger(u'ServiceManager') |
1981 | 42 | 36 | ||
1982 | 43 | def __init__(self, parent): | 37 | def __init__(self, parent): |
1983 | 44 | QtGui.QWidget.__init__(self) | 38 | QtGui.QWidget.__init__(self) |
1986 | 45 | self.parent=parent | 39 | self.parent = parent |
1987 | 46 | self.serviceItems=[] | 40 | self.serviceItems = [] |
1988 | 47 | self.Layout = QtGui.QVBoxLayout(self) | 41 | self.Layout = QtGui.QVBoxLayout(self) |
1989 | 48 | self.Layout.setSpacing(0) | 42 | self.Layout.setSpacing(0) |
1990 | 49 | self.Layout.setMargin(0) | 43 | self.Layout.setMargin(0) |
1991 | @@ -57,15 +51,15 @@ | |||
1992 | 57 | self.Toolbar.addToolbarButton(u'Move to bottom', u':/services/service_bottom.png', | 51 | self.Toolbar.addToolbarButton(u'Move to bottom', u':/services/service_bottom.png', |
1993 | 58 | translate(u'ServiceManager', u'Move to end'), self.onServiceEnd) | 52 | translate(u'ServiceManager', u'Move to end'), self.onServiceEnd) |
1994 | 59 | self.Toolbar.addSeparator() | 53 | self.Toolbar.addSeparator() |
1995 | 54 | self.Toolbar.addToolbarButton(u'Delete From Service', u':/services/service_delete.png', | ||
1996 | 55 | translate(u'ServiceManager', u'Delete From Service'), self.onDeleteFromService) | ||
1997 | 60 | self.Toolbar.addToolbarButton(u'New Service', u':/services/service_new.png', | 56 | self.Toolbar.addToolbarButton(u'New Service', u':/services/service_new.png', |
1998 | 61 | translate(u'ServiceManager', u'Create a new Service'), self.onNewService) | 57 | translate(u'ServiceManager', u'Create a new Service'), self.onNewService) |
2001 | 62 | self.Toolbar.addToolbarButton(u'Delete From Service', u':/services/service_delete.png', | 58 | self.Toolbar.addToolbarButton(u'Open Service', u':/services/service_open.png', |
2002 | 63 | translate(u'ServiceManager', u'Delete From Service'), self.onDeleteFromService) | 59 | translate(u'ServiceManager', u'Load Existing'), self.onLoadService) |
2003 | 64 | self.Toolbar.addSeparator() | 60 | self.Toolbar.addSeparator() |
2004 | 65 | self.Toolbar.addToolbarButton(u'Save Service', u':/services/service_save.png', | 61 | self.Toolbar.addToolbarButton(u'Save Service', u':/services/service_save.png', |
2005 | 66 | translate(u'ServiceManager', u'Save Service'), self.onSaveService) | 62 | translate(u'ServiceManager', u'Save Service'), self.onSaveService) |
2006 | 67 | self.Toolbar.addToolbarButton(u'Load Service', u':/services/service_open.png', | ||
2007 | 68 | translate(u'ServiceManager', u'Load Existing'), self.onLoadService) | ||
2008 | 69 | 63 | ||
2009 | 70 | self.Toolbar.addSeparator() | 64 | self.Toolbar.addSeparator() |
2010 | 71 | self.ThemeComboBox = QtGui.QComboBox(self.Toolbar) | 65 | self.ThemeComboBox = QtGui.QComboBox(self.Toolbar) |
2011 | @@ -87,14 +81,14 @@ | |||
2012 | 87 | 81 | ||
2013 | 88 | self.ServiceManagerList.setContextMenuPolicy(QtCore.Qt.ActionsContextMenu) | 82 | self.ServiceManagerList.setContextMenuPolicy(QtCore.Qt.ActionsContextMenu) |
2014 | 89 | 83 | ||
2016 | 90 | self.ServiceManagerList.addAction(self.contextMenuAction( | 84 | self.ServiceManagerList.addAction(contextMenuAction( |
2017 | 91 | self.ServiceManagerList, ':/system/system_preview.png', | 85 | self.ServiceManagerList, ':/system/system_preview.png', |
2018 | 92 | translate(u'ServiceManager',u'&Preview Verse'), self.makePreview)) | 86 | translate(u'ServiceManager',u'&Preview Verse'), self.makePreview)) |
2020 | 93 | self.ServiceManagerList.addAction(self.contextMenuAction( | 87 | self.ServiceManagerList.addAction(contextMenuAction( |
2021 | 94 | self.ServiceManagerList, ':/system/system_live.png', | 88 | self.ServiceManagerList, ':/system/system_live.png', |
2022 | 95 | translate(u'ServiceManager',u'&Show Live'), self.makeLive)) | 89 | translate(u'ServiceManager',u'&Show Live'), self.makeLive)) |
2025 | 96 | self.ServiceManagerList.addAction(self.contextMenuSeparator(self.ServiceManagerList)) | 90 | self.ServiceManagerList.addAction(contextMenuSeparator(self.ServiceManagerList)) |
2026 | 97 | self.ServiceManagerList.addAction(self.contextMenuAction( | 91 | self.ServiceManagerList.addAction(contextMenuAction( |
2027 | 98 | self.ServiceManagerList, ':/services/service_delete', | 92 | self.ServiceManagerList, ':/services/service_delete', |
2028 | 99 | translate(u'ServiceManager',u'&Remove from Service'), self.onDeleteFromService)) | 93 | translate(u'ServiceManager',u'&Remove from Service'), self.onDeleteFromService)) |
2029 | 100 | 94 | ||
2030 | @@ -106,20 +100,6 @@ | |||
2031 | 106 | self.config = PluginConfig(u'Main') | 100 | self.config = PluginConfig(u'Main') |
2032 | 107 | self.service_theme = self.config.get_config(u'theme service theme', u'') | 101 | self.service_theme = self.config.get_config(u'theme service theme', u'') |
2033 | 108 | 102 | ||
2034 | 109 | def contextMenuAction(self, base, icon, text, slot): | ||
2035 | 110 | """ | ||
2036 | 111 | Utility method to help build context menus for plugins | ||
2037 | 112 | """ | ||
2038 | 113 | action = QtGui.QAction(text, base) | ||
2039 | 114 | action .setIcon(buildIcon(icon)) | ||
2040 | 115 | QtCore.QObject.connect(action, QtCore.SIGNAL("triggered()"), slot) | ||
2041 | 116 | return action | ||
2042 | 117 | |||
2043 | 118 | def contextMenuSeparator(self, base): | ||
2044 | 119 | action = QtGui.QAction("", base) | ||
2045 | 120 | action.setSeparator(True) | ||
2046 | 121 | return action | ||
2047 | 122 | |||
2048 | 123 | def onServiceTop(self): | 103 | def onServiceTop(self): |
2049 | 124 | pass | 104 | pass |
2050 | 125 | 105 | ||
2051 | @@ -160,7 +140,7 @@ | |||
2052 | 160 | count = 0 | 140 | count = 0 |
2053 | 161 | for frame in item.frames: | 141 | for frame in item.frames: |
2054 | 162 | treewidgetitem1 = QtGui.QTreeWidgetItem(treewidgetitem) | 142 | treewidgetitem1 = QtGui.QTreeWidgetItem(treewidgetitem) |
2056 | 163 | text = frame[u'formatted'][0] | 143 | text = frame[u'title'][0] |
2057 | 164 | treewidgetitem1.setText(0,text[:30]) | 144 | treewidgetitem1.setText(0,text[:30]) |
2058 | 165 | treewidgetitem1.setData(0, QtCore.Qt.UserRole,QtCore.QVariant(count)) | 145 | treewidgetitem1.setData(0, QtCore.Qt.UserRole,QtCore.QVariant(count)) |
2059 | 166 | count = count + 1 | 146 | count = count + 1 |
2060 | @@ -199,7 +179,7 @@ | |||
2061 | 199 | Handle the release of the event and trigger the plugin | 179 | Handle the release of the event and trigger the plugin |
2062 | 200 | to add the data | 180 | to add the data |
2063 | 201 | """ | 181 | """ |
2065 | 202 | link=event.mimeData() | 182 | link = event.mimeData() |
2066 | 203 | if link.hasText(): | 183 | if link.hasText(): |
2067 | 204 | plugin = event.mimeData().text() | 184 | plugin = event.mimeData().text() |
2068 | 205 | self.EventManager.post_event(Event(EventType.LoadServiceItem, plugin)) | 185 | self.EventManager.post_event(Event(EventType.LoadServiceItem, plugin)) |
2069 | @@ -233,7 +213,9 @@ | |||
2070 | 233 | for theme in theme_list: | 213 | for theme in theme_list: |
2071 | 234 | self.ThemeComboBox.addItem(theme) | 214 | self.ThemeComboBox.addItem(theme) |
2072 | 235 | id = self.ThemeComboBox.findText(str(self.service_theme), QtCore.Qt.MatchExactly) | 215 | id = self.ThemeComboBox.findText(str(self.service_theme), QtCore.Qt.MatchExactly) |
2073 | 216 | # Not Found | ||
2074 | 236 | if id == -1: | 217 | if id == -1: |
2076 | 237 | id = 0 # Not Found | 218 | id = 0 |
2077 | 238 | self.service_theme = u'' | 219 | self.service_theme = u'' |
2078 | 239 | self.ThemeComboBox.setCurrentIndex(id) | 220 | self.ThemeComboBox.setCurrentIndex(id) |
2079 | 221 | self.RenderManager.set_service_theme(self.service_theme) | ||
2080 | 240 | 222 | ||
2081 | === modified file 'openlp/core/ui/slidecontroller.py' | |||
2082 | --- openlp/core/ui/slidecontroller.py 2009-05-16 10:24:03 +0000 | |||
2083 | +++ openlp/core/ui/slidecontroller.py 2009-05-20 20:17:20 +0000 | |||
2084 | @@ -22,8 +22,7 @@ | |||
2085 | 22 | 22 | ||
2086 | 23 | from PyQt4 import QtCore, QtGui | 23 | from PyQt4 import QtCore, QtGui |
2087 | 24 | 24 | ||
2090 | 25 | from openlp.core.lib import OpenLPToolbar | 25 | from openlp.core.lib import OpenLPToolbar, translate |
2089 | 26 | from openlp.core import translate | ||
2091 | 27 | 26 | ||
2092 | 28 | class SlideData(QtCore.QAbstractListModel): | 27 | class SlideData(QtCore.QAbstractListModel): |
2093 | 29 | """ | 28 | """ |
2094 | 30 | 29 | ||
2095 | === modified file 'openlp/core/ui/splashscreen.py' | |||
2096 | --- openlp/core/ui/splashscreen.py 2009-05-01 22:26:43 +0000 | |||
2097 | +++ openlp/core/ui/splashscreen.py 2009-05-20 20:17:20 +0000 | |||
2098 | @@ -20,7 +20,7 @@ | |||
2099 | 20 | 20 | ||
2100 | 21 | from PyQt4 import QtCore, QtGui | 21 | from PyQt4 import QtCore, QtGui |
2101 | 22 | 22 | ||
2103 | 23 | from openlp.core import translate | 23 | from openlp.core.lib import translate |
2104 | 24 | 24 | ||
2105 | 25 | class SplashScreen(object): | 25 | class SplashScreen(object): |
2106 | 26 | def __init__(self, version): | 26 | def __init__(self, version): |
2107 | 27 | 27 | ||
2108 | === modified file 'openlp/core/ui/thememanager.py' | |||
2109 | --- openlp/core/ui/thememanager.py 2009-05-18 19:47:18 +0000 | |||
2110 | +++ openlp/core/ui/thememanager.py 2009-05-22 05:14:55 +0000 | |||
2111 | @@ -23,23 +23,17 @@ | |||
2112 | 23 | import shutil | 23 | import shutil |
2113 | 24 | 24 | ||
2114 | 25 | from time import sleep | 25 | from time import sleep |
2115 | 26 | from copy import deepcopy | ||
2116 | 27 | from xml.etree.ElementTree import ElementTree, XML | 26 | from xml.etree.ElementTree import ElementTree, XML |
2117 | 28 | from PyQt4 import * | ||
2118 | 29 | from PyQt4 import QtCore, QtGui | 27 | from PyQt4 import QtCore, QtGui |
2119 | 30 | from PyQt4.QtCore import * | ||
2120 | 31 | from PyQt4.QtGui import * | ||
2121 | 32 | 28 | ||
2122 | 33 | from openlp.core.ui import AmendThemeForm, ServiceManager | 29 | from openlp.core.ui import AmendThemeForm, ServiceManager |
2123 | 34 | from openlp.core import translate, fileToXML | ||
2124 | 35 | from openlp.core.theme import Theme | 30 | from openlp.core.theme import Theme |
2126 | 36 | from openlp.core.lib import Event, EventType, EventManager, OpenLPToolbar, ThemeXML, Renderer | 31 | from openlp.core.lib import Event, EventType, EventManager, OpenLPToolbar, ThemeXML, Renderer, translate, file_to_xml |
2127 | 37 | from openlp.core.utils import ConfigHelper | 32 | from openlp.core.utils import ConfigHelper |
2128 | 38 | from openlp.core.resources import * | ||
2129 | 39 | 33 | ||
2130 | 40 | import logging | 34 | import logging |
2131 | 41 | 35 | ||
2133 | 42 | class ThemeData(QAbstractListModel): | 36 | class ThemeData(QtCore.QAbstractListModel): |
2134 | 43 | """ | 37 | """ |
2135 | 44 | Tree of items for an order of Theme. | 38 | Tree of items for an order of Theme. |
2136 | 45 | Includes methods for reading and writing the contents to an OOS file | 39 | Includes methods for reading and writing the contents to an OOS file |
2137 | @@ -49,7 +43,7 @@ | |||
2138 | 49 | log=logging.getLogger(u'ThemeData') | 43 | log=logging.getLogger(u'ThemeData') |
2139 | 50 | 44 | ||
2140 | 51 | def __init__(self): | 45 | def __init__(self): |
2142 | 52 | QAbstractListModel.__init__(self) | 46 | QtCore.QAbstractListModel.__init__(self) |
2143 | 53 | self.items = [] | 47 | self.items = [] |
2144 | 54 | self.rowheight = 50 | 48 | self.rowheight = 50 |
2145 | 55 | self.maximagewidth = self.rowheight * 16 / 9.0; | 49 | self.maximagewidth = self.rowheight * 16 / 9.0; |
2146 | @@ -62,36 +56,36 @@ | |||
2147 | 62 | return len(self.items) | 56 | return len(self.items) |
2148 | 63 | 57 | ||
2149 | 64 | def insertRow(self, row, filename): | 58 | def insertRow(self, row, filename): |
2151 | 65 | self.beginInsertRows(QModelIndex(), row, row) | 59 | self.beginInsertRows(QtCore.QModelIndex(), row, row) |
2152 | 66 | log.info(u'insert row %d:%s' % (row, filename)) | 60 | log.info(u'insert row %d:%s' % (row, filename)) |
2153 | 67 | (prefix, shortfilename) = os.path.split(str(filename)) | 61 | (prefix, shortfilename) = os.path.split(str(filename)) |
2154 | 68 | log.info(u'shortfilename = %s' % shortfilename) | 62 | log.info(u'shortfilename = %s' % shortfilename) |
2155 | 69 | theme = shortfilename.split(u'.') | 63 | theme = shortfilename.split(u'.') |
2156 | 70 | # create a preview image | 64 | # create a preview image |
2157 | 71 | if os.path.exists(filename): | 65 | if os.path.exists(filename): |
2159 | 72 | preview = QPixmap(str(filename)) | 66 | preview = QtGui.QPixmap(str(filename)) |
2160 | 73 | width = self.maximagewidth | 67 | width = self.maximagewidth |
2161 | 74 | height = self.rowheight | 68 | height = self.rowheight |
2163 | 75 | preview = preview.scaled(width, height, Qt.KeepAspectRatio, Qt.SmoothTransformation) | 69 | preview = preview.scaled(width, height, QtCore.Qt.KeepAspectRatio, QtCore.Qt.SmoothTransformation) |
2164 | 76 | realwidth = preview.width() | 70 | realwidth = preview.width() |
2165 | 77 | realheight = preview.height() | 71 | realheight = preview.height() |
2166 | 78 | # and move it to the centre of the preview space | 72 | # and move it to the centre of the preview space |
2170 | 79 | pixmap = QPixmap(width, height) | 73 | pixmap = QtGui.QPixmap(width, height) |
2171 | 80 | pixmap.fill(Qt.transparent) | 74 | pixmap.fill(QtCore.Qt.transparent) |
2172 | 81 | painter = QPainter(pixmap) | 75 | painter = QtGui.QPainter(pixmap) |
2173 | 82 | painter.drawPixmap((width - realwidth) / 2, (height - realheight) / 2, preview) | 76 | painter.drawPixmap((width - realwidth) / 2, (height - realheight) / 2, preview) |
2174 | 83 | else: | 77 | else: |
2175 | 84 | width = self.maximagewidth | 78 | width = self.maximagewidth |
2176 | 85 | height = self.rowheight | 79 | height = self.rowheight |
2179 | 86 | pixmap = QPixmap(width, height) | 80 | pixmap = QtGui.QtGui.QPixmap(width, height) |
2180 | 87 | pixmap.fill(Qt.transparent) | 81 | pixmap.fill(QtCore.Qt.transparent) |
2181 | 88 | # finally create the row | 82 | # finally create the row |
2182 | 89 | self.items.insert(row, (filename, pixmap, shortfilename, theme[0])) | 83 | self.items.insert(row, (filename, pixmap, shortfilename, theme[0])) |
2183 | 90 | log.info(u'Items: %s' % self.items) | 84 | log.info(u'Items: %s' % self.items) |
2184 | 91 | self.endInsertRows() | 85 | self.endInsertRows() |
2185 | 92 | 86 | ||
2186 | 93 | def removeRow(self, row): | 87 | def removeRow(self, row): |
2188 | 94 | self.beginRemoveRows(QModelIndex(), row, row) | 88 | self.beginRemoveRows(QtCore.QModelIndex(), row, row) |
2189 | 95 | self.items.pop(row) | 89 | self.items.pop(row) |
2190 | 96 | self.endRemoveRows() | 90 | self.endRemoveRows() |
2191 | 97 | 91 | ||
2192 | @@ -102,16 +96,15 @@ | |||
2193 | 102 | row = index.row() | 96 | row = index.row() |
2194 | 103 | if row > len(self.items): | 97 | if row > len(self.items): |
2195 | 104 | # if the last row is selected and deleted, we then get called with an empty row! | 98 | # if the last row is selected and deleted, we then get called with an empty row! |
2198 | 105 | return QVariant() | 99 | return QtCore.QVariant() |
2199 | 106 | if role == Qt.DisplayRole: | 100 | if role == QtCore.Qt.DisplayRole: |
2200 | 107 | retval = self.items[row][3] | 101 | retval = self.items[row][3] |
2202 | 108 | elif role == Qt.DecorationRole: | 102 | elif role == QtCore.Qt.DecorationRole: |
2203 | 109 | retval = self.items[row][1] | 103 | retval = self.items[row][1] |
2204 | 110 | else: | 104 | else: |
2209 | 111 | retval = QVariant() | 105 | retval = QtCore.QVariant() |
2210 | 112 | #log.info("Returning"+ str(retval)) | 106 | if type(retval) is not type(QtCore.QVariant): |
2211 | 113 | if type(retval) is not type(QVariant): | 107 | return QtCore.QVariant(retval) |
2208 | 114 | return QVariant(retval) | ||
2212 | 115 | else: | 108 | else: |
2213 | 116 | return retval | 109 | return retval |
2214 | 117 | 110 | ||
2215 | @@ -131,15 +124,15 @@ | |||
2216 | 131 | filelist = [item[3] for item in self.items] | 124 | filelist = [item[3] for item in self.items] |
2217 | 132 | return filelist | 125 | return filelist |
2218 | 133 | 126 | ||
2220 | 134 | class ThemeManager(QWidget): | 127 | class ThemeManager(QtGui.QWidget): |
2221 | 135 | """ | 128 | """ |
2222 | 136 | Manages the orders of Theme. | 129 | Manages the orders of Theme. |
2223 | 137 | """ | 130 | """ |
2224 | 138 | global log | 131 | global log |
2226 | 139 | log=logging.getLogger(u'ThemeManager') | 132 | log = logging.getLogger(u'ThemeManager') |
2227 | 140 | 133 | ||
2228 | 141 | def __init__(self, parent): | 134 | def __init__(self, parent): |
2230 | 142 | QWidget.__init__(self) | 135 | QtGui.QWidget.__init__(self) |
2231 | 143 | self.parent = parent | 136 | self.parent = parent |
2232 | 144 | self.Layout = QtGui.QVBoxLayout(self) | 137 | self.Layout = QtGui.QVBoxLayout(self) |
2233 | 145 | self.Layout.setSpacing(0) | 138 | self.Layout.setSpacing(0) |
2234 | @@ -174,7 +167,7 @@ | |||
2235 | 174 | self.themelist = [] | 167 | self.themelist = [] |
2236 | 175 | self.path = os.path.join(ConfigHelper.get_data_path(), u'themes') | 168 | self.path = os.path.join(ConfigHelper.get_data_path(), u'themes') |
2237 | 176 | self.checkThemesExists(self.path) | 169 | self.checkThemesExists(self.path) |
2239 | 177 | self.amendThemeForm.themePath(self.path) | 170 | self.amendThemeForm.path = self.path |
2240 | 178 | 171 | ||
2241 | 179 | def onAddTheme(self): | 172 | def onAddTheme(self): |
2242 | 180 | self.amendThemeForm.loadTheme(None) | 173 | self.amendThemeForm.loadTheme(None) |
2243 | @@ -224,8 +217,7 @@ | |||
2244 | 224 | self.themeData.addRow(os.path.join(self.path, name)) | 217 | self.themeData.addRow(os.path.join(self.path, name)) |
2245 | 225 | self.EventManager.post_event(Event(EventType.ThemeListChanged)) | 218 | self.EventManager.post_event(Event(EventType.ThemeListChanged)) |
2246 | 226 | self.ServiceManager.updateThemeList(self.getThemes()) | 219 | self.ServiceManager.updateThemeList(self.getThemes()) |
2249 | 227 | self.parent.settings_form.ThemesTab.updateThemeList(self.getThemes()) | 220 | self.parent.settingsForm.ThemesTab.updateThemeList(self.getThemes()) |
2248 | 228 | |||
2250 | 229 | 221 | ||
2251 | 230 | def getThemes(self): | 222 | def getThemes(self): |
2252 | 231 | return self.themeData.getList() | 223 | return self.themeData.getList() |
2253 | @@ -234,19 +226,19 @@ | |||
2254 | 234 | log.debug(u'getthemedata for theme %s', themename) | 226 | log.debug(u'getthemedata for theme %s', themename) |
2255 | 235 | xml_file = os.path.join(self.path, str(themename), str(themename) + u'.xml') | 227 | xml_file = os.path.join(self.path, str(themename), str(themename) + u'.xml') |
2256 | 236 | try: | 228 | try: |
2258 | 237 | xml = fileToXML(xml_file) | 229 | xml = file_to_xml(xml_file) |
2259 | 238 | except: | 230 | except: |
2260 | 239 | newtheme = ThemeXML() | 231 | newtheme = ThemeXML() |
2261 | 240 | newtheme.new_document(u'New Theme') | 232 | newtheme.new_document(u'New Theme') |
2262 | 241 | newtheme.add_background_solid(str(u'#000000')) | 233 | newtheme.add_background_solid(str(u'#000000')) |
2265 | 242 | newtheme.add_font(str(QFont().family()), str(u'#FFFFFF'), str(30), u'False') | 234 | newtheme.add_font(str(QtGui.QFont().family()), str(u'#FFFFFF'), str(30), u'False') |
2266 | 243 | newtheme.add_font(str(QFont().family()), str(u'#FFFFFF'), str(12), u'False', u'footer') | 235 | newtheme.add_font(str(QtGui.QFont().family()), str(u'#FFFFFF'), str(12), u'False', u'footer') |
2267 | 244 | newtheme.add_display(u'False', str(u'#FFFFFF'), u'False', str(u'#FFFFFF'), | 236 | newtheme.add_display(u'False', str(u'#FFFFFF'), u'False', str(u'#FFFFFF'), |
2268 | 245 | str(0), str(0), str(0)) | 237 | str(0), str(0), str(0)) |
2269 | 246 | xml = newtheme.extract_xml() | 238 | xml = newtheme.extract_xml() |
2270 | 247 | theme = ThemeXML() | 239 | theme = ThemeXML() |
2271 | 248 | theme.parse(xml) | 240 | theme.parse(xml) |
2273 | 249 | theme.extend_filename(self.path) | 241 | theme.extend_image_filename(self.path) |
2274 | 250 | return theme | 242 | return theme |
2275 | 251 | 243 | ||
2276 | 252 | def checkThemesExists(self, dir): | 244 | def checkThemesExists(self, dir): |
2277 | @@ -353,7 +345,7 @@ | |||
2278 | 353 | log.debug(u'generateAndSaveImage %s %s %s', dir, name, theme_xml) | 345 | log.debug(u'generateAndSaveImage %s %s %s', dir, name, theme_xml) |
2279 | 354 | theme = ThemeXML() | 346 | theme = ThemeXML() |
2280 | 355 | theme.parse(theme_xml) | 347 | theme.parse(theme_xml) |
2282 | 356 | theme.extend_filename(dir) | 348 | theme.extend_image_filename(dir) |
2283 | 357 | frame = self.generateImage(theme) | 349 | frame = self.generateImage(theme) |
2284 | 358 | im = frame.toImage() | 350 | im = frame.toImage() |
2285 | 359 | samplepathname = os.path.join(self.path, name + u'.png') | 351 | samplepathname = os.path.join(self.path, name + u'.png') |
2286 | 360 | 352 | ||
2287 | === modified file 'openlp/core/ui/themestab.py' | |||
2288 | --- openlp/core/ui/themestab.py 2009-05-18 19:47:18 +0000 | |||
2289 | +++ openlp/core/ui/themestab.py 2009-05-20 20:17:20 +0000 | |||
2290 | @@ -20,8 +20,7 @@ | |||
2291 | 20 | 20 | ||
2292 | 21 | from PyQt4 import QtCore, QtGui | 21 | from PyQt4 import QtCore, QtGui |
2293 | 22 | 22 | ||
2296 | 23 | from openlp.core import translate | 23 | from openlp.core.lib import SettingsTab, translate |
2295 | 24 | from openlp.core.lib import SettingsTab | ||
2297 | 25 | 24 | ||
2298 | 26 | class ThemesTab(SettingsTab): | 25 | class ThemesTab(SettingsTab): |
2299 | 27 | """ | 26 | """ |
2300 | 28 | 27 | ||
2301 | === modified file 'openlp/plugins/bibles/bibleplugin.py' | |||
2302 | --- openlp/plugins/bibles/bibleplugin.py 2009-05-17 08:25:15 +0000 | |||
2303 | +++ openlp/plugins/bibles/bibleplugin.py 2009-05-21 05:15:51 +0000 | |||
2304 | @@ -21,10 +21,8 @@ | |||
2305 | 21 | 21 | ||
2306 | 22 | from PyQt4 import QtCore, QtGui | 22 | from PyQt4 import QtCore, QtGui |
2307 | 23 | from PyQt4.QtCore import * | 23 | from PyQt4.QtCore import * |
2308 | 24 | from PyQt4.QtGui import * | ||
2309 | 25 | 24 | ||
2312 | 26 | from openlp.core.lib import Plugin, Event | 25 | from openlp.core.lib import Plugin, Event, EventType, translate |
2311 | 27 | from openlp.core.lib import EventType | ||
2313 | 28 | 26 | ||
2314 | 29 | from openlp.plugins.bibles.lib import BibleManager, BiblesTab, BibleMediaItem | 27 | from openlp.plugins.bibles.lib import BibleManager, BiblesTab, BibleMediaItem |
2315 | 30 | from openlp.plugins.bibles.lib.tables import * | 28 | from openlp.plugins.bibles.lib.tables import * |
2316 | @@ -59,7 +57,7 @@ | |||
2317 | 59 | self.ImportBibleItem = QtGui.QAction(import_menu) | 57 | self.ImportBibleItem = QtGui.QAction(import_menu) |
2318 | 60 | self.ImportBibleItem.setObjectName("ImportBibleItem") | 58 | self.ImportBibleItem.setObjectName("ImportBibleItem") |
2319 | 61 | import_menu.addAction(self.ImportBibleItem) | 59 | import_menu.addAction(self.ImportBibleItem) |
2321 | 62 | self.ImportBibleItem.setText(QtGui.QApplication.translate("main_window", "&Bible", None, QtGui.QApplication.UnicodeUTF8)) | 60 | self.ImportBibleItem.setText(translate("BiblePlugin", "&Bible")) |
2322 | 63 | # Signals and slots | 61 | # Signals and slots |
2323 | 64 | QtCore.QObject.connect(self.ImportBibleItem, QtCore.SIGNAL("triggered()"), self.onBibleNewClick) | 62 | QtCore.QObject.connect(self.ImportBibleItem, QtCore.SIGNAL("triggered()"), self.onBibleNewClick) |
2324 | 65 | 63 | ||
2325 | @@ -67,8 +65,7 @@ | |||
2326 | 67 | self.ExportBibleItem = QtGui.QAction(export_menu) | 65 | self.ExportBibleItem = QtGui.QAction(export_menu) |
2327 | 68 | self.ExportBibleItem.setObjectName("ExportBibleItem") | 66 | self.ExportBibleItem.setObjectName("ExportBibleItem") |
2328 | 69 | export_menu.addAction(self.ExportBibleItem) | 67 | export_menu.addAction(self.ExportBibleItem) |
2331 | 70 | self.ExportBibleItem.setText( | 68 | self.ExportBibleItem.setText(translate("BiblePlugin", u'&Bible')) |
2330 | 71 | QtGui.QApplication.translate("main_window", u'&Bible', None, QtGui.QApplication.UnicodeUTF8)) | ||
2332 | 72 | 69 | ||
2333 | 73 | def initialise(self): | 70 | def initialise(self): |
2334 | 74 | pass | 71 | pass |
2335 | 75 | 72 | ||
2336 | === modified file 'openlp/plugins/bibles/lib/biblestab.py' | |||
2337 | --- openlp/plugins/bibles/lib/biblestab.py 2009-05-18 16:11:59 +0000 | |||
2338 | +++ openlp/plugins/bibles/lib/biblestab.py 2009-05-21 05:15:51 +0000 | |||
2339 | @@ -20,8 +20,7 @@ | |||
2340 | 20 | 20 | ||
2341 | 21 | from PyQt4 import Qt, QtCore, QtGui | 21 | from PyQt4 import Qt, QtCore, QtGui |
2342 | 22 | 22 | ||
2345 | 23 | from openlp.core import translate | 23 | from openlp.core.lib import translate, str_to_bool |
2344 | 24 | from openlp import convertStringToBoolean | ||
2346 | 25 | from openlp.core.lib import SettingsTab | 24 | from openlp.core.lib import SettingsTab |
2347 | 26 | 25 | ||
2348 | 27 | class BiblesTab(SettingsTab): | 26 | class BiblesTab(SettingsTab): |
2349 | @@ -187,11 +186,11 @@ | |||
2350 | 187 | self.bible_search = True | 186 | self.bible_search = True |
2351 | 188 | 187 | ||
2352 | 189 | def load(self): | 188 | def load(self): |
2355 | 190 | self.paragraph_style = convertStringToBoolean(self.config.get_config(u'paragraph style', u'True')) | 189 | self.paragraph_style = str_to_bool(self.config.get_config(u'paragraph style', u'True')) |
2356 | 191 | self.show_new_chapters = convertStringToBoolean(self.config.get_config(u'display new chapter', u"False")) | 190 | self.show_new_chapters = str_to_bool(self.config.get_config(u'display new chapter', u"False")) |
2357 | 192 | self.display_style = int(self.config.get_config(u'display brackets', u'0')) | 191 | self.display_style = int(self.config.get_config(u'display brackets', u'0')) |
2358 | 193 | self.bible_theme = self.config.get_config(u'bible theme', u'0') | 192 | self.bible_theme = self.config.get_config(u'bible theme', u'0') |
2360 | 194 | self.bible_search = convertStringToBoolean(self.config.get_config(u'search as type', u'True')) | 193 | self.bible_search = str_to_bool(self.config.get_config(u'search as type', u'True')) |
2361 | 195 | if self.paragraph_style: | 194 | if self.paragraph_style: |
2362 | 196 | self.ParagraphRadioButton.setChecked(True) | 195 | self.ParagraphRadioButton.setChecked(True) |
2363 | 197 | else: | 196 | else: |
2364 | 198 | 197 | ||
2365 | === modified file 'openlp/plugins/bibles/lib/mediaitem.py' | |||
2366 | --- openlp/plugins/bibles/lib/mediaitem.py 2009-05-18 16:11:59 +0000 | |||
2367 | +++ openlp/plugins/bibles/lib/mediaitem.py 2009-05-22 19:36:16 +0000 | |||
2368 | @@ -21,10 +21,7 @@ | |||
2369 | 21 | 21 | ||
2370 | 22 | from PyQt4 import QtCore, QtGui | 22 | from PyQt4 import QtCore, QtGui |
2371 | 23 | 23 | ||
2376 | 24 | from openlp.core import translate | 24 | from openlp.core.lib import ServiceItem, MediaManagerItem, Receiver, translate |
2373 | 25 | from openlp.core.lib import MediaManagerItem, Receiver | ||
2374 | 26 | from openlp.core.lib import ServiceItem | ||
2375 | 27 | |||
2377 | 28 | from openlp.plugins.bibles.forms import BibleImportForm | 25 | from openlp.plugins.bibles.forms import BibleImportForm |
2378 | 29 | from openlp.plugins.bibles.lib import TextListData | 26 | from openlp.plugins.bibles.lib import TextListData |
2379 | 30 | 27 | ||
2380 | @@ -57,7 +54,7 @@ | |||
2381 | 57 | This is the custom media manager item for Bibles. | 54 | This is the custom media manager item for Bibles. |
2382 | 58 | """ | 55 | """ |
2383 | 59 | global log | 56 | global log |
2385 | 60 | log=logging.getLogger(u'BibleMediaItem') | 57 | log = logging.getLogger(u'BibleMediaItem') |
2386 | 61 | log.info(u'Bible Media Item loaded') | 58 | log.info(u'Bible Media Item loaded') |
2387 | 62 | 59 | ||
2388 | 63 | def __init__(self, parent, icon, title): | 60 | def __init__(self, parent, icon, title): |
2389 | @@ -207,7 +204,7 @@ | |||
2390 | 207 | self.BibleListView.setAlternatingRowColors(True) | 204 | self.BibleListView.setAlternatingRowColors(True) |
2391 | 208 | self.BibleListData = TextListData() | 205 | self.BibleListData = TextListData() |
2392 | 209 | self.BibleListView.setModel(self.BibleListData) | 206 | self.BibleListView.setModel(self.BibleListData) |
2394 | 210 | self.BibleListView.setSelectionMode(QtGui.QAbstractItemView.MultiSelection) | 207 | self.BibleListView.setSelectionMode(QtGui.QAbstractItemView.ExtendedSelection) |
2395 | 211 | self.BibleListView.setDragEnabled(True) | 208 | self.BibleListView.setDragEnabled(True) |
2396 | 212 | 209 | ||
2397 | 213 | self.PageLayout.addWidget(self.BibleListView) | 210 | self.PageLayout.addWidget(self.BibleListView) |
2398 | @@ -383,7 +380,7 @@ | |||
2399 | 383 | verse = str(self.search_results[0][2]) | 380 | verse = str(self.search_results[0][2]) |
2400 | 384 | text = self.search_results[0][3] | 381 | text = self.search_results[0][3] |
2401 | 385 | if self.parent.bibles_tab.paragraph_style: #Paragraph | 382 | if self.parent.bibles_tab.paragraph_style: #Paragraph |
2403 | 386 | text = text + u'\n' | 383 | text = text + u'\n\n' |
2404 | 387 | if self.parent.bibles_tab.display_style == 1: | 384 | if self.parent.bibles_tab.display_style == 1: |
2405 | 388 | loc = self.formatVerse(old_chapter, chapter, verse, u'(', u')') | 385 | loc = self.formatVerse(old_chapter, chapter, verse, u'(', u')') |
2406 | 389 | elif self.parent.bibles_tab.display_style == 2: | 386 | elif self.parent.bibles_tab.display_style == 2: |
2407 | 390 | 387 | ||
2408 | === modified file 'openlp/plugins/custom/customplugin.py' | |||
2409 | --- openlp/plugins/custom/customplugin.py 2009-05-16 10:24:03 +0000 | |||
2410 | +++ openlp/plugins/custom/customplugin.py 2009-05-21 16:07:01 +0000 | |||
2411 | @@ -21,10 +21,8 @@ | |||
2412 | 21 | 21 | ||
2413 | 22 | from PyQt4 import QtCore, QtGui | 22 | from PyQt4 import QtCore, QtGui |
2414 | 23 | 23 | ||
2415 | 24 | from openlp.core.resources import * | ||
2416 | 25 | from openlp.core.lib import Plugin, Event | ||
2417 | 26 | from openlp.core.lib import EventType | ||
2418 | 27 | from forms import EditCustomForm | 24 | from forms import EditCustomForm |
2419 | 25 | from openlp.core.lib import Plugin, Event, EventType | ||
2420 | 28 | from openlp.plugins.custom.lib import CustomManager, CustomTab, CustomMediaItem, CustomServiceItem | 26 | from openlp.plugins.custom.lib import CustomManager, CustomTab, CustomMediaItem, CustomServiceItem |
2421 | 29 | 27 | ||
2422 | 30 | 28 | ||
2423 | 31 | 29 | ||
2424 | === modified file 'openlp/plugins/custom/forms/editcustomdialog.py' | |||
2425 | --- openlp/plugins/custom/forms/editcustomdialog.py 2009-05-01 22:26:43 +0000 | |||
2426 | +++ openlp/plugins/custom/forms/editcustomdialog.py 2009-05-21 16:07:01 +0000 | |||
2427 | @@ -8,7 +8,7 @@ | |||
2428 | 8 | # WARNING! All changes made in this file will be lost! | 8 | # WARNING! All changes made in this file will be lost! |
2429 | 9 | 9 | ||
2430 | 10 | from PyQt4 import QtCore, QtGui | 10 | from PyQt4 import QtCore, QtGui |
2432 | 11 | from openlp.core import translate | 11 | from openlp.core.lib import translate |
2433 | 12 | 12 | ||
2434 | 13 | class Ui_customEditDialog(object): | 13 | class Ui_customEditDialog(object): |
2435 | 14 | def setupUi(self, customEditDialog): | 14 | def setupUi(self, customEditDialog): |
2436 | 15 | 15 | ||
2437 | === modified file 'openlp/plugins/custom/lib/customserviceitem.py' | |||
2438 | --- openlp/plugins/custom/lib/customserviceitem.py 2009-03-17 05:05:04 +0000 | |||
2439 | +++ openlp/plugins/custom/lib/customserviceitem.py 2009-05-21 16:07:01 +0000 | |||
2440 | @@ -19,6 +19,7 @@ | |||
2441 | 19 | """ | 19 | """ |
2442 | 20 | from PyQt4 import QtCore, QtGui | 20 | from PyQt4 import QtCore, QtGui |
2443 | 21 | import logging | 21 | import logging |
2444 | 22 | |||
2445 | 22 | from openlp.core.lib import ServiceItem | 23 | from openlp.core.lib import ServiceItem |
2446 | 23 | 24 | ||
2447 | 24 | from openlp.plugins.custom.lib import TextListData | 25 | from openlp.plugins.custom.lib import TextListData |
2448 | @@ -40,12 +41,12 @@ | |||
2449 | 40 | it simply tells the slide controller to use it??? | 41 | it simply tells the slide controller to use it??? |
2450 | 41 | 42 | ||
2451 | 42 | It contains 1 or more images | 43 | It contains 1 or more images |
2453 | 43 | 44 | ||
2454 | 44 | """ | 45 | """ |
2455 | 45 | global log | 46 | global log |
2456 | 46 | log=logging.getLogger(u'CustomServiceItem') | 47 | log=logging.getLogger(u'CustomServiceItem') |
2457 | 47 | log.info(u'CustomServiceItem loaded') | 48 | log.info(u'CustomServiceItem loaded') |
2459 | 48 | 49 | ||
2460 | 49 | def __init__(self, controller): | 50 | def __init__(self, controller): |
2461 | 50 | """ | 51 | """ |
2462 | 51 | Init Method | 52 | Init Method |
2463 | @@ -58,7 +59,7 @@ | |||
2464 | 58 | # c.uniformItemSizes=True | 59 | # c.uniformItemSizes=True |
2465 | 59 | # c.setModel(self.imgs) | 60 | # c.setModel(self.imgs) |
2466 | 60 | # c.setGeometry(0,0,200,200) | 61 | # c.setGeometry(0,0,200,200) |
2468 | 61 | 62 | ||
2469 | 62 | def render(self): | 63 | def render(self): |
2470 | 63 | """ | 64 | """ |
2471 | 64 | The render method is what the plugin uses to render its meda to the | 65 | The render method is what the plugin uses to render its meda to the |
2472 | @@ -66,7 +67,7 @@ | |||
2473 | 66 | """ | 67 | """ |
2474 | 67 | # render the "image chooser first" | 68 | # render the "image chooser first" |
2475 | 68 | # for f in self.imgs: | 69 | # for f in self.imgs: |
2477 | 69 | # fl , nm = os.path.split(str(f)) | 70 | # fl , nm = os.path.split(str(f)) |
2478 | 70 | # c = self.slide_controller.rowCount() | 71 | # c = self.slide_controller.rowCount() |
2479 | 71 | # self.slide_controller.setRowCount(c+1) | 72 | # self.slide_controller.setRowCount(c+1) |
2480 | 72 | # twi = QtGui.QTableWidgetItem(str(f)) | 73 | # twi = QtGui.QTableWidgetItem(str(f)) |
2481 | @@ -74,7 +75,7 @@ | |||
2482 | 74 | # twi = QtGui.QTableWidgetItem(str(nm)) | 75 | # twi = QtGui.QTableWidgetItem(str(nm)) |
2483 | 75 | # self.slide_controller.setItem(c , 1, twi) | 76 | # self.slide_controller.setItem(c , 1, twi) |
2484 | 76 | # self.slide_controller.setRowHeight(c, 80) | 77 | # self.slide_controller.setRowHeight(c, 80) |
2486 | 77 | 78 | ||
2487 | 78 | # render the preview screen here | 79 | # render the preview screen here |
2488 | 79 | 80 | ||
2489 | 80 | def get_parent_node(self): | 81 | def get_parent_node(self): |
2490 | @@ -83,7 +84,7 @@ | |||
2491 | 83 | Manager. | 84 | Manager. |
2492 | 84 | """ | 85 | """ |
2493 | 85 | pass | 86 | pass |
2495 | 86 | 87 | ||
2496 | 87 | def add(self, data): | 88 | def add(self, data): |
2497 | 88 | """ | 89 | """ |
2498 | 89 | append an image to the list | 90 | append an image to the list |
2499 | @@ -95,7 +96,7 @@ | |||
2500 | 95 | log.info("add Item..."+str(data)) | 96 | log.info("add Item..."+str(data)) |
2501 | 96 | for filename in data.imgs.get_file_list(): | 97 | for filename in data.imgs.get_file_list(): |
2502 | 97 | self.add(filename) | 98 | self.add(filename) |
2504 | 98 | 99 | ||
2505 | 99 | 100 | ||
2506 | 100 | def get_oos_text(self): | 101 | def get_oos_text(self): |
2507 | 101 | """ | 102 | """ |
2508 | @@ -114,4 +115,4 @@ | |||
2509 | 114 | files=text.split('\n') | 115 | files=text.split('\n') |
2510 | 115 | for f in files: | 116 | for f in files: |
2511 | 116 | self.imgs.addRow(f) | 117 | self.imgs.addRow(f) |
2513 | 117 | 118 | ||
2514 | 118 | 119 | ||
2515 | === modified file 'openlp/plugins/custom/lib/customtab.py' | |||
2516 | --- openlp/plugins/custom/lib/customtab.py 2009-03-07 09:20:56 +0000 | |||
2517 | +++ openlp/plugins/custom/lib/customtab.py 2009-05-21 16:07:01 +0000 | |||
2518 | @@ -20,9 +20,7 @@ | |||
2519 | 20 | 20 | ||
2520 | 21 | from PyQt4 import QtCore, QtGui | 21 | from PyQt4 import QtCore, QtGui |
2521 | 22 | 22 | ||
2525 | 23 | from openlp.core import translate | 23 | from openlp.core.lib import SettingsTab, translate |
2523 | 24 | from openlp.core.lib import SettingsTab | ||
2524 | 25 | from openlp.core.resources import * | ||
2526 | 26 | 24 | ||
2527 | 27 | class CustomTab(SettingsTab): | 25 | class CustomTab(SettingsTab): |
2528 | 28 | """ | 26 | """ |
2529 | 29 | 27 | ||
2530 | === modified file 'openlp/plugins/custom/lib/mediaitem.py' | |||
2531 | --- openlp/plugins/custom/lib/mediaitem.py 2009-05-12 21:06:35 +0000 | |||
2532 | +++ openlp/plugins/custom/lib/mediaitem.py 2009-05-21 16:07:01 +0000 | |||
2533 | @@ -21,11 +21,7 @@ | |||
2534 | 21 | 21 | ||
2535 | 22 | from PyQt4 import QtCore, QtGui | 22 | from PyQt4 import QtCore, QtGui |
2536 | 23 | 23 | ||
2542 | 24 | from openlp.core import translate | 24 | from openlp.core.lib import MediaManagerItem, SongXMLParser, ServiceItem, translate |
2538 | 25 | from openlp.core.lib import MediaManagerItem | ||
2539 | 26 | from openlp.core.lib import SongXMLParser | ||
2540 | 27 | from openlp.core.lib import ServiceItem | ||
2541 | 28 | |||
2543 | 29 | from openlp.plugins.custom.lib import TextListData | 25 | from openlp.plugins.custom.lib import TextListData |
2544 | 30 | 26 | ||
2545 | 31 | class CustomList(QtGui.QListView): | 27 | class CustomList(QtGui.QListView): |
2546 | 32 | 28 | ||
2547 | === modified file 'openlp/plugins/custom/lib/textlistdata.py' | |||
2548 | --- openlp/plugins/custom/lib/textlistdata.py 2009-03-15 06:35:07 +0000 | |||
2549 | +++ openlp/plugins/custom/lib/textlistdata.py 2009-05-21 16:07:01 +0000 | |||
2550 | @@ -1,55 +1,50 @@ | |||
2551 | 1 | import logging | 1 | import logging |
2552 | 2 | 2 | ||
2558 | 3 | from PyQt4.QtCore import * | 3 | from PyQt4 import QtCore, QtGui |
2559 | 4 | from PyQt4.QtGui import * | 4 | |
2560 | 5 | 5 | class TextListData(QtCore.QAbstractListModel): | |
2556 | 6 | |||
2557 | 7 | class TextListData(QAbstractListModel): | ||
2561 | 8 | """ | 6 | """ |
2563 | 9 | An abstract list of strings | 7 | An abstract list of strings |
2564 | 10 | """ | 8 | """ |
2565 | 11 | global log | 9 | global log |
2566 | 12 | log=logging.getLogger(u'TextListData') | 10 | log=logging.getLogger(u'TextListData') |
2567 | 13 | log.info(u'started') | 11 | log.info(u'started') |
2568 | 14 | 12 | ||
2569 | 15 | def __init__(self): | 13 | def __init__(self): |
2571 | 16 | QAbstractListModel.__init__(self) | 14 | QtCore.QAbstractListModel.__init__(self) |
2572 | 17 | self.items=[] # will be a list of (database id , title) tuples | 15 | self.items=[] # will be a list of (database id , title) tuples |
2573 | 18 | 16 | ||
2574 | 19 | def resetStore(self): | 17 | def resetStore(self): |
2575 | 20 | #reset list so can be reloaded | 18 | #reset list so can be reloaded |
2578 | 21 | self.items=[] | 19 | self.items=[] |
2579 | 22 | 20 | ||
2580 | 23 | def rowCount(self, parent): | 21 | def rowCount(self, parent): |
2581 | 24 | return len(self.items) | 22 | return len(self.items) |
2582 | 25 | 23 | ||
2583 | 26 | def insertRow(self, row, id, title): | 24 | def insertRow(self, row, id, title): |
2586 | 27 | self.beginInsertRows(QModelIndex(),row,row) | 25 | self.beginInsertRows(QtCore.QModelIndex(),row,row) |
2587 | 28 | log.debug("insert row %d:%s for id %d"%(row,title, id)) | 26 | log.debug("insert row %d:%s for id %d" % (row,title, id)) |
2588 | 29 | self.items.insert(row, (id, title)) | 27 | self.items.insert(row, (id, title)) |
2589 | 30 | self.endInsertRows() | 28 | self.endInsertRows() |
2590 | 31 | 29 | ||
2591 | 32 | def removeRow(self, row): | 30 | def removeRow(self, row): |
2593 | 33 | self.beginRemoveRows(QModelIndex(), row,row) | 31 | self.beginRemoveRows(QtCore.QModelIndex(), row,row) |
2594 | 34 | self.items.pop(row) | 32 | self.items.pop(row) |
2595 | 35 | self.endRemoveRows() | 33 | self.endRemoveRows() |
2596 | 36 | 34 | ||
2597 | 37 | def addRow(self, id, title): | 35 | def addRow(self, id, title): |
2598 | 38 | self.insertRow(len(self.items), id, title) | 36 | self.insertRow(len(self.items), id, title) |
2600 | 39 | 37 | ||
2601 | 40 | def data(self, index, role): | 38 | def data(self, index, role): |
2602 | 41 | row=index.row() | 39 | row=index.row() |
2603 | 42 | if row > len(self.items): # if the last row is selected and deleted, we then get called with an empty row! | 40 | if row > len(self.items): # if the last row is selected and deleted, we then get called with an empty row! |
2609 | 43 | return QVariant() | 41 | return QtCore.QVariant() |
2610 | 44 | if role==Qt.DisplayRole: | 42 | if role == QtCore.Qt.DisplayRole: |
2611 | 45 | retval= self.items[row][1] | 43 | retval = self.items[row][1] |
2607 | 46 | # elif role == Qt.ToolTipRole: #not sure if need as it shows the database row number | ||
2608 | 47 | # retval= self.items[row][0] | ||
2612 | 48 | else: | 44 | else: |
2617 | 49 | retval= QVariant() | 45 | retval = QtCore.QVariant() |
2618 | 50 | # log.info("Returning"+ str(retval)) | 46 | if type(retval) is not type(QtCore.QVariant): |
2619 | 51 | if type(retval) is not type(QVariant): | 47 | return QtCore.QVariant(retval) |
2616 | 52 | return QVariant(retval) | ||
2620 | 53 | else: | 48 | else: |
2621 | 54 | return retval | 49 | return retval |
2622 | 55 | 50 | ||
2623 | @@ -60,10 +55,7 @@ | |||
2624 | 60 | def getId(self, index): | 55 | def getId(self, index): |
2625 | 61 | row = index.row() | 56 | row = index.row() |
2626 | 62 | return self.items[row][0] | 57 | return self.items[row][0] |
2628 | 63 | 58 | ||
2629 | 64 | def deleteRow(self, index): | 59 | def deleteRow(self, index): |
2630 | 65 | row = index.row() | 60 | row = index.row() |
2631 | 66 | self.removeRow(row) | 61 | self.removeRow(row) |
2632 | 67 | |||
2633 | 68 | if __name__=="__main__": | ||
2634 | 69 | sxml=TextListData() | ||
2635 | 70 | 62 | ||
2636 | === modified file 'openlp/plugins/images/imageplugin.py' | |||
2637 | --- openlp/plugins/images/imageplugin.py 2009-05-16 10:24:03 +0000 | |||
2638 | +++ openlp/plugins/images/imageplugin.py 2009-05-21 16:07:01 +0000 | |||
2639 | @@ -21,14 +21,12 @@ | |||
2640 | 21 | 21 | ||
2641 | 22 | from PyQt4 import QtCore, QtGui | 22 | from PyQt4 import QtCore, QtGui |
2642 | 23 | 23 | ||
2646 | 24 | from openlp.core.lib import Plugin, Event | 24 | from openlp.core.lib import Plugin, Event, EventType |
2644 | 25 | from openlp.core.lib import EventType | ||
2645 | 26 | |||
2647 | 27 | from openlp.plugins.images.lib import ImageMediaItem, ImageServiceItem | 25 | from openlp.plugins.images.lib import ImageMediaItem, ImageServiceItem |
2648 | 28 | 26 | ||
2649 | 29 | class ImagePlugin(Plugin): | 27 | class ImagePlugin(Plugin): |
2650 | 30 | global log | 28 | global log |
2652 | 31 | log=logging.getLogger(u'ImagePlugin') | 29 | log = logging.getLogger(u'ImagePlugin') |
2653 | 32 | log.info(u'Image Plugin loaded') | 30 | log.info(u'Image Plugin loaded') |
2654 | 33 | 31 | ||
2655 | 34 | def __init__(self, plugin_helpers): | 32 | def __init__(self, plugin_helpers): |
2656 | 35 | 33 | ||
2657 | === modified file 'openlp/plugins/images/lib/imageserviceitem.py' | |||
2658 | --- openlp/plugins/images/lib/imageserviceitem.py 2009-05-09 07:01:33 +0000 | |||
2659 | +++ openlp/plugins/images/lib/imageserviceitem.py 2009-05-22 18:30:25 +0000 | |||
2660 | @@ -17,8 +17,8 @@ | |||
2661 | 17 | this program; if not, write to the Free Software Foundation, Inc., 59 Temple | 17 | this program; if not, write to the Free Software Foundation, Inc., 59 Temple |
2662 | 18 | Place, Suite 330, Boston, MA 02111-1307 USA | 18 | Place, Suite 330, Boston, MA 02111-1307 USA |
2663 | 19 | """ | 19 | """ |
2664 | 20 | import logging | ||
2665 | 20 | from PyQt4 import QtCore, QtGui | 21 | from PyQt4 import QtCore, QtGui |
2666 | 21 | import logging | ||
2667 | 22 | from openlp.core.lib import ServiceItem | 22 | from openlp.core.lib import ServiceItem |
2668 | 23 | from listwithpreviews import ListWithPreviews | 23 | from listwithpreviews import ListWithPreviews |
2669 | 24 | 24 | ||
2670 | 25 | 25 | ||
2671 | === modified file 'openlp/plugins/images/lib/listwithpreviews.py' | |||
2672 | --- openlp/plugins/images/lib/listwithpreviews.py 2009-05-11 05:09:43 +0000 | |||
2673 | +++ openlp/plugins/images/lib/listwithpreviews.py 2009-05-22 19:36:16 +0000 | |||
2674 | @@ -1,51 +1,74 @@ | |||
2675 | 1 | # -*- coding: utf-8 -*- | ||
2676 | 2 | # vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4 | ||
2677 | 3 | """ | ||
2678 | 4 | OpenLP - Open Source Lyrics Projection | ||
2679 | 5 | Copyright (c) 2008 Raoul Snyman | ||
2680 | 6 | Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley | ||
2681 | 7 | |||
2682 | 8 | This program is free software; you can redistribute it and/or modify it under | ||
2683 | 9 | the terms of the GNU General Public License as published by the Free Software | ||
2684 | 10 | Foundation; version 2 of the License. | ||
2685 | 11 | |||
2686 | 12 | This program is distributed in the hope that it will be useful, but WITHOUT ANY | ||
2687 | 13 | WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A | ||
2688 | 14 | PARTICULAR PURPOSE. See the GNU General Public License for more details. | ||
2689 | 15 | |||
2690 | 16 | You should have received a copy of the GNU General Public License along with | ||
2691 | 17 | this program; if not, write to the Free Software Foundation, Inc., 59 Temple | ||
2692 | 18 | Place, Suite 330, Boston, MA 02111-1307 USA | ||
2693 | 19 | """ | ||
2694 | 1 | import os | 20 | import os |
2695 | 2 | import logging | 21 | import logging |
2699 | 3 | from PyQt4.QtCore import * | 22 | from PyQt4 import QtCore, QtGui |
2700 | 4 | from PyQt4.QtGui import * | 23 | |
2701 | 5 | class ListWithPreviews(QAbstractListModel): | 24 | |
2702 | 25 | class ListWithPreviews(QtCore.QAbstractListModel): | ||
2703 | 6 | """ | 26 | """ |
2704 | 7 | An abstract list of strings and the preview icon to go with them | 27 | An abstract list of strings and the preview icon to go with them |
2705 | 8 | """ | 28 | """ |
2706 | 9 | global log | 29 | global log |
2708 | 10 | log=logging.getLogger("ListWithPreviews") | 30 | log = logging.getLogger("ListWithPreviews") |
2709 | 11 | log.info("started") | 31 | log.info("started") |
2710 | 12 | 32 | ||
2711 | 13 | def __init__(self): | 33 | def __init__(self): |
2716 | 14 | QAbstractListModel.__init__(self) | 34 | QtCore.QAbstractListModel.__init__(self) |
2717 | 15 | self.items=[] # will be a list of (full filename, QPixmap, shortname) tuples | 35 | self.items = [] # will be a list of (full filename, QPixmap, shortname) tuples |
2718 | 16 | self.rowheight=50 | 36 | self.rowheight = 50 |
2719 | 17 | self.maximagewidth=self.rowheight*16/9.0; | 37 | self.maximagewidth = self.rowheight*16/9.0; |
2720 | 18 | 38 | ||
2721 | 19 | def rowCount(self, parent): | 39 | def rowCount(self, parent): |
2722 | 20 | return len(self.items) | 40 | return len(self.items) |
2723 | 21 | 41 | ||
2724 | 22 | def insertRow(self, row, filename): | 42 | def insertRow(self, row, filename): |
2727 | 23 | self.beginInsertRows(QModelIndex(),row,row) | 43 | self.beginInsertRows(QtCore.QModelIndex(),row,row) |
2728 | 24 | log.info("insert row %d:%s"%(row,filename)) | 44 | log.info("insert row %d:%s"% (row,filename)) |
2729 | 25 | # get short filename to display next to image | 45 | # get short filename to display next to image |
2730 | 26 | (prefix, shortfilename) = os.path.split(str(filename)) | 46 | (prefix, shortfilename) = os.path.split(str(filename)) |
2732 | 27 | log.info("shortfilename=%s"%(shortfilename)) | 47 | log.info("shortfilename=%s"% (shortfilename)) |
2733 | 28 | # create a preview image | 48 | # create a preview image |
2734 | 29 | if os.path.exists(filename): | 49 | if os.path.exists(filename): |
2739 | 30 | preview = QPixmap(str(filename)) | 50 | preview = QtGui.QPixmap(str(filename)) |
2740 | 31 | w=self.maximagewidth;h=self.rowheight | 51 | w = self.maximagewidth; |
2741 | 32 | preview = preview.scaled(w,h, Qt.KeepAspectRatio, Qt.SmoothTransformation) | 52 | h = self.rowheight |
2742 | 33 | realw=preview.width(); realh=preview.height() | 53 | preview = preview.scaled(w, h, QtCore.Qt.KeepAspectRatio, QtCore.Qt.SmoothTransformation) |
2743 | 54 | realw = preview.width(); | ||
2744 | 55 | realh = preview.height() | ||
2745 | 34 | # and move it to the centre of the preview space | 56 | # and move it to the centre of the preview space |
2749 | 35 | p=QPixmap(w,h) | 57 | p = QtGui.QPixmap(w,h) |
2750 | 36 | p.fill(Qt.transparent) | 58 | p.fill(QtCore.Qt.transparent) |
2751 | 37 | painter=QPainter(p) | 59 | painter = QtGui.QPainter(p) |
2752 | 38 | painter.drawPixmap((w-realw)/2,(h-realh)/2,preview) | 60 | painter.drawPixmap((w-realw)/2,(h-realh)/2,preview) |
2753 | 39 | else: | 61 | else: |
2757 | 40 | w=self.maximagewidth;h=self.rowheight | 62 | w = self.maximagewidth; |
2758 | 41 | p=QPixmap(w,h) | 63 | h = self.rowheight |
2759 | 42 | p.fill(Qt.transparent) | 64 | p = QtGui.QPixmap(w,h) |
2760 | 65 | p.fill(QtCore.Qt.transparent) | ||
2761 | 43 | # finally create the row | 66 | # finally create the row |
2762 | 44 | self.items.insert(row, (filename, p, shortfilename)) | 67 | self.items.insert(row, (filename, p, shortfilename)) |
2763 | 45 | self.endInsertRows() | 68 | self.endInsertRows() |
2764 | 46 | 69 | ||
2765 | 47 | def removeRow(self, row): | 70 | def removeRow(self, row): |
2767 | 48 | self.beginRemoveRows(QModelIndex(), row,row) | 71 | self.beginRemoveRows(QtCore.QModelIndex(), row, row) |
2768 | 49 | self.items.pop(row) | 72 | self.items.pop(row) |
2769 | 50 | self.endRemoveRows() | 73 | self.endRemoveRows() |
2770 | 51 | 74 | ||
2771 | @@ -53,20 +76,20 @@ | |||
2772 | 53 | self.insertRow(len(self.items), filename) | 76 | self.insertRow(len(self.items), filename) |
2773 | 54 | 77 | ||
2774 | 55 | def data(self, index, role): | 78 | def data(self, index, role): |
2784 | 56 | row=index.row() | 79 | row = index.row() |
2785 | 57 | if row > len(self.items): # if the last row is selected and deleted, we then get called with an empty row! | 80 | if row > len(self.items): |
2786 | 58 | return QVariant() | 81 | # if the last row is selected and deleted, we then get called with an empty row! |
2787 | 59 | if role==Qt.DisplayRole: | 82 | return QtCore.QVariant() |
2788 | 60 | retval= self.items[row][2] | 83 | if role == QtCore.Qt.DisplayRole: |
2789 | 61 | elif role == Qt.DecorationRole: | 84 | retval = self.items[row][2] |
2790 | 62 | retval= self.items[row][1] | 85 | elif role == QtCore.Qt.DecorationRole: |
2791 | 63 | elif role == Qt.ToolTipRole: | 86 | retval = self.items[row][1] |
2792 | 64 | retval= self.items[row][0] | 87 | elif role == QtCore.Qt.ToolTipRole: |
2793 | 88 | retval = self.items[row][0] | ||
2794 | 65 | else: | 89 | else: |
2799 | 66 | retval= QVariant() | 90 | retval = QtCore.QVariant() |
2800 | 67 | # log.info("Returning"+ str(retval)) | 91 | if type(retval) is not type(QtCore.QVariant): |
2801 | 68 | if type(retval) is not type(QVariant): | 92 | return QtCore.QVariant(retval) |
2798 | 69 | return QVariant(retval) | ||
2802 | 70 | else: | 93 | else: |
2803 | 71 | return retval | 94 | return retval |
2804 | 72 | 95 | ||
2805 | 73 | 96 | ||
2806 | === modified file 'openlp/plugins/images/lib/mediaitem.py' | |||
2807 | --- openlp/plugins/images/lib/mediaitem.py 2009-05-16 10:24:03 +0000 | |||
2808 | +++ openlp/plugins/images/lib/mediaitem.py 2009-05-22 18:30:25 +0000 | |||
2809 | @@ -22,10 +22,7 @@ | |||
2810 | 22 | 22 | ||
2811 | 23 | from PyQt4 import QtCore, QtGui | 23 | from PyQt4 import QtCore, QtGui |
2812 | 24 | 24 | ||
2817 | 25 | from openlp.core import translate | 25 | from openlp.core.lib import MediaManagerItem, ServiceItem, translate |
2814 | 26 | from openlp.core.lib import MediaManagerItem | ||
2815 | 27 | from openlp.core.lib import ServiceItem | ||
2816 | 28 | |||
2818 | 29 | from openlp.plugins.images.lib import ListWithPreviews | 26 | from openlp.plugins.images.lib import ListWithPreviews |
2819 | 30 | 27 | ||
2820 | 31 | class ImageList(QtGui.QListView): | 28 | class ImageList(QtGui.QListView): |
2821 | @@ -156,7 +153,7 @@ | |||
2822 | 156 | for index in indexes: | 153 | for index in indexes: |
2823 | 157 | filename = self.ImageListData.getFilename(index) | 154 | filename = self.ImageListData.getFilename(index) |
2824 | 158 | frame = QtGui.QPixmap(str(filename)) | 155 | frame = QtGui.QPixmap(str(filename)) |
2826 | 159 | service_item.frames.append({u'formatted': u'Image', u'image': frame}) | 156 | service_item.frames.append({u'title': filename , u'image': frame}) |
2827 | 160 | 157 | ||
2828 | 161 | def onImagePreviewClick(self): | 158 | def onImagePreviewClick(self): |
2829 | 162 | log.debug(u'Image Preview Requested') | 159 | log.debug(u'Image Preview Requested') |
2830 | 163 | 160 | ||
2831 | === modified file 'openlp/plugins/media/lib/mediaitem.py' | |||
2832 | --- openlp/plugins/media/lib/mediaitem.py 2009-05-18 04:41:49 +0000 | |||
2833 | +++ openlp/plugins/media/lib/mediaitem.py 2009-05-22 18:30:25 +0000 | |||
2834 | @@ -22,8 +22,7 @@ | |||
2835 | 22 | 22 | ||
2836 | 23 | from PyQt4 import QtCore, QtGui | 23 | from PyQt4 import QtCore, QtGui |
2837 | 24 | 24 | ||
2840 | 25 | from openlp.core import translate | 25 | from openlp.core.lib import MediaManagerItem, translate |
2839 | 26 | from openlp.core.lib import MediaManagerItem | ||
2841 | 27 | 26 | ||
2842 | 28 | from openlp.plugins.media.lib import MediaTab | 27 | from openlp.plugins.media.lib import MediaTab |
2843 | 29 | from openlp.plugins.media.lib import FileListData | 28 | from openlp.plugins.media.lib import FileListData |
2844 | @@ -33,7 +32,7 @@ | |||
2845 | 33 | This is the custom media manager item for Media Slides. | 32 | This is the custom media manager item for Media Slides. |
2846 | 34 | """ | 33 | """ |
2847 | 35 | global log | 34 | global log |
2849 | 36 | log=logging.getLogger(u'MediaMediaItem') | 35 | log = logging.getLogger(u'MediaMediaItem') |
2850 | 37 | log.info(u'Media Media Item loaded') | 36 | log.info(u'Media Media Item loaded') |
2851 | 38 | 37 | ||
2852 | 39 | def __init__(self, parent, icon, title): | 38 | def __init__(self, parent, icon, title): |
2853 | 40 | 39 | ||
2854 | === modified file 'openlp/plugins/media/lib/mediatab.py' | |||
2855 | --- openlp/plugins/media/lib/mediatab.py 2009-05-15 05:15:53 +0000 | |||
2856 | +++ openlp/plugins/media/lib/mediatab.py 2009-05-21 05:15:51 +0000 | |||
2857 | @@ -20,9 +20,7 @@ | |||
2858 | 20 | 20 | ||
2859 | 21 | from PyQt4 import QtCore, QtGui | 21 | from PyQt4 import QtCore, QtGui |
2860 | 22 | 22 | ||
2864 | 23 | from openlp.core import translate | 23 | from openlp.core.lib import SettingsTab, str_to_bool, translate |
2862 | 24 | from openlp import convertStringToBoolean | ||
2863 | 25 | from openlp.core.lib import SettingsTab | ||
2865 | 26 | 24 | ||
2866 | 27 | class MediaTab(SettingsTab): | 25 | class MediaTab(SettingsTab): |
2867 | 28 | """ | 26 | """ |
2868 | @@ -67,11 +65,12 @@ | |||
2869 | 67 | def onVMRCheckBoxChanged(self): | 65 | def onVMRCheckBoxChanged(self): |
2870 | 68 | use_vmr_mode = self.UseVMRCheckBox.checkState() | 66 | use_vmr_mode = self.UseVMRCheckBox.checkState() |
2871 | 69 | self.use_vmr_mode = False | 67 | self.use_vmr_mode = False |
2873 | 70 | if use_vmr_mode == 2: # we have a set value convert to True/False | 68 | if use_vmr_mode == 2: |
2874 | 69 | # we have a set value convert to True/False | ||
2875 | 71 | self.use_vmr_mode = True | 70 | self.use_vmr_mode = True |
2876 | 72 | 71 | ||
2877 | 73 | def load(self): | 72 | def load(self): |
2879 | 74 | self.use_vmr_mode = convertStringToBoolean(self.config.get_config(u'use mode layout', u'False')) | 73 | self.use_vmr_mode = str_to_bool(self.config.get_config(u'use mode layout', u'False')) |
2880 | 75 | if self.use_vmr_mode : | 74 | if self.use_vmr_mode : |
2881 | 76 | self.UseVMRCheckBox.setChecked(True) | 75 | self.UseVMRCheckBox.setChecked(True) |
2882 | 77 | 76 | ||
2883 | 78 | 77 | ||
2884 | === modified file 'openlp/plugins/media/mediaplugin.py' | |||
2885 | --- openlp/plugins/media/mediaplugin.py 2009-05-15 05:15:53 +0000 | |||
2886 | +++ openlp/plugins/media/mediaplugin.py 2009-05-21 05:15:51 +0000 | |||
2887 | @@ -20,7 +20,6 @@ | |||
2888 | 20 | import os | 20 | import os |
2889 | 21 | from PyQt4 import QtCore, QtGui | 21 | from PyQt4 import QtCore, QtGui |
2890 | 22 | 22 | ||
2891 | 23 | from openlp.core.resources import * | ||
2892 | 24 | from openlp.core.lib import Plugin, MediaManagerItem, SettingsTab | 23 | from openlp.core.lib import Plugin, MediaManagerItem, SettingsTab |
2893 | 25 | from openlp.plugins.media.lib import MediaTab,MediaMediaItem | 24 | from openlp.plugins.media.lib import MediaTab,MediaMediaItem |
2894 | 26 | 25 | ||
2895 | 27 | 26 | ||
2896 | === modified file 'openlp/plugins/presentations/lib/mediaitem.py' | |||
2897 | --- openlp/plugins/presentations/lib/mediaitem.py 2009-05-18 19:04:25 +0000 | |||
2898 | +++ openlp/plugins/presentations/lib/mediaitem.py 2009-05-22 18:30:25 +0000 | |||
2899 | @@ -21,11 +21,7 @@ | |||
2900 | 21 | import os | 21 | import os |
2901 | 22 | 22 | ||
2902 | 23 | from PyQt4 import QtCore, QtGui | 23 | from PyQt4 import QtCore, QtGui |
2908 | 24 | 24 | from openlp.core.lib import MediaManagerItem, translate | |
2904 | 25 | from openlp.core import translate | ||
2905 | 26 | from openlp.core.lib import MediaManagerItem | ||
2906 | 27 | from openlp.core.resources import * | ||
2907 | 28 | |||
2909 | 29 | from openlp.plugins.presentations.lib import FileListData | 25 | from openlp.plugins.presentations.lib import FileListData |
2910 | 30 | 26 | ||
2911 | 31 | class PresentationMediaItem(MediaManagerItem): | 27 | class PresentationMediaItem(MediaManagerItem): |
2912 | 32 | 28 | ||
2913 | === modified file 'openlp/plugins/songs/lib/mediaitem.py' | |||
2914 | --- openlp/plugins/songs/lib/mediaitem.py 2009-03-10 16:46:25 +0000 | |||
2915 | +++ openlp/plugins/songs/lib/mediaitem.py 2009-05-22 18:30:25 +0000 | |||
2916 | @@ -21,9 +21,7 @@ | |||
2917 | 21 | 21 | ||
2918 | 22 | from PyQt4 import QtCore, QtGui | 22 | from PyQt4 import QtCore, QtGui |
2919 | 23 | 23 | ||
2923 | 24 | from openlp.core import translate | 24 | from openlp.core.lib import MediaManagerItem, translate |
2921 | 25 | from openlp.core.lib import MediaManagerItem | ||
2922 | 26 | from openlp.core.resources import * | ||
2924 | 27 | 25 | ||
2925 | 28 | from openlp.plugins.songs.forms import EditSongForm | 26 | from openlp.plugins.songs.forms import EditSongForm |
2926 | 29 | 27 | ||
2927 | @@ -32,7 +30,7 @@ | |||
2928 | 32 | This is the custom media manager item for Songs. | 30 | This is the custom media manager item for Songs. |
2929 | 33 | """ | 31 | """ |
2930 | 34 | global log | 32 | global log |
2932 | 35 | log=logging.getLogger("SongMediaItem") | 33 | log = logging.getLogger("SongMediaItem") |
2933 | 36 | log.info("Song Media Item loaded") | 34 | log.info("Song Media Item loaded") |
2934 | 37 | 35 | ||
2935 | 38 | def __init__(self, parent, icon, title): | 36 | def __init__(self, parent, icon, title): |
2936 | 39 | 37 | ||
2937 | === modified file 'openlp/plugins/songs/lib/songstab.py' | |||
2938 | --- openlp/plugins/songs/lib/songstab.py 2009-02-28 23:31:24 +0000 | |||
2939 | +++ openlp/plugins/songs/lib/songstab.py 2009-05-21 16:07:01 +0000 | |||
2940 | @@ -20,9 +20,7 @@ | |||
2941 | 20 | 20 | ||
2942 | 21 | from PyQt4 import QtCore, QtGui | 21 | from PyQt4 import QtCore, QtGui |
2943 | 22 | 22 | ||
2947 | 23 | from openlp.core import translate | 23 | from openlp.core.lib import SettingsTab, translate |
2945 | 24 | from openlp.core.lib import SettingsTab | ||
2946 | 25 | from openlp.core.resources import * | ||
2948 | 26 | 24 | ||
2949 | 27 | class SongsTab(SettingsTab): | 25 | class SongsTab(SettingsTab): |
2950 | 28 | """ | 26 | """ |
2951 | 29 | 27 | ||
2952 | === modified file 'openlp/plugins/songs/songsplugin.py' | |||
2953 | --- openlp/plugins/songs/songsplugin.py 2009-05-16 16:38:03 +0000 | |||
2954 | +++ openlp/plugins/songs/songsplugin.py 2009-05-22 18:30:25 +0000 | |||
2955 | @@ -21,7 +21,6 @@ | |||
2956 | 21 | 21 | ||
2957 | 22 | from PyQt4 import QtCore, QtGui | 22 | from PyQt4 import QtCore, QtGui |
2958 | 23 | 23 | ||
2959 | 24 | from openlp.core.resources import * | ||
2960 | 25 | from openlp.core.lib import Plugin, Event | 24 | from openlp.core.lib import Plugin, Event |
2961 | 26 | from openlp.core.lib import EventType | 25 | from openlp.core.lib import EventType |
2962 | 27 | from openlp.plugins.songs.lib import SongManager, SongsTab, SongMediaItem | 26 | from openlp.plugins.songs.lib import SongManager, SongsTab, SongMediaItem |
2963 | @@ -31,7 +30,7 @@ | |||
2964 | 31 | class SongsPlugin(Plugin): | 30 | class SongsPlugin(Plugin): |
2965 | 32 | 31 | ||
2966 | 33 | global log | 32 | global log |
2968 | 34 | log=logging.getLogger(u'SongsPlugin') | 33 | log = logging.getLogger(u'SongsPlugin') |
2969 | 35 | log.info(u'Song Plugin loaded') | 34 | log.info(u'Song Plugin loaded') |
2970 | 36 | 35 | ||
2971 | 37 | def __init__(self, plugin_helpers): | 36 | def __init__(self, plugin_helpers): |
2972 | @@ -124,7 +123,7 @@ | |||
2973 | 124 | """ | 123 | """ |
2974 | 125 | Handle the event contained in the event object. | 124 | Handle the event contained in the event object. |
2975 | 126 | """ | 125 | """ |
2977 | 127 | log.debug(u'Handle event called with event %s'%event.event_type) | 126 | log.debug(u'Handle event called with event %s' % event.event_type) |
2978 | 128 | if event.event_type == EventType.ThemeListChanged: | 127 | if event.event_type == EventType.ThemeListChanged: |
2979 | 129 | log.debug(u'New Theme request received') | 128 | log.debug(u'New Theme request received') |
2980 | 130 | #self.edit_custom_form.loadThemes(self.theme_manager.getThemes()) | 129 | #self.edit_custom_form.loadThemes(self.theme_manager.getThemes()) |
Ok then, time for another merge.
Lots of goddies this time. Mostly "style police" cleanups but some bug fixes as well.
Images in themes seem to work now as well as theme selection controlled from the settings.