#--------------------------------------------------------------------- # # QGIS Rest - A QGIS plugin to allow for interacting with REST servers # # Copyright (C) 2008 Aaron Racicot # # EMAIL: aaronr (at) z-pulley.com # WEB : www.reprojected.com # # Based on the original "Rest Client" Copyright (c) 2007 Christopher Schmidt # http://www.restclient.org/ # # Vector format code based on "FeatureServer" Copyright (c) 2007 MetaCarta # http://www.featureserver.org/ # #--------------------------------------------------------------------- # # licensed under the terms of GNU GPL 2 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License along # with this program; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. # #--------------------------------------------------------------------- from PyQt4.QtCore import * from PyQt4.QtGui import * from qgis.core import * from qgisrest_guistart import QGISRestGui import resources_rc import os class QGISRestPlugin: 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(":/qgisresticon.png"), "QGISRest", self.iface.mainWindow()) self.action.setWhatsThis("QGISRest Plugin") QObject.connect(self.action, SIGNAL("activated()"), self.run) self.helpaction = QAction(QIcon(":/qgisresthelp.png"), "About", self.iface.mainWindow()) self.helpaction.setWhatsThis("QGISRest Help") QObject.connect(self.helpaction, SIGNAL("activated()"), self.helprun) # add toolbar button and menu item self.iface.addToolBarIcon(self.action) self.iface.addPluginToMenu("&QGISRest", self.action) self.iface.addPluginToMenu("&QGISRest", self.helpaction) def unload(self): # remove the plugin menu item and icon self.iface.removePluginMenu("&QGISRest",self.action) self.iface.removePluginMenu("&QGISRest",self.helpaction) self.iface.removeToolBarIcon(self.action) def helprun(self): # print "Help pressed..." infoString = QString("Written by Aaron Racicot\naaronr@z-pulley.com\n") infoString = infoString.append("Company - http://www.z-pulley.com\n\n") infoString = infoString.append("Blog - http://www.reprojected.com\n\n") infoString = infoString.append("Source: http://svn.reprojected.com/") infoString = infoString.append("qgisplugins/trunk/qgisrest\n") infoString = infoString.append("TRAC: http://trac.reprojected.com/") infoString = infoString.append("qgisplugins\n") QMessageBox.information(self.iface.mainWindow(), "QGISRest Plugin About",infoString) def run(self): # create and show a configuration dialog flags = Qt.WindowTitleHint | Qt.WindowSystemMenuHint | Qt.WindowMaximizeButtonHint self.gui = QGISRestGui(self.iface.mainWindow(),flags) self.gui.show()