mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-25 00:58:06 -05:00
Both C++ and Python plugins now can implement icon() metadata function which returns path to the icon file name. The icon file is passed to QPixmap() constructor. For C++ it's preferred to use an icon from the resource file (e.g. ":/plugins/foo/foo_icon.png") because plugin's resource file gets loaded automatically when the plugin is loaded. Python plugins can use either relative path to the icon ("images/plugin-icon.png") or icon from the resource file (starting with a colon). The relative path is preferred, since it doesn't require the plugin to load its resource file and plugin repository will not have a trouble to fetch the icon automatically. Updated C++ plugins and Python plugins to include icon where applicable. Default plugin icon is (c) Anna Shlyapnikova, licensed under Creative Commons (Attribution 3.0 Unported). git-svn-id: http://svn.osgeo.org/qgis/trunk@14897 c8812cc2-4d05-0410-92ff-de0c093fc19c
69 lines
1.9 KiB
Python
Executable File
69 lines
1.9 KiB
Python
Executable File
"""@package __init__
|
|
/***************************************************************************
|
|
* *
|
|
* 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 is the main module of OpenStreetMap plugin for Quantum GIS.
|
|
It initializes the plugin, making it known to QGIS.
|
|
|
|
OSM Plugin is viewer and editor for OpenStreetMap data.
|
|
"""
|
|
|
|
|
|
def name():
|
|
"""Function returns name of this plugin.
|
|
|
|
@return name of this plugin ~ OpenStreetMap plugin
|
|
"""
|
|
|
|
return "OpenStreetMap plugin"
|
|
|
|
|
|
def description():
|
|
"""Function returns brief description of this plugin.
|
|
|
|
@return brief description of this plugin.
|
|
"""
|
|
|
|
return "Viewer and editor for OpenStreetMap data"
|
|
|
|
|
|
def version():
|
|
"""Function returns version of this plugin.
|
|
|
|
@return version of this plugin
|
|
"""
|
|
from OsmPlugin import versionNumber
|
|
return "Version "+versionNumber()
|
|
|
|
|
|
def qgisMinimumVersion():
|
|
"""Function returns information on what minimum version
|
|
of Quantum GIS this plugin works with.
|
|
|
|
@return minimum supported version of QGIS
|
|
"""
|
|
|
|
return "1.0.0"
|
|
|
|
def icon():
|
|
import resources_rc
|
|
return ":/plugins/osm_plugin/images/osm_load.png"
|
|
|
|
|
|
def classFactory(iface):
|
|
"""Function returns OSM Plugin instance.
|
|
|
|
@return instance of OSM Plugin
|
|
"""
|
|
|
|
from OsmPlugin import OsmPlugin
|
|
# return object of our plugin with reference to QGIS interface as the only argument
|
|
return OsmPlugin(iface)
|
|
|