Merge lp:~trb143/openlp/audit into lp:openlp

Proposed by Tim Bentley
Status: Merged
Merged at revision: not available
Proposed branch: lp:~trb143/openlp/audit
Merge into: lp:openlp
Diff against target: 194 lines
2 files modified
openlp/core/ui/plugindialoglistform.py (+33/-20)
resources/forms/plugindialoglistform.ui (+47/-3)
To merge this branch: bzr merge lp:~trb143/openlp/audit
Reviewer Review Type Date Requested Status
Jon Tibble (community) Approve
Review via email: mp+12787@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Tim Bentley (trb143) wrote :

Clean up the UI for PluginList

Revision history for this message
Jon Tibble (meths) wrote :

Looks good

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'openlp/core/ui/plugindialoglistform.py'
2--- openlp/core/ui/plugindialoglistform.py 2009-10-02 11:50:57 +0000
3+++ openlp/core/ui/plugindialoglistform.py 2009-10-02 14:25:22 +0000
4@@ -23,11 +23,11 @@
5
6 def setupUi(self, PluginForm):
7 PluginForm.setObjectName(u'PluginForm')
8- PluginForm.resize(400, 393)
9+ PluginForm.resize(400, 568)
10 icon = buildIcon(u':/icon/openlp-logo-16x16.png')
11 PluginForm.setWindowIcon(icon)
12 self.PluginViewList = QtGui.QTableWidget(PluginForm)
13- self.PluginViewList.setGeometry(QtCore.QRect(20, 10, 371, 331))
14+ self.PluginViewList.setGeometry(QtCore.QRect(20, 10, 371, 261))
15 self.PluginViewList.setObjectName(u'PluginViewList')
16 self.PluginViewList.setShowGrid(False)
17 self.PluginViewList.setGridStyle(QtCore.Qt.SolidLine)
18@@ -40,21 +40,34 @@
19 item = QtGui.QTableWidgetItem()
20 self.PluginViewList.setHorizontalHeaderItem(2, item)
21 self.PluginViewList.horizontalHeader().setVisible(True)
22+ self.PluginViewList.horizontalHeader().setStretchLastSection(True)
23 self.PluginViewList.verticalHeader().setVisible(False)
24 self.ButtonBox = QtGui.QDialogButtonBox(PluginForm)
25- self.ButtonBox.setGeometry(QtCore.QRect(220, 350, 170, 25))
26+ self.ButtonBox.setGeometry(QtCore.QRect(220, 530, 170, 25))
27 self.ButtonBox.setStandardButtons(QtGui.QDialogButtonBox.Ok)
28 self.ButtonBox.setObjectName(u'ButtonBox')
29+ self.PluginInfoGroupBox = QtGui.QGroupBox(PluginForm)
30+ self.PluginInfoGroupBox.setGeometry(QtCore.QRect(20, 270, 371, 241))
31+ self.PluginInfoGroupBox.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
32+ self.PluginInfoGroupBox.setFlat(False)
33+ self.PluginInfoGroupBox.setObjectName("PluginInfoGroupBox")
34+ self.AboutTextLabel = QtGui.QLabel(self.PluginInfoGroupBox)
35+ self.AboutTextLabel.setGeometry(QtCore.QRect(10, 30, 351, 191))
36+ self.AboutTextLabel.setAlignment(QtCore.Qt.AlignLeft|QtCore.Qt.AlignTop)
37+ self.AboutTextLabel.setWordWrap(True)
38+ self.AboutTextLabel.setObjectName("AboutTextLabel")
39+
40
41 self.retranslateUi(PluginForm)
42 QtCore.QObject.connect(self.ButtonBox,
43 QtCore.SIGNAL(u'accepted()'), PluginForm.close)
44 QtCore.QMetaObject.connectSlotsByName(PluginForm)
45 QtCore.QObject.connect(self.PluginViewList,
46- QtCore.SIGNAL(u'itemDoubleClicked(QTableWidgetItem*)'), self.displayAbout)
47+ QtCore.SIGNAL(u'itemClicked(QTableWidgetItem*)'), self.displayAbout)
48
49 def retranslateUi(self, PluginForm):
50 PluginForm.setWindowTitle(translate(u'PluginForm', u'Plugin list'))
51+ self.PluginInfoGroupBox.setTitle(translate("PluginForm", "Selected Plugin Information"))
52 self.PluginViewList.horizontalHeaderItem(0).setText(
53 translate(u'PluginForm', u'Name'))
54 self.PluginViewList.horizontalHeaderItem(1).setText(
55@@ -76,18 +89,22 @@
56 item2 = QtGui.QTableWidgetItem(plugin.version)
57 item2.setTextAlignment(QtCore.Qt.AlignVCenter)
58 item2.setFlags(QtCore.Qt.ItemIsSelectable)
59- if plugin.status == PluginStatus.Active:
60- item3 = QtGui.QTableWidgetItem(
61- translate(u'PluginForm', u'Active'))
62- else:
63- item3 = QtGui.QTableWidgetItem(
64- translate(u'PluginForm', u'Inactive'))
65- item3.setTextAlignment(QtCore.Qt.AlignVCenter)
66- item3.setFlags(QtCore.Qt.ItemIsSelectable)
67 self.PluginViewList.setItem(row, 0, item1)
68 self.PluginViewList.setItem(row, 1, item2)
69- self.PluginViewList.setItem(row, 2, item3)
70- self.PluginViewList.setRowHeight(row, 15)
71+ if plugin.can_be_disabled():
72+ combo = QtGui.QComboBox()
73+ self.PluginViewList.setCellWidget(row, 2, combo)
74+ combo.addItem(translate(u'PluginForm', u'Active'))
75+ combo.addItem(translate(u'PluginForm', u'Inactive'))
76+# if plugin.status == PluginStatus.Active:
77+ self.PluginViewList.setRowHeight(row, 25)
78+ else:
79+ item3 = QtGui.QTableWidgetItem(
80+ translate(u'PluginForm', u'Active'))
81+ item3.setTextAlignment(QtCore.Qt.AlignVCenter)
82+ item3.setFlags(QtCore.Qt.ItemIsSelectable)
83+ self.PluginViewList.setItem(row, 2, item3)
84+ self.PluginViewList.setRowHeight(row, 15)
85
86 def displayAbout(self, item):
87 if item is None:
88@@ -95,9 +112,5 @@
89 row = self.PluginViewList.row(item)
90 text = self.parent.plugin_manager.plugins[row].about()
91 if text is not None:
92- ret = QtGui.QMessageBox.information(self,
93- translate(u'PluginList', u'Plugin Information'),
94- translate(u'PluginList', text),
95- QtGui.QMessageBox.StandardButtons(
96- QtGui.QMessageBox.Ok),
97- QtGui.QMessageBox.Ok)
98+ self.AboutTextLabel.setText(translate(u'PluginList', text))
99+
100
101=== modified file 'resources/forms/plugindialoglistform.ui'
102--- resources/forms/plugindialoglistform.ui 2009-08-13 20:02:38 +0000
103+++ resources/forms/plugindialoglistform.ui 2009-10-02 14:25:22 +0000
104@@ -7,7 +7,7 @@
105 <x>0</x>
106 <y>0</y>
107 <width>400</width>
108- <height>393</height>
109+ <height>568</height>
110 </rect>
111 </property>
112 <property name="windowTitle">
113@@ -19,7 +19,7 @@
114 <x>20</x>
115 <y>10</y>
116 <width>371</width>
117- <height>331</height>
118+ <height>261</height>
119 </rect>
120 </property>
121 <property name="showGrid">
122@@ -34,12 +34,24 @@
123 <attribute name="horizontalHeaderVisible">
124 <bool>true</bool>
125 </attribute>
126+ <attribute name="horizontalHeaderCascadingSectionResizes">
127+ <bool>false</bool>
128+ </attribute>
129 <attribute name="horizontalHeaderShowSortIndicator" stdset="0">
130 <bool>true</bool>
131 </attribute>
132+ <attribute name="horizontalHeaderStretchLastSection">
133+ <bool>true</bool>
134+ </attribute>
135 <attribute name="verticalHeaderVisible">
136 <bool>false</bool>
137 </attribute>
138+ <attribute name="horizontalHeaderStretchLastSection">
139+ <bool>true</bool>
140+ </attribute>
141+ <attribute name="horizontalHeaderCascadingSectionResizes">
142+ <bool>false</bool>
143+ </attribute>
144 <row/>
145 <column>
146 <property name="text">
147@@ -76,7 +88,7 @@
148 <property name="geometry">
149 <rect>
150 <x>220</x>
151- <y>350</y>
152+ <y>530</y>
153 <width>170</width>
154 <height>25</height>
155 </rect>
156@@ -85,6 +97,38 @@
157 <set>QDialogButtonBox::Ok</set>
158 </property>
159 </widget>
160+ <widget class="QGroupBox" name="PluginInfoGroupBox">
161+ <property name="geometry">
162+ <rect>
163+ <x>20</x>
164+ <y>270</y>
165+ <width>371</width>
166+ <height>241</height>
167+ </rect>
168+ </property>
169+ <property name="title">
170+ <string>GroupBox</string>
171+ </property>
172+ <property name="alignment">
173+ <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
174+ </property>
175+ <property name="flat">
176+ <bool>false</bool>
177+ </property>
178+ <widget class="QLabel" name="AboutTextLabel">
179+ <property name="geometry">
180+ <rect>
181+ <x>10</x>
182+ <y>30</y>
183+ <width>351</width>
184+ <height>191</height>
185+ </rect>
186+ </property>
187+ <property name="text">
188+ <string>TextLabel</string>
189+ </property>
190+ </widget>
191+ </widget>
192 </widget>
193 <resources/>
194 <connections>