1 change: 1 addition & 0 deletions src/gui/qgsdetaileditemdelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ class GUI_EXPORT QgsDetailedItemDelegate :

private:
QFont detailFont( const QStyleOptionViewItem &theOption ) const;
QFont categoryFont( const QStyleOptionViewItem &theOption ) const;
QFont titleFont( const QStyleOptionViewItem &theOption ) const;
void drawHighlight( const QStyleOptionViewItem &theOption,
QPainter * thepPainter,
Expand Down
1 change: 1 addition & 0 deletions src/gui/qgsdetaileditemwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ void QgsDetailedItemWidget::setData( QgsDetailedItemData theData )
{
lblTitle->setText( theData.title() );
lblDetail->setText( theData.detail() );
lblCategory->setText( theData.category() );
cbx->setVisible( theData.isCheckable() );
cbx->setChecked( theData.isChecked() );
lblIcon->setPixmap( theData.icon() );
Expand Down
9 changes: 8 additions & 1 deletion src/plugins/coordinate_capture/coordinatecapture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@

static const QString sName = QObject::tr( "Coordinate Capture" );
static const QString sDescription = QObject::tr( "Capture mouse coordinates in different CRS" );
static const QString sCategory = QObject::tr( "Plugins" );
static const QString sPluginVersion = QObject::tr( "Version 0.1" );
static const QString sPluginIcon = ":/coordinate_capture/coordinate_capture.png";
static const QgisPlugin::PLUGINTYPE sPluginType = QgisPlugin::UI;
Expand All @@ -66,7 +67,7 @@ static const QgisPlugin::PLUGINTYPE sPluginType = QgisPlugin::UI;
* @param theQGisInterface - Pointer to the QGIS interface object
*/
CoordinateCapture::CoordinateCapture( QgisInterface * theQgisInterface ):
QgisPlugin( sName, sDescription, sPluginVersion, sPluginType ),
QgisPlugin( sName, sDescription, sCategory, sPluginVersion, sPluginType ),
mQGisIface( theQgisInterface )
{
}
Expand Down Expand Up @@ -331,6 +332,12 @@ QGISEXTERN QString description()
return sDescription;
}

// Return the category
QGISEXTERN QString category()
{
return sCategory;
}

// Return the type (either UI or MapLayer plugin)
QGISEXTERN int type()
{
Expand Down
15 changes: 14 additions & 1 deletion src/plugins/delimited_text/qgsdelimitedtextplugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@

static const QString pluginVersion = QObject::tr( "Version 0.2" );
static const QString description_ = QObject::tr( "Loads and displays delimited text files containing x,y coordinates" );
static const QString category_ = QObject::tr( "Layers" );
static const QString icon_ = ":/delimited_text.png";

/**
Expand All @@ -54,7 +55,7 @@ QgsDelimitedTextPlugin::QgsDelimitedTextPlugin( QgisInterface * theQgisInterFace
pluginNameQString = tr( "DelimitedTextLayer" );
pluginVersionQString = pluginVersion;
pluginDescriptionQString = description_;

pluginCategoryQString = category_;
}

QgsDelimitedTextPlugin::~QgsDelimitedTextPlugin()
Expand All @@ -80,6 +81,12 @@ QString QgsDelimitedTextPlugin::description()

}

QString QgsDelimitedTextPlugin::category()
{
return pluginCategoryQString;

}

int QgsDelimitedTextPlugin::type()
{
return QgisPlugin::UI;
Expand Down Expand Up @@ -193,6 +200,12 @@ QGISEXTERN QString description()
return description_;
}

// Return the category
QGISEXTERN QString category()
{
return category_;
}

// Return the type (either UI or MapLayer plugin)
QGISEXTERN int type()
{
Expand Down
6 changes: 6 additions & 0 deletions src/plugins/delimited_text/qgsdelimitedtextplugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ class QgsDelimitedTextPlugin: public QObject, public QgisPlugin, private Ui::Qgs
* Virtual function to return a description of the plugins functions
*/
virtual QString description();
/**
* Virtual function to return a plugin category
*/
virtual QString category();
/**
* Return the plugin type
*/
Expand Down Expand Up @@ -78,6 +82,8 @@ class QgsDelimitedTextPlugin: public QObject, public QgisPlugin, private Ui::Qgs
QString pluginVersionQString;
//! Descrption of the plugin
QString pluginDescriptionQString;
//! Category of the plugin
QString pluginCategoryQString;
//! Plugin type as defined in Plugin::PLUGINTYPE
int pluginType;
//! Pointer to the QGIS interface object
Expand Down
8 changes: 7 additions & 1 deletion src/plugins/diagram_overlay/qgsdiagramoverlayplugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,10 @@

static const QString pluginName = QObject::tr( "Diagram Overlay" );
static const QString pluginDescription = QObject::tr( "A plugin for placing diagrams on vector layers" );
static const QString pluginCategory = QObject::tr( "Plugins" );
static const QString pluginVersion = QObject::tr( "Version 0.0.1" );

QgsDiagramOverlayPlugin::QgsDiagramOverlayPlugin( QgisInterface* iface ): QObject(), QgsVectorOverlayPlugin( pluginName, pluginDescription, pluginVersion ), mInterface( iface )
QgsDiagramOverlayPlugin::QgsDiagramOverlayPlugin( QgisInterface* iface ): QObject(), QgsVectorOverlayPlugin( pluginName, pluginDescription, pluginCategory, pluginVersion ), mInterface( iface )
{
if ( iface && iface->mainWindow() )
{
Expand Down Expand Up @@ -141,6 +142,11 @@ QGISEXTERN QString description()
return pluginDescription;
}

QGISEXTERN QString category()
{
return pluginCategory;
}

QGISEXTERN QString version()
{
return pluginVersion;
Expand Down
9 changes: 8 additions & 1 deletion src/plugins/dxf2shp_converter/dxf2shpconverter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@

static const QString sName = QObject::tr( "Dxf2Shp Converter" );
static const QString sDescription = QObject::tr( "Converts from dxf to shp file format" );
static const QString sCategory = QObject::tr( "Vector" );
static const QString sPluginVersion = QObject::tr( "Version 0.1" );
static const QgisPlugin::PLUGINTYPE sPluginType = QgisPlugin::UI;
static const QString sPluginIcon = ":/dxf2shp_converter.png";
Expand All @@ -51,7 +52,7 @@ static const QString sPluginIcon = ":/dxf2shp_converter.png";
* @param theQGisInterface - Pointer to the QGIS interface object
*/
dxf2shpConverter::dxf2shpConverter( QgisInterface *theQgisInterface ): QgisPlugin
( sName, sDescription, sPluginVersion, sPluginType ), mQGisIface
( sName, sDescription, sCategory, sPluginVersion, sPluginType ), mQGisIface
( theQgisInterface ) {}

dxf2shpConverter::~dxf2shpConverter()
Expand Down Expand Up @@ -181,6 +182,12 @@ QGISEXTERN QString description()
return sDescription;
}

// Return the category
QGISEXTERN QString category()
{
return sCategory;
}

// Return the type (either UI or MapLayer plugin)
QGISEXTERN int type()
{
Expand Down
9 changes: 8 additions & 1 deletion src/plugins/evis/evis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,13 @@

static const QString sName = QObject::tr( "eVis" );
static const QString sDescription = QObject::tr( "An event visualization tool - view images associated with vector features" );
static const QString sCategory = QObject::tr( "Database" );
static const QString sPluginVersion = QObject::tr( "Version 1.1.0" );
static const QgisPlugin::PLUGINTYPE sPluginType = QgisPlugin::UI;


eVis::eVis( QgisInterface * theQgisInterface ):
QgisPlugin( sName, sDescription, sPluginVersion, sPluginType ),
QgisPlugin( sName, sDescription, sCategory, sPluginVersion, sPluginType ),
mQGisIface( theQgisInterface )
{
mIdTool = 0;
Expand Down Expand Up @@ -226,6 +227,12 @@ QGISEXTERN QString description( )
return sDescription;
}

// Return the category
QGISEXTERN QString category( )
{
return sCategory;
}

// Return the type ( either UI or MapLayer plugin )
QGISEXTERN int type( )
{
Expand Down
9 changes: 8 additions & 1 deletion src/plugins/georeferencer/qgsgeorefplugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@

static const QString sName = QObject::tr( "Georeferencer GDAL" );
static const QString sDescription = QObject::tr( "Georeferencing rasters using GDAL" );
static const QString sCategory = QObject::tr( "Raster" );
static const QString sPluginVersion = QObject::tr( "Version 3.1.9" );
static const QgisPlugin::PLUGINTYPE sPluginType = QgisPlugin::UI;
static const QString sPluginIcon = ":/icons/mGeorefRun.png";
Expand All @@ -79,7 +80,7 @@ static const QString sPluginIcon = ":/icons/mGeorefRun.png";
* @param theQGisInterface - Pointer to the QGIS interface object
*/
QgsGeorefPlugin::QgsGeorefPlugin( QgisInterface * theQgisInterface ):
QgisPlugin( sName, sDescription, sPluginVersion, sPluginType ),
QgisPlugin( sName, sDescription, sCategory, sPluginVersion, sPluginType ),
mQGisIface( theQgisInterface ),
mPluginGui( NULL )
{
Expand Down Expand Up @@ -227,6 +228,12 @@ QGISEXTERN QString description()
return sDescription;
}

// Return the category
QGISEXTERN QString category()
{
return sCategory;
}

// Return the type (either UI or MapLayer plugin)
QGISEXTERN int type()
{
Expand Down
9 changes: 8 additions & 1 deletion src/plugins/globe/globe_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,14 @@ using namespace osgEarth::Util::Controls;

static const QString sName = QObject::tr( "Globe" );
static const QString sDescription = QObject::tr( "Overlay data on a 3D globe" );
static const QString sCategory = QObject::tr( "Plugins" );
static const QString sPluginVersion = QObject::tr( "Version 0.1" );
static const QgisPlugin::PLUGINTYPE sPluginType = QgisPlugin::UI;


//constructor
GlobePlugin::GlobePlugin( QgisInterface* theQgisInterface )
: QgisPlugin( sName, sDescription, sPluginVersion, sPluginType )
: QgisPlugin( sName, sDescription, sCategory, sPluginVersion, sPluginType )
, mQGisIface( theQgisInterface )
, mQActionPointer( NULL )
, mQActionSettingsPointer( NULL )
Expand Down Expand Up @@ -1071,6 +1072,12 @@ QGISEXTERN QString description()
return sDescription;
}

// Return the category
QGISEXTERN QString category()
{
return sCategory;
}

// Return the type (either UI or MapLayer plugin)
QGISEXTERN int type()
{
Expand Down
9 changes: 8 additions & 1 deletion src/plugins/gps_importer/qgsgpsplugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@

static const QString name_ = QObject::tr( "GPS Tools" );
static const QString description_ = QObject::tr( "Tools for loading and importing GPS data" );
static const QString category_ = QObject::tr( "Vector" );
static const QString version_ = QObject::tr( "Version 0.1" );
static const QgisPlugin::PLUGINTYPE type_ = QgisPlugin::UI;
static const QString icon_ = ":/gps_importer.png";
Expand All @@ -61,7 +62,7 @@ static const QString icon_ = ":/gps_importer.png";
* @param _qI Pointer to the QGIS interface object
*/
QgsGPSPlugin::QgsGPSPlugin( QgisInterface * theQgisInterFace ):
QgisPlugin( name_, description_, version_, type_ ),
QgisPlugin( name_, description_, category_, version_, type_ ),
mQGisInterface( theQgisInterFace )
{
setupBabel();
Expand Down Expand Up @@ -724,6 +725,12 @@ QGISEXTERN QString description()
return description_;
}

// Return the category
QGISEXTERN QString category()
{
return category_;
}

// Return the type (either UI or MapLayer plugin)
QGISEXTERN int type()
{
Expand Down
12 changes: 12 additions & 0 deletions src/plugins/grass/qgsgrassplugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ QgsGrassPlugin::QgsGrassPlugin( QgisInterface * theQgisInterFace ):
pluginNameQString = tr( "GrassVector" );
pluginVersionQString = tr( "0.1" );
pluginDescriptionQString = tr( "GRASS layer" );
pluginCategoryQString = tr( "Plugins" );
}

QgsGrassPlugin::~QgsGrassPlugin()
Expand Down Expand Up @@ -91,6 +92,11 @@ QString QgsGrassPlugin::description()
return pluginDescriptionQString;
}

QString QgsGrassPlugin::category()
{
return pluginCategoryQString;
}

void QgsGrassPlugin::help()
{
//TODO
Expand Down Expand Up @@ -929,6 +935,12 @@ QGISEXTERN QString description()
return QObject::tr( "GRASS layer" );
}

// Return the category
QGISEXTERN QString category()
{
return QObject::tr( "Plugins" );
}

// Return the type (either UI or MapLayer plugin)
QGISEXTERN int type()
{
Expand Down
6 changes: 6 additions & 0 deletions src/plugins/grass/qgsgrassplugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ class QgsGrassPlugin : public QObject, public QgisPlugin
* Virtual function to return a description of the plugins functions
*/
virtual QString description();
/**
* Virtual function to return a category of the plugin
*/
virtual QString category();
/**
* Return the plugin type
*/
Expand Down Expand Up @@ -138,6 +142,8 @@ class QgsGrassPlugin : public QObject, public QgisPlugin
QString pluginVersionQString;
//! Descrption of the plugin
QString pluginDescriptionQString;
//! Category of the plugin
QString pluginCategoryQString;
//! Plugin type as defined in QgisPlugin::PLUGINTYPE
int pluginType;
//! Pointer to our toolbar
Expand Down
9 changes: 6 additions & 3 deletions src/plugins/interpolation/qgsinterpolationplugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

static const QString name_ = QObject::tr( "Interpolation plugin" );
static const QString description_ = QObject::tr( "A plugin for interpolation based on vertices of a vector layer" );
static const QString category_ = QObject::tr( "Raster" );
static const QString version_ = QObject::tr( "Version 0.001" );
static const QString icon_ = ":/interpolation.png";

Expand Down Expand Up @@ -104,6 +105,11 @@ QGISEXTERN QString description()
return description_;
}

QGISEXTERN QString category()
{
return category_;
}

QGISEXTERN QString version()
{
return version_;
Expand All @@ -123,6 +129,3 @@ QGISEXTERN void unload( QgisPlugin* theInterpolationPluginPointer )
{
delete theInterpolationPluginPointer;
}



9 changes: 8 additions & 1 deletion src/plugins/offline_editing/offline_editing_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,13 @@

static const QString sName = QObject::tr( "OfflineEditing" );
static const QString sDescription = QObject::tr( "Allow offline editing and synchronizing with database" );
static const QString sCategory = QObject::tr( "Database" );
static const QString sPluginVersion = QObject::tr( "Version 0.1" );
static const QgisPlugin::PLUGINTYPE sPluginType = QgisPlugin::UI;
static const QString sPluginIcon = ":/offline_editing/offline_editing_copy.png";

QgsOfflineEditingPlugin::QgsOfflineEditingPlugin( QgisInterface* theQgisInterface )
: QgisPlugin( sName, sDescription, sPluginVersion, sPluginType )
: QgisPlugin( sName, sDescription, sCategory, sPluginVersion, sPluginType )
, mQGisIface( theQgisInterface )
, mActionConvertProject( NULL )
, mActionSynchronize( NULL )
Expand Down Expand Up @@ -160,6 +161,12 @@ QGISEXTERN QString description()
return sDescription;
}

// Return the category
QGISEXTERN QString category()
{
return sCategory;
}

// Return the type (either UI or MapLayer plugin)
QGISEXTERN int type()
{
Expand Down
10 changes: 9 additions & 1 deletion src/plugins/oracle_raster/qgsoracle_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

static const QString sName = QObject::tr( "Oracle Spatial GeoRaster" );
static const QString sDescription = QObject::tr( "Access Oracle Spatial GeoRaster" );
static const QString sCategory = QObject::tr( "Layers" );
static const QString sPluginVersion = QObject::tr( "Version 0.1" );
static const QgisPlugin::PLUGINTYPE sPluginType = QgisPlugin::UI;
static const QString sPluginIcon = ":/oracleplugin/oracleplugin.png";
Expand All @@ -34,7 +35,7 @@ static const QString sPluginIcon = ":/oracleplugin/oracleplugin.png";
* @param theQGisInterface - Pointer to the QGIS interface object
*/
QgsOraclePlugin::QgsOraclePlugin( QgisInterface * theQgisInterface ) :
QgisPlugin( sName, sDescription, sPluginVersion, sPluginType ),
QgisPlugin( sName, sDescription, sCategory, sPluginVersion, sPluginType ),
mQGisIface( theQgisInterface )
{
}
Expand Down Expand Up @@ -130,6 +131,13 @@ QGISEXTERN QString description()
return sDescription;
}

// Return the description

QGISEXTERN QString category()
{
return sCategory;
}

// Return the type (either UI or MapLayer plugin)

QGISEXTERN int type()
Expand Down
81 changes: 45 additions & 36 deletions src/plugins/plugin_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# --------------------------------------
# Date : Sun Sep 16 12:11:04 AKDT 2007
# Copyright : (C) Copyright 2007 Martin Dobias
# Email :
# Email :
# Original authors of Perl version: Gary Sherman and Tim Sutton
#***************************************************************************
#* *
Expand All @@ -18,12 +18,12 @@
import os, sys, shutil, re

def template_file(file):
return os.path.join('plugin_template', file)
return os.path.join('plugin_template', file)

def plugin_file(pluginDir, file):
return os.path.join(pluginDir, file)
return os.path.join(pluginDir, file)

# make sure we are in the plugins directory otherwise the changes this script will make will
# make sure we are in the plugins directory otherwise the changes this script will make will
# wreak havoc....

myDir = os.getcwd()
Expand All @@ -32,12 +32,12 @@ def plugin_file(pluginDir, file):
pluginsDirectory = os.path.join('src','plugins')

if myDir[-len(pluginsDirectory):] == pluginsDirectory:
print "yes"
print "yes"
else:
print "no"
print myDir
print "Please relocate to the plugins directory before attempting to run this script."
sys.exit(1)
print "no"
print myDir
print "Please relocate to the plugins directory before attempting to run this script."
sys.exit(1)


# get the needed information from the user
Expand Down Expand Up @@ -70,6 +70,13 @@ def plugin_file(pluginDir, file):
print "Plugin description:",
pluginDescription = raw_input()

print
print "Enter a plugin category. Category will help users"
print "to understand where to find plugin. E.g. if plugin"
print "will be available from Vector menu category is Vector"
print "Plugin category:",
pluginCategory = raw_input()

print
print "Enter the name of the application menu that will be created for your plugin"
print "Clever Tools"
Expand All @@ -90,6 +97,7 @@ def plugin_file(pluginDir, file):
print "Plugin directory: ", pluginDir
print "Name of the plugin: ", pluginName
print "Description of the plugin:", pluginDescription
print "Category of the plugin: ", pluginCategory
print "Menu name: ", menuName
print "Menu item name: ", menuItemName
print
Expand All @@ -99,8 +107,8 @@ def plugin_file(pluginDir, file):
createIt = raw_input()

if createIt.lower() != 'y':
print "Plugin creation cancelled, exiting"
sys.exit(2)
print "Plugin creation cancelled, exiting"
sys.exit(2)

# create the plugin and modify the build files

Expand All @@ -123,37 +131,38 @@ def plugin_file(pluginDir, file):
#

files = [ plugin_file(pluginDir, 'CMakeLists.txt'),
plugin_file(pluginDir, 'README'),
plugin_file(pluginDir, pluginLCaseName + '.qrc'),
plugin_file(pluginDir, pluginLCaseName + '.cpp'),
plugin_file(pluginDir, pluginLCaseName + '.h'),
plugin_file(pluginDir, pluginLCaseName + 'gui.cpp'),
plugin_file(pluginDir, pluginLCaseName + 'gui.h'),
plugin_file(pluginDir, pluginLCaseName + 'guibase.ui') ]
plugin_file(pluginDir, 'README'),
plugin_file(pluginDir, pluginLCaseName + '.qrc'),
plugin_file(pluginDir, pluginLCaseName + '.cpp'),
plugin_file(pluginDir, pluginLCaseName + '.h'),
plugin_file(pluginDir, pluginLCaseName + 'gui.cpp'),
plugin_file(pluginDir, pluginLCaseName + 'gui.h'),
plugin_file(pluginDir, pluginLCaseName + 'guibase.ui') ]

# replace occurences of [pluginlcasename], [pluginname], [plugindescription], [menuname], [menutiem]
# in template with the values from user
replacements = [ ('\\[pluginlcasename\\]', pluginLCaseName),
('\\[pluginname\\]', pluginName),
('\\[plugindescription\\]', pluginDescription),
('\\[menuname\\]', menuName),
('\\[menuitemname\\]', menuItemName) ]
('\\[pluginname\\]', pluginName),
('\\[plugindescription\\]', pluginDescription),
('\\[plugincategory\\]', pluginCategory),
('\\[menuname\\]', menuName),
('\\[menuitemname\\]', menuItemName) ]

for file in files:
# read contents of the file
f = open(file)
content = f.read()
f.close()
# replace everything necessary
for repl in replacements:
content = re.sub(repl[0], repl[1], content)
# write changes to the file
f = open(file, "w")
f.write(content)
f.close()

# read contents of the file
f = open(file)
content = f.read()
f.close()

# replace everything necessary
for repl in replacements:
content = re.sub(repl[0], repl[1], content)

# write changes to the file
f = open(file, "w")
f.write(content)
f.close()


# Add an entry to src/plugins/CMakeLists.txt
Expand Down
9 changes: 8 additions & 1 deletion src/plugins/plugin_template/plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@

static const QString sName = QObject::tr( "[menuitemname]" );
static const QString sDescription = QObject::tr( "[plugindescription]" );
static const QString sCategory = QObject::tr( "[plugincategory]" );
static const QString sPluginVersion = QObject::tr( "Version 0.1" );
static const QgisPlugin::PLUGINTYPE sPluginType = QgisPlugin::UI;
static const QString sPluginIcon = ":/[pluginlcasename]/[pluginlcasename].png";
Expand All @@ -51,7 +52,7 @@ static const QString sPluginIcon = ":/[pluginlcasename]/[pluginlcasename].png";
* @param theQGisInterface - Pointer to the QGIS interface object
*/
[pluginname]::[pluginname]( QgisInterface * theQgisInterface ):
QgisPlugin( sName, sDescription, sPluginVersion, sPluginType ),
QgisPlugin( sName, sDescription, sCategory, sPluginVersion, sPluginType ),
mQGisIface( theQgisInterface )
{
}
Expand Down Expand Up @@ -141,6 +142,12 @@ QGISEXTERN QString description()
return sDescription;
}

// Return the category
QGISEXTERN QString category()
{
return sCategory;
}

// Return the type (either UI or MapLayer plugin)
QGISEXTERN int type()
{
Expand Down
20 changes: 20 additions & 0 deletions src/plugins/qgisplugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,12 @@ class QgisPlugin

QgisPlugin( QString const & name = "",
QString const & description = "",
QString const & category = "",
QString const & version = "",
PLUGINTYPE const & type = MAPLAYER )
: mName( name ),
mDescription( description ),
mCategory( category ),
mVersion( version ),
mType( type )
{}
Expand Down Expand Up @@ -118,6 +120,18 @@ class QgisPlugin
return mDescription;
}

//! Plugin category
QString const & category() const
{
return mCategory;
}

//! Plugin category
QString & category()
{
return mCategory;
}

//! Plugin type, either UI or map layer
QgisPlugin::PLUGINTYPE const & type() const
{
Expand Down Expand Up @@ -145,6 +159,9 @@ class QgisPlugin
/// description
QString mDescription;

/// category
QString mCategory;

/// version
QString mVersion;

Expand Down Expand Up @@ -172,6 +189,9 @@ typedef QString name_t();
//! Typedef for getting the description without instantiating the plugin
typedef QString description_t();

//! Typedef for getting the category without instantiating the plugin
typedef QString category_t();

//! Typedef for getting the plugin type without instantiating the plugin
typedef int type_t();

Expand Down
2 changes: 1 addition & 1 deletion src/plugins/qgsrendererplugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ vector layer properties dialog in the main qgis application*/
class QgsRendererPlugin: public QgisPlugin
{
public:
QgsRendererPlugin( const QString& name, const QString& description, const QString& version ): QgisPlugin( name, description, version, QgisPlugin::RENDERER ) {}
QgsRendererPlugin( const QString& name, const QString& description, const QString& category, const QString& version ): QgisPlugin( name, description, category, version, QgisPlugin::RENDERER ) {}
virtual ~QgsRendererPlugin() {}
virtual QDialog* rendererDialog() = 0;
virtual QgsRenderer* renderer() = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/qgsvectoroverlayplugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class QWidget;
class QgsVectorOverlayPlugin: public QgisPlugin
{
public:
QgsVectorOverlayPlugin( const QString& name, const QString& description, const QString& version ): QgisPlugin( name, description, version, QgisPlugin::VECTOR_OVERLAY ) {}
QgsVectorOverlayPlugin( const QString& name, const QString& description, const QString& category, const QString& version ): QgisPlugin( name, description, category, version, QgisPlugin::VECTOR_OVERLAY ) {}

virtual ~QgsVectorOverlayPlugin() {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@

static const QString name_ = QObject::tr( "Raster Terrain Analysis plugin" );
static const QString description_ = QObject::tr( "A plugin for raster based terrain analysis" );
static const QString category_ = QObject::tr( "Raster" );
static const QString version_ = QObject::tr( "Version 0.1" );
static const QString icon_ = ":/raster/raster_terrain_icon.png";

Expand Down Expand Up @@ -132,6 +133,11 @@ QGISEXTERN QString description()
return description_;
}

QGISEXTERN QString category()
{
return category_;
}

QGISEXTERN QString version()
{
return version_;
Expand Down
9 changes: 8 additions & 1 deletion src/plugins/roadgraph/roadgraphplugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@

static const QString sName = QObject::tr( "Road graph plugin" );
static const QString sDescription = QObject::tr( "It solves the shortest path problem." );
static const QString sCategory = QObject::tr( "Vector" );
static const QString sPluginVersion = QObject::tr( "Version 0.1" );
static const QgisPlugin::PLUGINTYPE sPluginType = QgisPlugin::UI;

Expand All @@ -73,7 +74,7 @@ static const QgisPlugin::PLUGINTYPE sPluginType = QgisPlugin::UI;
* @param theQgisInterface - Pointer to the QGIS interface object
*/
RoadGraphPlugin::RoadGraphPlugin( QgisInterface * theQgisInterface ):
QgisPlugin( sName, sDescription, sPluginVersion, sPluginType ),
QgisPlugin( sName, sDescription, sCategory, sPluginVersion, sPluginType ),
mQGisIface( theQgisInterface )
{

Expand Down Expand Up @@ -337,6 +338,12 @@ QGISEXTERN QString description()
return sDescription;
}

// Return the category
QGISEXTERN QString category()
{
return sCategory;
}

// Return the type (either UI or MapLayer plugin)
QGISEXTERN int type()
{
Expand Down
10 changes: 9 additions & 1 deletion src/plugins/spatialquery/qgsspatialqueryplugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@

static const QString name_ = QObject::tr( "Spatial Query Plugin" );
static const QString description_ = QObject::tr( "A plugin that makes spatial queries on vector layers" );
static const QString category_ = QObject::tr( "Vector" );
static const QString version_ = QObject::tr( "Version 0.1" );
static const QgisPlugin::PLUGINTYPE type_ = QgisPlugin::UI;
static const QString icon_ = ":/icons/spatialquery.png";
Expand All @@ -58,7 +59,7 @@ static const QString icon_ = ":/icons/spatialquery.png";
* @parma mIface Pointer to the QGIS interface object
*/
QgsSpatialQueryPlugin::QgsSpatialQueryPlugin( QgisInterface* iface )
: QgisPlugin( name_, description_, version_, type_ )
: QgisPlugin( name_, description_, category_, version_, type_ )
, mDialog( 0 )
, mIface( iface )
, mSpatialQueryAction( 0 )
Expand Down Expand Up @@ -184,6 +185,13 @@ QGISEXTERN QString description()
return description_;
}


// Return the category
QGISEXTERN QString category()
{
return category_;
}

// Return the type (either UI or MapLayer plugin)
QGISEXTERN int type()
{
Expand Down
9 changes: 8 additions & 1 deletion src/plugins/spit/qgsspitplugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@

static const QString name_ = QObject::tr( "SPIT" );
static const QString description_ = QObject::tr( "Shapefile to PostgreSQL/PostGIS Import Tool" );
static const QString category_ = QObject::tr( "Database" );
static const QString version_ = QObject::tr( "Version 0.1" );
static const QgisPlugin::PLUGINTYPE type_ = QgisPlugin::UI;
static const QString icon_ = ":/spit.png";
Expand All @@ -45,7 +46,7 @@ static const QString icon_ = ":/spit.png";
* @parma _qI Pointer to the QGIS interface object
*/
QgsSpitPlugin::QgsSpitPlugin( QgisInterface * _qI )
: QgisPlugin( name_, description_, version_, type_ ),
: QgisPlugin( name_, description_, category_, version_, type_ ),
qgisMainWindow( _qI->mainWindow() ),
qI( _qI )
{
Expand Down Expand Up @@ -142,6 +143,12 @@ QGISEXTERN QString description()
return description_;
}

// Return the category
QGISEXTERN QString category()
{
return category_;
}

// Return the type (either UI or MapLayer plugin)
QGISEXTERN int type()
{
Expand Down
2 changes: 2 additions & 0 deletions src/plugins/spit/qgsspitplugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ class QgsSpitPlugin: public QObject, public QgisPlugin
QString pVersion;
//! Descrption of the plugin
QString pDescription;
//! Category of the plugin
QString pCategory;
//! Plugin type as defined in QgisPlugin::PLUGINTYPE
int ptype;
//! Pionter to QGIS main application object
Expand Down
9 changes: 8 additions & 1 deletion src/plugins/sqlanywhere/sqlanywhere.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@

static const QString sName = QObject::tr( "SQL Anywhere plugin" );
static const QString sDescription = QObject::tr( "Store vector layers within a SQL Anywhere database" );
static const QString sCategory = QObject::tr( "Layers" );
static const QString sPluginVersion = QObject::tr( "Version 0.1" );
static const QgisPlugin::PLUGINTYPE sPluginType = QgisPlugin::UI;

Expand All @@ -57,7 +58,7 @@ static const QgisPlugin::PLUGINTYPE sPluginType = QgisPlugin::UI;
* @param theQGisInterface - Pointer to the QGIS interface object
*/
SqlAnywhere::SqlAnywhere( QgisInterface * theQgisInterface ):
QgisPlugin( sName, sDescription, sPluginVersion, sPluginType ),
QgisPlugin( sName, sDescription, sCategory, sPluginVersion, sPluginType ),
mQGisIface( theQgisInterface )
{
}
Expand Down Expand Up @@ -229,6 +230,12 @@ QGISEXTERN QString description()
return sDescription;
}

// Return the category
QGISEXTERN QString category()
{
return sCategory;
}

// Return the type (either UI or MapLayer plugin)
QGISEXTERN int type()
{
Expand Down
6 changes: 6 additions & 0 deletions src/plugins/zonal_statistics/qgszonalstatisticsplugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

static const QString name_ = QObject::tr( "Zonal statistics plugin" );
static const QString description_ = QObject::tr( "A plugin to calculate count, sum, mean of rasters for each polygon of a vector layer" );
static const QString category_ = QObject::tr( "Raster" );
static const QString version_ = QObject::tr( "Version 0.1" );

QgsZonalStatisticsPlugin::QgsZonalStatisticsPlugin( QgisInterface* iface ): mIface( iface ), mAction( 0 )
Expand Down Expand Up @@ -89,6 +90,11 @@ QGISEXTERN QString description()
return description_;
}

QGISEXTERN QString category()
{
return category_;
}

QGISEXTERN QString version()
{
return version_;
Expand Down
9 changes: 8 additions & 1 deletion src/ui/qgsdetaileditemwidgetbase.ui
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>246</width>
<height>45</height>
<height>56</height>
</rect>
</property>
<property name="windowTitle">
Expand Down Expand Up @@ -122,6 +122,13 @@
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLabel" name="lblCategory">
<property name="text">
<string>Category label</string>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
Expand Down