Initial import
This commit is contained in:
30
CMakeLists.txt
Normal file
30
CMakeLists.txt
Normal file
@@ -0,0 +1,30 @@
|
||||
cmake_minimum_required(VERSION 3.0)
|
||||
|
||||
project(simplecastengine)
|
||||
|
||||
set(QT_MIN_VERSION "5.9.0")
|
||||
set(KF_MIN_VERSION "5.35.0")
|
||||
|
||||
find_package(ECM ${KF_MIN_VERSION} REQUIRED NO_MODULE)
|
||||
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
|
||||
|
||||
include(KDEInstallDirs)
|
||||
include(KDECMakeSettings)
|
||||
include(KDECompilerSettings NO_POLICY_SCOPE)
|
||||
include(ECMInstallIcons)
|
||||
include(FeatureSummary)
|
||||
|
||||
find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS Core Gui Widgets)
|
||||
|
||||
find_package(KF5 ${KF_MIN_VERSION} REQUIRED COMPONENTS
|
||||
CoreAddons
|
||||
I18n
|
||||
)
|
||||
|
||||
add_subdirectory(src)
|
||||
add_subdirectory(icons)
|
||||
|
||||
# Make it possible to use the po files fetched by the fetch-translations step
|
||||
ki18n_install(po)
|
||||
|
||||
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)
|
||||
4
Messages.sh
Normal file
4
Messages.sh
Normal file
@@ -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/simplecastengine.pot
|
||||
rm -f rc.cpp
|
||||
17
README
Normal file
17
README
Normal file
@@ -0,0 +1,17 @@
|
||||
How To Build This Template
|
||||
-=-=-=-=-=-=-=-=-=-=-=-=-=
|
||||
|
||||
--- On Unix:
|
||||
|
||||
cd <project_name_path>
|
||||
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
|
||||
BIN
icons/16-apps-simplecastengine.png
Normal file
BIN
icons/16-apps-simplecastengine.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 625 B |
BIN
icons/22-apps-simplecastengine.png
Normal file
BIN
icons/22-apps-simplecastengine.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 802 B |
BIN
icons/32-apps-simplecastengine.png
Normal file
BIN
icons/32-apps-simplecastengine.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.2 KiB |
BIN
icons/48-apps-simplecastengine.png
Normal file
BIN
icons/48-apps-simplecastengine.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.8 KiB |
8
icons/CMakeLists.txt
Normal file
8
icons/CMakeLists.txt
Normal file
@@ -0,0 +1,8 @@
|
||||
set(simplecastengine_ICONS
|
||||
16-apps-simplecastengine.png
|
||||
22-apps-simplecastengine.png
|
||||
32-apps-simplecastengine.png
|
||||
48-apps-simplecastengine.png
|
||||
)
|
||||
|
||||
ecm_install_icons(ICONS ${simplecastengine_ICONS} DESTINATION ${KDE_INSTALL_ICONDIR} THEME hicolor)
|
||||
18
src/CMakeLists.txt
Normal file
18
src/CMakeLists.txt
Normal file
@@ -0,0 +1,18 @@
|
||||
set( simplecastengine_SRCS
|
||||
main.cpp
|
||||
simplecastenginewindow.cpp
|
||||
)
|
||||
|
||||
ki18n_wrap_ui(simplecastengine_SRCS simplecastengine.ui)
|
||||
|
||||
add_executable( simplecastengine ${simplecastengine_SRCS} )
|
||||
|
||||
target_link_libraries( simplecastengine
|
||||
KF5::CoreAddons
|
||||
KF5::I18n
|
||||
Qt5::Widgets
|
||||
)
|
||||
|
||||
install( TARGETS simplecastengine ${KDE_INSTALL_TARGETS_DEFAULT_ARGS} )
|
||||
install( PROGRAMS org.example.simplecastengine.desktop DESTINATION ${KDE_INSTALL_APPDIR} )
|
||||
install( FILES org.example.simplecastengine.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR} )
|
||||
62
src/main.cpp
Normal file
62
src/main.cpp
Normal file
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
// application header
|
||||
#include "simplecastenginewindow.h"
|
||||
|
||||
// KF headers
|
||||
#include <KAboutData>
|
||||
#include <KLocalizedString>
|
||||
|
||||
// Qt headers
|
||||
#include <QApplication>
|
||||
#include <QCommandLineParser>
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
QApplication application(argc, argv);
|
||||
|
||||
KLocalizedString::setApplicationDomain("simplecastengine");
|
||||
|
||||
KAboutData aboutData( QStringLiteral("simplecastengine"),
|
||||
i18n("SimpleCastEngine"),
|
||||
QStringLiteral("%{VERSION}"),
|
||||
i18n("A Simple Application written with KDE Frameworks"),
|
||||
KAboutLicense::GPL,
|
||||
i18n("Copyright %{CURRENT_YEAR}, %{AUTHOR} <%{EMAIL}>"));
|
||||
|
||||
aboutData.addAuthor(i18n("%{AUTHOR}"),i18n("Author"), QStringLiteral("%{EMAIL}"));
|
||||
aboutData.setOrganizationDomain("example.org");
|
||||
aboutData.setDesktopFileName(QStringLiteral("org.example.simplecastengine"));
|
||||
|
||||
KAboutData::setApplicationData(aboutData);
|
||||
application.setWindowIcon(QIcon::fromTheme(QStringLiteral("simplecastengine")));
|
||||
|
||||
QCommandLineParser parser;
|
||||
aboutData.setupCommandLine(&parser);
|
||||
|
||||
parser.process(application);
|
||||
aboutData.processCommandLine(&parser);
|
||||
|
||||
SimpleCastEngineWindow *mainWindow = new SimpleCastEngineWindow;
|
||||
mainWindow->show();
|
||||
|
||||
return application.exec();
|
||||
}
|
||||
23
src/org.example.simplecastengine.appdata.xml
Normal file
23
src/org.example.simplecastengine.appdata.xml
Normal file
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<component type="desktop-application">
|
||||
<id>org.example.simplecastengine.desktop</id>
|
||||
<metadata_license>CC0-1.0</metadata_license>
|
||||
<project_license> https://www.freedesktop.org/software/appstream/docs/chap-Metadata.html#tag-metadata_license </project_license>
|
||||
<name>SimpleCastEngine</name>
|
||||
<summary> https://www.freedesktop.org/software/appstream/docs/chap-Metadata.html#tag-summary </summary>
|
||||
<description>
|
||||
<p> https://www.freedesktop.org/software/appstream/docs/chap-Metadata.html#tag-description </p>
|
||||
</description>
|
||||
<url type="homepage">https://www.example.org</url>
|
||||
<url type="bugtracker">https://bugs.example.org</url>
|
||||
<url type="donation">https://www.example.org/community/donations</url>
|
||||
<screenshots>
|
||||
<screenshot type="default">
|
||||
<image> https://www.freedesktop.org/software/appstream/docs/chap-Metadata.html#tag-screenshots </image>
|
||||
</screenshot>
|
||||
</screenshots>
|
||||
<provides>
|
||||
<binary>simplecastengine</binary>
|
||||
</provides>
|
||||
<project_group>KDE</project_group>
|
||||
</component>
|
||||
9
src/org.example.simplecastengine.desktop
Normal file
9
src/org.example.simplecastengine.desktop
Normal file
@@ -0,0 +1,9 @@
|
||||
[Desktop Entry]
|
||||
Type=Application
|
||||
|
||||
Name=SimpleCastEngine
|
||||
GenericName=A Simple KDE Application
|
||||
Icon=simplecastengine
|
||||
|
||||
Exec=simplecastengine
|
||||
StartupWMClass=simplecastengine
|
||||
28
src/simplecastengine.ui
Normal file
28
src/simplecastengine.ui
Normal file
@@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>mainWidget</class>
|
||||
<widget class="QWidget" name="mainWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>400</width>
|
||||
<height>300</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Hello world!</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
33
src/simplecastenginewindow.cpp
Normal file
33
src/simplecastenginewindow.cpp
Normal file
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "simplecastenginewindow.h"
|
||||
|
||||
SimpleCastEngineWindow::SimpleCastEngineWindow()
|
||||
: QMainWindow()
|
||||
{
|
||||
QWidget *widget = new QWidget(this);
|
||||
setCentralWidget(widget);
|
||||
m_ui.setupUi(widget);
|
||||
}
|
||||
|
||||
SimpleCastEngineWindow::~SimpleCastEngineWindow()
|
||||
{
|
||||
}
|
||||
57
src/simplecastenginewindow.h
Normal file
57
src/simplecastenginewindow.h
Normal file
@@ -0,0 +1,57 @@
|
||||
/*
|
||||
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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef SIMPLECASTENGINEWINDOW_H
|
||||
#define SIMPLECASTENGINEWINDOW_H
|
||||
|
||||
|
||||
#include "ui_simplecastengine.h"
|
||||
|
||||
#include <QMainWindow>
|
||||
|
||||
/**
|
||||
* This class serves as the main window for SimpleCastEngine. It handles the
|
||||
* menus, toolbars and status bars.
|
||||
*
|
||||
* @short Main window class
|
||||
* @author %{AUTHOR} <%{EMAIL}>
|
||||
* @version %{VERSION}
|
||||
*/
|
||||
class SimpleCastEngineWindow : public QMainWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
/**
|
||||
* Default Constructor
|
||||
*/
|
||||
SimpleCastEngineWindow();
|
||||
|
||||
/**
|
||||
* Default Destructor
|
||||
*/
|
||||
~SimpleCastEngineWindow() override;
|
||||
|
||||
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 // SIMPLECASTENGINEWINDOW_H
|
||||
Reference in New Issue
Block a user