← Back to team overview

openlp-core team mailing list archive

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

 

Tim Bentley has proposed merging lp:~trb143/openlp/audit into lp:openlp.

    Requested reviews:
    OpenLP Core (openlp-core)


Clean up the UI for PluginList
-- 
https://code.launchpad.net/~trb143/openlp/audit/+merge/12787
Your team OpenLP Core is subscribed to branch lp:openlp.
=== modified file 'openlp/core/ui/plugindialoglistform.py'
--- openlp/core/ui/plugindialoglistform.py	2009-10-02 11:50:57 +0000
+++ openlp/core/ui/plugindialoglistform.py	2009-10-02 14:25:22 +0000
@@ -23,11 +23,11 @@
 
     def setupUi(self, PluginForm):
         PluginForm.setObjectName(u'PluginForm')
-        PluginForm.resize(400, 393)
+        PluginForm.resize(400, 568)
         icon = buildIcon(u':/icon/openlp-logo-16x16.png')
         PluginForm.setWindowIcon(icon)
         self.PluginViewList = QtGui.QTableWidget(PluginForm)
-        self.PluginViewList.setGeometry(QtCore.QRect(20, 10, 371, 331))
+        self.PluginViewList.setGeometry(QtCore.QRect(20, 10, 371, 261))
         self.PluginViewList.setObjectName(u'PluginViewList')
         self.PluginViewList.setShowGrid(False)
         self.PluginViewList.setGridStyle(QtCore.Qt.SolidLine)
@@ -40,21 +40,34 @@
         item = QtGui.QTableWidgetItem()
         self.PluginViewList.setHorizontalHeaderItem(2, item)
         self.PluginViewList.horizontalHeader().setVisible(True)
+        self.PluginViewList.horizontalHeader().setStretchLastSection(True)
         self.PluginViewList.verticalHeader().setVisible(False)
         self.ButtonBox = QtGui.QDialogButtonBox(PluginForm)
-        self.ButtonBox.setGeometry(QtCore.QRect(220, 350, 170, 25))
+        self.ButtonBox.setGeometry(QtCore.QRect(220, 530, 170, 25))
         self.ButtonBox.setStandardButtons(QtGui.QDialogButtonBox.Ok)
         self.ButtonBox.setObjectName(u'ButtonBox')
+        self.PluginInfoGroupBox = QtGui.QGroupBox(PluginForm)
+        self.PluginInfoGroupBox.setGeometry(QtCore.QRect(20, 270, 371, 241))
+        self.PluginInfoGroupBox.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
+        self.PluginInfoGroupBox.setFlat(False)
+        self.PluginInfoGroupBox.setObjectName("PluginInfoGroupBox")
+        self.AboutTextLabel = QtGui.QLabel(self.PluginInfoGroupBox)
+        self.AboutTextLabel.setGeometry(QtCore.QRect(10, 30, 351, 191))
+        self.AboutTextLabel.setAlignment(QtCore.Qt.AlignLeft|QtCore.Qt.AlignTop)
+        self.AboutTextLabel.setWordWrap(True)
+        self.AboutTextLabel.setObjectName("AboutTextLabel")
+
 
         self.retranslateUi(PluginForm)
         QtCore.QObject.connect(self.ButtonBox,
             QtCore.SIGNAL(u'accepted()'), PluginForm.close)
         QtCore.QMetaObject.connectSlotsByName(PluginForm)
         QtCore.QObject.connect(self.PluginViewList,
-           QtCore.SIGNAL(u'itemDoubleClicked(QTableWidgetItem*)'), self.displayAbout)
+           QtCore.SIGNAL(u'itemClicked(QTableWidgetItem*)'), self.displayAbout)
 
     def retranslateUi(self, PluginForm):
         PluginForm.setWindowTitle(translate(u'PluginForm', u'Plugin list'))
+        self.PluginInfoGroupBox.setTitle(translate("PluginForm", "Selected Plugin Information"))
         self.PluginViewList.horizontalHeaderItem(0).setText(
             translate(u'PluginForm', u'Name'))
         self.PluginViewList.horizontalHeaderItem(1).setText(
@@ -76,18 +89,22 @@
             item2 = QtGui.QTableWidgetItem(plugin.version)
             item2.setTextAlignment(QtCore.Qt.AlignVCenter)
             item2.setFlags(QtCore.Qt.ItemIsSelectable)
-            if plugin.status == PluginStatus.Active:
-                item3 = QtGui.QTableWidgetItem(
-                    translate(u'PluginForm', u'Active'))
-            else:
-                item3 = QtGui.QTableWidgetItem(
-                    translate(u'PluginForm', u'Inactive'))
-            item3.setTextAlignment(QtCore.Qt.AlignVCenter)
-            item3.setFlags(QtCore.Qt.ItemIsSelectable)
             self.PluginViewList.setItem(row, 0, item1)
             self.PluginViewList.setItem(row, 1, item2)
-            self.PluginViewList.setItem(row, 2, item3)
-            self.PluginViewList.setRowHeight(row, 15)
+            if plugin.can_be_disabled():
+                combo = QtGui.QComboBox()
+                self.PluginViewList.setCellWidget(row, 2, combo)
+                combo.addItem(translate(u'PluginForm', u'Active'))
+                combo.addItem(translate(u'PluginForm', u'Inactive'))
+#                if plugin.status == PluginStatus.Active:
+                self.PluginViewList.setRowHeight(row, 25)
+            else:
+                item3 = QtGui.QTableWidgetItem(
+                    translate(u'PluginForm', u'Active'))
+                item3.setTextAlignment(QtCore.Qt.AlignVCenter)
+                item3.setFlags(QtCore.Qt.ItemIsSelectable)
+                self.PluginViewList.setItem(row, 2, item3)
+                self.PluginViewList.setRowHeight(row, 15)
 
     def displayAbout(self, item):
         if item is None:
@@ -95,9 +112,5 @@
         row = self.PluginViewList.row(item)
         text = self.parent.plugin_manager.plugins[row].about()
         if text is not None:
-            ret = QtGui.QMessageBox.information(self,
-                translate(u'PluginList', u'Plugin Information'),
-                translate(u'PluginList', text),
-                QtGui.QMessageBox.StandardButtons(
-                    QtGui.QMessageBox.Ok),
-                QtGui.QMessageBox.Ok)
+            self.AboutTextLabel.setText(translate(u'PluginList', text))
+

=== modified file 'resources/forms/plugindialoglistform.ui'
--- resources/forms/plugindialoglistform.ui	2009-08-13 20:02:38 +0000
+++ resources/forms/plugindialoglistform.ui	2009-10-02 14:25:22 +0000
@@ -7,7 +7,7 @@
     <x>0</x>
     <y>0</y>
     <width>400</width>
-    <height>393</height>
+    <height>568</height>
    </rect>
   </property>
   <property name="windowTitle">
@@ -19,7 +19,7 @@
      <x>20</x>
      <y>10</y>
      <width>371</width>
-     <height>331</height>
+     <height>261</height>
     </rect>
    </property>
    <property name="showGrid">
@@ -34,12 +34,24 @@
    <attribute name="horizontalHeaderVisible">
     <bool>true</bool>
    </attribute>
+   <attribute name="horizontalHeaderCascadingSectionResizes">
+    <bool>false</bool>
+   </attribute>
    <attribute name="horizontalHeaderShowSortIndicator" stdset="0">
     <bool>true</bool>
    </attribute>
+   <attribute name="horizontalHeaderStretchLastSection">
+    <bool>true</bool>
+   </attribute>
    <attribute name="verticalHeaderVisible">
     <bool>false</bool>
    </attribute>
+   <attribute name="horizontalHeaderStretchLastSection">
+    <bool>true</bool>
+   </attribute>
+   <attribute name="horizontalHeaderCascadingSectionResizes">
+    <bool>false</bool>
+   </attribute>
    <row/>
    <column>
     <property name="text">
@@ -76,7 +88,7 @@
    <property name="geometry">
     <rect>
      <x>220</x>
-     <y>350</y>
+     <y>530</y>
      <width>170</width>
      <height>25</height>
     </rect>
@@ -85,6 +97,38 @@
     <set>QDialogButtonBox::Ok</set>
    </property>
   </widget>
+  <widget class="QGroupBox" name="PluginInfoGroupBox">
+   <property name="geometry">
+    <rect>
+     <x>20</x>
+     <y>270</y>
+     <width>371</width>
+     <height>241</height>
+    </rect>
+   </property>
+   <property name="title">
+    <string>GroupBox</string>
+   </property>
+   <property name="alignment">
+    <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
+   </property>
+   <property name="flat">
+    <bool>false</bool>
+   </property>
+   <widget class="QLabel" name="AboutTextLabel">
+    <property name="geometry">
+     <rect>
+      <x>10</x>
+      <y>30</y>
+      <width>351</width>
+      <height>191</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>TextLabel</string>
+    </property>
+   </widget>
+  </widget>
  </widget>
  <resources/>
  <connections>


Follow ups