Skip to content
Permalink
Browse files
Further improvments to plugin template:
 - use standard convention of ui being named FooGuiBase



git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@7873 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
timlinux committed Jan 8, 2008
1 parent 1dfd005 commit 6d531418432b9b07ff247e6c658955ef8052f35f
@@ -118,7 +118,7 @@ def plugin_file(pluginDir, file):
shutil.copy(template_file('plugin.h'), os.path.join(pluginDir, pluginLCaseName + '.h'))
shutil.copy(template_file('plugingui.cpp'), os.path.join(pluginDir, pluginLCaseName + 'gui.cpp'))
shutil.copy(template_file('plugingui.h'), os.path.join(pluginDir, pluginLCaseName + 'gui.h'))
shutil.copy(template_file('plugingui.ui'), os.path.join(pluginDir, pluginLCaseName + 'gui.ui'))
shutil.copy(template_file('pluginguibase.ui'), os.path.join(pluginDir, pluginLCaseName + 'guibase.ui'))

# Substitute the plugin specific vars in the various files
# This is a brute force approach but its quick and dirty :)
@@ -131,7 +131,7 @@ def plugin_file(pluginDir, file):
plugin_file(pluginDir, pluginLCaseName + '.h'),
plugin_file(pluginDir, pluginLCaseName + 'gui.cpp'),
plugin_file(pluginDir, pluginLCaseName + 'gui.h'),
plugin_file(pluginDir, pluginLCaseName + 'gui.ui') ]
plugin_file(pluginDir, pluginLCaseName + 'guibase.ui') ]

# replace occurences of [pluginlcasename], [pluginname], [plugindescription], [menuname], [menutiem]
# in template with the values from user
@@ -7,7 +7,7 @@ SET ([pluginlcasename]_SRCS
[pluginlcasename]gui.cpp
)

SET ([pluginlcasename]_UIS [pluginlcasename]gui.ui)
SET ([pluginlcasename]_UIS [pluginlcasename]guibase.ui)

SET ([pluginlcasename]_MOC_HDRS
[pluginlcasename].h
@@ -13,12 +13,12 @@
#define [pluginname]GUI_H

#include <QDialog>
#include <ui_[pluginlcasename]gui.h>
#include <ui_[pluginlcasename]guibase.h>

/**
@author Tim Sutton
*/
class [pluginname]Gui : public QDialog, private Ui::[pluginname]Gui
class [pluginname]Gui : public QDialog, private Ui::[pluginname]GuiBase
{
Q_OBJECT
public:
@@ -1,6 +1,6 @@
<ui version="4.0" >
<class>[pluginname]Gui</class>
<widget class="QDialog" name="[pluginname]Gui" >
<class>[pluginname]GuiBase</class>
<widget class="QDialog" name="[pluginname]GuiBase" >
<property name="geometry" >
<rect>
<x>0</x>

0 comments on commit 6d53141

Please sign in to comment.