mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-14 00:07:35 -04:00
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
This commit is contained in:
parent
acdc107f1a
commit
b7de177045
@ -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 @@ class Ui_Dialog(object):
|
||||
|
||||
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 @@ class InstallerPlugin:
|
||||
|
||||
|
||||
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 @@ class InstallerPlugin:
|
||||
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 @@ class InstallerPlugin:
|
||||
|
||||
def treeClicked(self, item, col):
|
||||
self.gui.linePlugin.setText(item.text(0))
|
||||
return
|
||||
return
|
||||
|
Loading…
x
Reference in New Issue
Block a user