Status: | Merged | ||||||||
---|---|---|---|---|---|---|---|---|---|
Merged at revision: | not available | ||||||||
Proposed branch: | lp:~trb143/openlp/bugfixes | ||||||||
Merge into: | lp:openlp | ||||||||
Diff against target: | None lines | ||||||||
To merge this branch: | bzr merge lp:~trb143/openlp/bugfixes | ||||||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Raoul Snyman | Approve | ||
Review via email: mp+9656@code.launchpad.net |
Commit message
Description of the change
To post a comment you must log in.
Revision history for this message
Tim Bentley (trb143) wrote : | # |
Revision history for this message
Raoul Snyman (raoul-snyman) wrote : | # |
Looks fine to me.
review:
Approve
lp:~trb143/openlp/bugfixes
updated
- 499. By Tim Bentley
-
New features and fixes.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'openlp/core/lib/renderer.py' |
2 | --- openlp/core/lib/renderer.py 2009-07-21 20:04:27 +0000 |
3 | +++ openlp/core/lib/renderer.py 2009-08-03 19:49:21 +0000 |
4 | @@ -556,15 +556,21 @@ |
5 | """ |
6 | Set the fonts from the current theme settings. |
7 | """ |
8 | + footer_weight = 50 |
9 | + if self._theme.font_footer_weight == u'Bold': |
10 | + footer_weight = 75 |
11 | self.footerFont = QtGui.QFont(self._theme.font_footer_name, |
12 | int(self._theme.font_footer_proportion), # size |
13 | - QtGui.QFont.Normal, # weight |
14 | - 0)# italic |
15 | + int(footer_weight), # weight |
16 | + self._theme.font_footer_italics)# italic |
17 | self.footerFont.setPixelSize(int(self._theme.font_footer_proportion)) |
18 | + main_weight = 50 |
19 | + if self._theme.font_main_weight == u'Bold': |
20 | + main_weight = 75 |
21 | self.mainFont = QtGui.QFont(self._theme.font_main_name, |
22 | int(self._theme.font_main_proportion), # size |
23 | - QtGui.QFont.Normal, # weight |
24 | - 0)# italic |
25 | + int(main_weight), # weight |
26 | + self._theme.font_main_italics)# italic |
27 | self.mainFont.setPixelSize(int(self._theme.font_main_proportion)) |
28 | |
29 | def _get_extent_and_render(self, line, footer, tlcorner=(0, 0), draw=False, color=None): |
30 | |
31 | === modified file 'openlp/core/lib/themexmlhandler.py' |
32 | --- openlp/core/lib/themexmlhandler.py 2009-07-10 13:16:15 +0000 |
33 | +++ openlp/core/lib/themexmlhandler.py 2009-08-03 19:49:21 +0000 |
34 | @@ -46,12 +46,16 @@ |
35 | <name>Arial</name> |
36 | <color>#000000</color> |
37 | <proportion>30</proportion> |
38 | + <weight>Normal</weight> |
39 | + <italics>False</italics> |
40 | <location override="False" x="0" y="0" width="0" height="0"/> |
41 | </font> |
42 | <font type="footer"> |
43 | <name>Arial</name> |
44 | <color>#000000</color> |
45 | <proportion>12</proportion> |
46 | + <weight>Normal</weight> |
47 | + <italics>False</italics> |
48 | <location override="False" x="0" y="0" width="0" height="0"/> |
49 | </font> |
50 | <display> |
51 | @@ -157,7 +161,7 @@ |
52 | #Create Filename element |
53 | self.child_element(background, u'filename', filename) |
54 | |
55 | - def add_font(self, name, color, proportion, override, fonttype=u'main', |
56 | + def add_font(self, name, color, proportion, override, fonttype=u'main', weight=u'Bold', italics=False, |
57 | xpos=0, ypos=0, width=0, height=0): |
58 | """ |
59 | Add a Font. |
60 | @@ -177,6 +181,12 @@ |
61 | ``fonttype`` |
62 | The type of font, ``main`` or ``footer``. Defaults to ``main``. |
63 | |
64 | + ``weight`` |
65 | + The weight of then font Defaults to 50 Normal |
66 | + |
67 | + ``italics`` |
68 | + Does the font render to italics Defaults to 0 Normal |
69 | + |
70 | ``xpos`` |
71 | The X position of the text block. |
72 | |
73 | @@ -198,8 +208,10 @@ |
74 | self.child_element(background, u'color', color) |
75 | #Create Proportion name element |
76 | self.child_element(background, u'proportion', proportion) |
77 | - #Create Proportion name element |
78 | - self.child_element(background, u'proportion', proportion) |
79 | + #Create weight name element |
80 | + self.child_element(background, u'weight', weight) |
81 | + #Create italics name element |
82 | + self.child_element(background, u'italics', italics) |
83 | #Create Location element |
84 | element = self.theme_xml.createElement(u'location') |
85 | element.setAttribute(u'override',override) |
86 | @@ -329,14 +341,17 @@ |
87 | setattr(self, master + element.tag + u'_'+ e[0], e[1]) |
88 | else: |
89 | field = master + e[0] |
90 | - e1 = e[1] |
91 | if e[1] == u'True' or e[1] == u'False': |
92 | - e1 = str_to_bool(e[1]) |
93 | - setattr(self, field, e1) |
94 | + setattr(self, field, str_to_bool(e[1])) |
95 | + else: |
96 | + setattr(self, field, e[1]) |
97 | else: |
98 | if element.tag is not None: |
99 | field = master + element.tag |
100 | - setattr(self, field, element.text) |
101 | + if element.text == u'True' or element.text == u'False': |
102 | + setattr(self, field, str_to_bool(element.text)) |
103 | + else: |
104 | + setattr(self, field, element.text) |
105 | |
106 | def __str__(self): |
107 | """ |
108 | |
109 | === modified file 'openlp/core/ui/amendthemedialog.py' |
110 | --- openlp/core/ui/amendthemedialog.py 2009-06-16 18:21:24 +0000 |
111 | +++ openlp/core/ui/amendthemedialog.py 2009-08-01 18:03:07 +0000 |
112 | @@ -165,6 +165,16 @@ |
113 | self.FontMainSizeSpinBox.setMaximum(999) |
114 | self.FontMainSizeSpinBox.setObjectName(u'FontMainSizeSpinBox') |
115 | self.MainFontLayout.setWidget(2, QtGui.QFormLayout.FieldRole, self.FontMainSizeSpinBox) |
116 | + self.FontMainWeightComboBox = QtGui.QComboBox(self.FontMainGroupBox) |
117 | + self.FontMainWeightComboBox.setObjectName("FontMainWeightComboBox") |
118 | + self.FontMainWeightComboBox.addItem(QtCore.QString()) |
119 | + self.FontMainWeightComboBox.addItem(QtCore.QString()) |
120 | + self.FontMainWeightComboBox.addItem(QtCore.QString()) |
121 | + self.FontMainWeightComboBox.addItem(QtCore.QString()) |
122 | + self.MainFontLayout.setWidget(3, QtGui.QFormLayout.FieldRole, self.FontMainWeightComboBox) |
123 | + self.FontMainWeightLabel = QtGui.QLabel(self.FontMainGroupBox) |
124 | + self.FontMainWeightLabel.setObjectName("FontMainWeightLabel") |
125 | + self.MainFontLayout.setWidget(3, QtGui.QFormLayout.LabelRole, self.FontMainWeightLabel) |
126 | self.MainLeftLayout.addWidget(self.FontMainGroupBox) |
127 | spacerItem1 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) |
128 | self.MainLeftLayout.addItem(spacerItem1) |
129 | @@ -292,6 +302,16 @@ |
130 | self.FontFooterSizeSpinBox.setMaximum(999) |
131 | self.FontFooterSizeSpinBox.setObjectName(u'FontFooterSizeSpinBox') |
132 | self.FooterFontLayout.setWidget(2, QtGui.QFormLayout.FieldRole, self.FontFooterSizeSpinBox) |
133 | + self.FontFooterWeightComboBox = QtGui.QComboBox(self.FooterFontGroupBox) |
134 | + self.FontFooterWeightComboBox.setObjectName("FontFooterWeightComboBox") |
135 | + self.FontFooterWeightComboBox.addItem(QtCore.QString()) |
136 | + self.FontFooterWeightComboBox.addItem(QtCore.QString()) |
137 | + self.FontFooterWeightComboBox.addItem(QtCore.QString()) |
138 | + self.FontFooterWeightComboBox.addItem(QtCore.QString()) |
139 | + self.FooterFontLayout.setWidget(3, QtGui.QFormLayout.FieldRole, self.FontFooterWeightComboBox) |
140 | + self.FontFooterWeightLabel = QtGui.QLabel(self.FooterFontGroupBox) |
141 | + self.FontFooterWeightLabel.setObjectName("FontFooterWeightLabel") |
142 | + self.FooterFontLayout.setWidget(3, QtGui.QFormLayout.LabelRole, self.FontFooterWeightLabel) |
143 | self.FooterLeftLayout.addWidget(self.FooterFontGroupBox) |
144 | spacerItem3 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) |
145 | self.FooterLeftLayout.addItem(spacerItem3) |
146 | @@ -550,6 +570,11 @@ |
147 | self.FontMainColorLabel.setText(translate(u'AmendThemeDialog', u'Font Color:')) |
148 | self.FontMainSize.setText(translate(u'AmendThemeDialog', u'Size:')) |
149 | self.FontMainSizeSpinBox.setSuffix(translate(u'AmendThemeDialog', u'pt')) |
150 | + self.FontMainWeightComboBox.setItemText(0, translate("AmendThemeDialog", u'Normal')) |
151 | + self.FontMainWeightComboBox.setItemText(1, translate("AmendThemeDialog", u'Bold')) |
152 | + self.FontMainWeightComboBox.setItemText(2, translate("AmendThemeDialog", u'Italics')) |
153 | + self.FontMainWeightComboBox.setItemText(3, translate("AmendThemeDialog", u'Bold/Italics')) |
154 | + self.FontMainWeightLabel.setText(translate("AmendThemeDialog", u'Font Weight:')) |
155 | self.MainLocationGroupBox.setTitle(translate(u'AmendThemeDialog', u'Display Location')) |
156 | self.DefaultLocationLabel.setText(translate(u'AmendThemeDialog', u'Use Default Location:')) |
157 | self.FontMainXLabel.setText(translate(u'AmendThemeDialog', u'X Position:')) |
158 | @@ -566,6 +591,11 @@ |
159 | self.FontFooterColorLabel.setText(translate(u'AmendThemeDialog', u'Font Color:')) |
160 | self.FontFooterSizeLabel.setText(translate(u'AmendThemeDialog', u'Size:')) |
161 | self.FontFooterSizeSpinBox.setSuffix(translate(u'AmendThemeDialog', u'pt')) |
162 | + self.FontFooterWeightComboBox.setItemText(0, translate("AmendThemeDialog", u'Normal')) |
163 | + self.FontFooterWeightComboBox.setItemText(1, translate("AmendThemeDialog", u'Bold')) |
164 | + self.FontFooterWeightComboBox.setItemText(2, translate("AmendThemeDialog", u'Italics')) |
165 | + self.FontFooterWeightComboBox.setItemText(3, translate("AmendThemeDialog", u'Bold/Italics')) |
166 | + self.FontFooterWeightLabel.setText(translate("AmendThemeDialog", u'Font Weight:')) |
167 | self.LocationFooterGroupBox.setTitle(translate(u'AmendThemeDialog', u'Display Location')) |
168 | self.FontFooterDefaultLabel.setText(translate(u'AmendThemeDialog', u'Use Default Location:')) |
169 | self.FontFooterXLabel.setText(translate(u'AmendThemeDialog', u'X Position:')) |
170 | |
171 | === modified file 'openlp/core/ui/amendthemeform.py' |
172 | --- openlp/core/ui/amendthemeform.py 2009-07-14 19:41:44 +0000 |
173 | +++ openlp/core/ui/amendthemeform.py 2009-08-03 19:49:21 +0000 |
174 | @@ -53,7 +53,6 @@ |
175 | QtCore.SIGNAL(u'pressed()'), self.onShadowColorPushButtonClicked) |
176 | QtCore.QObject.connect(self.ImageToolButton, |
177 | QtCore.SIGNAL(u'pressed()'), self.onImageToolButtonClicked) |
178 | - |
179 | #Combo boxes |
180 | QtCore.QObject.connect(self.BackgroundComboBox, |
181 | QtCore.SIGNAL(u'activated(int)'), self.onBackgroundComboBoxSelected) |
182 | @@ -63,13 +62,17 @@ |
183 | QtCore.SIGNAL(u'activated(int)'), self.onGradientComboBoxSelected) |
184 | QtCore.QObject.connect(self.FontMainComboBox, |
185 | QtCore.SIGNAL(u'activated(int)'), self.onFontMainComboBoxSelected) |
186 | + QtCore.QObject.connect(self.FontMainWeightComboBox, |
187 | + QtCore.SIGNAL(u'activated(int)'), self.onFontMainWeightComboBoxSelected) |
188 | QtCore.QObject.connect(self.FontFooterComboBox, |
189 | QtCore.SIGNAL(u'activated(int)'), self.onFontFooterComboBoxSelected) |
190 | + QtCore.QObject.connect(self.FontFooterWeightComboBox, |
191 | + QtCore.SIGNAL(u'activated(int)'), self.onFontFooterWeightComboBoxSelected) |
192 | QtCore.QObject.connect(self.HorizontalComboBox, |
193 | QtCore.SIGNAL(u'activated(int)'), self.onHorizontalComboBoxSelected) |
194 | QtCore.QObject.connect(self.VerticalComboBox, |
195 | QtCore.SIGNAL(u'activated(int)'), self.onVerticalComboBoxSelected) |
196 | - |
197 | + #Spin boxes |
198 | QtCore.QObject.connect(self.FontMainSizeSpinBox, |
199 | QtCore.SIGNAL(u'editingFinished()'), self.onFontMainSizeSpinBoxChanged) |
200 | QtCore.QObject.connect(self.FontFooterSizeSpinBox, |
201 | @@ -118,10 +121,12 @@ |
202 | |
203 | new_theme.add_font(unicode(self.theme.font_main_name), unicode(self.theme.font_main_color), |
204 | unicode(self.theme.font_main_proportion), unicode(self.theme.font_main_override), u'main', |
205 | + unicode(self.theme.font_main_weight), unicode(self.theme.font_main_italics), |
206 | unicode(self.theme.font_main_x), unicode(self.theme.font_main_y), unicode(self.theme.font_main_width), |
207 | unicode(self.theme.font_main_height)) |
208 | new_theme.add_font(unicode(self.theme.font_footer_name), unicode(self.theme.font_footer_color), |
209 | unicode(self.theme.font_footer_proportion), unicode(self.theme.font_footer_override), u'footer', |
210 | + unicode(self.theme.font_footer_weight), unicode(self.theme.font_footer_italics), |
211 | unicode(self.theme.font_footer_x), unicode(self.theme.font_footer_y), unicode(self.theme.font_footer_width), |
212 | unicode(self.theme.font_footer_height) ) |
213 | new_theme.add_display(unicode(self.theme.display_shadow), unicode(self.theme.display_shadow_color), |
214 | @@ -159,6 +164,21 @@ |
215 | self.theme.font_main_name = self.FontMainComboBox.currentFont().family() |
216 | self.previewTheme(self.theme) |
217 | |
218 | + def onFontMainWeightComboBoxSelected(self, value): |
219 | + if value ==0: |
220 | + self.theme.font_main_weight = u'Normal' |
221 | + self.theme.font_main_italics = False |
222 | + elif value == 1: |
223 | + self.theme.font_main_weight = u'Bold' |
224 | + self.theme.font_main_italics = False |
225 | + elif value == 2: |
226 | + self.theme.font_main_weight = u'Normal' |
227 | + self.theme.font_main_italics = True |
228 | + else: |
229 | + self.theme.font_main_weight = u'Bold' |
230 | + self.theme.font_main_italics = True |
231 | + self.previewTheme(self.theme) |
232 | + |
233 | def onFontMainColorPushButtonClicked(self): |
234 | self.theme.font_main_color = QtGui.QColorDialog.getColor( |
235 | QtGui.QColor(self.theme.font_main_color), self).name() |
236 | @@ -217,6 +237,21 @@ |
237 | self.theme.font_footer_name = self.FontFooterComboBox.currentFont().family() |
238 | self.previewTheme(self.theme) |
239 | |
240 | + def onFontFooterWeightComboBoxSelected(self, value): |
241 | + if value == 0: |
242 | + self.theme.font_footer_weight = u'Normal' |
243 | + self.theme.font_footer_italics = False |
244 | + elif value == 1: |
245 | + self.theme.font_footer_weight = u'Bold' |
246 | + self.theme.font_footer_italics = False |
247 | + elif value == 2: |
248 | + self.theme.font_footer_weight = u'Normal' |
249 | + self.theme.font_footer_italics = True |
250 | + else: |
251 | + self.theme.font_footer_weight = u'Bold' |
252 | + self.theme.font_footer_italics = True |
253 | + self.previewTheme(self.theme) |
254 | + |
255 | def onFontFooterColorPushButtonClicked(self): |
256 | self.theme.font_footer_color = QtGui.QColorDialog.getColor( |
257 | QtGui.QColor(self.theme.font_footer_color), self).name() |
258 | @@ -410,11 +445,28 @@ |
259 | self.GradientComboBox.setCurrentIndex(2) |
260 | |
261 | self.FontMainSizeSpinBox.setValue(int(self.theme.font_main_proportion)) |
262 | + if not self.theme.font_main_italics and self.theme.font_main_weight == u'Normal': |
263 | + self.FontMainWeightComboBox.setCurrentIndex(0) |
264 | + elif not self.theme.font_main_italics and self.theme.font_main_weight == u'Bold': |
265 | + self.FontMainWeightComboBox.setCurrentIndex(1) |
266 | + elif self.theme.font_main_italics and self.theme.font_main_weight == u'Normal': |
267 | + self.FontMainWeightComboBox.setCurrentIndex(2) |
268 | + else: |
269 | + self.FontMainWeightComboBox.setCurrentIndex(3) |
270 | + |
271 | self.FontMainXSpinBox.setValue(int(self.theme.font_main_x)) |
272 | self.FontMainYSpinBox.setValue(int(self.theme.font_main_y)) |
273 | self.FontMainWidthSpinBox.setValue(int(self.theme.font_main_width)) |
274 | self.FontMainHeightSpinBox.setValue(int(self.theme.font_main_height)) |
275 | self.FontFooterSizeSpinBox.setValue(int(self.theme.font_footer_proportion)) |
276 | + if not self.theme.font_footer_italics and self.theme.font_footer_weight == u'Normal': |
277 | + self.FontFooterWeightComboBox.setCurrentIndex(0) |
278 | + elif not self.theme.font_footer_italics and self.theme.font_footer_weight == u'Bold': |
279 | + self.FontFooterWeightComboBox.setCurrentIndex(1) |
280 | + elif self.theme.font_footer_italics and self.theme.font_footer_weight == u'Normal': |
281 | + self.FontFooterWeightComboBox.setCurrentIndex(2) |
282 | + else: |
283 | + self.FontFooterWeightComboBox.setCurrentIndex(3) |
284 | self.FontFooterXSpinBox.setValue(int(self.theme.font_footer_x)) |
285 | self.FontFooterYSpinBox.setValue(int(self.theme.font_footer_y)) |
286 | self.FontFooterWidthSpinBox.setValue(int(self.theme.font_footer_width)) |
287 | @@ -529,7 +581,6 @@ |
288 | else: |
289 | self.ShadowColorPushButton.setEnabled(False) |
290 | |
291 | - |
292 | def previewTheme(self, theme): |
293 | if self.allowPreview: |
294 | frame = self.thememanager.generateImage(theme) |
295 | |
296 | === modified file 'openlp/core/ui/servicemanager.py' |
297 | --- openlp/core/ui/servicemanager.py 2009-07-21 20:04:27 +0000 |
298 | +++ openlp/core/ui/servicemanager.py 2009-08-02 16:13:59 +0000 |
299 | @@ -300,7 +300,7 @@ |
300 | Used when moving items as the move takes place in supporting array, |
301 | and when regenerating all the items due to theme changes |
302 | """ |
303 | - #Correct order of idems in array |
304 | + #Correct order of items in array |
305 | count = 1 |
306 | for item in self.serviceItems: |
307 | item[u'order'] = count |
308 | @@ -398,7 +398,7 @@ |
309 | """ |
310 | Set the theme for the current service |
311 | """ |
312 | - self.service_theme = self.ThemeComboBox.currentText() |
313 | + self.service_theme = unicode(self.ThemeComboBox.currentText()) |
314 | self.parent.RenderManager.set_service_theme(self.service_theme) |
315 | self.config.set_config(u'theme service theme', self.service_theme) |
316 | self.regenerateServiceItems() |
317 | |
318 | === modified file 'openlp/core/ui/thememanager.py' |
319 | --- openlp/core/ui/thememanager.py 2009-07-06 16:34:13 +0000 |
320 | +++ openlp/core/ui/thememanager.py 2009-08-02 16:13:59 +0000 |
321 | @@ -100,6 +100,10 @@ |
322 | except: |
323 | #if not present do not worry |
324 | pass |
325 | + #As we do not reload the themes push out the change |
326 | + self.parent.EventManager.post_event(Event(EventType.ThemeListChanged)) |
327 | + self.parent.ServiceManagerContents.updateThemeList(self.getThemes()) |
328 | + self.parent.settingsForm.ThemesTab.updateThemeList(self.getThemes()) |
329 | |
330 | def onExportTheme(self): |
331 | pass |
332 | |
333 | === modified file 'openlp/migration/migratesongs.py' |
334 | --- openlp/migration/migratesongs.py 2009-07-18 07:30:26 +0000 |
335 | +++ openlp/migration/migratesongs.py 2009-08-02 16:13:59 +0000 |
336 | @@ -155,6 +155,8 @@ |
337 | if bb is None: |
338 | author = Author() |
339 | author.display_name = authors_temp.authorname |
340 | + author.first_name = u'' |
341 | + author.last_name = u'' |
342 | else: |
343 | id = int(bb[0]) |
344 | author = self.session.query(Author).get(bb[0]) |
345 | |
346 | === modified file 'openlp/plugins/bibles/lib/bibleHTTPimpl.py' |
347 | --- openlp/plugins/bibles/lib/bibleHTTPimpl.py 2009-07-13 20:11:36 +0000 |
348 | +++ openlp/plugins/bibles/lib/bibleHTTPimpl.py 2009-08-02 13:44:41 +0000 |
349 | @@ -96,7 +96,7 @@ |
350 | chapter - chapter number |
351 | """ |
352 | log.debug(u'get_bible_chapter %s,%s,%s,%s', version, bookid, bookname, chapter) |
353 | - bookname = bookname.replace(u' ', '') |
354 | + bookname = bookname.replace(u' ', u'') |
355 | urlstring = u'http://bible.crosswalk.com/OnlineStudyBible/bible.cgi?word=%s+%d&version=%s' % (bookname, chapter, version) |
356 | xml_string = self._get_web_text(urlstring, self.proxyurl) |
357 | #log.debug(u'Return data %s', xml_string) |
358 | @@ -151,8 +151,8 @@ |
359 | verseText = xml_string[versePos: i] |
360 | versePos = i |
361 | #print verseText |
362 | + #print self._clean_text(verseText) |
363 | bible[verse] = self._clean_text(verseText) |
364 | - #bible[verse] = verseText |
365 | |
366 | #log.debug( bible) |
367 | return SearchResults(book_title, book_chapter, bible) |
368 | |
369 | === modified file 'openlp/plugins/bibles/lib/biblestab.py' |
370 | --- openlp/plugins/bibles/lib/biblestab.py 2009-06-16 18:21:24 +0000 |
371 | +++ openlp/plugins/bibles/lib/biblestab.py 2009-07-23 05:17:26 +0000 |
372 | @@ -56,22 +56,9 @@ |
373 | self.VerseDisplayLayout = QtGui.QGridLayout(self.VerseDisplayGroupBox) |
374 | self.VerseDisplayLayout.setMargin(8) |
375 | self.VerseDisplayLayout.setObjectName(u'VerseDisplayLayout') |
376 | - self.VerseTypeWidget = QtGui.QWidget(self.VerseDisplayGroupBox) |
377 | - self.VerseTypeWidget.setObjectName(u'VerseTypeWidget') |
378 | - self.VerseTypeLayout = QtGui.QHBoxLayout(self.VerseTypeWidget) |
379 | - self.VerseTypeLayout.setSpacing(8) |
380 | - self.VerseTypeLayout.setMargin(0) |
381 | - self.VerseTypeLayout.setObjectName(u'VerseTypeLayout') |
382 | - self.VerseRadioButton = QtGui.QRadioButton(self.VerseTypeWidget) |
383 | - self.VerseRadioButton.setObjectName(u'VerseRadioButton') |
384 | - self.VerseTypeLayout.addWidget(self.VerseRadioButton) |
385 | - self.ParagraphRadioButton = QtGui.QRadioButton(self.VerseTypeWidget) |
386 | - self.ParagraphRadioButton.setObjectName(u'ParagraphRadioButton') |
387 | - self.VerseTypeLayout.addWidget(self.ParagraphRadioButton) |
388 | - self.VerseDisplayLayout.addWidget(self.VerseTypeWidget, 0, 0, 1, 1) |
389 | self.NewChaptersCheckBox = QtGui.QCheckBox(self.VerseDisplayGroupBox) |
390 | self.NewChaptersCheckBox.setObjectName(u'NewChaptersCheckBox') |
391 | - self.VerseDisplayLayout.addWidget(self.NewChaptersCheckBox, 1, 0, 1, 1) |
392 | + self.VerseDisplayLayout.addWidget(self.NewChaptersCheckBox, 0, 0, 1, 1) |
393 | self.DisplayStyleWidget = QtGui.QWidget(self.VerseDisplayGroupBox) |
394 | self.DisplayStyleWidget.setObjectName(u'DisplayStyleWidget') |
395 | self.DisplayStyleLayout = QtGui.QHBoxLayout(self.DisplayStyleWidget) |
396 | @@ -88,7 +75,24 @@ |
397 | self.DisplayStyleComboBox.addItem(QtCore.QString()) |
398 | self.DisplayStyleComboBox.addItem(QtCore.QString()) |
399 | self.DisplayStyleLayout.addWidget(self.DisplayStyleComboBox) |
400 | - self.VerseDisplayLayout.addWidget(self.DisplayStyleWidget, 2, 0, 1, 1) |
401 | + self.VerseDisplayLayout.addWidget(self.DisplayStyleWidget, 1, 0, 1, 1) |
402 | + self.LayoutStyleWidget = QtGui.QWidget(self.VerseDisplayGroupBox) |
403 | + self.LayoutStyleWidget.setObjectName(u'LayoutStyleWidget') |
404 | + self.LayoutStyleLayout = QtGui.QHBoxLayout(self.LayoutStyleWidget) |
405 | + self.LayoutStyleLayout.setSpacing(8) |
406 | + self.LayoutStyleLayout.setMargin(0) |
407 | + self.LayoutStyleLayout.setObjectName(u'LayoutStyleLayout') |
408 | + self.LayoutStyleLabel = QtGui.QLabel(self.LayoutStyleWidget) |
409 | + self.LayoutStyleLabel.setObjectName(u'LayoutStyleLabel') |
410 | + self.LayoutStyleLayout.addWidget(self.LayoutStyleLabel) |
411 | + self.LayoutStyleComboBox = QtGui.QComboBox(self.LayoutStyleWidget) |
412 | + self.LayoutStyleComboBox.setObjectName(u'LayoutStyleComboBox') |
413 | + self.LayoutStyleComboBox.addItem(QtCore.QString()) |
414 | + self.LayoutStyleComboBox.addItem(QtCore.QString()) |
415 | + self.LayoutStyleComboBox.addItem(QtCore.QString()) |
416 | + self.LayoutStyleLayout.addWidget(self.LayoutStyleComboBox) |
417 | + self.VerseDisplayLayout.addWidget(self.LayoutStyleWidget, 2, 0, 1, 1) |
418 | + |
419 | self.BibleThemeWidget = QtGui.QWidget(self.VerseDisplayGroupBox) |
420 | self.BibleThemeWidget.setObjectName(u'BibleThemeWidget') |
421 | self.BibleThemeLayout = QtGui.QHBoxLayout(self.BibleThemeWidget) |
422 | @@ -136,22 +140,22 @@ |
423 | QtCore.SIGNAL(u'stateChanged(int)'), self.onNewChaptersCheckBoxChanged) |
424 | QtCore.QObject.connect(self.BibleSearchCheckBox, |
425 | QtCore.SIGNAL(u'stateChanged(int)'), self.onBibleSearchCheckBoxChanged) |
426 | - QtCore.QObject.connect(self.VerseRadioButton, |
427 | - QtCore.SIGNAL(u'pressed()'), self.onVerseRadioButtonPressed) |
428 | - QtCore.QObject.connect(self.ParagraphRadioButton, |
429 | - QtCore.SIGNAL(u'pressed()'), self.onParagraphRadioButtonPressed) |
430 | QtCore.QObject.connect(self.DisplayStyleComboBox, |
431 | QtCore.SIGNAL(u'activated(int)'), self.onDisplayStyleComboBoxChanged) |
432 | QtCore.QObject.connect(self.BibleThemeComboBox, |
433 | QtCore.SIGNAL(u'activated(int)'), self.onBibleThemeComboBoxChanged) |
434 | + QtCore.QObject.connect(self.LayoutStyleComboBox, |
435 | + QtCore.SIGNAL(u'activated(int)'), self.onLayoutStyleComboBoxChanged) |
436 | |
437 | def retranslateUi(self): |
438 | self.VerseDisplayGroupBox.setTitle(translate(u'SettingsForm', u'Verse Display')) |
439 | - self.VerseRadioButton.setText(translate(u'SettingsForm', u'Verse style')) |
440 | - self.ParagraphRadioButton.setText(translate(u'SettingsForm', u'Paragraph style')) |
441 | self.NewChaptersCheckBox.setText(translate(u'SettingsForm', u'Only show new chapter numbers')) |
442 | + self.LayoutStyleLabel.setText(translate(u'SettingsForm', u'Layout Style:')) |
443 | self.DisplayStyleLabel.setText(translate(u'SettingsForm', u'Display Style:')) |
444 | self.BibleThemeLabel.setText(translate(u'SettingsForm', u'Bible Theme:')) |
445 | + self.LayoutStyleComboBox.setItemText(0, translate(u'SettingsForm', u'verse per slide')) |
446 | + self.LayoutStyleComboBox.setItemText(1, translate(u'SettingsForm', u'verse per line')) |
447 | + self.LayoutStyleComboBox.setItemText(2, translate(u'SettingsForm', u'continuous')) |
448 | self.DisplayStyleComboBox.setItemText(0, translate(u'SettingsForm', u'No brackets')) |
449 | self.DisplayStyleComboBox.setItemText(1, translate(u'SettingsForm', u'( and )')) |
450 | self.DisplayStyleComboBox.setItemText(2, translate(u'SettingsForm', u'{ and }')) |
451 | @@ -166,11 +170,8 @@ |
452 | def onDisplayStyleComboBoxChanged(self): |
453 | self.display_style = self.DisplayStyleComboBox.currentIndex() |
454 | |
455 | - def onVerseRadioButtonPressed(self): |
456 | - self.paragraph_style = False |
457 | - |
458 | - def onParagraphRadioButtonPressed(self): |
459 | - self.paragraph_style = True |
460 | + def onLayoutStyleComboBoxChanged(self): |
461 | + self.layout_style = self.LayoutStyleComboBox.currentIndex() |
462 | |
463 | def onNewChaptersCheckBoxChanged(self): |
464 | check_state = self.NewChaptersCheckBox.checkState() |
465 | @@ -187,23 +188,20 @@ |
466 | self.bible_search = True |
467 | |
468 | def load(self): |
469 | - self.paragraph_style = str_to_bool(self.config.get_config(u'paragraph style', u'True')) |
470 | self.show_new_chapters = str_to_bool(self.config.get_config(u'display new chapter', u'False')) |
471 | self.display_style = int(self.config.get_config(u'display brackets', u'0')) |
472 | + self.layout_style = int(self.config.get_config(u'verse layout style', u'0')) |
473 | self.bible_theme = self.config.get_config(u'bible theme', u'0') |
474 | self.bible_search = str_to_bool(self.config.get_config(u'search as type', u'True')) |
475 | - if self.paragraph_style: |
476 | - self.ParagraphRadioButton.setChecked(True) |
477 | - else: |
478 | - self.VerseRadioButton.setChecked(True) |
479 | self.NewChaptersCheckBox.setChecked(self.show_new_chapters) |
480 | self.DisplayStyleComboBox.setCurrentIndex(self.display_style) |
481 | + self.LayoutStyleComboBox.setCurrentIndex(self.layout_style) |
482 | self.BibleSearchCheckBox.setChecked(self.bible_search) |
483 | |
484 | def save(self): |
485 | - self.config.set_config(u'paragraph style', unicode(self.paragraph_style)) |
486 | self.config.set_config(u'display new chapter', unicode(self.show_new_chapters)) |
487 | self.config.set_config(u'display brackets', unicode(self.display_style)) |
488 | + self.config.set_config(u'verse layout style', unicode(self.layout_style)) |
489 | self.config.set_config(u'search as type', unicode(self.bible_search)) |
490 | self.config.set_config(u'bible theme', unicode(self.bible_theme)) |
491 | |
492 | @@ -220,4 +218,4 @@ |
493 | # Not Found |
494 | id = 0 |
495 | self.bible_theme = u'' |
496 | - self.BibleThemeComboBox.setCurrentIndex(id) |
497 | \ No newline at end of file |
498 | + self.BibleThemeComboBox.setCurrentIndex(id) |
499 | |
500 | === modified file 'openlp/plugins/bibles/lib/manager.py' |
501 | --- openlp/plugins/bibles/lib/manager.py 2009-07-18 05:43:50 +0000 |
502 | +++ openlp/plugins/bibles/lib/manager.py 2009-08-02 13:44:41 +0000 |
503 | @@ -28,9 +28,7 @@ |
504 | from bibleCSVimpl import BibleCSVImpl |
505 | from bibleDBimpl import BibleDBImpl |
506 | from bibleHTTPimpl import BibleHTTPImpl |
507 | - |
508 | -#from openlp.plugins.bibles.lib.tables import * |
509 | -#from openlp.plugins.bibles.lib.classes import * |
510 | +from openlp.core.lib import Receiver |
511 | |
512 | class BibleMode(object): |
513 | Full = 1 |
514 | @@ -68,6 +66,15 @@ |
515 | self.dialogobject = None |
516 | self.reload_bibles() |
517 | |
518 | + def set_media_manager(self, media): |
519 | + """ |
520 | + Sets the reference to the media manager. |
521 | + |
522 | + ``media`` |
523 | + The reference to the media manager. |
524 | + """ |
525 | + self.media = media |
526 | + |
527 | def reload_bibles(self): |
528 | log.debug(u'Reload bibles') |
529 | files = self.config.get_files(self.bibleSuffix) |
530 | @@ -228,8 +235,7 @@ |
531 | Advanced Search, and when the mode is ``BibleMode.Partial`` |
532 | this method returns all the bibles for the Quick Search. |
533 | |
534 | - ``mode`` |
535 | - Defaults to ``BibleMode.Full``. The Bible mode. |
536 | +c |
537 | """ |
538 | log.debug(u'get_bibles') |
539 | bible_list = [] |
540 | @@ -293,17 +299,24 @@ |
541 | Returns a list of verses for a given Book, Chapter and ranges of verses. |
542 | If the end verse(everse) is less then the start verse(sverse) |
543 | then only one verse is returned |
544 | - bible - Which bible to use. |
545 | + |
546 | + ``bible`` |
547 | + The name of the bible to be used |
548 | + |
549 | Rest can be guessed at ! |
550 | """ |
551 | text = [] |
552 | + self.media.setQuickMsg1(u'') |
553 | + self.media.setQuickMsg2(u'') |
554 | log.debug(u'get_verse_text %s,%s,%s,%s,%s,%s', bible, bookname, schapter, echapter, sverse, everse) |
555 | - if not self.bible_http_cache[bible] == None: |
556 | - # check to see if book/chapter exists |
557 | + # check to see if book/chapter exists fow HTTP bibles and load cache if necessary |
558 | + if self.bible_http_cache[bible] is not None: |
559 | book= self.bible_db_cache[bible].get_bible_book(bookname) |
560 | if book == None: |
561 | + self.media.setQuickMsg1(u'Downloading') |
562 | log.debug(u'get_verse_text : new book') |
563 | - for chapter in range(schapter, echapter+1): |
564 | + for chapter in range(schapter, echapter + 1): |
565 | + self.media.setQuickMsg2(u'%s: %s'% (bookname, chapter)) |
566 | search_results = self.bible_http_cache [bible].get_bible_chapter(bible, 0, bookname, chapter) |
567 | if search_results.has_verselist() : |
568 | ## We have found a book of the bible lets check to see if it was there. |
569 | @@ -325,35 +338,39 @@ |
570 | ## Book exists check chapter and texts only. |
571 | v = self.bible_db_cache[bible].get_bible_chapter(book.id, chapter) |
572 | if v == None: |
573 | + self.media.setQuickMsg2(u'%s: %s'%(bookname, chapter)) |
574 | self.bible_db_cache[bible].create_chapter(book.id, \ |
575 | chapter, \ |
576 | search_results.get_verselist()) |
577 | else: |
578 | log.debug(u'get_verse_text : old book') |
579 | - for chapter in range(schapter, echapter+1): |
580 | + for chapter in range(schapter, echapter + 1): |
581 | v = self.bible_db_cache[bible].get_bible_chapter(book.id, chapter) |
582 | if v == None: |
583 | try: |
584 | + self.media.setQuickMsg1(u'Downloading') |
585 | + self.media.setQuickMsg2(u'%s: %s'% (bookname, chapter)) |
586 | search_results = self.bible_http_cache [bible].get_bible_chapter(bible, book.id, bookname, chapter) |
587 | - self.bible_db_cache[bible].create_chapter(book.id, \ |
588 | - search_results.get_chapter(),\ |
589 | - search_results.get_verselist()) |
590 | + if search_results.has_verselist(): |
591 | + self.bible_db_cache[bible].create_chapter(book.id, \ |
592 | + search_results.get_chapter(),\ |
593 | + search_results.get_verselist()) |
594 | except : |
595 | log.error(u'Errow thrown %s', sys.exc_info()[1]) |
596 | - |
597 | + #Now get verses from database |
598 | if schapter == echapter: |
599 | text = self.bible_db_cache[bible].get_bible_text(bookname, schapter, sverse, everse) |
600 | else: |
601 | for i in range (schapter, echapter + 1): |
602 | if i == schapter: |
603 | start = sverse |
604 | - end = self.get_book_verse_count(bible, bookname,i )[0] |
605 | + end = self.get_book_verse_count(bible, bookname, i) |
606 | elif i == echapter: |
607 | start = 1 |
608 | end = everse |
609 | else: |
610 | start = 1 |
611 | - end = self.get_book_verse_count(bible, bookname,i )[0] |
612 | + end = self.get_book_verse_count(bible, bookname, i) |
613 | |
614 | txt = self.bible_db_cache[bible].get_bible_text(bookname, i, start, end) |
615 | text.extend(txt) |
616 | |
617 | === modified file 'openlp/plugins/bibles/lib/mediaitem.py' |
618 | --- openlp/plugins/bibles/lib/mediaitem.py 2009-07-13 20:11:36 +0000 |
619 | +++ openlp/plugins/bibles/lib/mediaitem.py 2009-08-02 13:44:41 +0000 |
620 | @@ -135,6 +135,12 @@ |
621 | self.ClearQuickSearchComboBox = QtGui.QComboBox(self.QuickTab) |
622 | self.ClearQuickSearchComboBox.setObjectName(u'ClearQuickSearchComboBox') |
623 | self.QuickLayout.addWidget(self.ClearQuickSearchComboBox, 3, 1, 1, 1) |
624 | + self.QuickMsg1 = QtGui.QLabel(self.QuickTab) |
625 | + self.QuickMsg1.setObjectName(u'QuickSearchLabel') |
626 | + self.QuickLayout.addWidget(self.QuickMsg1, 4, 0, 1, 1) |
627 | + self.QuickMsg2 = QtGui.QLabel(self.QuickTab) |
628 | + self.QuickMsg2.setObjectName(u'QuickSearchLabel') |
629 | + self.QuickLayout.addWidget(self.QuickMsg2, 4, 1, 1, 1) |
630 | self.SearchTabWidget.addTab(self.QuickTab, 'Quick') |
631 | QuickSpacerItem = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, |
632 | QtGui.QSizePolicy.Expanding) |
633 | @@ -254,6 +260,14 @@ |
634 | def initialise(self): |
635 | log.debug(u'initialise') |
636 | self.loadBibles() |
637 | + self.parent.biblemanager.set_media_manager(self) |
638 | + |
639 | + def setQuickMsg1(self, text): |
640 | + self.QuickMsg1.setText(translate(u'BibleMediaItem', unicode(text))) |
641 | + |
642 | + def setQuickMsg2(self, text): |
643 | + self.QuickMsg2.setText(translate(u'BibleMediaItem', unicode(text))) |
644 | + Receiver().send_message(u'openlpprocessevents') |
645 | |
646 | def loadBibles(self): |
647 | log.debug(u'Loading Bibles') |
648 | @@ -355,7 +369,7 @@ |
649 | verse = unicode(self.search_results[0].verse) |
650 | text = self.search_results[0].text |
651 | #Paragraph style force new line per verse |
652 | - if self.parent.bibles_tab.paragraph_style: |
653 | + if self.parent.bibles_tab.layout_style == 1: |
654 | text = text + u'\n\n' |
655 | if self.parent.bibles_tab.display_style == 1: |
656 | loc = self.formatVerse(old_chapter, chapter, verse, u'(u', u')') |
657 | @@ -367,8 +381,13 @@ |
658 | loc = self.formatVerse(old_chapter, chapter, verse, u'', u'') |
659 | old_chapter = chapter |
660 | bible_text = bible_text + u' '+ loc + u' '+ text |
661 | + #if we are verse per slide then create slide |
662 | + if self.parent.bibles_tab.layout_style == 0: |
663 | + raw_slides.append(bible_text) |
664 | + bible_text = u'' |
665 | service_item.title = book + u' ' + loc |
666 | footer = book + u' (' + self.version + u' ' + self.copyright +u')' |
667 | + #If not found throws and error so add.s |
668 | try: |
669 | raw_footer.index(footer) |
670 | except: |
671 | @@ -377,7 +396,9 @@ |
672 | service_item.theme = None |
673 | else: |
674 | service_item.theme = self.parent.bibles_tab.bible_theme |
675 | - raw_slides.append(bible_text) |
676 | + #if we are verse per slide we have already been added |
677 | + if self.parent.bibles_tab.layout_style != 0: |
678 | + raw_slides.append(bible_text) |
679 | for slide in raw_slides: |
680 | service_item.add_from_text(slide[:30], slide) |
681 | service_item.raw_footer = raw_footer |
682 | @@ -425,10 +446,6 @@ |
683 | |
684 | def displayResults(self, bible): |
685 | for verse in self.search_results: |
686 | - #bible_text = unicode(u' %s %d:%d (%s)'%(book , chap,vse, bible)) |
687 | - #bible_verse = QtGui.QListWidgetItem(bible_text) |
688 | - #bible_verse.setData(QtCore.Qt.UserRole, QtCore.QVariant(bible_text)) |
689 | - #self.ListView.addItem(bible_verse) |
690 | bible_text = u' %s %d:%d (%s)' % (verse.book.name, |
691 | verse.chapter, verse.verse, bible) |
692 | bible_verse = QtGui.QListWidgetItem(bible_text) |
693 | |
694 | === modified file 'openlp/plugins/songs/forms/editsongform.py' |
695 | --- openlp/plugins/songs/forms/editsongform.py 2009-07-19 07:58:37 +0000 |
696 | +++ openlp/plugins/songs/forms/editsongform.py 2009-08-02 16:13:59 +0000 |
697 | @@ -48,16 +48,12 @@ |
698 | QtCore.SIGNAL(u'clicked()'), self.onAuthorRemovefromSongItemClicked) |
699 | QtCore.QObject.connect(self.AuthorsListView, |
700 | QtCore.SIGNAL(u'itemClicked(QListWidgetItem*)'), self.onAuthorsListViewPressed) |
701 | -# QtCore.QObject.connect(self.AddTopicButton, |
702 | -# QtCore.SIGNAL(u'clicked()'), self.onAddTopicButtonClicked) |
703 | QtCore.QObject.connect(self.AddTopicsToSongButton, |
704 | QtCore.SIGNAL(u'clicked()'), self.onTopicAddtoSongItemClicked) |
705 | QtCore.QObject.connect(self.TopicRemoveItem, |
706 | QtCore.SIGNAL(u'clicked()'), self.onTopicRemovefromSongItemClicked) |
707 | QtCore.QObject.connect(self.TopicsListView, |
708 | QtCore.SIGNAL(u'itemClicked(QListWidgetItem*)'), self.onTopicListViewPressed) |
709 | -# QtCore.QObject.connect(self.AddSongBookButton, |
710 | -# QtCore.SIGNAL(u'clicked()'), self.onAddSongBookButtonClicked) |
711 | QtCore.QObject.connect(self.CopyrightInsertItem, |
712 | QtCore.SIGNAL(u'clicked()'), self.onCopyrightInsertItemTriggered) |
713 | QtCore.QObject.connect(self.AddButton, |
714 | @@ -75,9 +71,6 @@ |
715 | # Create other objects and forms |
716 | self.songmanager = songmanager |
717 | self.eventmanager = eventmanager |
718 | -# self.authors_form = AuthorsForm(self.songmanager) |
719 | -# self.topics_form = TopicsForm(self.songmanager) |
720 | -# self.song_book_form = SongBookForm(self.songmanager) |
721 | self.verse_form = EditVerseForm() |
722 | self.initialise() |
723 | self.AuthorsListView.setSortingEnabled(False) |
724 | @@ -253,30 +246,6 @@ |
725 | row = self.TopicsListView.row(item) |
726 | self.TopicsListView.takeItem(row) |
727 | |
728 | -# def onAddAuthorsButtonClicked(self): |
729 | -# """ |
730 | -# Slot documentation goes here. |
731 | -# """ |
732 | -# self.authors_form.load_form() |
733 | -# self.authors_form.exec_() |
734 | -# self.loadAuthors() |
735 | -# |
736 | -# def onAddTopicButtonClicked(self): |
737 | -# """ |
738 | -# Slot documentation goes here. |
739 | -# """ |
740 | -# self.topics_form.load_form() |
741 | -# self.topics_form.exec_() |
742 | -# self.loadTopics() |
743 | -# |
744 | -# def onAddSongBookButtonClicked(self): |
745 | -# """ |
746 | -# Slot documentation goes here. |
747 | -# """ |
748 | -# self.song_book_form.load_form() |
749 | -# self.song_book_form.exec_() |
750 | -# self.loadBooks() |
751 | - |
752 | def onSongBookComboChanged(self, item): |
753 | if item == 0: |
754 | self.song.song_book_id = 0 |
New version of previous merge
Fixes and New feature time:
- Bibles now can have verse per slide
- Themes can have bold fonts.
- Http biles now tell you when downloading
- Http bibles stop at end of chapter(oops)
- Fix song migration bug
- Fix Theme deletion bug