Merge lp:~raoul-snyman/openlp/dualdisplay2 into lp:openlp

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

Fixed displaying of "display" label on the display form.
Display form is displayed on the correct screen at startup.
Display form switches to active non-primary screen or hidden on primary screen after set in the settings dialog.
A few syntax tidy-ups.
Made the loading and saving of things to the "registry" better.

Revision history for this message
Tim Bentley (trb143) wrote :

Looks fine to me

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'openlp/core/lib/pluginconfig.py'
--- openlp/core/lib/pluginconfig.py 2009-05-20 20:17:20 +0000
+++ openlp/core/lib/pluginconfig.py 2009-06-05 18:53:50 +0000
@@ -56,10 +56,8 @@
56 safe_name = self.section.replace(u' ',u'-')56 safe_name = self.section.replace(u' ',u'-')
57 plugin_data = self.get_config(u'data path', safe_name)57 plugin_data = self.get_config(u'data path', safe_name)
58 path = os.path.join(app_data, plugin_data)58 path = os.path.join(app_data, plugin_data)
59
60 if not os.path.exists(path):59 if not os.path.exists(path):
61 os.makedirs(path)60 os.makedirs(path)
62
63 return path61 return path
6462
65 def set_data_path(self, path):63 def set_data_path(self, path):
@@ -74,8 +72,8 @@
74 if suffix != None:72 if suffix != None:
75 return_files = []73 return_files = []
76 for f in files:74 for f in files:
77 if f.find('.') != -1:75 if f.find(u'.') != -1:
78 nme = f.split('.')76 nme = f.split(u'.')
79 bname = nme[0]77 bname = nme[0]
80 sfx = nme[1].lower()78 sfx = nme[1].lower()
81 sfx = sfx.lower()79 sfx = sfx.lower()
@@ -127,7 +125,7 @@
127 name = u'last directory'125 name = u'last directory'
128 last_dir = self.get_config(name)126 last_dir = self.get_config(name)
129 if last_dir is None:127 if last_dir is None:
130 last_dir = ''128 last_dir = u''
131 return last_dir129 return last_dir
132130
133 def set_last_dir(self, directory, num=None):131 def set_last_dir(self, directory, num=None):
134132
=== modified file 'openlp/core/lib/renderer.py'
--- openlp/core/lib/renderer.py 2009-06-03 15:38:14 +0000
+++ openlp/core/lib/renderer.py 2009-06-05 18:53:50 +0000
@@ -27,11 +27,8 @@
27from copy import copy27from copy import copy
2828
29class Renderer:29class Renderer:
3030 """
31 global log31 All the functions for rendering a set of words onto a Device Context
32 log = logging.getLogger(u'Renderer')
33 log.info(u'Renderer Loaded')
34 """All the functions for rendering a set of words onto a Device Context
3532
36 How to use:33 How to use:
37 set the words to be displayed with a call to format_slide() - this returns an array of screenfuls of data34 set the words to be displayed with a call to format_slide() - this returns an array of screenfuls of data
@@ -39,8 +36,11 @@
39 tell it which DC to render to with set_DC()36 tell it which DC to render to with set_DC()
40 set the borders of where you want the text (if not the whole DC) with set_text_rectangle()37 set the borders of where you want the text (if not the whole DC) with set_text_rectangle()
41 tell it to render a particular screenfull with render_screen(n)38 tell it to render a particular screenfull with render_screen(n)
39 """
40 global log
41 log = logging.getLogger(u'Renderer')
42 log.info(u'Renderer Loaded')
4243
43 """
44 def __init__(self):44 def __init__(self):
45 self._rect = None45 self._rect = None
46 self._debug = 046 self._debug = 0
@@ -119,19 +119,11 @@
119 lines = verse.split(u'\n')119 lines = verse.split(u'\n')
120 for line in lines:120 for line in lines:
121 text.append(line)121 text.append(line)
122
123 split_text = self._split_set_of_lines(text, False)122 split_text = self._split_set_of_lines(text, False)
124 print "split text ", split_text123 print "split text ", split_text
125 print "text ", text124 print "text ", text
126 return split_text125 return split_text
127126
128# def render_screen(self, screennum):
129# log.debug(u'render screen\n %s %s ', screennum, self.words[screennum])
130# t = 0.0
131# words = self.words[screennum]
132# retval = self._render_lines(words)
133# return retval
134
135 def set_text_rectangle(self, rect_main, rect_footer):127 def set_text_rectangle(self, rect_main, rect_footer):
136 """128 """
137 Sets the rectangle within which text should be rendered129 Sets the rectangle within which text should be rendered
@@ -145,23 +137,17 @@
145 """137 """
146 #print "########## Generate frame from lines ##################"138 #print "########## Generate frame from lines ##################"
147 log.debug(u'generate_frame_from_lines - Start')139 log.debug(u'generate_frame_from_lines - Start')
148
149 #print "Render Lines ", lines140 #print "Render Lines ", lines
150
151 bbox = self._render_lines_unaligned(lines, False)141 bbox = self._render_lines_unaligned(lines, False)
152 if footer_lines is not None:142 if footer_lines is not None:
153 bbox1 = self._render_lines_unaligned(footer_lines, True)143 bbox1 = self._render_lines_unaligned(footer_lines, True)
154
155 # reset the frame. first time do not worrk about what you paint on.144 # reset the frame. first time do not worrk about what you paint on.
156 self._frame = QtGui.QPixmap(self._bg_frame)145 self._frame = QtGui.QPixmap(self._bg_frame)
157
158 x, y = self._correctAlignment(self._rect, bbox)146 x, y = self._correctAlignment(self._rect, bbox)
159 bbox = self._render_lines_unaligned(lines, False, (x, y))147 bbox = self._render_lines_unaligned(lines, False, (x, y))
160
161 if footer_lines is not None:148 if footer_lines is not None:
162 bbox = self._render_lines_unaligned(footer_lines, True, (self._rect_footer.left(), self._rect_footer.top()) )149 bbox = self._render_lines_unaligned(footer_lines, True, (self._rect_footer.left(), self._rect_footer.top()) )
163 log.debug(u'generate_frame_from_lines - Finish')150 log.debug(u'generate_frame_from_lines - Finish')
164
165 return self._frame151 return self._frame
166152
167 def _generate_background_frame(self):153 def _generate_background_frame(self):
@@ -189,23 +175,18 @@
189 w = int(self._frame.width()) / 2175 w = int(self._frame.width()) / 2
190 h = int(self._frame.height()) / 2176 h = int(self._frame.height()) / 2
191 gradient = QtGui.QRadialGradient(w, h, w) # Circular177 gradient = QtGui.QRadialGradient(w, h, w) # Circular
192
193 gradient.setColorAt(0, QtGui.QColor(self._theme.background_startColor))178 gradient.setColorAt(0, QtGui.QColor(self._theme.background_startColor))
194 gradient.setColorAt(1, QtGui.QColor(self._theme.background_endColor))179 gradient.setColorAt(1, QtGui.QColor(self._theme.background_endColor))
195
196 painter.setBrush(QtGui.QBrush(gradient))180 painter.setBrush(QtGui.QBrush(gradient))
197 rectPath = QtGui.QPainterPath()181 rectPath = QtGui.QPainterPath()
198
199 max_x = self._frame.width()182 max_x = self._frame.width()
200 max_y = self._frame.height()183 max_y = self._frame.height()
201 rectPath.moveTo(0, 0)184 rectPath.moveTo(0, 0)
202 rectPath.lineTo(0, max_y)185 rectPath.lineTo(0, max_y)
203 rectPath.lineTo(max_x, max_y)186 rectPath.lineTo(max_x, max_y)
204 rectPath.lineTo(max_x, 0)187 rectPath.lineTo(max_x, 0)
205
206 rectPath.closeSubpath()188 rectPath.closeSubpath()
207 painter.drawPath(rectPath)189 painter.drawPath(rectPath)
208
209 elif self._theme.background_type== u'image': # image190 elif self._theme.background_type== u'image': # image
210 if self.bg_image is not None:191 if self.bg_image is not None:
211 painter.drawPixmap(0 ,0 , self.bg_image)192 painter.drawPixmap(0 ,0 , self.bg_image)
@@ -219,24 +200,19 @@
219 def _split_set_of_lines(self, lines, footer):200 def _split_set_of_lines(self, lines, footer):
220 """201 """
221 Given a list of lines, decide how to split them best if they don't all fit on the screen202 Given a list of lines, decide how to split them best if they don't all fit on the screen
222 - this is done by splitting at 1/2, 1/3 or 1/4 of the set203 - this is done by splitting at 1/2, 1/3 or 1/4 of the set
223 If it doesn't fit, even at this size, just split at each opportunity204 If it doesn't fit, even at this size, just split at each opportunity.
224205 We'll do this by getting the bounding box of each line, and then summing them appropriately
225 We'll do this by getting the bounding box of each line, and then summing them appropriately206 Returns a list of [lists of lines], one set for each screenful
226 Returns a list of [lists of lines], one set for each screenful207 """
227 """
228 bboxes = []208 bboxes = []
229 #print "lines ", lines209 #print "lines ", lines
230
231 for line in lines:210 for line in lines:
232 bboxes.append(self._render_and_wrap_single_line(line, footer))211 bboxes.append(self._render_and_wrap_single_line(line, footer))
233 #print "bboxes ", bboxes212 #print "bboxes ", bboxes
234
235 numlines = len(lines)213 numlines = len(lines)
236 bottom = self._rect.bottom()214 bottom = self._rect.bottom()
237
238 count = 0215 count = 0
239
240 for ratio in (numlines, numlines/2, numlines/3, numlines/4):216 for ratio in (numlines, numlines/2, numlines/3, numlines/4):
241 good = 1217 good = 1
242 startline = 0218 startline = 0
@@ -258,7 +234,6 @@
258 endline = startline + ratio234 endline = startline + ratio
259 if good == 1:235 if good == 1:
260 break236 break
261
262 retval = []237 retval = []
263 numlines_per_page = ratio238 numlines_per_page = ratio
264 #print "good ", good, ratio239 #print "good ", good, ratio
@@ -276,7 +251,7 @@
276 retval.append(thislines)251 retval.append(thislines)
277 #print "extra ", thislines252 #print "extra ", thislines
278 else:253 else:
279# print "Just split where you can"254 # print "Just split where you can"
280 retval = []255 retval = []
281 startline = 0256 startline = 0
282 endline = startline + 1257 endline = startline + 1
@@ -312,7 +287,6 @@
312 (using the _render_single_line fn - which may result in going287 (using the _render_single_line fn - which may result in going
313 off the bottom) They are expected to be pre-arranged to less288 off the bottom) They are expected to be pre-arranged to less
314 than a screenful (eg. by using split_set_of_lines)289 than a screenful (eg. by using split_set_of_lines)
315
316 Returns the bounding box of the text as QRect290 Returns the bounding box of the text as QRect
317 """291 """
318 log.debug(u'render lines unaligned Start')292 log.debug(u'render lines unaligned Start')
@@ -339,10 +313,8 @@
339 """313 """
340 Render a single line of words onto the DC, top left corner314 Render a single line of words onto the DC, top left corner
341 specified.315 specified.
342
343 If the line is too wide for the context, it wraps, but316 If the line is too wide for the context, it wraps, but
344 right-aligns the surplus words in the manner of song lyrics317 right-aligns the surplus words in the manner of song lyrics
345
346 Returns the bottom-right corner (of what was rendered) as a tuple(x, y).318 Returns the bottom-right corner (of what was rendered) as a tuple(x, y).
347 """319 """
348 log.debug(u'Render single line %s @ %s '%( line, tlcorner))320 log.debug(u'Render single line %s @ %s '%( line, tlcorner))
@@ -374,7 +346,6 @@
374 align = 0346 align = 0
375 else:347 else:
376 align = int(self._theme .display_horizontalAlign)348 align = int(self._theme .display_horizontalAlign)
377
378 for linenum in range(len(lines)):349 for linenum in range(len(lines)):
379 line = lines[linenum]350 line = lines[linenum]
380 #find out how wide line is351 #find out how wide line is
@@ -420,7 +391,6 @@
420 color = self._theme.display_outline_color)391 color = self._theme.display_outline_color)
421 self._get_extent_and_render(line, footer,(x-self._outline_offset,y-self._outline_offset), draw=True,392 self._get_extent_and_render(line, footer,(x-self._outline_offset,y-self._outline_offset), draw=True,
422 color = self._theme.display_outline_color)393 color = self._theme.display_outline_color)
423
424 self._get_extent_and_render(line, footer,tlcorner=(x, y), draw=True)394 self._get_extent_and_render(line, footer,tlcorner=(x, y), draw=True)
425 y += h395 y += h
426 if linenum == 0:396 if linenum == 0:
@@ -432,7 +402,6 @@
432 painter.setPen(QtGui.QPen(QtGui.QColor(0,255,0)))402 painter.setPen(QtGui.QPen(QtGui.QColor(0,255,0)))
433 painter.drawRect(startx , starty , rightextent-startx , y-starty)403 painter.drawRect(startx , starty , rightextent-startx , y-starty)
434 painter.end()404 painter.end()
435
436 brcorner = (rightextent , y)405 brcorner = (rightextent , y)
437 log.debug(u'Render single line Finish')406 log.debug(u'Render single line Finish')
438 return brcorner407 return brcorner
@@ -489,3 +458,10 @@
489 if image2 is not None:458 if image2 is not None:
490 im = image2.toImage()459 im = image2.toImage()
491 im.save("renderer2.png", "png")460 im.save("renderer2.png", "png")
461
462# def render_screen(self, screennum):
463# log.debug(u'render screen\n %s %s ', screennum, self.words[screennum])
464# t = 0.0
465# words = self.words[screennum]
466# retval = self._render_lines(words)
467# return retval
492468
=== modified file 'openlp/core/lib/rendermanager.py'
--- openlp/core/lib/rendermanager.py 2009-06-01 17:50:37 +0000
+++ openlp/core/lib/rendermanager.py 2009-06-05 18:53:50 +0000
@@ -54,17 +54,25 @@
54 log=logging.getLogger(u'RenderManager')54 log=logging.getLogger(u'RenderManager')
55 log.info(u'RenderManager Loaded')55 log.info(u'RenderManager Loaded')
5656
57 def __init__(self, theme_manager, screen_list):57 def __init__(self, theme_manager, screen_list, screen_number=0):
58 log.debug(u'Initilisation started')58 log.debug(u'Initilisation started')
59 self.screen_list = screen_list59 self.screen_list = screen_list
60 self.theme_manager = theme_manager60 self.theme_manager = theme_manager
61 self.displays = len(screen_list)61 self.displays = len(screen_list)
62 self.current_display = 062 self.current_display = screen_number
63 self.renderer = Renderer()63 self.renderer = Renderer()
64 self.calculate_default(self.screen_list[self.current_display]['size'])64 self.calculate_default(self.screen_list[self.current_display]['size'])
65 self.theme = u''65 self.theme = u''
66 self.service_theme = u''66 self.service_theme = u''
6767
68 def update_display(self, screen_number):
69 """
70 Updates the render manager's information about the current screen.
71 """
72 if self.current_display != screen_number:
73 self.current_display = screen_number
74 self.calculate_default(self.screen_list[self.current_display]['size'])
75
68 def set_global_theme(self, global_theme, global_style = u'Global'):76 def set_global_theme(self, global_theme, global_style = u'Global'):
69 self.global_theme = global_theme77 self.global_theme = global_theme
70 self.global_style = global_style78 self.global_style = global_style
@@ -95,7 +103,7 @@
95 if self.theme is not self.renderer.theme_name:103 if self.theme is not self.renderer.theme_name:
96 log.debug(u'theme is now %s', self.theme)104 log.debug(u'theme is now %s', self.theme)
97 self.themedata = self.theme_manager.getThemeData(self.theme)105 self.themedata = self.theme_manager.getThemeData(self.theme)
98 self.calculate_default(self.screen_list[self.current_display]['size'])106 self.calculate_default(self.screen_list[self.current_display][u'size'])
99 self.renderer.set_theme(self.themedata)107 self.renderer.set_theme(self.themedata)
100 self.build_text_rectangle(self.themedata)108 self.build_text_rectangle(self.themedata)
101109
@@ -140,14 +148,14 @@
140148
141 def format_slide(self, words):149 def format_slide(self, words):
142 log.debug(u'format slide')150 log.debug(u'format slide')
143 self.calculate_default(self.screen_list[self.current_display]['size'])151 self.calculate_default(self.screen_list[self.current_display][u'size'])
144 self.build_text_rectangle(self.themedata)152 self.build_text_rectangle(self.themedata)
145 self.renderer.set_frame_dest(self.width, self.height)153 self.renderer.set_frame_dest(self.width, self.height)
146 return self.renderer.format_slide(words, False)154 return self.renderer.format_slide(words, False)
147155
148 def generate_slide(self,main_text, footer_text):156 def generate_slide(self,main_text, footer_text):
149 log.debug(u'generate slide')157 log.debug(u'generate slide')
150 self.calculate_default(self.screen_list[self.current_display]['size'])158 self.calculate_default(self.screen_list[self.current_display][u'size'])
151 self.build_text_rectangle(self.themedata)159 self.build_text_rectangle(self.themedata)
152 self.renderer.set_frame_dest(self.width, self.height)160 self.renderer.set_frame_dest(self.width, self.height)
153 return self.renderer.generate_frame_from_lines(main_text, footer_text)161 return self.renderer.generate_frame_from_lines(main_text, footer_text)
154162
=== modified file 'openlp/core/lib/settingstab.py'
--- openlp/core/lib/settingstab.py 2009-05-01 11:50:09 +0000
+++ openlp/core/lib/settingstab.py 2009-06-05 18:53:50 +0000
@@ -25,7 +25,7 @@
25 """25 """
26 SettingsTab is a helper widget for plugins to define Tabs for the settings dialog.26 SettingsTab is a helper widget for plugins to define Tabs for the settings dialog.
27 """27 """
28 def __init__(self, title=None):28 def __init__(self, title=None, section=None):
29 """29 """
30 Constructor to create the Steetings tab item.30 Constructor to create the Steetings tab item.
31 """31 """
@@ -34,10 +34,10 @@
34 self.setupUi()34 self.setupUi()
35 self.retranslateUi()35 self.retranslateUi()
36 self.initialise()36 self.initialise()
37 if title == None:37 if section == None:
38 self.config = PluginConfig(u'Main')38 self.config = PluginConfig(title)
39 else:39 else:
40 self.config = PluginConfig(str(title))40 self.config = PluginConfig(section)
41 self.load()41 self.load()
4242
43 def setTitle(self, title):43 def setTitle(self, title):
4444
=== modified file 'openlp/core/ui/alertstab.py'
--- openlp/core/ui/alertstab.py 2009-05-20 20:17:20 +0000
+++ openlp/core/ui/alertstab.py 2009-06-05 18:53:50 +0000
@@ -29,7 +29,7 @@
29 def __init__(self):29 def __init__(self):
30 self.font_color = '#ffffff'30 self.font_color = '#ffffff'
31 self.bg_color = '#660000'31 self.bg_color = '#660000'
32 SettingsTab.__init__(self, u'Alerts')32 SettingsTab.__init__(self, translate(u'AlertsTab', u'Alerts'), u'Alerts')
3333
34 def setupUi(self):34 def setupUi(self):
35 self.setObjectName(u'AlertsTab')35 self.setObjectName(u'AlertsTab')
@@ -130,13 +130,13 @@
130 self.AlertsLayout.addWidget(self.AlertRightColumn)130 self.AlertsLayout.addWidget(self.AlertRightColumn)
131 # Signals and slots131 # Signals and slots
132 QtCore.QObject.connect(self.BackgroundColorButton,132 QtCore.QObject.connect(self.BackgroundColorButton,
133 QtCore.SIGNAL("pressed()"), self.onBackgroundColorButtonClicked)133 QtCore.SIGNAL(u'pressed()'), self.onBackgroundColorButtonClicked)
134 QtCore.QObject.connect(self.FontColorButton,134 QtCore.QObject.connect(self.FontColorButton,
135 QtCore.SIGNAL("pressed()"), self.onFontColorButtonClicked)135 QtCore.SIGNAL(u'pressed()'), self.onFontColorButtonClicked)
136 QtCore.QObject.connect(self.FontComboBox,136 QtCore.QObject.connect(self.FontComboBox,
137 QtCore.SIGNAL("activated(int)"), self.onFontComboBoxClicked)137 QtCore.SIGNAL(u'activated(int)'), self.onFontComboBoxClicked)
138 QtCore.QObject.connect(self.TimeoutSpinBox,138 QtCore.QObject.connect(self.TimeoutSpinBox,
139 QtCore.SIGNAL("valueChanged(int)"), self.onTimeoutSpinBoxChanged)139 QtCore.SIGNAL(u'valueChanged(int)'), self.onTimeoutSpinBoxChanged)
140140
141 def retranslateUi(self):141 def retranslateUi(self):
142 self.FontGroupBox.setTitle(translate(u'AlertsTab', u'Font'))142 self.FontGroupBox.setTitle(translate(u'AlertsTab', u'Font'))
@@ -146,13 +146,13 @@
146 self.TimeoutLabel.setText(translate(u'AlertsTab', u'Alert timeout:'))146 self.TimeoutLabel.setText(translate(u'AlertsTab', u'Alert timeout:'))
147 self.TimeoutSpinBox.setSuffix(translate(u'AlertsTab', u's'))147 self.TimeoutSpinBox.setSuffix(translate(u'AlertsTab', u's'))
148 self.PreviewGroupBox.setTitle(translate(u'AlertsTab', u'Preview'))148 self.PreviewGroupBox.setTitle(translate(u'AlertsTab', u'Preview'))
149 self.FontPreview.setText(translate(u'AlertsTab', 'openlp.org 2.0 rocks!'))149 self.FontPreview.setText(translate(u'AlertsTab', u'openlp.org 2.0 rocks!'))
150150
151 def onBackgroundColorButtonClicked(self):151 def onBackgroundColorButtonClicked(self):
152 self.bg_color = QtGui.QColorDialog.getColor(152 self.bg_color = QtGui.QColorDialog.getColor(
153 QColor(self.bg_color), self).name()153 QtGui.QColor(self.bg_color), self).name()
154 self.BackgroundColorButton.setStyleSheet(154 self.BackgroundColorButton.setStyleSheet(
155 'background-color: %s' % self.bg_color)155 u'background-color: %s' % self.bg_color)
156 self.updateDisplay()156 self.updateDisplay()
157157
158 def onFontComboBoxClicked(self):158 def onFontComboBoxClicked(self):
@@ -160,22 +160,22 @@
160160
161 def onFontColorButtonClicked(self):161 def onFontColorButtonClicked(self):
162 self.font_color = QtGui.QColorDialog.getColor(162 self.font_color = QtGui.QColorDialog.getColor(
163 QColor(self.font_color), self).name()163 QtGui.QColor(self.font_color), self).name()
164 self.FontColorButton.setStyleSheet(164 self.FontColorButton.setStyleSheet(
165 'background-color: %s' % self.font_color)165 u'background-color: %s' % self.font_color)
166 self.updateDisplay()166 self.updateDisplay()
167167
168 def onTimeoutSpinBoxChanged(self):168 def onTimeoutSpinBoxChanged(self):
169 self.timeout = self.TimeoutSpinBox.value()169 self.timeout = self.TimeoutSpinBox.value()
170170
171 def load(self):171 def load(self):
172 self.timeout = int(self.config.get_config('timeout', 5))172 self.timeout = int(self.config.get_config(u'timeout', 5))
173 self.font_color = str(self.config.get_config('font color', u'#ffffff'))173 self.font_color = str(self.config.get_config(u'font color', u'#ffffff'))
174 self.bg_color = str(self.config.get_config('background color', u'#660000'))174 self.bg_color = str(self.config.get_config(u'background color', u'#660000'))
175 self.font_face = str(self.config.get_config('font face', QtGui.QFont().family()))175 self.font_face = str(self.config.get_config(u'font face', QtGui.QFont().family()))
176 self.TimeoutSpinBox.setValue(self.timeout)176 self.TimeoutSpinBox.setValue(self.timeout)
177 self.FontColorButton.setStyleSheet('background-color: %s' % self.font_color)177 self.FontColorButton.setStyleSheet(u'background-color: %s' % self.font_color)
178 self.BackgroundColorButton.setStyleSheet('background-color: %s' % self.bg_color)178 self.BackgroundColorButton.setStyleSheet(u'background-color: %s' % self.bg_color)
179 font = QtGui.QFont()179 font = QtGui.QFont()
180 font.setFamily(self.font_face)180 font.setFamily(self.font_face)
181 self.FontComboBox.setCurrentFont(font)181 self.FontComboBox.setCurrentFont(font)
@@ -183,10 +183,10 @@
183183
184 def save(self):184 def save(self):
185 self.font_face = self.FontComboBox.currentFont().family()185 self.font_face = self.FontComboBox.currentFont().family()
186 self.config.set_config('background color', str(self.bg_color))186 self.config.set_config(u'background color', str(self.bg_color))
187 self.config.set_config('font color', str(self.font_color))187 self.config.set_config(u'font color', str(self.font_color))
188 self.config.set_config('font face', str(self.font_face))188 self.config.set_config(u'font face', str(self.font_face))
189 self.config.set_config('timeout', str(self.timeout))189 self.config.set_config(u'timeout', str(self.timeout))
190190
191 def updateDisplay(self):191 def updateDisplay(self):
192 font = QtGui.QFont()192 font = QtGui.QFont()
@@ -195,4 +195,4 @@
195 font.setPointSize(16)195 font.setPointSize(16)
196 self.FontPreview.setFont(font)196 self.FontPreview.setFont(font)
197 self.FontPreview.setStyleSheet(197 self.FontPreview.setStyleSheet(
198 'background-color: %s; color: %s' % (self.bg_color, self.font_color))198 u'background-color: %s; color: %s' % (self.bg_color, self.font_color))
199199
=== modified file 'openlp/core/ui/generaltab.py'
--- openlp/core/ui/generaltab.py 2009-06-01 17:50:37 +0000
+++ openlp/core/ui/generaltab.py 2009-06-05 18:53:50 +0000
@@ -28,7 +28,7 @@
28 """28 """
29 def __init__(self, screen_list):29 def __init__(self, screen_list):
30 self.screen_list = screen_list30 self.screen_list = screen_list
31 SettingsTab.__init__(self, translate(u'GeneralTab', u'General'))31 SettingsTab.__init__(self, translate(u'GeneralTab', u'General'), u'General')
3232
33 def setupUi(self):33 def setupUi(self):
34 self.setObjectName(u'GeneralTab')34 self.setObjectName(u'GeneralTab')
@@ -114,18 +114,17 @@
114 self.GeneralRightLayout.addItem(self.GeneralRightSpacer)114 self.GeneralRightLayout.addItem(self.GeneralRightSpacer)
115 self.GeneralLayout.addWidget(self.GeneralRightWidget)115 self.GeneralLayout.addWidget(self.GeneralRightWidget)
116 QtCore.QObject.connect(self.MonitorComboBox,116 QtCore.QObject.connect(self.MonitorComboBox,
117 QtCore.SIGNAL("activated(int)"), self.onMonitorComboBoxChanged)117 QtCore.SIGNAL(u'activated(int)'), self.onMonitorComboBoxChanged)
118 QtCore.QObject.connect(self.WarningCheckBox,118 QtCore.QObject.connect(self.WarningCheckBox,
119 QtCore.SIGNAL("stateChanged(int)"), self.onWarningCheckBoxChanged)119 QtCore.SIGNAL(u'stateChanged(int)'), self.onWarningCheckBoxChanged)
120 QtCore.QObject.connect(self.AutoOpenCheckBox,120 QtCore.QObject.connect(self.AutoOpenCheckBox,
121 QtCore.SIGNAL("stateChanged(int)"), self.onAutoOpenCheckBoxChanged)121 QtCore.SIGNAL(u'stateChanged(int)'), self.onAutoOpenCheckBoxChanged)
122 QtCore.QObject.connect(self.NumberEdit,122 QtCore.QObject.connect(self.NumberEdit,
123 QtCore.SIGNAL("lostFocus()"), self.onNumberEditLostFocus)123 QtCore.SIGNAL(u'lostFocus()'), self.onNumberEditLostFocus)
124 QtCore.QObject.connect(self.UsernameEdit,124 QtCore.QObject.connect(self.UsernameEdit,
125 QtCore.SIGNAL("lostFocus()"), self.onUsernameEditLostFocus)125 QtCore.SIGNAL(u'lostFocus()'), self.onUsernameEditLostFocus)
126 QtCore.QObject.connect(self.PasswordEdit,126 QtCore.QObject.connect(self.PasswordEdit,
127 QtCore.SIGNAL("lostFocus()"), self.onPasswordEditLostFocus)127 QtCore.SIGNAL(u'lostFocus()'), self.onPasswordEditLostFocus)
128
129128
130 def retranslateUi(self):129 def retranslateUi(self):
131 self.MonitorGroupBox.setTitle(translate(u'GeneralTab', u'Monitors'))130 self.MonitorGroupBox.setTitle(translate(u'GeneralTab', u'Monitors'))
@@ -144,12 +143,14 @@
144143
145 def onAutoOpenCheckBoxChanged(self, value):144 def onAutoOpenCheckBoxChanged(self, value):
146 self.AutoOpen = False145 self.AutoOpen = False
147 if value == 2: # we have a set value convert to True/False146 if value == 2:
147 # we have a set value convert to True/False
148 self.AutoOpen = True148 self.AutoOpen = True
149149
150 def onWarningCheckBoxChanged(self, value):150 def onWarningCheckBoxChanged(self, value):
151 self.Warning = False151 self.Warning = False
152 if value == 2: # we have a set value convert to True/False152 if value == 2:
153 # we have a set value convert to True/False
153 self.Warning = True154 self.Warning = True
154155
155 def onNumberEditLostFocus(self):156 def onNumberEditLostFocus(self):
@@ -164,19 +165,19 @@
164 def load(self):165 def load(self):
165 for screen in self.screen_list:166 for screen in self.screen_list:
166 screen_name = translate(u'GeneralTab', u'Screen') + u' ' + \167 screen_name = translate(u'GeneralTab', u'Screen') + u' ' + \
167 str(screen['number'] + 1)168 str(screen[u'number'] + 1)
168 if screen['primary']:169 if screen[u'primary']:
169 screen_name = screen_name + u' (' + \170 screen_name = screen_name + u' (' + \
170 translate(u'GeneralTab', u'primary') + u')'171 translate(u'GeneralTab', u'primary') + u')'
171 self.MonitorComboBox.addItem(screen_name)172 self.MonitorComboBox.addItem(screen_name)
172173 # Get the configs
173 self.MonitorNumber = int(self.config.get_config(u'Monitor', u'0'))174 self.MonitorNumber = int(self.config.get_config(u'Monitor', u'0'))
174 self.Warning = str_to_bool(self.config.get_config(u'Warning', u"False"))175 self.Warning = str_to_bool(self.config.get_config(u'Warning', u'False'))
175 self.AutoOpen = str_to_bool(self.config.get_config(u'Auto Open', u"False"))176 self.AutoOpen = str_to_bool(self.config.get_config(u'Auto Open', u'False'))
176 self.CCLNumber = str(self.config.get_config('CCL Number', u'XXX'))177 self.CCLNumber = str(self.config.get_config(u'CCL Number', u'XXX'))
177 self.Username = str(self.config.get_config('User Name', u''))178 self.Username = str(self.config.get_config(u'User Name', u''))
178 self.Password = str(self.config.get_config('Password', u''))179 self.Password = str(self.config.get_config(u'Password', u''))
179180 # Set a few things up
180 self.MonitorComboBox.setCurrentIndex(self.MonitorNumber)181 self.MonitorComboBox.setCurrentIndex(self.MonitorNumber)
181 self.WarningCheckBox.setChecked(self.Warning)182 self.WarningCheckBox.setChecked(self.Warning)
182 self.AutoOpenCheckBox.setChecked(self.AutoOpen)183 self.AutoOpenCheckBox.setChecked(self.AutoOpen)
@@ -185,9 +186,9 @@
185 self.PasswordEdit.setText(self.Password)186 self.PasswordEdit.setText(self.Password)
186187
187 def save(self):188 def save(self):
188 self.config.set_config(u'Monitor',str(self.MonitorNumber))189 self.config.set_config(u'Monitor', self.MonitorNumber)
189 self.config.set_config(u'Warning', str(self.Warning))190 self.config.set_config(u'Warning', self.Warning)
190 self.config.set_config(u'Auto Open', str(self.AutoOpen))191 self.config.set_config(u'Auto Open', self.AutoOpen)
191 self.config.set_config('CCL Number', str(self.CCLNumber))192 self.config.set_config(u'CCL Number', self.CCLNumber)
192 self.config.set_config('User Name',str(self.Username))193 self.config.set_config(u'User Name', self.Username)
193 self.config.set_config('Password', str(self.Password ))194 self.config.set_config(u'Password', self.Password)
194195
=== modified file 'openlp/core/ui/maindisplay.py'
--- openlp/core/ui/maindisplay.py 2009-06-01 17:50:37 +0000
+++ openlp/core/ui/maindisplay.py 2009-06-05 18:53:50 +0000
@@ -29,8 +29,13 @@
29 QtGui.QWidget.__init__(self, parent)29 QtGui.QWidget.__init__(self, parent)
30 self.setWindowTitle(u'OpenLP Display')30 self.setWindowTitle(u'OpenLP Display')
31 self.screens = screens31 self.screens = screens
32 self.layout = QtGui.QVBoxLayout(self)
33 self.layout.setSpacing(0)
34 self.layout.setMargin(0)
35 self.layout.setObjectName(u'layout')
32 self.display = QtGui.QLabel(self)36 self.display = QtGui.QLabel(self)
33 self.display.setScaledContents(True)37 self.display.setScaledContents(True)
38 self.layout.addWidget(self.display)
34 self.displayBlank = False39 self.displayBlank = False
35 self.blankFrame= None40 self.blankFrame= None
36 self.alertactive = False41 self.alertactive = False
@@ -43,23 +48,21 @@
43 @param (integer) screen This is the screen number.48 @param (integer) screen This is the screen number.
44 """49 """
45 screen = self.screens[screenNumber]50 screen = self.screens[screenNumber]
46 if screen['number'] != screenNumber:51 if screen[u'number'] != screenNumber:
47 # We will most probably never actually hit this bit, but just in52 # We will most probably never actually hit this bit, but just in
48 # case the index in the list doesn't match the screen number, we53 # case the index in the list doesn't match the screen number, we
49 # search for it.54 # search for it.
50 for scrn in self.screens:55 for scrn in self.screens:
51 if scrn['number'] == screenNumber:56 if scrn[u'number'] == screenNumber:
52 screen = scrn57 screen = scrn
53 break58 break
54 self.setGeometry(screen['size'])59 self.setGeometry(screen[u'size'])
55 self.display.setGeometry(screen['size'])60 if not screen[u'primary']:
56 if not screen['primary']:
57 self.showFullScreen()61 self.showFullScreen()
58 else:62 else:
59 self.showMinimized()63 self.hide()
6064 painter = QtGui.QPainter()
61 painter=QtGui.QPainter()65 self.blankFrame = QtGui.QPixmap(screen[u'size'].width(), screen[u'size'].height())
62 self.blankFrame = QtGui.QPixmap(screen['size'].width(), screen['size'].height())
63 painter.begin(self.blankFrame)66 painter.begin(self.blankFrame)
64 painter.fillRect(self.blankFrame.rect(), QtGui.QColor(u'#000000'))67 painter.fillRect(self.blankFrame.rect(), QtGui.QColor(u'#000000'))
65 self.frameView(self.blankFrame)68 self.frameView(self.blankFrame)
6669
=== modified file 'openlp/core/ui/mainwindow.py'
--- openlp/core/ui/mainwindow.py 2009-06-02 19:02:12 +0000
+++ openlp/core/ui/mainwindow.py 2009-06-05 18:53:50 +0000
@@ -25,7 +25,7 @@
25from openlp.core.ui import AboutForm, SettingsForm, AlertForm, ServiceManager, \25from openlp.core.ui import AboutForm, SettingsForm, AlertForm, ServiceManager, \
26 ThemeManager, MainDisplay, SlideController26 ThemeManager, MainDisplay, SlideController
27from openlp.core.lib import translate, Plugin, MediaManagerItem, SettingsTab, \27from openlp.core.lib import translate, Plugin, MediaManagerItem, SettingsTab, \
28 EventManager, RenderManager28 EventManager, RenderManager, PluginConfig
29from openlp.core import PluginManager29from openlp.core import PluginManager
3030
31class MainWindow(object):31class MainWindow(object):
@@ -46,6 +46,7 @@
46 self.mainDisplay = MainDisplay(None, screens)46 self.mainDisplay = MainDisplay(None, screens)
47 self.screenList = screens47 self.screenList = screens
48 self.EventManager = EventManager()48 self.EventManager = EventManager()
49 self.generalConfig = PluginConfig(u'General')
49 self.alertForm = AlertForm(self)50 self.alertForm = AlertForm(self)
50 self.aboutForm = AboutForm()51 self.aboutForm = AboutForm()
51 self.settingsForm = SettingsForm(self.screenList, self)52 self.settingsForm = SettingsForm(self.screenList, self)
@@ -60,7 +61,8 @@
60 #warning cyclic dependency61 #warning cyclic dependency
61 #RenderManager needs to call ThemeManager and62 #RenderManager needs to call ThemeManager and
62 #ThemeManager needs to call RenderManager63 #ThemeManager needs to call RenderManager
63 self.RenderManager = RenderManager(self.ThemeManagerContents, self.screenList)64 self.RenderManager = RenderManager(self.ThemeManagerContents,
65 self.screenList, int(self.generalConfig.get_config(u'Monitor', 0)))
64 log.info(u'Load Plugins')66 log.info(u'Load Plugins')
65 self.plugin_helpers[u'preview'] = self.PreviewController67 self.plugin_helpers[u'preview'] = self.PreviewController
66 self.plugin_helpers[u'live'] = self.LiveController68 self.plugin_helpers[u'live'] = self.LiveController
@@ -91,6 +93,43 @@
91 log.info(u'Load Themes')93 log.info(u'Load Themes')
92 self.ThemeManagerContents.loadThemes()94 self.ThemeManagerContents.loadThemes()
9395
96 def show(self):
97 """
98 Show the main form, as well as the display form
99 """
100 self.mainWindow.showMaximized()
101 self.mainDisplay.setup(self.settingsForm.GeneralTab.MonitorNumber)
102 self.mainDisplay.show()
103 #self.mainWindow.setFocus(QtCore.Qt.OtherFocusReason)
104
105 def onHelpAboutItemClicked(self):
106 """
107 Show the About form
108 """
109 self.aboutForm.exec_()
110
111 def onToolsAlertItemClicked(self):
112 """
113 Show the Alert form
114 """
115 self.alertForm.exec_()
116
117 def onOptionsSettingsItemClicked(self):
118 """
119 Show the Settings dialog
120 """
121 self.settingsForm.exec_()
122 screen_number = int(self.generalConfig.get_config(u'Monitor', 0))
123 self.RenderManager.update_display(screen_number)
124 self.mainDisplay.setup(screen_number)
125
126 def onCloseEvent(self, event):
127 """
128 Hook to close the main window and display windows on exit
129 """
130 self.mainDisplay.close()
131 event.accept()
132
94 def setupUi(self):133 def setupUi(self):
95 """134 """
96 Set up the user interface135 Set up the user interface
@@ -459,36 +498,3 @@
459 self.action_Preview_Panel.setText(498 self.action_Preview_Panel.setText(
460 translate(u'mainWindow', u'&Preview Pane'))499 translate(u'mainWindow', u'&Preview Pane'))
461 self.ModeLiveItem.setText(translate(u'mainWindow', u'&Live'))500 self.ModeLiveItem.setText(translate(u'mainWindow', u'&Live'))
462
463 def show(self):
464 """
465 Show the main form, as well as the display form
466 """
467 self.mainWindow.showMaximized()
468 self.mainDisplay.setup(self.settingsForm.GeneralTab.MonitorNumber)
469 self.mainDisplay.show()
470
471 def onHelpAboutItemClicked(self):
472 """
473 Show the About form
474 """
475 self.aboutForm.exec_()
476
477 def onToolsAlertItemClicked(self):
478 """
479 Show the Alert form
480 """
481 self.alertForm.exec_()
482
483 def onOptionsSettingsItemClicked(self):
484 """
485 Show the Settings dialog
486 """
487 self.settingsForm.exec_()
488
489 def onCloseEvent(self, event):
490 """
491 Hook to close the main window and display windows on exit
492 """
493 self.mainDisplay.close()
494 event.accept()
495501
=== modified file 'openlp/core/ui/themestab.py'
--- openlp/core/ui/themestab.py 2009-05-20 20:17:20 +0000
+++ openlp/core/ui/themestab.py 2009-06-05 18:53:50 +0000
@@ -28,7 +28,7 @@
28 """28 """
29 def __init__(self, parent):29 def __init__(self, parent):
30 self.parent = parent30 self.parent = parent
31 SettingsTab.__init__(self, u'Themes')31 SettingsTab.__init__(self, translate(u'ThemesTab', u'Themes'), u'Themes')
3232
33 def setupUi(self):33 def setupUi(self):
34 self.setObjectName(u'ThemesTab')34 self.setObjectName(u'ThemesTab')
@@ -90,11 +90,11 @@
90 self.ThemesTabLayout.addWidget(self.LevelGroupBox)90 self.ThemesTabLayout.addWidget(self.LevelGroupBox)
9191
92 QtCore.QObject.connect(self.SongLevelRadioButton,92 QtCore.QObject.connect(self.SongLevelRadioButton,
93 QtCore.SIGNAL("pressed()"), self.onSongLevelButtonPressed)93 QtCore.SIGNAL(u'pressed()'), self.onSongLevelButtonPressed)
94 QtCore.QObject.connect(self.ServiceLevelRadioButton,94 QtCore.QObject.connect(self.ServiceLevelRadioButton,
95 QtCore.SIGNAL("pressed()"), self.onServiceLevelButtonPressed)95 QtCore.SIGNAL(u'pressed()'), self.onServiceLevelButtonPressed)
96 QtCore.QObject.connect(self.GlobalLevelRadioButton,96 QtCore.QObject.connect(self.GlobalLevelRadioButton,
97 QtCore.SIGNAL("pressed()"), self.onGlobalLevelButtonPressed)97 QtCore.SIGNAL(u'pressed()'), self.onGlobalLevelButtonPressed)
9898
99 QtCore.QObject.connect(self.DefaultComboBox,99 QtCore.QObject.connect(self.DefaultComboBox,
100 QtCore.SIGNAL("activated(int)"), self.onDefaultComboBoxChanged)100 QtCore.SIGNAL("activated(int)"), self.onDefaultComboBoxChanged)
101101
=== modified file 'openlp/core/utils/registry.py'
--- openlp/core/utils/registry.py 2009-06-04 16:53:49 +0000
+++ openlp/core/utils/registry.py 2009-06-05 18:53:50 +0000
@@ -28,8 +28,8 @@
28 """28 """
29 def __init__(self, dir):29 def __init__(self, dir):
30 self.config = SafeConfigParser()30 self.config = SafeConfigParser()
31 self.file_name = os.path.join(dir, 'openlp.conf')31 self.file_name = os.path.join(dir, u'openlp.conf')
32 self.config.read(self.file_name)32 self._load()
3333
34 def has_value(self, section, key):34 def has_value(self, section, key):
35 """35 """
@@ -95,14 +95,24 @@
95 except:95 except:
96 return False96 return False
9797
98 def _load(self):
99 try:
100 if not os.path.isfile(self.file_name):
101 return False
102 file_handle = open(self.file_name, u'r')
103 self.config.readfp(file_handle)
104 file_handle.close()
105 return True
106 except:
107 return False
108
98 def _save(self):109 def _save(self):
99 try:110 try:
100 if not os.path.exists(os.path.dirname(self.file_name)):111 if not os.path.exists(os.path.dirname(self.file_name)):
101 os.makedirs(os.path.dirname(self.file_name))112 os.makedirs(os.path.dirname(self.file_name))
102 file_handle = open(self.file_name, 'w')113 file_handle = open(self.file_name, u'w')
103 self.config.write(file_handle)114 self.config.write(file_handle)
104 close(file_handle)115 file_handle.close()
105 self.config.read(self.file_name)116 return self._load()
106 return True
107 except:117 except:
108 return False118 return False
109119
=== modified file 'openlp/plugins/bibles/lib/biblestab.py'
--- openlp/plugins/bibles/lib/biblestab.py 2009-05-21 05:15:51 +0000
+++ openlp/plugins/bibles/lib/biblestab.py 2009-06-05 18:53:50 +0000
@@ -32,7 +32,7 @@
32 self.show_new_chapters = False32 self.show_new_chapters = False
33 self.display_style = 033 self.display_style = 0
34 self.bible_search = True34 self.bible_search = True
35 SettingsTab.__init__(self, u'Bibles')35 SettingsTab.__init__(self, translate(u'BiblesTab', u'Bibles'), u'Bibles')
3636
37 def setupUi(self):37 def setupUi(self):
38 self.setObjectName(u'BiblesTab')38 self.setObjectName(u'BiblesTab')
@@ -134,32 +134,32 @@
134 self.BibleLayout.addWidget(self.BibleRightWidget)134 self.BibleLayout.addWidget(self.BibleRightWidget)
135 # Signals and slots135 # Signals and slots
136 QtCore.QObject.connect(self.NewChaptersCheckBox,136 QtCore.QObject.connect(self.NewChaptersCheckBox,
137 QtCore.SIGNAL("stateChanged(int)"), self.onNewChaptersCheckBoxChanged)137 QtCore.SIGNAL(u'stateChanged(int)'), self.onNewChaptersCheckBoxChanged)
138 QtCore.QObject.connect(self.BibleSearchCheckBox,138 QtCore.QObject.connect(self.BibleSearchCheckBox,
139 QtCore.SIGNAL("stateChanged(int)"), self.onBibleSearchCheckBoxChanged)139 QtCore.SIGNAL(u'stateChanged(int)'), self.onBibleSearchCheckBoxChanged)
140 QtCore.QObject.connect(self.VerseRadioButton,140 QtCore.QObject.connect(self.VerseRadioButton,
141 QtCore.SIGNAL("pressed()"), self.onVerseRadioButtonPressed)141 QtCore.SIGNAL(u'pressed()'), self.onVerseRadioButtonPressed)
142 QtCore.QObject.connect(self.ParagraphRadioButton,142 QtCore.QObject.connect(self.ParagraphRadioButton,
143 QtCore.SIGNAL("pressed()"), self.onParagraphRadioButtonPressed)143 QtCore.SIGNAL(u'pressed()'), self.onParagraphRadioButtonPressed)
144 QtCore.QObject.connect(self.DisplayStyleComboBox,144 QtCore.QObject.connect(self.DisplayStyleComboBox,
145 QtCore.SIGNAL("activated(int)"), self.onDisplayStyleComboBoxChanged)145 QtCore.SIGNAL(u'activated(int)'), self.onDisplayStyleComboBoxChanged)
146 QtCore.QObject.connect(self.BibleThemeComboBox,146 QtCore.QObject.connect(self.BibleThemeComboBox,
147 QtCore.SIGNAL("activated(int)"), self.onBibleThemeComboBoxChanged)147 QtCore.SIGNAL(u'activated(int)'), self.onBibleThemeComboBoxChanged)
148148
149 def retranslateUi(self):149 def retranslateUi(self):
150 self.VerseDisplayGroupBox.setTitle(translate('SettingsForm', 'Verse Display'))150 self.VerseDisplayGroupBox.setTitle(translate(u'SettingsForm', u'Verse Display'))
151 self.VerseRadioButton.setText(translate('SettingsForm', 'Verse style'))151 self.VerseRadioButton.setText(translate(u'SettingsForm', u'Verse style'))
152 self.ParagraphRadioButton.setText(translate('SettingsForm','Paragraph style'))152 self.ParagraphRadioButton.setText(translate(u'SettingsForm', u'Paragraph style'))
153 self.NewChaptersCheckBox.setText(translate('SettingsForm', 'Only show new chapter numbers'))153 self.NewChaptersCheckBox.setText(translate(u'SettingsForm', u'Only show new chapter numbers'))
154 self.DisplayStyleLabel.setText(translate('SettingsForm', 'Display Style:'))154 self.DisplayStyleLabel.setText(translate(u'SettingsForm', u'Display Style:'))
155 self.BibleThemeLabel.setText(translate('SettingsForm', 'Bible Theme:'))155 self.BibleThemeLabel.setText(translate(u'SettingsForm', u'Bible Theme:'))
156 self.DisplayStyleComboBox.setItemText(0, translate('SettingsForm', 'No brackets'))156 self.DisplayStyleComboBox.setItemText(0, translate(u'SettingsForm', u'No brackets'))
157 self.DisplayStyleComboBox.setItemText(1, translate('SettingsForm', '( and )'))157 self.DisplayStyleComboBox.setItemText(1, translate(u'SettingsForm', u'( and )'))
158 self.DisplayStyleComboBox.setItemText(2, translate('SettingsForm', '{ and }'))158 self.DisplayStyleComboBox.setItemText(2, translate(u'SettingsForm', u'{ and }'))
159 self.DisplayStyleComboBox.setItemText(3, translate('SettingsForm', '[ and ]'))159 self.DisplayStyleComboBox.setItemText(3, translate(u'SettingsForm', u'[ and ]'))
160 self.ChangeNoteLabel.setText(translate('SettingsForm', 'Note:\nChanges don\'t affect verses already in the service'))160 self.ChangeNoteLabel.setText(translate(u'SettingsForm', u'Note:\nChanges don\'t affect verses already in the service'))
161 self.BibleSearchGroupBox.setTitle(translate('SettingsForm', 'Search'))161 self.BibleSearchGroupBox.setTitle(translate(u'SettingsForm', u'Search'))
162 self.BibleSearchCheckBox.setText(translate('SettingsForm', 'Search-as-you-type'))162 self.BibleSearchCheckBox.setText(translate(u'SettingsForm', u'Search-as-you-type'))
163163
164 def onBibleThemeComboBoxChanged(self):164 def onBibleThemeComboBoxChanged(self):
165 self.bible_theme = self.BibleThemeComboBox.currentText()165 self.bible_theme = self.BibleThemeComboBox.currentText()
@@ -187,7 +187,7 @@
187187
188 def load(self):188 def load(self):
189 self.paragraph_style = str_to_bool(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'))
190 self.show_new_chapters = str_to_bool(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'))
191 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'))
192 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')
193 self.bible_search = str_to_bool(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'))
@@ -216,6 +216,7 @@
216 self.BibleThemeComboBox.addItem(theme)216 self.BibleThemeComboBox.addItem(theme)
217 id = self.BibleThemeComboBox.findText(str(self.bible_theme), QtCore.Qt.MatchExactly)217 id = self.BibleThemeComboBox.findText(str(self.bible_theme), QtCore.Qt.MatchExactly)
218 if id == -1:218 if id == -1:
219 id = 0 # Not Found219 # Not Found
220 id = 0
220 self.bible_theme = u''221 self.bible_theme = u''
221 self.BibleThemeComboBox.setCurrentIndex(id)222 self.BibleThemeComboBox.setCurrentIndex(id)
222223
=== modified file 'openlp/plugins/custom/lib/customtab.py'
--- openlp/plugins/custom/lib/customtab.py 2009-05-21 16:07:01 +0000
+++ openlp/plugins/custom/lib/customtab.py 2009-06-05 18:53:50 +0000
@@ -27,7 +27,7 @@
27 SongsTab is the songs settings tab in the settings dialog.27 SongsTab is the songs settings tab in the settings dialog.
28 """28 """
29 def __init__(self):29 def __init__(self):
30 SettingsTab.__init__(self, u'Custom')30 SettingsTab.__init__(self, translate(u'CustomTab', u'Custom'), u'Custom')
3131
32 def setupUi(self):32 def setupUi(self):
33 self.setObjectName(u'CustomTab')33 self.setObjectName(u'CustomTab')
3434
=== modified file 'openlp/plugins/media/lib/mediatab.py'
--- openlp/plugins/media/lib/mediatab.py 2009-05-21 05:15:51 +0000
+++ openlp/plugins/media/lib/mediatab.py 2009-06-05 18:53:50 +0000
@@ -27,40 +27,38 @@
27 mediaTab is the media settings tab in the settings dialog.27 mediaTab is the media settings tab in the settings dialog.
28 """28 """
29 def __init__(self):29 def __init__(self):
30 SettingsTab.__init__(self, u'Media')30 SettingsTab.__init__(self, translate(u'MediaTab', u'Media'), u'Media')
3131
32 def setupUi(self):32 def setupUi(self):
33 self.setObjectName(u'MediaTab')33 self.setObjectName(u'MediaTab')
34
35 self.MediaLayout = QtGui.QFormLayout(self)34 self.MediaLayout = QtGui.QFormLayout(self)
36 self.MediaLayout.setObjectName("MediaLayout")35 self.MediaLayout.setObjectName(u'MediaLayout')
37
38 self.MediaModeGroupBox = QtGui.QGroupBox(self)36 self.MediaModeGroupBox = QtGui.QGroupBox(self)
39 self.MediaModeGroupBox.setObjectName("MediaModeGroupBox")37 self.MediaModeGroupBox.setObjectName(u'MediaModeGroupBox')
40 self.MediaModeLayout = QtGui.QVBoxLayout(self.MediaModeGroupBox)38 self.MediaModeLayout = QtGui.QVBoxLayout(self.MediaModeGroupBox)
41 self.MediaModeLayout.setSpacing(8)39 self.MediaModeLayout.setSpacing(8)
42 self.MediaModeLayout.setMargin(8)40 self.MediaModeLayout.setMargin(8)
43 self.MediaModeLayout.setObjectName("MediaModeLayout")41 self.MediaModeLayout.setObjectName(u'MediaModeLayout')
44 self.UseVMRCheckBox = QtGui.QCheckBox(self.MediaModeGroupBox)42 self.UseVMRCheckBox = QtGui.QCheckBox(self.MediaModeGroupBox)
45 self.UseVMRCheckBox.setObjectName("UseVMRCheckBox")43 self.UseVMRCheckBox.setObjectName(u'UseVMRCheckBox')
46 self.MediaModeLayout.addWidget(self.UseVMRCheckBox)44 self.MediaModeLayout.addWidget(self.UseVMRCheckBox)
47 self.UseVMRLabel = QtGui.QLabel(self.MediaModeGroupBox)45 self.UseVMRLabel = QtGui.QLabel(self.MediaModeGroupBox)
48 self.UseVMRLabel.setObjectName("UseVMRLabel")46 self.UseVMRLabel.setObjectName(u'UseVMRLabel')
49 self.MediaModeLayout.addWidget(self.UseVMRLabel)47 self.MediaModeLayout.addWidget(self.UseVMRLabel)
5048
51 self.MediaLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.MediaModeGroupBox)49 self.MediaLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.MediaModeGroupBox)
52 # Signals and slots50 # Signals and slots
53 QtCore.QObject.connect(self.UseVMRCheckBox,51 QtCore.QObject.connect(self.UseVMRCheckBox,
54 QtCore.SIGNAL("stateChanged(int)"), self.onVMRCheckBoxChanged)52 QtCore.SIGNAL(u'stateChanged(int)'), self.onVMRCheckBoxChanged)
5553
56 def retranslateUi(self):54 def retranslateUi(self):
57 self.MediaModeGroupBox.setTitle(translate("SettingsForm", "Media Mode"))55 self.MediaModeGroupBox.setTitle(translate(u'MediaTab', u'Media Mode'))
58 self.UseVMRCheckBox.setText(translate("SettingsForm", "Use Video Mode Rendering"))56 self.UseVMRCheckBox.setText(translate(u'MediaTab', u'Use Video Mode Rendering'))
59 self.UseVMRLabel.setText(translate("SettingsForm", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"57 self.UseVMRLabel.setText(translate(u'MediaTab', u'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">\n'
60"<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n"58 u'<html><head><meta name="qrichtext" content="1" /><style type="text/css">\n'
61"p, li { white-space: pre-wrap; }\n"59 u'p, li { white-space: pre-wrap; }\n'
62"</style></head><body style=\" font-family:\'DejaVu Sans\'; font-size:10pt; font-weight:400; font-style:normal;\">\n"60 u'</style></head><body style="font-family:\'DejaVu Sans\'; font-size:10pt; font-weight:400; font-style:normal;">\n'
63"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-style:italic;\">No video preview available with VMR enabled</span></p></body></html>"))61 u'<p style="margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-style:italic;">No video preview available with VMR enabled</span></p></body></html>'))
6462
65 def onVMRCheckBoxChanged(self):63 def onVMRCheckBoxChanged(self):
66 use_vmr_mode = self.UseVMRCheckBox.checkState()64 use_vmr_mode = self.UseVMRCheckBox.checkState()
6765
=== modified file 'openlp/plugins/presentations/lib/presentationtab.py'
--- openlp/plugins/presentations/lib/presentationtab.py 2009-06-01 18:37:06 +0000
+++ openlp/plugins/presentations/lib/presentationtab.py 2009-06-05 18:53:50 +0000
@@ -24,23 +24,23 @@
2424
25class PresentationTab(SettingsTab):25class PresentationTab(SettingsTab):
26 """26 """
27 BiblesTab is the Bibles settings tab in the settings dialog.27 PresentationsTab is the Presentations settings tab in the settings dialog.
28 """28 """
29 def __init__(self):29 def __init__(self):
30 SettingsTab.__init__(self, u'Presentation')30 SettingsTab.__init__(self, translate(u'PresentationTab', u'Presentation'), u'Presentation')
3131
32 def setupUi(self):32 def setupUi(self):
33 self.setObjectName(u'BiblesTab')33 self.setObjectName(u'PresentationTab')
34 self.BibleLayout = QtGui.QHBoxLayout(self)34 self.PresentationLayout = QtGui.QHBoxLayout(self)
35 self.BibleLayout.setSpacing(8)35 self.PresentationLayout.setSpacing(8)
36 self.BibleLayout.setMargin(8)36 self.PresentationLayout.setMargin(8)
37 self.BibleLayout.setObjectName(u'BibleLayout')37 self.PresentationLayout.setObjectName(u'PresentationLayout')
38 self.BibleLeftWidget = QtGui.QWidget(self)38 self.PresentationLeftWidget = QtGui.QWidget(self)
39 self.BibleLeftWidget.setObjectName(u'BibleLeftWidget')39 self.PresentationLeftWidget.setObjectName(u'PresentationLeftWidget')
40 self.BibleLeftLayout = QtGui.QVBoxLayout(self.BibleLeftWidget)40 self.PresentationLeftLayout = QtGui.QVBoxLayout(self.PresentationLeftWidget)
41 self.BibleLeftLayout.setObjectName(u'BibleLeftLayout')41 self.PresentationLeftLayout.setObjectName(u'PresentationLeftLayout')
42 self.BibleLeftLayout.setSpacing(8)42 self.PresentationLeftLayout.setSpacing(8)
43 self.BibleLeftLayout.setMargin(0)43 self.PresentationLeftLayout.setMargin(0)
4444
45 self.VerseDisplayGroupBox = QtGui.QGroupBox(self)45 self.VerseDisplayGroupBox = QtGui.QGroupBox(self)
46 self.VerseDisplayGroupBox.setObjectName(u'VerseDisplayGroupBox')46 self.VerseDisplayGroupBox.setObjectName(u'VerseDisplayGroupBox')
@@ -70,29 +70,29 @@
70 self.ImpressPath.setObjectName("ImpressPath")70 self.ImpressPath.setObjectName("ImpressPath")
71 self.VerseDisplayLayout.addWidget(self.ImpressPath, 3, 0, 1, 1)71 self.VerseDisplayLayout.addWidget(self.ImpressPath, 3, 0, 1, 1)
7272
73 self.BibleThemeWidget = QtGui.QWidget(self.VerseDisplayGroupBox)73 self.PresentationThemeWidget = QtGui.QWidget(self.VerseDisplayGroupBox)
74 self.BibleThemeWidget.setObjectName(u'BibleThemeWidget')74 self.PresentationThemeWidget.setObjectName(u'PresentationThemeWidget')
75 self.BibleThemeLayout = QtGui.QHBoxLayout(self.BibleThemeWidget)75 self.PresentationThemeLayout = QtGui.QHBoxLayout(self.PresentationThemeWidget)
76 self.BibleThemeLayout.setSpacing(8)76 self.PresentationThemeLayout.setSpacing(8)
77 self.BibleThemeLayout.setMargin(0)77 self.PresentationThemeLayout.setMargin(0)
78 self.BibleThemeLayout.setObjectName(u'BibleThemeLayout')78 self.PresentationThemeLayout.setObjectName(u'PresentationThemeLayout')
7979
80 self.BibleLeftLayout.addWidget(self.VerseDisplayGroupBox)80 self.PresentationLeftLayout.addWidget(self.VerseDisplayGroupBox)
81 self.BibleLeftSpacer = QtGui.QSpacerItem(40, 20,81 self.PresentationLeftSpacer = QtGui.QSpacerItem(40, 20,
82 QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)82 QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
83 self.BibleLeftLayout.addItem(self.BibleLeftSpacer)83 self.PresentationLeftLayout.addItem(self.PresentationLeftSpacer)
84 self.BibleLayout.addWidget(self.BibleLeftWidget)84 self.PresentationLayout.addWidget(self.PresentationLeftWidget)
8585
86 self.BibleRightWidget = QtGui.QWidget(self)86 self.PresentationRightWidget = QtGui.QWidget(self)
87 self.BibleRightWidget.setObjectName(u'BibleRightWidget')87 self.PresentationRightWidget.setObjectName(u'PresentationRightWidget')
88 self.BibleRightLayout = QtGui.QVBoxLayout(self.BibleRightWidget)88 self.PresentationRightLayout = QtGui.QVBoxLayout(self.PresentationRightWidget)
89 self.BibleRightLayout.setObjectName(u'BibleRightLayout')89 self.PresentationRightLayout.setObjectName(u'PresentationRightLayout')
90 self.BibleRightLayout.setSpacing(8)90 self.PresentationRightLayout.setSpacing(8)
91 self.BibleRightLayout.setMargin(0)91 self.PresentationRightLayout.setMargin(0)
92 self.BibleRightSpacer = QtGui.QSpacerItem(50, 20,92 self.PresentationRightSpacer = QtGui.QSpacerItem(50, 20,
93 QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)93 QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
94 self.BibleRightLayout.addItem(self.BibleRightSpacer)94 self.PresentationRightLayout.addItem(self.PresentationRightSpacer)
95 self.BibleLayout.addWidget(self.BibleRightWidget)95 self.PresentationLayout.addWidget(self.PresentationRightWidget)
9696
97 # Signals and slots97 # Signals and slots
98 #QtCore.QObject.connect(self.NewChaptersCheckBox,98 #QtCore.QObject.connect(self.NewChaptersCheckBox,
@@ -116,20 +116,20 @@
116# self.paragraph_style = (self.config.get_config(u'paragraph style', u'True'))116# self.paragraph_style = (self.config.get_config(u'paragraph style', u'True'))
117# self.show_new_chapters = (self.config.get_config(u'display new chapter', u"False"))117# self.show_new_chapters = (self.config.get_config(u'display new chapter', u"False"))
118# self.display_style = int(self.config.get_config(u'display brackets', u'0'))118# self.display_style = int(self.config.get_config(u'display brackets', u'0'))
119# self.bible_theme = int(self.config.get_config(u'bible theme', u'0'))119# self.Presentation_theme = int(self.config.get_config(u'Presentation theme', u'0'))
120# self.bible_search = (self.config.get_config(u'search as type', u'True'))120# self.Presentation_search = (self.config.get_config(u'search as type', u'True'))
121# if self.paragraph_style:121# if self.paragraph_style:
122# self.ParagraphRadioButton.setChecked(True)122# self.ParagraphRadioButton.setChecked(True)
123# else:123# else:
124# self.VerseRadioButton.setChecked(True)124# self.VerseRadioButton.setChecked(True)
125# self.NewChaptersCheckBox.setChecked(self.show_new_chapters)125# self.NewChaptersCheckBox.setChecked(self.show_new_chapters)
126# self.DisplayStyleComboBox.setCurrentIndex(self.display_style)126# self.DisplayStyleComboBox.setCurrentIndex(self.display_style)
127# self.BibleSearchCheckBox.setChecked(self.bible_search)127# self.PresentationSearchCheckBox.setChecked(self.Presentation_search)
128128
129 def save(self):129 def save(self):
130 pass130 pass
131# self.config.set_config(u'paragraph style', str(self.paragraph_style))131# self.config.set_config(u'paragraph style', str(self.paragraph_style))
132# self.config.set_config(u'display new chapter', str(self.show_new_chapters))132# self.config.set_config(u'display new chapter', str(self.show_new_chapters))
133# self.config.set_config(u'display brackets', str(self.display_style))133# self.config.set_config(u'display brackets', str(self.display_style))
134# self.config.set_config(u'search as type', str(self.bible_search))134# self.config.set_config(u'search as type', str(self.Presentation_search))
135# self.config.set_config(u'bible theme', str(self.bible_theme))135# self.config.set_config(u'Presentation theme', str(self.Presentation_theme))
136136
=== modified file 'openlp/plugins/songs/lib/songstab.py'
--- openlp/plugins/songs/lib/songstab.py 2009-05-21 16:07:01 +0000
+++ openlp/plugins/songs/lib/songstab.py 2009-06-05 18:53:50 +0000
@@ -20,14 +20,14 @@
2020
21from PyQt4 import QtCore, QtGui21from PyQt4 import QtCore, QtGui
2222
23from openlp.core.lib import SettingsTab, translate23from openlp.core.lib import SettingsTab, translate
2424
25class SongsTab(SettingsTab):25class SongsTab(SettingsTab):
26 """26 """
27 SongsTab is the songs settings tab in the settings dialog.27 SongsTab is the songs settings tab in the settings dialog.
28 """28 """
29 def __init__(self):29 def __init__(self):
30 SettingsTab.__init__(self, u'Songs')30 SettingsTab.__init__(self, translate(u'SongsTab', u'Songs'), u'Songs')
3131
32 def setupUi(self):32 def setupUi(self):
33 self.setObjectName(u'SongsTab')33 self.setObjectName(u'SongsTab')