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 | ||
Martin Thompson (community) | Approve | ||
Review via email:
|
Commit message
Description of the change
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Tim Bentley (trb143) wrote : | # |
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Martin Thompson (mjthompson) wrote : | # |
Possible tweaks?
Line 69 of diff - would the uninit'ed theme be better as None than u'' - more pythonic? At line 437, it does seem to be that way
Line 113 - extra space after comma
Lines:
158 + self.service_theme = self.ThemeCombo
159 + self.RenderMana
160 + self.config.
Do all these three have to be kept in sync like this? It feels a bit potentially "fragile" (to me), but I guess if it's only ever going to be done this once, it won't matter!
Line 277: Would it be acceptable to use double-quoted strings to avoid escaping all the single quotes (this is the reason I default to double-quoted strings in my code :)
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Raoul Snyman (raoul-snyman) wrote : | # |
Erm, what's happening here?
112 - def __init__(self, parent, screens):
113 + def __init__(self, parent , screens):
Also not sure why some lines seem to have been removed and then added again...
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Tim Bentley (trb143) : | # |
Preview Diff
1 | === modified file 'openlp/core/lib/renderer.py' | |||
2 | --- openlp/core/lib/renderer.py 2009-05-17 15:24:02 +0000 | |||
3 | +++ openlp/core/lib/renderer.py 2009-05-19 16:27:01 +0000 | |||
4 | @@ -78,26 +78,19 @@ | |||
5 | 78 | 78 | ||
6 | 79 | def scale_bg_image(self): | 79 | def scale_bg_image(self): |
7 | 80 | assert self._frame | 80 | assert self._frame |
28 | 81 | image = QtGui.QImage(self._bg_image_filename) | 81 | preview = QtGui.QPixmap(self._bg_image_filename) |
29 | 82 | # rescale and offset | 82 | width = self._frame.width() |
30 | 83 | imw = image.width() | 83 | height = self._frame.height() |
31 | 84 | imh = image.height() | 84 | preview = preview.scaled(width, height, QtCore.Qt.KeepAspectRatio, QtCore.Qt.SmoothTransformation) |
32 | 85 | dcw = self._frame.width()+1 | 85 | realwidth = preview.width() |
33 | 86 | dch = self._frame.height() | 86 | realheight = preview.height() |
34 | 87 | imratio = imw/float(imh) | 87 | # and move it to the centre of the preview space |
35 | 88 | dcratio = dcw/float(dch) | 88 | self.bg_image = QtGui.QPixmap(width, height) |
36 | 89 | log.debug(u'Image scaling params %s %s %s %s %s %s', imw, imh, imratio, dcw, dch, dcratio) | 89 | self.bg_image.fill(QtCore.Qt.transparent) |
37 | 90 | if imratio > dcratio: | 90 | painter = QtGui.QPainter(self.bg_image) |
38 | 91 | scale = dcw/float(imw) | 91 | self.background_offsetx = (width - realwidth) / 2 |
39 | 92 | elif imratio < dcratio: | 92 | self.background_offsety = (height - realheight) / 2 |
40 | 93 | scale = dch/float(imh) | 93 | painter.drawPixmap(self.background_offsetx, self.background_offsety , preview) |
21 | 94 | else: | ||
22 | 95 | scale = dcw/float(imw) # either will do | ||
23 | 96 | neww = int(round(imw*scale)) | ||
24 | 97 | newh = int(round(imh*scale)) | ||
25 | 98 | self.background_offsetx=(dcw-neww)/2 | ||
26 | 99 | self.background_offsety=(dch-newh)/2 | ||
27 | 100 | self.bg_image=QtGui.QPixmap.fromImage(image.scaled(QtCore.QSize(neww, newh), Qt.Qt.KeepAspectRatio)) | ||
41 | 101 | 94 | ||
42 | 102 | def set_frame_dest(self, frame_width, frame_height, preview=False): | 95 | def set_frame_dest(self, frame_width, frame_height, preview=False): |
43 | 103 | """ | 96 | """ |
44 | @@ -118,6 +111,7 @@ | |||
45 | 118 | """ | 111 | """ |
46 | 119 | log.debug(u'format_slide %s', words) | 112 | log.debug(u'format_slide %s', words) |
47 | 120 | verses = [] | 113 | verses = [] |
48 | 114 | words=words.replace("\r\n", "\n") | ||
49 | 121 | verses_text = words.split(u'\n\n') | 115 | verses_text = words.split(u'\n\n') |
50 | 122 | for verse in verses_text: | 116 | for verse in verses_text: |
51 | 123 | lines = verse.split(u'\n') | 117 | lines = verse.split(u'\n') |
52 | 124 | 118 | ||
53 | === modified file 'openlp/core/lib/rendermanager.py' | |||
54 | --- openlp/core/lib/rendermanager.py 2009-05-17 15:24:02 +0000 | |||
55 | +++ openlp/core/lib/rendermanager.py 2009-05-18 19:47:18 +0000 | |||
56 | @@ -44,8 +44,6 @@ | |||
57 | 44 | print "%s:%s: %s" % (name, lineno, line.rstrip()) | 44 | print "%s:%s: %s" % (name, lineno, line.rstrip()) |
58 | 45 | return traceit | 45 | return traceit |
59 | 46 | 46 | ||
60 | 47 | |||
61 | 48 | |||
62 | 49 | class RenderManager: | 47 | class RenderManager: |
63 | 50 | """ | 48 | """ |
64 | 51 | Class to pull all Renderer interactions into one place. | 49 | Class to pull all Renderer interactions into one place. |
65 | @@ -64,14 +62,34 @@ | |||
66 | 64 | self.current_display = 0 | 62 | self.current_display = 0 |
67 | 65 | self.renderer = Renderer() | 63 | self.renderer = Renderer() |
68 | 66 | self.calculate_default(self.screen_list[self.current_display]['size']) | 64 | self.calculate_default(self.screen_list[self.current_display]['size']) |
69 | 65 | self.theme = u'' | ||
70 | 66 | |||
71 | 67 | def set_global_theme(self, global_theme, global_style = u'Global'): | ||
72 | 68 | self.global_theme = global_theme | ||
73 | 69 | self.global_style = global_style | ||
74 | 70 | |||
75 | 71 | def set_service_theme(self, service_theme): | ||
76 | 72 | self.service_theme = service_theme | ||
77 | 67 | 73 | ||
78 | 68 | def set_override_theme(self, theme): | 74 | def set_override_theme(self, theme): |
79 | 69 | log.debug(u'set override theme to %s', theme) | 75 | log.debug(u'set override theme to %s', theme) |
82 | 70 | if theme is not None: | 76 | if self.global_style == u'Global': |
83 | 71 | self.theme = theme | 77 | self.theme = self.global_theme |
84 | 78 | elif self.global_style == u'Service': | ||
85 | 79 | if self.service_theme == u'': | ||
86 | 80 | self.theme = self.global_theme | ||
87 | 81 | else: | ||
88 | 82 | self.theme = self.service_theme | ||
89 | 72 | else: | 83 | else: |
92 | 73 | self.theme = self.default_theme | 84 | if theme is not None: |
93 | 74 | if self.theme != self.renderer.theme_name: | 85 | self.theme = theme |
94 | 86 | elif self.global_style == u'Service': | ||
95 | 87 | if self.service_theme == u'': | ||
96 | 88 | self.theme = self.global_theme | ||
97 | 89 | else: | ||
98 | 90 | self.theme = self.service_theme | ||
99 | 91 | |||
100 | 92 | if self.theme is not self.renderer.theme_name: | ||
101 | 75 | log.debug(u'theme is now %s', self.theme) | 93 | log.debug(u'theme is now %s', self.theme) |
102 | 76 | self.themedata = self.theme_manager.getThemeData(self.theme) | 94 | self.themedata = self.theme_manager.getThemeData(self.theme) |
103 | 77 | self.calculate_default(self.screen_list[self.current_display]['size']) | 95 | self.calculate_default(self.screen_list[self.current_display]['size']) |
104 | 78 | 96 | ||
105 | === modified file 'openlp/core/ui/maindisplay.py' | |||
106 | --- openlp/core/ui/maindisplay.py 2009-05-16 19:47:30 +0000 | |||
107 | +++ openlp/core/ui/maindisplay.py 2009-05-18 19:04:25 +0000 | |||
108 | @@ -24,7 +24,7 @@ | |||
109 | 24 | 24 | ||
110 | 25 | class MainDisplay(QtGui.QWidget): | 25 | class MainDisplay(QtGui.QWidget): |
111 | 26 | 26 | ||
113 | 27 | def __init__(self, parent, screens): | 27 | def __init__(self, parent , screens): |
114 | 28 | QtGui.QWidget.__init__(self, parent) | 28 | QtGui.QWidget.__init__(self, parent) |
115 | 29 | self.setWindowTitle(u'OpenLP Display') | 29 | self.setWindowTitle(u'OpenLP Display') |
116 | 30 | self.screens = screens | 30 | self.screens = screens |
117 | 31 | 31 | ||
118 | === modified file 'openlp/core/ui/mainwindow.py' | |||
119 | --- openlp/core/ui/mainwindow.py 2009-05-16 16:38:03 +0000 | |||
120 | +++ openlp/core/ui/mainwindow.py 2009-05-18 19:04:25 +0000 | |||
121 | @@ -43,7 +43,7 @@ | |||
122 | 43 | self.EventManager = EventManager() | 43 | self.EventManager = EventManager() |
123 | 44 | self.alert_form = AlertForm() | 44 | self.alert_form = AlertForm() |
124 | 45 | self.about_form = AboutForm() | 45 | self.about_form = AboutForm() |
126 | 46 | self.settings_form = SettingsForm(self.screen_list) | 46 | self.settings_form = SettingsForm(self.screen_list, self) |
127 | 47 | 47 | ||
128 | 48 | pluginpath = os.path.split(os.path.abspath(__file__))[0] | 48 | pluginpath = os.path.split(os.path.abspath(__file__))[0] |
129 | 49 | pluginpath = os.path.abspath(os.path.join(pluginpath, u'..', u'..', u'plugins')) | 49 | pluginpath = os.path.abspath(os.path.join(pluginpath, u'..', u'..', u'plugins')) |
130 | 50 | 50 | ||
131 | === modified file 'openlp/core/ui/servicemanager.py' | |||
132 | --- openlp/core/ui/servicemanager.py 2009-05-16 16:38:03 +0000 | |||
133 | +++ openlp/core/ui/servicemanager.py 2009-05-18 19:04:25 +0000 | |||
134 | @@ -21,7 +21,7 @@ | |||
135 | 21 | import logging | 21 | import logging |
136 | 22 | 22 | ||
137 | 23 | from PyQt4 import QtCore, QtGui | 23 | from PyQt4 import QtCore, QtGui |
139 | 24 | 24 | from openlp.core.lib import PluginConfig | |
140 | 25 | from openlp.core.lib import OpenLPToolbar | 25 | from openlp.core.lib import OpenLPToolbar |
141 | 26 | from openlp.core.lib import ServiceItem | 26 | from openlp.core.lib import ServiceItem |
142 | 27 | from openlp.core.lib import RenderManager | 27 | from openlp.core.lib import RenderManager |
143 | @@ -103,6 +103,9 @@ | |||
144 | 103 | QtCore.QObject.connect(self.ThemeComboBox, | 103 | QtCore.QObject.connect(self.ThemeComboBox, |
145 | 104 | QtCore.SIGNAL("activated(int)"), self.onThemeComboBoxSelected) | 104 | QtCore.SIGNAL("activated(int)"), self.onThemeComboBoxSelected) |
146 | 105 | 105 | ||
147 | 106 | self.config = PluginConfig(u'Main') | ||
148 | 107 | self.service_theme = self.config.get_config(u'theme service theme', u'') | ||
149 | 108 | |||
150 | 106 | def contextMenuAction(self, base, icon, text, slot): | 109 | def contextMenuAction(self, base, icon, text, slot): |
151 | 107 | """ | 110 | """ |
152 | 108 | Utility method to help build context menus for plugins | 111 | Utility method to help build context menus for plugins |
153 | @@ -142,7 +145,9 @@ | |||
154 | 142 | pass | 145 | pass |
155 | 143 | 146 | ||
156 | 144 | def onThemeComboBoxSelected(self, currentIndex): | 147 | def onThemeComboBoxSelected(self, currentIndex): |
158 | 145 | self.RenderManager.default_theme = self.ThemeComboBox.currentText() | 148 | self.service_theme = self.ThemeComboBox.currentText() |
159 | 149 | self.RenderManager.set_service_theme(self.service_theme) | ||
160 | 150 | self.config.set_config(u'theme service theme', self.service_theme) | ||
161 | 146 | 151 | ||
162 | 147 | def addServiceItem(self, item): | 152 | def addServiceItem(self, item): |
163 | 148 | self.serviceItems.append({u'data': item, u'order': len(self.serviceItems)+1}) | 153 | self.serviceItems.append({u'data': item, u'order': len(self.serviceItems)+1}) |
164 | @@ -224,7 +229,11 @@ | |||
165 | 224 | Called from ThemeManager when the Themes have changed | 229 | Called from ThemeManager when the Themes have changed |
166 | 225 | """ | 230 | """ |
167 | 226 | self.ThemeComboBox.clear() | 231 | self.ThemeComboBox.clear() |
168 | 232 | self.ThemeComboBox.addItem(u'') | ||
169 | 227 | for theme in theme_list: | 233 | for theme in theme_list: |
170 | 228 | self.ThemeComboBox.addItem(theme) | 234 | self.ThemeComboBox.addItem(theme) |
173 | 229 | self.RenderManager.default_theme = self.ThemeComboBox.currentText() | 235 | id = self.ThemeComboBox.findText(str(self.service_theme), QtCore.Qt.MatchExactly) |
174 | 230 | 236 | if id == -1: | |
175 | 237 | id = 0 # Not Found | ||
176 | 238 | self.service_theme = u'' | ||
177 | 239 | self.ThemeComboBox.setCurrentIndex(id) | ||
178 | 231 | 240 | ||
179 | === modified file 'openlp/core/ui/settingsform.py' | |||
180 | --- openlp/core/ui/settingsform.py 2009-05-01 11:50:09 +0000 | |||
181 | +++ openlp/core/ui/settingsform.py 2009-05-18 19:04:25 +0000 | |||
182 | @@ -31,14 +31,14 @@ | |||
183 | 31 | 31 | ||
184 | 32 | class SettingsForm(QtGui.QDialog, Ui_SettingsDialog): | 32 | class SettingsForm(QtGui.QDialog, Ui_SettingsDialog): |
185 | 33 | 33 | ||
188 | 34 | def __init__(self, screen_list, parent=None): | 34 | def __init__(self, screen_list, mainWindow, parent=None): |
189 | 35 | QtGui.QDialog.__init__(self, parent) | 35 | QtGui.QDialog.__init__(self, None) |
190 | 36 | self.setupUi(self) | 36 | self.setupUi(self) |
191 | 37 | # General tab | 37 | # General tab |
192 | 38 | self.GeneralTab = GeneralTab(screen_list) | 38 | self.GeneralTab = GeneralTab(screen_list) |
193 | 39 | self.addTab(self.GeneralTab) | 39 | self.addTab(self.GeneralTab) |
194 | 40 | # Themes tab | 40 | # Themes tab |
196 | 41 | self.ThemesTab = ThemesTab() | 41 | self.ThemesTab = ThemesTab(mainWindow) |
197 | 42 | self.addTab(self.ThemesTab) | 42 | self.addTab(self.ThemesTab) |
198 | 43 | # Alert tab | 43 | # Alert tab |
199 | 44 | self.AlertsTab = AlertsTab() | 44 | self.AlertsTab = AlertsTab() |
200 | 45 | 45 | ||
201 | === modified file 'openlp/core/ui/thememanager.py' | |||
202 | --- openlp/core/ui/thememanager.py 2009-05-17 08:25:15 +0000 | |||
203 | +++ openlp/core/ui/thememanager.py 2009-05-18 19:47:18 +0000 | |||
204 | @@ -367,3 +367,7 @@ | |||
205 | 367 | frame = self.RenderManager.generate_preview(themedata) | 367 | frame = self.RenderManager.generate_preview(themedata) |
206 | 368 | return frame | 368 | return frame |
207 | 369 | 369 | ||
208 | 370 | def getPreviewImage(self, theme): | ||
209 | 371 | log.debug(u'getPreviewImage %s ', theme) | ||
210 | 372 | image = os.path.join(self.path, theme + u'.png') | ||
211 | 373 | return image | ||
212 | 370 | 374 | ||
213 | === modified file 'openlp/core/ui/themestab.py' | |||
214 | --- openlp/core/ui/themestab.py 2009-05-16 16:38:03 +0000 | |||
215 | +++ openlp/core/ui/themestab.py 2009-05-18 19:47:18 +0000 | |||
216 | @@ -3,7 +3,7 @@ | |||
217 | 3 | """ | 3 | """ |
218 | 4 | OpenLP - Open Source Lyrics Projection | 4 | OpenLP - Open Source Lyrics Projection |
219 | 5 | Copyright (c) 2008 Raoul Snyman | 5 | Copyright (c) 2008 Raoul Snyman |
221 | 6 | Portions copyright (c) 2008 Martin Thompson, Tim Bentley, | 6 | Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley, |
222 | 7 | 7 | ||
223 | 8 | This program is free software; you can redistribute it and/or modify it under | 8 | This program is free software; you can redistribute it and/or modify it under |
224 | 9 | the terms of the GNU General Public License as published by the Free Software | 9 | the terms of the GNU General Public License as published by the Free Software |
225 | @@ -22,13 +22,13 @@ | |||
226 | 22 | 22 | ||
227 | 23 | from openlp.core import translate | 23 | from openlp.core import translate |
228 | 24 | from openlp.core.lib import SettingsTab | 24 | from openlp.core.lib import SettingsTab |
229 | 25 | from openlp.core.resources import * | ||
230 | 26 | 25 | ||
231 | 27 | class ThemesTab(SettingsTab): | 26 | class ThemesTab(SettingsTab): |
232 | 28 | """ | 27 | """ |
233 | 29 | ThemesTab is the theme settings tab in the settings dialog. | 28 | ThemesTab is the theme settings tab in the settings dialog. |
234 | 30 | """ | 29 | """ |
236 | 31 | def __init__(self): | 30 | def __init__(self, parent): |
237 | 31 | self.parent = parent | ||
238 | 32 | SettingsTab.__init__(self, u'Themes') | 32 | SettingsTab.__init__(self, u'Themes') |
239 | 33 | 33 | ||
240 | 34 | def setupUi(self): | 34 | def setupUi(self): |
241 | @@ -45,11 +45,8 @@ | |||
242 | 45 | self.GlobalGroupBoxLayout.setObjectName(u'GlobalGroupBoxLayout') | 45 | self.GlobalGroupBoxLayout.setObjectName(u'GlobalGroupBoxLayout') |
243 | 46 | self.DefaultComboBox = QtGui.QComboBox(self.GlobalGroupBox) | 46 | self.DefaultComboBox = QtGui.QComboBox(self.GlobalGroupBox) |
244 | 47 | self.DefaultComboBox.setObjectName(u'DefaultComboBox') | 47 | self.DefaultComboBox.setObjectName(u'DefaultComboBox') |
245 | 48 | self.DefaultComboBox.addItem(QtCore.QString()) | ||
246 | 49 | self.DefaultComboBox.addItem(QtCore.QString()) | ||
247 | 50 | self.DefaultComboBox.addItem(QtCore.QString()) | ||
248 | 51 | self.GlobalGroupBoxLayout.addWidget(self.DefaultComboBox) | 48 | self.GlobalGroupBoxLayout.addWidget(self.DefaultComboBox) |
250 | 52 | self.DefaultListView = QtGui.QListView(self.GlobalGroupBox) | 49 | self.DefaultListView = QtGui.QLabel(self.GlobalGroupBox) |
251 | 53 | self.DefaultListView.setObjectName(u'DefaultListView') | 50 | self.DefaultListView.setObjectName(u'DefaultListView') |
252 | 54 | self.GlobalGroupBoxLayout.addWidget(self.DefaultListView) | 51 | self.GlobalGroupBoxLayout.addWidget(self.DefaultListView) |
253 | 55 | self.ThemesTabLayout.addWidget(self.GlobalGroupBox) | 52 | self.ThemesTabLayout.addWidget(self.GlobalGroupBox) |
254 | @@ -93,11 +90,20 @@ | |||
255 | 93 | self.GlobalLevelLabel) | 90 | self.GlobalLevelLabel) |
256 | 94 | self.ThemesTabLayout.addWidget(self.LevelGroupBox) | 91 | self.ThemesTabLayout.addWidget(self.LevelGroupBox) |
257 | 95 | 92 | ||
258 | 93 | QtCore.QObject.connect(self.SongLevelRadioButton, | ||
259 | 94 | QtCore.SIGNAL("pressed()"), self.onSongLevelButtonPressed) | ||
260 | 95 | QtCore.QObject.connect(self.ServiceLevelRadioButton, | ||
261 | 96 | QtCore.SIGNAL("pressed()"), self.onServiceLevelButtonPressed) | ||
262 | 97 | QtCore.QObject.connect(self.GlobalLevelRadioButton, | ||
263 | 98 | QtCore.SIGNAL("pressed()"), self.onGlobalLevelButtonPressed) | ||
264 | 99 | |||
265 | 100 | QtCore.QObject.connect(self.DefaultComboBox, | ||
266 | 101 | QtCore.SIGNAL("activated(int)"), self.onDefaultComboBoxChanged) | ||
267 | 102 | |||
268 | 103 | #self.DefaultListView.setScaledContents(True) | ||
269 | 104 | |||
270 | 96 | def retranslateUi(self): | 105 | def retranslateUi(self): |
271 | 97 | self.GlobalGroupBox.setTitle(translate(u'ThemesTab', u'Global theme')) | 106 | self.GlobalGroupBox.setTitle(translate(u'ThemesTab', u'Global theme')) |
272 | 98 | self.DefaultComboBox.setItemText(0, translate(u'ThemesTab', u'African Sunset')) | ||
273 | 99 | self.DefaultComboBox.setItemText(1, translate(u'ThemesTab', u'Snowy Mountains')) | ||
274 | 100 | self.DefaultComboBox.setItemText(2, translate(u'ThemesTab', u'Wilderness')) | ||
275 | 101 | self.LevelGroupBox.setTitle(translate(u'ThemesTab', u'Theme level')) | 107 | self.LevelGroupBox.setTitle(translate(u'ThemesTab', u'Theme level')) |
276 | 102 | self.SongLevelRadioButton.setText(translate(u'ThemesTab', u'Song level')) | 108 | self.SongLevelRadioButton.setText(translate(u'ThemesTab', u'Song level')) |
277 | 103 | self.SongLevelLabel.setText(translate(u'ThemesTab', u'Use the theme from each song in the database. If a song doesn\'t have a theme associated with it, then use the service\'s theme. If the service doesn\'t have a theme, then use the global theme.')) | 109 | self.SongLevelLabel.setText(translate(u'ThemesTab', u'Use the theme from each song in the database. If a song doesn\'t have a theme associated with it, then use the service\'s theme. If the service doesn\'t have a theme, then use the global theme.')) |
278 | @@ -106,6 +112,40 @@ | |||
279 | 106 | self.GlobalLevelRadioButton.setText(translate(u'ThemesTab', u'Global level')) | 112 | self.GlobalLevelRadioButton.setText(translate(u'ThemesTab', u'Global level')) |
280 | 107 | self.GlobalLevelLabel.setText(translate(u'ThemesTab', u'Use the global theme, overriding any themes associated wither either the service or the songs.')) | 113 | self.GlobalLevelLabel.setText(translate(u'ThemesTab', u'Use the global theme, overriding any themes associated wither either the service or the songs.')) |
281 | 108 | 114 | ||
282 | 115 | def load(self): | ||
283 | 116 | self.global_style = self.config.get_config(u'theme global style', u'Global') | ||
284 | 117 | self.global_theme = self.config.get_config(u'theme global theme', u'') | ||
285 | 118 | if self.global_style == u'Global': | ||
286 | 119 | self.GlobalLevelRadioButton.setChecked(True) | ||
287 | 120 | elif self.global_style == u'Service': | ||
288 | 121 | self.ServiceLevelRadioButton.setChecked(True) | ||
289 | 122 | else: | ||
290 | 123 | self.SongLevelRadioButton.setChecked(True) | ||
291 | 124 | |||
292 | 125 | def save(self): | ||
293 | 126 | self.config.set_config(u'theme global style', self.global_style ) | ||
294 | 127 | self.config.set_config(u'theme global theme',self.global_theme) | ||
295 | 128 | |||
296 | 129 | def onSongLevelButtonPressed(self): | ||
297 | 130 | self.global_style= u'Song' | ||
298 | 131 | self.parent.RenderManager.set_global_theme(self.global_theme, self.global_style) | ||
299 | 132 | |||
300 | 133 | def onServiceLevelButtonPressed(self): | ||
301 | 134 | self.global_style= u'Service' | ||
302 | 135 | self.parent.RenderManager.set_global_theme(self.global_theme, self.global_style) | ||
303 | 136 | |||
304 | 137 | def onGlobalLevelButtonPressed(self): | ||
305 | 138 | self.global_style= u'Global' | ||
306 | 139 | self.parent.RenderManager.set_global_theme(self.global_theme, self.global_style) | ||
307 | 140 | |||
308 | 141 | def onDefaultComboBoxChanged(self, value): | ||
309 | 142 | self.global_theme = self.DefaultComboBox.currentText() | ||
310 | 143 | self.parent.RenderManager.set_global_theme(self.global_theme, self.global_style) | ||
311 | 144 | image = self.parent.ThemeManagerContents.getPreviewImage(str(self.global_theme)) | ||
312 | 145 | preview = QtGui.QPixmap(str(image)) | ||
313 | 146 | display = preview.scaled(300, 255, QtCore.Qt.KeepAspectRatio, QtCore.Qt.SmoothTransformation) | ||
314 | 147 | self.DefaultListView.setPixmap(display) | ||
315 | 148 | |||
316 | 109 | def updateThemeList(self, theme_list): | 149 | def updateThemeList(self, theme_list): |
317 | 110 | """ | 150 | """ |
318 | 111 | Called from ThemeManager when the Themes have changed | 151 | Called from ThemeManager when the Themes have changed |
319 | @@ -113,3 +153,14 @@ | |||
320 | 113 | self.DefaultComboBox.clear() | 153 | self.DefaultComboBox.clear() |
321 | 114 | for theme in theme_list: | 154 | for theme in theme_list: |
322 | 115 | self.DefaultComboBox.addItem(theme) | 155 | self.DefaultComboBox.addItem(theme) |
323 | 156 | id = self.DefaultComboBox.findText(str(self.global_theme), QtCore.Qt.MatchExactly) | ||
324 | 157 | if id == -1: | ||
325 | 158 | id = 0 # Not Found | ||
326 | 159 | self.global_theme = u'' | ||
327 | 160 | self.DefaultComboBox.setCurrentIndex(id) | ||
328 | 161 | self.parent.RenderManager.set_global_theme(self.global_theme, self.global_style) | ||
329 | 162 | if self.global_theme is not u'': | ||
330 | 163 | image = self.parent.ThemeManagerContents.getPreviewImage(str(self.global_theme)) | ||
331 | 164 | preview = QtGui.QPixmap(str(image)) | ||
332 | 165 | display = preview.scaled(300, 255, QtCore.Qt.KeepAspectRatio, QtCore.Qt.SmoothTransformation) | ||
333 | 166 | self.DefaultListView.setPixmap(display) | ||
334 | 116 | 167 | ||
335 | === modified file 'openlp/plugins/bibles/lib/biblestab.py' | |||
336 | --- openlp/plugins/bibles/lib/biblestab.py 2009-05-17 15:24:02 +0000 | |||
337 | +++ openlp/plugins/bibles/lib/biblestab.py 2009-05-18 16:11:59 +0000 | |||
338 | @@ -3,7 +3,7 @@ | |||
339 | 3 | """ | 3 | """ |
340 | 4 | OpenLP - Open Source Lyrics Projection | 4 | OpenLP - Open Source Lyrics Projection |
341 | 5 | Copyright (c) 2008 Raoul Snyman | 5 | Copyright (c) 2008 Raoul Snyman |
343 | 6 | Portions copyright (c) 2008 Martin Thompson, Tim Bentley, | 6 | Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley, |
344 | 7 | 7 | ||
345 | 8 | This program is free software; you can redistribute it and/or modify it under | 8 | This program is free software; you can redistribute it and/or modify it under |
346 | 9 | the terms of the GNU General Public License as published by the Free Software | 9 | the terms of the GNU General Public License as published by the Free Software |
347 | @@ -18,7 +18,7 @@ | |||
348 | 18 | Place, Suite 330, Boston, MA 02111-1307 USA | 18 | Place, Suite 330, Boston, MA 02111-1307 USA |
349 | 19 | """ | 19 | """ |
350 | 20 | 20 | ||
352 | 21 | from PyQt4 import QtCore, QtGui | 21 | from PyQt4 import Qt, QtCore, QtGui |
353 | 22 | 22 | ||
354 | 23 | from openlp.core import translate | 23 | from openlp.core import translate |
355 | 24 | from openlp import convertStringToBoolean | 24 | from openlp import convertStringToBoolean |
356 | @@ -144,6 +144,8 @@ | |||
357 | 144 | QtCore.SIGNAL("pressed()"), self.onParagraphRadioButtonPressed) | 144 | QtCore.SIGNAL("pressed()"), self.onParagraphRadioButtonPressed) |
358 | 145 | QtCore.QObject.connect(self.DisplayStyleComboBox, | 145 | QtCore.QObject.connect(self.DisplayStyleComboBox, |
359 | 146 | QtCore.SIGNAL("activated(int)"), self.onDisplayStyleComboBoxChanged) | 146 | QtCore.SIGNAL("activated(int)"), self.onDisplayStyleComboBoxChanged) |
360 | 147 | QtCore.QObject.connect(self.BibleThemeComboBox, | ||
361 | 148 | QtCore.SIGNAL("activated(int)"), self.onBibleThemeComboBoxChanged) | ||
362 | 147 | 149 | ||
363 | 148 | def retranslateUi(self): | 150 | def retranslateUi(self): |
364 | 149 | self.VerseDisplayGroupBox.setTitle(translate('SettingsForm', 'Verse Display')) | 151 | self.VerseDisplayGroupBox.setTitle(translate('SettingsForm', 'Verse Display')) |
365 | @@ -160,6 +162,9 @@ | |||
366 | 160 | self.BibleSearchGroupBox.setTitle(translate('SettingsForm', 'Search')) | 162 | self.BibleSearchGroupBox.setTitle(translate('SettingsForm', 'Search')) |
367 | 161 | self.BibleSearchCheckBox.setText(translate('SettingsForm', 'Search-as-you-type')) | 163 | self.BibleSearchCheckBox.setText(translate('SettingsForm', 'Search-as-you-type')) |
368 | 162 | 164 | ||
369 | 165 | def onBibleThemeComboBoxChanged(self): | ||
370 | 166 | self.bible_theme = self.BibleThemeComboBox.currentText() | ||
371 | 167 | |||
372 | 163 | def onDisplayStyleComboBoxChanged(self): | 168 | def onDisplayStyleComboBoxChanged(self): |
373 | 164 | self.display_style = self.DisplayStyleComboBox.currentIndex() | 169 | self.display_style = self.DisplayStyleComboBox.currentIndex() |
374 | 165 | 170 | ||
375 | @@ -182,11 +187,11 @@ | |||
376 | 182 | self.bible_search = True | 187 | self.bible_search = True |
377 | 183 | 188 | ||
378 | 184 | def load(self): | 189 | def load(self): |
384 | 185 | self.paragraph_style = convertStringToBoolean(self.config.get_config('paragraph style', u'True')) | 190 | self.paragraph_style = convertStringToBoolean(self.config.get_config(u'paragraph style', u'True')) |
385 | 186 | self.show_new_chapters = convertStringToBoolean(self.config.get_config('display new chapter', u"False")) | 191 | self.show_new_chapters = convertStringToBoolean(self.config.get_config(u'display new chapter', u"False")) |
386 | 187 | self.display_style = int(self.config.get_config('display brackets', '0')) | 192 | self.display_style = int(self.config.get_config(u'display brackets', u'0')) |
387 | 188 | self.bible_theme = int(self.config.get_config('bible theme', '0')) | 193 | self.bible_theme = self.config.get_config(u'bible theme', u'0') |
388 | 189 | self.bible_search = convertStringToBoolean(self.config.get_config('search as type', u'True')) | 194 | self.bible_search = convertStringToBoolean(self.config.get_config(u'search as type', u'True')) |
389 | 190 | if self.paragraph_style: | 195 | if self.paragraph_style: |
390 | 191 | self.ParagraphRadioButton.setChecked(True) | 196 | self.ParagraphRadioButton.setChecked(True) |
391 | 192 | else: | 197 | else: |
392 | @@ -194,23 +199,24 @@ | |||
393 | 194 | self.NewChaptersCheckBox.setChecked(self.show_new_chapters) | 199 | self.NewChaptersCheckBox.setChecked(self.show_new_chapters) |
394 | 195 | self.DisplayStyleComboBox.setCurrentIndex(self.display_style) | 200 | self.DisplayStyleComboBox.setCurrentIndex(self.display_style) |
395 | 196 | self.BibleSearchCheckBox.setChecked(self.bible_search) | 201 | self.BibleSearchCheckBox.setChecked(self.bible_search) |
396 | 197 | if self.bible_theme == 0: # must be new set to first | ||
397 | 198 | self.BibleThemeComboBox.setCurrentIndex(self.bible_theme) | ||
398 | 199 | else: | ||
399 | 200 | pass # TODO need to code | ||
400 | 201 | self.bible_theme = None | ||
401 | 202 | 202 | ||
402 | 203 | def save(self): | 203 | def save(self): |
408 | 204 | self.config.set_config("paragraph style", str(self.paragraph_style)) | 204 | self.config.set_config(u'paragraph style', str(self.paragraph_style)) |
409 | 205 | self.config.set_config("display new chapter", str(self.show_new_chapters)) | 205 | self.config.set_config(u'display new chapter', str(self.show_new_chapters)) |
410 | 206 | self.config.set_config("display brackets", str(self.display_style)) | 206 | self.config.set_config(u'display brackets', str(self.display_style)) |
411 | 207 | self.config.set_config("search as type", str(self.bible_search)) | 207 | self.config.set_config(u'search as type', str(self.bible_search)) |
412 | 208 | self.config.set_config("bible theme", str(self.bible_theme)) | 208 | self.config.set_config(u'bible theme', str(self.bible_theme)) |
413 | 209 | 209 | ||
414 | 210 | def updateThemeList(self, theme_list): | 210 | def updateThemeList(self, theme_list): |
415 | 211 | """ | 211 | """ |
416 | 212 | Called from ThemeManager when the Themes have changed | 212 | Called from ThemeManager when the Themes have changed |
417 | 213 | """ | 213 | """ |
418 | 214 | self.BibleThemeComboBox.clear() | 214 | self.BibleThemeComboBox.clear() |
419 | 215 | self.BibleThemeComboBox.addItem(u'') | ||
420 | 215 | for theme in theme_list: | 216 | for theme in theme_list: |
421 | 216 | self.BibleThemeComboBox.addItem(theme) | 217 | self.BibleThemeComboBox.addItem(theme) |
422 | 218 | id = self.BibleThemeComboBox.findText(str(self.bible_theme), QtCore.Qt.MatchExactly) | ||
423 | 219 | if id == -1: | ||
424 | 220 | id = 0 # Not Found | ||
425 | 221 | self.bible_theme = u'' | ||
426 | 222 | self.BibleThemeComboBox.setCurrentIndex(id) | ||
427 | 217 | 223 | ||
428 | === modified file 'openlp/plugins/bibles/lib/mediaitem.py' | |||
429 | --- openlp/plugins/bibles/lib/mediaitem.py 2009-05-17 15:24:02 +0000 | |||
430 | +++ openlp/plugins/bibles/lib/mediaitem.py 2009-05-18 16:11:59 +0000 | |||
431 | @@ -398,7 +398,10 @@ | |||
432 | 398 | if len(raw_footer) <= 1: | 398 | if len(raw_footer) <= 1: |
433 | 399 | raw_footer.append(book) | 399 | raw_footer.append(book) |
434 | 400 | 400 | ||
436 | 401 | service_item.theme = self.parent.bibles_tab.bible_theme | 401 | if len(self.parent.bibles_tab.bible_theme) == 0: |
437 | 402 | service_item.theme = None | ||
438 | 403 | else: | ||
439 | 404 | service_item.theme = self.parent.bibles_tab.bible_theme | ||
440 | 402 | raw_slides.append(bible_text) | 405 | raw_slides.append(bible_text) |
441 | 403 | service_item.raw_slides = raw_slides | 406 | service_item.raw_slides = raw_slides |
442 | 404 | service_item.raw_footer = raw_footer | 407 | service_item.raw_footer = raw_footer |
443 | 405 | 408 | ||
444 | === modified file 'openlp/plugins/media/lib/mediaitem.py' | |||
445 | --- openlp/plugins/media/lib/mediaitem.py 2009-05-16 16:38:03 +0000 | |||
446 | +++ openlp/plugins/media/lib/mediaitem.py 2009-05-18 04:41:49 +0000 | |||
447 | @@ -100,7 +100,7 @@ | |||
448 | 100 | files = QtGui.QFileDialog.getOpenFileNames(None, | 100 | files = QtGui.QFileDialog.getOpenFileNames(None, |
449 | 101 | translate('MediaMediaItem', u'Select Media(s) items'), | 101 | translate('MediaMediaItem', u'Select Media(s) items'), |
450 | 102 | self.parent.config.get_last_dir(), | 102 | self.parent.config.get_last_dir(), |
452 | 103 | u'Images (*.avi *.mpeg);;Audio (*.mp3 *.ogg *.wma);;All files (*)') | 103 | u'Videos (*.avi *.mpeg);;Audio (*.mp3 *.ogg *.wma);;All files (*)') |
453 | 104 | if len(files) > 0: | 104 | if len(files) > 0: |
454 | 105 | self.loadMediaList(files) | 105 | self.loadMediaList(files) |
455 | 106 | dir, filename = os.path.split(str(files[0])) | 106 | dir, filename = os.path.split(str(files[0])) |
456 | 107 | 107 | ||
457 | === modified file 'openlp/plugins/presentations/lib/__init__.py' | |||
458 | --- openlp/plugins/presentations/lib/__init__.py 2009-03-19 17:31:33 +0000 | |||
459 | +++ openlp/plugins/presentations/lib/__init__.py 2009-05-18 16:04:34 +0000 | |||
460 | @@ -20,5 +20,6 @@ | |||
461 | 20 | 20 | ||
462 | 21 | from filelistdata import FileListData | 21 | from filelistdata import FileListData |
463 | 22 | from mediaitem import PresentationMediaItem | 22 | from mediaitem import PresentationMediaItem |
464 | 23 | from presentationtab import PresentationTab | ||
465 | 23 | 24 | ||
467 | 24 | __all__ = ['PresentationMediaItem', 'FileListData'] | 25 | __all__ = ['PresentationMediaItem', 'FileListData', 'PresentationTab'] |
468 | 25 | 26 | ||
469 | === modified file 'openlp/plugins/presentations/lib/mediaitem.py' | |||
470 | --- openlp/plugins/presentations/lib/mediaitem.py 2009-03-19 17:31:33 +0000 | |||
471 | +++ openlp/plugins/presentations/lib/mediaitem.py 2009-05-18 19:04:25 +0000 | |||
472 | @@ -39,87 +39,111 @@ | |||
473 | 39 | def __init__(self, parent, icon, title): | 39 | def __init__(self, parent, icon, title): |
474 | 40 | MediaManagerItem.__init__(self, parent, icon, title) | 40 | MediaManagerItem.__init__(self, parent, icon, title) |
475 | 41 | 41 | ||
477 | 42 | def setupUi(self): | 42 | def setupUi(self): |
478 | 43 | # Add a toolbar | 43 | # Add a toolbar |
479 | 44 | self.addToolbar() | 44 | self.addToolbar() |
480 | 45 | # Create buttons for the toolbar | 45 | # Create buttons for the toolbar |
481 | 46 | ## New Presentation Button ## | 46 | ## New Presentation Button ## |
482 | 47 | self.addToolbarButton( | 47 | self.addToolbarButton( |
484 | 48 | translate('PresentationsMediaItem',u'New presentations'), | 48 | translate('PresentationsMediaItem',u'New presentations'), |
485 | 49 | translate('PresentationsMediaItem',u'Load presentations into openlp.org'), | 49 | translate('PresentationsMediaItem',u'Load presentations into openlp.org'), |
486 | 50 | ':/presentations/presentation_load.png', self.onPresentationNewClick, 'PresentationNewItem') | 50 | ':/presentations/presentation_load.png', self.onPresentationNewClick, 'PresentationNewItem') |
487 | 51 | ## Delete Presentation Button ## | 51 | ## Delete Presentation Button ## |
488 | 52 | self.addToolbarButton( | 52 | self.addToolbarButton( |
490 | 53 | translate('PresentationsMediaItem',u'Delete Presentation'), | 53 | translate('PresentationsMediaItem',u'Delete Presentation'), |
491 | 54 | translate('PresentationsMediaItem',u'Delete the selected presentation'), | 54 | translate('PresentationsMediaItem',u'Delete the selected presentation'), |
492 | 55 | ':/presentations/presentation_delete.png', self.onPresentationDeleteClick, 'PresentationDeleteItem') | 55 | ':/presentations/presentation_delete.png', self.onPresentationDeleteClick, 'PresentationDeleteItem') |
493 | 56 | ## Separator Line ## | 56 | ## Separator Line ## |
494 | 57 | self.addToolbarSeparator() | 57 | self.addToolbarSeparator() |
495 | 58 | ## Preview Presentation Button ## | 58 | ## Preview Presentation Button ## |
496 | 59 | self.addToolbarButton( | 59 | self.addToolbarButton( |
498 | 60 | translate('PresentationsMediaItem',u'Preview Presentation'), | 60 | translate('PresentationsMediaItem',u'Preview Presentation'), |
499 | 61 | translate('PresentationsMediaItem',u'Preview the selected Presentation'), | 61 | translate('PresentationsMediaItem',u'Preview the selected Presentation'), |
500 | 62 | ':/system/system_preview.png', self.onPresentationPreviewClick, 'PresentationPreviewItem') | 62 | ':/system/system_preview.png', self.onPresentationPreviewClick, 'PresentationPreviewItem') |
501 | 63 | ## Live Presentation Button ## | 63 | ## Live Presentation Button ## |
502 | 64 | self.addToolbarButton( | 64 | self.addToolbarButton( |
504 | 65 | translate('PresentationsMediaItem',u'Go Live'), | 65 | translate('PresentationsMediaItem',u'Go Live'), |
505 | 66 | translate('PresentationsMediaItem',u'Send the selected presentation live'), | 66 | translate('PresentationsMediaItem',u'Send the selected presentation live'), |
506 | 67 | ':/system/system_live.png', self.onPresentationLiveClick, 'PresentationLiveItem') | 67 | ':/system/system_live.png', self.onPresentationLiveClick, 'PresentationLiveItem') |
507 | 68 | ## Add Presentation Button ## | 68 | ## Add Presentation Button ## |
508 | 69 | self.addToolbarButton( | 69 | self.addToolbarButton( |
509 | 70 | translate('PresentationsMediaItem',u'Add Presentation To Service'), | 70 | translate('PresentationsMediaItem',u'Add Presentation To Service'), |
511 | 71 | translate('PresentationsMediaItem',u'Add the selected Presentations(s) to the service'), | 71 | translate('PresentationsMediaItem',u'Add the selected Presentations(s) to the service'), |
512 | 72 | ':/system/system_add.png',self.onPresentationAddClick, 'PresentationsAddItem') | 72 | ':/system/system_add.png',self.onPresentationAddClick, 'PresentationsAddItem') |
513 | 73 | ## Add the Presentationlist widget ## | 73 | ## Add the Presentationlist widget ## |
515 | 74 | 74 | ||
516 | 75 | self.PresentationWidget = QtGui.QWidget(self) | ||
517 | 76 | sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) | ||
518 | 77 | sizePolicy.setHorizontalStretch(0) | ||
519 | 78 | sizePolicy.setVerticalStretch(0) | ||
520 | 79 | sizePolicy.setHeightForWidth(self.PresentationWidget.sizePolicy().hasHeightForWidth()) | ||
521 | 80 | self.PresentationWidget.setSizePolicy(sizePolicy) | ||
522 | 81 | self.PresentationWidget.setObjectName('PresentationWidget') | ||
523 | 82 | self.DisplayLayout = QtGui.QGridLayout(self.PresentationWidget) | ||
524 | 83 | self.DisplayLayout.setObjectName('DisplayLayout') | ||
525 | 84 | self.DisplayTypeComboBox = QtGui.QComboBox(self.PresentationWidget) | ||
526 | 85 | self.DisplayTypeComboBox.setObjectName('DisplayTypeComboBox') | ||
527 | 86 | self.DisplayLayout.addWidget(self.DisplayTypeComboBox, 0, 1, 1, 2) | ||
528 | 87 | self.DisplayTypeLabel = QtGui.QLabel(self.PresentationWidget) | ||
529 | 88 | self.DisplayTypeLabel.setObjectName('SearchTypeLabel') | ||
530 | 89 | self.DisplayLayout.addWidget(self.DisplayTypeLabel, 0, 0, 1, 1) | ||
531 | 90 | |||
532 | 91 | self.DisplayTypeLabel.setText(translate('PresentationMediaItem', u'Present using:')) | ||
533 | 92 | |||
534 | 93 | # Add the song widget to the page layout | ||
535 | 94 | self.PageLayout.addWidget(self.PresentationWidget) | ||
536 | 95 | |||
537 | 75 | self.PresentationsListView = QtGui.QListView() | 96 | self.PresentationsListView = QtGui.QListView() |
538 | 76 | self.PresentationsListView.setAlternatingRowColors(True) | 97 | self.PresentationsListView.setAlternatingRowColors(True) |
539 | 77 | self.PresentationsListData = FileListData() | 98 | self.PresentationsListData = FileListData() |
540 | 78 | self.PresentationsListView.setModel(self.PresentationsListData) | 99 | self.PresentationsListView.setModel(self.PresentationsListData) |
542 | 79 | 100 | ||
543 | 80 | self.PageLayout.addWidget(self.PresentationsListView) | 101 | self.PageLayout.addWidget(self.PresentationsListView) |
545 | 81 | 102 | ||
546 | 82 | #define and add the context menu | 103 | #define and add the context menu |
547 | 83 | self.PresentationsListView.setContextMenuPolicy(QtCore.Qt.ActionsContextMenu) | 104 | self.PresentationsListView.setContextMenuPolicy(QtCore.Qt.ActionsContextMenu) |
548 | 84 | 105 | ||
549 | 85 | self.PresentationsListView.addAction(self.contextMenuAction( | 106 | self.PresentationsListView.addAction(self.contextMenuAction( |
551 | 86 | self.PresentationsListView, ':/system/system_preview.png', | 107 | self.PresentationsListView, ':/system/system_preview.png', |
552 | 87 | translate('PresentationsMediaItem',u'&Preview presentations'), self.onPresentationPreviewClick)) | 108 | translate('PresentationsMediaItem',u'&Preview presentations'), self.onPresentationPreviewClick)) |
553 | 88 | self.PresentationsListView.addAction(self.contextMenuAction( | 109 | self.PresentationsListView.addAction(self.contextMenuAction( |
555 | 89 | self.PresentationsListView, ':/system/system_live.png', | 110 | self.PresentationsListView, ':/system/system_live.png', |
556 | 90 | translate('PresentationsMediaItem',u'&Show Live'), self.onPresentationLiveClick)) | 111 | translate('PresentationsMediaItem',u'&Show Live'), self.onPresentationLiveClick)) |
557 | 91 | self.PresentationsListView.addAction(self.contextMenuAction( | 112 | self.PresentationsListView.addAction(self.contextMenuAction( |
559 | 92 | self.PresentationsListView, ':/system/system_add.png', | 113 | self.PresentationsListView, ':/system/system_add.png', |
560 | 93 | translate('PresentationsMediaItem',u'&Add to Service'), self.onPresentationAddClick)) | 114 | translate('PresentationsMediaItem',u'&Add to Service'), self.onPresentationAddClick)) |
562 | 94 | 115 | ||
563 | 95 | def initialise(self): | 116 | def initialise(self): |
564 | 96 | list = self.parent.config.load_list(u'presentations') | 117 | list = self.parent.config.load_list(u'presentations') |
565 | 97 | self.loadPresentationList(list) | 118 | self.loadPresentationList(list) |
566 | 119 | self.DisplayTypeComboBox.addItem(u'Impress') | ||
567 | 120 | self.DisplayTypeComboBox.addItem(u'Powerpoint') | ||
568 | 121 | self.DisplayTypeComboBox.addItem(u'Keynote') | ||
569 | 98 | 122 | ||
570 | 99 | def onPresentationNewClick(self): | 123 | def onPresentationNewClick(self): |
573 | 100 | files = QtGui.QFileDialog.getOpenFileNames(None, | 124 | files = QtGui.QFileDialog.getOpenFileNames(None, |
574 | 101 | translate('PresentationsMediaItem', u'Select presentations(s)'), | 125 | translate('PresentationsMediaItem', u'Select presentations(s)'), |
575 | 102 | self.parent.config.get_last_dir(), u'Presentations (*.ppt *.pps *.odi)') | 126 | self.parent.config.get_last_dir(), u'Presentations (*.ppt *.pps *.odi)') |
576 | 103 | if len(files) > 0: | 127 | if len(files) > 0: |
577 | 104 | self.loadPresentationList(files) | 128 | self.loadPresentationList(files) |
578 | 105 | dir, filename = os.path.split(str(files[0])) | 129 | dir, filename = os.path.split(str(files[0])) |
579 | 106 | self.parent.config.set_last_dir(dir) | 130 | self.parent.config.set_last_dir(dir) |
580 | 107 | self.parent.config.set_list(u'Presentations', self.PresentationsListData.getFileList()) | 131 | self.parent.config.set_list(u'Presentations', self.PresentationsListData.getFileList()) |
582 | 108 | 132 | ||
583 | 109 | def getFileList(self): | 133 | def getFileList(self): |
584 | 110 | filelist = [item[0] for item in self.PresentationsListView]; | 134 | filelist = [item[0] for item in self.PresentationsListView]; |
586 | 111 | return filelist | 135 | return filelist |
587 | 112 | 136 | ||
588 | 113 | def loadPresentationList(self, list): | 137 | def loadPresentationList(self, list): |
589 | 114 | for files in list: | 138 | for files in list: |
590 | 115 | self.PresentationsListData.addRow(files) | 139 | self.PresentationsListData.addRow(files) |
592 | 116 | 140 | ||
593 | 117 | def onPresentationDeleteClick(self): | 141 | def onPresentationDeleteClick(self): |
594 | 118 | indexes = self.PresentationsListView.selectedIndexes() | 142 | indexes = self.PresentationsListView.selectedIndexes() |
595 | 119 | for index in indexes: | 143 | for index in indexes: |
596 | 120 | current_row = int(index.row()) | 144 | current_row = int(index.row()) |
597 | 121 | self.PresentationsListData.removeRow(current_row) | 145 | self.PresentationsListData.removeRow(current_row) |
599 | 122 | self.parent.config.set_list(u'Presentations', self.PresentationsListData.getFileList()) | 146 | self.parent.config.set_list(u'Presentations', self.PresentationsListData.getFileList()) |
600 | 123 | 147 | ||
601 | 124 | def onPresentationPreviewClick(self): | 148 | def onPresentationPreviewClick(self): |
602 | 125 | pass | 149 | pass |
603 | @@ -128,4 +152,4 @@ | |||
604 | 128 | pass | 152 | pass |
605 | 129 | 153 | ||
606 | 130 | def onPresentationAddClick(self): | 154 | def onPresentationAddClick(self): |
608 | 131 | pass | 155 | pass |
609 | 132 | 156 | ||
610 | === modified file 'openlp/plugins/presentations/presentationplugin.py' | |||
611 | --- openlp/plugins/presentations/presentationplugin.py 2009-03-22 07:13:34 +0000 | |||
612 | +++ openlp/plugins/presentations/presentationplugin.py 2009-05-18 16:04:34 +0000 | |||
613 | @@ -3,7 +3,7 @@ | |||
614 | 3 | """ | 3 | """ |
615 | 4 | OpenLP - Open Source Lyrics Projection | 4 | OpenLP - Open Source Lyrics Projection |
616 | 5 | Copyright (c) 2008 Raoul Snyman | 5 | Copyright (c) 2008 Raoul Snyman |
618 | 6 | Portions copyright (c) 2008 Martin Thompson, Tim Bentley, | 6 | Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley, |
619 | 7 | 7 | ||
620 | 8 | This program is free software; you can redistribute it and/or modify it under | 8 | This program is free software; you can redistribute it and/or modify it under |
621 | 9 | the terms of the GNU General Public License as published by the Free Software | 9 | the terms of the GNU General Public License as published by the Free Software |
622 | @@ -22,9 +22,8 @@ | |||
623 | 22 | 22 | ||
624 | 23 | from PyQt4 import QtCore, QtGui | 23 | from PyQt4 import QtCore, QtGui |
625 | 24 | 24 | ||
626 | 25 | from openlp.core.resources import * | ||
627 | 26 | from openlp.core.lib import Plugin, MediaManagerItem | 25 | from openlp.core.lib import Plugin, MediaManagerItem |
629 | 27 | from openlp.plugins.presentations.lib import PresentationMediaItem | 26 | from openlp.plugins.presentations.lib import PresentationMediaItem, PresentationTab |
630 | 28 | 27 | ||
631 | 29 | class PresentationPlugin(Plugin): | 28 | class PresentationPlugin(Plugin): |
632 | 30 | 29 | ||
633 | @@ -38,7 +37,8 @@ | |||
634 | 38 | QtGui.QIcon.Normal, QtGui.QIcon.Off) | 37 | QtGui.QIcon.Normal, QtGui.QIcon.Off) |
635 | 39 | 38 | ||
636 | 40 | def get_settings_tab(self): | 39 | def get_settings_tab(self): |
638 | 41 | pass | 40 | self.presentation_tab = PresentationTab() |
639 | 41 | return self.presentation_tab | ||
640 | 42 | 42 | ||
641 | 43 | def get_media_manager_item(self): | 43 | def get_media_manager_item(self): |
642 | 44 | # Create the MediaManagerItem object | 44 | # Create the MediaManagerItem object |
466. By Tim Bentley 2 minutes ago
Rendering cleanup
465. By Tim Bentley 20 hours ago
Theme Preview in ThemeTab
464. By Tim Bentley 21 hours ago
Finish the Theme work to save all themes and replay them on reload
Add rules as to which theme to use in the RenderManager
463. By Tim Bentley on 2009-05-18
Fix Bible plugin to handle themes correctly when changed and removed.
462. By Tim Bentley on 2009-05-18
Change Presentation Plugin to choose presentation software.
Trial version until superfly gets his hands on it!
461. By Tim Bentley on 2009-05-18
Fix comments from last merge
Fix BiblePlugin Theme storage and usage
460. By Tim Bentley on 2009-05-17
Corrections to Renderer to handle slides not lines
Fixes to Bibleplugin to renderer multiple verses per slide
Pass Bible Theme to RenderManager