Navigation Menu

Skip to content

Commit

Permalink
Further improvments to plugin template:
Browse files Browse the repository at this point in the history
 - 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 6d53141
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/plugins/plugin_builder.py
Expand Up @@ -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 :)
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/plugin_template/CMakeLists.txt
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/plugin_template/plugingui.h
Expand Up @@ -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:
Expand Down
@@ -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>
Expand Down

0 comments on commit 6d53141

Please sign in to comment.