summaryrefslogtreecommitdiffstats
path: root/languages/cpp/app_templates/kscons_kmdi
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commit114a878c64ce6f8223cfd22d76a20eb16d177e5e (patch)
treeacaf47eb0fa12142d3896416a69e74cbf5a72242 /languages/cpp/app_templates/kscons_kmdi
downloadtdevelop-114a878c64ce6f8223cfd22d76a20eb16d177e5e.tar.gz
tdevelop-114a878c64ce6f8223cfd22d76a20eb16d177e5e.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdevelop@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'languages/cpp/app_templates/kscons_kmdi')
-rw-r--r--languages/cpp/app_templates/kscons_kmdi/INSTALL83
-rw-r--r--languages/cpp/app_templates/kscons_kmdi/Makefile.am21
-rw-r--r--languages/cpp/app_templates/kscons_kmdi/QUICKSTART164
-rw-r--r--languages/cpp/app_templates/kscons_kmdi/README111
-rw-r--r--languages/cpp/app_templates/kscons_kmdi/SConscript-doc92
-rw-r--r--languages/cpp/app_templates/kscons_kmdi/SConscript-src60
-rw-r--r--languages/cpp/app_templates/kscons_kmdi/SConstruct112
-rw-r--r--languages/cpp/app_templates/kscons_kmdi/VERSION1
-rw-r--r--languages/cpp/app_templates/kscons_kmdi/app.kcfg12
-rw-r--r--languages/cpp/app_templates/kscons_kmdi/app.kdevelop169
-rw-r--r--languages/cpp/app_templates/kscons_kmdi/app_part.cpp159
-rw-r--r--languages/cpp/app_templates/kscons_kmdi/app_part.h74
-rw-r--r--languages/cpp/app_templates/kscons_kmdi/app_part.rc17
-rw-r--r--languages/cpp/app_templates/kscons_kmdi/app_shell.rc33
-rw-r--r--languages/cpp/app_templates/kscons_kmdi/appkmdi.cpp394
-rw-r--r--languages/cpp/app_templates/kscons_kmdi/appkmdi.h82
-rw-r--r--languages/cpp/app_templates/kscons_kmdi/appkmdiView.cpp63
-rw-r--r--languages/cpp/app_templates/kscons_kmdi/appkmdiView.h29
-rw-r--r--languages/cpp/app_templates/kscons_kmdi/kmdikonsole.cpp76
-rw-r--r--languages/cpp/app_templates/kscons_kmdi/kmdikonsole.h32
-rw-r--r--languages/cpp/app_templates/kscons_kmdi/kscons_kmdi.kdevtemplate271
-rw-r--r--languages/cpp/app_templates/kscons_kmdi/kscons_kmdi.pngbin0 -> 13151 bytes
-rw-r--r--languages/cpp/app_templates/kscons_kmdi/main.cpp60
-rwxr-xr-xlanguages/cpp/app_templates/kscons_kmdi/messages.sh60
-rw-r--r--languages/cpp/app_templates/kscons_kmdi/prefs.ui30
-rw-r--r--languages/cpp/app_templates/kscons_kmdi/settings.kcfgc6
-rw-r--r--languages/cpp/app_templates/kscons_kmdi/tips6
27 files changed, 2217 insertions, 0 deletions
diff --git a/languages/cpp/app_templates/kscons_kmdi/INSTALL b/languages/cpp/app_templates/kscons_kmdi/INSTALL
new file mode 100644
index 00000000..edeed594
--- /dev/null
+++ b/languages/cpp/app_templates/kscons_kmdi/INSTALL
@@ -0,0 +1,83 @@
+REQUIREMENTS
+------------
+
+* KDE headers & libraries for kdelibs
+* A Python interpreter for the compilation
+
+scons v0.96.1 or newer is recommended, but it's not required since a
+minimum scons distribution is included in the package.
+
+BUILDING AND INSTALLING
+-----------------------
+
+For configuring, compiling and installing the application and
+if you do have Scons 0.96.1 or newer installed, just run:
+
+$ scons
+$ scons install (as root user)
+
+In case you don't have Scons installed, you can use
+the accompanying minimum scons by running:
+
+$ tar xjvf admin/scons-mini.tar.bz2
+$ ./scons
+$ ./scons install
+
+ADVANCED BUILD FEATURES & DEINSTALLING
+--------------------------------------
+
+In case you want to execute many compilation jobs in parallel (because you
+want to make use of a SMP system or a compile cluster, for instance),
+you can use ('N' is the number of jobs which should be run in parallel):
+
+$ scons -jN
+
+A debug build of the program can be created by running:
+
+$ scons configure debug=1
+$ scons
+
+Finally, the software can be removed from your system by running
+
+$ scons -c install
+
+CONFIGURATION NOTES
+-------------------
+
+The installation scripts are relying on the kde-config program.
+The programs kde-config, qmake, uic and moc must be accesssible
+through your PATH.
+
+Qt and kde may not be installed as expected (in QTDIR and KDEDIR)
+So until kde-config is able to give that information, you may
+have to give those paths. You may also want to tune the build.
+
+In these cases, you must first run "scons configure" with some options
+before running "scons" and "scons install"
+
+Here are some examples :
+On Fedora/Redhat
+$ scons configure kdeincludes=/usr/include/kde/
+On Debian
+$ scons configure qtincludes=/usr/include/qt/ kdeinclude=/usr/include/kde/
+To install in some particular location with additional include paths
+$ scons configure prefix=~/tmp extraincludes=/tmp/include:/usr/local/include
+For AMD64 and platforms where folders are like /usr/lib64
+$ scons configure libsuffix=64
+
+For more options, run
+scons --help
+
+The build system is based on bksys, a build system that replaces
+autoconf, automake and make in a row. Feel free to report your opinion
+about it to the bksys authors.
+
+PACKAGE CREATION
+----------------
+
+RPM packagers can use the DESTDIR environment variable
+$ DESTDIR=/tmp/build-rpm/ scons install
+
+To use checkinstall, pass the following option
+$ checkinstall --fstrans=no --nodoc scons install
+
diff --git a/languages/cpp/app_templates/kscons_kmdi/Makefile.am b/languages/cpp/app_templates/kscons_kmdi/Makefile.am
new file mode 100644
index 00000000..aa6d9b53
--- /dev/null
+++ b/languages/cpp/app_templates/kscons_kmdi/Makefile.am
@@ -0,0 +1,21 @@
+dataFiles = app.kcfg app.kdevelop appkmdi.cpp appkmdi.h appkmdiView.cpp \
+appkmdiView.h INSTALL kmdikonsole.cpp kmdikonsole.h main.cpp \
+messages.sh prefs.ui QUICKSTART README SConscript-doc SConscript-src \
+SConstruct settings.kcfgc tips VERSION \
+app_part.cpp app_part.h app_part.rc app_shell.rc
+
+templateName= kscons_kmdi
+
+### no need to change below:
+template_DATA = $(templateName).kdevtemplate
+templatedir = ${appwizarddatadir}/templates
+
+appwizarddatadir = ${kde_datadir}/kdevappwizard
+$(templateName).tar.gz: ${dataFiles} ${dataFiles}
+ $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles}
+ $(GZIP_COMMAND) -f9 $(templateName).tar
+
+archivedir = ${appwizarddatadir}
+archive_DATA = $(templateName).tar.gz ${templateName}.png
+
+CLEANFILES = *.tar.gz
diff --git a/languages/cpp/app_templates/kscons_kmdi/QUICKSTART b/languages/cpp/app_templates/kscons_kmdi/QUICKSTART
new file mode 100644
index 00000000..ceaf1bda
--- /dev/null
+++ b/languages/cpp/app_templates/kscons_kmdi/QUICKSTART
@@ -0,0 +1,164 @@
+------------------------------------------
+SUMMARY :
+
+scons
+scons install
+
+
+The online documentation of bksys can be found at:
+http://freehackers.org/~tnagy/bksys_manual.html
+
+ ... and now for the quickstart:
+
+CONFIGURING AND COMPILING THE PROJECT(S)
+SCONS TIPS
+MOC PROCESSING
+SCONS MINIMUM DISTRIBUTION
+MORE TIPS
+
+------------------------------------------
+CONFIGURING AND COMPILING THE PROJECT(S)
+
+The program scons is usually launched as "scons"
+When it is not intalled globally, one can run
+"./scons" instead of "scons" (ie : to use the local scons
+that comes with bksys - see below SCONS MINIMUM DISTRIBUTION
+if you do not have scons already)
+
+To compile the project, you will then only need to launch
+scons on the top-level directory, the scripts find and
+cache the environment detected *automatically* :
+-> scons
+
+To clean the project -> scons -c
+
+To install the project -> scons install
+To install as root user -> su -c 'scons install'
+To uninstall the project -> scons -c install
+To uninstall (as root) -> su -c 'scons -c install'
+To consult the help -> scons -h
+
+To (re)configure the project and give particular arguments, use :
+ -> scons configure debug=1
+
+The variables are saved automatically after the first run
+in files named *.cache.py (look at kde.cache.py, ..)
+
+------------------------------------------
+SCONS TIPS
+
+In a subdirectory, it is necessary to launch scons with the -u flag :
+scons -u
+
+This is annoying and you probably want to add this to your .bashrc
+export SCONSFLAGS=-u
+and forget about it :)
+
+To make .deb or .rpm packages of your program, use :
+checkinstall --fstrans=no --nodoc scons install
+(if you have checkinstall on your system of course)
+
+To make scons run (much) faster, consult ./addons/README in bksys
+
+------------------------------------------
+MOC PROCESSING
+
+In qt programs, when a header 'foo.h' contains a class that has
+signals and slots, then 'foo.h' must contain the macro Q_OBJECT
+in order to compile. foo_moc.cpp is usually generated, and is
+used to produce foo_moc.o which is linked with the
+program or the library.
+
+In kde programs, 'foo.moc' is generated instead of foo_moc.cpp,
+and it must be included at the very end of foo.cpp
+(add #include "foo.moc" : this increases the speed of
+compilation a *lot* and makes less object files.
+
+Both modes are provided though, see test6-mocfiesta/
+
+------------------------------------------
+MINIMUM SCONS DISTRIBUTION
+
+A minimum scons distribution is included in the archive
+for convenience to those who do not have scons packages
+for their operating system or their linux
+distribution. For a full and more recent version of scons,
+please consult http://www.scons.org
+
+Including this scons distribution to your archive will add
+about 63kb (compressed) , while including the necessary
+kdescripts (admin/ directory, configure, autom4 cache stuff,
+Makefile.in) can add easily 500kb (compressed).
+
+To compile with the scons distribution :
+* unpack it with :
+ tar xjvf admin/scons-mini.tar.bz2
+* compile the program with :
+ ./scons (instead of just 'scons')
+* install the program with :
+ ./scons install (instead of just 'scons install')
+
+More options :
+* clean the object files with :
+ ./scons -c
+* uninstall the program with with :
+ ./scons -c install
+* create a package :
+ ./scons dist
+
+------------------------------------------
+MORE TIPS
+
+** static libraries **
+With Makefile.am, one had to make static libraries all the time
+because it did not allow having source code in other directories.
+This is not the case anymore with scons, so you can specify
+sources in other directories relative to the sconscript file, ie:
+ test1_sources = ['mainfiles/main.cpp', 'otherfile/program.cpp']
+ myenv.Program( target = "test1", source = test1_sources )
+To encourage you to switch to the new scheme, the static library
+helper has been omitted (look at the end of kde.py if you need one)
+
+** libtool **
+The LaFile build tool is a cheat that allows klibloader to load
+.so files without complaints. If you need real libtool support
+you can have a look to the libtool directory : it can work but
+remember that libtool is broken on many systems (invalid flags
+among others), so when you can work without libtool
+(small projects especially), just do it.
+
+** moc processing **
+As stated above, you should always add #include "foo.moc"
+for your qt classes (Q_OBJECT) to save precious compilation time.
+
+** using a cache **
+It is a good idea to enable the cache feature in SConstruct,
+especially if you are doing experiments (it saves your computer
+from recompiling the same files over and over again ..).
+
+** threading **
+myenv.AppendUnique( CPPFLAGS = ['-DQT_THREAD_SUPPORT', '-D_REENTRANT'] )
+
+** final notes ***
+A medium-sized project containing several targets, libraries and data
+files can be converted very quickly.
+Also, remember that SConscript files are actually python scripts ..
+you can use whatever python feature you want in them, ie: "for" loops,
+this is how the kde helpers work (KDEprogram, KDEshlib ..).
+
+If you are stuck, you can also have a look at more complicated
+bksys-based projects like kdissert or kshaderdesigner
+
+The scons man page and the wiki can be very useful, do not forget to
+consult them when you encounter an issue
+
+------------------------------------------
+
+I hope you will enjoy this alternative to the autotools
+scripts for kde programming, at least as much as I do :
+http://freehackers.org/~tnagy/kdissert/index.html
+
+Happy kde hacking,
+
+Thomas Nagy, 2004, 2005 <tnagyemail-mail@yahoo^fr>
+
diff --git a/languages/cpp/app_templates/kscons_kmdi/README b/languages/cpp/app_templates/kscons_kmdi/README
new file mode 100644
index 00000000..8085c7e7
--- /dev/null
+++ b/languages/cpp/app_templates/kscons_kmdi/README
@@ -0,0 +1,111 @@
+-----------------------------------------------
+Kde scons template quickstart
+Author: Thomas Nagy
+Date: 2005-04-04
+-----------------------------------------------
+
+This README file explains basic concepts necessary
+for starting with this application template.
+
+
+** Building and installing **
+
+* To configure the application run "scons configure"
+ In some rare cases you may need to add flags:
+ scons configure qtincludes=/usr/include/qt3/include kdeincludes=/usr/lib/kde3/include
+
+* After building, launch the application and test the dcop
+ interface by using the command (search a bit) :
+ dcop
+ dcop appname-...
+ dcop appname-... instancenumber
+ dcop appname-... instancenumber switch_colors
+ dcop appname switch_colors
+ Or launch kdcop and search in the menus for your program
+ name and double-click on 'switch_colors()'
+
+* The usual targets call the following scons commands :
+ make -> scons
+ make clean -> scons -c
+ make install -> scons install
+ make uninstall -> scons -c install
+ make dist -> scons dist
+
+* To build apps, use KDEprogram, KDEshlib, etc.
+ these functions are documented at the bottom of kde.py
+ More information can be found in the QUICKSTART
+
+* The scons scripts for building kde applications originate
+ from the 'bksys' distribution. It contains several other examples
+ that detail the kpart building and the dcop interface
+ processing :
+ http://www.kde-apps.org/content/show.php?content=19243
+
+* Extending the scons scripts for building the application :
+ The scons scripts are actually python scripts, so all the
+ usual tricks apply : 'for' and 'while' loops, 'if', 'else' ..
+ consult :
+ http://www.python.org for more information about python
+ http://www.scons.org for more informationabout scons
+
+* Simplify your life : install the project in your home directory for
+testing purposes.
+scons configure prefix=/home/user/dummyfolder/
+In the end when you finished the development you can
+rm -rf /home/user/dummyfolder/
+without fear.
+
+
+** Technologies **
+
+* Build the menus of your application easily
+kde applications now use an xml file (*ui.rc file) to build the menus.
+This allow a great customization of the application. However, when
+programming the menu is shown only after a "make install"
+
+For more details, consult :
+http://devel-home.kde.org/~larrosa/tutorial/p9.html
+http://developer.kde.org/documentation/tutorials/xmlui/preface.html
+
+* Use KConfig XT to create your configuration dialogs and make
+them more maintainable.
+
+For that, you will need to write two simple configuration files
+in the src directory : <myproject>.kcfg and a <settings>.kcfgc
+The configure.in.in will need to be modified : change the line #MIN_CONFIG(3.0.0)
+into #MIN_CONFIG(3.2.0)
+
+Take an example on the many apps found in the kdegames source package and consult :
+http://developer.kde.org/documentation/tutorials/kconfigxt/kconfigxt.html
+
+* With KParts, you can embed other kde components in your program, or make your program
+embeddable in other apps. For example, the kmplayer kpart can be called to play videos
+in your app.
+
+For more details, consult :
+http://www-106.ibm.com/developerworks/library/l-kparts/
+http://developer.kde.org/documentation/tutorials/dot/writing-plugins.html
+http://developer.kde.org/documentation/tutorials/developing-a-plugin-structure/index.html
+
+* With dcop, you can control your app from other applications
+Make sure to include K_DCOP and a kdcop: section in your .h file
+http://developer.kde.org/documentation/tutorials/dot/dcopiface/dcop-interface.html
+
+
+** Documentation **
+
+* For the translations :
+refer to the file po/SConscript and po/messages.sh
+
+1. Download a patched gettext which can be found at:
+ http://public.kde.planetmirror.com/pub/kde/devel/gettext-kde/
+2. Install that gettext in ~/bin/
+3. cd ~/yourproject, export PATH=~/bin:$PATH, export
+KDEDIR=/where_your_KDE3_is
+4. make -f admin/Makefile.common package-messages
+5. make package-messages
+6. Translate the po files (not the pot!!) with kbabel or xemacs
+
+* Do not forget to write the documentation for your kde app
+edit the documentation template index.docbook in doc/
+
diff --git a/languages/cpp/app_templates/kscons_kmdi/SConscript-doc b/languages/cpp/app_templates/kscons_kmdi/SConscript-doc
new file mode 100644
index 00000000..6769a359
--- /dev/null
+++ b/languages/cpp/app_templates/kscons_kmdi/SConscript-doc
@@ -0,0 +1,92 @@
+#! /usr/bin/env python
+## This script demonstrates to build and install
+## the documentation of a kde program with scons
+##
+## Thomas Nagy, 2005
+
+## This file can be reused freely for any project (see COPYING)
+
+## First load the environment set in the top-level SConstruct file
+Import( 'env' )
+myenv=env.Copy()
+
+## The following looks complicated but it is not
+## We first define a function to install all files as documentation
+## The documentation is of course lying in subfolders from here
+## * normal files are installed under KDEDOC/destination
+## * meinproc files are not installed, but processed into a single
+## index.cache.bz2 which is installed afterwards
+
+## This is far more maintainable to have *one* file than
+## having lots of almost empty SConscript in several folders
+
+###################################################################
+# COMMON PART FOR PROCESSING DOCUMENTATION FOLDERS
+###################################################################
+
+import os
+import sys
+import glob
+import SCons.Util
+
+## Define this to 1 if you are writing documentation else to 0 :)
+i_am_a_documentation_writer = 0
+
+## This function uses env imported above
+def processfolder(folder, lang, destination=""):
+ # folder is the folder to process
+ # lang is the language
+ # destination is the subdirectory in KDEDOC
+
+ docfiles = glob.glob(folder+"/???*.*") # file files that are at least 4 chars wide :)
+
+ # warn about errors
+ #if len(lang) != 2:
+ # print "error, lang must be a two-letter string, like 'en'"
+
+ # when the destination is not given, use the folder
+ if len(destination) == 0:
+ destination=folder
+
+ docbook_list = []
+ for file in docfiles:
+
+ # do not process folders
+ if not os.path.isfile(file):
+ continue
+ # do not process the cache file
+ if file == 'index.cache.bz2':
+ continue
+ # ignore invalid files (TODO??)
+ if len( SCons.Util.splitext( file ) ) <= 1 :
+ continue
+
+ ext = SCons.Util.splitext( file )[1]
+
+ # docbook files are processed by meinproc
+ if ext == '.docbook':
+ docbook_list.append( file )
+ continue
+
+ myenv.KDEinstall('KDEDOC', lang+'/'+destination, file)
+
+ # Now process the index.docbook files ..
+ if len(docbook_list) == 0:
+ return
+ if not os.path.isfile( folder+'/index.docbook' ):
+ print "Error, index.docbook was not found in "+folder+'/index.docbook'
+ return
+ if i_am_a_documentation_writer:
+ for file in docbook_list:
+ myenv.Depends( folder+'index.cache.bz2', file )
+ myenv.Meinproc( folder+'/index.cache.bz2', folder+'/index.docbook' )
+ myenv.KDEinstall( 'KDEDOC', lang+'/'+destination, folder+'/index.cache.bz2' )
+
+###################################################################
+# TELL WHICH FOLDERS TO PROCESS
+###################################################################
+
+## Use processfolder for each documentation directory
+processfolder('en/', 'en', '%{APPNAMELC}')
+processfolder('fr/', 'fr', '%{APPNAMELC}')
+
diff --git a/languages/cpp/app_templates/kscons_kmdi/SConscript-src b/languages/cpp/app_templates/kscons_kmdi/SConscript-src
new file mode 100644
index 00000000..746cdf98
--- /dev/null
+++ b/languages/cpp/app_templates/kscons_kmdi/SConscript-src
@@ -0,0 +1,60 @@
+#! /usr/bin/env python
+## This script is a quick test to demonstrate (and test)
+## the bksys moc handling '#include "file.moc"' can be added .. or not
+##
+## Thomas Nagy, 2005
+## This file can be reused freely for any project (see COPYING)
+
+Import('env')
+myenv=env.Copy()
+
+## First build : the shell
+## Each tab in it will hold an instance of the part ..
+
+%{APPNAMELC}_sources="""
+main.cpp
+%{APPNAMELC}kmdi.cpp
+%{APPNAMELC}kmdiView.cpp
+kmdikonsole.cpp
+settings.kcfgc
+prefs.ui
+"""
+# Now that we have our list of sources we can build the program
+myenv.KDEprogram( '%{APPNAMELC}', %{APPNAMELC}_sources ) # main program
+myenv.KDEaddpaths_includes( './ ../' ) # additional paths
+myenv.KDEaddlibs( 'qt-mt kdecore kio kparts kmdi' ) # additional libraries
+
+## Next, the kpart library
+## using KDEshlib, the .so and .la are installed automatically when needed
+
+myenv2=env.Copy()
+%{APPNAMELC}part_sources = '%{APPNAMELC}_part.cpp'
+myenv2.KDEshlib( 'lib%{APPNAMELC}part', %{APPNAMELC}part_sources)
+myenv2.KDEaddpaths_includes( './ #/' ) # the '#' means the top-level directory
+myenv2.KDEaddlibs( 'qt-mt kio kdecore kdeprint kparts' )
+# myenv2.KDEaddflags_link( '-DQT_THREAD_SUPPORT' )
+
+#############################
+## Data files to install
+
+## NOTE: KDEinstall( resource_type, subdir, list of files )
+
+## the .kcfg file
+myenv.KDEinstall( 'KDEKCFG', '', '%{APPNAMELC}.kcfg' )
+
+## the program .desktop file
+myenv.KDEinstall( 'KDEMENU', '/Utilities', '%{APPNAMELC}.desktop' )
+
+## the rc file - named *_shell.rc instead of *ui.rc for kpart apps
+myenv.KDEinstall( 'KDEDATA', '/%{APPNAMELC}', '%{APPNAMELC}_shell.rc' )
+
+## this servicetype desktop file goes in KDEXDG whether the other one goes in KDEMENU
+myenv.KDEinstall( 'KDEXDG', '', '%{APPNAMELC}_part.desktop' )
+
+## the kpart resource file
+myenv.KDEinstall( 'KDEDATA', '/%{APPNAMELC}part', '%{APPNAMELC}_part.rc' )
+
+## Installing icons is easy (hi-16-app-%{APPNAMELC}.png, hi-22-app-%{APPNAMELC}.png)
+#myenv.KDEicon()
+
+## do not forget that this is a python script so even loops are allowed... :)
diff --git a/languages/cpp/app_templates/kscons_kmdi/SConstruct b/languages/cpp/app_templates/kscons_kmdi/SConstruct
new file mode 100644
index 00000000..b82de4e1
--- /dev/null
+++ b/languages/cpp/app_templates/kscons_kmdi/SConstruct
@@ -0,0 +1,112 @@
+#! /usr/bin/env python
+
+"""
+help -> scons -h
+compile -> scons
+clean -> scons -c
+install -> scons install
+uninstall -> scons -c install
+configure -> scons configure prefix=/tmp/ita debug=full extraincludes=/usr/local/include:/tmp/include prefix=/usr/local
+
+Run from a subdirectory -> scons -u
+The variables are saved automatically after the first run (look at cache/kde.cache.py, ..)
+"""
+
+###################################################################
+# LOAD THE ENVIRONMENT AND SET UP THE TOOLS
+###################################################################
+
+## Load the builders in config
+env = Environment( tools=['default', 'generic', 'kde'], toolpath=['./', './admin'])
+#env = Environment( tools=['default', 'generic', 'kde', 'othertool'], toolpath=['./', './admin'])
+
+env.KDEuse("environ rpath")
+#env.KDEuse("environ rpath lang_qt thread nohelp")
+
+###################################################################
+# SCRIPTS FOR BUILDING THE TARGETS
+###################################################################
+
+dirs="""
+src
+doc
+"""
+env.subdirs(dirs)
+
+## Process the translations in the po/ directory
+env.KDElang('po/', '%{APPNAMELC}')
+
+###################################################################
+# CONVENIENCE FUNCTIONS TO EMULATE 'make dist' and 'make distclean'
+###################################################################
+
+### To make a tarball of your masterpiece, use 'scons dist'
+if 'dist' in COMMAND_LINE_TARGETS:
+
+ ## The target scons dist requires the python module shutil which is in 2.3
+ env.EnsurePythonVersion(2, 3)
+
+ import os
+ APPNAME = 'bksys'
+ VERSION = os.popen("cat VERSION").read().rstrip()
+ FOLDER = APPNAME+'-'+VERSION
+ ARCHIVE = FOLDER+'.tar.bz2'
+
+ ## If your app name and version number are defined in 'version.h', use this instead:
+ ## (contributed by Dennis Schridde devurandom@gmx@net)
+ #import re
+ #INFO = dict( re.findall( '(?m)^#define\s+(\w+)\s+(.*)(?<=\S)', open(r"version.h","rb").read() ) )
+ #APPNAME = INFO['APPNAME']
+ #VERSION = INFO['VERSION']
+
+ import shutil
+ import glob
+
+ ## check if the temporary directory already exists
+ if os.path.isdir(FOLDER):
+ shutil.rmtree(FOLDER)
+ if os.path.isfile(ARCHIVE):
+ os.remove(ARCHIVE)
+
+ ## create a temporary directory
+ startdir = os.getcwd()
+ shutil.copytree(startdir, FOLDER)
+
+ ## remove our object files first
+ os.popen("find "+FOLDER+" -name \"*cache*\" | xargs rm -rf")
+ os.popen("find "+FOLDER+" -name \"*.pyc\" | xargs rm -f")
+ #os.popen("pushd %s && scons -c " % FOLDER) # TODO
+
+ ## CVS cleanup
+ os.popen("find "+FOLDER+" -name \"CVS\" | xargs rm -rf")
+ os.popen("find "+FOLDER+" -name \".cvsignore\" | xargs rm -rf")
+
+ ## Subversion cleanup
+ os.popen("find %s -name .svn -type d | xargs rm -rf" % FOLDER)
+
+ ## GNU Arch cleanup
+ os.popen("find "+FOLDER+" -name \"{arch}\" | xargs rm -rf")
+ os.popen("find "+FOLDER+" -name \".arch-i*\" | xargs rm -rf")
+
+ ## Create the tarball (coloured output)
+ print "\033[92m"+"Writing archive "+ARCHIVE+"\033[0m"
+ os.popen("tar cjf "+ARCHIVE+" "+FOLDER)
+
+ ## Remove the temporary directory
+ if os.path.isdir(FOLDER):
+ shutil.rmtree(FOLDER)
+
+ env.Default(None)
+ env.Exit(0)
+
+### Emulate "make distclean"
+if 'distclean' in COMMAND_LINE_TARGETS:
+ ## Remove the cache directory
+ import os, shutil
+ if os.path.isdir(env['CACHEDIR']):
+ shutil.rmtree(env['CACHEDIR'])
+ os.popen("find . -name \"*.pyc\" | xargs rm -rf")
+
+ env.Default(None)
+ env.Exit(0)
+
diff --git a/languages/cpp/app_templates/kscons_kmdi/VERSION b/languages/cpp/app_templates/kscons_kmdi/VERSION
new file mode 100644
index 00000000..2e293c30
--- /dev/null
+++ b/languages/cpp/app_templates/kscons_kmdi/VERSION
@@ -0,0 +1 @@
+%{VERSION}
diff --git a/languages/cpp/app_templates/kscons_kmdi/app.kcfg b/languages/cpp/app_templates/kscons_kmdi/app.kcfg
new file mode 100644
index 00000000..f2c46b64
--- /dev/null
+++ b/languages/cpp/app_templates/kscons_kmdi/app.kcfg
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<kcfg xmlns="http://www.kde.org/standards/kcfg/1.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0
+ http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" >
+ <kcfgfile name="%{APPNAMELC}rc"/>
+ <group name="Preferences">
+ <entry name="showCloseTabsButton" type="Bool">
+ <default>true</default>
+ </entry>
+ </group>
+</kcfg>
diff --git a/languages/cpp/app_templates/kscons_kmdi/app.kdevelop b/languages/cpp/app_templates/kscons_kmdi/app.kdevelop
new file mode 100644
index 00000000..e6a14fff
--- /dev/null
+++ b/languages/cpp/app_templates/kscons_kmdi/app.kdevelop
@@ -0,0 +1,169 @@
+<?xml version = '1.0'?>
+<kdevelop>
+ <general>
+ <author>%{AUTHOR}</author>
+ <email>%{EMAIL}</email>
+ <version>%{VERSION}</version>
+ <projectmanagement>KDevKDEAutoProject</projectmanagement>
+ <primarylanguage>C++</primarylanguage>
+ <keywords>
+ <keyword>C++</keyword>
+ <keyword>Code</keyword>
+ <keyword>Qt</keyword>
+ <keyword>KDE</keyword>
+ </keywords>
+ <projectdirectory>.</projectdirectory>
+ <absoluteprojectpath>false</absoluteprojectpath>
+ <description/>
+ <ignoreparts/>
+ </general>
+ <kdevcppsupport>
+ <qt>
+ <version>3</version>
+ <used>true</used>
+ <includestyle>3</includestyle>
+ <designerintegration>EmbeddedKDevDesigner</designerintegration>
+ </qt>
+ </kdevcppsupport>
+
+ <kdevautoproject>
+ <general>
+ <activetarget>src/%{APPNAMELC}</activetarget>
+ <useconfiguration>debug</useconfiguration>
+ </general>
+ <run>
+ <mainprogram>src/%{APPNAMELC}</mainprogram>
+ <terminal>false</terminal>
+ </run>
+ <make>
+ <envvars>
+ <envvar value="1" name="WANT_AUTOCONF_2_5" />
+ <envvar value="1" name="WANT_AUTOMAKE_1_6" />
+ </envvars>
+ <abortonerror>false</abortonerror>
+ <numberofjobs>1</numberofjobs>
+ <dontact>false</dontact>
+ <makebin/>
+ </make>
+ <configurations>
+ <optimized>
+ <builddir>optimized</builddir>
+ <ccompiler>kdevgccoptions</ccompiler>
+ <cxxcompiler>kdevgppoptions</cxxcompiler>
+ <f77compiler>kdevg77options</f77compiler>
+ <cxxflags>-O2 -g0</cxxflags>
+ </optimized>
+ <debug>
+ <configargs>--enable-debug=full</configargs>
+ <builddir>debug</builddir>
+ <ccompiler>kdevgccoptions</ccompiler>
+ <cxxcompiler>kdevgppoptions</cxxcompiler>
+ <f77compiler>kdevg77options</f77compiler>
+ <cxxflags>-O0 -g3</cxxflags>
+ </debug>
+ </configurations>
+ </kdevautoproject>
+ <kdevfileview>
+ <groups>
+ <group pattern="*.cpp;*.cxx;*.h" name="Sources" />
+ <group pattern="*.ui" name="User Interface" />
+ <group pattern="*.png" name="Icons" />
+ <group pattern="*.po;*.ts" name="Translations" />
+ <group pattern="*" name="Others" />
+ </groups>
+ <tree>
+ <hidenonprojectfiles>false</hidenonprojectfiles>
+ <hidepatterns>*.o,*.lo,CVS</hidepatterns>
+ </tree>
+ </kdevfileview>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>ada</toc>
+ <toc>ada_bugs_gcc</toc>
+ <toc>bash</toc>
+ <toc>bash_bugs</toc>
+ <toc>clanlib</toc>
+ <toc>w3c-dom-level2-html</toc>
+ <toc>fortran_bugs_gcc</toc>
+ <toc>gnome1</toc>
+ <toc>gnustep</toc>
+ <toc>gtk</toc>
+ <toc>gtk_bugs</toc>
+ <toc>haskell</toc>
+ <toc>haskell_bugs_ghc</toc>
+ <toc>java_bugs_gcc</toc>
+ <toc>java_bugs_sun</toc>
+ <toc>pascal_bugs_fp</toc>
+ <toc>php</toc>
+ <toc>php_bugs</toc>
+ <toc>perl</toc>
+ <toc>perl_bugs</toc>
+ <toc>python</toc>
+ <toc>python_bugs</toc>
+ <toc>ruby</toc>
+ <toc>ruby_bugs</toc>
+ <toc>sdl</toc>
+ <toc>w3c-svg</toc>
+ <toc>sw</toc>
+ <toc>w3c-uaag10</toc>
+ <toc>wxwidgets_bugs</toc>
+ </ignoretocs>
+ <ignoreqt_xml>
+ <toc>qmake User Guide</toc>
+ </ignoreqt_xml>
+ </kdevdoctreeview>
+ <kdevdebugger>
+ <general>
+ <dbgshell>libtool</dbgshell>
+ <programargs/>
+ <gdbpath/>
+ <breakonloadinglibs>true</breakonloadinglibs>
+ <separatetty>false</separatetty>
+ <floatingtoolbar>false</floatingtoolbar>
+ <runappinappdirectory>true</runappinappdirectory>
+ </general>
+ <display>
+ <staticmembers>false</staticmembers>
+ <demanglenames>true</demanglenames>
+ </display>
+ </kdevdebugger>
+ <kdevfilecreate>
+ <filetypes/>
+ <useglobaltypes>
+ <type ext="ui" />
+ <type ext="cpp" />
+ <type ext="h" />
+ </useglobaltypes>
+ </kdevfilecreate>
+ <kdevcvs>
+ <cvsoptions>-f</cvsoptions>
+ <commitoptions/>
+ <updateoptions>-dP</updateoptions>
+ <addoptions/>
+ <removeoptions>-f</removeoptions>
+ <diffoptions>-u3 -p</diffoptions>
+ <logoptions/>
+ <rshoptions/>
+ </kdevcvs>
+ <cppsupportpart>
+ <codecompletion/>
+ <filetemplates>
+ <choosefiles>false</choosefiles>
+ <interfaceURL/>
+ <implementationURL/>
+ <interfacesuffix>.h</interfacesuffix>
+ <implementationsuffix>.cpp</implementationsuffix>
+ <lowercasefilenames>true</lowercasefilenames>
+ </filetemplates>
+ </cppsupportpart>
+ <kdevclassview>
+ <folderhierarchy>true</folderhierarchy>
+ <depthoffolders>2</depthoffolders>
+ </kdevclassview>
+ <kdevdocumentation>
+ <projectdoc>
+ <docsystem>Doxygen Documentation Collection</docsystem>
+ <docurl>%{APPNAMELC}.tag</docurl>
+ </projectdoc>
+ </kdevdocumentation>
+</kdevelop>
diff --git a/languages/cpp/app_templates/kscons_kmdi/app_part.cpp b/languages/cpp/app_templates/kscons_kmdi/app_part.cpp
new file mode 100644
index 00000000..71155138
--- /dev/null
+++ b/languages/cpp/app_templates/kscons_kmdi/app_part.cpp
@@ -0,0 +1,159 @@
+%{CPP_TEMPLATE}
+
+#include "%{APPNAMELC}_part.h"
+
+#include <kparts/genericfactory.h>
+#include <kinstance.h>
+#include <kaction.h>
+#include <kstdaction.h>
+#include <kfiledialog.h>
+#include <kglobal.h>
+#include <klocale.h>
+
+#include <qfile.h>
+#include <qtextstream.h>
+#include <qmultilineedit.h>
+
+typedef KParts::GenericFactory<%{APPNAMELC}Part> %{APPNAMELC}PartFactory;
+K_EXPORT_COMPONENT_FACTORY( lib%{APPNAMELC}part, %{APPNAMELC}PartFactory );
+
+%{APPNAMELC}Part::%{APPNAMELC}Part( QWidget *parentWidget, const char *widgetName,
+ QObject *parent, const char *name, const QStringList & /*args*/)
+ : KParts::ReadWritePart(parent)
+{
+ // we need an instance
+ setInstance( %{APPNAMELC}PartFactory::instance() );
+
+ // this should be your custom internal widget
+ m_widget = new QMultiLineEdit( parentWidget, widgetName );
+
+ // notify the part that this is our internal widget
+ setWidget(m_widget);
+
+ // create our actions
+ KStdAction::open(this, SLOT(fileOpen()), actionCollection());
+ KStdAction::saveAs(this, SLOT(fileSaveAs()), actionCollection());
+ KStdAction::save(this, SLOT(save()), actionCollection());
+
+ // set our XML-UI resource file
+ setXMLFile("%{APPNAMELC}_part.rc");
+
+ // we are read-write by default
+ setReadWrite(true);
+
+ // we are not modified since we haven't done anything yet
+ setModified(false);
+}
+
+%{APPNAMELC}Part::~%{APPNAMELC}Part()
+{
+}
+
+KAboutData *%{APPNAMELC}Part::createAboutData()
+{
+ // The non-i18n name here must be the same as the directory in
+ // which the part's rc file is installed
+ KAboutData *aboutData = new KAboutData("%{APPNAMELC}part", I18N_NOOP("%{APPNAMELC}Part"), "0.0.1");
+ aboutData->addAuthor("%{AUTHOR}", 0, "%{EMAIL}");
+ return aboutData;
+}
+
+void %{APPNAMELC}Part::setReadWrite(bool rw)
+{
+ // notify your internal widget of the read-write state
+ m_widget->setReadOnly(!rw);
+ if (rw)
+ connect(m_widget, SIGNAL(textChanged()),
+ this, SLOT(setModified()));
+ else
+ {
+ disconnect(m_widget, SIGNAL(textChanged()),
+ this, SLOT(setModified()));
+ }
+
+ ReadWritePart::setReadWrite(rw);
+}
+
+void %{APPNAMELC}Part::setModified(bool modified)
+{
+ // get a handle on our Save action and make sure it is valid
+ KAction *save = actionCollection()->action(KStdAction::stdName(KStdAction::Save));
+ if (!save)
+ return;
+
+ // if so, we either enable or disable it based on the current
+ // state
+ if (modified)
+ save->setEnabled(true);
+ else
+ save->setEnabled(false);
+
+ // in any event, we want our parent to do it's thing
+ ReadWritePart::setModified(modified);
+}
+
+bool %{APPNAMELC}Part::openFile()
+{
+ // m_file is always local so we can use QFile on it
+ QFile file(m_file);
+ if (file.open(IO_ReadOnly) == false)
+ return false;
+
+ // our example widget is text-based, so we use QTextStream instead
+ // of a raw QDataStream
+ QTextStream stream(&file);
+ QString str;
+ while (!stream.eof())
+ str += stream.readLine() + "\n";
+
+ file.close();
+
+ // now that we have the entire file, display it
+ m_widget->setText(str);
+
+ // just for fun, set the status bar
+ emit setStatusBarText( m_url.prettyURL() );
+
+ return true;
+}
+
+bool %{APPNAMELC}Part::saveFile()
+{
+ // if we aren't read-write, return immediately
+ if (isReadWrite() == false)
+ return false;
+
+ // m_file is always local, so we use QFile
+ QFile file(m_file);
+ if (file.open(IO_WriteOnly) == false)
+ return false;
+
+ // use QTextStream to dump the text to the file
+ QTextStream stream(&file);
+ stream << m_widget->text();
+
+ file.close();
+
+ return true;
+}
+
+void %{APPNAMELC}Part::fileOpen()
+{
+ // this slot is called whenever the File->Open menu is selected,
+ // the Open shortcut is pressed (usually CTRL+O) or the Open toolbar
+ // button is clicked
+ QString file_name = KFileDialog::getOpenFileName();
+
+ if (file_name.isEmpty() == false)
+ openURL(file_name);
+}
+
+void %{APPNAMELC}Part::fileSaveAs()
+{
+ // this slot is called whenever the File->Save As menu is selected,
+ QString file_name = KFileDialog::getSaveFileName();
+ if (file_name.isEmpty() == false)
+ saveAs(file_name);
+}
+
+#include "%{APPNAMELC}_part.moc"
diff --git a/languages/cpp/app_templates/kscons_kmdi/app_part.h b/languages/cpp/app_templates/kscons_kmdi/app_part.h
new file mode 100644
index 00000000..e1dd002b
--- /dev/null
+++ b/languages/cpp/app_templates/kscons_kmdi/app_part.h
@@ -0,0 +1,74 @@
+%{H_TEMPLATE}
+
+#ifndef _%{APPNAMEUC}PART_H_
+#define _%{APPNAMEUC}PART_H_
+
+#include <kparts/part.h>
+#include <kparts/factory.h>
+
+class QMultiLineEdit;
+class QWidget;
+class QPainter;
+class KURL;
+class KAboutData;
+
+/**
+ * This is a "Part". It that does all the real work in a KPart
+ * application.
+ *
+ * @short Main Part
+ * @author %{AUTHOR}
+ * @version %{VERSION}
+ */
+class %{APPNAMELC}Part : public KParts::ReadWritePart
+{
+ Q_OBJECT
+public:
+ /**
+ * Default constructor
+ */
+ %{APPNAMELC}Part(QWidget *parentWidget, const char *widgetName,
+ QObject *parent, const char *name, const QStringList & /*args*/);
+
+ /**
+ * Destructor
+ */
+ virtual ~%{APPNAMELC}Part();
+
+ /**
+ * This is a virtual function inherited from KParts::ReadWritePart.
+ * A shell will use this to inform this Part if it should act
+ * read-only
+ */
+ virtual void setReadWrite(bool rw);
+
+ /**
+ * Reimplemented to disable and enable Save action
+ */
+ virtual void setModified(bool modified);
+
+ /**
+ * About data for the part
+ */
+ static KAboutData *createAboutData();
+
+protected:
+ /**
+ * This must be implemented by each part
+ */
+ virtual bool openFile();
+
+ /**
+ * This must be implemented by each read-write part
+ */
+ virtual bool saveFile();
+
+protected slots:
+ void fileOpen();
+ void fileSaveAs();
+
+private:
+ QMultiLineEdit *m_widget;
+};
+
+#endif // _%{APPNAMEUC}PART_H_
diff --git a/languages/cpp/app_templates/kscons_kmdi/app_part.rc b/languages/cpp/app_templates/kscons_kmdi/app_part.rc
new file mode 100644
index 00000000..cec8ec5c
--- /dev/null
+++ b/languages/cpp/app_templates/kscons_kmdi/app_part.rc
@@ -0,0 +1,17 @@
+<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
+<kpartgui name="%{APPNAMELC}_part" version="1">
+<MenuBar>
+ <Menu name="file">
+ <Action name="file_open"/>
+ <Separator/>
+ <Action name="file_save"/>
+ <Action name="file_save_as"/>
+ </Menu>
+</MenuBar>
+<ToolBar name="mainToolBar">
+ <Action name="file_open"/>
+ <Action name="file_save"/>
+ <Action name="file_print"/>
+ <Separator/>
+</ToolBar>
+</kpartgui>
diff --git a/languages/cpp/app_templates/kscons_kmdi/app_shell.rc b/languages/cpp/app_templates/kscons_kmdi/app_shell.rc
new file mode 100644
index 00000000..c8b2bb98
--- /dev/null
+++ b/languages/cpp/app_templates/kscons_kmdi/app_shell.rc
@@ -0,0 +1,33 @@
+<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
+<kpartgui name="%{APPNAMELC}_shell" version="1">
+<MenuBar>
+ <Menu noMerge="1" name="file"><text>&amp;File</text>
+ <Action name="file_new"/>
+ <Merge/>
+ <Separator/>
+ <Action name="file_close"/>
+ <Separator/>
+ <Action name="file_quit"/>
+ </Menu>
+ <Menu name="view" noMerge="1"><text>&amp;View</text>
+ </Menu>
+ <Menu noMerge="1" name="settings"><text>&amp;Settings</text>
+ <Action name="options_show_toolbar"/>
+ <Action name="options_show_statusbar"/>
+ <Merge name="show_merge"/>
+ <Separator/>
+ <Action name="options_configure_keybinding"/>
+ <Action name="options_configure_toolbars"/>
+ <Action name="options_configure"/>
+ <Merge name="configure_merge"/>
+ <Separator/>
+ <Merge/>
+ </Menu>
+</MenuBar>
+<ToolBar noMerge="1" name="mainToolBar"><text>Main Toolbar</text>
+ <Action name="file_new"/>
+ <Action name="file_close"/>
+ <Merge/>
+ <Action name="help"/>
+</ToolBar>
+</kpartgui>
diff --git a/languages/cpp/app_templates/kscons_kmdi/appkmdi.cpp b/languages/cpp/app_templates/kscons_kmdi/appkmdi.cpp
new file mode 100644
index 00000000..be5d8862
--- /dev/null
+++ b/languages/cpp/app_templates/kscons_kmdi/appkmdi.cpp
@@ -0,0 +1,394 @@
+%{CPP_TEMPLATE}
+
+#include <qdragobject.h>
+#include <qpainter.h>
+#include <qpaintdevicemetrics.h>
+#include <qdragobject.h>
+#include <qstatusbar.h>
+#include <qtoolbutton.h>
+
+#include <kdebug.h>
+#include <kglobal.h>
+#include <ktip.h>
+#include <kparts/part.h>
+#include <kparts/partmanager.h>
+
+#include <kio/netaccess.h>
+#include <kurl.h>
+#include <kurldrag.h>
+#include <kurlrequesterdlg.h>
+#include <kconfig.h>
+#include <kconfigdialog.h>
+#include <klibloader.h>
+#include <kaboutdata.h>
+#include <kfiledialog.h>
+#include <kactionclasses.h>
+#include <kglobal.h>
+#include <klocale.h>
+#include <kiconloader.h>
+#include <kdeversion.h>
+#include <kmenubar.h>
+#include <kstatusbar.h>
+#include <kkeydialog.h>
+#include <kmessagebox.h>
+#include <ktabwidget.h>
+#include <kedittoolbar.h>
+#include <kdeversion.h>
+#include <kstdaccel.h>
+#include <kaction.h>
+#include <kstdaction.h>
+
+#include "settings.h"
+#include "prefs.h"
+#include "%{APPNAMELC}kmdiView.h"
+#include "kmdikonsole.h"
+#include "%{APPNAMELC}kmdi.h"
+
+%{APPNAMELC}kmdi::%{APPNAMELC}kmdi(KMdi::MdiMode mode)
+ : KMdiMainFrm( 0, "%{APPNAMELC}", mode )
+{
+ resize( 800, 600 ); // start at 800x600 the first time
+
+ setManagedDockPositionModeEnabled(true);
+ setStandardMDIMenuEnabled(false);
+
+ m_manager = new KParts::PartManager(this);
+ connect(m_manager, SIGNAL(activePartChanged(KParts::Part*)),
+ this, SLOT(createGUI(KParts::Part*)) );
+
+#if KDE_IS_VERSION(3, 3, 0)
+ setToolviewStyle( KMdi::TextAndIcon );
+ tabWidget()->setHoverCloseButton( false );
+#endif
+
+ setMenuForSDIModeSysButtons( menuBar() );
+ setManagedDockPositionModeEnabled(true);
+
+ m_console = NULL;
+
+ // accept dnd
+ setAcceptDrops(true);
+
+ // then, setup our actions
+ setupActions();
+
+ //createShellGUI( true );
+
+ // and a status bar
+ statusBar()->show();
+
+ connect( this, SIGNAL( viewActivated( KMdiChildView * ) ), this, SLOT( currentChanged( KMdiChildView * ) ) );
+
+ m_console = new kmdikonsole(this, "konsole");
+ m_console->setIcon( SmallIcon("konsole") );
+ m_console->setCaption( i18n("Terminal") );
+ addToolWindow( m_console, KDockWidget::DockBottom, getMainDockWidget(), 20 );
+
+
+#if KDE_IS_VERSION(3, 3, 0)
+ if (Settings::showCloseTabsButton())
+ {
+ QToolButton *but = new QToolButton(tabWidget());
+ but->setIconSet(SmallIcon("tab_remove"));
+ but->adjustSize();
+ but->hide();
+ connect(but, SIGNAL(clicked()), actionCollection()->action( "file_close" ), SIGNAL(activated()));
+ tabWidget()->setCornerWidget(but, TopRight);
+ }
+#endif
+
+ // apply the saved mainwindow settings, if any, and ask the mainwindow
+ // to automatically save settings if changed: window size, toolbar
+ // position, icon size, etc.
+ setAutoSaveSettings();
+
+ // Read the dock config only if the app was started at least only once - kmdi is tricky
+ KConfig *cfg = new KConfig("%{APPNAMELC}_dockposrc");
+ if (cfg->readNumEntry("%{APPNAMELC}_main_dock_settings", 0) == 1) manager()->readConfig(cfg);
+ cfg->writeEntry("%{APPNAMELC}_main_dock_settings", 1);
+ delete cfg;
+
+ showTipOnStart();
+}
+
+%{APPNAMELC}kmdi::~%{APPNAMELC}kmdi()
+{
+ // Write the dock config on exit
+ KConfig *cfg = new KConfig("%{APPNAMELC}_dockposrc");
+ manager()->writeConfig(cfg);
+ delete cfg;
+ delete m_console;
+}
+
+void %{APPNAMELC}kmdi::setupActions()
+{
+ setXMLFile("%{APPNAMELC}_shell.rc");
+
+ KStdAction::openNew(this, SLOT(slotFileNew()), actionCollection());
+
+ KStdAction::tipOfDay( this, SLOT( showTip() ), actionCollection()
+ )->setWhatsThis(i18n("This shows useful tips on the use of this application."));
+
+ KStdAction::close(this, SLOT(slotFileClose()), actionCollection());
+ KStdAction::quit(this, SLOT(slotFileQuit()), actionCollection());
+
+ m_toolbarAction = KStdAction::showToolbar(this, SLOT(optionsShowToolbar()), actionCollection());
+ m_statusbarAction = KStdAction::showStatusbar(this, SLOT(optionsShowStatusbar()), actionCollection());
+
+ KStdAction::keyBindings(this, SLOT(optionsConfigureKeys()), actionCollection());
+ KStdAction::preferences(this, SLOT(optionsPreferences()), actionCollection());
+
+ KAction* action = KStdAction::configureToolbars(this,
+ SLOT(optionsConfigureToolbars()), actionCollection());
+
+ createGUI( NULL );
+}
+
+void %{APPNAMELC}kmdi::showTip()
+{
+ KTipDialog::showTip(this,QString::null,true);
+}
+
+void %{APPNAMELC}kmdi::showTipOnStart()
+{
+ KTipDialog::showTip(this);
+}
+
+void %{APPNAMELC}kmdi::slotFileNew()
+{
+ %{APPNAMELC}kmdiView *view = new %{APPNAMELC}kmdiView(this);
+ m_manager->addPart( view->part() );
+
+ addWindow( view );
+
+ // add the tree view to the widget stack
+ m_views += view;
+
+ currentChanged( view );
+}
+
+void %{APPNAMELC}kmdi::openURL(const KURL & url)
+{
+ // check if the url is not already opened first
+ QValueList<%{APPNAMELC}kmdiView*>::iterator it = m_views.begin();
+ QValueList<%{APPNAMELC}kmdiView*>::iterator end = m_views.end();
+ for (; it != end; ++it)
+ {
+ %{APPNAMELC}kmdiView *view = *it;
+ if (view->part()->url() == url)
+ {
+ activateView(view);
+ return;
+ }
+ }
+
+ %{APPNAMELC}kmdiView *view = new %{APPNAMELC}kmdiView(this);
+ m_manager->addPart( view->part() );
+
+ addWindow( view );
+
+ m_views += view;
+
+ view->part()->openURL(url);
+ currentChanged( view );
+}
+
+void %{APPNAMELC}kmdi::currentChanged( KMdiChildView *current )
+{
+ //kdWarning()<<"current view changed"<<endl;
+ if (!current)
+ {
+ m_manager->setActivePart(NULL);
+ //setCaption("()");
+ return;
+ }
+
+ // switch to the corresponding document
+ if ( m_views.contains( (%{APPNAMELC}kmdiView*) current ) )
+ {
+ %{APPNAMELC}kmdiView *view = (%{APPNAMELC}kmdiView*) current;
+ //view->updateCaption();
+ m_manager->setActivePart( view->part() );
+ }
+}
+
+void %{APPNAMELC}kmdi::slotFileClose()
+{
+ requestClose( activeWindow() );
+}
+
+bool %{APPNAMELC}kmdi::requestClose(KMdiChildView* v)
+{
+ // kdWarning()<<"closing view"<<v<<endl;
+ // if (view == NULL)
+ // return;
+
+ if (v == NULL)
+ {
+ if ( m_views.count() == 1)
+ {
+ %{APPNAMELC}kmdiView *view = m_views[0];
+ if (view->part()->queryClose())
+ {
+ m_manager->removePart( view->part() );
+
+ closeWindow( view );
+ m_views.clear();
+ setCaption("kdissert");
+ return true;
+ }
+ return false;
+ }
+ return true;
+ }
+
+ %{APPNAMELC}kmdiView *view = (%{APPNAMELC}kmdiView*) v;
+ if ( m_views.contains( view ) )
+ {
+ m_views.remove( view );
+ if ( view->part()->queryClose() )
+ {
+ m_manager->removePart( view->part() );
+
+ closeWindow( view );
+ return true;
+ }
+ return false;
+ }
+ return true;
+}
+
+void %{APPNAMELC}kmdi::slotFileQuit()
+{
+ close();
+}
+
+void %{APPNAMELC}kmdi::optionsShowToolbar()
+{
+ if (m_toolbarAction->isChecked())
+ toolBar()->show();
+ else
+ toolBar()->hide();
+}
+
+void %{APPNAMELC}kmdi::optionsShowStatusbar()
+{
+ if (m_statusbarAction->isChecked())
+ statusBar()->show();
+ else
+ statusBar()->hide();
+}
+
+void %{APPNAMELC}kmdi::optionsConfigureKeys()
+{
+ //KKeyDialog::configure(actionCollection());
+ KKeyDialog dlg( false, this );
+ QPtrList<KXMLGUIClient> clients = guiFactory()->clients();
+
+ for( QPtrListIterator<KXMLGUIClient> it( clients ); it.current(); ++it )
+ dlg.insert ( (*it)->actionCollection(), (*it)->instance()->aboutData()->programName() );
+
+ dlg.configure();
+
+ for (int i=0; i<m_views.count(); i++)
+ {
+ m_views[i]->part()->reloadXML();
+ }
+}
+
+void %{APPNAMELC}kmdi::optionsConfigureToolbars()
+{
+ //saveMainWindowSettings(KGlobal::config(), autoSaveGroup());
+}
+
+void %{APPNAMELC}kmdi::newToolbarConfig()
+{
+ // This slot is called when user clicks "Ok" or "Apply" in the toolbar editor.
+ // recreate our GUI, and re-apply the settings (e.g. "text under icons", etc.)
+ //createGUI();
+ //applyMainWindowSettings(KGlobal::config(), autoSaveGroup());
+}
+
+void %{APPNAMELC}kmdi::optionsPreferences()
+{
+ // The preference dialog is derived from prefs-base.ui which is subclassed into Prefs
+ //
+ // compare the names of the widgets in the .ui file
+ // to the names of the variables in the .kcfg file
+ if (KConfigDialog::showDialog("settings"))
+ return;
+
+ KConfigDialog *dialog = new KConfigDialog(this, "settings", Settings::self(), KDialogBase::Swallow);
+ dialog->addPage(new prefs(), i18n("General"), "package_settings");
+ connect(dialog, SIGNAL(settingsChanged()), this, SLOT(settingsChanged()));
+ dialog->show();
+}
+
+void %{APPNAMELC}kmdi::settingsChanged()
+{
+ // propagate the changes to our views
+ /*QValueList<%{APPNAMELC}kmdiView*>::iterator it = m_views.begin();
+ QValueList<%{APPNAMELC}kmdiView*>::iterator end = m_views.end();
+ for (; it != end; ++it)
+ {
+ %{APPNAMELC}kmdiView *view = *it;
+ view->settingsChanged();
+ }*/
+}
+
+void %{APPNAMELC}kmdi::changeStatusbar(const QString& text)
+{
+ // display the text on the statusbar
+ statusBar()->message(text, 2000);
+}
+
+void %{APPNAMELC}kmdi::dragEnterEvent(QDragEnterEvent *event)
+{
+ // accept uri drops only
+ event->accept(KURLDrag::canDecode(event));
+}
+
+void %{APPNAMELC}kmdi::dropEvent(QDropEvent *event)
+{
+ KURL::List urls;
+
+ // see if we can decode a URI.. if not, just ignore it
+ if (KURLDrag::decode(event, urls) && !urls.isEmpty())
+ {
+ // okay, we have a URI.. process it
+ const KURL &url = urls.first();
+
+ // load in the file
+ openURL(url);
+ }
+}
+
+bool %{APPNAMELC}kmdi::queryClose()
+{
+ QValueList<%{APPNAMELC}kmdiView*>::iterator it;
+
+ // check if we can close all documents
+ for (it = m_views.begin(); it != m_views.end(); ++it)
+ {
+ // kdWarning()<<"searching for the part"<<endl;
+ %{APPNAMELC}kmdiView *view = *it;
+ if (!view->part()->queryClose())
+ {
+ return false;
+ }
+ }
+
+ // and now close the documents
+ for (it = m_views.begin(); it != m_views.end(); ++it)
+ {
+ // now close all views
+ %{APPNAMELC}kmdiView *view = *it;
+
+ m_manager->removePart( view->part() );
+ closeWindow( view );
+ }
+
+ return true;
+}
+
+#include "%{APPNAMELC}kmdi.moc"
diff --git a/languages/cpp/app_templates/kscons_kmdi/appkmdi.h b/languages/cpp/app_templates/kscons_kmdi/appkmdi.h
new file mode 100644
index 00000000..370a3034
--- /dev/null
+++ b/languages/cpp/app_templates/kscons_kmdi/appkmdi.h
@@ -0,0 +1,82 @@
+%{H_TEMPLATE}
+
+#ifndef _%{APPNAMEUC}KMDI_H
+#define _%{APPNAMEUC}KMDI_H
+
+#include <qvaluelist.h>
+
+#include <kapplication.h>
+#include <kmdimainfrm.h>
+#include <kurl.h>
+
+class KToggleAction;
+class KRecentFilesAction;
+
+class kmdikonsole;
+class KMdiChildView;
+class QWidgetStack;
+class %{APPNAMELC}kmdiView;
+class TextProperties;
+class MiscProperties;
+
+/**
+ * This class serves as the main window for %{APPNAMELC}kmdi. It handles the
+ * menus, toolbars, and status bars.
+ *
+ * @short Main window class
+ */
+class %{APPNAMELC}kmdi : public KMdiMainFrm
+{
+ Q_OBJECT
+ public:
+ %{APPNAMELC}kmdi( KMdi::MdiMode mode );
+ virtual ~%{APPNAMELC}kmdi();
+ void showTipOnStart();
+
+ public slots:
+ void openURL( const KURL& );
+
+ protected:
+ virtual void dragEnterEvent(QDragEnterEvent *event);
+ virtual void dropEvent(QDropEvent *event);
+ virtual bool queryClose();
+
+ private slots:
+ void slotFileNew();
+ void slotFileClose();
+ void slotFileQuit();
+
+ /// this is called when a new file is saved
+ void showTip();
+
+ void optionsShowToolbar();
+ void optionsShowStatusbar();
+ void optionsConfigureKeys();
+ void optionsConfigureToolbars();
+ void optionsPreferences();
+ void newToolbarConfig();
+
+
+ void changeStatusbar(const QString& text);
+
+ void currentChanged( KMdiChildView *current );
+ bool requestClose(KMdiChildView* view);
+
+ void settingsChanged();
+
+ private:
+ void setupAccel();
+ void setupActions();
+
+ QValueList<%{APPNAMELC}kmdiView*> m_views;
+
+ KToggleAction *m_toolbarAction;
+ KToggleAction *m_statusbarAction;
+
+ KParts::PartManager *m_manager;
+
+ kmdikonsole *m_console;
+};
+
+#endif // _%{APPNAMEUC}KMDI_H
+
diff --git a/languages/cpp/app_templates/kscons_kmdi/appkmdiView.cpp b/languages/cpp/app_templates/kscons_kmdi/appkmdiView.cpp
new file mode 100644
index 00000000..c4cfbf65
--- /dev/null
+++ b/languages/cpp/app_templates/kscons_kmdi/appkmdiView.cpp
@@ -0,0 +1,63 @@
+%{CPP_TEMPLATE}
+
+#include <qpixmap.h>
+#include <qlayout.h>
+
+#include <kiconloader.h>
+#include <klocale.h>
+#include <kmdichildview.h>
+#include <kdebug.h>
+#include <klibloader.h>
+#include <kmessagebox.h>
+
+#include "%{APPNAMELC}kmdiView.h"
+
+
+ %{APPNAMELC}kmdiView::%{APPNAMELC}kmdiView( QWidget *parentWidget, const char *name )
+: KMdiChildView( parentWidget, name )
+{
+ m_part = NULL;
+
+ // this routine will find and load our Part. it finds the Part by
+ // name which is a bad idea usually.. but it's alright in this
+ // case since our Part is made for this Shell
+ KLibFactory *factory = KLibLoader::self()->factory("lib%{APPNAMELC}part");
+ //KLibFactory *factory = KLibLoader::self()->factory("libkatepart");
+ if (factory)
+ {
+ // now that the Part is loaded, we cast it to a Part to get
+ // our hands on it
+ m_part = static_cast<KParts::ReadWritePart *>(factory->create(
+ this, "katepart", "KParts::ReadWritePart" ));
+
+ if (m_part)
+ {
+ part()->widget()->setFocus();
+ setFocusProxy(part()->widget());
+
+ QBoxLayout* layout = new QHBoxLayout(this, 0, -1, "kdissertviewlayout" );
+ part()->widget()->reparent( this, QPoint(0, 0) );
+ layout->addWidget( part()->widget() );
+
+ // connect( m_part, SIGNAL(stateChanged()), this, SLOT(updateCaption()) );
+ }
+ else
+ {
+ KMessageBox::error(this, i18n("Could not find our part."));
+ }
+ }
+ else
+ {
+ // if we couldn't find our Part, we exit since the Shell by
+ // itself can't do anything useful
+ KMessageBox::error(this, i18n("Could not find our part."));
+ return;
+ }
+}
+
+%{APPNAMELC}kmdiView::~%{APPNAMELC}kmdiView()
+{
+ delete m_part->widget();
+}
+
+#include "%{APPNAMELC}kmdiView.moc"
diff --git a/languages/cpp/app_templates/kscons_kmdi/appkmdiView.h b/languages/cpp/app_templates/kscons_kmdi/appkmdiView.h
new file mode 100644
index 00000000..66e5203b
--- /dev/null
+++ b/languages/cpp/app_templates/kscons_kmdi/appkmdiView.h
@@ -0,0 +1,29 @@
+%{H_TEMPLATE}
+
+#ifndef _%{APPNAMEUC}KMDIVIEW_H
+#define _%{APPNAMEUC}KMDIVIEW_H
+
+#include <kparts/part.h>
+#include <kmdichildview.h>
+#include <kmdichildfrm.h>
+
+/**
+ * This class serves as the %{APPNAMELC}kmdi view.
+ *
+ * @short main view class
+ */
+class %{APPNAMELC}kmdiView : public KMdiChildView
+{
+ Q_OBJECT
+ public:
+ %{APPNAMELC}kmdiView( QWidget *parentWidget=0L, const char *name=0L );
+ virtual ~%{APPNAMELC}kmdiView();
+
+ KParts::ReadWritePart *part() { return m_part; }
+
+ private:
+ KParts::ReadWritePart *m_part;
+};
+
+#endif // _%{APPNAMEUC}KMDIVIEW_H
+
diff --git a/languages/cpp/app_templates/kscons_kmdi/kmdikonsole.cpp b/languages/cpp/app_templates/kscons_kmdi/kmdikonsole.cpp
new file mode 100644
index 00000000..da41685f
--- /dev/null
+++ b/languages/cpp/app_templates/kscons_kmdi/kmdikonsole.cpp
@@ -0,0 +1,76 @@
+%{CPP_TEMPLATE}
+
+#include <qfileinfo.h>
+#include <qframe.h>
+
+#include <kparts/part.h>
+#include <kate/document.h>
+#include <kate/view.h>
+#include <klocale.h>
+#include <klibloader.h>
+#include <kurl.h>
+
+#include "kmdikonsole.h"
+
+kmdikonsole::kmdikonsole(QWidget *parent, const char *name) : QVBox(parent, name)
+{
+ m_haskonsole = false;
+ respawn();
+}
+
+kmdikonsole::~kmdikonsole()
+{
+}
+
+void kmdikonsole::respawn()
+{
+ KLibFactory *factory = KLibLoader::self()->factory("libkonsolepart");
+
+ if (!factory) return;
+ m_part = (KParts::ReadOnlyPart *) factory->create(this);
+
+ if (!m_part) return;
+
+ if (m_part->widget()->inherits("QFrame"))
+ ((QFrame*)m_part->widget())->setFrameStyle(QFrame::Panel|QFrame::Sunken);
+
+ m_haskonsole=true;
+ connect( m_part, SIGNAL(destroyed()), this, SLOT(slotDestroyed()) );
+
+ m_part->widget()->show();
+ show();
+}
+
+void kmdikonsole::setDirectory(const QString &dirname)
+{
+ if (m_haskonsole)
+ {
+ KURL url(dirname);
+ if (m_part->url() != url)
+ m_part->openURL(url);
+ }
+}
+
+void kmdikonsole::showEvent(QShowEvent *ev)
+{
+ QWidget::showEvent(ev);
+ activate();
+}
+
+void kmdikonsole::activate()
+{
+ if (m_haskonsole)
+ {
+ m_part->widget()->show();
+ setFocusProxy(m_part->widget());
+ m_part->widget()->setFocus();
+ }
+}
+
+void kmdikonsole::slotDestroyed()
+{
+ m_haskonsole=false;
+ respawn();
+}
+
+#include "kmdikonsole.moc"
diff --git a/languages/cpp/app_templates/kscons_kmdi/kmdikonsole.h b/languages/cpp/app_templates/kscons_kmdi/kmdikonsole.h
new file mode 100644
index 00000000..83adb417
--- /dev/null
+++ b/languages/cpp/app_templates/kscons_kmdi/kmdikonsole.h
@@ -0,0 +1,32 @@
+%{H_TEMPLATE}
+
+#ifndef KMDIKONSOLE_H
+#define KMDIKONSOLE_H
+
+#include <qvbox.h>
+
+class kmdikonsole : public QVBox
+{
+ Q_OBJECT
+
+ public:
+ kmdikonsole( QWidget* parent, const char* name=0);
+ ~kmdikonsole();
+
+ public slots:
+ void setDirectory(const QString & dir);
+ void activate();
+
+ private slots:
+ void slotDestroyed();
+ void respawn();
+
+ protected:
+ void showEvent(QShowEvent *ev);
+
+ private:
+ KParts::ReadOnlyPart *m_part;
+ bool m_haskonsole;
+};
+
+#endif // KMDIKONSOLE_H
diff --git a/languages/cpp/app_templates/kscons_kmdi/kscons_kmdi.kdevtemplate b/languages/cpp/app_templates/kscons_kmdi/kscons_kmdi.kdevtemplate
new file mode 100644
index 00000000..4f0f8856
--- /dev/null
+++ b/languages/cpp/app_templates/kscons_kmdi/kscons_kmdi.kdevtemplate
@@ -0,0 +1,271 @@
+# KDE Config File
+[General]
+Name=Scons-based KMDI application
+Name[ca]=Aplicació per a KMDI basada en Scons
+Name[da]=Scons-baseret KMDI-program
+Name[de]=Auf Scons basierende KMDI-Anwendung
+Name[el]=Μια εφαρμογή KMDI βασισμένης στο Scons
+Name[es]=Aplicación KMDI basada en Scons
+Name[et]=KMDI rakendus Sconsi põhjal
+Name[eu]=Scons-en oinarritutako KMDI aplikazioa
+Name[fa]=کاربرد KMDI بر مبنای Scons
+Name[fr]=Application KMDI basée sur Scons
+Name[ga]=Feidhmchlár KMDI bunaithe ar Scons
+Name[gl]=Aplicación KMDI baseada en Scons
+Name[hu]=Scons-alapú KMDI-alkalmazás
+Name[it]=Applicazione KMDI basata su scons
+Name[ja]=Scons ベースの KMDI アプリケーション
+Name[nds]=Op "scons" opbuut KMDI-Programm
+Name[ne]=स्कोन-आधारित KMDI अनुप्रयोग
+Name[nl]=Scons gebaseerde KMDI-toepassing
+Name[pl]=Program KMDI wykorzystujący Scons
+Name[pt]=Aplicação KMDI usando Scons
+Name[pt_BR]=Aplicação KMDI usando Scons
+Name[ru]=Многооконное приложение KDE на базе Scons
+Name[sk]=KMDI aplikácia založená na Scons
+Name[sr]=KMDI програм на основу Scons-а
+Name[sr@Latn]=KMDI program na osnovu Scons-a
+Name[sv]=Scons-baserat KMDI-program
+Name[tr]=Scons tabanlı KMDI uygulaması
+Name[zh_CN]=基于 Scons 的 KMDI 应用程序
+Name[zh_TW]=Scons 為基礎的 KMDI 應用程式
+Category=C++/KDE
+Icon=kscons_kmdi.png
+Comment=Generates a complex KMDI application. Scons scripts are provided for compiling and installing the application.
+Comment[ca]=Genera una complexa aplicació per a KMDI. Els scripts en Scons són proveïts per a compilar i instal·lar l'aplicació.
+Comment[da]=Genererer et komplekst KDE-program. Der sørges for scons-scripter til at kompilere og installere programmet.
+Comment[de]=Erstellt eine aufwändige KMDI-Anwendung. Scons-Skripte zum Kompilieren und Installieren der Anwendung werden zur Verfügung gestellt.
+Comment[el]=Δημιουργεί μια πολύπλοκη εφαρμογή KMDI. Προσφέρονται σενάρια Scons για τη μεταγλώττιση και εγκατάσταση της εφαρμογής.
+Comment[es]=Genera una aplicación KMDI compleja. Se proporcionan guiones en Scons para compilar e instalar la aplicación.
+Comment[et]=Keerulise KMDI rakenduse loomine. Luuakse ka Sconsi skriptid rakenduse kompileerimiseks ja paigaldamiseks.
+Comment[eu]=KMDI aplikazio konplexu bat sortzen du. Aplikazioak konpilatu eta aplikazioa instalatzeko Scons script-ak sortzen ditu.
+Comment[fa]=یک کاربرد پیچیدۀ KMDI تولید می‌کند. دست‌نوشته‌های Scons برای ترجمه و نصب کاربرد فراهم می‌شوند.
+Comment[fr]=Génère une application KMDI évoluée. Des scripts Scons sont fournis pour compiler et installer l'application.
+Comment[gl]=Xera unha aplicación complexa KMDI. Os scripts Scons proporciónanse para compilar e instalar a aplicación.
+Comment[hu]=Létrehoz egy komplex KMDI alkalmazást. Az alkalmazás lefordításához és telepítéséhez Scons-szkriptek állnak rendelkezésre.
+Comment[it]=Genera una applicazione KMDI complessa. Gli script scons sono forniti per compilare e istallare l'applicazione.
+Comment[nds]=Stellt en vigeliensch KMDI-Programm op. Stellt Scons-Skripten för't Kompileren un Installeren vun't Programm praat.
+Comment[ne]=जटिल KMDI अनुप्रयोग उत्पन्न गर्दछ । स्कोन स्क्रिप्टहरू अनुप्रयोग स्थापना र कम्पाइल गर्नका लागि प्रदान गरिन्छ ।
+Comment[nl]=Genereert een complexe KMDI-applicatie. Scons-scripts worden gebruikt voor compilatie en installatie.
+Comment[pl]=Generuje złożony program z powłoką KMDI. Do kompilacji i instalacji wykorzystywany jest skrypt Scons.
+Comment[pt]=Gera uma aplicação complexa com KMDI. Os ficheiros do Scons são fornecidos para compilar e instalar a aplicação.
+Comment[pt_BR]=Gera uma aplicação complexa com KMDI. Os ficheiros do Scons são fornecidos para compilar e instalar a aplicação.
+Comment[ru]=Создание полноценного многооконного приложения KDE. Для сборки и установки этого приложения будут использованы скрипты Scons.
+Comment[sk]=Vygeneruje komplexnú KMDI aplikáciu. K dispozícii je Scons skriptna kompiláciu a inštaláciu aplikácie.
+Comment[sr]=Прави сложени KMDI програм. Дате су Scons скрипте за превођење и инсталирање програма.
+Comment[sr@Latn]=Pravi složeni KMDI program. Date su Scons skripte za prevođenje i instaliranje programa.
+Comment[sv]=Skapar ett komplext KMDI-program. Scons-skript tillhandahålls för att kompilera och installera programmet.
+Comment[tr]=Karmaşık bir KMDI uygulaması yaratır. Uygulamayı derlemek ve kurmak için scons betikleri sağlanmıştır.
+Comment[zh_CN]=生成一个复杂的 KMDI 应用程序。此时会提供 Scons 脚本以供编译并安装应用程序。
+Comment[zh_TW]=產生一個複雜的 KMDI 應用程式。Scons 文稿是用於編譯與安裝應用程式。
+FileTemplates=h,CStyle,cpp,CStyle
+ShowFilesAfterGeneration=%{dest}/QUICKSTART
+Archive=kscons_kmdi.tar.gz
+
+[SCONS]
+Type=include
+File=%{kdevelop}/template-common/scons.kdevtemplate
+
+[MKDIR_DOCBOOK1]
+Type=mkdir
+Dir=%{dest}/doc
+
+[MKDIR_DOCBOOK2]
+Type=mkdir
+Dir=%{dest}/doc/en
+
+[FILE1]
+Type=install
+Source=%{src}/SConscript-doc
+Dest=%{dest}/doc/SConscript
+
+[FILE2]
+Type=install
+EscapeXML=true
+Source=%{kdevelop}/template-common/kde-index.docbook
+Dest=%{dest}/doc/en/index.docbook
+
+[FILE3]
+Type=install
+EscapeXML=true
+Source=%{src}/app.kdevelop
+Dest=%{dest}/%{APPNAMELC}.kdevelop
+
+[FILE4]
+Type=install
+Source=%{src}/SConstruct
+Dest=%{dest}/SConstruct
+
+[MkDir3]
+Type=mkdir
+Dir=%{dest}/src
+
+[FILE6]
+Type=install
+Source=%{kdevelop}/template-common/kde-app.desktop
+Dest=%{dest}/src/%{APPNAMELC}.desktop
+
+[FILE7]
+Type=install
+Source=%{kdevelop}/template-common/hi16-app-app.png
+Dest=%{dest}/src/hi16-app-%{APPNAMELC}.png
+Process=false
+
+[FILE8]
+Type=install
+Source=%{kdevelop}/template-common/hi32-app-app.png
+Dest=%{dest}/src/hi32-app-%{APPNAMELC}.png
+Process=false
+
+[MkDir4]
+Type=mkdir
+Dir=%{dest}/po
+
+[FILE10]
+Type=install
+Source=%{src}/SConscript-src
+Dest=%{dest}/src/SConscript
+
+[FILE11]
+Type=install
+Source=%{src}/appkmdi.cpp
+Dest=%{dest}/src/%{APPNAMELC}kmdi.cpp
+
+[FILE12]
+Type=install
+Source=%{src}/appkmdi.h
+Dest=%{dest}/src/%{APPNAMELC}kmdi.h
+
+[FILE13]
+Type=install
+EscapeXML=true
+Source=%{src}/prefs.ui
+Dest=%{dest}/src/prefs.ui
+
+[FILE14]
+Type=install
+Source=%{src}/appkmdiView.cpp
+Dest=%{dest}/src/%{APPNAMELC}kmdiView.cpp
+
+[FILE15]
+Type=install
+Source=%{src}/appkmdiView.h
+Dest=%{dest}/src/%{APPNAMELC}kmdiView.h
+
+[FILE19]
+Type=install
+Source=%{src}/main.cpp
+Dest=%{dest}/src/main.cpp
+
+[FILE20]
+Type=install
+EscapeXML=true
+Source=%{src}/app_shell.rc
+Dest=%{dest}/src/%{APPNAMELC}_shell.rc
+
+[FILE21]
+Type=install
+Source=%{src}/README
+Dest=%{dest}/src/README
+
+[FILE22]
+Type=install
+Source=%{src}/app.kcfg
+Dest=%{dest}/src/%{APPNAMELC}.kcfg
+
+[FILE23]
+Type=install
+Source=%{src}/settings.kcfgc
+Dest=%{dest}/src/settings.kcfgc
+
+[FILE25]
+Type=install
+Source=%{src}/tips
+Dest=%{dest}/src/tips
+
+[FILE27]
+Type=install
+Source=%{src}/VERSION
+Dest=%{dest}/VERSION
+
+[FILE28]
+Type=install
+Source=%{src}/INSTALL
+Dest=%{dest}/INSTALL
+
+[FILE29]
+Type=install
+Source=%{src}/QUICKSTART
+Dest=%{dest}/QUICKSTART
+
+[FILE30]
+Type=install
+Source=%{src}/messages.sh
+Dest=%{dest}/po/messages.sh
+
+[FILE31]
+Type=install
+Source=%{src}/kmdikonsole.cpp
+Dest=%{dest}/src/kmdikonsole.cpp
+
+[FILE32]
+Type=install
+Source=%{src}/kmdikonsole.h
+Dest=%{dest}/src/kmdikonsole.h
+
+[FILE34]
+Type=install
+Source=%{src}/app_part.cpp
+Dest=%{dest}/src/%{APPNAMELC}_part.cpp
+
+[FILE35]
+Type=install
+Source=%{src}/app_part.h
+Dest=%{dest}/src/%{APPNAMELC}_part.h
+
+[FILE36]
+Type=install
+Source=%{kdevelop}/template-common/kde-app.desktop
+Dest=%{dest}/src/%{APPNAMELC}.desktop
+
+[FILE37]
+Type=install
+Source=%{kdevelop}/template-common/kde-part.desktop
+Dest=%{dest}/src/%{APPNAMELC}_part.desktop
+
+[FILE38]
+Type=install
+Source=%{src}/app_part.rc
+Dest=%{dest}/src/%{APPNAMELC}_part.rc
+
+[MSG]
+Type=message
+Comment=A KDE application with scons scripts was created in %{dest}
+Comment[ca]=Una aplicació per al KDE amb scripts en Scons ha estat creada e n %{dest}
+Comment[da]=Et KDE program med scons-scripter blev oprette i %{dest}
+Comment[de]=Eine KDE-Anwendung mit Scons-Skripten wurde in %{dest} erstellt.
+Comment[el]=Μια εφαρμογή KDE με σενάρια scons δημιουργήθηκε στο %{dest}
+Comment[es]=Una aplicación para KDE con guiones de Scons ha sido creada en %{dest}
+Comment[et]=KDE rakendus Sconsi skriptidega loodi asukohta %{dest}
+Comment[eu]=Scons script-dun KDE aplikazio bat sortu da hemen: %{dest}
+Comment[fa]=یک کاربرد KDE با دست‌نوشته‌های scons در %{dest} ایجاد شد
+Comment[fr]=Une application KDE comprenant des scripts Scons a été créée dans %{dest}
+Comment[ga]=Cruthaíodh feidhmchlár KDE le scripteanna scons i %{dest}
+Comment[gl]=Creouse unha aplicación KDE con scripts scons en %{dest}
+Comment[hu]=Létrejött egy Scons-szkripteket használó KDE-alapú alkalmazás itt: %{dest}
+Comment[it]=È stata creata un'applicazione KDE con gli script scons in %{dest}
+Comment[ja]=Scons スクリプトを使った KDE アプリケーションを %{dest} に作成しました
+Comment[nds]=In %{dest} wöör en KDE-Programm mit scons-Skripten opstellt
+Comment[ne]=स्कोन स्क्रिप्टसँग केडीई अनुप्रयोग %{dest} मा सिर्जना गरियो
+Comment[nl]=Een KDE applicatie inclusief Scons-scripts is aangemaakt in %{dest}
+Comment[pl]=Program KDE ze skryptami scons utworzony w %{dest}
+Comment[pt]=Foi criada uma aplicação do KDE com ficheiros do 'scons' em %{dest}
+Comment[pt_BR]=Foi criada uma aplicação do KDE com ficheiros do 'scons' em %{dest}
+Comment[ru]=Приложение KDE со скриптами Scons создано в %{dest}
+Comment[sk]=KDE aplikácia so scons skriptom bola vytvorená v %{dest}
+Comment[sr]=KDE програм са scons скриптама направљен је у %{dest}
+Comment[sr@Latn]=KDE program sa scons skriptama napravljen je u %{dest}
+Comment[sv]=Ett KDE-program med Scons-skript skapades i %{dest}
+Comment[tr]=Scons betikleri olan bir KDE uygulaması %{dest} içinde yaratıldı.
+Comment[zh_CN]=在 %{dest} 中创建了带 scons 脚本的 KDE 应用程序
+Comment[zh_TW]=一個內含 scons 文稿的 KDE 應用程式已建立於 %{dest}
diff --git a/languages/cpp/app_templates/kscons_kmdi/kscons_kmdi.png b/languages/cpp/app_templates/kscons_kmdi/kscons_kmdi.png
new file mode 100644
index 00000000..72a347ee
--- /dev/null
+++ b/languages/cpp/app_templates/kscons_kmdi/kscons_kmdi.png
Binary files differ
diff --git a/languages/cpp/app_templates/kscons_kmdi/main.cpp b/languages/cpp/app_templates/kscons_kmdi/main.cpp
new file mode 100644
index 00000000..7e43b0e7
--- /dev/null
+++ b/languages/cpp/app_templates/kscons_kmdi/main.cpp
@@ -0,0 +1,60 @@
+%{CPP_TEMPLATE}
+
+#include <kurl.h>
+#include <kapplication.h>
+#include <kaboutdata.h>
+#include <kcmdlineargs.h>
+#include <klocale.h>
+
+#include "%{APPNAMELC}kmdi.h"
+
+static const char description[] =
+I18N_NOOP("A simple kmdi app");
+
+static const char version[] = "0.0.1";
+
+static KCmdLineOptions options[] =
+{
+ { "+[URL]", I18N_NOOP( "Document to open" ), 0 },
+ KCmdLineLastOption
+};
+
+int main(int argc, char **argv)
+{
+ KAboutData about("%{APPNAMELC}", I18N_NOOP("%{APPNAME}"), version, description,
+ KAboutData::License_%{LICENSE}, "(C) %{YEAR} %{AUTHOR}", 0, 0, "%{EMAIL}" );
+ about.addAuthor( "%{AUTHOR}", 0, "%{EMAIL}" );
+
+ // warning, utf-8 char
+ //about.addCredit( "bksys authors", "Thomas Nagy, Julien Antille" );
+
+ KCmdLineArgs::init(argc, argv, &about);
+ KCmdLineArgs::addCmdLineOptions(options);
+
+ KApplication app;
+
+ // see if we are starting with session management
+ /*if (app.isRestored())
+ {
+ RESTORE((%{APPNAME});
+ } else */
+ {
+ // no session.. just start up normally
+ KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
+
+ %{APPNAMELC}kmdi *widget = new %{APPNAMELC}kmdi( KMdi::IDEAlMode );
+
+ if (args->count() != 0)
+ {
+ for (int i=0; i < args->count(); i++)
+ {
+ widget->openURL( args->url( i ) );
+ }
+ }
+ widget->show();
+ args->clear();
+ }
+
+ return app.exec();
+}
+
diff --git a/languages/cpp/app_templates/kscons_kmdi/messages.sh b/languages/cpp/app_templates/kscons_kmdi/messages.sh
new file mode 100755
index 00000000..a36f5c93
--- /dev/null
+++ b/languages/cpp/app_templates/kscons_kmdi/messages.sh
@@ -0,0 +1,60 @@
+#!/bin/sh
+
+# Inspired by Makefile.common from coolo
+# this script is used to update the .po files
+
+# To update the translations, you will need a specific gettext
+# patched for kde and a lot of patience, tenacity, luck, time ..
+
+
+# I guess one should only update the .po files when all .cpp files
+# are generated (after a make or scons)
+
+# If you have a better way to do this, do not keep that info
+# for yourself and help me to improve this script, thanks
+# (tnagyemail-mail tat yahoo d0tt fr)
+
+SRCDIR=../test1-kconfigxt # srcdir is the directory containing the source code
+TIPSDIR=$SRCDIR # tipsdir is the directory containing the tips
+
+KDEDIR=`kde-config --prefix`
+EXTRACTRC=extractrc
+KDEPOT=`kde-config --prefix`/include/kde.pot
+XGETTEXT="xgettext -C -ki18n -ktr2i18n -kI18N_NOOP -ktranslate -kaliasLocale -x $KDEPOT "
+
+## check that kde.pot is available
+if ! test -e $KDEPOT; then
+ echo "$KDEPOT does not exist, there is something wrong with your installation!"
+ XGETTEXT="xgettext -C -ki18n -ktr2i18n -kI18N_NOOP -ktranslate -kaliasLocale "
+fi
+
+> rc.cpp
+
+## extract the strings
+echo "extracting the strings"
+
+# process the .ui and .rc files
+$EXTRACTRC `find $SRCDIR -iname *.rc` >> rc.cpp
+$EXTRACTRC `find $SRCDIR -iname *.ui` >> rc.cpp
+echo -e 'i18n("_: NAME OF TRANSLATORS\\n"\n"Your names")\ni18n("_: EMAIL OF TRANSLATORS\\n"\n"Your emails")' > $SRCDIR/_translatorinfo.cpp
+
+# process the tips - $SRCDIR is supposed to be where the tips are living
+pushd $TIPSDIR; preparetips >tips.cpp; popd
+
+$XGETTEXT `find $SRCDIR -name "*.cpp"` -o kdissert.pot
+
+# remove the intermediate files
+rm -f $TIPSDIR/tips.cpp
+rm -f rc.cpp
+rm -f $SRCDIR/_translatorinfo.cpp
+
+## now merge the .po files ..
+echo "merging the .po files"
+
+for i in `ls *.po`; do
+ msgmerge $i kdissert.pot -o $i || exit 1
+done
+
+## finished
+echo "Done"
+
diff --git a/languages/cpp/app_templates/kscons_kmdi/prefs.ui b/languages/cpp/app_templates/kscons_kmdi/prefs.ui
new file mode 100644
index 00000000..5de638ef
--- /dev/null
+++ b/languages/cpp/app_templates/kscons_kmdi/prefs.ui
@@ -0,0 +1,30 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>prefs</class>
+<widget class="QWidget">
+<property name="name">
+<cstring>prefs</cstring>
+</property>
+<property name="geometry">
+<rect>
+<x>0</x>
+<y>0</y>
+<width>241</width>
+<height>47</height>
+</rect>
+</property>
+<grid>
+<property name="name">
+<cstring>unnamed</cstring>
+</property>
+<widget class="QCheckBox" row="0" column="0">
+<property name="name">
+<cstring>kcfg_showCloseTabsButton</cstring>
+</property>
+<property name="text">
+<string>Show close buttons on the right of tabs</string>
+</property>
+</widget>
+</grid>
+</widget>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/languages/cpp/app_templates/kscons_kmdi/settings.kcfgc b/languages/cpp/app_templates/kscons_kmdi/settings.kcfgc
new file mode 100644
index 00000000..384510cd
--- /dev/null
+++ b/languages/cpp/app_templates/kscons_kmdi/settings.kcfgc
@@ -0,0 +1,6 @@
+# Code generation options for kconfig_compiler
+File=%{APPNAMELC}.kcfg
+ClassName=Settings
+Singleton=true
+Mutators=col_background,col_foreground
+# will create the necessary code for setting those variables
diff --git a/languages/cpp/app_templates/kscons_kmdi/tips b/languages/cpp/app_templates/kscons_kmdi/tips
new file mode 100644
index 00000000..56f29469
--- /dev/null
+++ b/languages/cpp/app_templates/kscons_kmdi/tips
@@ -0,0 +1,6 @@
+<tip category="help">
+<html>
+<p>... that automake was not involved in building this kde application ?</p>
+<p>The kdevelop template &quot;kscons_kxt&quot; was used instead.</p>
+</html>
+</tip>