diff options
Diffstat (limited to 'languages/cpp/app_templates/kconfig35')
22 files changed, 1146 insertions, 0 deletions
diff --git a/languages/cpp/app_templates/kconfig35/Makefile.am b/languages/cpp/app_templates/kconfig35/Makefile.am new file mode 100644 index 00000000..f5f8132d --- /dev/null +++ b/languages/cpp/app_templates/kconfig35/Makefile.am @@ -0,0 +1,19 @@ +dataFiles = src-Makefile.am app.cpp app.h main.cpp appui.rc app.kdevelop \ + subdirs app.desktop kxt35.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= kconfig35 + +### 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/kconfig35/README b/languages/cpp/app_templates/kconfig35/README new file mode 100644 index 00000000..527ce518 --- /dev/null +++ b/languages/cpp/app_templates/kconfig35/README @@ -0,0 +1,90 @@ +----------------------------------------------- +Kde templates quickstart +Author: Thomas Nagy +Date: 2004-03-22 +----------------------------------------------- + +This README file explains you basic things for starting with +this application template. + +----------------------------------------------- +--NOTE--: you need kdelibs 3.5 and kdelibs headers 3.5 (devel package) in order to build this template. +Qt version might be 3.3.4 or 3.3.5 +----------------------------------------------- + +** 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/kconfig35/app.cpp b/languages/cpp/app_templates/kconfig35/app.cpp new file mode 100644 index 00000000..e32e28b5 --- /dev/null +++ b/languages/cpp/app_templates/kconfig35/app.cpp @@ -0,0 +1,105 @@ +%{CPP_TEMPLATE} + +#include "%{APPNAMELC}.h" +#include "settings.h" +#include "prefs.h" + +#include <qdragobject.h> + +#include <kaction.h> +#include <kconfigdialog.h> +#include <kglobal.h> +#include <klocale.h> +#include <kprinter.h> +#include <kstatusbar.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); + // and a status bar + statusBar()->show(); + // then, setup our actions + setupActions(); + + // 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()); + + KStdAction::preferences(this, SLOT(optionsPreferences()), actionCollection()); + + // custom menu and menu item + KAction *custom = new KAction(i18n("Swi&tch Colors"), 0, + m_view, SLOT(switchColors()), + actionCollection(), "switch_action"); + + setupGUI(); +} + +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.) + setupGUI(); +} + +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}::changeCaption(const QString& text) +{ + // display the text on the caption + setCaption(text); +} + +void %{APPNAMELC}::changeStatusbar(const QString& text) +{ + // display the text on the statusbar + statusBar()->message(text); +} + +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(); +} + +#include "%{APPNAMELC}.moc" + diff --git a/languages/cpp/app_templates/kconfig35/app.desktop b/languages/cpp/app_templates/kconfig35/app.desktop new file mode 100644 index 00000000..8b36e6e0 --- /dev/null +++ b/languages/cpp/app_templates/kconfig35/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/kconfig35/app.h b/languages/cpp/app_templates/kconfig35/app.h new file mode 100644 index 00000000..abfd6c09 --- /dev/null +++ b/languages/cpp/app_templates/kconfig35/app.h @@ -0,0 +1,60 @@ +%{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 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 optionsPreferences(); + void newToolbarConfig(); + + void changeStatusbar(const QString& text); + void changeCaption(const QString& text); + +private: + + void setupActions(); + +private: + %{APPNAMELC}View *m_view; + + KPrinter *m_printer; +}; + +#endif // _%{APPNAMEUC}_H_ + diff --git a/languages/cpp/app_templates/kconfig35/app.kcfg b/languages/cpp/app_templates/kconfig35/app.kcfg new file mode 100644 index 00000000..686f25f2 --- /dev/null +++ b/languages/cpp/app_templates/kconfig35/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/kconfig35/app.kdevelop b/languages/cpp/app_templates/kconfig35/app.kdevelop new file mode 100644 index 00000000..07cf3f0f --- /dev/null +++ b/languages/cpp/app_templates/kconfig35/app.kdevelop @@ -0,0 +1,168 @@ +<?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/kconfig35/appui.rc b/languages/cpp/app_templates/kconfig35/appui.rc new file mode 100644 index 00000000..06549878 --- /dev/null +++ b/languages/cpp/app_templates/kconfig35/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/kconfig35/appview.cpp b/languages/cpp/app_templates/kconfig35/appview.cpp new file mode 100644 index 00000000..35e23682 --- /dev/null +++ b/languages/cpp/app_templates/kconfig35/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/kconfig35/appview.h b/languages/cpp/app_templates/kconfig35/appview.h new file mode 100644 index 00000000..45a10de7 --- /dev/null +++ b/languages/cpp/app_templates/kconfig35/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/kconfig35/appview_base.ui b/languages/cpp/app_templates/kconfig35/appview_base.ui new file mode 100644 index 00000000..626d95df --- /dev/null +++ b/languages/cpp/app_templates/kconfig35/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/kconfig35/kconfig35.kdevtemplate b/languages/cpp/app_templates/kconfig35/kconfig35.kdevtemplate new file mode 100644 index 00000000..0aa709f4 --- /dev/null +++ b/languages/cpp/app_templates/kconfig35/kconfig35.kdevtemplate @@ -0,0 +1,245 @@ +# KDE Config File +[General] +Name=KConfig XT for KDE 3.5 +Name[ca]=KConfig XT per a KDE 3.5 +Name[de]=KConfigXT-Anwendung für KDE 3.5 +Name[el]=Εφαρμογή KConfig XT για το KDE 3.5 +Name[es]=KConfig XT para KDE 3.5 +Name[et]=KConfig XT KDE 3.5 jaoks +Name[fr]=Application KConfig XT pour KDE 3.5 +Name[hu]=KConfig XT a KDE 3.5-höz +Name[it]=KConfig XT per KDE 3.5 +Name[ja]=KDE 3.5 用 KConfig XT +Name[nds]=KConfig-XT-Programm för KDE 3.5 +Name[nl]=KConfig XT voor KDE 3.5 +Name[pl]=Program KConfig XT dla KDE 3.5 +Name[pt]=Aplicação do KConfig XT para o KDE 3.5 +Name[pt_BR]=Aplicação do KConfig XT para o KDE 3.5 +Name[ru]=Приложение KDE 3.5 с KConfig XT +Name[sk]=KConfig XT pre KDE 3.5 +Name[sr]=KConfig XT програм за KDE 3.5 +Name[sr@Latn]=KConfig XT program za KDE 3.5 +Name[sv]=KConfig XT för KDE 3.5 +Name[zh_TW]=KDE 3.5 的 KConfig XT 應用程式 +Category=C++/KDE +Icon=kxt.png +Comment=Generates a simple KDE application with one widget and a configuration dialog compatible with KDE 3.5 only +Comment[ca]=Genera una simple aplicació per al KDE amb un estri i un diàleg de configuració compatible només amb KDE 3.5. +Comment[da]=Genererer et simpelt KDE-program med en kontrol og en indstillingsdialog der kun er kompatibelt med KDE 3.5 +Comment[de]=Erstellt eine einfache KDE-Anwendung für KDE 3.5 mit einem Widget und einem Einstellungsdialog. +Comment[el]=Δημιουργεί μια απλή εφαρμογή KDE με ένα γραφικό συστατικό, ένα διάλογο ρύθμισης συμβατό μόνο με το KDE 3.5 +Comment[en_GB]=Generates a simple KDE application with one widget and a configuration dialogue compatible with KDE 3.5 only +Comment[es]=Genera una sencilla aplicación para KDE con un widget y un diálogo de configuración compatible solo con KDE 3.5 +Comment[et]=Lihtsa KDE rakenduse loomine ühe vidina ja vaid KDE 3.5-ga ühilduva seadistustedialoogiga. +Comment[fr]=Génère une application KDE simple comprenant un seul élément graphique et une boîte de dialogue de configuration compatible avec KDE 3.5 uniquement +Comment[hu]=Létrehoz egy egyszerű KDE-alkalmazást egy grafikus elemmel és egy beállítóablakkal, csak a KDE 3.5-tel kompatibilis +Comment[it]=Genera una semplice applicazione KDE con un elemento grafico e una finestra di configurazione compatibile solo con KDE 3.5 +Comment[ja]=一つのウィジェットと設定ダイアログを含む簡単な KDE アプリケーションを作成します (KDE 3.5 用) +Comment[nds]=Stellt en eenfach KDE-Programm mit een Element un en Instelldialoog op, de bloots mit KDE 3.5 kompatibel is. +Comment[nl]=Genereert een eenvoudige KDE-toepassing met één widget en een configuratiedialoog die alleen met KDE 3.5 compatible is +Comment[pl]=Generuje prosty program KDE z jednym widżetem i oknem konfiguracyjnym zgodnym z KDE 3.5 +Comment[pt]=Gera uma aplicação simples do KDE com uma janela principal e outra para configuração, apenas para o KDE 3.5 +Comment[pt_BR]=Gera uma aplicação simples do KDE com uma janela principal e outra para configuração, apenas para o KDE 3.5 +Comment[ru]=Создание простого приложения KDE с одним виджетом и диалогом конфигурации, совместимое только с KDE 3.5. +Comment[sk]=Vygeneruje jednoduchú KDE aplikáciu s jedným oknom a konfiguračným dialógom kompatibilnú len s KDE 3.5 +Comment[sr]=Прави једноставан KDE програм са једном контролом и дијалогом за подешавање, компатибилан само са KDE-ом 3.5 +Comment[sr@Latn]=Pravi jednostavan KDE program sa jednom kontrolom i dijalogom za podešavanje, kompatibilan samo sa KDE-om 3.5 +Comment[sv]=Skapar ett enkelt KDE-program med en grafisk komponent och en inställningsdialogruta, som bara fungerar med KDE 3.5 +Comment[zh_TW]=產生一個簡單的 KDE 3.5 上的應用程式,內含一個元件與一個設定對話框。 +FileTemplates=h,CStyle,cpp,CStyle +ShowFilesAfterGeneration=%{dest}/src/%{APPNAMELC}.cpp,%{dest}/README +Archive=kconfig35.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 + +[FILE11] +Type=install +Source=%{kdevelop}/template-common/hi32-app-app.png +Dest=%{dest}/src/hi32-app-%{APPNAMELC}.png + +[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}/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 KDE 3.5 KConfig XT application was created in %{dest} +Comment[ca]=Una aplicació KConfig XT per al KDE ha estat creada en %{dest} +Comment[da]=Et KDE 3.5 KConfig XT-program blev oprettet i %{dest} +Comment[de]=Eine KConfig-XT-Anwendung für KDE 3.5 wurde in %{dest} erstellt. +Comment[el]=Μια εφαρμογή KConfig XT του KDE 3.5 δημιουργήθηκε στο %{dest} +Comment[es]=Una aplicación KConfig XT para KDE 3.5 ha sido creada en %{dest} +Comment[et]=KDE 3.5 KConfig XT rakendus loodi asukohta %{dest} +Comment[fr]=Une application KConfig XT pour KDE 3.5 a été créée dans %{dest} +Comment[hu]=Létrejött egy KConfig XT-alapú KDE 3.5-alkalmazás itt: %{dest} +Comment[it]=È stata creata un'applicazione KConfig XT per KDE 3.5 in %{dest} +Comment[ja]=KDE 3.5 用 KConfig XT アプリケーションを %{dest} に作成しました +Comment[nds]=In %{dest} wöör en KConfig-XT-Programm för KDE 3.5 opstellt +Comment[nl]=Een KDE 3.5 KConfig XT-toepassing is aangemaakt in %{dest} +Comment[pl]=Program KConfig XT dla KDE 3.5 został utworzony w %{dest} +Comment[pt]=Foi criada uma aplicação do KConfig XT para o KDE 3.5 em %{dest} +Comment[pt_BR]=Foi criada uma aplicação do KConfig XT para o KDE 3.5 em %{dest} +Comment[ru]=Приложение KDE с KConfig XT создано в %{dest} +Comment[sk]=KConfig XT pre KDE 3.5 bola vytvorená v %{dest} +Comment[sr]=KConfig XT програм за KDE 3.5 направљен је у %{dest} +Comment[sr@Latn]=KConfig XT program za KDE 3.5 napravljen je u %{dest} +Comment[sv]=Ett KDE 3.5 KConfig XT-program skapades i %{dest} +Comment[zh_TW]=一個 KDE 3.5 上的 KConfig XT 應用程式已建立於 %{dest} diff --git a/languages/cpp/app_templates/kconfig35/kconfig35.png b/languages/cpp/app_templates/kconfig35/kconfig35.png Binary files differnew file mode 100644 index 00000000..a3866883 --- /dev/null +++ b/languages/cpp/app_templates/kconfig35/kconfig35.png diff --git a/languages/cpp/app_templates/kconfig35/kxt35.png b/languages/cpp/app_templates/kconfig35/kxt35.png Binary files differnew file mode 100644 index 00000000..a3866883 --- /dev/null +++ b/languages/cpp/app_templates/kconfig35/kxt35.png diff --git a/languages/cpp/app_templates/kconfig35/main.cpp b/languages/cpp/app_templates/kconfig35/main.cpp new file mode 100644 index 00000000..66f038c9 --- /dev/null +++ b/languages/cpp/app_templates/kconfig35/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/kconfig35/prefs-base.ui b/languages/cpp/app_templates/kconfig35/prefs-base.ui new file mode 100644 index 00000000..5c0fc860 --- /dev/null +++ b/languages/cpp/app_templates/kconfig35/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/kconfig35/prefs.cpp b/languages/cpp/app_templates/kconfig35/prefs.cpp new file mode 100644 index 00000000..e7a46ddf --- /dev/null +++ b/languages/cpp/app_templates/kconfig35/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/kconfig35/prefs.h b/languages/cpp/app_templates/kconfig35/prefs.h new file mode 100644 index 00000000..9106fe59 --- /dev/null +++ b/languages/cpp/app_templates/kconfig35/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/kconfig35/settings.kcfgc b/languages/cpp/app_templates/kconfig35/settings.kcfgc new file mode 100644 index 00000000..384510cd --- /dev/null +++ b/languages/cpp/app_templates/kconfig35/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/kconfig35/src-Makefile.am b/languages/cpp/app_templates/kconfig35/src-Makefile.am new file mode 100644 index 00000000..5f7936da --- /dev/null +++ b/languages/cpp/app_templates/kconfig35/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/kconfig35/src-configure.in.in b/languages/cpp/app_templates/kconfig35/src-configure.in.in new file mode 100644 index 00000000..61d4a7fd --- /dev/null +++ b/languages/cpp/app_templates/kconfig35/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/kconfig35/subdirs b/languages/cpp/app_templates/kconfig35/subdirs new file mode 100644 index 00000000..0e678106 --- /dev/null +++ b/languages/cpp/app_templates/kconfig35/subdirs @@ -0,0 +1,3 @@ +doc +po +src |