Merge lp:~raoul-snyman/openlp/dualdisplay2 into lp:openlp
- dualdisplay2
- Merge into trunk
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 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Tim Bentley | Approve | ||
Review via email:
|
Commit message
Description of the change
To post a comment you must log in.
Revision history for this message
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Raoul Snyman (raoul-snyman) wrote : | # |
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'openlp/core/lib/pluginconfig.py' | |||
2 | --- openlp/core/lib/pluginconfig.py 2009-05-20 20:17:20 +0000 | |||
3 | +++ openlp/core/lib/pluginconfig.py 2009-06-05 18:53:50 +0000 | |||
4 | @@ -56,10 +56,8 @@ | |||
5 | 56 | safe_name = self.section.replace(u' ',u'-') | 56 | safe_name = self.section.replace(u' ',u'-') |
6 | 57 | plugin_data = self.get_config(u'data path', safe_name) | 57 | plugin_data = self.get_config(u'data path', safe_name) |
7 | 58 | path = os.path.join(app_data, plugin_data) | 58 | path = os.path.join(app_data, plugin_data) |
8 | 59 | |||
9 | 60 | if not os.path.exists(path): | 59 | if not os.path.exists(path): |
10 | 61 | os.makedirs(path) | 60 | os.makedirs(path) |
11 | 62 | |||
12 | 63 | return path | 61 | return path |
13 | 64 | 62 | ||
14 | 65 | def set_data_path(self, path): | 63 | def set_data_path(self, path): |
15 | @@ -74,8 +72,8 @@ | |||
16 | 74 | if suffix != None: | 72 | if suffix != None: |
17 | 75 | return_files = [] | 73 | return_files = [] |
18 | 76 | for f in files: | 74 | for f in files: |
21 | 77 | if f.find('.') != -1: | 75 | if f.find(u'.') != -1: |
22 | 78 | nme = f.split('.') | 76 | nme = f.split(u'.') |
23 | 79 | bname = nme[0] | 77 | bname = nme[0] |
24 | 80 | sfx = nme[1].lower() | 78 | sfx = nme[1].lower() |
25 | 81 | sfx = sfx.lower() | 79 | sfx = sfx.lower() |
26 | @@ -127,7 +125,7 @@ | |||
27 | 127 | name = u'last directory' | 125 | name = u'last directory' |
28 | 128 | last_dir = self.get_config(name) | 126 | last_dir = self.get_config(name) |
29 | 129 | if last_dir is None: | 127 | if last_dir is None: |
31 | 130 | last_dir = '' | 128 | last_dir = u'' |
32 | 131 | return last_dir | 129 | return last_dir |
33 | 132 | 130 | ||
34 | 133 | def set_last_dir(self, directory, num=None): | 131 | def set_last_dir(self, directory, num=None): |
35 | 134 | 132 | ||
36 | === modified file 'openlp/core/lib/renderer.py' | |||
37 | --- openlp/core/lib/renderer.py 2009-06-03 15:38:14 +0000 | |||
38 | +++ openlp/core/lib/renderer.py 2009-06-05 18:53:50 +0000 | |||
39 | @@ -27,11 +27,8 @@ | |||
40 | 27 | from copy import copy | 27 | from copy import copy |
41 | 28 | 28 | ||
42 | 29 | class Renderer: | 29 | class Renderer: |
48 | 30 | 30 | """ | |
49 | 31 | global log | 31 | All the functions for rendering a set of words onto a Device Context |
45 | 32 | log = logging.getLogger(u'Renderer') | ||
46 | 33 | log.info(u'Renderer Loaded') | ||
47 | 34 | """All the functions for rendering a set of words onto a Device Context | ||
50 | 35 | 32 | ||
51 | 36 | How to use: | 33 | How to use: |
52 | 37 | set the words to be displayed with a call to format_slide() - this returns an array of screenfuls of data | 34 | set the words to be displayed with a call to format_slide() - this returns an array of screenfuls of data |
53 | @@ -39,8 +36,11 @@ | |||
54 | 39 | tell it which DC to render to with set_DC() | 36 | tell it which DC to render to with set_DC() |
55 | 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() |
56 | 41 | tell it to render a particular screenfull with render_screen(n) | 38 | tell it to render a particular screenfull with render_screen(n) |
57 | 39 | """ | ||
58 | 40 | global log | ||
59 | 41 | log = logging.getLogger(u'Renderer') | ||
60 | 42 | log.info(u'Renderer Loaded') | ||
61 | 42 | 43 | ||
62 | 43 | """ | ||
63 | 44 | def __init__(self): | 44 | def __init__(self): |
64 | 45 | self._rect = None | 45 | self._rect = None |
65 | 46 | self._debug = 0 | 46 | self._debug = 0 |
66 | @@ -119,19 +119,11 @@ | |||
67 | 119 | lines = verse.split(u'\n') | 119 | lines = verse.split(u'\n') |
68 | 120 | for line in lines: | 120 | for line in lines: |
69 | 121 | text.append(line) | 121 | text.append(line) |
70 | 122 | |||
71 | 123 | split_text = self._split_set_of_lines(text, False) | 122 | split_text = self._split_set_of_lines(text, False) |
72 | 124 | print "split text ", split_text | 123 | print "split text ", split_text |
73 | 125 | print "text ", text | 124 | print "text ", text |
74 | 126 | return split_text | 125 | return split_text |
75 | 127 | 126 | ||
76 | 128 | # def render_screen(self, screennum): | ||
77 | 129 | # log.debug(u'render screen\n %s %s ', screennum, self.words[screennum]) | ||
78 | 130 | # t = 0.0 | ||
79 | 131 | # words = self.words[screennum] | ||
80 | 132 | # retval = self._render_lines(words) | ||
81 | 133 | # return retval | ||
82 | 134 | |||
83 | 135 | def set_text_rectangle(self, rect_main, rect_footer): | 127 | def set_text_rectangle(self, rect_main, rect_footer): |
84 | 136 | """ | 128 | """ |
85 | 137 | Sets the rectangle within which text should be rendered | 129 | Sets the rectangle within which text should be rendered |
86 | @@ -145,23 +137,17 @@ | |||
87 | 145 | """ | 137 | """ |
88 | 146 | #print "########## Generate frame from lines ##################" | 138 | #print "########## Generate frame from lines ##################" |
89 | 147 | log.debug(u'generate_frame_from_lines - Start') | 139 | log.debug(u'generate_frame_from_lines - Start') |
90 | 148 | |||
91 | 149 | #print "Render Lines ", lines | 140 | #print "Render Lines ", lines |
92 | 150 | |||
93 | 151 | bbox = self._render_lines_unaligned(lines, False) | 141 | bbox = self._render_lines_unaligned(lines, False) |
94 | 152 | if footer_lines is not None: | 142 | if footer_lines is not None: |
95 | 153 | bbox1 = self._render_lines_unaligned(footer_lines, True) | 143 | bbox1 = self._render_lines_unaligned(footer_lines, True) |
96 | 154 | |||
97 | 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. |
98 | 156 | self._frame = QtGui.QPixmap(self._bg_frame) | 145 | self._frame = QtGui.QPixmap(self._bg_frame) |
99 | 157 | |||
100 | 158 | x, y = self._correctAlignment(self._rect, bbox) | 146 | x, y = self._correctAlignment(self._rect, bbox) |
101 | 159 | bbox = self._render_lines_unaligned(lines, False, (x, y)) | 147 | bbox = self._render_lines_unaligned(lines, False, (x, y)) |
102 | 160 | |||
103 | 161 | if footer_lines is not None: | 148 | if footer_lines is not None: |
104 | 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()) ) |
105 | 163 | log.debug(u'generate_frame_from_lines - Finish') | 150 | log.debug(u'generate_frame_from_lines - Finish') |
106 | 164 | |||
107 | 165 | return self._frame | 151 | return self._frame |
108 | 166 | 152 | ||
109 | 167 | def _generate_background_frame(self): | 153 | def _generate_background_frame(self): |
110 | @@ -189,23 +175,18 @@ | |||
111 | 189 | w = int(self._frame.width()) / 2 | 175 | w = int(self._frame.width()) / 2 |
112 | 190 | h = int(self._frame.height()) / 2 | 176 | h = int(self._frame.height()) / 2 |
113 | 191 | gradient = QtGui.QRadialGradient(w, h, w) # Circular | 177 | gradient = QtGui.QRadialGradient(w, h, w) # Circular |
114 | 192 | |||
115 | 193 | gradient.setColorAt(0, QtGui.QColor(self._theme.background_startColor)) | 178 | gradient.setColorAt(0, QtGui.QColor(self._theme.background_startColor)) |
116 | 194 | gradient.setColorAt(1, QtGui.QColor(self._theme.background_endColor)) | 179 | gradient.setColorAt(1, QtGui.QColor(self._theme.background_endColor)) |
117 | 195 | |||
118 | 196 | painter.setBrush(QtGui.QBrush(gradient)) | 180 | painter.setBrush(QtGui.QBrush(gradient)) |
119 | 197 | rectPath = QtGui.QPainterPath() | 181 | rectPath = QtGui.QPainterPath() |
120 | 198 | |||
121 | 199 | max_x = self._frame.width() | 182 | max_x = self._frame.width() |
122 | 200 | max_y = self._frame.height() | 183 | max_y = self._frame.height() |
123 | 201 | rectPath.moveTo(0, 0) | 184 | rectPath.moveTo(0, 0) |
124 | 202 | rectPath.lineTo(0, max_y) | 185 | rectPath.lineTo(0, max_y) |
125 | 203 | rectPath.lineTo(max_x, max_y) | 186 | rectPath.lineTo(max_x, max_y) |
126 | 204 | rectPath.lineTo(max_x, 0) | 187 | rectPath.lineTo(max_x, 0) |
127 | 205 | |||
128 | 206 | rectPath.closeSubpath() | 188 | rectPath.closeSubpath() |
129 | 207 | painter.drawPath(rectPath) | 189 | painter.drawPath(rectPath) |
130 | 208 | |||
131 | 209 | elif self._theme.background_type== u'image': # image | 190 | elif self._theme.background_type== u'image': # image |
132 | 210 | if self.bg_image is not None: | 191 | if self.bg_image is not None: |
133 | 211 | painter.drawPixmap(0 ,0 , self.bg_image) | 192 | painter.drawPixmap(0 ,0 , self.bg_image) |
134 | @@ -219,24 +200,19 @@ | |||
135 | 219 | def _split_set_of_lines(self, lines, footer): | 200 | def _split_set_of_lines(self, lines, footer): |
136 | 220 | """ | 201 | """ |
137 | 221 | Given a list of lines, decide how to split them best if they don't all fit on the screen | 202 | Given a list of lines, decide how to split them best if they don't all fit on the screen |
144 | 222 | - this is done by splitting at 1/2, 1/3 or 1/4 of the set | 203 | - this is done by splitting at 1/2, 1/3 or 1/4 of the set |
145 | 223 | If it doesn't fit, even at this size, just split at each opportunity | 204 | If it doesn't fit, even at this size, just split at each opportunity. |
146 | 224 | 205 | We'll do this by getting the bounding box of each line, and then summing them appropriately | |
147 | 225 | We'll do this by getting the bounding box of each line, and then summing them appropriately | 206 | Returns a list of [lists of lines], one set for each screenful |
148 | 226 | Returns a list of [lists of lines], one set for each screenful | 207 | """ |
143 | 227 | """ | ||
149 | 228 | bboxes = [] | 208 | bboxes = [] |
150 | 229 | #print "lines ", lines | 209 | #print "lines ", lines |
151 | 230 | |||
152 | 231 | for line in lines: | 210 | for line in lines: |
153 | 232 | bboxes.append(self._render_and_wrap_single_line(line, footer)) | 211 | bboxes.append(self._render_and_wrap_single_line(line, footer)) |
154 | 233 | #print "bboxes ", bboxes | 212 | #print "bboxes ", bboxes |
155 | 234 | |||
156 | 235 | numlines = len(lines) | 213 | numlines = len(lines) |
157 | 236 | bottom = self._rect.bottom() | 214 | bottom = self._rect.bottom() |
158 | 237 | |||
159 | 238 | count = 0 | 215 | count = 0 |
160 | 239 | |||
161 | 240 | for ratio in (numlines, numlines/2, numlines/3, numlines/4): | 216 | for ratio in (numlines, numlines/2, numlines/3, numlines/4): |
162 | 241 | good = 1 | 217 | good = 1 |
163 | 242 | startline = 0 | 218 | startline = 0 |
164 | @@ -258,7 +234,6 @@ | |||
165 | 258 | endline = startline + ratio | 234 | endline = startline + ratio |
166 | 259 | if good == 1: | 235 | if good == 1: |
167 | 260 | break | 236 | break |
168 | 261 | |||
169 | 262 | retval = [] | 237 | retval = [] |
170 | 263 | numlines_per_page = ratio | 238 | numlines_per_page = ratio |
171 | 264 | #print "good ", good, ratio | 239 | #print "good ", good, ratio |
172 | @@ -276,7 +251,7 @@ | |||
173 | 276 | retval.append(thislines) | 251 | retval.append(thislines) |
174 | 277 | #print "extra ", thislines | 252 | #print "extra ", thislines |
175 | 278 | else: | 253 | else: |
177 | 279 | # print "Just split where you can" | 254 | # print "Just split where you can" |
178 | 280 | retval = [] | 255 | retval = [] |
179 | 281 | startline = 0 | 256 | startline = 0 |
180 | 282 | endline = startline + 1 | 257 | endline = startline + 1 |
181 | @@ -312,7 +287,6 @@ | |||
182 | 312 | (using the _render_single_line fn - which may result in going | 287 | (using the _render_single_line fn - which may result in going |
183 | 313 | off the bottom) They are expected to be pre-arranged to less | 288 | off the bottom) They are expected to be pre-arranged to less |
184 | 314 | than a screenful (eg. by using split_set_of_lines) | 289 | than a screenful (eg. by using split_set_of_lines) |
185 | 315 | |||
186 | 316 | Returns the bounding box of the text as QRect | 290 | Returns the bounding box of the text as QRect |
187 | 317 | """ | 291 | """ |
188 | 318 | log.debug(u'render lines unaligned Start') | 292 | log.debug(u'render lines unaligned Start') |
189 | @@ -339,10 +313,8 @@ | |||
190 | 339 | """ | 313 | """ |
191 | 340 | Render a single line of words onto the DC, top left corner | 314 | Render a single line of words onto the DC, top left corner |
192 | 341 | specified. | 315 | specified. |
193 | 342 | |||
194 | 343 | If the line is too wide for the context, it wraps, but | 316 | If the line is too wide for the context, it wraps, but |
195 | 344 | right-aligns the surplus words in the manner of song lyrics | 317 | right-aligns the surplus words in the manner of song lyrics |
196 | 345 | |||
197 | 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). |
198 | 347 | """ | 319 | """ |
199 | 348 | log.debug(u'Render single line %s @ %s '%( line, tlcorner)) | 320 | log.debug(u'Render single line %s @ %s '%( line, tlcorner)) |
200 | @@ -374,7 +346,6 @@ | |||
201 | 374 | align = 0 | 346 | align = 0 |
202 | 375 | else: | 347 | else: |
203 | 376 | align = int(self._theme .display_horizontalAlign) | 348 | align = int(self._theme .display_horizontalAlign) |
204 | 377 | |||
205 | 378 | for linenum in range(len(lines)): | 349 | for linenum in range(len(lines)): |
206 | 379 | line = lines[linenum] | 350 | line = lines[linenum] |
207 | 380 | #find out how wide line is | 351 | #find out how wide line is |
208 | @@ -420,7 +391,6 @@ | |||
209 | 420 | color = self._theme.display_outline_color) | 391 | color = self._theme.display_outline_color) |
210 | 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, |
211 | 422 | color = self._theme.display_outline_color) | 393 | color = self._theme.display_outline_color) |
212 | 423 | |||
213 | 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) |
214 | 425 | y += h | 395 | y += h |
215 | 426 | if linenum == 0: | 396 | if linenum == 0: |
216 | @@ -432,7 +402,6 @@ | |||
217 | 432 | painter.setPen(QtGui.QPen(QtGui.QColor(0,255,0))) | 402 | painter.setPen(QtGui.QPen(QtGui.QColor(0,255,0))) |
218 | 433 | painter.drawRect(startx , starty , rightextent-startx , y-starty) | 403 | painter.drawRect(startx , starty , rightextent-startx , y-starty) |
219 | 434 | painter.end() | 404 | painter.end() |
220 | 435 | |||
221 | 436 | brcorner = (rightextent , y) | 405 | brcorner = (rightextent , y) |
222 | 437 | log.debug(u'Render single line Finish') | 406 | log.debug(u'Render single line Finish') |
223 | 438 | return brcorner | 407 | return brcorner |
224 | @@ -489,3 +458,10 @@ | |||
225 | 489 | if image2 is not None: | 458 | if image2 is not None: |
226 | 490 | im = image2.toImage() | 459 | im = image2.toImage() |
227 | 491 | im.save("renderer2.png", "png") | 460 | im.save("renderer2.png", "png") |
228 | 461 | |||
229 | 462 | # def render_screen(self, screennum): | ||
230 | 463 | # log.debug(u'render screen\n %s %s ', screennum, self.words[screennum]) | ||
231 | 464 | # t = 0.0 | ||
232 | 465 | # words = self.words[screennum] | ||
233 | 466 | # retval = self._render_lines(words) | ||
234 | 467 | # return retval | ||
235 | 492 | 468 | ||
236 | === modified file 'openlp/core/lib/rendermanager.py' | |||
237 | --- openlp/core/lib/rendermanager.py 2009-06-01 17:50:37 +0000 | |||
238 | +++ openlp/core/lib/rendermanager.py 2009-06-05 18:53:50 +0000 | |||
239 | @@ -54,17 +54,25 @@ | |||
240 | 54 | log=logging.getLogger(u'RenderManager') | 54 | log=logging.getLogger(u'RenderManager') |
241 | 55 | log.info(u'RenderManager Loaded') | 55 | log.info(u'RenderManager Loaded') |
242 | 56 | 56 | ||
244 | 57 | def __init__(self, theme_manager, screen_list): | 57 | def __init__(self, theme_manager, screen_list, screen_number=0): |
245 | 58 | log.debug(u'Initilisation started') | 58 | log.debug(u'Initilisation started') |
246 | 59 | self.screen_list = screen_list | 59 | self.screen_list = screen_list |
247 | 60 | self.theme_manager = theme_manager | 60 | self.theme_manager = theme_manager |
248 | 61 | self.displays = len(screen_list) | 61 | self.displays = len(screen_list) |
250 | 62 | self.current_display = 0 | 62 | self.current_display = screen_number |
251 | 63 | self.renderer = Renderer() | 63 | self.renderer = Renderer() |
252 | 64 | self.calculate_default(self.screen_list[self.current_display]['size']) | 64 | self.calculate_default(self.screen_list[self.current_display]['size']) |
253 | 65 | self.theme = u'' | 65 | self.theme = u'' |
254 | 66 | self.service_theme = u'' | 66 | self.service_theme = u'' |
255 | 67 | 67 | ||
256 | 68 | def update_display(self, screen_number): | ||
257 | 69 | """ | ||
258 | 70 | Updates the render manager's information about the current screen. | ||
259 | 71 | """ | ||
260 | 72 | if self.current_display != screen_number: | ||
261 | 73 | self.current_display = screen_number | ||
262 | 74 | self.calculate_default(self.screen_list[self.current_display]['size']) | ||
263 | 75 | |||
264 | 68 | def set_global_theme(self, global_theme, global_style = u'Global'): | 76 | def set_global_theme(self, global_theme, global_style = u'Global'): |
265 | 69 | self.global_theme = global_theme | 77 | self.global_theme = global_theme |
266 | 70 | self.global_style = global_style | 78 | self.global_style = global_style |
267 | @@ -95,7 +103,7 @@ | |||
268 | 95 | if self.theme is not self.renderer.theme_name: | 103 | if self.theme is not self.renderer.theme_name: |
269 | 96 | log.debug(u'theme is now %s', self.theme) | 104 | log.debug(u'theme is now %s', self.theme) |
270 | 97 | self.themedata = self.theme_manager.getThemeData(self.theme) | 105 | self.themedata = self.theme_manager.getThemeData(self.theme) |
272 | 98 | self.calculate_default(self.screen_list[self.current_display]['size']) | 106 | self.calculate_default(self.screen_list[self.current_display][u'size']) |
273 | 99 | self.renderer.set_theme(self.themedata) | 107 | self.renderer.set_theme(self.themedata) |
274 | 100 | self.build_text_rectangle(self.themedata) | 108 | self.build_text_rectangle(self.themedata) |
275 | 101 | 109 | ||
276 | @@ -140,14 +148,14 @@ | |||
277 | 140 | 148 | ||
278 | 141 | def format_slide(self, words): | 149 | def format_slide(self, words): |
279 | 142 | log.debug(u'format slide') | 150 | log.debug(u'format slide') |
281 | 143 | self.calculate_default(self.screen_list[self.current_display]['size']) | 151 | self.calculate_default(self.screen_list[self.current_display][u'size']) |
282 | 144 | self.build_text_rectangle(self.themedata) | 152 | self.build_text_rectangle(self.themedata) |
283 | 145 | self.renderer.set_frame_dest(self.width, self.height) | 153 | self.renderer.set_frame_dest(self.width, self.height) |
284 | 146 | return self.renderer.format_slide(words, False) | 154 | return self.renderer.format_slide(words, False) |
285 | 147 | 155 | ||
286 | 148 | def generate_slide(self,main_text, footer_text): | 156 | def generate_slide(self,main_text, footer_text): |
287 | 149 | log.debug(u'generate slide') | 157 | log.debug(u'generate slide') |
289 | 150 | self.calculate_default(self.screen_list[self.current_display]['size']) | 158 | self.calculate_default(self.screen_list[self.current_display][u'size']) |
290 | 151 | self.build_text_rectangle(self.themedata) | 159 | self.build_text_rectangle(self.themedata) |
291 | 152 | self.renderer.set_frame_dest(self.width, self.height) | 160 | self.renderer.set_frame_dest(self.width, self.height) |
292 | 153 | return self.renderer.generate_frame_from_lines(main_text, footer_text) | 161 | return self.renderer.generate_frame_from_lines(main_text, footer_text) |
293 | 154 | 162 | ||
294 | === modified file 'openlp/core/lib/settingstab.py' | |||
295 | --- openlp/core/lib/settingstab.py 2009-05-01 11:50:09 +0000 | |||
296 | +++ openlp/core/lib/settingstab.py 2009-06-05 18:53:50 +0000 | |||
297 | @@ -25,7 +25,7 @@ | |||
298 | 25 | """ | 25 | """ |
299 | 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. |
300 | 27 | """ | 27 | """ |
302 | 28 | def __init__(self, title=None): | 28 | def __init__(self, title=None, section=None): |
303 | 29 | """ | 29 | """ |
304 | 30 | Constructor to create the Steetings tab item. | 30 | Constructor to create the Steetings tab item. |
305 | 31 | """ | 31 | """ |
306 | @@ -34,10 +34,10 @@ | |||
307 | 34 | self.setupUi() | 34 | self.setupUi() |
308 | 35 | self.retranslateUi() | 35 | self.retranslateUi() |
309 | 36 | self.initialise() | 36 | self.initialise() |
312 | 37 | if title == None: | 37 | if section == None: |
313 | 38 | self.config = PluginConfig(u'Main') | 38 | self.config = PluginConfig(title) |
314 | 39 | else: | 39 | else: |
316 | 40 | self.config = PluginConfig(str(title)) | 40 | self.config = PluginConfig(section) |
317 | 41 | self.load() | 41 | self.load() |
318 | 42 | 42 | ||
319 | 43 | def setTitle(self, title): | 43 | def setTitle(self, title): |
320 | 44 | 44 | ||
321 | === modified file 'openlp/core/ui/alertstab.py' | |||
322 | --- openlp/core/ui/alertstab.py 2009-05-20 20:17:20 +0000 | |||
323 | +++ openlp/core/ui/alertstab.py 2009-06-05 18:53:50 +0000 | |||
324 | @@ -29,7 +29,7 @@ | |||
325 | 29 | def __init__(self): | 29 | def __init__(self): |
326 | 30 | self.font_color = '#ffffff' | 30 | self.font_color = '#ffffff' |
327 | 31 | self.bg_color = '#660000' | 31 | self.bg_color = '#660000' |
329 | 32 | SettingsTab.__init__(self, u'Alerts') | 32 | SettingsTab.__init__(self, translate(u'AlertsTab', u'Alerts'), u'Alerts') |
330 | 33 | 33 | ||
331 | 34 | def setupUi(self): | 34 | def setupUi(self): |
332 | 35 | self.setObjectName(u'AlertsTab') | 35 | self.setObjectName(u'AlertsTab') |
333 | @@ -130,13 +130,13 @@ | |||
334 | 130 | self.AlertsLayout.addWidget(self.AlertRightColumn) | 130 | self.AlertsLayout.addWidget(self.AlertRightColumn) |
335 | 131 | # Signals and slots | 131 | # Signals and slots |
336 | 132 | QtCore.QObject.connect(self.BackgroundColorButton, | 132 | QtCore.QObject.connect(self.BackgroundColorButton, |
338 | 133 | QtCore.SIGNAL("pressed()"), self.onBackgroundColorButtonClicked) | 133 | QtCore.SIGNAL(u'pressed()'), self.onBackgroundColorButtonClicked) |
339 | 134 | QtCore.QObject.connect(self.FontColorButton, | 134 | QtCore.QObject.connect(self.FontColorButton, |
341 | 135 | QtCore.SIGNAL("pressed()"), self.onFontColorButtonClicked) | 135 | QtCore.SIGNAL(u'pressed()'), self.onFontColorButtonClicked) |
342 | 136 | QtCore.QObject.connect(self.FontComboBox, | 136 | QtCore.QObject.connect(self.FontComboBox, |
344 | 137 | QtCore.SIGNAL("activated(int)"), self.onFontComboBoxClicked) | 137 | QtCore.SIGNAL(u'activated(int)'), self.onFontComboBoxClicked) |
345 | 138 | QtCore.QObject.connect(self.TimeoutSpinBox, | 138 | QtCore.QObject.connect(self.TimeoutSpinBox, |
347 | 139 | QtCore.SIGNAL("valueChanged(int)"), self.onTimeoutSpinBoxChanged) | 139 | QtCore.SIGNAL(u'valueChanged(int)'), self.onTimeoutSpinBoxChanged) |
348 | 140 | 140 | ||
349 | 141 | def retranslateUi(self): | 141 | def retranslateUi(self): |
350 | 142 | self.FontGroupBox.setTitle(translate(u'AlertsTab', u'Font')) | 142 | self.FontGroupBox.setTitle(translate(u'AlertsTab', u'Font')) |
351 | @@ -146,13 +146,13 @@ | |||
352 | 146 | self.TimeoutLabel.setText(translate(u'AlertsTab', u'Alert timeout:')) | 146 | self.TimeoutLabel.setText(translate(u'AlertsTab', u'Alert timeout:')) |
353 | 147 | self.TimeoutSpinBox.setSuffix(translate(u'AlertsTab', u's')) | 147 | self.TimeoutSpinBox.setSuffix(translate(u'AlertsTab', u's')) |
354 | 148 | self.PreviewGroupBox.setTitle(translate(u'AlertsTab', u'Preview')) | 148 | self.PreviewGroupBox.setTitle(translate(u'AlertsTab', u'Preview')) |
356 | 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!')) |
357 | 150 | 150 | ||
358 | 151 | def onBackgroundColorButtonClicked(self): | 151 | def onBackgroundColorButtonClicked(self): |
359 | 152 | self.bg_color = QtGui.QColorDialog.getColor( | 152 | self.bg_color = QtGui.QColorDialog.getColor( |
361 | 153 | QColor(self.bg_color), self).name() | 153 | QtGui.QColor(self.bg_color), self).name() |
362 | 154 | self.BackgroundColorButton.setStyleSheet( | 154 | self.BackgroundColorButton.setStyleSheet( |
364 | 155 | 'background-color: %s' % self.bg_color) | 155 | u'background-color: %s' % self.bg_color) |
365 | 156 | self.updateDisplay() | 156 | self.updateDisplay() |
366 | 157 | 157 | ||
367 | 158 | def onFontComboBoxClicked(self): | 158 | def onFontComboBoxClicked(self): |
368 | @@ -160,22 +160,22 @@ | |||
369 | 160 | 160 | ||
370 | 161 | def onFontColorButtonClicked(self): | 161 | def onFontColorButtonClicked(self): |
371 | 162 | self.font_color = QtGui.QColorDialog.getColor( | 162 | self.font_color = QtGui.QColorDialog.getColor( |
373 | 163 | QColor(self.font_color), self).name() | 163 | QtGui.QColor(self.font_color), self).name() |
374 | 164 | self.FontColorButton.setStyleSheet( | 164 | self.FontColorButton.setStyleSheet( |
376 | 165 | 'background-color: %s' % self.font_color) | 165 | u'background-color: %s' % self.font_color) |
377 | 166 | self.updateDisplay() | 166 | self.updateDisplay() |
378 | 167 | 167 | ||
379 | 168 | def onTimeoutSpinBoxChanged(self): | 168 | def onTimeoutSpinBoxChanged(self): |
380 | 169 | self.timeout = self.TimeoutSpinBox.value() | 169 | self.timeout = self.TimeoutSpinBox.value() |
381 | 170 | 170 | ||
382 | 171 | def load(self): | 171 | def load(self): |
387 | 172 | self.timeout = int(self.config.get_config('timeout', 5)) | 172 | self.timeout = int(self.config.get_config(u'timeout', 5)) |
388 | 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')) |
389 | 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')) |
390 | 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())) |
391 | 176 | self.TimeoutSpinBox.setValue(self.timeout) | 176 | self.TimeoutSpinBox.setValue(self.timeout) |
394 | 177 | self.FontColorButton.setStyleSheet('background-color: %s' % self.font_color) | 177 | self.FontColorButton.setStyleSheet(u'background-color: %s' % self.font_color) |
395 | 178 | self.BackgroundColorButton.setStyleSheet('background-color: %s' % self.bg_color) | 178 | self.BackgroundColorButton.setStyleSheet(u'background-color: %s' % self.bg_color) |
396 | 179 | font = QtGui.QFont() | 179 | font = QtGui.QFont() |
397 | 180 | font.setFamily(self.font_face) | 180 | font.setFamily(self.font_face) |
398 | 181 | self.FontComboBox.setCurrentFont(font) | 181 | self.FontComboBox.setCurrentFont(font) |
399 | @@ -183,10 +183,10 @@ | |||
400 | 183 | 183 | ||
401 | 184 | def save(self): | 184 | def save(self): |
402 | 185 | self.font_face = self.FontComboBox.currentFont().family() | 185 | self.font_face = self.FontComboBox.currentFont().family() |
407 | 186 | self.config.set_config('background color', str(self.bg_color)) | 186 | self.config.set_config(u'background color', str(self.bg_color)) |
408 | 187 | self.config.set_config('font color', str(self.font_color)) | 187 | self.config.set_config(u'font color', str(self.font_color)) |
409 | 188 | self.config.set_config('font face', str(self.font_face)) | 188 | self.config.set_config(u'font face', str(self.font_face)) |
410 | 189 | self.config.set_config('timeout', str(self.timeout)) | 189 | self.config.set_config(u'timeout', str(self.timeout)) |
411 | 190 | 190 | ||
412 | 191 | def updateDisplay(self): | 191 | def updateDisplay(self): |
413 | 192 | font = QtGui.QFont() | 192 | font = QtGui.QFont() |
414 | @@ -195,4 +195,4 @@ | |||
415 | 195 | font.setPointSize(16) | 195 | font.setPointSize(16) |
416 | 196 | self.FontPreview.setFont(font) | 196 | self.FontPreview.setFont(font) |
417 | 197 | self.FontPreview.setStyleSheet( | 197 | self.FontPreview.setStyleSheet( |
419 | 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)) |
420 | 199 | 199 | ||
421 | === modified file 'openlp/core/ui/generaltab.py' | |||
422 | --- openlp/core/ui/generaltab.py 2009-06-01 17:50:37 +0000 | |||
423 | +++ openlp/core/ui/generaltab.py 2009-06-05 18:53:50 +0000 | |||
424 | @@ -28,7 +28,7 @@ | |||
425 | 28 | """ | 28 | """ |
426 | 29 | def __init__(self, screen_list): | 29 | def __init__(self, screen_list): |
427 | 30 | self.screen_list = screen_list | 30 | self.screen_list = screen_list |
429 | 31 | SettingsTab.__init__(self, translate(u'GeneralTab', u'General')) | 31 | SettingsTab.__init__(self, translate(u'GeneralTab', u'General'), u'General') |
430 | 32 | 32 | ||
431 | 33 | def setupUi(self): | 33 | def setupUi(self): |
432 | 34 | self.setObjectName(u'GeneralTab') | 34 | self.setObjectName(u'GeneralTab') |
433 | @@ -114,18 +114,17 @@ | |||
434 | 114 | self.GeneralRightLayout.addItem(self.GeneralRightSpacer) | 114 | self.GeneralRightLayout.addItem(self.GeneralRightSpacer) |
435 | 115 | self.GeneralLayout.addWidget(self.GeneralRightWidget) | 115 | self.GeneralLayout.addWidget(self.GeneralRightWidget) |
436 | 116 | QtCore.QObject.connect(self.MonitorComboBox, | 116 | QtCore.QObject.connect(self.MonitorComboBox, |
438 | 117 | QtCore.SIGNAL("activated(int)"), self.onMonitorComboBoxChanged) | 117 | QtCore.SIGNAL(u'activated(int)'), self.onMonitorComboBoxChanged) |
439 | 118 | QtCore.QObject.connect(self.WarningCheckBox, | 118 | QtCore.QObject.connect(self.WarningCheckBox, |
441 | 119 | QtCore.SIGNAL("stateChanged(int)"), self.onWarningCheckBoxChanged) | 119 | QtCore.SIGNAL(u'stateChanged(int)'), self.onWarningCheckBoxChanged) |
442 | 120 | QtCore.QObject.connect(self.AutoOpenCheckBox, | 120 | QtCore.QObject.connect(self.AutoOpenCheckBox, |
444 | 121 | QtCore.SIGNAL("stateChanged(int)"), self.onAutoOpenCheckBoxChanged) | 121 | QtCore.SIGNAL(u'stateChanged(int)'), self.onAutoOpenCheckBoxChanged) |
445 | 122 | QtCore.QObject.connect(self.NumberEdit, | 122 | QtCore.QObject.connect(self.NumberEdit, |
447 | 123 | QtCore.SIGNAL("lostFocus()"), self.onNumberEditLostFocus) | 123 | QtCore.SIGNAL(u'lostFocus()'), self.onNumberEditLostFocus) |
448 | 124 | QtCore.QObject.connect(self.UsernameEdit, | 124 | QtCore.QObject.connect(self.UsernameEdit, |
450 | 125 | QtCore.SIGNAL("lostFocus()"), self.onUsernameEditLostFocus) | 125 | QtCore.SIGNAL(u'lostFocus()'), self.onUsernameEditLostFocus) |
451 | 126 | QtCore.QObject.connect(self.PasswordEdit, | 126 | QtCore.QObject.connect(self.PasswordEdit, |
454 | 127 | QtCore.SIGNAL("lostFocus()"), self.onPasswordEditLostFocus) | 127 | QtCore.SIGNAL(u'lostFocus()'), self.onPasswordEditLostFocus) |
453 | 128 | |||
455 | 129 | 128 | ||
456 | 130 | def retranslateUi(self): | 129 | def retranslateUi(self): |
457 | 131 | self.MonitorGroupBox.setTitle(translate(u'GeneralTab', u'Monitors')) | 130 | self.MonitorGroupBox.setTitle(translate(u'GeneralTab', u'Monitors')) |
458 | @@ -144,12 +143,14 @@ | |||
459 | 144 | 143 | ||
460 | 145 | def onAutoOpenCheckBoxChanged(self, value): | 144 | def onAutoOpenCheckBoxChanged(self, value): |
461 | 146 | self.AutoOpen = False | 145 | self.AutoOpen = False |
463 | 147 | if value == 2: # we have a set value convert to True/False | 146 | if value == 2: |
464 | 147 | # we have a set value convert to True/False | ||
465 | 148 | self.AutoOpen = True | 148 | self.AutoOpen = True |
466 | 149 | 149 | ||
467 | 150 | def onWarningCheckBoxChanged(self, value): | 150 | def onWarningCheckBoxChanged(self, value): |
468 | 151 | self.Warning = False | 151 | self.Warning = False |
470 | 152 | if value == 2: # we have a set value convert to True/False | 152 | if value == 2: |
471 | 153 | # we have a set value convert to True/False | ||
472 | 153 | self.Warning = True | 154 | self.Warning = True |
473 | 154 | 155 | ||
474 | 155 | def onNumberEditLostFocus(self): | 156 | def onNumberEditLostFocus(self): |
475 | @@ -164,19 +165,19 @@ | |||
476 | 164 | def load(self): | 165 | def load(self): |
477 | 165 | for screen in self.screen_list: | 166 | for screen in self.screen_list: |
478 | 166 | screen_name = translate(u'GeneralTab', u'Screen') + u' ' + \ | 167 | screen_name = translate(u'GeneralTab', u'Screen') + u' ' + \ |
481 | 167 | str(screen['number'] + 1) | 168 | str(screen[u'number'] + 1) |
482 | 168 | if screen['primary']: | 169 | if screen[u'primary']: |
483 | 169 | screen_name = screen_name + u' (' + \ | 170 | screen_name = screen_name + u' (' + \ |
484 | 170 | translate(u'GeneralTab', u'primary') + u')' | 171 | translate(u'GeneralTab', u'primary') + u')' |
485 | 171 | self.MonitorComboBox.addItem(screen_name) | 172 | self.MonitorComboBox.addItem(screen_name) |
487 | 172 | 173 | # Get the configs | |
488 | 173 | self.MonitorNumber = int(self.config.get_config(u'Monitor', u'0')) | 174 | self.MonitorNumber = int(self.config.get_config(u'Monitor', u'0')) |
495 | 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')) |
496 | 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')) |
497 | 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')) |
498 | 177 | self.Username = str(self.config.get_config('User Name', u'')) | 178 | self.Username = str(self.config.get_config(u'User Name', u'')) |
499 | 178 | self.Password = str(self.config.get_config('Password', u'')) | 179 | self.Password = str(self.config.get_config(u'Password', u'')) |
500 | 179 | 180 | # Set a few things up | |
501 | 180 | self.MonitorComboBox.setCurrentIndex(self.MonitorNumber) | 181 | self.MonitorComboBox.setCurrentIndex(self.MonitorNumber) |
502 | 181 | self.WarningCheckBox.setChecked(self.Warning) | 182 | self.WarningCheckBox.setChecked(self.Warning) |
503 | 182 | self.AutoOpenCheckBox.setChecked(self.AutoOpen) | 183 | self.AutoOpenCheckBox.setChecked(self.AutoOpen) |
504 | @@ -185,9 +186,9 @@ | |||
505 | 185 | self.PasswordEdit.setText(self.Password) | 186 | self.PasswordEdit.setText(self.Password) |
506 | 186 | 187 | ||
507 | 187 | def save(self): | 188 | def save(self): |
514 | 188 | self.config.set_config(u'Monitor',str(self.MonitorNumber)) | 189 | self.config.set_config(u'Monitor', self.MonitorNumber) |
515 | 189 | self.config.set_config(u'Warning', str(self.Warning)) | 190 | self.config.set_config(u'Warning', self.Warning) |
516 | 190 | self.config.set_config(u'Auto Open', str(self.AutoOpen)) | 191 | self.config.set_config(u'Auto Open', self.AutoOpen) |
517 | 191 | self.config.set_config('CCL Number', str(self.CCLNumber)) | 192 | self.config.set_config(u'CCL Number', self.CCLNumber) |
518 | 192 | self.config.set_config('User Name',str(self.Username)) | 193 | self.config.set_config(u'User Name', self.Username) |
519 | 193 | self.config.set_config('Password', str(self.Password )) | 194 | self.config.set_config(u'Password', self.Password) |
520 | 194 | 195 | ||
521 | === modified file 'openlp/core/ui/maindisplay.py' | |||
522 | --- openlp/core/ui/maindisplay.py 2009-06-01 17:50:37 +0000 | |||
523 | +++ openlp/core/ui/maindisplay.py 2009-06-05 18:53:50 +0000 | |||
524 | @@ -29,8 +29,13 @@ | |||
525 | 29 | QtGui.QWidget.__init__(self, parent) | 29 | QtGui.QWidget.__init__(self, parent) |
526 | 30 | self.setWindowTitle(u'OpenLP Display') | 30 | self.setWindowTitle(u'OpenLP Display') |
527 | 31 | self.screens = screens | 31 | self.screens = screens |
528 | 32 | self.layout = QtGui.QVBoxLayout(self) | ||
529 | 33 | self.layout.setSpacing(0) | ||
530 | 34 | self.layout.setMargin(0) | ||
531 | 35 | self.layout.setObjectName(u'layout') | ||
532 | 32 | self.display = QtGui.QLabel(self) | 36 | self.display = QtGui.QLabel(self) |
533 | 33 | self.display.setScaledContents(True) | 37 | self.display.setScaledContents(True) |
534 | 38 | self.layout.addWidget(self.display) | ||
535 | 34 | self.displayBlank = False | 39 | self.displayBlank = False |
536 | 35 | self.blankFrame= None | 40 | self.blankFrame= None |
537 | 36 | self.alertactive = False | 41 | self.alertactive = False |
538 | @@ -43,23 +48,21 @@ | |||
539 | 43 | @param (integer) screen This is the screen number. | 48 | @param (integer) screen This is the screen number. |
540 | 44 | """ | 49 | """ |
541 | 45 | screen = self.screens[screenNumber] | 50 | screen = self.screens[screenNumber] |
543 | 46 | if screen['number'] != screenNumber: | 51 | if screen[u'number'] != screenNumber: |
544 | 47 | # We will most probably never actually hit this bit, but just in | 52 | # We will most probably never actually hit this bit, but just in |
545 | 48 | # case the index in the list doesn't match the screen number, we | 53 | # case the index in the list doesn't match the screen number, we |
546 | 49 | # search for it. | 54 | # search for it. |
547 | 50 | for scrn in self.screens: | 55 | for scrn in self.screens: |
549 | 51 | if scrn['number'] == screenNumber: | 56 | if scrn[u'number'] == screenNumber: |
550 | 52 | screen = scrn | 57 | screen = scrn |
551 | 53 | break | 58 | break |
555 | 54 | self.setGeometry(screen['size']) | 59 | self.setGeometry(screen[u'size']) |
556 | 55 | self.display.setGeometry(screen['size']) | 60 | if not screen[u'primary']: |
554 | 56 | if not screen['primary']: | ||
557 | 57 | self.showFullScreen() | 61 | self.showFullScreen() |
558 | 58 | else: | 62 | else: |
563 | 59 | self.showMinimized() | 63 | self.hide() |
564 | 60 | 64 | painter = QtGui.QPainter() | |
565 | 61 | painter=QtGui.QPainter() | 65 | self.blankFrame = QtGui.QPixmap(screen[u'size'].width(), screen[u'size'].height()) |
562 | 62 | self.blankFrame = QtGui.QPixmap(screen['size'].width(), screen['size'].height()) | ||
566 | 63 | painter.begin(self.blankFrame) | 66 | painter.begin(self.blankFrame) |
567 | 64 | painter.fillRect(self.blankFrame.rect(), QtGui.QColor(u'#000000')) | 67 | painter.fillRect(self.blankFrame.rect(), QtGui.QColor(u'#000000')) |
568 | 65 | self.frameView(self.blankFrame) | 68 | self.frameView(self.blankFrame) |
569 | 66 | 69 | ||
570 | === modified file 'openlp/core/ui/mainwindow.py' | |||
571 | --- openlp/core/ui/mainwindow.py 2009-06-02 19:02:12 +0000 | |||
572 | +++ openlp/core/ui/mainwindow.py 2009-06-05 18:53:50 +0000 | |||
573 | @@ -25,7 +25,7 @@ | |||
574 | 25 | from openlp.core.ui import AboutForm, SettingsForm, AlertForm, ServiceManager, \ | 25 | from openlp.core.ui import AboutForm, SettingsForm, AlertForm, ServiceManager, \ |
575 | 26 | ThemeManager, MainDisplay, SlideController | 26 | ThemeManager, MainDisplay, SlideController |
576 | 27 | from openlp.core.lib import translate, Plugin, MediaManagerItem, SettingsTab, \ | 27 | from openlp.core.lib import translate, Plugin, MediaManagerItem, SettingsTab, \ |
578 | 28 | EventManager, RenderManager | 28 | EventManager, RenderManager, PluginConfig |
579 | 29 | from openlp.core import PluginManager | 29 | from openlp.core import PluginManager |
580 | 30 | 30 | ||
581 | 31 | class MainWindow(object): | 31 | class MainWindow(object): |
582 | @@ -46,6 +46,7 @@ | |||
583 | 46 | self.mainDisplay = MainDisplay(None, screens) | 46 | self.mainDisplay = MainDisplay(None, screens) |
584 | 47 | self.screenList = screens | 47 | self.screenList = screens |
585 | 48 | self.EventManager = EventManager() | 48 | self.EventManager = EventManager() |
586 | 49 | self.generalConfig = PluginConfig(u'General') | ||
587 | 49 | self.alertForm = AlertForm(self) | 50 | self.alertForm = AlertForm(self) |
588 | 50 | self.aboutForm = AboutForm() | 51 | self.aboutForm = AboutForm() |
589 | 51 | self.settingsForm = SettingsForm(self.screenList, self) | 52 | self.settingsForm = SettingsForm(self.screenList, self) |
590 | @@ -60,7 +61,8 @@ | |||
591 | 60 | #warning cyclic dependency | 61 | #warning cyclic dependency |
592 | 61 | #RenderManager needs to call ThemeManager and | 62 | #RenderManager needs to call ThemeManager and |
593 | 62 | #ThemeManager needs to call RenderManager | 63 | #ThemeManager needs to call RenderManager |
595 | 63 | self.RenderManager = RenderManager(self.ThemeManagerContents, self.screenList) | 64 | self.RenderManager = RenderManager(self.ThemeManagerContents, |
596 | 65 | self.screenList, int(self.generalConfig.get_config(u'Monitor', 0))) | ||
597 | 64 | log.info(u'Load Plugins') | 66 | log.info(u'Load Plugins') |
598 | 65 | self.plugin_helpers[u'preview'] = self.PreviewController | 67 | self.plugin_helpers[u'preview'] = self.PreviewController |
599 | 66 | self.plugin_helpers[u'live'] = self.LiveController | 68 | self.plugin_helpers[u'live'] = self.LiveController |
600 | @@ -91,6 +93,43 @@ | |||
601 | 91 | log.info(u'Load Themes') | 93 | log.info(u'Load Themes') |
602 | 92 | self.ThemeManagerContents.loadThemes() | 94 | self.ThemeManagerContents.loadThemes() |
603 | 93 | 95 | ||
604 | 96 | def show(self): | ||
605 | 97 | """ | ||
606 | 98 | Show the main form, as well as the display form | ||
607 | 99 | """ | ||
608 | 100 | self.mainWindow.showMaximized() | ||
609 | 101 | self.mainDisplay.setup(self.settingsForm.GeneralTab.MonitorNumber) | ||
610 | 102 | self.mainDisplay.show() | ||
611 | 103 | #self.mainWindow.setFocus(QtCore.Qt.OtherFocusReason) | ||
612 | 104 | |||
613 | 105 | def onHelpAboutItemClicked(self): | ||
614 | 106 | """ | ||
615 | 107 | Show the About form | ||
616 | 108 | """ | ||
617 | 109 | self.aboutForm.exec_() | ||
618 | 110 | |||
619 | 111 | def onToolsAlertItemClicked(self): | ||
620 | 112 | """ | ||
621 | 113 | Show the Alert form | ||
622 | 114 | """ | ||
623 | 115 | self.alertForm.exec_() | ||
624 | 116 | |||
625 | 117 | def onOptionsSettingsItemClicked(self): | ||
626 | 118 | """ | ||
627 | 119 | Show the Settings dialog | ||
628 | 120 | """ | ||
629 | 121 | self.settingsForm.exec_() | ||
630 | 122 | screen_number = int(self.generalConfig.get_config(u'Monitor', 0)) | ||
631 | 123 | self.RenderManager.update_display(screen_number) | ||
632 | 124 | self.mainDisplay.setup(screen_number) | ||
633 | 125 | |||
634 | 126 | def onCloseEvent(self, event): | ||
635 | 127 | """ | ||
636 | 128 | Hook to close the main window and display windows on exit | ||
637 | 129 | """ | ||
638 | 130 | self.mainDisplay.close() | ||
639 | 131 | event.accept() | ||
640 | 132 | |||
641 | 94 | def setupUi(self): | 133 | def setupUi(self): |
642 | 95 | """ | 134 | """ |
643 | 96 | Set up the user interface | 135 | Set up the user interface |
644 | @@ -459,36 +498,3 @@ | |||
645 | 459 | self.action_Preview_Panel.setText( | 498 | self.action_Preview_Panel.setText( |
646 | 460 | translate(u'mainWindow', u'&Preview Pane')) | 499 | translate(u'mainWindow', u'&Preview Pane')) |
647 | 461 | self.ModeLiveItem.setText(translate(u'mainWindow', u'&Live')) | 500 | self.ModeLiveItem.setText(translate(u'mainWindow', u'&Live')) |
648 | 462 | |||
649 | 463 | def show(self): | ||
650 | 464 | """ | ||
651 | 465 | Show the main form, as well as the display form | ||
652 | 466 | """ | ||
653 | 467 | self.mainWindow.showMaximized() | ||
654 | 468 | self.mainDisplay.setup(self.settingsForm.GeneralTab.MonitorNumber) | ||
655 | 469 | self.mainDisplay.show() | ||
656 | 470 | |||
657 | 471 | def onHelpAboutItemClicked(self): | ||
658 | 472 | """ | ||
659 | 473 | Show the About form | ||
660 | 474 | """ | ||
661 | 475 | self.aboutForm.exec_() | ||
662 | 476 | |||
663 | 477 | def onToolsAlertItemClicked(self): | ||
664 | 478 | """ | ||
665 | 479 | Show the Alert form | ||
666 | 480 | """ | ||
667 | 481 | self.alertForm.exec_() | ||
668 | 482 | |||
669 | 483 | def onOptionsSettingsItemClicked(self): | ||
670 | 484 | """ | ||
671 | 485 | Show the Settings dialog | ||
672 | 486 | """ | ||
673 | 487 | self.settingsForm.exec_() | ||
674 | 488 | |||
675 | 489 | def onCloseEvent(self, event): | ||
676 | 490 | """ | ||
677 | 491 | Hook to close the main window and display windows on exit | ||
678 | 492 | """ | ||
679 | 493 | self.mainDisplay.close() | ||
680 | 494 | event.accept() | ||
681 | 495 | 501 | ||
682 | === modified file 'openlp/core/ui/themestab.py' | |||
683 | --- openlp/core/ui/themestab.py 2009-05-20 20:17:20 +0000 | |||
684 | +++ openlp/core/ui/themestab.py 2009-06-05 18:53:50 +0000 | |||
685 | @@ -28,7 +28,7 @@ | |||
686 | 28 | """ | 28 | """ |
687 | 29 | def __init__(self, parent): | 29 | def __init__(self, parent): |
688 | 30 | self.parent = parent | 30 | self.parent = parent |
690 | 31 | SettingsTab.__init__(self, u'Themes') | 31 | SettingsTab.__init__(self, translate(u'ThemesTab', u'Themes'), u'Themes') |
691 | 32 | 32 | ||
692 | 33 | def setupUi(self): | 33 | def setupUi(self): |
693 | 34 | self.setObjectName(u'ThemesTab') | 34 | self.setObjectName(u'ThemesTab') |
694 | @@ -90,11 +90,11 @@ | |||
695 | 90 | self.ThemesTabLayout.addWidget(self.LevelGroupBox) | 90 | self.ThemesTabLayout.addWidget(self.LevelGroupBox) |
696 | 91 | 91 | ||
697 | 92 | QtCore.QObject.connect(self.SongLevelRadioButton, | 92 | QtCore.QObject.connect(self.SongLevelRadioButton, |
699 | 93 | QtCore.SIGNAL("pressed()"), self.onSongLevelButtonPressed) | 93 | QtCore.SIGNAL(u'pressed()'), self.onSongLevelButtonPressed) |
700 | 94 | QtCore.QObject.connect(self.ServiceLevelRadioButton, | 94 | QtCore.QObject.connect(self.ServiceLevelRadioButton, |
702 | 95 | QtCore.SIGNAL("pressed()"), self.onServiceLevelButtonPressed) | 95 | QtCore.SIGNAL(u'pressed()'), self.onServiceLevelButtonPressed) |
703 | 96 | QtCore.QObject.connect(self.GlobalLevelRadioButton, | 96 | QtCore.QObject.connect(self.GlobalLevelRadioButton, |
705 | 97 | QtCore.SIGNAL("pressed()"), self.onGlobalLevelButtonPressed) | 97 | QtCore.SIGNAL(u'pressed()'), self.onGlobalLevelButtonPressed) |
706 | 98 | 98 | ||
707 | 99 | QtCore.QObject.connect(self.DefaultComboBox, | 99 | QtCore.QObject.connect(self.DefaultComboBox, |
708 | 100 | QtCore.SIGNAL("activated(int)"), self.onDefaultComboBoxChanged) | 100 | QtCore.SIGNAL("activated(int)"), self.onDefaultComboBoxChanged) |
709 | 101 | 101 | ||
710 | === modified file 'openlp/core/utils/registry.py' | |||
711 | --- openlp/core/utils/registry.py 2009-06-04 16:53:49 +0000 | |||
712 | +++ openlp/core/utils/registry.py 2009-06-05 18:53:50 +0000 | |||
713 | @@ -28,8 +28,8 @@ | |||
714 | 28 | """ | 28 | """ |
715 | 29 | def __init__(self, dir): | 29 | def __init__(self, dir): |
716 | 30 | self.config = SafeConfigParser() | 30 | self.config = SafeConfigParser() |
719 | 31 | self.file_name = os.path.join(dir, 'openlp.conf') | 31 | self.file_name = os.path.join(dir, u'openlp.conf') |
720 | 32 | self.config.read(self.file_name) | 32 | self._load() |
721 | 33 | 33 | ||
722 | 34 | def has_value(self, section, key): | 34 | def has_value(self, section, key): |
723 | 35 | """ | 35 | """ |
724 | @@ -95,14 +95,24 @@ | |||
725 | 95 | except: | 95 | except: |
726 | 96 | return False | 96 | return False |
727 | 97 | 97 | ||
728 | 98 | def _load(self): | ||
729 | 99 | try: | ||
730 | 100 | if not os.path.isfile(self.file_name): | ||
731 | 101 | return False | ||
732 | 102 | file_handle = open(self.file_name, u'r') | ||
733 | 103 | self.config.readfp(file_handle) | ||
734 | 104 | file_handle.close() | ||
735 | 105 | return True | ||
736 | 106 | except: | ||
737 | 107 | return False | ||
738 | 108 | |||
739 | 98 | def _save(self): | 109 | def _save(self): |
740 | 99 | try: | 110 | try: |
741 | 100 | if not os.path.exists(os.path.dirname(self.file_name)): | 111 | if not os.path.exists(os.path.dirname(self.file_name)): |
742 | 101 | os.makedirs(os.path.dirname(self.file_name)) | 112 | os.makedirs(os.path.dirname(self.file_name)) |
744 | 102 | file_handle = open(self.file_name, 'w') | 113 | file_handle = open(self.file_name, u'w') |
745 | 103 | self.config.write(file_handle) | 114 | self.config.write(file_handle) |
749 | 104 | close(file_handle) | 115 | file_handle.close() |
750 | 105 | self.config.read(self.file_name) | 116 | return self._load() |
748 | 106 | return True | ||
751 | 107 | except: | 117 | except: |
752 | 108 | return False | 118 | return False |
753 | 109 | 119 | ||
754 | === modified file 'openlp/plugins/bibles/lib/biblestab.py' | |||
755 | --- openlp/plugins/bibles/lib/biblestab.py 2009-05-21 05:15:51 +0000 | |||
756 | +++ openlp/plugins/bibles/lib/biblestab.py 2009-06-05 18:53:50 +0000 | |||
757 | @@ -32,7 +32,7 @@ | |||
758 | 32 | self.show_new_chapters = False | 32 | self.show_new_chapters = False |
759 | 33 | self.display_style = 0 | 33 | self.display_style = 0 |
760 | 34 | self.bible_search = True | 34 | self.bible_search = True |
762 | 35 | SettingsTab.__init__(self, u'Bibles') | 35 | SettingsTab.__init__(self, translate(u'BiblesTab', u'Bibles'), u'Bibles') |
763 | 36 | 36 | ||
764 | 37 | def setupUi(self): | 37 | def setupUi(self): |
765 | 38 | self.setObjectName(u'BiblesTab') | 38 | self.setObjectName(u'BiblesTab') |
766 | @@ -134,32 +134,32 @@ | |||
767 | 134 | self.BibleLayout.addWidget(self.BibleRightWidget) | 134 | self.BibleLayout.addWidget(self.BibleRightWidget) |
768 | 135 | # Signals and slots | 135 | # Signals and slots |
769 | 136 | QtCore.QObject.connect(self.NewChaptersCheckBox, | 136 | QtCore.QObject.connect(self.NewChaptersCheckBox, |
771 | 137 | QtCore.SIGNAL("stateChanged(int)"), self.onNewChaptersCheckBoxChanged) | 137 | QtCore.SIGNAL(u'stateChanged(int)'), self.onNewChaptersCheckBoxChanged) |
772 | 138 | QtCore.QObject.connect(self.BibleSearchCheckBox, | 138 | QtCore.QObject.connect(self.BibleSearchCheckBox, |
774 | 139 | QtCore.SIGNAL("stateChanged(int)"), self.onBibleSearchCheckBoxChanged) | 139 | QtCore.SIGNAL(u'stateChanged(int)'), self.onBibleSearchCheckBoxChanged) |
775 | 140 | QtCore.QObject.connect(self.VerseRadioButton, | 140 | QtCore.QObject.connect(self.VerseRadioButton, |
777 | 141 | QtCore.SIGNAL("pressed()"), self.onVerseRadioButtonPressed) | 141 | QtCore.SIGNAL(u'pressed()'), self.onVerseRadioButtonPressed) |
778 | 142 | QtCore.QObject.connect(self.ParagraphRadioButton, | 142 | QtCore.QObject.connect(self.ParagraphRadioButton, |
780 | 143 | QtCore.SIGNAL("pressed()"), self.onParagraphRadioButtonPressed) | 143 | QtCore.SIGNAL(u'pressed()'), self.onParagraphRadioButtonPressed) |
781 | 144 | QtCore.QObject.connect(self.DisplayStyleComboBox, | 144 | QtCore.QObject.connect(self.DisplayStyleComboBox, |
783 | 145 | QtCore.SIGNAL("activated(int)"), self.onDisplayStyleComboBoxChanged) | 145 | QtCore.SIGNAL(u'activated(int)'), self.onDisplayStyleComboBoxChanged) |
784 | 146 | QtCore.QObject.connect(self.BibleThemeComboBox, | 146 | QtCore.QObject.connect(self.BibleThemeComboBox, |
786 | 147 | QtCore.SIGNAL("activated(int)"), self.onBibleThemeComboBoxChanged) | 147 | QtCore.SIGNAL(u'activated(int)'), self.onBibleThemeComboBoxChanged) |
787 | 148 | 148 | ||
788 | 149 | def retranslateUi(self): | 149 | def retranslateUi(self): |
802 | 150 | self.VerseDisplayGroupBox.setTitle(translate('SettingsForm', 'Verse Display')) | 150 | self.VerseDisplayGroupBox.setTitle(translate(u'SettingsForm', u'Verse Display')) |
803 | 151 | self.VerseRadioButton.setText(translate('SettingsForm', 'Verse style')) | 151 | self.VerseRadioButton.setText(translate(u'SettingsForm', u'Verse style')) |
804 | 152 | self.ParagraphRadioButton.setText(translate('SettingsForm','Paragraph style')) | 152 | self.ParagraphRadioButton.setText(translate(u'SettingsForm', u'Paragraph style')) |
805 | 153 | self.NewChaptersCheckBox.setText(translate('SettingsForm', 'Only show new chapter numbers')) | 153 | self.NewChaptersCheckBox.setText(translate(u'SettingsForm', u'Only show new chapter numbers')) |
806 | 154 | self.DisplayStyleLabel.setText(translate('SettingsForm', 'Display Style:')) | 154 | self.DisplayStyleLabel.setText(translate(u'SettingsForm', u'Display Style:')) |
807 | 155 | self.BibleThemeLabel.setText(translate('SettingsForm', 'Bible Theme:')) | 155 | self.BibleThemeLabel.setText(translate(u'SettingsForm', u'Bible Theme:')) |
808 | 156 | self.DisplayStyleComboBox.setItemText(0, translate('SettingsForm', 'No brackets')) | 156 | self.DisplayStyleComboBox.setItemText(0, translate(u'SettingsForm', u'No brackets')) |
809 | 157 | self.DisplayStyleComboBox.setItemText(1, translate('SettingsForm', '( and )')) | 157 | self.DisplayStyleComboBox.setItemText(1, translate(u'SettingsForm', u'( and )')) |
810 | 158 | self.DisplayStyleComboBox.setItemText(2, translate('SettingsForm', '{ and }')) | 158 | self.DisplayStyleComboBox.setItemText(2, translate(u'SettingsForm', u'{ and }')) |
811 | 159 | self.DisplayStyleComboBox.setItemText(3, translate('SettingsForm', '[ and ]')) | 159 | self.DisplayStyleComboBox.setItemText(3, translate(u'SettingsForm', u'[ and ]')) |
812 | 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')) |
813 | 161 | self.BibleSearchGroupBox.setTitle(translate('SettingsForm', 'Search')) | 161 | self.BibleSearchGroupBox.setTitle(translate(u'SettingsForm', u'Search')) |
814 | 162 | self.BibleSearchCheckBox.setText(translate('SettingsForm', 'Search-as-you-type')) | 162 | self.BibleSearchCheckBox.setText(translate(u'SettingsForm', u'Search-as-you-type')) |
815 | 163 | 163 | ||
816 | 164 | def onBibleThemeComboBoxChanged(self): | 164 | def onBibleThemeComboBoxChanged(self): |
817 | 165 | self.bible_theme = self.BibleThemeComboBox.currentText() | 165 | self.bible_theme = self.BibleThemeComboBox.currentText() |
818 | @@ -187,7 +187,7 @@ | |||
819 | 187 | 187 | ||
820 | 188 | def load(self): | 188 | def load(self): |
821 | 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')) |
823 | 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')) |
824 | 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')) |
825 | 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') |
826 | 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')) |
827 | @@ -216,6 +216,7 @@ | |||
828 | 216 | self.BibleThemeComboBox.addItem(theme) | 216 | self.BibleThemeComboBox.addItem(theme) |
829 | 217 | id = self.BibleThemeComboBox.findText(str(self.bible_theme), QtCore.Qt.MatchExactly) | 217 | id = self.BibleThemeComboBox.findText(str(self.bible_theme), QtCore.Qt.MatchExactly) |
830 | 218 | if id == -1: | 218 | if id == -1: |
832 | 219 | id = 0 # Not Found | 219 | # Not Found |
833 | 220 | id = 0 | ||
834 | 220 | self.bible_theme = u'' | 221 | self.bible_theme = u'' |
835 | 221 | self.BibleThemeComboBox.setCurrentIndex(id) | 222 | self.BibleThemeComboBox.setCurrentIndex(id) |
836 | 222 | 223 | ||
837 | === modified file 'openlp/plugins/custom/lib/customtab.py' | |||
838 | --- openlp/plugins/custom/lib/customtab.py 2009-05-21 16:07:01 +0000 | |||
839 | +++ openlp/plugins/custom/lib/customtab.py 2009-06-05 18:53:50 +0000 | |||
840 | @@ -27,7 +27,7 @@ | |||
841 | 27 | SongsTab is the songs settings tab in the settings dialog. | 27 | SongsTab is the songs settings tab in the settings dialog. |
842 | 28 | """ | 28 | """ |
843 | 29 | def __init__(self): | 29 | def __init__(self): |
845 | 30 | SettingsTab.__init__(self, u'Custom') | 30 | SettingsTab.__init__(self, translate(u'CustomTab', u'Custom'), u'Custom') |
846 | 31 | 31 | ||
847 | 32 | def setupUi(self): | 32 | def setupUi(self): |
848 | 33 | self.setObjectName(u'CustomTab') | 33 | self.setObjectName(u'CustomTab') |
849 | 34 | 34 | ||
850 | === modified file 'openlp/plugins/media/lib/mediatab.py' | |||
851 | --- openlp/plugins/media/lib/mediatab.py 2009-05-21 05:15:51 +0000 | |||
852 | +++ openlp/plugins/media/lib/mediatab.py 2009-06-05 18:53:50 +0000 | |||
853 | @@ -27,40 +27,38 @@ | |||
854 | 27 | mediaTab is the media settings tab in the settings dialog. | 27 | mediaTab is the media settings tab in the settings dialog. |
855 | 28 | """ | 28 | """ |
856 | 29 | def __init__(self): | 29 | def __init__(self): |
858 | 30 | SettingsTab.__init__(self, u'Media') | 30 | SettingsTab.__init__(self, translate(u'MediaTab', u'Media'), u'Media') |
859 | 31 | 31 | ||
860 | 32 | def setupUi(self): | 32 | def setupUi(self): |
861 | 33 | self.setObjectName(u'MediaTab') | 33 | self.setObjectName(u'MediaTab') |
862 | 34 | |||
863 | 35 | self.MediaLayout = QtGui.QFormLayout(self) | 34 | self.MediaLayout = QtGui.QFormLayout(self) |
866 | 36 | self.MediaLayout.setObjectName("MediaLayout") | 35 | self.MediaLayout.setObjectName(u'MediaLayout') |
865 | 37 | |||
867 | 38 | self.MediaModeGroupBox = QtGui.QGroupBox(self) | 36 | self.MediaModeGroupBox = QtGui.QGroupBox(self) |
869 | 39 | self.MediaModeGroupBox.setObjectName("MediaModeGroupBox") | 37 | self.MediaModeGroupBox.setObjectName(u'MediaModeGroupBox') |
870 | 40 | self.MediaModeLayout = QtGui.QVBoxLayout(self.MediaModeGroupBox) | 38 | self.MediaModeLayout = QtGui.QVBoxLayout(self.MediaModeGroupBox) |
871 | 41 | self.MediaModeLayout.setSpacing(8) | 39 | self.MediaModeLayout.setSpacing(8) |
872 | 42 | self.MediaModeLayout.setMargin(8) | 40 | self.MediaModeLayout.setMargin(8) |
874 | 43 | self.MediaModeLayout.setObjectName("MediaModeLayout") | 41 | self.MediaModeLayout.setObjectName(u'MediaModeLayout') |
875 | 44 | self.UseVMRCheckBox = QtGui.QCheckBox(self.MediaModeGroupBox) | 42 | self.UseVMRCheckBox = QtGui.QCheckBox(self.MediaModeGroupBox) |
877 | 45 | self.UseVMRCheckBox.setObjectName("UseVMRCheckBox") | 43 | self.UseVMRCheckBox.setObjectName(u'UseVMRCheckBox') |
878 | 46 | self.MediaModeLayout.addWidget(self.UseVMRCheckBox) | 44 | self.MediaModeLayout.addWidget(self.UseVMRCheckBox) |
879 | 47 | self.UseVMRLabel = QtGui.QLabel(self.MediaModeGroupBox) | 45 | self.UseVMRLabel = QtGui.QLabel(self.MediaModeGroupBox) |
881 | 48 | self.UseVMRLabel.setObjectName("UseVMRLabel") | 46 | self.UseVMRLabel.setObjectName(u'UseVMRLabel') |
882 | 49 | self.MediaModeLayout.addWidget(self.UseVMRLabel) | 47 | self.MediaModeLayout.addWidget(self.UseVMRLabel) |
883 | 50 | 48 | ||
884 | 51 | self.MediaLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.MediaModeGroupBox) | 49 | self.MediaLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.MediaModeGroupBox) |
885 | 52 | # Signals and slots | 50 | # Signals and slots |
886 | 53 | QtCore.QObject.connect(self.UseVMRCheckBox, | 51 | QtCore.QObject.connect(self.UseVMRCheckBox, |
888 | 54 | QtCore.SIGNAL("stateChanged(int)"), self.onVMRCheckBoxChanged) | 52 | QtCore.SIGNAL(u'stateChanged(int)'), self.onVMRCheckBoxChanged) |
889 | 55 | 53 | ||
890 | 56 | def retranslateUi(self): | 54 | def retranslateUi(self): |
898 | 57 | self.MediaModeGroupBox.setTitle(translate("SettingsForm", "Media Mode")) | 55 | self.MediaModeGroupBox.setTitle(translate(u'MediaTab', u'Media Mode')) |
899 | 58 | self.UseVMRCheckBox.setText(translate("SettingsForm", "Use Video Mode Rendering")) | 56 | self.UseVMRCheckBox.setText(translate(u'MediaTab', u'Use Video Mode Rendering')) |
900 | 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' |
901 | 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' |
902 | 61 | "p, li { white-space: pre-wrap; }\n" | 59 | u'p, li { white-space: pre-wrap; }\n' |
903 | 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' |
904 | 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>')) |
905 | 64 | 62 | ||
906 | 65 | def onVMRCheckBoxChanged(self): | 63 | def onVMRCheckBoxChanged(self): |
907 | 66 | use_vmr_mode = self.UseVMRCheckBox.checkState() | 64 | use_vmr_mode = self.UseVMRCheckBox.checkState() |
908 | 67 | 65 | ||
909 | === modified file 'openlp/plugins/presentations/lib/presentationtab.py' | |||
910 | --- openlp/plugins/presentations/lib/presentationtab.py 2009-06-01 18:37:06 +0000 | |||
911 | +++ openlp/plugins/presentations/lib/presentationtab.py 2009-06-05 18:53:50 +0000 | |||
912 | @@ -24,23 +24,23 @@ | |||
913 | 24 | 24 | ||
914 | 25 | class PresentationTab(SettingsTab): | 25 | class PresentationTab(SettingsTab): |
915 | 26 | """ | 26 | """ |
917 | 27 | BiblesTab is the Bibles settings tab in the settings dialog. | 27 | PresentationsTab is the Presentations settings tab in the settings dialog. |
918 | 28 | """ | 28 | """ |
919 | 29 | def __init__(self): | 29 | def __init__(self): |
921 | 30 | SettingsTab.__init__(self, u'Presentation') | 30 | SettingsTab.__init__(self, translate(u'PresentationTab', u'Presentation'), u'Presentation') |
922 | 31 | 31 | ||
923 | 32 | def setupUi(self): | 32 | def setupUi(self): |
935 | 33 | self.setObjectName(u'BiblesTab') | 33 | self.setObjectName(u'PresentationTab') |
936 | 34 | self.BibleLayout = QtGui.QHBoxLayout(self) | 34 | self.PresentationLayout = QtGui.QHBoxLayout(self) |
937 | 35 | self.BibleLayout.setSpacing(8) | 35 | self.PresentationLayout.setSpacing(8) |
938 | 36 | self.BibleLayout.setMargin(8) | 36 | self.PresentationLayout.setMargin(8) |
939 | 37 | self.BibleLayout.setObjectName(u'BibleLayout') | 37 | self.PresentationLayout.setObjectName(u'PresentationLayout') |
940 | 38 | self.BibleLeftWidget = QtGui.QWidget(self) | 38 | self.PresentationLeftWidget = QtGui.QWidget(self) |
941 | 39 | self.BibleLeftWidget.setObjectName(u'BibleLeftWidget') | 39 | self.PresentationLeftWidget.setObjectName(u'PresentationLeftWidget') |
942 | 40 | self.BibleLeftLayout = QtGui.QVBoxLayout(self.BibleLeftWidget) | 40 | self.PresentationLeftLayout = QtGui.QVBoxLayout(self.PresentationLeftWidget) |
943 | 41 | self.BibleLeftLayout.setObjectName(u'BibleLeftLayout') | 41 | self.PresentationLeftLayout.setObjectName(u'PresentationLeftLayout') |
944 | 42 | self.BibleLeftLayout.setSpacing(8) | 42 | self.PresentationLeftLayout.setSpacing(8) |
945 | 43 | self.BibleLeftLayout.setMargin(0) | 43 | self.PresentationLeftLayout.setMargin(0) |
946 | 44 | 44 | ||
947 | 45 | self.VerseDisplayGroupBox = QtGui.QGroupBox(self) | 45 | self.VerseDisplayGroupBox = QtGui.QGroupBox(self) |
948 | 46 | self.VerseDisplayGroupBox.setObjectName(u'VerseDisplayGroupBox') | 46 | self.VerseDisplayGroupBox.setObjectName(u'VerseDisplayGroupBox') |
949 | @@ -70,29 +70,29 @@ | |||
950 | 70 | self.ImpressPath.setObjectName("ImpressPath") | 70 | self.ImpressPath.setObjectName("ImpressPath") |
951 | 71 | self.VerseDisplayLayout.addWidget(self.ImpressPath, 3, 0, 1, 1) | 71 | self.VerseDisplayLayout.addWidget(self.ImpressPath, 3, 0, 1, 1) |
952 | 72 | 72 | ||
976 | 73 | self.BibleThemeWidget = QtGui.QWidget(self.VerseDisplayGroupBox) | 73 | self.PresentationThemeWidget = QtGui.QWidget(self.VerseDisplayGroupBox) |
977 | 74 | self.BibleThemeWidget.setObjectName(u'BibleThemeWidget') | 74 | self.PresentationThemeWidget.setObjectName(u'PresentationThemeWidget') |
978 | 75 | self.BibleThemeLayout = QtGui.QHBoxLayout(self.BibleThemeWidget) | 75 | self.PresentationThemeLayout = QtGui.QHBoxLayout(self.PresentationThemeWidget) |
979 | 76 | self.BibleThemeLayout.setSpacing(8) | 76 | self.PresentationThemeLayout.setSpacing(8) |
980 | 77 | self.BibleThemeLayout.setMargin(0) | 77 | self.PresentationThemeLayout.setMargin(0) |
981 | 78 | self.BibleThemeLayout.setObjectName(u'BibleThemeLayout') | 78 | self.PresentationThemeLayout.setObjectName(u'PresentationThemeLayout') |
982 | 79 | 79 | ||
983 | 80 | self.BibleLeftLayout.addWidget(self.VerseDisplayGroupBox) | 80 | self.PresentationLeftLayout.addWidget(self.VerseDisplayGroupBox) |
984 | 81 | self.BibleLeftSpacer = QtGui.QSpacerItem(40, 20, | 81 | self.PresentationLeftSpacer = QtGui.QSpacerItem(40, 20, |
985 | 82 | QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) | 82 | QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) |
986 | 83 | self.BibleLeftLayout.addItem(self.BibleLeftSpacer) | 83 | self.PresentationLeftLayout.addItem(self.PresentationLeftSpacer) |
987 | 84 | self.BibleLayout.addWidget(self.BibleLeftWidget) | 84 | self.PresentationLayout.addWidget(self.PresentationLeftWidget) |
988 | 85 | 85 | ||
989 | 86 | self.BibleRightWidget = QtGui.QWidget(self) | 86 | self.PresentationRightWidget = QtGui.QWidget(self) |
990 | 87 | self.BibleRightWidget.setObjectName(u'BibleRightWidget') | 87 | self.PresentationRightWidget.setObjectName(u'PresentationRightWidget') |
991 | 88 | self.BibleRightLayout = QtGui.QVBoxLayout(self.BibleRightWidget) | 88 | self.PresentationRightLayout = QtGui.QVBoxLayout(self.PresentationRightWidget) |
992 | 89 | self.BibleRightLayout.setObjectName(u'BibleRightLayout') | 89 | self.PresentationRightLayout.setObjectName(u'PresentationRightLayout') |
993 | 90 | self.BibleRightLayout.setSpacing(8) | 90 | self.PresentationRightLayout.setSpacing(8) |
994 | 91 | self.BibleRightLayout.setMargin(0) | 91 | self.PresentationRightLayout.setMargin(0) |
995 | 92 | self.BibleRightSpacer = QtGui.QSpacerItem(50, 20, | 92 | self.PresentationRightSpacer = QtGui.QSpacerItem(50, 20, |
996 | 93 | QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) | 93 | QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) |
997 | 94 | self.BibleRightLayout.addItem(self.BibleRightSpacer) | 94 | self.PresentationRightLayout.addItem(self.PresentationRightSpacer) |
998 | 95 | self.BibleLayout.addWidget(self.BibleRightWidget) | 95 | self.PresentationLayout.addWidget(self.PresentationRightWidget) |
999 | 96 | 96 | ||
1000 | 97 | # Signals and slots | 97 | # Signals and slots |
1001 | 98 | #QtCore.QObject.connect(self.NewChaptersCheckBox, | 98 | #QtCore.QObject.connect(self.NewChaptersCheckBox, |
1002 | @@ -116,20 +116,20 @@ | |||
1003 | 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')) |
1004 | 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")) |
1005 | 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')) |
1008 | 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')) |
1009 | 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')) |
1010 | 121 | # if self.paragraph_style: | 121 | # if self.paragraph_style: |
1011 | 122 | # self.ParagraphRadioButton.setChecked(True) | 122 | # self.ParagraphRadioButton.setChecked(True) |
1012 | 123 | # else: | 123 | # else: |
1013 | 124 | # self.VerseRadioButton.setChecked(True) | 124 | # self.VerseRadioButton.setChecked(True) |
1014 | 125 | # self.NewChaptersCheckBox.setChecked(self.show_new_chapters) | 125 | # self.NewChaptersCheckBox.setChecked(self.show_new_chapters) |
1015 | 126 | # self.DisplayStyleComboBox.setCurrentIndex(self.display_style) | 126 | # self.DisplayStyleComboBox.setCurrentIndex(self.display_style) |
1017 | 127 | # self.BibleSearchCheckBox.setChecked(self.bible_search) | 127 | # self.PresentationSearchCheckBox.setChecked(self.Presentation_search) |
1018 | 128 | 128 | ||
1019 | 129 | def save(self): | 129 | def save(self): |
1020 | 130 | pass | 130 | pass |
1021 | 131 | # self.config.set_config(u'paragraph style', str(self.paragraph_style)) | 131 | # self.config.set_config(u'paragraph style', str(self.paragraph_style)) |
1022 | 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)) |
1023 | 133 | # self.config.set_config(u'display brackets', str(self.display_style)) | 133 | # self.config.set_config(u'display brackets', str(self.display_style)) |
1026 | 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)) |
1027 | 135 | # self.config.set_config(u'bible theme', str(self.bible_theme)) | 135 | # self.config.set_config(u'Presentation theme', str(self.Presentation_theme)) |
1028 | 136 | 136 | ||
1029 | === modified file 'openlp/plugins/songs/lib/songstab.py' | |||
1030 | --- openlp/plugins/songs/lib/songstab.py 2009-05-21 16:07:01 +0000 | |||
1031 | +++ openlp/plugins/songs/lib/songstab.py 2009-06-05 18:53:50 +0000 | |||
1032 | @@ -20,14 +20,14 @@ | |||
1033 | 20 | 20 | ||
1034 | 21 | from PyQt4 import QtCore, QtGui | 21 | from PyQt4 import QtCore, QtGui |
1035 | 22 | 22 | ||
1037 | 23 | from openlp.core.lib import SettingsTab, translate | 23 | from openlp.core.lib import SettingsTab, translate |
1038 | 24 | 24 | ||
1039 | 25 | class SongsTab(SettingsTab): | 25 | class SongsTab(SettingsTab): |
1040 | 26 | """ | 26 | """ |
1041 | 27 | SongsTab is the songs settings tab in the settings dialog. | 27 | SongsTab is the songs settings tab in the settings dialog. |
1042 | 28 | """ | 28 | """ |
1043 | 29 | def __init__(self): | 29 | def __init__(self): |
1045 | 30 | SettingsTab.__init__(self, u'Songs') | 30 | SettingsTab.__init__(self, translate(u'SongsTab', u'Songs'), u'Songs') |
1046 | 31 | 31 | ||
1047 | 32 | def setupUi(self): | 32 | def setupUi(self): |
1048 | 33 | self.setObjectName(u'SongsTab') | 33 | self.setObjectName(u'SongsTab') |
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.