From 114a878c64ce6f8223cfd22d76a20eb16d177e5e Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: 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 --- languages/cpp/app_templates/kde4app/CMakeLists.txt | 31 +++ languages/cpp/app_templates/kde4app/Makefile.am | 19 ++ languages/cpp/app_templates/kde4app/README | 15 ++ languages/cpp/app_templates/kde4app/kapp4.cpp | 90 +++++++++ languages/cpp/app_templates/kde4app/kapp4.desktop | 30 +++ languages/cpp/app_templates/kde4app/kapp4.h | 53 +++++ languages/cpp/app_templates/kde4app/kapp4.kcfg | 21 ++ languages/cpp/app_templates/kde4app/kapp4view.cpp | 42 ++++ languages/cpp/app_templates/kde4app/kapp4view.h | 55 ++++++ .../cpp/app_templates/kde4app/kapp4view_base.ui | 213 +++++++++++++++++++++ .../cpp/app_templates/kde4app/kde4app.kdevelop | 205 ++++++++++++++++++++ .../kde4app/kde4app.kdevelop.filelist | 13 ++ .../cpp/app_templates/kde4app/kde4app.kdevtemplate | 155 +++++++++++++++ languages/cpp/app_templates/kde4app/kde4app.png | Bin 0 -> 6320 bytes languages/cpp/app_templates/kde4app/kde4appui.rc | 8 + languages/cpp/app_templates/kde4app/main.cpp | 55 ++++++ languages/cpp/app_templates/kde4app/prefs_base.ui | 155 +++++++++++++++ languages/cpp/app_templates/kde4app/settings.kcfgc | 6 + 18 files changed, 1166 insertions(+) create mode 100644 languages/cpp/app_templates/kde4app/CMakeLists.txt create mode 100644 languages/cpp/app_templates/kde4app/Makefile.am create mode 100644 languages/cpp/app_templates/kde4app/README create mode 100644 languages/cpp/app_templates/kde4app/kapp4.cpp create mode 100644 languages/cpp/app_templates/kde4app/kapp4.desktop create mode 100644 languages/cpp/app_templates/kde4app/kapp4.h create mode 100644 languages/cpp/app_templates/kde4app/kapp4.kcfg create mode 100644 languages/cpp/app_templates/kde4app/kapp4view.cpp create mode 100644 languages/cpp/app_templates/kde4app/kapp4view.h create mode 100644 languages/cpp/app_templates/kde4app/kapp4view_base.ui create mode 100644 languages/cpp/app_templates/kde4app/kde4app.kdevelop create mode 100644 languages/cpp/app_templates/kde4app/kde4app.kdevelop.filelist create mode 100644 languages/cpp/app_templates/kde4app/kde4app.kdevtemplate create mode 100644 languages/cpp/app_templates/kde4app/kde4app.png create mode 100644 languages/cpp/app_templates/kde4app/kde4appui.rc create mode 100644 languages/cpp/app_templates/kde4app/main.cpp create mode 100644 languages/cpp/app_templates/kde4app/prefs_base.ui create mode 100644 languages/cpp/app_templates/kde4app/settings.kcfgc (limited to 'languages/cpp/app_templates/kde4app') diff --git a/languages/cpp/app_templates/kde4app/CMakeLists.txt b/languages/cpp/app_templates/kde4app/CMakeLists.txt new file mode 100644 index 00000000..2544a271 --- /dev/null +++ b/languages/cpp/app_templates/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_KDEUI_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/Makefile.am b/languages/cpp/app_templates/kde4app/Makefile.am new file mode 100644 index 00000000..2b39fcb4 --- /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.kdevelop kde4app.kdevelop.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..a5f3a307 --- /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 kdevelop 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..c11a58d1 --- /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 +#include + +#include +#include + +#include +#include +#include + +#include + +%{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() +{ + KStandardAction::openNew(this, SLOT(fileNew()), actionCollection()); + KStandardAction::quit(qApp, SLOT(quit()), actionCollection()); + + KStandardAction::preferences(this, SLOT(optionsPreferences()), actionCollection()); + + // custom menu and menu item - the slot is in the class %{APPNAME}View + KAction *custom = new KAction(KIcon("colorize"), i18n("Swi&tch Colors"), this); + actionCollection()->addAction( QLatin1String("switch_action"), custom ); + connect(custom, SIGNAL(triggered(bool)), m_view, 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 ( KConfigDialog::showDialog( "settings" ) ) { + return; + } + KConfigDialog *dialog = new KConfigDialog(this, "settings", Settings::self()); + QWidget *generalSettingsDlg = new QWidget; + ui_prefs_base.setupUi(generalSettingsDlg); + dialog->addPage(generalSettingsDlg, i18n("General"), "package_setting"); + connect(dialog, SIGNAL(settingsChanged(QString)), m_view, SLOT(settingsChanged())); + dialog->setAttribute( Qt::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..008fad44 --- /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 +X-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..fb059fde --- /dev/null +++ b/languages/cpp/app_templates/kde4app/kapp4.h @@ -0,0 +1,53 @@ +%{H_TEMPLATE} +#ifndef %{APPNAMEUC}_H +#define %{APPNAMEUC}_H + + +#include + +#include "ui_prefs_base.h" + +class %{APPNAME}View; +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 Andreas Pakulat + * @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; + KToggleAction *m_toolbarAction; + KToggleAction *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 @@ + + + + + + + black + + + + yellow + + + + 2 + + + diff --git a/languages/cpp/app_templates/kde4app/kapp4view.cpp b/languages/cpp/app_templates/kde4app/kapp4view.cpp new file mode 100644 index 00000000..256f6bcb --- /dev/null +++ b/languages/cpp/app_templates/kde4app/kapp4view.cpp @@ -0,0 +1,42 @@ +%{CPP_TEMPLATE} +#include "%{APPNAMELC}view.h" +#include "settings.h" + +#include +#include + +%{APPNAME}View::%{APPNAME}View(QWidget *) +{ + 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 + QColor color = Settings::col_background(); + Settings::setCol_background( Settings::col_foreground() ); + Settings::setCol_foreground( color ); + + settingsChanged(); +} + +void %{APPNAME}View::settingsChanged() +{ + QPalette pal; + pal.setColor( QPalette::Window, Settings::col_background()); + pal.setColor( QPalette::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..ab08445f --- /dev/null +++ b/languages/cpp/app_templates/kde4app/kapp4view.h @@ -0,0 +1,55 @@ +%{H_TEMPLATE} +#ifndef %{APPNAMELC}VIEW_H +#define %{APPNAMELC}VIEW_H + +#include + +#include "ui_%{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 %{APPNAME}View : public QWidget, public Ui::%{APPNAMELC}view_base +{ + Q_OBJECT +public: + /** + * Default constructor + */ + %{APPNAME}View(QWidget *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 QString& text); + + /** + * Use this signal to change the content of the caption + */ + void signalChangeCaption(const QString& 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..eb6a254a --- /dev/null +++ b/languages/cpp/app_templates/kde4app/kapp4view_base.ui @@ -0,0 +1,213 @@ + +%{APPNAMELC}view_base + + + + 0 + 0 + 315 + 233 + + + + %{APPNAMELC}_base + + + true + + + + 11 + + + 11 + + + 11 + + + 11 + + + 6 + + + 6 + + + + + + + + + + 255 + 255 + 0 + + + + + + + 0 + 0 + 0 + + + + + + + 0 + 0 + 0 + + + + + + + 0 + 0 + 0 + + + + + + + 0 + 0 + 0 + + + + + + + + + 255 + 255 + 0 + + + + + + + 0 + 0 + 0 + + + + + + + 0 + 0 + 0 + + + + + + + 0 + 0 + 0 + + + + + + + 0 + 0 + 0 + + + + + + + + + 119 + 119 + 119 + + + + + + + 0 + 0 + 0 + + + + + + + 0 + 0 + 0 + + + + + + + 0 + 0 + 0 + + + + + + + 0 + 0 + 0 + + + + + + + + + Sans Serif + 12 + + + + true + + + hello, world + + + true + + + Qt::AlignCenter + + + false + + + + + + + qPixmapFromMimeSource + + + diff --git a/languages/cpp/app_templates/kde4app/kde4app.kdevelop b/languages/cpp/app_templates/kde4app/kde4app.kdevelop new file mode 100644 index 00000000..d36a9536 --- /dev/null +++ b/languages/cpp/app_templates/kde4app/kde4app.kdevelop @@ -0,0 +1,205 @@ + + + + %{AUTHOR} + %{EMAIL} + %{VERSION} + KDevCustomProject + C++ + + C++ + Code + Qt + KDE + + %{APPNAMELC} + . + false + + + + + + + + + + + + + false + *.o,*.lo,CVS + + + + + ada + ada_bugs_gcc + bash + bash_bugs + clanlib + w3c-dom-level2-html + fortran_bugs_gcc + gnome1 + gnustep + gtk + gtk_bugs + haskell + haskell_bugs_ghc + java_bugs_gcc + java_bugs_sun + pascal_bugs_fp + php + php_bugs + perl + perl_bugs + python + python_bugs + ruby + ruby_bugs + sdl + w3c-svg + sw + w3c-uaag10 + wxwidgets_bugs + + + qmake User Guide + + + + + libtool + + + true + false + false + true + + + false + true + + + + + + + + + + + + -f + + -dP + + -f + -u3 -p + + + + + + + false + + + .h + .cpp + true + + + + + %{dest}/build/%{APPNAMELC} + + false + false + + + + + + + + + false + false + + true + %{dest} + executable + + + make + %{dest}/build + + + false + 1 + 0 + false + make + + + default + + + + + + + + + + + + + *.h + *.cpp + CMakeLists.txt + *.desktop + *.kcfg* + *.ui + Doxyfile + *.dox + *.rc + *.cmake + + + 0 + + + + default + + + + + + build + + + + + true + 4 + 4 + ExternalDesigner + /usr/bin/designer-qt4 + /usr/lib/qt4 + + + + true + 2 + + + + Doxygen Documentation Collection + %{APPNAMELC}.tag + + + diff --git a/languages/cpp/app_templates/kde4app/kde4app.kdevelop.filelist b/languages/cpp/app_templates/kde4app/kde4app.kdevelop.filelist new file mode 100644 index 00000000..5235563f --- /dev/null +++ b/languages/cpp/app_templates/kde4app/kde4app.kdevelop.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/kde4app.kdevtemplate b/languages/cpp/app_templates/kde4app/kde4app.kdevtemplate new file mode 100644 index 00000000..2a7269fd --- /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.kdevelop +Dest=%{dest}/%{APPNAMELC}.kdevelop + +[FILE15] +Type=install +Source=%{src}/kde4app.kdevelop.filelist +Dest=%{dest}/%{APPNAMELC}.kdevelop.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 new file mode 100644 index 00000000..a421a664 Binary files /dev/null and b/languages/cpp/app_templates/kde4app/kde4app.png differ 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 @@ + + + + &Move + + + + diff --git a/languages/cpp/app_templates/kde4app/main.cpp b/languages/cpp/app_templates/kde4app/main.cpp new file mode 100644 index 00000000..2bb5b6bf --- /dev/null +++ b/languages/cpp/app_templates/kde4app/main.cpp @@ -0,0 +1,55 @@ +%{CPP_TEMPLATE} + +#include "%{APPNAMELC}.h" +#include +#include +#include +#include + +static const char description[] = + I18N_NOOP("A KDE 4 Application"); + +static const char version[] = "%{VERSION}"; + +int main(int argc, char **argv) +{ + KAboutData about("%{APPNAMELC}", 0, ki18n("%{APPNAME}"), version, ki18n(description), + KAboutData::License_%{LICENSE}, ki18n("(C) %{YEAR} %{AUTHOR}"), KLocalizedString(), 0, "%{EMAIL}"); + about.addAuthor( ki18n("%{AUTHOR}"), KLocalizedString(), "%{EMAIL}" ); + KCmdLineArgs::init(argc, argv, &about); + + KCmdLineOptions options; + options.add("+[URL]", ki18n( "Document to open" )); + KCmdLineArgs::addCmdLineOptions(options); + KApplication 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 + 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/kde4app/prefs_base.ui b/languages/cpp/app_templates/kde4app/prefs_base.ui new file mode 100644 index 00000000..ea400f02 --- /dev/null +++ b/languages/cpp/app_templates/kde4app/prefs_base.ui @@ -0,0 +1,155 @@ + + prefs_base + + + + 0 + 0 + 282 + 156 + + + + + + + Background color: + + + false + + + + + + + Choose a new background color + + + <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> + + + + + + + + + + Project age: + + + false + + + + + + + Foreground color: + + + false + + + + + + + Choose a new foreground color + + + <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> + + + + + + + + + + Qt::Vertical + + + QSizePolicy::Expanding + + + + 41 + 20 + + + + + + + + Qt::Vertical + + + QSizePolicy::Expanding + + + + 41 + 20 + + + + + + + + Set the project age (in days) + + + Change the project age (in days) by choosing a new number of days. + + + 1 + + + 2 + + + + + + + Qt::Vertical + + + QSizePolicy::Expanding + + + + 41 + 20 + + + + + + + + qPixmapFromMimeSource + + + KColorButton + QPushButton +
kcolorbutton.h
+
+
+ + kcolorbutton.h + + + +
diff --git a/languages/cpp/app_templates/kde4app/settings.kcfgc b/languages/cpp/app_templates/kde4app/settings.kcfgc new file mode 100644 index 00000000..384510cd --- /dev/null +++ b/languages/cpp/app_templates/kde4app/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 -- cgit v1.2.1