Skip to content

Commit

Permalink
Set column widths in the plugin display.
Browse files Browse the repository at this point in the history
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 b7de177
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 4 deletions.
2 changes: 2 additions & 0 deletions python/plugins/plugin_installer/CMakeLists.txt
@@ -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
Expand Down
6 changes: 4 additions & 2 deletions python/plugins/plugin_installer/gui.py
Expand Up @@ -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):
Expand Down Expand Up @@ -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")

Expand Down
3 changes: 3 additions & 0 deletions python/plugins/plugin_installer/gui.ui
Expand Up @@ -109,6 +109,9 @@
<height>251</height>
</rect>
</property>
<property name="alternatingRowColors" >
<bool>true</bool>
</property>
<property name="itemsExpandable" >
<bool>false</bool>
</property>
Expand Down
19 changes: 17 additions & 2 deletions python/plugins/plugin_installer/installer_plugin.py
Expand Up @@ -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:
Expand All @@ -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])
Expand All @@ -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.