Make the plugin name, description, and version available for

translation.
Also tidy up the plugin descriptions.


git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@6301 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
g_j_m 2006-12-22 07:43:47 +00:00
parent af3f3e6a6f
commit c6938bdac8
12 changed files with 47 additions and 42 deletions

View File

@ -52,9 +52,9 @@ email : tim@linfiniti.com
static const char * const ident_ = "$Id$";
static const char * const name_ = "CopyrightLabel";
static const char * const description_ = "This plugin overlays copyright information on the rendered map.";
static const char * const version_ = "Version 0.1";
static const QString name_ = QObject::tr("CopyrightLabel");
static const QString description_ = QObject::tr("Draws copyright information");
static const QString version_ = QObject::tr("Version 0.1");
static const QgisPlugin::PLUGINTYPE type_ = QgisPlugin::UI;

View File

@ -46,7 +46,8 @@ Functions:
#define QGISEXTERN extern "C"
#endif
static const char *pluginVersion = "Version 0.2";
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");
/**
* Constructor for the plugin. The plugin is passed a pointer to the main app
* and an interface object that provides access to exposed functions in QGIS.
@ -57,9 +58,9 @@ static const char *pluginVersion = "Version 0.2";
qgisMainWindowPointer(theQGisApp), qGisInterface(theQgisInterFace)
{
/** Initialize the plugin and set the required attributes */
pluginNameQString = "DelimitedTextLayer";
pluginVersionQString = "Version 0.1";
pluginDescriptionQString = "This plugin provides support for delimited text files containing x,y coordinates";
pluginNameQString = tr("DelimitedTextLayer");
pluginVersionQString = pluginVersion;
pluginDescriptionQString = description_;
}
@ -162,13 +163,13 @@ QGISEXTERN QgisPlugin * classFactory(QgisApp * theQGisAppPointer,
// the class may not yet be insantiated when this method is called.
QGISEXTERN QString name()
{
return QString("Add Delimited Text Layer");
return QString(QObject::tr("Add Delimited Text Layer"));
}
// Return the description
QGISEXTERN QString description()
{
return QString("This plugin provides support for delimited text files containing x,y coordinates");
return description_;
}
// Return the type (either UI or MapLayer plugin)

View File

@ -60,9 +60,9 @@
#endif
static const char * const sIdent = "$Id$";
static const char * const sName = "Georeferencer";
static const char * const sDescription = "The georeferencer plugin is a tool for adding projection info to rasters";
static const char * const sPluginVersion = "Version 0.1";
static const QString sName = QObject::tr("Georeferencer");
static const QString sDescription = QObject::tr("Adding projection info to rasters");
static const QString sPluginVersion = QObject::tr("Version 0.1");
static const QgisPlugin::PLUGINTYPE sPluginType = QgisPlugin::UI;
//////////////////////////////////////////////////////////////////////

View File

@ -57,10 +57,10 @@
static const char * const ident_ =
"$Id$";
static const char * const name_ = "GPS Tools";
static const char * const description_ =
"Tools for loading and importing GPS data.";
static const char * const version_ = "Version 0.1";
static const QString name_ = QObject::tr("GPS Tools");
static const QString description_ =
QObject::tr("Tools for loading and importing GPS data");
static const QString version_ = QObject::tr("Version 0.1");
static const QgisPlugin::PLUGINTYPE type_ = QgisPlugin::UI;

View File

@ -77,7 +77,7 @@ extern "C" {
#include "grass_edit.xpm"
#include "grass_region.xpm"
#include "grass_region_edit.xpm"
static const char *pluginVersion = "Version 0.1";
static const QString pluginVersion = QObject::tr("Version 0.1");
/**
* Constructor for the plugin. The plugin is passed a pointer to the main app
@ -89,9 +89,9 @@ QgsGrassPlugin::QgsGrassPlugin(QgisApp * theQGisApp, QgisIface * theQgisInterFac
mQgis(theQGisApp), qGisInterface(theQgisInterFace)
{
/** Initialize the plugin and set the required attributes */
pluginNameQString = "GrassVector";
pluginVersionQString = "0.1";
pluginDescriptionQString = "GRASS layer";
pluginNameQString = tr("GrassVector");
pluginVersionQString = tr("0.1");
pluginDescriptionQString = tr("GRASS layer");
}
QgsGrassPlugin::~QgsGrassPlugin()
@ -831,13 +831,13 @@ extern "C" QgisPlugin * classFactory(QgisApp * theQGisAppPointer, QgisIface * th
// the class may not yet be insantiated when this method is called.
extern "C" QString name()
{
return QString("GRASS");
return QObject::tr("GRASS");
}
// Return the description
extern "C" QString description()
{
return QString("GRASS layer");
return QObject::tr("GRASS layer");
}
// Return the type (either UI or MapLayer plugin)

View File

@ -47,9 +47,9 @@ email : tim@linfiniti.com
static const char * const ident_ = "$Id$";
static const char * const name_ = "Graticule Creator";
static const char * const description_ = "A graticule building plugin.";
static const char * const version_ = "Version 0.1";
static const QString name_ = QObject::tr("Graticule Creator");
static const QString description_ = QObject::tr("Builds a graticule");
static const QString version_ = QObject::tr("Version 0.1");
static const QgisPlugin::PLUGINTYPE type_ = QgisPlugin::UI;
/**
* Constructor for the plugin. The plugin is passed a pointer to the main app

View File

@ -54,9 +54,9 @@ email : tim@linfiniti.com
//
static const char * const ident_ = "$Id$";
static const char * const name_ = "NorthArrow";
static const char * const description_ = "This plugin displays a north arrow overlayed onto the map.";
static const char * const version_ = "Version 0.1";
static const QString name_ = QObject::tr("NorthArrow");
static const QString description_ = QObject::tr("Displays a north arrow overlayed onto the map");
static const QString version_ = QObject::tr("Version 0.1");
static const QgisPlugin::PLUGINTYPE type_ = QgisPlugin::UI;
const double QgsNorthArrowPlugin::PI = 3.14159265358979323846;

View File

@ -53,9 +53,9 @@
#endif
static const char * const sIdent = "$Id$";
static const char * const sName = "[menuitemname]";
static const char * const sDescription = "[plugindescription]";
static const char * const sPluginVersion = "Version 0.1";
static const QString sName = QObject::tr("[menuitemname]");
static const QString sDescription = QObject::tr("[plugindescription]");
static const QString sPluginVersion = QObject::tr("Version 0.1");
static const QgisPlugin::PLUGINTYPE sPluginType = QgisPlugin::UI;
//////////////////////////////////////////////////////////////////////

View File

@ -21,7 +21,7 @@
#define QGISPLUGIN_H
#include <qstring.h>
#include <QString>
#include <qgisapp.h>

View File

@ -59,9 +59,9 @@ email : sbr00pwb@users.sourceforge.net
static const char * const ident_ = "$Id$";
static const char * const name_ = "ScaleBar";
static const char * const description_ = "Plugin to draw scale bar on map";
static const char * const version_ = "Version 0.1";
static const QString name_ = QObject::tr("ScaleBar");
static const QString description_ = QObject::tr("Draws a scale bar");
static const QString version_ = QObject::tr("Version 0.1");
static const QgisPlugin::PLUGINTYPE type_ = QgisPlugin::UI;

View File

@ -39,9 +39,9 @@
static const char * const ident_ = "$Id$";
static const char * const name_ = "SPIT";
static const char * const description_ = "Shapefile to PostgreSQL/PostGIS Import Tool";
static const char * const version_ = "Version 0.1";
static const QString name_ = QObject::tr("SPIT");
static const QString description_ = QObject::tr("Shapefile to PostgreSQL/PostGIS Import Tool");
static const QString version_ = QObject::tr("Version 0.1");
static const QgisPlugin::PLUGINTYPE type_ = QgisPlugin::UI;

View File

@ -30,7 +30,11 @@
#define QGISEXTERN extern "C"
#endif
QgsWFSPlugin::QgsWFSPlugin(QgisApp* app, QgisIface* iface): QgisPlugin("WFS plugin", "A plugin to add WFS layers to the QGIS canvas", "Version 0.0001", QgisPlugin::MAPLAYER), mApp(app), mIface(iface), mWfsDialogAction(0)
static const QString name_ = QObject::tr("WFS plugin");
static const QString description_ = QObject::tr("Adds WFS layers to the QGIS canvas");
static const QString version_ = QObject::tr("Version 0.0001");
QgsWFSPlugin::QgsWFSPlugin(QgisApp* app, QgisIface* iface): QgisPlugin(name_, description_, version_, QgisPlugin::MAPLAYER), mApp(app), mIface(iface), mWfsDialogAction(0)
{
}
@ -72,17 +76,17 @@ QGISEXTERN QgisPlugin * classFactory(QgisApp * theQGisAppPointer, QgisIface * th
QGISEXTERN QString name()
{
return QString("WFS plugin");
return name_;
}
QGISEXTERN QString description()
{
return QString("A plugin to add WFS layers to the QGIS canvas");
return description_;
}
QGISEXTERN QString version()
{
return QString("Version 0.0001");
return version_;
}
QGISEXTERN int type()