Skip to content
Permalink
Browse files

Further updates to plugin builder - build a valid resources file. Var…

…ious other clean ups. Get rid of xpm useage. Makefile cleanups. I still get compile errors with the generated plugin so its not useable yet.

git-svn-id: http://svn.osgeo.org/qgis/trunk@5169 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
timlinux
timlinux committed Apr 4, 2006
1 parent f00bbe4 commit 0fe2e112606fc473f7e067bd691aa2d7d16c5aef
@@ -77,6 +77,8 @@
system("mkdir $pluginDir");
# copy files to appropriate names
system("cp plugin_template/Makefile.am $pluginDir/");
system("cp plugin_template/plugin.qrc $pluginDir/$pluginLCaseName.qrc");
system("cp plugin_template/plugin.png $pluginDir/$pluginLCaseName.png");
system("cp plugin_template/plugin.cpp $pluginDir/$pluginLCaseName.cpp");
system("cp plugin_template/plugin.h $pluginDir/$pluginLCaseName.h");
system("cp plugin_template/plugingui.cpp $pluginDir/${pluginLCaseName}gui.cpp");
@@ -88,7 +90,7 @@
# This is a brute force approach but its quick and dirty :)
#
# replace [pluginlcasename] in template with the new plugin name
system("perl -pi -e 's/\\\[pluginlcasename\\\]/$pluginLCaseName/g' $pluginDir/*.cpp $pluginDir/*.h $pluginDir/*.am $pluginDir/*.ui");
system("perl -pi -e 's/\\\[pluginlcasename\\\]/$pluginLCaseName/g' $pluginDir/*.qrc $pluginDir/*.cpp $pluginDir/*.h $pluginDir/*.am $pluginDir/*.ui");
# replace [pluginname] in template with the new plugin name
system("perl -pi -e 's/\\\[pluginname\\\]/$pluginName/g' $pluginDir/*.cpp $pluginDir/*.h $pluginDir/*.am $pluginDir/*.ui");
# replace [plugindescription] in template with the description
@@ -42,7 +42,7 @@ ui_%.h: %.ui
## For plugin lib
##

[pluginlcasename]_la_SOURCES = [pluginlcasename].cpp \
libqgis_plugin_[pluginlcasename]_la_SOURCES = [pluginlcasename].cpp \
[pluginlcasename]gui.cpp \
$(plugin_UI)\
$(plugin_MOC)\
@@ -63,12 +63,12 @@ plugin_QRC = [pluginlcasename].qrc

BUILT_SOURCES = $(plugin_MOC) $(plugin_UI) $(plugin_RES)

[pluginlcasename]_la_LIBADD = $(QT_LDADD) \
libqgis_plugin_[pluginlcasename]_la_LIBADD = $(QT_LDADD) \
$(GDAL_LDADD) \
../../core/libqgis_core.la \
../../gui/libqgis_gui.la
[pluginlcasename]_la_CFLAGS = $(CFLAGS) $(EXTRA_CFLAGS) $(DEBUG_QGIS)
[pluginlcasename]_la_CXXFLAGS = $(CXXFLAGS) \
libqgis_plugin_[pluginlcasename]_la_CFLAGS = $(CFLAGS) $(EXTRA_CFLAGS) $(DEBUG_QGIS)
libqgis_plugin_[pluginlcasename]_la_CXXFLAGS = $(CXXFLAGS) \
$(EXTRA_CXXFLAGS) \
$(QT_CXXFLAGS) \
$(DEBUG_QGIS) \
@@ -77,4 +77,4 @@ BUILT_SOURCES = $(plugin_MOC) $(plugin_UI) $(plugin_RES)
-I../../core \
-I../../ui \
-I../../gui
[pluginlcasename]_la_LDFLAGS = -avoid-version -module
libqgis_plugin_[pluginlcasename]_la_LDFLAGS = -avoid-version -module

This file was deleted.

@@ -44,7 +44,6 @@ email : tim@linfiniti.com
#include "plugingui.h"

// xpm for creating the toolbar icon
#include "icon.xpm"
#ifdef WIN32
#define QGISEXTERN extern "C" __declspec( dllexport )
#else
@@ -88,7 +87,8 @@ static const QgisPlugin::PLUGINTYPE sPluginType = QgisPlugin::UI;
void [pluginname]::initGui()
{
Q3PopupMenu *pluginMenu = qGisInterface->getPluginMenu("&[menuname]");
menuId = pluginMenu->insertItem(QIcon(icon),"&[menuitemname]", this, SLOT(run()));
//set teh icon from the resource file
menuId = pluginMenu->insertItem(QIcon(":/[pluginlcasename]/[pluginlcasename].png"),"&[menuitemname]", this, SLOT(run()));

pluginMenu->setWhatsThis(menuId, tr("Replace this with a short description of the what the plugin does"));

Binary file not shown.
@@ -0,0 +1,5 @@
<RCC>
<qresource prefix="/[pluginlcasename]/" >
<file>[pluginlcasename].png</file>
</qresource>
</RCC>

0 comments on commit 0fe2e11

Please sign in to comment.
You can’t perform that action at this time.