QGIS/python/plugins/plugin_installer/installer_plugin.py
wonder b330657fd2 Improvements to plugin installer:
- ability to support custom repositories
- better error handling


git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@7909 c8812cc2-4d05-0410-92ff-de0c093fc19c
2008-01-10 14:45:28 +00:00

37 lines
1.3 KiB
Python

from PyQt4.QtCore import *
from PyQt4.QtGui import *
from qgis.core import *
from dialog import InstallerPluginGui
import resources
class InstallerPlugin:
# ----------------------------------------- #
def __init__(self, iface):
# save reference to the QGIS interface
self.iface = iface
# ----------------------------------------- #
def initGui(self):
# create action that will start plugin configuration
self.action = QAction(QIcon(":/plugins/installer/icon.xpm"), "Install plugins", self.iface.getMainWindow())
self.action.setWhatsThis("Plugin Installer")
QObject.connect(self.action, SIGNAL("activated()"), self.run)
# add toolbar button and menu item
self.iface.addToolBarIcon(self.action)
self.iface.addPluginMenu("&Plugin Installer", self.action)
# ----------------------------------------- #
def unload(self):
# remove the plugin menu item and icon
self.iface.removePluginMenu("&Plugin Installer",self.action)
self.iface.removeToolBarIcon(self.action)
# ----------------------------------------- #
def run(self):
# create and show a configuration dialog
flags = Qt.WindowTitleHint | Qt.WindowSystemMenuHint | Qt.WindowMaximizeButtonHint
self.gui = InstallerPluginGui(self.iface.getMainWindow(),flags)
self.gui.show()