Skip to content

Commit b7de177

Browse files
author
gsherman
committed
Set column widths in the plugin display.
Added row highlighting to plugin list. Added wait cursor when fetching the plugin list and during install. git-svn-id: http://svn.osgeo.org/qgis/trunk@7447 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent acdc107 commit b7de177

File tree

4 files changed

+26
-4
lines changed

4 files changed

+26
-4
lines changed

python/plugins/plugin_installer/CMakeLists.txt

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#TODO: Need to configure cmake to run pyrcc4 and pyuic4 as required when the resource
2+
# file or the ui change
13
SET(INSTALLER_FILES
24
dialog.py
35
gui.py

python/plugins/plugin_installer/gui.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@
22

33
# Form implementation generated from reading ui file 'gui.ui'
44
#
5-
# Created: Sun Oct 21 17:55:51 2007
6-
# by: PyQt4 UI code generator 4.3
5+
# Created: Sat Nov 17 14:57:42 2007
6+
# by: PyQt4 UI code generator 4.1.1
77
#
88
# WARNING! All changes made in this file will be lost!
99

10+
import sys
1011
from PyQt4 import QtCore, QtGui
1112

1213
class Ui_Dialog(object):
@@ -44,6 +45,7 @@ def setupUi(self, Dialog):
4445

4546
self.treePlugins = QtGui.QTreeWidget(Dialog)
4647
self.treePlugins.setGeometry(QtCore.QRect(10,50,911,251))
48+
self.treePlugins.setAlternatingRowColors(True)
4749
self.treePlugins.setItemsExpandable(False)
4850
self.treePlugins.setObjectName("treePlugins")
4951

python/plugins/plugin_installer/gui.ui

+3
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,9 @@
109109
<height>251</height>
110110
</rect>
111111
</property>
112+
<property name="alternatingRowColors" >
113+
<bool>true</bool>
114+
</property>
112115
<property name="itemsExpandable" >
113116
<bool>false</bool>
114117
</property>

python/plugins/plugin_installer/installer_plugin.py

+17-2
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@ def run(self):
5151

5252

5353
def getAvailablePlugins(self):
54+
print "getting list of plugins"
5455
from qgis_plugins import retrieve_list
56+
QApplication.setOverrideCursor(Qt.WaitCursor)
5557
pluginlist = retrieve_list(self.repository)
5658
output = "QGIS python plugins avialable from \n%s\n" % self.repository
5759
#for p in pluginlist:
@@ -64,14 +66,27 @@ def getAvailablePlugins(self):
6466
a.setText(1,p["version"])
6567
a.setText(2,p["desc"])
6668
a.setText(3,p["author"])
69+
70+
QApplication.restoreOverrideCursor()
6771

68-
print "getting list of plugins"
72+
73+
# resize the columns
74+
# plugin name
75+
self.gui.treePlugins.resizeColumnToContents(0);
76+
# version
77+
self.gui.treePlugins.resizeColumnToContents(1);
78+
# author/contributor
79+
self.gui.treePlugins.resizeColumnToContents(3);
80+
# description
81+
self.gui.treePlugins.setColumnWidth(2, 560);
6982
return
7083

7184
def installPlugin(self, plugin):
85+
QApplication.setOverrideCursor(Qt.WaitCursor)
7286
from qgis_plugins import retrieve_list, install_plugin
7387
plugindir = str(QgsApplication.qgisSettingsDirPath()) + "/python/plugins"
7488
result = install_plugin(plugin, plugindir, self.repository)
89+
QApplication.restoreOverrideCursor()
7590
if result[0]:
7691
mb=QMessageBox(self.iface.getMainWindow())
7792
mb.information(mb, "Plugin installed successfully", result[1])
@@ -82,4 +97,4 @@ def installPlugin(self, plugin):
8297

8398
def treeClicked(self, item, col):
8499
self.gui.linePlugin.setText(item.text(0))
85-
return
100+
return

0 commit comments

Comments
 (0)