Skip to content

Commit 1dfd005

Browse files
author
timlinux
committed
Enhancements to plugin builder:
- replace tokens in README which was missing from the file list - use nice word wrapping in README.whatnext git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@7872 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 044bc42 commit 1dfd005

File tree

2 files changed

+44
-11
lines changed

2 files changed

+44
-11
lines changed

src/plugins/plugin_builder.py

+1
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ def plugin_file(pluginDir, file):
125125
#
126126

127127
files = [ plugin_file(pluginDir, 'CMakeLists.txt'),
128+
plugin_file(pluginDir, 'README'),
128129
plugin_file(pluginDir, pluginLCaseName + '.qrc'),
129130
plugin_file(pluginDir, pluginLCaseName + '.cpp'),
130131
plugin_file(pluginDir, pluginLCaseName + '.h'),

src/plugins/plugin_template/README.whatnext

+43-11
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
Welcome to your automatically generated plugin!
22
-------------------------------------------------------------
33

4-
This is just a starting point. You now need to modify the code to make it do something useful....read on for a more information to get yourself started.
4+
This is just a starting point. You now need to modify the code to make it do
5+
something useful....read on for a more information to get yourself started.
56

67
Documentation:
78
-------------------------------------------------------------
@@ -17,33 +18,62 @@ QgsMapCanvas : http://svn.qgis.org/api_doc/html/classQgsMapCanvas.html
1718
QgsMapTool : http://svn.qgis.org/api_doc/html/classQgsMapTool.html
1819
QgsPlugin : http://svn.qgis.org/api_doc/html/classQgisPlugin.html
1920

20-
QGisInterface is an abstract base class (ABC) that specifies what publicly available features of QGIS are exposed to third party code and plugins. An instance of the QgisInterface is passed to the plugin when it loads. Please consult the QGIS development team if there is functionality required in the QGisInterface that is not available.
21+
QGisInterface is an abstract base class (ABC) that specifies what publicly
22+
available features of QGIS are exposed to third party code and plugins. An
23+
instance of the QgisInterface is passed to the plugin when it loads. Please
24+
consult the QGIS development team if there is functionality required in the
25+
QGisInterface that is not available.
2126

22-
QgsPlugin is an ABC that defines required behaviour your plugin must provide. See below for more details.
27+
QgsPlugin is an ABC that defines required behaviour your plugin must provide.
28+
See below for more details.
2329

2430
What are all the files in my generated plugin directory for?
2531
-------------------------------------------------------------
2632

2733
CMakeLists.txt
28-
This is the generated CMake file that builds the plugin. You should add you application specific dependencies and source files to this file.
34+
This is the generated CMake file that builds the plugin. You should add you
35+
application specific dependencies and source files to this file.
2936

3037
[pluginlcasename].h
3138
[pluginlcasename].cpp
32-
This is the class that provides the 'glue' between your custom application logic and the QGIS application. You will see that a number of methods are already implemented for you - including some examples of how to add a raster or vector layer to the main application map canvas. This class is a concrete implementation of QgisPlugin (which defines required behaviour for a plugin). In particular, a plugin has a number of static methods and members so that the QgsPluginManager and plugin loader logic can identify each plugin, create an appropriate menu entry for it etc. Note there is nothing stopping you creating multiple toolbar icons and menu entries for a single plugin. By default though a single menu entry and toolbar button is created and its pre-configured to call the run() method in this class when selected. This default implementation provided for you by the plugin builder is well documented, so please refer to the code for further advice.
39+
This is the class that provides the 'glue' between your custom application
40+
logic and the QGIS application. You will see that a number of methods are
41+
already implemented for you - including some examples of how to add a raster or
42+
vector layer to the main application map canvas. This class is a concrete
43+
implementation of QgisPlugin (which defines required behaviour for a plugin).
44+
In particular, a plugin has a number of static methods and members so that the
45+
QgsPluginManager and plugin loader logic can identify each plugin, create an
46+
appropriate menu entry for it etc. Note there is nothing stopping you creating
47+
multiple toolbar icons and menu entries for a single plugin. By default though
48+
a single menu entry and toolbar button is created and its pre-configured to
49+
call the run() method in this class when selected. This default implementation
50+
provided for you by the plugin builder is well documented, so please refer to
51+
the code for further advice.
3352

3453
[pluginlcasename]gui.ui
35-
This is a Qt designer 'ui' file. It defines the look of the default plugin dialog without implementing any application logic. You can modify this form to suite your needs or completely remove it if your plugin does not need to display a user form (e.g. for custom MapTools).
54+
This is a Qt designer 'ui' file. It defines the look of the default plugin
55+
dialog without implementing any application logic. You can modify this form to
56+
suite your needs or completely remove it if your plugin does not need to
57+
display a user form (e.g. for custom MapTools).
3658

3759

3860
[pluginlcasename]gui.cpp
3961
[pluginlcasename]gui.h
40-
This is the concrete class where application logic for the above mentioned dialog should go. The world is your oyster here really....
62+
This is the concrete class where application logic for the above mentioned
63+
dialog should go. The world is your oyster here really....
4164

4265
[pluginlcasename].qrc
43-
This is the Qt4 resources file for your plugin. The Makefile generated for your plugin is all set up to compile the resource file so all you need to do is add your additional icons etc using the simple xml file format. Note the namespace used for all your resources e.g. (":/[pluginname]/"). It is important to use this prefix for all your resources. We suggest you include any other images and run time data in this resurce file too.
66+
This is the Qt4 resources file for your plugin. The Makefile generated for your
67+
plugin is all set up to compile the resource file so all you need to do is add
68+
your additional icons etc using the simple xml file format. Note the namespace
69+
used for all your resources e.g. (":/[pluginname]/"). It is important to use
70+
this prefix for all your resources. We suggest you include any other images and
71+
run time data in this resurce file too.
4472

4573
[pluginlcasename].png
46-
This is the icon that will be used for your plugin menu entry and toolbar icon. Simply replace this icon with your own icon to make your plugin disctinctive from the rest.
74+
This is the icon that will be used for your plugin menu entry and toolbar icon.
75+
Simply replace this icon with your own icon to make your plugin disctinctive
76+
from the rest.
4777

4878
README
4979
This file contains the documentation you are reading now!
@@ -52,12 +82,14 @@ This file contains the documentation you are reading now!
5282
Getting developer help:
5383
-------------------------------------------------------------
5484

55-
For Questions and Comments regarding the plugin builder template and creating your features in QGIS using the plugin interface please contact us via:
85+
For Questions and Comments regarding the plugin builder template and creating
86+
your features in QGIS using the plugin interface please contact us via:
5687

5788
* the QGIS developers mailing list, or
5889
* IRC (#qgis on freenode.net)
5990

60-
QGIS is distributed under the Gnu Public License. If you create a useful plugin please consider contributing it back to the community.
91+
QGIS is distributed under the Gnu Public License. If you create a useful plugin
92+
please consider contributing it back to the community.
6193

6294
Have fun and thank you for choosing QGIS.
6395

0 commit comments

Comments
 (0)