diff options
author | Michele Calgaro <michele.calgaro@yahoo.it> | 2014-05-25 15:37:31 +0900 |
---|---|---|
committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2014-05-25 15:37:31 +0900 |
commit | 6392f5a9dfce2bf83617d49bb7f332181ec6004e (patch) | |
tree | ab69e390f7962b7e7dda1a3a64f035c61c751cf4 /languages/cpp/app_templates/kde4app | |
parent | aba2788b428dc53243407902e9ccbb20b97a69fd (diff) | |
download | tdevelop-6392f5a9dfce2bf83617d49bb7f332181ec6004e.tar.gz tdevelop-6392f5a9dfce2bf83617d49bb7f332181ec6004e.zip |
Revert "Finish renaming tdevelop components"
This reverts commit 722ce1efbac31c61b1d4b13f7e075c9f311e3e73.
Diffstat (limited to 'languages/cpp/app_templates/kde4app')
19 files changed, 1197 insertions, 0 deletions
diff --git a/languages/cpp/app_templates/kde4app/CMakeLists.txt b/languages/cpp/app_templates/kde4app/CMakeLists.txt new file mode 100644 index 00000000..0399f045 --- /dev/null +++ b/languages/cpp/app_templates/kde4app/CMakeLists.txt @@ -0,0 +1,29 @@ +################################################# +# +# (C) 2010-2011 Serghei Amelian +# serghei (DOT) amelian (AT) gmail.com +# +# Improvements and feedback are welcome +# +# This file is released under GPL >= 2 +# +################################################# + +add_custom_target( kde4app.tar.gz ALL + COMMAND tar zcf kde4app.tar.gz -C ${CMAKE_CURRENT_SOURCE_DIR} + kapp4.cpp kapp4.h prefs_base.ui kapp4view.cpp + kapp4view.h kapp4view_base.ui main.cpp kde4appui.rc + kde4app-CMakeLists.txt kapp4.desktop kapp4.kcfg + settings.kcfgc kde4app.png README kde4app.tdevelop + kde4app.tdevelop.filelist +) + + +install( FILES + ${CMAKE_CURRENT_BINARY_DIR}/kde4app.tar.gz kde4app.png + DESTINATION ${DATA_INSTALL_DIR}/kdevappwizard ) + + +install( FILES + kde4app.kdevtemplate + DESTINATION ${DATA_INSTALL_DIR}/kdevappwizard/templates ) diff --git a/languages/cpp/app_templates/kde4app/Makefile.am b/languages/cpp/app_templates/kde4app/Makefile.am new file mode 100644 index 00000000..455acd8d --- /dev/null +++ b/languages/cpp/app_templates/kde4app/Makefile.am @@ -0,0 +1,19 @@ +dataFiles = kapp4.cpp kapp4.h prefs_base.ui kapp4view.cpp kapp4view.h kapp4view_base.ui \ + main.cpp kde4appui.rc CMakeLists.txt kapp4.desktop kapp4.kcfg settings.kcfgc \ + kde4app.png README kde4app.tdevelop kde4app.tdevelop.filelist + +templateName = kde4app + +### 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/kde4app/README b/languages/cpp/app_templates/kde4app/README new file mode 100644 index 00000000..8180d28c --- /dev/null +++ b/languages/cpp/app_templates/kde4app/README @@ -0,0 +1,15 @@ +!!!!!ATTENTION!!!!! + +Before starting the build you may need to setup the KDE4 environment variables. +To do this open Project->Project Options and then look at the "Run" and the "Make" +pages. Each of these two has an environment variables widget in which you have +to fill in the right values for the variables already listed. + +After setting up the variables you'll also need to run cmake inside the build +directory. This can not be done by tdevelop as a KDE4 environment is needed +when running cmake to find KDE4. Open the integrated konsole and change to the build +subdirectory. Then setup a KDE4 environment and run "cmake ../". + +More information how to setup a KDE4 development environment can be found on +http://techbase.kde.org/Getting_Started/Increased_Productivity_in_KDE4_with_Scripts + diff --git a/languages/cpp/app_templates/kde4app/kapp4.cpp b/languages/cpp/app_templates/kde4app/kapp4.cpp new file mode 100644 index 00000000..d224123c --- /dev/null +++ b/languages/cpp/app_templates/kde4app/kapp4.cpp @@ -0,0 +1,90 @@ +%{CPP_TEMPLATE} + +#include "%{APPNAMELC}.h" +#include "%{APPNAMELC}view.h" +#include "settings.h" + +#include <TQtGui/TQDropEvent> +#include <TQtGui/TQPainter> + +#include <tdeconfigdialog.h> +#include <kstatusbar.h> + +#include <tdeaction.h> +#include <tdeactioncollection.h> +#include <kstandardaction.h> + +#include <KDE/TDELocale> + +%{APPNAME}::%{APPNAME}() + : KXmlGuiWindow(), + m_view(new %{APPNAME}View(this)), + m_printer(0) +{ + // accept dnd + setAcceptDrops(true); + + // tell the KXmlGuiWindow that this is indeed the main widget + setCentralWidget(m_view); + + // then, setup our actions + setupActions(); + + // add a status bar + statusBar()->show(); + + // a call to KXmlGuiWindow::setupGUI() populates the GUI + // with actions, using KXMLGUI. + // It also applies the saved mainwindow settings, if any, and ask the + // mainwindow to automatically save settings if changed: window size, + // toolbar position, icon size, etc. + setupGUI(); +} + +%{APPNAME}::~%{APPNAME}() +{ +} + +void %{APPNAME}::setupActions() +{ + TDEStandardAction::openNew(this, TQT_SLOT(fileNew()), actionCollection()); + TDEStandardAction::quit(tqApp, TQT_SLOT(quit()), actionCollection()); + + TDEStandardAction::preferences(this, TQT_SLOT(optionsPreferences()), actionCollection()); + + // custom menu and menu item - the slot is in the class %{APPNAME}View + TDEAction *custom = new TDEAction(TDEIcon("colorize"), i18n("Swi&tch Colors"), this); + actionCollection()->addAction( TQLatin1String("switch_action"), custom ); + connect(custom, TQT_SIGNAL(triggered(bool)), m_view, TQT_SLOT(switchColors())); +} + +void %{APPNAME}::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 %{APPNAME})->show(); +} + +void %{APPNAME}::optionsPreferences() +{ + // The preference dialog is derived from prefs_base.ui + // + // compare the names of the widgets in the .ui file + // to the names of the variables in the .kcfg file + //avoid to have 2 dialogs shown + if ( TDEConfigDialog::showDialog( "settings" ) ) { + return; + } + TDEConfigDialog *dialog = new TDEConfigDialog(this, "settings", Settings::self()); + TQWidget *generalSettingsDlg = new TQWidget; + ui_prefs_base.setupUi(generalSettingsDlg); + dialog->addPage(generalSettingsDlg, i18n("General"), "package_setting"); + connect(dialog, TQT_SIGNAL(settingsChanged(TQString)), m_view, TQT_SLOT(settingsChanged())); + dialog->setAttribute( TQt::WA_DeleteOnClose ); + dialog->show(); +} + +#include "%{APPNAMELC}.moc" diff --git a/languages/cpp/app_templates/kde4app/kapp4.desktop b/languages/cpp/app_templates/kde4app/kapp4.desktop new file mode 100644 index 00000000..18cdcbe5 --- /dev/null +++ b/languages/cpp/app_templates/kde4app/kapp4.desktop @@ -0,0 +1,30 @@ +[Desktop Entry] +Name=KApp4 +Name[nds]=KProg4 +Name[sv]=KDE 4-program +Name[zh_TW]=KApp4 程式 +Exec=kapp4 %i -caption "%c" +Icon=kapp4 +Type=Application +DocPath=kapp4/kapp4.html +GenericName=A KDE4 Application +GenericName[ca]=Una aplicació del KDE4 +GenericName[da]=Et KDE4-program +GenericName[de]=Eine KDE 4-Anwendung +GenericName[el]=Μία εφαρμογή του KDE4 +GenericName[es]=Una aplicación para KDE4 +GenericName[et]=KDE4 rakendus +GenericName[hu]=KDE4-alapú alkalmazás +GenericName[it]=Applicazione KDE4 +GenericName[nds]=En KDE4-Programm +GenericName[nl]=Een KDE4-programma +GenericName[pl]=Program dla KDE4 +GenericName[pt]=Uma Aplicação do KDE4 +GenericName[pt_BR]=Uma Aplicação do KDE4 +GenericName[ru]=Приложение KDE 4 +GenericName[sk]=KDE4 aplikácia +GenericName[sr]=KDE4 програм +GenericName[sr@Latn]=KDE4 program +GenericName[sv]=Ett KDE 4-program +GenericName[zh_TW]=KDE4 應用程式 +Terminal=false diff --git a/languages/cpp/app_templates/kde4app/kapp4.h b/languages/cpp/app_templates/kde4app/kapp4.h new file mode 100644 index 00000000..3c209de2 --- /dev/null +++ b/languages/cpp/app_templates/kde4app/kapp4.h @@ -0,0 +1,54 @@ +%{H_TEMPLATE} +#ifndef %{APPNAMEUC}_H +#define %{APPNAMEUC}_H + + +#include <kxmlguiwindow.h> + +#include "ui_prefs_base.h" + +class %{APPNAME}View; +class KPrinter; +class TDEToggleAction; +class KUrl; + +/** + * This class serves as the main window for %{APPNAME}. It handles the + * menus, toolbars, and status bars. + * + * @short Main window class + * @author Andreas Pakulat <apaku@gmx.de> + * @version 0.1 + */ +class %{APPNAME} : public KXmlGuiWindow +{ + Q_OBJECT + +public: + /** + * Default Constructor + */ + %{APPNAME}(); + + /** + * Default Destructor + */ + virtual ~%{APPNAME}(); + +private slots: + void fileNew(); + void optionsPreferences(); + +private: + void setupActions(); + +private: + Ui::prefs_base ui_prefs_base ; + %{APPNAME}View *m_view; + + KPrinter *m_printer; + TDEToggleAction *m_toolbarAction; + TDEToggleAction *m_statusbarAction; +}; + +#endif // _%{APPNAMELC}_H_ diff --git a/languages/cpp/app_templates/kde4app/kapp4.kcfg b/languages/cpp/app_templates/kde4app/kapp4.kcfg new file mode 100644 index 00000000..6040f769 --- /dev/null +++ b/languages/cpp/app_templates/kde4app/kapp4.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/kde4app/kapp4view.cpp b/languages/cpp/app_templates/kde4app/kapp4view.cpp new file mode 100644 index 00000000..af95aa15 --- /dev/null +++ b/languages/cpp/app_templates/kde4app/kapp4view.cpp @@ -0,0 +1,42 @@ +%{CPP_TEMPLATE} +#include "%{APPNAMELC}view.h" +#include "settings.h" + +#include <tdelocale.h> +#include <TQtGui/TQLabel> + +%{APPNAME}View::%{APPNAME}View(TQWidget *) +{ + ui_%{APPNAMELC}view_base.setupUi(this); + settingsChanged(); + setAutoFillBackground(true); +} + +%{APPNAME}View::~%{APPNAME}View() +{ + +} + +void %{APPNAME}View::switchColors() +{ + // switch the foreground/background colors of the label + TQColor color = Settings::col_background(); + Settings::setCol_background( Settings::col_foreground() ); + Settings::setCol_foreground( color ); + + settingsChanged(); +} + +void %{APPNAME}View::settingsChanged() +{ + TQPalette pal; + pal.setColor( TQPalette::Window, Settings::col_background()); + pal.setColor( TQPalette::WindowText, Settings::col_foreground()); + ui_%{APPNAMELC}view_base.kcfg_sillyLabel->setPalette( pal ); + + // i18n : internationalization + ui_%{APPNAMELC}view_base.kcfg_sillyLabel->setText( i18n("This project is %1 days old",Settings::val_time()) ); + emit signalChangeStatusbar( i18n("Settings changed") ); +} + +#include "%{APPNAMELC}view.moc" diff --git a/languages/cpp/app_templates/kde4app/kapp4view.h b/languages/cpp/app_templates/kde4app/kapp4view.h new file mode 100644 index 00000000..855a2144 --- /dev/null +++ b/languages/cpp/app_templates/kde4app/kapp4view.h @@ -0,0 +1,56 @@ +%{H_TEMPLATE} +#ifndef %{APPNAMELC}VIEW_H +#define %{APPNAMELC}VIEW_H + +#include <TQtGui/TQWidget> + +#include "ui_%{APPNAMELC}view_base.h" + +class TQPainter; +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 %{APPNAME}View : public TQWidget, public Ui::%{APPNAMELC}view_base +{ + Q_OBJECT + +public: + /** + * Default constructor + */ + %{APPNAME}View(TQWidget *parent); + + /** + * Destructor + */ + virtual ~%{APPNAME}View(); + +private: + Ui::%{APPNAMELC}view_base ui_%{APPNAMELC}view_base; + +signals: + /** + * Use this signal to change the content of the statusbar + */ + void signalChangeStatusbar(const TQString& text); + + /** + * Use this signal to change the content of the caption + */ + void signalChangeCaption(const TQString& text); + +private slots: + void switchColors(); + void settingsChanged(); +}; + +#endif // %{APPNAME}VIEW_H diff --git a/languages/cpp/app_templates/kde4app/kapp4view_base.ui b/languages/cpp/app_templates/kde4app/kapp4view_base.ui new file mode 100644 index 00000000..6738a789 --- /dev/null +++ b/languages/cpp/app_templates/kde4app/kapp4view_base.ui @@ -0,0 +1,213 @@ +<ui version="4.0" > +<class>%{APPNAMELC}view_base</class> +<widget class="TQWidget" name="%{APPNAMELC}view_base" > + <property name="geometry" > + <rect> + <x>0</x> + <y>0</y> + <width>315</width> + <height>233</height> + </rect> + </property> + <property name="windowTitle" > + <string>%{APPNAMELC}_base</string> + </property> + <property name="autoFillBackground" > + <bool>true</bool> + </property> + <layout class="TQGridLayout" > + <property name="leftMargin" > + <number>11</number> + </property> + <property name="topMargin" > + <number>11</number> + </property> + <property name="rightMargin" > + <number>11</number> + </property> + <property name="bottomMargin" > + <number>11</number> + </property> + <property name="horizontalSpacing" > + <number>6</number> + </property> + <property name="verticalSpacing" > + <number>6</number> + </property> + <item row="0" column="0" > + <widget class="TQLabel" name="kcfg_sillyLabel" > + <property name="palette" > + <palette> + <active> + <colorrole role="WindowText" > + <brush brushstyle="SolidPattern" > + <color alpha="255" > + <red>255</red> + <green>255</green> + <blue>0</blue> + </color> + </brush> + </colorrole> + <colorrole role="Button" > + <brush brushstyle="SolidPattern" > + <color alpha="255" > + <red>0</red> + <green>0</green> + <blue>0</blue> + </color> + </brush> + </colorrole> + <colorrole role="Base" > + <brush brushstyle="SolidPattern" > + <color alpha="255" > + <red>0</red> + <green>0</green> + <blue>0</blue> + </color> + </brush> + </colorrole> + <colorrole role="Window" > + <brush brushstyle="SolidPattern" > + <color alpha="255" > + <red>0</red> + <green>0</green> + <blue>0</blue> + </color> + </brush> + </colorrole> + <colorrole role="AlternateBase" > + <brush brushstyle="SolidPattern" > + <color alpha="255" > + <red>0</red> + <green>0</green> + <blue>0</blue> + </color> + </brush> + </colorrole> + </active> + <inactive> + <colorrole role="WindowText" > + <brush brushstyle="SolidPattern" > + <color alpha="255" > + <red>255</red> + <green>255</green> + <blue>0</blue> + </color> + </brush> + </colorrole> + <colorrole role="Button" > + <brush brushstyle="SolidPattern" > + <color alpha="255" > + <red>0</red> + <green>0</green> + <blue>0</blue> + </color> + </brush> + </colorrole> + <colorrole role="Base" > + <brush brushstyle="SolidPattern" > + <color alpha="255" > + <red>0</red> + <green>0</green> + <blue>0</blue> + </color> + </brush> + </colorrole> + <colorrole role="Window" > + <brush brushstyle="SolidPattern" > + <color alpha="255" > + <red>0</red> + <green>0</green> + <blue>0</blue> + </color> + </brush> + </colorrole> + <colorrole role="AlternateBase" > + <brush brushstyle="SolidPattern" > + <color alpha="255" > + <red>0</red> + <green>0</green> + <blue>0</blue> + </color> + </brush> + </colorrole> + </inactive> + <disabled> + <colorrole role="WindowText" > + <brush brushstyle="SolidPattern" > + <color alpha="255" > + <red>119</red> + <green>119</green> + <blue>119</blue> + </color> + </brush> + </colorrole> + <colorrole role="Button" > + <brush brushstyle="SolidPattern" > + <color alpha="255" > + <red>0</red> + <green>0</green> + <blue>0</blue> + </color> + </brush> + </colorrole> + <colorrole role="Base" > + <brush brushstyle="SolidPattern" > + <color alpha="255" > + <red>0</red> + <green>0</green> + <blue>0</blue> + </color> + </brush> + </colorrole> + <colorrole role="Window" > + <brush brushstyle="SolidPattern" > + <color alpha="255" > + <red>0</red> + <green>0</green> + <blue>0</blue> + </color> + </brush> + </colorrole> + <colorrole role="AlternateBase" > + <brush brushstyle="SolidPattern" > + <color alpha="255" > + <red>0</red> + <green>0</green> + <blue>0</blue> + </color> + </brush> + </colorrole> + </disabled> + </palette> + </property> + <property name="font" > + <font> + <family>Sans Serif</family> + <pointsize>12</pointsize> + </font> + </property> + <property name="autoFillBackground" > + <bool>true</bool> + </property> + <property name="text" > + <string>hello, world</string> + </property> + <property name="scaledContents" > + <bool>true</bool> + </property> + <property name="alignment" > + <set>Qt::AlignCenter</set> + </property> + <property name="wordWrap" > + <bool>false</bool> + </property> + </widget> + </item> + </layout> + </widget> + <layoutdefault spacing="6" margin="11" /> + <pixmapfunction>qPixmapFromMimeSource</pixmapfunction> + <resources/> + <connections/> +</ui> diff --git a/languages/cpp/app_templates/kde4app/kde4app-CMakeLists.txt b/languages/cpp/app_templates/kde4app/kde4app-CMakeLists.txt new file mode 100644 index 00000000..db1f4bab --- /dev/null +++ b/languages/cpp/app_templates/kde4app/kde4app-CMakeLists.txt @@ -0,0 +1,31 @@ +project(%{APPNAME}) +find_package(KDE4 REQUIRED) +include (KDE4Defaults) +include_directories( ${KDE4_INCLUDES} ${QT_INCLUDES} ) + +set(%{APPNAMELC}_SRCS + %{APPNAMELC}.cpp + main.cpp + %{APPNAMELC}view.cpp + ) + +#kde4_automoc(${%{APPNAMELC}_SRCS}) + +kde4_add_ui_files(%{APPNAMELC}_SRCS %{APPNAMELC}view_base.ui prefs_base.ui) + +kde4_add_kcfg_files(%{APPNAMELC}_SRCS settings.kcfgc ) + +kde4_add_executable(%{APPNAMELC} ${%{APPNAMELC}_SRCS}) + +target_link_libraries(%{APPNAMELC} ${KDE4_TDEUI_LIBS} ) + +install(TARGETS %{APPNAMELC} DESTINATION ${BIN_INSTALL_DIR} ) + + +########### install files ############### + +install( FILES %{APPNAMELC}.desktop DESTINATION ${XDG_APPS_INSTALL_DIR} ) +install( FILES %{APPNAMELC}.kcfg DESTINATION ${KCFG_INSTALL_DIR} ) +install( FILES %{APPNAMELC}ui.rc DESTINATION ${DATA_INSTALL_DIR}/%{APPNAMELC} ) + + diff --git a/languages/cpp/app_templates/kde4app/kde4app.kdevtemplate b/languages/cpp/app_templates/kde4app/kde4app.kdevtemplate new file mode 100644 index 00000000..1516e92e --- /dev/null +++ b/languages/cpp/app_templates/kde4app/kde4app.kdevtemplate @@ -0,0 +1,155 @@ +# KDE Config File +[General] +Name=KDE4 Application framework +Name[ca]=Entorn de treball d'aplicacions pel KDE4 +Name[da]=KDE4 program-framework +Name[de]=KDE 4-Anwendungsgrundgerüst +Name[el]=Πλαίσιο εφαρμογής του KDE4 +Name[es]=Infraestructura de aplicación para KDE4 +Name[et]=KDE4 rakenduse raamistik +Name[hu]=Keretrendszer KDE4-alapú alkalmazáshoz +Name[it]=Infrastruttura per applicazioni KDE4 +Name[nds]=KDE4-Programmrahmenwark +Name[nl]=KDE4-programmaframewerk +Name[pl]=Szablon programu dla KDE4 +Name[pt]=Plataforma de aplicações do KDE4 +Name[pt_BR]=Plataforma de aplicações do KDE4 +Name[ru]=Инструментарий для создания приложений KDE 4 +Name[sk]=KDE4 aplikačný framework +Name[sr]=Радни оквир KDE4 програма +Name[sr@Latn]=Radni okvir KDE4 programa +Name[sv]=KDE 4-programramverk +Name[zh_TW]=KDE4 應用程式框架 +Icon=kde4app.png +Category=C++/KDE4 +Comment=Generates a simple KDE4 application with one toplevel window, menus and toolbars. +Comment[ca]=Genera una aplicació senzilla per al KDE4 amb una finestra principal, menús i barres d'eines. +Comment[da]=Genererer et simpelt KDE4-program med et vindue på topniveau, menuer og værktøjslinjer. +Comment[de]=Erstellt eine einfache KDE 4-Anwendung mit einem Toplevel-Fenster, Menüs und Werkzeugleisten. +Comment[el]=Δημιουργεί μια απλή εφαρμογή του KDE4 με ένα ανώτερο παράθυρο, μενού, και γραμμές εργαλείων. +Comment[es]=Genera una sencilla aplicación para KDE4 con una ventana principal, menús y barras de herramientas. +Comment[et]=Lihtsa KDE4 rakenduse loomine ühe tipptaseme akna, menüüde ja tööriistaribadega. +Comment[hu]=Létrehoz egy egyszerű KDE4-alkalmazást egy főablakkal, menükkel és eszköztárakkal. +Comment[it]=Genera una semplice applicazione KDE4 con una finestra toplevel, menu e barre degli strumenti. +Comment[nds]=Stellt en eenfach KDE4-Programm mit een böverst Finster, Menüs un Warktüüchbalkens op. +Comment[nl]=Genereert een eenvoudig KDE4-programma met een topniveauvenster, menu's en werkbalken. +Comment[pl]=Generuje prosty program dla KDE4 posiadający okno, menu i paski narzędzi. +Comment[pt]=Gera uma aplicação para KDE4 simples, com uma janela de topo, menus e barras de ferramentas. +Comment[pt_BR]=Gera uma aplicação para KDE4 simples, com uma janela de topo, menus e barras de ferramentas. +Comment[ru]=Создание простого приложения KDE 4 с одним окном верхнего уровня, меню и панелями инструментов. +Comment[sk]=Vygeneruje jednoduchú KDE4 aplikáciu s jedným oknom, menu a panelom nástrojov. +Comment[sr]=Прави једноставан KDE4 програм са једним прозором највишег нивоа, менијима и тракама са алатом. +Comment[sr@Latn]=Pravi jednostavan KDE4 program sa jednim prozorom najvišeg nivoa, menijima i trakama sa alatom. +Comment[sv]=Skapar ett enkelt KDE 4-program med ett toppnivåfönster, menyer och verktygsrader. +Comment[zh_TW]=產生一個簡單的 KDE4 應用程式,內含頂層視窗、選單與工具列。 +FileTemplates=h,CStyle,cpp,CStyle +ShowFilesAfterGeneration=%{dest}/README +Archive=kde4app.tar.gz + +[FILE1] +Type=install +Source=%{src}/CMakeLists.txt +Dest=%{dest}/CMakeLists.txt + +[FILE2] +Type=install +Source=%{src}/main.cpp +Dest=%{dest}/main.cpp + +[FILE3] +Type=install +Source=%{src}/kapp4.cpp +Dest=%{dest}/%{APPNAMELC}.cpp + +[FILE4] +Type=install +Source=%{src}/kapp4.h +Dest=%{dest}/%{APPNAMELC}.h + +[FILE5] +Type=install +Source=%{src}/kapp4view.cpp +Dest=%{dest}/%{APPNAMELC}view.cpp + + +[FILE6] +Type=install +Source=%{src}/kapp4view.h +Dest=%{dest}/%{APPNAMELC}view.h + + +[FILE7] +Type=install +Source=%{src}/kde4appui.rc +Dest=%{dest}/%{APPNAMELC}ui.rc + + +[FILE8] +Type=install +Source=%{src}/kapp4view_base.ui +Dest=%{dest}/%{APPNAMELC}view_base.ui + + +[FILE9] +Type=install +Source=%{src}/kapp4.desktop +Dest=%{dest}/%{APPNAMELC}.desktop + +[FILE10] +Type=install +Source=%{src}/kapp4.kcfg +Dest=%{dest}/%{APPNAMELC}.kcfg + + +[FILE11] +Type=install +Source=%{src}/prefs_base.ui +Dest=%{dest}/prefs_base.ui + + +[FILE12] +Type=install +Source=%{src}/settings.kcfgc +Dest=%{dest}/settings.kcfgc + +[FILE13] +Type=install +Source=%{src}/README +Dest=%{dest}/README + +[FILE14] +Type=install +Source=%{src}/kde4app.tdevelop +Dest=%{dest}/%{APPNAMELC}.tdevelop + +[FILE15] +Type=install +Source=%{src}/kde4app.tdevelop.filelist +Dest=%{dest}/%{APPNAMELC}.tdevelop.filelist + +[MKDIR1] +Type=mkdir +Dir=%{dest}/build + +[MSG] +Type=message +Comment=A KDE4 Application was created at %{dest} +Comment[ca]=S'ha creat una aplicació per al KDE4 a %{dest} +Comment[da]=Et KDE4-program blev oprettet i %{dest} +Comment[de]=Eine KDE 4-Anwendung wurde in %{dest} erstellt. +Comment[el]=Μια εφαρμογή KDE4 δημιουργήθηκε στο %{dest} +Comment[es]=Una aplicación para KDE4 ha sido creada en %{dest} +Comment[et]=KDE4 rakendus loodi asukohta %{dest} +Comment[hu]=Létrejött egy KDE4-alapú alkalmazás itt: %{dest} +Comment[it]=È stata creata un'applicazione KDE4 in %{dest} +Comment[nds]=In %{dest} wöör en KDE4-Programm opstellt +Comment[nl]=Een KDE4-toepassing is aangemaakt in %{dest} +Comment[pl]=Program dla KDE4 został utworzony w %{dest} +Comment[pt]=Foi criada uma aplicação do KDE4 em %{dest} +Comment[pt_BR]=Foi criada uma aplicação do KDE4 em %{dest} +Comment[ru]=Приложение KDE 4 создано в %{dest} +Comment[sk]=KDE4 aplikácia bola vytvorená v %{dest} +Comment[sr]=KDE4 програм је направљен у %{dest} +Comment[sr@Latn]=KDE4 program je napravljen u %{dest} +Comment[sv]=Ett KDE 4-program skapades i %{dest} +Comment[zh_TW]=一個 KDE4 應用程式已建立於 %{dest} diff --git a/languages/cpp/app_templates/kde4app/kde4app.png b/languages/cpp/app_templates/kde4app/kde4app.png Binary files differnew file mode 100644 index 00000000..a421a664 --- /dev/null +++ b/languages/cpp/app_templates/kde4app/kde4app.png diff --git a/languages/cpp/app_templates/kde4app/kde4app.tdevelop b/languages/cpp/app_templates/kde4app/kde4app.tdevelop new file mode 100644 index 00000000..d332fa06 --- /dev/null +++ b/languages/cpp/app_templates/kde4app/kde4app.tdevelop @@ -0,0 +1,205 @@ +<?xml version = '1.0'?> +<tdevelop> + <general> + <author>%{AUTHOR}</author> + <email>%{EMAIL}</email> + <version>%{VERSION}</version> + <projectmanagement>KDevCustomProject</projectmanagement> + <primarylanguage>C++</primarylanguage> + <keywords> + <keyword>C++</keyword> + <keyword>Code</keyword> + <keyword>Qt</keyword> + <keyword>KDE</keyword> + </keywords> + <projectname>%{APPNAMELC}</projectname> + <projectdirectory>.</projectdirectory> + <absoluteprojectpath>false</absoluteprojectpath> + <description/> + <ignoreparts/> + </general> + <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> + <kdevcustomproject> + <run> + <mainprogram>%{dest}/build/%{APPNAMELC}</mainprogram> + <programargs/> + <terminal>false</terminal> + <autocompile>false</autocompile> + <envvars> + <envvar value="" name="TDEDIRS" /> + <envvar value="" name="TDEHOME" /> + <envvar value="" name="LD_LIBRARY_PATH" /> + <envvar value="" name="PATH" /> + <envvar value="" name="PKG_CONFIG_PATH" /> + <envvar value="" name="QT_PLUGIN_PATH" /> + </envvars> + <autoinstall>false</autoinstall> + <autotdesu>false</autotdesu> + <globaldebugarguments/> + <useglobalprogram>true</useglobalprogram> + <globalcwd>%{dest}</globalcwd> + <directoryradio>executable</directoryradio> + </run> + <build> + <buildtool>make</buildtool> + <builddir>%{dest}/build</builddir> + </build> + <make> + <abortonerror>false</abortonerror> + <numberofjobs>1</numberofjobs> + <prio>0</prio> + <dontact>false</dontact> + <makebin>make</makebin> + <defaulttarget/> + <makeoptions/> + <selectedenvironment>default</selectedenvironment> + <environments> + <default> + <envvar value="" name="TDEDIRS" /> + <envvar value="" name="TDEHOME" /> + <envvar value="" name="LD_LIBRARY_PATH" /> + <envvar value="" name="PATH" /> + <envvar value="" name="PKG_CONFIG_PATH" /> + <envvar value="" name="QT_PLUGIN_PATH" /> + </default> + </environments> + </make> + <filetypes> + <filetype>*.h</filetype> + <filetype>*.cpp</filetype> + <filetype>CMakeLists.txt</filetype> + <filetype>*.desktop</filetype> + <filetype>*.kcfg*</filetype> + <filetype>*.ui</filetype> + <filetype>Doxyfile</filetype> + <filetype>*.dox</filetype> + <filetype>*.rc</filetype> + <filetype>*.cmake</filetype> + </filetypes> + <other> + <prio>0</prio> + <otherbin/> + <defaulttarget/> + <otheroptions/> + <selectedenvironment>default</selectedenvironment> + <environments> + <default/> + </environments> + </other> + <blacklist> + <path>build</path> + </blacklist> + </kdevcustomproject> + <kdevcppsupport> + <qt> + <used>true</used> + <version>4</version> + <includestyle>4</includestyle> + <designerintegration>ExternalDesigner</designerintegration> + <designer>/usr/bin/designer-qt4</designer> + <root>/usr/lib/qt4</root> + </qt> + </kdevcppsupport> + <kdevclassview> + <folderhierarchy>true</folderhierarchy> + <depthoffolders>2</depthoffolders> + </kdevclassview> + <kdevdocumentation> + <projectdoc> + <docsystem>Doxygen Documentation Collection</docsystem> + <docurl>%{APPNAMELC}.tag</docurl> + </projectdoc> + </kdevdocumentation> +</tdevelop> diff --git a/languages/cpp/app_templates/kde4app/kde4app.tdevelop.filelist b/languages/cpp/app_templates/kde4app/kde4app.tdevelop.filelist new file mode 100644 index 00000000..5235563f --- /dev/null +++ b/languages/cpp/app_templates/kde4app/kde4app.tdevelop.filelist @@ -0,0 +1,13 @@ +# KDevelop Custom Project File List +CMakeLists.txt +main.cpp +prefs_base.ui +settings.kcfgc +%{APPNAMELC}.cpp +%{APPNAMELC}.desktop +%{APPNAMELC}.h +%{APPNAMELC}.kcfg +%{APPNAMELC}ui.rc +%{APPNAMELC}view.cpp +%{APPNAMELC}view.h +%{APPNAMELC}view_base.ui diff --git a/languages/cpp/app_templates/kde4app/kde4appui.rc b/languages/cpp/app_templates/kde4app/kde4appui.rc new file mode 100644 index 00000000..406bccc6 --- /dev/null +++ b/languages/cpp/app_templates/kde4app/kde4appui.rc @@ -0,0 +1,8 @@ +<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd"> +<kpartgui name="KApp4" version="1"> +<MenuBar> + <Menu name="move"><text>&Move</text> + <Action name="switch_action" /> + </Menu> +</MenuBar> +</kpartgui> diff --git a/languages/cpp/app_templates/kde4app/main.cpp b/languages/cpp/app_templates/kde4app/main.cpp new file mode 100644 index 00000000..5c83921b --- /dev/null +++ b/languages/cpp/app_templates/kde4app/main.cpp @@ -0,0 +1,55 @@ +%{CPP_TEMPLATE} + +#include "%{APPNAMELC}.h" +#include <tdeapplication.h> +#include <tdeaboutdata.h> +#include <tdecmdlineargs.h> +#include <KDE/TDELocale> + +static const char description[] = + I18N_NOOP("A KDE 4 Application"); + +static const char version[] = "%{VERSION}"; + +int main(int argc, char **argv) +{ + TDEAboutData about("%{APPNAMELC}", 0, ki18n("%{APPNAME}"), version, ki18n(description), + TDEAboutData::License_%{LICENSE}, ki18n("(C) %{YEAR} %{AUTHOR}"), KLocalizedString(), 0, "%{EMAIL}"); + about.addAuthor( ki18n("%{AUTHOR}"), KLocalizedString(), "%{EMAIL}" ); + TDECmdLineArgs::init(argc, argv, &about); + + TDECmdLineOptions options; + options.add("+[URL]", ki18n( "Document to open" )); + TDECmdLineArgs::addCmdLineOptions(options); + TDEApplication app; + + %{APPNAME} *widget = new %{APPNAME}; + + // see if we are starting with session management + if (app.isSessionRestored()) + { + RESTORE(%{APPNAME}); + } + else + { + // no session.. just start up normally + TDECmdLineArgs *args = TDECmdLineArgs::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/kde4app/prefs_base.ui b/languages/cpp/app_templates/kde4app/prefs_base.ui new file mode 100644 index 00000000..87a191f1 --- /dev/null +++ b/languages/cpp/app_templates/kde4app/prefs_base.ui @@ -0,0 +1,155 @@ +<ui version="4.0" > + <class>prefs_base</class> + <widget class="TQWidget" name="prefs_base" > + <property name="geometry" > + <rect> + <x>0</x> + <y>0</y> + <width>282</width> + <height>156</height> + </rect> + </property> + <layout class="TQGridLayout" > + <item row="0" column="0" > + <widget class="TQLabel" name="textLabel2_2" > + <property name="text" > + <string>Background color:</string> + </property> + <property name="wordWrap" > + <bool>false</bool> + </property> + </widget> + </item> + <item row="0" column="1" > + <widget class="KColorButton" name="kcfg_col_background" > + <property name="toolTip" > + <string>Choose a new background color</string> + </property> + <property name="whatsThis" > + <string><html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'DejaVu Serif'; font-size:9pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Change the <span style=" font-weight:600;">background</span> color by clicking here and choose the new <span style=" color:#ff0000;">color</span> in the <span style=" font-style:italic;">color dialog</span>.</p></body></html></string> + </property> + <property name="text" > + <string/> + </property> + </widget> + </item> + <item row="2" column="0" > + <widget class="TQLabel" name="textLabel1" > + <property name="text" > + <string>Project age:</string> + </property> + <property name="wordWrap" > + <bool>false</bool> + </property> + </widget> + </item> + <item row="1" column="0" > + <widget class="TQLabel" name="textLabel2" > + <property name="text" > + <string>Foreground color:</string> + </property> + <property name="wordWrap" > + <bool>false</bool> + </property> + </widget> + </item> + <item row="1" column="1" > + <widget class="KColorButton" name="kcfg_col_foreground" > + <property name="toolTip" > + <string>Choose a new foreground color</string> + </property> + <property name="whatsThis" > + <string><html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'DejaVu Serif'; font-size:9pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Change the <span style=" font-weight:600;">foreground</span> color by clicking here and choose the new <span style=" color:#ff0000;">color</span> in the <span style=" font-style:italic;">color dialog</span>.</p></body></html></string> + </property> + <property name="text" > + <string/> + </property> + </widget> + </item> + <item row="0" column="2" > + <spacer> + <property name="orientation" > + <enum>Qt::Vertical</enum> + </property> + <property name="sizeType" > + <enum>QSizePolicy::Expanding</enum> + </property> + <property name="sizeHint" > + <size> + <width>41</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item row="1" column="2" > + <spacer> + <property name="orientation" > + <enum>Qt::Vertical</enum> + </property> + <property name="sizeType" > + <enum>QSizePolicy::Expanding</enum> + </property> + <property name="sizeHint" > + <size> + <width>41</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item row="2" column="1" > + <widget class="TQSpinBox" name="kcfg_val_time" > + <property name="toolTip" > + <string>Set the project age (in days)</string> + </property> + <property name="whatsThis" > + <string>Change the project age (in days) by choosing a new number of days.</string> + </property> + <property name="minimum" > + <number>1</number> + </property> + <property name="value" > + <number>2</number> + </property> + </widget> + </item> + <item row="2" column="2" > + <spacer> + <property name="orientation" > + <enum>Qt::Vertical</enum> + </property> + <property name="sizeType" > + <enum>QSizePolicy::Expanding</enum> + </property> + <property name="sizeHint" > + <size> + <width>41</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + </layout> + </widget> + <layoutdefault spacing="6" margin="11" /> + <pixmapfunction>qPixmapFromMimeSource</pixmapfunction> + <customwidgets> + <customwidget> + <class>KColorButton</class> + <extends>QPushButton</extends> + <header>kcolorbutton.h</header> + </customwidget> + </customwidgets> + <includes> + <include location="local" >kcolorbutton.h</include> + </includes> + <resources/> + <connections/> +</ui> diff --git a/languages/cpp/app_templates/kde4app/settings.kcfgc b/languages/cpp/app_templates/kde4app/settings.kcfgc new file mode 100644 index 00000000..402fad09 --- /dev/null +++ b/languages/cpp/app_templates/kde4app/settings.kcfgc @@ -0,0 +1,6 @@ +# Code generation options for tdeconfig_compiler +File=%{APPNAMELC}.kcfg +ClassName=Settings +Singleton=true +Mutators=col_background,col_foreground +# will create the necessary code for setting those variables |