Merge lp:~meths/openlp/trivialfixes into lp:openlp

Proposed by Jon Tibble
Status: Merged
Merged at revision: not available
Proposed branch: lp:~meths/openlp/trivialfixes
Merge into: lp:openlp
Diff against target: 159 lines
8 files modified
openlp/core/lib/__init__.py (+11/-1)
openlp/core/lib/baselistwithdnd.py (+0/-2)
openlp/core/lib/toolbar.py (+12/-0)
openlp/core/ui/alertform.py (+1/-1)
openlp/core/ui/amendthemedialog.py (+0/-2)
openlp/core/ui/plugindialoglistform.py (+4/-2)
openlp/core/ui/slidecontroller.py (+5/-5)
openlp/plugins/presentations/lib/presentationtab.py (+0/-1)
To merge this branch: bzr merge lp:~meths/openlp/trivialfixes
Reviewer Review Type Date Requested Status
Tim Bentley Approve
Review via email: mp+12765@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Jon Tibble (meths) wrote :

Fixes some dialogs parentage

Adds push button support to toolbars - fixing UI issue with screen black button

Adds exception handling to XML file loading

lp:~meths/openlp/trivialfixes updated
583. By Tim Bentley

Start of about Text

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

Looks ok to me

review: Approve
lp:~meths/openlp/trivialfixes updated
584. By Jon Tibble

Dialogs, Exceptions and Toolbars

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'openlp/core/lib/__init__.py'
2--- openlp/core/lib/__init__.py 2009-09-29 12:51:38 +0000
3+++ openlp/core/lib/__init__.py 2009-10-01 23:50:21 +0000
4@@ -54,7 +54,17 @@
5 ``xmlfile``
6 The name of the file.
7 """
8- return open(xmlfile).read()
9+ file = None
10+ xml = None
11+ try:
12+ file = open(xmlfile, u'r')
13+ xml = file.read()
14+ except IOError:
15+ log.exception(u'Failed to open XML file')
16+ finally:
17+ if file:
18+ file.close()
19+ return xml
20
21 def str_to_bool(stringvalue):
22 """
23
24=== modified file 'openlp/core/lib/baselistwithdnd.py'
25--- openlp/core/lib/baselistwithdnd.py 2009-09-29 12:51:38 +0000
26+++ openlp/core/lib/baselistwithdnd.py 2009-10-01 23:50:21 +0000
27@@ -24,8 +24,6 @@
28
29 from PyQt4 import QtCore, QtGui
30
31-from openlp.core.lib.toolbar import *
32-
33 class BaseListWithDnD(QtGui.QListWidget):
34 """
35 Please put a short description of what this class does in here.
36
37=== modified file 'openlp/core/lib/toolbar.py'
38--- openlp/core/lib/toolbar.py 2009-09-29 12:51:38 +0000
39+++ openlp/core/lib/toolbar.py 2009-10-01 23:50:21 +0000
40@@ -125,3 +125,15 @@
41 """
42 for widget in widgets:
43 self.actions[widget].setVisible(True)
44+
45+ def addPushButton(self, imageFile=None, text=u''):
46+ """
47+ Adds a push button to the toolbar.
48+
49+ Returns the push button
50+ """
51+ pushButton = QtGui.QPushButton(buildIcon(imageFile), text)
52+ pushButton.setCheckable(True)
53+ pushButton.setFlat(True)
54+ self.addWidget(pushButton)
55+ return pushButton
56\ No newline at end of file
57
58=== modified file 'openlp/core/ui/alertform.py'
59--- openlp/core/ui/alertform.py 2009-09-29 02:54:32 +0000
60+++ openlp/core/ui/alertform.py 2009-10-01 23:50:21 +0000
61@@ -31,7 +31,7 @@
62 log = logging.getLogger(u'AlertForm')
63
64 def __init__(self, parent=None):
65- QtGui.QDialog.__init__(self, None)
66+ QtGui.QDialog.__init__(self, parent)
67 self.parent = parent
68 self.setupUi(self)
69 log.debug(u'Defined')
70
71=== modified file 'openlp/core/ui/amendthemedialog.py'
72--- openlp/core/ui/amendthemedialog.py 2009-09-29 02:54:32 +0000
73+++ openlp/core/ui/amendthemedialog.py 2009-10-01 23:50:21 +0000
74@@ -120,8 +120,6 @@
75 self.ImageToolButton.setObjectName(u'ImageToolButton')
76 self.horizontalLayout_2.addWidget(self.ImageToolButton)
77 self.BackgroundLayout.setWidget(4, QtGui.QFormLayout.FieldRole, self.ImageFilenameWidget)
78- spacerItem = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
79- #self.BackgroundLayout.addItem(spacerItem, 7, 1, 1, 1)
80 self.ThemeTabWidget.addTab(self.BackgroundTab, u'')
81 self.FontMainTab = QtGui.QWidget()
82 self.FontMainTab.setObjectName(u'FontMainTab')
83
84=== modified file 'openlp/core/ui/plugindialoglistform.py'
85--- openlp/core/ui/plugindialoglistform.py 2009-09-21 17:56:36 +0000
86+++ openlp/core/ui/plugindialoglistform.py 2009-10-01 23:50:21 +0000
87@@ -9,14 +9,14 @@
88
89 import logging
90 from PyQt4 import QtCore, QtGui
91-from openlp.core.lib import translate, PluginStatus
92+from openlp.core.lib import translate, PluginStatus, buildIcon
93
94 class PluginForm(QtGui.QDialog):
95 global log
96 log = logging.getLogger(u'PluginForm')
97
98 def __init__(self, parent=None):
99- QtGui.QDialog.__init__(self, None)
100+ QtGui.QDialog.__init__(self, parent)
101 self.parent = parent
102 self.setupUi(self)
103 log.debug(u'Defined')
104@@ -24,6 +24,8 @@
105 def setupUi(self, PluginForm):
106 PluginForm.setObjectName(u'PluginForm')
107 PluginForm.resize(400, 393)
108+ icon = buildIcon(u':/icon/openlp-logo-16x16.png')
109+ PluginForm.setWindowIcon(icon)
110 self.PluginViewList = QtGui.QTableWidget(PluginForm)
111 self.PluginViewList.setGeometry(QtCore.QRect(20, 10, 371, 331))
112 self.PluginViewList.setObjectName(u'PluginViewList')
113
114=== modified file 'openlp/core/ui/slidecontroller.py'
115--- openlp/core/ui/slidecontroller.py 2009-09-25 23:06:54 +0000
116+++ openlp/core/ui/slidecontroller.py 2009-10-01 23:50:21 +0000
117@@ -131,10 +131,8 @@
118 self.onSlideSelectedLast)
119 if self.isLive:
120 self.Toolbar.addToolbarSeparator(u'Close Separator')
121- self.Toolbar.addToolbarButton(u'Close Screen',
122- u':/slides/slide_close.png',
123- translate(u'SlideController', u'Close Screen'),
124- self.onBlankScreen)
125+ self.blackPushButton = self.Toolbar.addPushButton(
126+ u':/slides/slide_close.png')
127 if not self.isLive:
128 self.Toolbar.addToolbarSeparator(u'Close Separator')
129 self.Toolbar.addToolbarButton(u'Go Live',
130@@ -190,6 +188,8 @@
131 QtCore.QObject.connect(self.PreviewListWidget,
132 QtCore.SIGNAL(u'activated(QModelIndex)'), self.onSlideSelected)
133 if isLive:
134+ QtCore.QObject.connect(self.blackPushButton,
135+ QtCore.SIGNAL(u'toggled(bool)'), self.onBlankScreen)
136 QtCore.QObject.connect(Receiver.get_receiver(),
137 QtCore.SIGNAL(u'update_spin_delay'), self.receiveSpinDelay)
138 Receiver().send_message(u'request_spin_delay')
139@@ -337,7 +337,7 @@
140 """
141 row = self.PreviewListWidget.currentRow()
142 if row > -1 and row < self.PreviewListWidget.rowCount():
143- label = self.PreviewListWidget.cellWidget(row, 0)
144+ #label = self.PreviewListWidget.cellWidget(row, 0)
145 frame = self.serviceitem.frames[row][u'image']
146 before = time.time()
147 if frame is None:
148
149=== modified file 'openlp/plugins/presentations/lib/presentationtab.py'
150--- openlp/plugins/presentations/lib/presentationtab.py 2009-09-30 19:26:51 +0000
151+++ openlp/plugins/presentations/lib/presentationtab.py 2009-10-01 23:50:21 +0000
152@@ -22,7 +22,6 @@
153 # Temple Place, Suite 330, Boston, MA 02111-1307 USA #
154 ###############################################################################
155
156-import os
157 from PyQt4 import QtGui
158
159 from openlp.core.lib import SettingsTab, translate