diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..dc5ec1d --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,58 @@ +project(tangraplay) + +cmake_minimum_required(VERSION 3.1 FATAL_ERROR) + +set(QT_MIN_VERSION "5.10.0") +set(KF5_DEP_VERSION "5.40.0") + +# We need some parts of the ECM CMake helpers. +find_package(ECM ${KF5_DEP_VERSION} QUIET REQUIRED NO_MODULE) + +# We append to the module path so modules can be overridden from the command line. +list(APPEND CMAKE_MODULE_PATH ${ECM_MODULE_PATH}) + +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x") + +find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS Core Quick QuickControls2 Multimedia Widgets Gui ) + +include_directories(.) +include_directories(${Qt5Core_PRIVATE_INCLUDE_DIRS}) + +set(CMAKE_INCLUDE_CURRENT_DIR ON) +set(CMAKE_AUTOMOC ON) + +include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE) +include(KDEInstallDirs) +include(KDECMakeSettings) + +include(ECMOptionalAddSubdirectory) +include(ECMAddAppIcon) +include(ECMInstallIcons) + + +add_subdirectory(Resources) +qt5_add_resources(RESOURCES qml.qrc) + +SET(SOURCES + main.cpp + ) + +add_executable(tangraplay + ${SOURCES} + ${RESOURCES} + ) + +qt5_use_modules(tangraplay Quick QuickControls2 Core Multimedia ) + +target_link_libraries(tangraplay + Qt5::Quick + Qt5::QuickControls2 + Qt5::Core + Qt5::Widgets + Qt5::Gui + Qt5::Multimedia ) + +install(TARGETS tangraplay DESTINATION ${KDE_INSTALL_TARGETS_DEFAULT_ARGS}) + +install(PROGRAMS org.petrovs_info.tangraplay.desktop DESTINATION ${KDE_INSTALL_APPDIR}) +install(FILES org.petrovs_info.tangraplay.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR}) diff --git a/Resources/128-apps-org.petrovs_info.tangraplay.png b/Resources/128-apps-org.petrovs_info.tangraplay.png new file mode 100644 index 0000000..84534a6 Binary files /dev/null and b/Resources/128-apps-org.petrovs_info.tangraplay.png differ diff --git a/Resources/16-apps-org.petrovs_info.tangraplay.png b/Resources/16-apps-org.petrovs_info.tangraplay.png new file mode 100644 index 0000000..b11e561 Binary files /dev/null and b/Resources/16-apps-org.petrovs_info.tangraplay.png differ diff --git a/Resources/32-apps-org.petrovs_info.tangraplay.png b/Resources/32-apps-org.petrovs_info.tangraplay.png new file mode 100644 index 0000000..2d843a1 Binary files /dev/null and b/Resources/32-apps-org.petrovs_info.tangraplay.png differ diff --git a/Resources/48-apps-org.petrovs_info.tangraplay.png b/Resources/48-apps-org.petrovs_info.tangraplay.png new file mode 100644 index 0000000..e7537ce Binary files /dev/null and b/Resources/48-apps-org.petrovs_info.tangraplay.png differ diff --git a/Resources/64-apps-org.petrovs_info.tangraplay.png b/Resources/64-apps-org.petrovs_info.tangraplay.png new file mode 100644 index 0000000..e77a91f Binary files /dev/null and b/Resources/64-apps-org.petrovs_info.tangraplay.png differ diff --git a/Resources/CMakeLists.txt b/Resources/CMakeLists.txt new file mode 100644 index 0000000..73d7cfe --- /dev/null +++ b/Resources/CMakeLists.txt @@ -0,0 +1,10 @@ + +ecm_install_icons( + ICONS + 128-apps-org.petrovs_info.tangraplay.png + 64-apps-org.petrovs_info.tangraplay.png + 48-apps-org.petrovs_info.tangraplay.png + 32-apps-org.petrovs_info.tangraplay.png + 16-apps-org.petrovs_info.tangraplay.png + DESTINATION ${ICON_INSTALL_DIR} +) diff --git a/TangraPlay.pro b/TangraPlay.pro index bf3e4c8..5913411 100644 --- a/TangraPlay.pro +++ b/TangraPlay.pro @@ -1,4 +1,4 @@ -QT += quick +QT += quick gui core widgets CONFIG += c++11 diff --git a/main.cpp b/main.cpp index db8d3b8..068ac16 100644 --- a/main.cpp +++ b/main.cpp @@ -1,11 +1,12 @@ #include +#include #include int main(int argc, char *argv[]) { QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); - QGuiApplication app(argc, argv); + QApplication app(argc, argv); QQmlApplicationEngine engine; const QUrl url(QStringLiteral("qrc:/main.qml")); diff --git a/main.qml b/main.qml index b343020..c615b8b 100644 --- a/main.qml +++ b/main.qml @@ -107,12 +107,21 @@ Window { } MenuButton { - id: buttonMinimize - anchors.left: buttonExit.right - caption: "_" - onClicked: mainWindow.hide() + id: buttonMinimize + anchors.left: buttonExit.right + caption: "_" + onClicked: mainWindow.hide() } + + Text { + id: appTitle + anchors.left: buttonMinimize.right + text: qsTr("TangraPlay") + font.pixelSize: 20 + font.bold: true + color: "#f9c620" + } } } diff --git a/make-flatpak.sh b/make-flatpak.sh new file mode 100644 index 0000000..4ac2148 --- /dev/null +++ b/make-flatpak.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +flatpak-builder --user --install build-dir org.petrovs_info.tangraplay.json + +flatpak run org.petrovs_info.tangraplay diff --git a/org.petrovs_info.tangraplay.appdata.xml b/org.petrovs_info.tangraplay.appdata.xml new file mode 100644 index 0000000..48dfb88 --- /dev/null +++ b/org.petrovs_info.tangraplay.appdata.xml @@ -0,0 +1,32 @@ + + + org.petrovs_info.tangraplay + org.petrovs_info.tangraplay.desktop + CC0-1.0 + LGPL-2.0+ + TangraPlay + TangraPlay + +

Application for Radio Tangra

+

Приложение за радио Тангра

+
+ + + + + + https://tangraplay.petrovs.info/screenshot.png + + + + Multimedia + + https://tangraplay.petrovs.info + https://code.petrovs.info/blago/TangraPlay/issues + petrovs_info + blagovest_AT_petrovs.info + + tangraplay + + +
diff --git a/org.petrovs_info.tangraplay.desktop b/org.petrovs_info.tangraplay.desktop new file mode 100644 index 0000000..aa52ece --- /dev/null +++ b/org.petrovs_info.tangraplay.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Name=TangraPlay +GenericName=TangraPlay +Comment=Плеър за Рок Радио Тангра +Exec=tangraplay +Terminal=false +Icon=org.petrovs_info.tangraplay +Type=Application +X-KDE-PluginInfo-Website=http://tangraplay.petrovs.info +Categories=AudioVideo;Player +Keywords=Player;Radio;Tangra;Rock;Broadcast diff --git a/org.petrovs_info.tangraplay.json b/org.petrovs_info.tangraplay.json new file mode 100644 index 0000000..5a10025 --- /dev/null +++ b/org.petrovs_info.tangraplay.json @@ -0,0 +1,31 @@ +{ + "app-id": "org.petrovs_info.tangraplay", + "runtime": "org.kde.Platform", + "runtime-version": "5.15", + "sdk": "org.kde.Sdk", + "command": "tangraplay", + "finish-args": [ + "--share=ipc", + "--socket=x11", + "--socket=wayland", + "--filesystem=host", + "--device=dri", + "--socket=pulseaudio", + "--share=network" + + ], + "modules": [ + { + "name": "tangraplay", + "buildsystem": "cmake-ninja", + // "config-opts": ["-DCMAKE_BUILD_TYPE=RelWithDebInfo"], + "sources": [ + { + "type": "git", + "url": "https://code.petrovs.info/blago/TangraPlay.git", + "branch": "flatpak-cmake" + } + ] + } + ] +}