Skip to content
Permalink
Browse files
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
  • Loading branch information
gsherman committed Nov 18, 2007
1 parent acdc107 commit b7de17704537ff3c0868e8eabf6f2299174cd9c4
@@ -1,3 +1,5 @@
#TODO: Need to configure cmake to run pyrcc4 and pyuic4 as required when the resource
# file or the ui change
SET(INSTALLER_FILES
dialog.py
gui.py
@@ -2,11 +2,12 @@

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

import sys
from PyQt4 import QtCore, QtGui

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

self.treePlugins = QtGui.QTreeWidget(Dialog)
self.treePlugins.setGeometry(QtCore.QRect(10,50,911,251))
self.treePlugins.setAlternatingRowColors(True)
self.treePlugins.setItemsExpandable(False)
self.treePlugins.setObjectName("treePlugins")

@@ -109,6 +109,9 @@
<height>251</height>
</rect>
</property>
<property name="alternatingRowColors" >
<bool>true</bool>
</property>
<property name="itemsExpandable" >
<bool>false</bool>
</property>
@@ -51,7 +51,9 @@ def run(self):


def getAvailablePlugins(self):
print "getting list of plugins"
from qgis_plugins import retrieve_list
QApplication.setOverrideCursor(Qt.WaitCursor)
pluginlist = retrieve_list(self.repository)
output = "QGIS python plugins avialable from \n%s\n" % self.repository
#for p in pluginlist:
@@ -64,14 +66,27 @@ def getAvailablePlugins(self):
a.setText(1,p["version"])
a.setText(2,p["desc"])
a.setText(3,p["author"])

QApplication.restoreOverrideCursor()

print "getting list of plugins"

# resize the columns
# plugin name
self.gui.treePlugins.resizeColumnToContents(0);
# version
self.gui.treePlugins.resizeColumnToContents(1);
# author/contributor
self.gui.treePlugins.resizeColumnToContents(3);
# description
self.gui.treePlugins.setColumnWidth(2, 560);
return

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

def treeClicked(self, item, col):
self.gui.linePlugin.setText(item.text(0))
return
return

0 comments on commit b7de177

Please sign in to comment.