diff options
author | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
---|---|---|
committer | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
commit | 114a878c64ce6f8223cfd22d76a20eb16d177e5e (patch) | |
tree | acaf47eb0fa12142d3896416a69e74cbf5a72242 /languages/cpp/app_templates/khello2 | |
download | tdevelop-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/khello2')
-rw-r--r-- | languages/cpp/app_templates/khello2/.kdev_ignore | 0 | ||||
-rw-r--r-- | languages/cpp/app_templates/khello2/Makefile.am | 18 | ||||
-rw-r--r-- | languages/cpp/app_templates/khello2/app.cpp | 19 | ||||
-rw-r--r-- | languages/cpp/app_templates/khello2/app.desktop | 40 | ||||
-rw-r--r-- | languages/cpp/app_templates/khello2/app.h | 32 | ||||
-rw-r--r-- | languages/cpp/app_templates/khello2/app.kdevelop | 115 | ||||
-rw-r--r-- | languages/cpp/app_templates/khello2/appui.rc | 8 | ||||
-rw-r--r-- | languages/cpp/app_templates/khello2/khello2.kdevtemplate | 230 | ||||
-rw-r--r-- | languages/cpp/app_templates/khello2/khello2.png | bin | 0 -> 3155 bytes | |||
-rw-r--r-- | languages/cpp/app_templates/khello2/main.cpp | 51 | ||||
-rw-r--r-- | languages/cpp/app_templates/khello2/src-Makefile.am | 35 | ||||
-rw-r--r-- | languages/cpp/app_templates/khello2/subdirs | 3 | ||||
-rw-r--r-- | languages/cpp/app_templates/khello2/widget.cpp | 30 | ||||
-rw-r--r-- | languages/cpp/app_templates/khello2/widget.h | 30 | ||||
-rw-r--r-- | languages/cpp/app_templates/khello2/widgetbase.ui | 52 |
15 files changed, 663 insertions, 0 deletions
diff --git a/languages/cpp/app_templates/khello2/.kdev_ignore b/languages/cpp/app_templates/khello2/.kdev_ignore new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/languages/cpp/app_templates/khello2/.kdev_ignore diff --git a/languages/cpp/app_templates/khello2/Makefile.am b/languages/cpp/app_templates/khello2/Makefile.am new file mode 100644 index 00000000..8ac1b18d --- /dev/null +++ b/languages/cpp/app_templates/khello2/Makefile.am @@ -0,0 +1,18 @@ +dataFiles = src-Makefile.am app.cpp app.h main.cpp appui.rc app.kdevelop \ + subdirs app.desktop khello2.png widget.cpp widget.h widgetbase.ui + +templateName = khello2 + +### no need to change below: +template_DATA = $(templateName).kdevtemplate +templatedir = ${appwizarddatadir}/templates + +appwizarddatadir = ${kde_datadir}/kdevappwizard +$(templateName).tar.gz: ${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
\ No newline at end of file diff --git a/languages/cpp/app_templates/khello2/app.cpp b/languages/cpp/app_templates/khello2/app.cpp new file mode 100644 index 00000000..948a98fc --- /dev/null +++ b/languages/cpp/app_templates/khello2/app.cpp @@ -0,0 +1,19 @@ +%{CPP_TEMPLATE} + +#include <kmainwindow.h> +#include <klocale.h> + +#include "%{APPNAMELC}.h" +#include "%{APPNAMELC}widget.h" + +%{APPNAME}::%{APPNAME}() + : KMainWindow( 0, "%{APPNAME}" ) +{ + setCentralWidget( new %{APPNAME}Widget( this ) ); +} + +%{APPNAME}::~%{APPNAME}() +{ +} + +#include "%{APPNAMELC}.moc" diff --git a/languages/cpp/app_templates/khello2/app.desktop b/languages/cpp/app_templates/khello2/app.desktop new file mode 100644 index 00000000..8b36e6e0 --- /dev/null +++ b/languages/cpp/app_templates/khello2/app.desktop @@ -0,0 +1,40 @@ +[Desktop Entry] +Name=%{APPNAME} +Exec=%{APPNAMELC} +Icon=%{APPNAMELC} +Type=Application +Comment=A simple KDE Application +Comment[br]=Ur meziant eeun evit KDE +Comment[ca]=Una simple aplicació per al KDE +Comment[da]=Et simpelt KDE program +Comment[de]=Eine einfache KDE-Anwendung +Comment[el]=Μια απλή εφαρμογή του KDE +Comment[es]=Una aplicación de KDE sencilla +Comment[et]=Lihtne KDE rakendus +Comment[eu]=KDE aplikazio simple bat +Comment[fa]=یک کاربرد سادۀ KDE +Comment[fr]=Une application simple pour KDE +Comment[ga]=Feidhmchlár Simplí KDE +Comment[gl]=Unha aplicación KDE sinxela +Comment[hi]=एक सादा केडीई अनुप्रयोग +Comment[hu]=Egyszerű KDE-alkalmazás +Comment[is]=Einfalt KDE forrit +Comment[it]=Una semplice applicazione KDE +Comment[ja]=簡単な KDE アプリケーション +Comment[nds]=En eenfach KDE-Programm +Comment[ne]=एउटा साधारण केडीई अनुप्रयोग +Comment[nl]=Een eenvoudige KDE-toepassing +Comment[pl]=Prosty program KDE +Comment[pt]=Uma aplicação simples do KDE +Comment[pt_BR]=Um simples Aplicativo do KDE +Comment[ru]=Простое приложение KDE +Comment[sk]=Jednoduchá KDE aplikácia +Comment[sl]=Preprost program za KDE +Comment[sr]=Једноставан KDE програм +Comment[sr@Latn]=Jednostavan KDE program +Comment[sv]=Ett enkelt KDE-program +Comment[ta]=ஒரு சாதாரண கெடிஇ பயன்பாடு +Comment[tg]=Гузориши оддиKDE +Comment[tr]=Basit bir KDE Uygulaması +Comment[zh_CN]=一个简单的 KDE 应用程序 +Comment[zh_TW]=簡單的 KDE 應用程式 diff --git a/languages/cpp/app_templates/khello2/app.h b/languages/cpp/app_templates/khello2/app.h new file mode 100644 index 00000000..678df7a3 --- /dev/null +++ b/languages/cpp/app_templates/khello2/app.h @@ -0,0 +1,32 @@ +%{H_TEMPLATE} + +#ifndef _%{APPNAMEUC}_H_ +#define _%{APPNAMEUC}_H_ + +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + +#include <kmainwindow.h> + +/** + * @short Application Main Window + * @author %{AUTHOR} <%{EMAIL}> + * @version %{VERSION} + */ +class %{APPNAME} : public KMainWindow +{ + Q_OBJECT +public: + /** + * Default Constructor + */ + %{APPNAME}(); + + /** + * Default Destructor + */ + virtual ~%{APPNAME}(); +}; + +#endif // _%{APPNAMEUC}_H_ diff --git a/languages/cpp/app_templates/khello2/app.kdevelop b/languages/cpp/app_templates/khello2/app.kdevelop new file mode 100644 index 00000000..43425791 --- /dev/null +++ b/languages/cpp/app_templates/khello2/app.kdevelop @@ -0,0 +1,115 @@ +<?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> + </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> + </run> + <configurations> + <optimized> + <builddir>optimized</builddir> + <ccompiler>GccOptions</ccompiler> + <cxxcompiler>GppOptions</cxxcompiler> + <f77compiler>G77Options</f77compiler> + <cxxflags>-O2 -g0</cxxflags> + </optimized> + <debug> + <configargs>--enable-debug=full</configargs> + <builddir>debug</builddir> + <ccompiler>GccOptions</ccompiler> + <cxxcompiler>GppOptions</cxxcompiler> + <f77compiler>G77Options</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> + </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> + </general> + </kdevdebugger> + <kdevfilecreate> + <filetypes/> + <useglobaltypes> + <type ext="ui" /> + <type ext="cpp" /> + <type ext="h" /> + </useglobaltypes> + </kdevfilecreate> + <kdevdocumentation> + <projectdoc> + <docsystem>Doxygen Documentation Collection</docsystem> + <docurl>%{APPNAMELC}.tag</docurl> + </projectdoc> + </kdevdocumentation> +</kdevelop> diff --git a/languages/cpp/app_templates/khello2/appui.rc b/languages/cpp/app_templates/khello2/appui.rc new file mode 100644 index 00000000..ceb4f14e --- /dev/null +++ b/languages/cpp/app_templates/khello2/appui.rc @@ -0,0 +1,8 @@ +<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd"> +<kpartgui name="%{APPNAMELC}" version="1"> +<MenuBar> + <Menu name="custom"><text>C&ustom</text> + <Action name="custom_action" /> + </Menu> +</MenuBar> +</kpartgui> diff --git a/languages/cpp/app_templates/khello2/khello2.kdevtemplate b/languages/cpp/app_templates/khello2/khello2.kdevtemplate new file mode 100644 index 00000000..479d7496 --- /dev/null +++ b/languages/cpp/app_templates/khello2/khello2.kdevtemplate @@ -0,0 +1,230 @@ +# KDE Config File +[General] +Name=Simple Designer based KDE Application +Name[ca]=Simple aplicació per al KDE basada en el dissenyador +Name[da]=Simpelt Designer-baseret KDE program +Name[de]=Einfache, auf Designer basierende KDE-Anwendung +Name[el]=Απλή εφαρμογή KDE βασισμένη στο σχεδιαστή +Name[es]=Aplicación para KDE sencilla basada en el diseñador +Name[et]=Lihtne KDE rakendus Disaineri põhjal +Name[eu]=Designer-en oinarritutako KDE aplikazio simple bat +Name[fa]=کاربرد KDE بر مبنای طراح ساده +Name[fr]=Application KDE simple basée sur Designer +Name[gl]=Aplicación KDE sinxela baseada no deseñador +Name[hu]=Egyszerű Qt Designer-alapú KDE-s alkalmazás +Name[it]=Una semplice applicazione KDE basata su designer +Name[ja]=Designer ベースの簡単な KDE アプリケーション +Name[nds]=Eenfach, op "Designer" opbuut KDE-Programm +Name[ne]=साधारण डिजाइनरमा आधारित केडीई अनुप्रयोग +Name[nl]=Eenvoudige Designer-gebaseerde KDE-toepassing +Name[pl]=Prosty program dla KDE wykonany w Designerze +Name[pt]=Aplicação Simples do KDE baseada no Qt Designer +Name[pt_BR]=Aplicação Simples do KDE baseada no Qt Designer +Name[ru]=Простое приложение KDE с формой +Name[sk]=Jednoduchý dizajnér založený na KDE aplikácii +Name[sr]=Једноставан KDE програм на основу Designer-а +Name[sr@Latn]=Jednostavan KDE program na osnovu Designer-a +Name[sv]=Enkelt KDE-program baserat på Designer +Name[tr]=Basit Designer tabanlı KDE Uygulaması +Name[zh_CN]=基于设计师的简单 KDE 应用程序 +Name[zh_TW]=簡單的設計器 KDE 應用程式 +Category=C++/KDE +Icon=khello2.png +Comment=Generates a simple KDE application with one Qt-designer based widget. +Comment[ca]=Genera una simple aplicació per al KDE basada en el dissenyador de Qt. +Comment[da]=Genererer et simpelt KDE program med en Qt-designer baseret kontrol. +Comment[de]=Erstellt eine einfache KDE-Anwendung mit einem auf Qt-Designer basierenden Widget. +Comment[el]=Δημιουργεί μια απλή εφαρμογή KDE με ένα γραφικό συστατικό βασισμένο στο σχεδιαστή Qt. +Comment[es]=Genera una sencilla aplicación para KDE con una ventana basada en Qt-designer. +Comment[et]=Lihtsa KDE rakenduse loomine ühe vidinaga Qt Disaineri põhjal. +Comment[eu]=Qt Designer-en oinarritutako trepeta bat duen KDE aplikazio sinple bat sortzen du. +Comment[fa]=یک کاربرد سادۀ KDE با یک عنصر مبنای طراح Qt تولید میکند. +Comment[fr]=Génère une application KDE simple comprenant un seul élément graphique (widget) basé sur Qt-designer. +Comment[ga]=Cruthaíonn sé seo feidhmchlár simplí KDE le giuirléid amháin bunaithe ar Qt-Designer +Comment[gl]=Xera unha aplicación KDE sinxela cunha compoñente baseada en Qt-designer. +Comment[hu]=Létrehoz egy egyszerű KDE-s alkalmazást, mely egy Qt Designerrel készített grafikus elemre épül. +Comment[it]=Genera una semplice applicazione KDE con un elemento grafico basato su Qt-designer. +Comment[nds]=Stellt en eenfach KDE-Programm mit een op Qt-Designer opbuut Element op. +Comment[ne]=क्यू टी डिजाइनरमा आधारित विगेटसँग साधारण केडीई अनुप्रयोग उत्पन्न गर्दछ । +Comment[nl]=Genereert een eenvoudige KDE-toepassing met één Qt-Designer-gebaseerde widget. +Comment[pl]=Generuje prosty program dla KDE z jednym widgetem pochodzącym z Qt Designera. +Comment[pt]=Gera uma aplicação simples do KDE com uma interface baseada no Qt-designer. +Comment[pt_BR]=Gera uma aplicação simples do KDE com uma interface baseada no Qt-designer. +Comment[ru]=Создание простого приложения KDE с формой, созданной в Qt Designer. +Comment[sk]=Vygeneruje jednoduchú KDE aplikáciu s jedným oknom Qt dizajnéra. +Comment[sr]=Прави једноставан KDE програма са једном контролом на основу Qt-Designer-а. +Comment[sr@Latn]=Pravi jednostavan KDE programa sa jednom kontrolom na osnovu Qt-Designer-a. +Comment[sv]=Skapar ett enkelt KDE-program med en grafisk komponent baserad på Qt-Designer. +Comment[tr]=Qt-designer tabanlı bir parçacığı olan basit bir KDE uygulaması yaratır. +Comment[zh_CN]=生成一个带一个基于 Qt 设计师部件的简单 KDE 应用程序。 +Comment[zh_TW]=產生一個簡單的 KDE 應用程式,內含 Qt 設計器的元件 +FileTemplates=h,CStyle,cpp,CStyle +ShowFilesAfterGeneration=%{dest}/src/%{APPNAMELC}.cpp +Archive=khello2.tar.gz + +[ADMIN] +Type=include +File=%{kdevelop}/template-common/admin.kdevtemplate + +[GNU] +Type=include +File=%{kdevelop}/template-common/gnu.kdevtemplate + +[MKDIR_DOCBOOK1] +Type=mkdir +Dir=%{dest}/doc + +[MKDIR_DOCBOOK2] +Type=mkdir +Dir=%{dest}/doc/en + +[FILE1] +Type=install +Source=%{kdevelop}/template-common/kde-doc-Makefile.am +Dest=%{dest}/doc/Makefile.am + +[FILE2] +Type=install +Source=%{kdevelop}/template-common/kde-doc-en-Makefile.am +Dest=%{dest}/doc/en/Makefile.am + +[FILE3] +Type=install +EscapeXML=true +Source=%{kdevelop}/template-common/kde-index.docbook +Dest=%{dest}/doc/en/index.docbook + +[FILE4] +Type=install +EscapeXML=true +Source=%{src}/app.kdevelop +Dest=%{dest}/%{APPNAMELC}.kdevelop + +[FILE5] +Type=install +Source=%{kdevelop}/template-common/kde-Makefile.cvs +Dest=%{dest}/Makefile.cvs + +[FILE6] +Type=install +Source=%{kdevelop}/template-common/kde-Makefile.am +Dest=%{dest}/Makefile.am + +[FILE7] +Type=install +Source=%{kdevelop}/template-common/kde-configure.in.in +Dest=%{dest}/configure.in.in + +[MkDir3] +Type=mkdir +Dir=%{dest}/po + +[FILE8] +Type=install +Source=%{kdevelop}/template-common/kde-po-Makefile.am +Dest=%{dest}/po/Makefile.am + +[FILE9] +Type=install +Source=%{src}/subdirs +Dest=%{dest}/subdirs + +[MkDir4] +Type=mkdir +Dir=%{dest}/src + +[FILE10] +Type=install +Source=%{kdevelop}/template-common/kde-app.lsm +Dest=%{dest}/src/%{APPNAMELC}.lsm + +[FILE11] +Type=install +Source=%{kdevelop}/template-common/hi16-app-app.png +Dest=%{dest}/src/hi16-app-%{APPNAMELC}.png +Process=false + +[FILE12] +Type=install +Source=%{kdevelop}/template-common/hi32-app-app.png +Dest=%{dest}/src/hi32-app-%{APPNAMELC}.png +Process=false + +[FILE13] +Type=install +Source=%{src}/src-Makefile.am +Dest=%{dest}/src/Makefile.am + +[FILE14] +Type=install +Source=%{src}/app.cpp +Dest=%{dest}/src/%{APPNAMELC}.cpp + +[FILE15] +Type=install +Source=%{src}/app.h +Dest=%{dest}/src/%{APPNAMELC}.h + +[FILE16] +Type=install +Source=%{src}/widget.cpp +Dest=%{dest}/src/%{APPNAMELC}widget.cpp + +[FILE17] +Type=install +Source=%{src}/widget.h +Dest=%{dest}/src/%{APPNAMELC}widget.h + +[FILE18] +Type=install +EscapeXML=true +Source=%{src}/widgetbase.ui +Dest=%{dest}/src/%{APPNAMELC}widgetbase.ui + +[FILE19] +Type=install +Source=%{src}/main.cpp +Dest=%{dest}/src/main.cpp + +[FILE20] +Type=install +EscapeXML=true +Source=%{src}/appui.rc +Dest=%{dest}/src/%{APPNAMELC}ui.rc + +[FILE21] +Type=install +Source=%{src}/app.desktop +Dest=%{dest}/src/%{APPNAMELC}.desktop + +[MSG] +Type=message +Comment=A simple designer based KDE application was created in %{dest} +Comment[ca]=A simple aplicació per al KDE basada en el dissenyador ha estat creada en %{dest} +Comment[da]=Et simpelt designer-baseret KDE program blev oprettet i %{dest} +Comment[de]=Eine einfache, auf Designer basierende KDE-Anwendung wurde in %{dest} erstellt. +Comment[el]=Μια απλή εφαρμογή KDE βασισμένη στο σχεδιαστή δημιουργήθηκε στο %{dest} +Comment[es]=Una sencilla aplicación para KDE basada en el diseñador ha sido creada en %{dest} +Comment[et]=Lihtne KDE rakendus Disaineri põhjal loodi asukohta %{dest} +Comment[eu]=Designer-en oinarritutako KDE aplikazio simple bat sortu da hemen: %{dest} +Comment[fa]=یک کاربرد سادهای بر مبنای طراح در %{dest} ایجاد شد +Comment[fr]=Une application KDE simple basée sur Designer a été créée dans %{dest} +Comment[ga]=Cruthaíodh feidhmchlár simplí KDE bunaithe ar Qt-Designer i %{dest} +Comment[gl]=Creouse unha aplicación KDE baseada no deseñador en %{dest} +Comment[hu]=Létrejött egy egyszerű, Qt Designer-alapú KDE-s alkalmazás itt: %{dest} +Comment[it]=È stata creata una semplice applicazione KDE basata su designer +Comment[ja]=Designer ベースの簡単な KDE アプリケーションを %{dest} に作成しました +Comment[nds]=In %{dest} wöör en eenfach op "Designer" opbuut KDE-Programm opstellt +Comment[ne]=साधारण डिजाइनरमा आधारित केडीई अनुप्रयोग %{dest} मा सिर्जना गरियो +Comment[nl]=Een eenvoudige Designer-gebaseerde KDE-toepassing is aangemaakt in %{dest} +Comment[pl]=Prosty program wykorzystujący Qt Designera został utworzony w %{dest} +Comment[pt]=Foi criada uma aplicação simples do KDE em %{dest} +Comment[pt_BR]=Foi criada uma aplicação simples do KDE em %{dest} +Comment[ru]=Простое приложение KDE с формой создано в %{dest} +Comment[sk]=Jednoduchý dizajnér založený na KDE aplikácii bol vytvorený v %{dest} +Comment[sr]=Једноставан KDE програм на основу Designer-а направљен је у %{dest} +Comment[sr@Latn]=Jednostavan KDE program na osnovu Designer-a napravljen je u %{dest} +Comment[sv]=Ett enkelt KDE-program baserat på Designer skapades i %{dest} +Comment[tr]=Designer tabanlı basit bir KDE uygulaması %{dest} içinde yaratıldı. +Comment[zh_CN]=在 %{dest} 中创建了一个基于设计师的简单 KDE 应用程序 +Comment[zh_TW]=一個簡單的設計器 KDE 應用程式已建立於 %{dest} diff --git a/languages/cpp/app_templates/khello2/khello2.png b/languages/cpp/app_templates/khello2/khello2.png Binary files differnew file mode 100644 index 00000000..97422793 --- /dev/null +++ b/languages/cpp/app_templates/khello2/khello2.png diff --git a/languages/cpp/app_templates/khello2/main.cpp b/languages/cpp/app_templates/khello2/main.cpp new file mode 100644 index 00000000..278eef46 --- /dev/null +++ b/languages/cpp/app_templates/khello2/main.cpp @@ -0,0 +1,51 @@ +%{CPP_TEMPLATE} + +#include "%{APPNAMELC}.h" +#include <kapplication.h> +#include <kaboutdata.h> +#include <kcmdlineargs.h> +#include <klocale.h> + +static const char description[] = + I18N_NOOP("A KDE KPart Application"); + +static const char version[] = "%{VERSION}"; + +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}" ); + KCmdLineArgs::init(argc, argv, &about); + KCmdLineArgs::addCmdLineOptions( options ); + KApplication app; + %{APPNAME} *mainWin = 0; + + if (app.isRestored()) + { + RESTORE(%{APPNAME}); + } + else + { + // no session.. just start up normally + KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); + + /// @todo do something with the command line args here + + mainWin = new %{APPNAME}(); + app.setMainWidget( mainWin ); + mainWin->show(); + + args->clear(); + } + + // mainWin has WDestructiveClose flag by default, so it will delete itself. + return app.exec(); +} + diff --git a/languages/cpp/app_templates/khello2/src-Makefile.am b/languages/cpp/app_templates/khello2/src-Makefile.am new file mode 100644 index 00000000..4664fe84 --- /dev/null +++ b/languages/cpp/app_templates/khello2/src-Makefile.am @@ -0,0 +1,35 @@ +# set the include path for X, qt and KDE +INCLUDES = $(all_includes) + +# these are the headers for your project +noinst_HEADERS = %{APPNAMELC}.h + +# let automoc handle all of the meta source files (moc) +METASOURCES = AUTO + +messages: rc.cpp + $(EXTRACTRC) `find . -name \*.ui -o -name \*.rc` > rc.cpp + $(XGETTEXT) *.cpp -o $(podir)/%{APPNAMELC}.pot + +KDE_ICON = AUTO + +######################################################################### +# APPLICATION SECTION +######################################################################### +# this is the program that gets installed. it's name is used for all +# of the other Makefile.am variables +bin_PROGRAMS = %{APPNAMELC} + +# the application source, library search path, and link libraries +%{APPNAMELC}_SOURCES = main.cpp %{APPNAMELC}.cpp %{APPNAMELC}widget.cpp %{APPNAMELC}widgetbase.ui +%{APPNAMELC}_LDFLAGS = $(KDE_RPATH) $(all_libraries) +%{APPNAMELC}_LDADD = $(LIB_KDEUI) + +# this is where the desktop file will go +shelldesktopdir = $(kde_appsdir)/Utilities +shelldesktop_DATA = %{APPNAMELC}.desktop + +# this is where the shell's XML-GUI resource file goes +shellrcdir = $(kde_datadir)/%{APPNAMELC} +shellrc_DATA = %{APPNAMELC}ui.rc + diff --git a/languages/cpp/app_templates/khello2/subdirs b/languages/cpp/app_templates/khello2/subdirs new file mode 100644 index 00000000..0e678106 --- /dev/null +++ b/languages/cpp/app_templates/khello2/subdirs @@ -0,0 +1,3 @@ +doc +po +src diff --git a/languages/cpp/app_templates/khello2/widget.cpp b/languages/cpp/app_templates/khello2/widget.cpp new file mode 100644 index 00000000..6775ac39 --- /dev/null +++ b/languages/cpp/app_templates/khello2/widget.cpp @@ -0,0 +1,30 @@ +%{CPP_TEMPLATE} + +#include <qlabel.h> + +#include "%{APPNAMELC}widget.h" + +%{APPNAME}Widget::%{APPNAME}Widget(QWidget* parent, const char* name, WFlags fl) + : %{APPNAME}WidgetBase(parent,name,fl) +{} + +%{APPNAME}Widget::~%{APPNAME}Widget() +{} + +/*$SPECIALIZATION$*/ +void %{APPNAME}Widget::button_clicked() +{ + if ( label->text().isEmpty() ) + { + label->setText( "Hello World!" ); + } + else + { + label->clear(); + } +} + + + +#include "%{APPNAMELC}widget.moc" + diff --git a/languages/cpp/app_templates/khello2/widget.h b/languages/cpp/app_templates/khello2/widget.h new file mode 100644 index 00000000..275e13c7 --- /dev/null +++ b/languages/cpp/app_templates/khello2/widget.h @@ -0,0 +1,30 @@ +%{H_TEMPLATE} + +#ifndef _%{APPNAMEUC}WIDGET_H_ +#define _%{APPNAMEUC}WIDGET_H_ + +#include "%{APPNAMELC}widgetbase.h" + +class %{APPNAME}Widget : public %{APPNAME}WidgetBase +{ + Q_OBJECT + +public: + %{APPNAME}Widget(QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); + ~%{APPNAME}Widget(); + /*$PUBLIC_FUNCTIONS$*/ + +public slots: + /*$PUBLIC_SLOTS$*/ + virtual void button_clicked(); + +protected: + /*$PROTECTED_FUNCTIONS$*/ + +protected slots: + /*$PROTECTED_SLOTS$*/ + +}; + +#endif + diff --git a/languages/cpp/app_templates/khello2/widgetbase.ui b/languages/cpp/app_templates/khello2/widgetbase.ui new file mode 100644 index 00000000..e6f5be3d --- /dev/null +++ b/languages/cpp/app_templates/khello2/widgetbase.ui @@ -0,0 +1,52 @@ +<!DOCTYPE UI><UI version="3.1" stdsetdef="1"> +<class>%{APPNAME}WidgetBase</class> +<widget class="QWidget"> + <property name="name"> + <cstring>%{APPNAMELC}widgetbase</cstring> + </property> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>220</width> + <height>133</height> + </rect> + </property> + <property name="caption"> + <string></string> + </property> + <grid> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="QPushButton" row="1" column="0"> + <property name="name"> + <cstring>button</cstring> + </property> + <property name="text"> + <string>Click Me!</string> + </property> + </widget> + <widget class="QLabel" row="0" column="0"> + <property name="name"> + <cstring>label</cstring> + </property> + <property name="text"> + <string></string> + </property> + </widget> + </grid> +</widget> +<connections> + <connection> + <sender>button</sender> + <signal>clicked()</signal> + <receiver>%{APPNAMELC}widgetbase</receiver> + <slot>button_clicked()</slot> + </connection> +</connections> +<slots> + <slot>button_clicked()</slot> +</slots> +<layoutdefaults spacing="6" margin="11"/> +</UI> |