diff --git a/templates/C++/kde-frameworks5-simple/src/%{APPNAMELC}.ui b/templates/C++/kde-frameworks5-simple/src/%{APPNAMELC}.ui new file mode 100644 index 0000000..adf8109 --- /dev/null +++ b/templates/C++/kde-frameworks5-simple/src/%{APPNAMELC}.ui @@ -0,0 +1,28 @@ + + + mainWidget + + + + 0 + 0 + 400 + 300 + + + + Form + + + + + + Hello KDE! + + + + + + + + diff --git a/templates/C++/kde-frameworks5-simple/src/CMakeLists.txt b/templates/C++/kde-frameworks5-simple/src/CMakeLists.txt new file mode 100644 index 0000000..0b62376 --- /dev/null +++ b/templates/C++/kde-frameworks5-simple/src/CMakeLists.txt @@ -0,0 +1,17 @@ +set( %{APPNAMELC}_SRCS + main.cpp + %{APPNAMELC}.cpp +) + +ki18n_wrap_ui(%{APPNAMELC}_SRCS %{APPNAMELC}.ui) + +add_executable( %{APPNAMELC} ${%{APPNAMELC}_SRCS} ) + +target_link_libraries( %{APPNAMELC} + Qt5::Widgets + KF5::CoreAddons + KF5::I18n +) + +install( TARGETS %{APPNAMELC} ${INSTALL_TARGETS_DEFAULT_ARGS} ) +install( PROGRAMS %{APPNAMELC}.desktop DESTINATION ${XDG_APPS_INSTALL_DIR} ) diff --git a/templates/C++/kde-frameworks5-simple/src/main.cpp b/templates/C++/kde-frameworks5-simple/src/main.cpp new file mode 100644 index 0000000..305ee34 --- /dev/null +++ b/templates/C++/kde-frameworks5-simple/src/main.cpp @@ -0,0 +1,52 @@ +/*************************************************************************** + * Copyright (C) %{CURRENT_YEAR} by %{AUTHOR} <%{EMAIL}> * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * + ***************************************************************************/ + +// application header +#include "%{APPNAMELC}.h" +// KDE headers +#include +#include +#include +#include + +int main(int argc, char **argv) +{ + QApplication application(argc, argv); + + KLocalizedString::setApplicationDomain("%{APPNAMELC}"); + KAboutData aboutData( QStringLiteral("%{APPNAMELC}"), + i18n("Simple App"), + QStringLiteral("0.1"), + i18n("A Simple Application written with KDE Frameworks"), + KAboutLicense::GPL, + i18n("(c) 20013-2014, %{AUTHOR} <%{EMAIL}>")); + + aboutData.addAuthor(i18n("%{AUTHOR}"),i18n("Author"), QStringLiteral("%{EMAIL}")); + aboutData.setProgramIconName("%{APPNAMELC}"); + QCommandLineParser parser; + parser.addHelpOption(); + parser.addVersionOption(); + aboutData.setupCommandLine(&parser); + parser.process(application); + aboutData.processCommandLine(&parser); + + %{APPNAME} *appwindow = new %{APPNAME}; + appwindow->show(); + return application.exec(); +} diff --git a/templates/C++/kde-frameworks5-simple/kde-frameworks5-simple.kdevtemplate b/templates/C++/kde-frameworks5-simple/kde-frameworks5-simple.kdevtemplate new file mode 100644 index 0000000..17042c0 --- /dev/null +++ b/templates/C++/kde-frameworks5-simple/kde-frameworks5-simple.kdevtemplate @@ -0,0 +1,7 @@ +# KDE Config File +[General] +Name=Minimal C++ KDE Frameworks +Comment=A very basic KDE Frameworks 5 GUI Application in C++ +Category=KDE/Graphical +Icon=kde-frameworks5-simple.png +ShowFilesAfterGeneration=%{dest}/src/%{APPNAMELC}.cpp diff --git a/templates/C++/kde-frameworks5-simple/kde-frameworks5-simple.png b/templates/C++/kde-frameworks5-simple/kde-frameworks5-simple.png new file mode 100644 index 0000000..0786edd Binary files /dev/null and b/templates/C++/kde-frameworks5-simple/kde-frameworks5-simple.png differ diff --git a/templates/C++/kde-frameworks5-simple/src/%{APPNAMELC}.cpp b/templates/C++/kde-frameworks5-simple/src/%{APPNAMELC}.cpp new file mode 100644 index 0000000..c99989a --- /dev/null +++ b/templates/C++/kde-frameworks5-simple/src/%{APPNAMELC}.cpp @@ -0,0 +1,35 @@ +/* + Copyright (C) %{CURRENT_YEAR} by %{AUTHOR} <%{EMAIL}> + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License or (at your option) version 3 or any later version + accepted by the membership of KDE e.V. (or its successor approved + by the membership of KDE e.V.), which shall act as a proxy + defined in Section 14 of version 3 of the license. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#include "%{APPNAMELC}.h" + +%{APPNAME}::%{APPNAME}() + : QMainWindow() +{ + QWidget *widget = new QWidget(this); + setCentralWidget(widget); + m_ui.setupUi(widget); +} + +%{APPNAME}::~%{APPNAME}() +{ +} + +#include "%{APPNAMELC}.moc" diff --git a/templates/C++/kde-frameworks5-simple/src/%{APPNAMELC}.desktop b/templates/C++/kde-frameworks5-simple/src/%{APPNAMELC}.desktop new file mode 100644 index 0000000..8ab9411 --- /dev/null +++ b/templates/C++/kde-frameworks5-simple/src/%{APPNAMELC}.desktop @@ -0,0 +1,7 @@ +[Desktop Entry] +Name=%{APPNAME} +Exec=%{APPNAMELC} +Icon=%{APPNAMELC} +Type=Application +X-DocPath=%{APPNAMELC}/index.html +GenericName=A Simple KDE Application diff --git a/templates/C++/kde-frameworks5-simple/src/%{APPNAMELC}.h b/templates/C++/kde-frameworks5-simple/src/%{APPNAMELC}.h new file mode 100644 index 0000000..73d0b2b --- /dev/null +++ b/templates/C++/kde-frameworks5-simple/src/%{APPNAMELC}.h @@ -0,0 +1,58 @@ +/* + Copyright (C) %{CURRENT_YEAR} by %{AUTHOR} <%{EMAIL}> + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License or (at your option) version 3 or any later version + accepted by the membership of KDE e.V. (or its successor approved + by the membership of KDE e.V.), which shall act as a proxy + defined in Section 14 of version 3 of the license. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#ifndef %{APPNAMEUC}_H +#define %{APPNAMEUC}_H + + +#include + +#include "ui_%{APPNAMELC}.h" + + +/** + * This class serves as the main window for %{APPNAME}. It handles the + * menus, toolbars and status bars. + * + * @short Main window class + * @author Your Name + * @version 0.1 + */ +class %{APPNAME} : public QMainWindow +{ + Q_OBJECT +public: + /** + * Default Constructor + */ + %{APPNAME}(); + + /** + * Default Destructor + */ + virtual ~%{APPNAME}(); + +private: + // this is the name of the root widget inside our Ui file + // you can rename it in designer and then change it here + Ui::mainWidget m_ui; +}; + +#endif // _%{APPNAMEUC}_H_ diff --git a/templates/C++/kde-frameworks5-simple/CMakeLists.txt b/templates/C++/kde-frameworks5-simple/CMakeLists.txt new file mode 100644 index 0000000..0da779c --- /dev/null +++ b/templates/C++/kde-frameworks5-simple/CMakeLists.txt @@ -0,0 +1,25 @@ +project(%{APPNAMELC}) + +cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR) +set(QT_MIN_VERSION "5.3.0") + +find_package(ECM 1.0.0 REQUIRED NO_MODULE) +set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/cmake) + +include(ECMInstallIcons) +include(KDEInstallDirs) +include(KDECMakeSettings) +include(KDECompilerSettings) +include(FeatureSummary) + +find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS Core Gui Widgets) + +find_package(KF5 REQUIRED COMPONENTS + CoreAddons + I18n +) + +feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES) + +add_subdirectory(src) +add_subdirectory(icons) diff --git a/templates/C++/kde-frameworks5-simple/Messages.sh b/templates/C++/kde-frameworks5-simple/Messages.sh new file mode 100644 index 0000000..75a840b --- /dev/null +++ b/templates/C++/kde-frameworks5-simple/Messages.sh @@ -0,0 +1,4 @@ +#! /usr/bin/env bash +$EXTRACTRC `find . -name \*.ui -o -name \*.rc -o -name \*.kcfg` >> rc.cpp +$XGETTEXT `find . -name \*.cpp` -o $podir/%{APPNAMELC}.pot +rm -f rc.cpp diff --git a/templates/C++/kde-frameworks5-simple/README b/templates/C++/kde-frameworks5-simple/README new file mode 100644 index 0000000..21a8f91 --- /dev/null +++ b/templates/C++/kde-frameworks5-simple/README @@ -0,0 +1,17 @@ +How To Build This Template +-=-=-=-=-=-=-=-=-=-=-=-=-= + +--- On Unix: + +cd +mkdir build +cd build +cmake -DCMAKE_INSTALL_PREFIX=$KDEDIRS -DCMAKE_BUILD_TYPE=Debug .. +make +make install or su -c 'make install' or sudo make install + +where $KDEDIRS points to your KDE installation prefix. + +Note: you can use another build path. Then cd in your build dir and: +export KDE_SRC=path_to_your_src +cmake $KDE_SRC -DCMAKE_INSTALL_PREFIX=$KDEDIRS -DCMAKE_BUILD_TYPE=Debug diff --git a/templates/C++/kde-frameworks5-simple/icons/CMakeLists.txt b/templates/C++/kde-frameworks5-simple/icons/CMakeLists.txt new file mode 100644 index 0000000..832a8e5 --- /dev/null +++ b/templates/C++/kde-frameworks5-simple/icons/CMakeLists.txt @@ -0,0 +1 @@ +ecm_install_icons( ${ICON_INSTALL_DIR} ) diff --git a/templates/C++/kde-frameworks5-simple/icons/hi16-apps-%{APPNAMELC}.png b/templates/C++/kde-frameworks5-simple/icons/hi16-apps-%{APPNAMELC}.png new file mode 100644 index 0000000..3d812df Binary files /dev/null and b/templates/C++/kde-frameworks5-simple/icons/hi16-apps-%{APPNAMELC}.png differ diff --git a/templates/C++/kde-frameworks5-simple/icons/hi32-apps-%{APPNAMELC}.png b/templates/C++/kde-frameworks5-simple/icons/hi32-apps-%{APPNAMELC}.png new file mode 100644 index 0000000..3f6bb9e Binary files /dev/null and b/templates/C++/kde-frameworks5-simple/icons/hi32-apps-%{APPNAMELC}.png differ diff --git a/templates/C++/kde-frameworks5-simple/icons/hi48-apps-%{APPNAMELC}.png b/templates/C++/kde-frameworks5-simple/icons/hi48-apps-%{APPNAMELC}.png new file mode 100644 index 0000000..4bd7f0c Binary files /dev/null and b/templates/C++/kde-frameworks5-simple/icons/hi48-apps-%{APPNAMELC}.png differ diff --git a/templates/C++/CMakeLists.txt b/templates/C++/CMakeLists.txt index 668af48..6f31aa3 100644 --- a/templates/C++/CMakeLists.txt +++ b/templates/C++/CMakeLists.txt @@ -2,6 +2,7 @@ set(apptemplate_DIRS kapp4 kapp4-qml kde-simple + kde-frameworks5-simple plasmoid runner flake diff --git a/CMakeLists.txt b/CMakeLists.txt index 726f8ad..0c162c4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -49,6 +49,7 @@ install( FILES kapptemplate.kcfg DESTINATION ${KCFG_INSTALL_DIR} ) install(FILES default.png DESTINATION ${DATA_INSTALL_DIR}/kdevappwizard/template_previews) install(FILES templates/C++/kapp4/kapp4.png DESTINATION ${DATA_INSTALL_DIR}/kdevappwizard/template_previews) install(FILES templates/C++/kde-simple/kde-simple.png DESTINATION ${DATA_INSTALL_DIR}/kdevappwizard/template_previews) +install(FILES templates/C++/kde-frameworks5-simple/kde-frameworks5-simple.png DESTINATION ${DATA_INSTALL_DIR}/kdevappwizard/template_previews) install(FILES templates/C++/plasmoid/plasma-applet.png DESTINATION ${DATA_INSTALL_DIR}/kdevappwizard/template_previews) install(FILES templates/ruby/kderubyapp/kderubyapp.png DESTINATION ${DATA_INSTALL_DIR}/kdevappwizard/template_previews) install(FILES templates/Python/pyqt4app/pyqt4app.png DESTINATION ${DATA_INSTALL_DIR}/kdevappwizard/template_previews)