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/kxt | |
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/kxt')
23 files changed, 1222 insertions, 0 deletions
diff --git a/languages/cpp/app_templates/kxt/.kdev_ignore b/languages/cpp/app_templates/kxt/.kdev_ignore new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/languages/cpp/app_templates/kxt/.kdev_ignore diff --git a/languages/cpp/app_templates/kxt/Makefile.am b/languages/cpp/app_templates/kxt/Makefile.am new file mode 100644 index 00000000..07767961 --- /dev/null +++ b/languages/cpp/app_templates/kxt/Makefile.am @@ -0,0 +1,19 @@ +dataFiles = src-Makefile.am app.cpp app.h main.cpp appui.rc app.kdevelop \ + subdirs app.desktop preview.png appview.h appview.cpp appview_base.ui \ + prefs-base.ui prefs.cpp prefs.h app.kcfg settings.kcfgc README \ + src-configure.in.in +templateName= kxt + +### 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 diff --git a/languages/cpp/app_templates/kxt/README b/languages/cpp/app_templates/kxt/README new file mode 100644 index 00000000..74e23296 --- /dev/null +++ b/languages/cpp/app_templates/kxt/README @@ -0,0 +1,86 @@ +----------------------------------------------- +Kde templates quickstart +Author: Thomas Nagy +Date: 2004-03-22 +----------------------------------------------- + +This README file explains you basic things for starting with +this application template. + + +** Building and installing ** + +* Build the configure script by "make -f Makefile.cvs" + +* To clean, use "make clean", and to clean everything +(remove the makefiles, etc), use "make distclean" + +* To distribute your program, try "make dist". +This will make a compact tarball archive of your release with the +necessary scripts inside. + +* Modifying the auto-tools scripts +for automake scripts there is an excellent tutorial there : +http://developer.kde.org/documentation/other/makefile_am_howto.html + +* Simplify your life : install the project in your home directory for +testing purposes. +./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 : +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/kxt/app.cpp b/languages/cpp/app_templates/kxt/app.cpp new file mode 100644 index 00000000..6e2ce524 --- /dev/null +++ b/languages/cpp/app_templates/kxt/app.cpp @@ -0,0 +1,154 @@ +%{CPP_TEMPLATE} + +#include "%{APPNAMELC}.h" +#include "settings.h" +#include "prefs.h" + +#include <qdragobject.h> +#include <kprinter.h> +#include <qpainter.h> +#include <qpaintdevicemetrics.h> + +#include <kconfigdialog.h> +#include <kglobal.h> +#include <klocale.h> +#include <kiconloader.h> +#include <kdeversion.h> +#include <kmenubar.h> +#include <kstatusbar.h> +#include <kkeydialog.h> + +#include <kedittoolbar.h> + +#include <kstdaccel.h> +#include <kaction.h> +#include <kstdaction.h> + +%{APPNAMELC}::%{APPNAMELC}() + : KMainWindow( 0, "%{APPNAMELC}" ), + m_view(new %{APPNAMELC}View(this)), + m_printer(0) +{ + // accept dnd + setAcceptDrops(true); + + // tell the KMainWindow that this is indeed the main widget + setCentralWidget(m_view); + + // then, setup our actions + setupActions(); + + // and a status bar + statusBar()->show(); + + // 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(); + + // allow the view to change the statusbar and caption + connect(m_view, SIGNAL(signalChangeStatusbar(const QString&)), + this, SLOT(changeStatusbar(const QString&))); + connect(m_view, SIGNAL(signalChangeCaption(const QString&)), + this, SLOT(changeCaption(const QString&))); + +} + +%{APPNAMELC}::~%{APPNAMELC}() +{ +} + +void %{APPNAMELC}::setupActions() +{ + KStdAction::openNew(this, SLOT(fileNew()), actionCollection()); + KStdAction::quit(kapp, SLOT(quit()), actionCollection()); + + m_toolbarAction = KStdAction::showToolbar(this, SLOT(optionsShowToolbar()), actionCollection()); + m_statusbarAction = KStdAction::showStatusbar(this, SLOT(optionsShowStatusbar()), actionCollection()); + + KStdAction::keyBindings(this, SLOT(optionsConfigureKeys()), actionCollection()); + KStdAction::configureToolbars(this, SLOT(optionsConfigureToolbars()), actionCollection()); + KStdAction::preferences(this, SLOT(optionsPreferences()), actionCollection()); + + // custom menu and menu item - the slot is in the class %{APPNAMELC}View + KAction *custom = new KAction(i18n("Swi&tch Colors"), 0, + m_view, SLOT(switchColors()), + actionCollection(), "switch_action"); + + createGUI(); +} + +void %{APPNAMELC}::fileNew() +{ + // this slot is called whenever the File->New menu is selected, + // the New shortcut is pressed (usually CTRL+N) or the New toolbar + // button is clicked + + // create a new window + (new %{APPNAMELC})->show(); +} + +void %{APPNAMELC}::optionsShowToolbar() +{ + // this is all very cut and paste code for showing/hiding the + // toolbar + if (m_toolbarAction->isChecked()) + toolBar()->show(); + else + toolBar()->hide(); +} + +void %{APPNAMELC}::optionsShowStatusbar() +{ + // show/hide the statusbar + if (m_statusbarAction->isChecked()) + statusBar()->show(); + else + statusBar()->hide(); +} + +void %{APPNAMELC}::optionsConfigureKeys() +{ + KKeyDialog::configure(actionCollection()); +} + +void %{APPNAMELC}::optionsConfigureToolbars() +{ + // use the standard toolbar editor + saveMainWindowSettings(KGlobal::config(), autoSaveGroup()); +} + +void %{APPNAMELC}::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}::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 + KConfigDialog *dialog = new KConfigDialog(this, "settings", Settings::self(), KDialogBase::Swallow); + dialog->addPage(new Prefs(), i18n("General"), "package_settings"); + connect(dialog, SIGNAL(settingsChanged()), m_view, SLOT(settingsChanged())); + dialog->show(); +} + +void %{APPNAMELC}::changeStatusbar(const QString& text) +{ + // display the text on the statusbar + statusBar()->message(text, 2000); +} + +void %{APPNAMELC}::changeCaption(const QString& text) +{ + // display the text on the caption + setCaption(text); +} +#include "%{APPNAMELC}.moc" + diff --git a/languages/cpp/app_templates/kxt/app.desktop b/languages/cpp/app_templates/kxt/app.desktop new file mode 100644 index 00000000..8b36e6e0 --- /dev/null +++ b/languages/cpp/app_templates/kxt/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/kxt/app.h b/languages/cpp/app_templates/kxt/app.h new file mode 100644 index 00000000..22037de2 --- /dev/null +++ b/languages/cpp/app_templates/kxt/app.h @@ -0,0 +1,66 @@ +%{H_TEMPLATE} + +#ifndef _%{APPNAMEUC}_H_ +#define _%{APPNAMEUC}_H_ + +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + +#include <kapplication.h> +#include <kmainwindow.h> + +#include "%{APPNAMELC}view.h" + +class KPrinter; +class KToggleAction; +class KURL; + +/** + * This class serves as the main window for %{APPNAME}. It handles the + * menus, toolbars, and status bars. + * + * @short Main window class + * @author %{AUTHOR} <%{EMAIL}> + * @version %{VERSION} + */ +class %{APPNAMELC} : public KMainWindow +{ + Q_OBJECT +public: + /** + * Default Constructor + */ + %{APPNAMELC}(); + + /** + * Default Destructor + */ + virtual ~%{APPNAMELC}(); + +private slots: + void fileNew(); + void optionsShowToolbar(); + void optionsShowStatusbar(); + void optionsConfigureKeys(); + void optionsConfigureToolbars(); + void optionsPreferences(); + void newToolbarConfig(); + + void changeStatusbar(const QString& text); + void changeCaption(const QString& text); + +private: + void setupAccel(); + void setupActions(); + +private: + %{APPNAMELC}View *m_view; + + KPrinter *m_printer; + KToggleAction *m_toolbarAction; + KToggleAction *m_statusbarAction; +}; + +#endif // _%{APPNAMEUC}_H_ + diff --git a/languages/cpp/app_templates/kxt/app.kcfg b/languages/cpp/app_templates/kxt/app.kcfg new file mode 100644 index 00000000..686f25f2 --- /dev/null +++ b/languages/cpp/app_templates/kxt/app.kcfg @@ -0,0 +1,21 @@ +<?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="col_background" type="Color"> + <label>color of the background</label> + <default>black</default> + </entry> + <entry name="col_foreground" type="Color"> + <label>color of the foreground</label> + <default>yellow</default> + </entry> + <entry name="val_time" type="Int"> + <label>size of a ball</label> + <default>2</default> + </entry> + </group> +</kcfg> diff --git a/languages/cpp/app_templates/kxt/app.kdevelop b/languages/cpp/app_templates/kxt/app.kdevelop new file mode 100644 index 00000000..e6a14fff --- /dev/null +++ b/languages/cpp/app_templates/kxt/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/kxt/appui.rc b/languages/cpp/app_templates/kxt/appui.rc new file mode 100644 index 00000000..06549878 --- /dev/null +++ b/languages/cpp/app_templates/kxt/appui.rc @@ -0,0 +1,8 @@ +<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd"> +<kpartgui name="%{APPNAMELC}" version="1"> +<MenuBar> + <Menu name="move"><text>&Move</text> + <Action name="switch_action" /> + </Menu> +</MenuBar> +</kpartgui> diff --git a/languages/cpp/app_templates/kxt/appview.cpp b/languages/cpp/app_templates/kxt/appview.cpp new file mode 100644 index 00000000..35e23682 --- /dev/null +++ b/languages/cpp/app_templates/kxt/appview.cpp @@ -0,0 +1,41 @@ +%{CPP_TEMPLATE} + +#include "%{APPNAMELC}view.h" +#include "settings.h" + +#include <klocale.h> +#include <qlabel.h> + +%{APPNAMELC}View::%{APPNAMELC}View(QWidget *parent) + : %{APPNAMELC}view_base(parent) +{ + settingsChanged(); +} + +%{APPNAMELC}View::~%{APPNAMELC}View() +{ + +} + +void %{APPNAMELC}View::switchColors() +{ + // switch the foreground/background colors of the label + QColor color = Settings::col_background(); + Settings::setCol_background( Settings::col_foreground() ); + Settings::setCol_foreground( color ); + + settingsChanged(); +} + +void %{APPNAMELC}View::settingsChanged() +{ + sillyLabel->setPaletteBackgroundColor( Settings::col_background() ); + sillyLabel->setPaletteForegroundColor( Settings::col_foreground() ); + + // i18n : internationalization + sillyLabel->setText( i18n("This project is %1 days old").arg(Settings::val_time()) ); + emit signalChangeStatusbar( i18n("Settings changed") ); +} + +#include "%{APPNAMELC}view.moc" + diff --git a/languages/cpp/app_templates/kxt/appview.h b/languages/cpp/app_templates/kxt/appview.h new file mode 100644 index 00000000..45a10de7 --- /dev/null +++ b/languages/cpp/app_templates/kxt/appview.h @@ -0,0 +1,52 @@ +%{H_TEMPLATE} + +#ifndef _%{APPNAMEUC}VIEW_H_ +#define _%{APPNAMEUC}VIEW_H_ + +#include <qwidget.h> + +#include "%{APPNAMELC}view_base.h" + +class QPainter; +class KURL; + +/** + * This is the main view class for %{APPNAME}. Most of the non-menu, + * non-toolbar, and non-statusbar (e.g., non frame) GUI code should go + * here. + * + * @short Main view + * @author %{AUTHOR} <%{EMAIL}> + * @version %{VERSION} + */ +class %{APPNAMELC}View : public %{APPNAMELC}view_base +{ + Q_OBJECT +public: + /** + * Default constructor + */ + %{APPNAMELC}View(QWidget *parent); + + /** + * Destructor + */ + virtual ~%{APPNAMELC}View(); + +signals: + /** + * Use this signal to change the content of the statusbar + */ + void signalChangeStatusbar(const QString& text); + + /** + * Use this signal to change the content of the caption + */ + void signalChangeCaption(const QString& text); + +private slots: + void switchColors(); + void settingsChanged(); +}; + +#endif // _%{APPNAMEUC}VIEW_H_ diff --git a/languages/cpp/app_templates/kxt/appview_base.ui b/languages/cpp/app_templates/kxt/appview_base.ui new file mode 100644 index 00000000..626d95df --- /dev/null +++ b/languages/cpp/app_templates/kxt/appview_base.ui @@ -0,0 +1,33 @@ +<!DOCTYPE UI><UI version="3.2" stdsetdef="1"> +<class>%{APPNAMELC}view_base</class> +<widget class="QWidget"> +<property name="name"> +<cstring>%{APPNAMELC}view_base</cstring> +</property> +<property name="geometry"> +<rect> +<x>0</x> +<y>0</y> +<width>268</width> +<height>164</height> +</rect> +</property> +<property name="caption"> +<string>%{APPNAMELC}_base</string> +</property> +<grid> +<property name="name"> +<cstring>unnamed</cstring> +</property> +<widget class="QLabel" row="0" column="0"> +<property name="name"> +<cstring>sillyLabel</cstring> +</property> +<property name="text"> +<string>hello, world</string> +</property> +</widget> +</grid> +</widget> +<layoutdefaults spacing="6" margin="11"/> +</UI> diff --git a/languages/cpp/app_templates/kxt/kxt.kdevtemplate b/languages/cpp/app_templates/kxt/kxt.kdevtemplate new file mode 100644 index 00000000..a7a23298 --- /dev/null +++ b/languages/cpp/app_templates/kxt/kxt.kdevtemplate @@ -0,0 +1,269 @@ +# KDE Config File +[General] +Name=KConfig XT application +Name[ca]=Aplicació KConfig XT +Name[da]=KConfig XT program +Name[de]=KConfigXT-Anwendung +Name[el]=Εφαρμογή KConfig XT +Name[es]=Aplicación KConfig XT +Name[et]=KConfig XT rakendus +Name[eu]=KConfig XT aplikazioa +Name[fa]=کاربرد KConfig XT +Name[fr]=Application KConfig XT +Name[ga]=Feidhmchlár XT KConfig +Name[gl]=Aplicación KConfig XT +Name[hu]=KConfig XT-alapú alkalmazás +Name[it]=Applicazione KConfig XT +Name[ja]=KConfig XT アプリケーション +Name[nds]=KConfig-XT-Programm +Name[ne]=KConfig XT अनुप्रयोग +Name[nl]=KConfig XT-toepassing +Name[pl]=Program KConfig XT +Name[pt]=Aplicação do KConfig XT +Name[pt_BR]=Aplicação do KConfig XT +Name[ru]=Приложение KDE с KConfig XT +Name[sk]=KConfig XT aplikácia +Name[sr]=KConfig XT програм +Name[sr@Latn]=KConfig XT program +Name[sv]=KConfig XT-program +Name[tr]=KConfig XT uygulaması +Name[zh_CN]=KConfig XT 应用程序 +Name[zh_TW]=KConfig XT 應用程式 +Category=C++/KDE +Icon=kxt.png +Comment=Generates a simple KDE application with one widget and a configuration dialog +Comment[ca]=Genera una simple aplicació per al KDE amb un estri i un diàleg de configuració +Comment[da]=Genererer et simpelt KDE-program med en kontrol og en indstillingsdialog +Comment[de]=Erstellt eine einfache KDE-Anwendung mit einem Widget und einem Einstellungsdialog. +Comment[el]=Δημιουργεί μια απλή εφαρμογή KDE με ένα γραφικό συστατικό, ένα διάλογο ρύθμισης +Comment[en_GB]=Generates a simple KDE application with one widget and a configuration dialogue +Comment[es]=Genera una sencilla aplicación para KDE con una ventana y un diálogo de configuración +Comment[et]=Lihtsa KDE rakenduse loomine ühe vidina ja seadistustedialoogiga. +Comment[eu]=Trepeta bat eta konfigurazio elkarrizketa-koadro bat duen KDE aplikazio sinple bat sortzen du +Comment[fa]=یک کاربرد سادۀ KDE، با یک عنصر و یک محاورۀ پیکربندی تولید میکند +Comment[fr]=Génère une application KDE simple comprenant un seul élément graphique (widget) et une boîte de dialogue de configuration +Comment[ga]=Cruthaíonn sé seo feidhmchlár simplí KDE le giuirléid amháin agus dialóg chumraíochta +Comment[gl]=Xera unha aplicación KDE sinxela cunha compoñente e un diálogo de configuración +Comment[hu]=Létrehoz egy egyszerű KDE-alkalmazást egy grafikus elemmel és egy beállítóablakkal +Comment[it]=Genera una semplice applicazione KDE con un elemento grafico e una finestra di configurazione +Comment[ja]=一つのウィジェットと設定ダイアログを含む簡単な KDE アプリケーションを作成します +Comment[nds]=Stellt en eenfach KDE-Programm mit een Element un en Instelldialoog op +Comment[ne]=एउटा विगेट र कन्फिगरेसन संवादसँग साधारण केडीई अनुप्रयोग उत्पन्न गर्दछ +Comment[nl]=Genereert een eenvoudige KDE-toepassing met één widget en een configuratiedialoog +Comment[pl]=Generuje prosty program KDE z jednym widgetem i oknem konfiguracyjnym +Comment[pt]=Gera uma aplicação simples do KDE com uma janela principal e outra para configuração +Comment[pt_BR]=Gera uma aplicação simples do KDE com uma janela principal e outra para configuração +Comment[ru]=Создание приложения KDE с окном конфигурации +Comment[sk]=Vygeneruje jednoduchú KDE aplikáciu s jedným oknom a konfiguračným dialógom +Comment[sr]=Прави једноставан KDE програм са једном контролом и дијалогом за подешавање +Comment[sr@Latn]=Pravi jednostavan KDE program sa jednom kontrolom i dijalogom za podešavanje +Comment[sv]=Skapar ett enkelt KDE-program med en grafisk komponent och en inställningsdialogruta +Comment[tr]=Bir parçacığı ve ayar penceresi olan basit bir KDE uygulaması yaratır. +Comment[zh_CN]=生成带一个部件和一个配置对话框的简单 KDE 应用程序 +Comment[zh_TW]=產生一個簡單的 KDE 應用程式,內含一個元件與一個設定對話框。 +FileTemplates=h,CStyle,cpp,CStyle +ShowFilesAfterGeneration=%{dest}/src/%{APPNAMELC}.cpp +Archive=kxt.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.am +Dest=%{dest}/Makefile.am + +[FILE6] +Type=install +Source=%{kdevelop}/template-common/kde-Makefile.cvs +Dest=%{dest}/Makefile.cvs + +[FILE7] +Type=install +Source=%{kdevelop}/template-common/kde-configure.in.in +Dest=%{dest}/configure.in.in + +[MkDir3] +Type=mkdir +Dir=%{dest}/src + +[FILE8] +Type=install +Source=%{kdevelop}/template-common/kde-app.desktop +Dest=%{dest}/src/%{APPNAMELC}.desktop + +[FILE9] +Type=install +Source=%{kdevelop}/template-common/kde-app.lsm +Dest=%{dest}/src/%{APPNAMELC}.lsm + +[FILE10] +Type=install +Source=%{kdevelop}/template-common/hi16-app-app.png +Dest=%{dest}/src/hi16-app-%{APPNAMELC}.png +Process=false + +[FILE11] +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 + +[FILE12] +Type=install +Source=%{kdevelop}/template-common/kde-po-Makefile.am +Dest=%{dest}/po/Makefile.am + +[FILE13] +Type=install +Source=%{src}/subdirs +Dest=%{dest}/subdirs + +[FILE14] +Type=install +Source=%{src}/src-Makefile.am +Dest=%{dest}/src/Makefile.am + +[FILE15] +Type=install +Source=%{src}/app.cpp +Dest=%{dest}/src/%{APPNAMELC}.cpp + +[FILE16] +Type=install +Source=%{src}/app.h +Dest=%{dest}/src/%{APPNAMELC}.h + +[FILE17] +Type=install +EscapeXML=true +Source=%{src}/appview_base.ui +Dest=%{dest}/src/%{APPNAMELC}view_base.ui + +[FILE18] +Type=install +Source=%{src}/appview.cpp +Dest=%{dest}/src/%{APPNAMELC}view.cpp + +[FILE19] +Type=install +Source=%{src}/appview.h +Dest=%{dest}/src/%{APPNAMELC}view.h + +[FILE20] +Type=install +EscapeXML=true +Source=%{src}/prefs-base.ui +Dest=%{dest}/src/prefs-base.ui + +[FILE21] +Type=install +Source=%{src}/prefs.cpp +Dest=%{dest}/src/prefs.cpp + +[FILE22] +Type=install +Source=%{src}/prefs.h +Dest=%{dest}/src/prefs.h + +[FILE23] +Type=install +Source=%{src}/main.cpp +Dest=%{dest}/src/main.cpp + +[FILE24] +Type=install +EscapeXML=true +Source=%{src}/appui.rc +Dest=%{dest}/src/%{APPNAMELC}ui.rc + +[FILE25] +Type=install +Source=%{src}/README +Dest=%{dest}/src/README + +[FILE26] +Type=install +Source=%{src}/app.kcfg +Dest=%{dest}/src/%{APPNAMELC}.kcfg + +[FILE27] +Type=install +Source=%{src}/settings.kcfgc +Dest=%{dest}/src/settings.kcfgc + +[FILE28] +Type=install +Source=%{src}/src-configure.in.in +Dest=%{dest}/configure.in.in + +[MSG] +Type=message +Comment=A KConfig XT application was created in %{dest} +Comment[ca]=Una aplicació KConfig XT ha estat creada en %{dest} +Comment[da]=Et KConfig XT-program blev oprettet i %{dest} +Comment[de]=Eine KConfig-XT-Anwendung wurde in %{dest} erstellt +Comment[el]=Μια εφαρμογή KConfig XT δημιουργήθηκε στο %{dest} +Comment[es]=Una aplicación KConfig XT ha sido creada en %{dest} +Comment[et]=A KConfig XT rakendus loodi asukohta %{dest} +Comment[eu]=KConfig XT aplikazio bat sortu da hemen: %{dest} +Comment[fa]=یک کاربرد KConfig XT در %{dest} ایجاد شد +Comment[fr]=Une application KConfig XT a été créée dans %{dest} +Comment[ga]=Cruthaíodh feidhmchlár XT KConfig i %{dest} +Comment[gl]=Creouse unha aplicación KConfig XT en %{dest} +Comment[hu]=Létrejött egy KConfig XT-alapú alkalmazás itt: %{dest} +Comment[it]=È stata creata un'applicazione KConfig XT in %{dest} +Comment[ja]=KConfig XT アプリケーションを %{dest} に作成しました +Comment[nds]=In %{dest} wöör en KConfig-XT-Programm opstellt +Comment[ne]=KConfig XT अनुप्रयोग %{dest} मा सिर्जना गरियो +Comment[nl]=Een KConfig XT-toepassing is aangemaakt in %{dest} +Comment[pl]=Program KConfig XT został utworzony w %{dest} +Comment[pt]=Foi criada uma aplicação do KConfig XT em %{dest} +Comment[pt_BR]=Foi criada uma aplicação do KConfig XT em %{dest} +Comment[ru]=Приложение KDE с KConfig XT создано в %{dest} +Comment[sk]=KConfig XT aplikácia bola vytvorená v %{dest} +Comment[sr]=KConfig XT програм је направљен у %{dest} +Comment[sr@Latn]=KConfig XT program je napravljen u %{dest} +Comment[sv]=Ett KConfig XT-program skapades i %{dest} +Comment[tr]=Bir KConfig XT uygulaması %{dest} içinde yaratıldı. +Comment[zh_CN]=在 %{dest} 中创建了 KConfig XT 应用程序 +Comment[zh_TW]=一個 KConfig XT 應用程式已建立於 %{dest} diff --git a/languages/cpp/app_templates/kxt/kxt.png b/languages/cpp/app_templates/kxt/kxt.png Binary files differnew file mode 100644 index 00000000..5a4b6359 --- /dev/null +++ b/languages/cpp/app_templates/kxt/kxt.png diff --git a/languages/cpp/app_templates/kxt/main.cpp b/languages/cpp/app_templates/kxt/main.cpp new file mode 100644 index 00000000..66f038c9 --- /dev/null +++ b/languages/cpp/app_templates/kxt/main.cpp @@ -0,0 +1,57 @@ +%{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 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; + + // see if we are starting with session management + if (app.isRestored()) + { + RESTORE(%{APPNAMELC}); + } + else + { + // no session.. just start up normally + KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); + if (args->count() == 0) + { + %{APPNAMELC} *widget = new %{APPNAMELC}; + widget->show(); + } + else + { + int i = 0; + for (; i < args->count(); i++) + { + %{APPNAMELC} *widget = new %{APPNAMELC}; + widget->show(); + } + } + args->clear(); + } + + return app.exec(); +} + diff --git a/languages/cpp/app_templates/kxt/prefs-base.ui b/languages/cpp/app_templates/kxt/prefs-base.ui new file mode 100644 index 00000000..5c0fc860 --- /dev/null +++ b/languages/cpp/app_templates/kxt/prefs-base.ui @@ -0,0 +1,127 @@ +<!DOCTYPE UI><UI version="3.2" stdsetdef="1"> +<class>Prefs_base</class> +<widget class="QWidget"> + <property name="name"> + <cstring>Prefs_base</cstring> + </property> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>282</width> + <height>156</height> + </rect> + </property> + <grid> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="QLabel" row="0" column="0"> + <property name="name"> + <cstring>textLabel2_2</cstring> + </property> + <property name="text"> + <string>Background color:</string> + </property> + </widget> + <widget class="KColorButton" row="0" column="1"> + <property name="name"> + <cstring>kcfg_col_background</cstring> + </property> + <property name="text"> + <string></string> + </property> + </widget> + <widget class="QLabel" row="2" column="0"> + <property name="name"> + <cstring>textLabel1</cstring> + </property> + <property name="text"> + <string>Project age:</string> + </property> + </widget> + <widget class="QLabel" row="1" column="0"> + <property name="name"> + <cstring>textLabel2</cstring> + </property> + <property name="text"> + <string>Foreground color:</string> + </property> + </widget> + <widget class="KColorButton" row="1" column="1"> + <property name="name"> + <cstring>kcfg_col_foreground</cstring> + </property> + <property name="text"> + <string></string> + </property> + </widget> + <spacer row="0" column="2"> + <property name="name"> + <cstring>spacer1</cstring> + </property> + <property name="orientation"> + <enum>Horizontal</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="sizeHint"> + <size> + <width>41</width> + <height>20</height> + </size> + </property> + </spacer> + <spacer row="1" column="2"> + <property name="name"> + <cstring>spacer2</cstring> + </property> + <property name="orientation"> + <enum>Horizontal</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="sizeHint"> + <size> + <width>41</width> + <height>20</height> + </size> + </property> + </spacer> + <widget class="QSpinBox" row="2" column="1"> + <property name="name"> + <cstring>kcfg_val_time</cstring> + </property> + <property name="minValue"> + <number>1</number> + </property> + <property name="value"> + <number>2</number> + </property> + </widget> + <spacer row="2" column="2"> + <property name="name"> + <cstring>spacer3</cstring> + </property> + <property name="orientation"> + <enum>Horizontal</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="sizeHint"> + <size> + <width>41</width> + <height>20</height> + </size> + </property> + </spacer> + </grid> +</widget> +<layoutdefaults spacing="6" margin="11"/> +<includehints> + <includehint>kcolorbutton.h</includehint> +</includehints> +</UI> diff --git a/languages/cpp/app_templates/kxt/prefs.cpp b/languages/cpp/app_templates/kxt/prefs.cpp new file mode 100644 index 00000000..e7a46ddf --- /dev/null +++ b/languages/cpp/app_templates/kxt/prefs.cpp @@ -0,0 +1,12 @@ +%{CPP_TEMPLATE} + +#include "prefs.h" +#include <kdebug.h> + +Prefs::Prefs() + : Prefs_base() +{ +// debugging : +// kdWarning()<<"creating a pref dialog"<<endl; +} + diff --git a/languages/cpp/app_templates/kxt/prefs.h b/languages/cpp/app_templates/kxt/prefs.h new file mode 100644 index 00000000..9106fe59 --- /dev/null +++ b/languages/cpp/app_templates/kxt/prefs.h @@ -0,0 +1,11 @@ +%{H_TEMPLATE} + +#include "prefs-base.h" + + +class Prefs : public Prefs_base +{ + public: + Prefs(); +}; + diff --git a/languages/cpp/app_templates/kxt/preview.png b/languages/cpp/app_templates/kxt/preview.png Binary files differnew file mode 100644 index 00000000..e235c9cf --- /dev/null +++ b/languages/cpp/app_templates/kxt/preview.png diff --git a/languages/cpp/app_templates/kxt/settings.kcfgc b/languages/cpp/app_templates/kxt/settings.kcfgc new file mode 100644 index 00000000..384510cd --- /dev/null +++ b/languages/cpp/app_templates/kxt/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/kxt/src-Makefile.am b/languages/cpp/app_templates/kxt/src-Makefile.am new file mode 100644 index 00000000..5f7936da --- /dev/null +++ b/languages/cpp/app_templates/kxt/src-Makefile.am @@ -0,0 +1,41 @@ +## Makefile.am for %{APPNAMELC} + +# this is the program that gets installed. it's name is used for all +# of the other Makefile.am variables +bin_PROGRAMS = %{APPNAMELC} + +# set the include path for X, qt and KDE +INCLUDES = $(all_includes) + +# let automoc handle all of the meta source files (moc) +METASOURCES = AUTO + +# the library search path. +%{APPNAMELC}_LDFLAGS = $(KDE_RPATH) $(all_libraries) + +# the libraries to link against. +%{APPNAMELC}_LDADD = $(LIB_KFILE) $(LIB_KDEPRINT) + +# which sources should be compiled for %{APPNAMELC} +%{APPNAMELC}_SOURCES = settings.kcfgc main.cpp %{APPNAMELC}.cpp %{APPNAMELC}view.cpp \ + %{APPNAMELC}view_base.ui prefs-base.ui prefs.cpp + +xdg_apps_DATA = %{APPNAMELC}.desktop +kde_kcfg_DATA = %{APPNAMELC}.kcfg + +# these are the headers for your project +noinst_HEADERS = %{APPNAMELC}.h %{APPNAMELC}view.h prefs.h + +messages: rc.cpp + $(EXTRACTRC) `find . -name \*.ui -o -name \*.rc` > rc.cpp + $(XGETTEXT) *.cpp -o $(podir)/%{APPNAMELC}.pot + +KDE_ICON = AUTO + +# this is where the kdelnk file will go +kdelnkdir = $(kde_appsdir)/Utilities +kdelnk_DATA = %{APPNAMELC}.desktop + +# this is where the XML-GUI resource file goes +rcdir = $(kde_datadir)/%{APPNAMELC} +rc_DATA = %{APPNAMELC}ui.rc diff --git a/languages/cpp/app_templates/kxt/src-configure.in.in b/languages/cpp/app_templates/kxt/src-configure.in.in new file mode 100644 index 00000000..61d4a7fd --- /dev/null +++ b/languages/cpp/app_templates/kxt/src-configure.in.in @@ -0,0 +1,7 @@ + +#MIN_CONFIG(3.2.0) + +AM_INIT_AUTOMAKE(%{APPNAMELC}, %{VERSION}) +AC_C_BIGENDIAN +AC_CHECK_KDEMAXPATHLEN + diff --git a/languages/cpp/app_templates/kxt/subdirs b/languages/cpp/app_templates/kxt/subdirs new file mode 100644 index 00000000..0e678106 --- /dev/null +++ b/languages/cpp/app_templates/kxt/subdirs @@ -0,0 +1,3 @@ +doc +po +src |