From now on, plugins must have metadata.txt file (with INI format)
that is used for storing of metadata. This has two advantages:
- plugins do not need to be loaded in order to read metadata
- repository can parse the metadata more easily
parameter to that type
- change default level to WARNING
- change startup messages to INFO
- don't unhide the warning button for INFO messages
- fix warnings produced by python code
macros are executed when a project is loaded (openProject function), saved (saveProject function) or is closing (closeProject function),
macros' python code is embedded in the project file (XML),
a bar (non-blocking) is shown on the top of the canvas to ask to the user whether enable project macros.
Work done for ARPA Piemonte
Until now plugins' metadata were always retrieved from __init__.py by calling python methods.
Reading metadata from a text file has the advantage of not requiring to load the plugin code
and can be done by plugin repository.
Metadata in metadata.txt is preferred to the methods in __init__.py - if the text file is
present, it is used to fetch the values. From QGIS 2.0 the metadata from __init__.py
will not be accepted - the metadata.txt file will be required.
Plugin metadata should be in INI file format, recognized by python's ConfigParser module
and by Qt's QSettings class.
All currently used metadata should be in [general] section. Example use:
[general]
name=PostGIS manager
description=Manage your PostGIS database
version=Version 0.5.15
icon=icons/postgis_elephant.png
qgisMinimumVersion=1.0.0
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
Additionally, plugin paths in QGIS_PLUGINPATH can be separated by either semicolon or colon.
git-svn-id: http://svn.osgeo.org/qgis/trunk@13943 c8812cc2-4d05-0410-92ff-de0c093fc19c
Modules Y,Z have been missed by the import wrapper and the unloader did not remove the plugin completely/correctly.
git-svn-id: http://svn.osgeo.org/qgis/trunk@13693 c8812cc2-4d05-0410-92ff-de0c093fc19c
More paths can be passed, separated by semicolon. Patch from Chris Crook (#2608), slightly modified.
git-svn-id: http://svn.osgeo.org/qgis/trunk@13236 c8812cc2-4d05-0410-92ff-de0c093fc19c
This cleans python support a bit and makes a starting point for further improvements of the console.
It's possible to run the console also outside QGIS:
import qgis.console
qgis.console.show_console()
git-svn-id: http://svn.osgeo.org/qgis/trunk@12725 c8812cc2-4d05-0410-92ff-de0c093fc19c
This enables complete unload and reload of plugins:
- qgis.utils.unloadPlugin(name) - now removes also plugin's modules (files) from python
- qgis.utils.reloadPlugin(name) - unloads and starts the plugin again (using fresh source files)
git-svn-id: http://svn.osgeo.org/qgis/trunk@12690 c8812cc2-4d05-0410-92ff-de0c093fc19c
This allows seamless loading/unloading of plugins by plugin installer.
git-svn-id: http://svn.osgeo.org/qgis/trunk@12552 c8812cc2-4d05-0410-92ff-de0c093fc19c
This will enable more flexibility in plugins handling
Hopefully it doesn't break anything :-)
git-svn-id: http://svn.osgeo.org/qgis/trunk@11950 c8812cc2-4d05-0410-92ff-de0c093fc19c