From ebb1ab3d05b1e61a491375b7640196e04f1bab06 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Thu, 9 Apr 2020 16:15:07 +0200 Subject: Initial commit: Basic chess grid --- harbour-sailchess.desktop | 12 + harbour-sailchess.pro | 40 ++ harbour-sailchess.pro.user | 783 +++++++++++++++++++++++++++++++++++ icons/108x108/harbour-sailchess.png | Bin 0 -> 7433 bytes icons/128x128/harbour-sailchess.png | Bin 0 -> 9004 bytes icons/172x172/harbour-sailchess.png | Bin 0 -> 12765 bytes icons/86x86/harbour-sailchess.png | Bin 0 -> 5835 bytes qml/Square.qml | 11 + qml/cover/CoverPage.qml | 22 + qml/harbour-sailchess.qml | 10 + qml/pages/Board.qml | 44 ++ rpm/harbour-sailchess.changes.in | 18 + rpm/harbour-sailchess.changes.run.in | 25 ++ rpm/harbour-sailchess.spec | 67 +++ rpm/harbour-sailchess.yaml | 43 ++ src/harbour-sailchess.cpp | 20 + translations/harbour-sailchess-de.ts | 18 + translations/harbour-sailchess.ts | 18 + 18 files changed, 1131 insertions(+) create mode 100644 harbour-sailchess.desktop create mode 100644 harbour-sailchess.pro create mode 100644 harbour-sailchess.pro.user create mode 100644 icons/108x108/harbour-sailchess.png create mode 100644 icons/128x128/harbour-sailchess.png create mode 100644 icons/172x172/harbour-sailchess.png create mode 100644 icons/86x86/harbour-sailchess.png create mode 100644 qml/Square.qml create mode 100644 qml/cover/CoverPage.qml create mode 100644 qml/harbour-sailchess.qml create mode 100644 qml/pages/Board.qml create mode 100644 rpm/harbour-sailchess.changes.in create mode 100644 rpm/harbour-sailchess.changes.run.in create mode 100644 rpm/harbour-sailchess.spec create mode 100644 rpm/harbour-sailchess.yaml create mode 100644 src/harbour-sailchess.cpp create mode 100644 translations/harbour-sailchess-de.ts create mode 100644 translations/harbour-sailchess.ts diff --git a/harbour-sailchess.desktop b/harbour-sailchess.desktop new file mode 100644 index 0000000..8cc738d --- /dev/null +++ b/harbour-sailchess.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Application +X-Nemo-Application-Type=silica-qt5 +Icon=harbour-sailchess +Exec=harbour-sailchess +Name=harbour-sailchess +# translation example: +# your app name in German locale (de) +# +# Remember to comment out the following line, if you do not want to use +# a different app name in German locale (de). +Name[de]=harbour-sailchess diff --git a/harbour-sailchess.pro b/harbour-sailchess.pro new file mode 100644 index 0000000..762f411 --- /dev/null +++ b/harbour-sailchess.pro @@ -0,0 +1,40 @@ +# NOTICE: +# +# Application name defined in TARGET has a corresponding QML filename. +# If name defined in TARGET is changed, the following needs to be done +# to match new name: +# - corresponding QML filename must be changed +# - desktop icon filename must be changed +# - desktop filename must be changed +# - icon definition filename in desktop file must be changed +# - translation filenames have to be changed + +# The name of your application +TARGET = harbour-sailchess + +CONFIG += sailfishapp + +SOURCES += src/harbour-sailchess.cpp + +DISTFILES += qml/harbour-sailchess.qml \ + qml/cover/CoverPage.qml \ + qml/pages/Board.qml \ + qml/Square.qml \ + rpm/harbour-sailchess.changes.in \ + rpm/harbour-sailchess.changes.run.in \ + rpm/harbour-sailchess.spec \ + rpm/harbour-sailchess.yaml \ + translations/*.ts \ + harbour-sailchess.desktop + +SAILFISHAPP_ICONS = 86x86 108x108 128x128 172x172 + +# to disable building translations every time, comment out the +# following CONFIG line +CONFIG += sailfishapp_i18n + +# German translation is enabled as an example. If you aren't +# planning to localize your app, remember to comment out the +# following TRANSLATIONS line. And also do not forget to +# modify the localized app name in the the .desktop file. +TRANSLATIONS += translations/harbour-sailchess-de.ts diff --git a/harbour-sailchess.pro.user b/harbour-sailchess.pro.user new file mode 100644 index 0000000..7ac6205 --- /dev/null +++ b/harbour-sailchess.pro.user @@ -0,0 +1,783 @@ + + + + + + EnvironmentId + {165e634c-1493-4e4a-a669-d4ec7547e75a} + + + ProjectExplorer.Project.ActiveTarget + 0 + + + ProjectExplorer.Project.EditorSettings + + true + false + true + + Cpp + + CppGlobal + + + + QmlJS + + QmlJSGlobal + + + 2 + UTF-8 + false + 4 + false + 80 + true + true + 1 + true + false + 0 + true + true + 0 + 8 + true + 1 + true + true + true + false + + + + ProjectExplorer.Project.PluginSettings + + + + ProjectExplorer.Project.Target.0 + + SailfishOS-3.2.1.20-armv7hl (in Sailfish OS Build Engine) + SailfishOS-3.2.1.20-armv7hl (in Sailfish OS Build Engine) + SailfishOS-3.2.1.20-armv7hl + 0 + 0 + 0 + + /home/melvin/code/build-harbour-sailchess-SailfishOS_3_2_1_20_armv7hl_in_Sailfish_OS_Build_Engine-Debug + + + true + Start Build Engine + + Mer.MerSdkStartStep + + + true + qmake + + QtProjectManager.QMakeBuildStep + true + + false + false + false + + + true + Make + + Qt4ProjectManager.MakeStep + + false + + + false + + 3 + Build + + ProjectExplorer.BuildSteps.Build + + + + true + Start Build Engine + + Mer.MerSdkStartStep + + + true + Make + + Qt4ProjectManager.MakeStep + + true + clean + + false + + 2 + Clean + + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Debug + Debug + Qt4ProjectManager.Qt4BuildConfiguration + 2 + true + + + /home/melvin/code/build-harbour-sailchess-SailfishOS_3_2_1_20_armv7hl_in_Sailfish_OS_Build_Engine-Release + + + true + Start Build Engine + + Mer.MerSdkStartStep + + + true + qmake + + QtProjectManager.QMakeBuildStep + false + + false + false + false + + + true + Make + + Qt4ProjectManager.MakeStep + + false + + + false + + 3 + Build + + ProjectExplorer.BuildSteps.Build + + + + true + Start Build Engine + + Mer.MerSdkStartStep + + + true + Make + + Qt4ProjectManager.MakeStep + + true + clean + + false + + 2 + Clean + + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Release + Release + Qt4ProjectManager.Qt4BuildConfiguration + 0 + true + + + /home/melvin/code/build-harbour-sailchess-SailfishOS_3_2_1_20_armv7hl_in_Sailfish_OS_Build_Engine-Profile + + + true + Start Build Engine + + Mer.MerSdkStartStep + + + true + qmake + + QtProjectManager.QMakeBuildStep + true + + false + true + false + + + true + Make + + Qt4ProjectManager.MakeStep + + false + + + false + + 3 + Build + + ProjectExplorer.BuildSteps.Build + + + + true + Start Build Engine + + Mer.MerSdkStartStep + + + true + Make + + Qt4ProjectManager.MakeStep + + true + clean + + false + + 2 + Clean + + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Profile + Profile + Qt4ProjectManager.Qt4BuildConfiguration + 0 + true + + 3 + + + + true + RPM + + QmakeProjectManager.MerRpmBuildStep + + 1 + Deploy + + ProjectExplorer.BuildSteps.Deploy + + 1 + Build RPM Package For Manual Deployment + + QmakeProjectManager.MerMb2RpmBuildConfiguration + + + + + true + Prepare Target + + QmakeProjectManager.MerPrepareTargetStep + + + true + Rsync + + QmakeProjectManager.MerRsyncDeployStep + + 2 + Deploy + + ProjectExplorer.BuildSteps.Deploy + + 1 + Deploy By Copying Binaries + + QmakeProjectManager.MerRSyncDeployConfiguration + + + + + true + Prepare Target + + QmakeProjectManager.MerPrepareTargetStep + + + true + RPM + + QmakeProjectManager.MerRpmDeployStep + + 2 + Deploy + + ProjectExplorer.BuildSteps.Deploy + + 1 + Deploy As RPM Package + + QmakeProjectManager.MerRpmDeployConfiguration + + 3 + + + dwarf + + cpu-cycles + + + 250 + -F + true + 4096 + false + false + 1000 + + true + + false + false + false + false + true + 0.01 + 10 + true + kcachegrind + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + /home/melvin/code/harbour-sailchess + false + -1 + 3 + + 2 + + + Custom Executable + + ProjectExplorer.CustomExecutableRunConfiguration + + 3768 + false + true + false + false + true + + + + 1 + + + + ProjectExplorer.Project.Target.1 + + SailfishOS-3.2.1.20-i486 (in Sailfish OS Build Engine) + SailfishOS-3.2.1.20-i486 (in Sailfish OS Build Engine) + SailfishOS-3.2.1.20-i486 + 0 + 0 + 0 + + /home/melvin/code/build-harbour-sailchess-SailfishOS_3_2_1_20_i486_in_Sailfish_OS_Build_Engine-Debug + + + true + Start Build Engine + + Mer.MerSdkStartStep + + + true + qmake + + QtProjectManager.QMakeBuildStep + true + + false + false + false + + + true + Make + + Qt4ProjectManager.MakeStep + + false + + + false + + 3 + Build + + ProjectExplorer.BuildSteps.Build + + + + true + Start Build Engine + + Mer.MerSdkStartStep + + + true + Make + + Qt4ProjectManager.MakeStep + + true + clean + + false + + 2 + Clean + + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Debug + Debug + Qt4ProjectManager.Qt4BuildConfiguration + 2 + true + + + /home/melvin/code/build-harbour-sailchess-SailfishOS_3_2_1_20_i486_in_Sailfish_OS_Build_Engine-Release + + + true + Start Build Engine + + Mer.MerSdkStartStep + + + true + qmake + + QtProjectManager.QMakeBuildStep + false + + false + false + false + + + true + Make + + Qt4ProjectManager.MakeStep + + false + + + false + + 3 + Build + + ProjectExplorer.BuildSteps.Build + + + + true + Start Build Engine + + Mer.MerSdkStartStep + + + true + Make + + Qt4ProjectManager.MakeStep + + true + clean + + false + + 2 + Clean + + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Release + Release + Qt4ProjectManager.Qt4BuildConfiguration + 0 + true + + + /home/melvin/code/build-harbour-sailchess-SailfishOS_3_2_1_20_i486_in_Sailfish_OS_Build_Engine-Profile + + + true + Start Build Engine + + Mer.MerSdkStartStep + + + true + qmake + + QtProjectManager.QMakeBuildStep + true + + false + true + false + + + true + Make + + Qt4ProjectManager.MakeStep + + false + + + false + + 3 + Build + + ProjectExplorer.BuildSteps.Build + + + + true + Start Build Engine + + Mer.MerSdkStartStep + + + true + Make + + Qt4ProjectManager.MakeStep + + true + clean + + false + + 2 + Clean + + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Profile + Profile + Qt4ProjectManager.Qt4BuildConfiguration + 0 + true + + 3 + + + + true + RPM + + QmakeProjectManager.MerRpmBuildStep + + 1 + Deploy + + ProjectExplorer.BuildSteps.Deploy + + 1 + Build RPM Package For Manual Deployment + + QmakeProjectManager.MerMb2RpmBuildConfiguration + + + + + true + Prepare Target + + QmakeProjectManager.MerPrepareTargetStep + + + true + Rsync + + QmakeProjectManager.MerRsyncDeployStep + + 2 + Deploy + + ProjectExplorer.BuildSteps.Deploy + + 1 + Deploy By Copying Binaries + + QmakeProjectManager.MerRSyncDeployConfiguration + + + + + true + Prepare Target + + QmakeProjectManager.MerPrepareTargetStep + + + true + RPM + + QmakeProjectManager.MerRpmDeployStep + + 2 + Deploy + + ProjectExplorer.BuildSteps.Deploy + + 1 + Deploy As RPM Package + + QmakeProjectManager.MerRpmDeployConfiguration + + 3 + + + dwarf + + cpu-cycles + + + 250 + -F + true + 4096 + false + false + 1000 + + true + + false + false + false + false + true + 0.01 + 10 + true + kcachegrind + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + /home/melvin/code/harbour-sailchess + false + -1 + 3 + + 2 + + + Custom Executable + + ProjectExplorer.CustomExecutableRunConfiguration + + 3768 + false + true + false + false + true + + + + 1 + + + + ProjectExplorer.Project.TargetCount + 2 + + + ProjectExplorer.Project.Updater.FileVersion + 21 + + + Version + 21 + + diff --git a/icons/108x108/harbour-sailchess.png b/icons/108x108/harbour-sailchess.png new file mode 100644 index 0000000..ab10628 Binary files /dev/null and b/icons/108x108/harbour-sailchess.png differ diff --git a/icons/128x128/harbour-sailchess.png b/icons/128x128/harbour-sailchess.png new file mode 100644 index 0000000..54375c5 Binary files /dev/null and b/icons/128x128/harbour-sailchess.png differ diff --git a/icons/172x172/harbour-sailchess.png b/icons/172x172/harbour-sailchess.png new file mode 100644 index 0000000..36eee58 Binary files /dev/null and b/icons/172x172/harbour-sailchess.png differ diff --git a/icons/86x86/harbour-sailchess.png b/icons/86x86/harbour-sailchess.png new file mode 100644 index 0000000..ad316d6 Binary files /dev/null and b/icons/86x86/harbour-sailchess.png differ diff --git a/qml/Square.qml b/qml/Square.qml new file mode 100644 index 0000000..de61de4 --- /dev/null +++ b/qml/Square.qml @@ -0,0 +1,11 @@ +import QtQuick 2.0 + +Rectangle { + height: this.width + border.color: "yellow" + border.width: 0 + MouseArea { + anchors.fill: parent + onClicked: parent.border.width ^= 3 + } +} diff --git a/qml/cover/CoverPage.qml b/qml/cover/CoverPage.qml new file mode 100644 index 0000000..fc562d5 --- /dev/null +++ b/qml/cover/CoverPage.qml @@ -0,0 +1,22 @@ +import QtQuick 2.0 +import Sailfish.Silica 1.0 + +CoverBackground { + Label { + id: label + anchors.centerIn: parent + text: qsTr("My Cover") + } + + CoverActionList { + id: coverAction + + CoverAction { + iconSource: "image://theme/icon-cover-next" + } + + CoverAction { + iconSource: "image://theme/icon-cover-pause" + } + } +} diff --git a/qml/harbour-sailchess.qml b/qml/harbour-sailchess.qml new file mode 100644 index 0000000..ddc0046 --- /dev/null +++ b/qml/harbour-sailchess.qml @@ -0,0 +1,10 @@ +import QtQuick 2.0 +import Sailfish.Silica 1.0 +import "pages" + +ApplicationWindow +{ + initialPage: Component { Board { } } + cover: Qt.resolvedUrl("cover/CoverPage.qml") + allowedOrientations: Orientation.Portrait +} diff --git a/qml/pages/Board.qml b/qml/pages/Board.qml new file mode 100644 index 0000000..f04a0f1 --- /dev/null +++ b/qml/pages/Board.qml @@ -0,0 +1,44 @@ +import QtQuick 2.0 +import Sailfish.Silica 1.0 +import ".." + +Page { + id: page + allowedOrientations: Orientation.Portrait + + SilicaFlickable { + anchors.fill: parent + contentHeight: column.height + + Column { + id: column + + width: page.width + height: page.height + spacing: Theme.paddingLarge + + PageHeader { + title: qsTr("Chess") + } + + Grid { + property int row: 0 + + id: grid + anchors.horizontalCenter: parent.horizontalCenter + anchors.verticalCenter: parent.verticalCenter + columns: 8 + rows: 8 + Repeater { + id: repeater + model: 64 + delegate: Square { + width: page.width / 8 + color: ((index >> 3 ^ index) & 1) == 1 ? "#e8ebef" : "#7d8796" + + } + } + } + } + } +} diff --git a/rpm/harbour-sailchess.changes.in b/rpm/harbour-sailchess.changes.in new file mode 100644 index 0000000..c2ff1b9 --- /dev/null +++ b/rpm/harbour-sailchess.changes.in @@ -0,0 +1,18 @@ +# Rename this file as harbour-sailchess.changes to include changelog +# entries in your RPM file. +# +# Add new changelog entries following the format below. +# Add newest entries to the top of the list. +# Separate entries from eachother with a blank line. +# +# Alternatively, if your changelog is automatically generated (e.g. with +# the git-change-log command provided with Sailfish OS SDK), create a +# harbour-sailchess.changes.run script to let mb2 run the required commands for you. + +# * date Author's Name version-release +# - Summary of changes + +* Sun Apr 13 2014 Jack Tar 0.0.1-1 +- Scrubbed the deck +- Hoisted the sails + diff --git a/rpm/harbour-sailchess.changes.run.in b/rpm/harbour-sailchess.changes.run.in new file mode 100644 index 0000000..33c8c9b --- /dev/null +++ b/rpm/harbour-sailchess.changes.run.in @@ -0,0 +1,25 @@ +#!/bin/bash +# +# Rename this file as harbour-sailchess.changes.run to let mb2 automatically +# generate changelog from well formatted Git commit messages and tag +# annotations. + +git-change-log + +# Here are some basic examples how to change from the default behavior. Run +# git-change-log --help inside the Sailfish OS SDK chroot or build engine to +# learn all the options git-change-log accepts. + +# Use a subset of tags +#git-change-log --tags refs/tags/my-prefix/* + +# Group entries by minor revision, suppress headlines for patch-level revisions +#git-change-log --dense '/[0-9]+.[0-9+$' + +# Trim very old changes +#git-change-log --since 2014-04-01 +#echo '[ Some changelog entries trimmed for brevity ]' + +# Use the subjects (first lines) of tag annotations when no entry would be +# included for a revision otherwise +#git-change-log --auto-add-annotations diff --git a/rpm/harbour-sailchess.spec b/rpm/harbour-sailchess.spec new file mode 100644 index 0000000..86a2217 --- /dev/null +++ b/rpm/harbour-sailchess.spec @@ -0,0 +1,67 @@ +# +# Do NOT Edit the Auto-generated Part! +# Generated by: spectacle version 0.27 +# + +Name: harbour-sailchess + +# >> macros +# << macros + +Summary: Awesome chess application +Version: 0.1 +Release: 1 +Group: Qt/Qt +License: LICENSE +URL: http://example.org/ +Source0: %{name}-%{version}.tar.bz2 +Source100: harbour-sailchess.yaml +Requires: sailfishsilica-qt5 >= 0.10.9 +BuildRequires: pkgconfig(sailfishapp) >= 1.0.2 +BuildRequires: pkgconfig(Qt5Core) +BuildRequires: pkgconfig(Qt5Qml) +BuildRequires: pkgconfig(Qt5Quick) +BuildRequires: desktop-file-utils + +%description +Short description of my Sailfish OS Application + + +%prep +%setup -q -n %{name}-%{version} + +# >> setup +# << setup + +%build +# >> build pre +# << build pre + +%qmake5 + +make %{?_smp_mflags} + +# >> build post +# << build post + +%install +rm -rf %{buildroot} +# >> install pre +# << install pre +%qmake5_install + +# >> install post +# << install post + +desktop-file-install --delete-original \ + --dir %{buildroot}%{_datadir}/applications \ + %{buildroot}%{_datadir}/applications/*.desktop + +%files +%defattr(-,root,root,-) +%{_bindir} +%{_datadir}/%{name} +%{_datadir}/applications/%{name}.desktop +%{_datadir}/icons/hicolor/*/apps/%{name}.png +# >> files +# << files diff --git a/rpm/harbour-sailchess.yaml b/rpm/harbour-sailchess.yaml new file mode 100644 index 0000000..7c36f06 --- /dev/null +++ b/rpm/harbour-sailchess.yaml @@ -0,0 +1,43 @@ +Name: harbour-sailchess +Summary: Awesome chess application +Version: 0.1 +Release: 1 +# The contents of the Group field should be one of the groups listed here: +# https://github.com/mer-tools/spectacle/blob/master/data/GROUPS +Group: Qt/Qt +URL: http://example.org/ +License: LICENSE +# This must be generated before uploading a package to a remote build service. +# Usually this line does not need to be modified. +Sources: +- '%{name}-%{version}.tar.bz2' +Description: | + Short description of my Sailfish OS Application +Configure: none +Builder: qmake5 + +# This section specifies build dependencies that are resolved using pkgconfig. +# This is the preferred way of specifying build dependencies for your package. +PkgConfigBR: + - sailfishapp >= 1.0.2 + - Qt5Core + - Qt5Qml + - Qt5Quick + +# Build dependencies without a pkgconfig setup can be listed here +# PkgBR: +# - package-needed-to-build + +# Runtime dependencies which are not automatically detected +Requires: + - sailfishsilica-qt5 >= 0.10.9 + +# All installed files +Files: + - '%{_bindir}' + - '%{_datadir}/%{name}' + - '%{_datadir}/applications/%{name}.desktop' + - '%{_datadir}/icons/hicolor/*/apps/%{name}.png' + +# For more information about yaml and what's supported in Sailfish OS +# build system, please see https://wiki.merproject.org/wiki/Spectacle diff --git a/src/harbour-sailchess.cpp b/src/harbour-sailchess.cpp new file mode 100644 index 0000000..e7df625 --- /dev/null +++ b/src/harbour-sailchess.cpp @@ -0,0 +1,20 @@ +#ifdef QT_QML_DEBUG +#include +#endif + +#include + +int main(int argc, char *argv[]) +{ + // SailfishApp::main() will display "qml/harbour-sailchess.qml", if you need more + // control over initialization, you can use: + // + // - SailfishApp::application(int, char *[]) to get the QGuiApplication * + // - SailfishApp::createView() to get a new QQuickView * instance + // - SailfishApp::pathTo(QString) to get a QUrl to a resource file + // - SailfishApp::pathToMainQml() to get a QUrl to the main QML file + // + // To display the view, call "show()" (will show fullscreen on device). + + return SailfishApp::main(argc, argv); +} diff --git a/translations/harbour-sailchess-de.ts b/translations/harbour-sailchess-de.ts new file mode 100644 index 0000000..df2aa7b --- /dev/null +++ b/translations/harbour-sailchess-de.ts @@ -0,0 +1,18 @@ + + + + + Board + + Chess + + + + + CoverPage + + My Cover + Mein Cover + + + diff --git a/translations/harbour-sailchess.ts b/translations/harbour-sailchess.ts new file mode 100644 index 0000000..dd3cf7f --- /dev/null +++ b/translations/harbour-sailchess.ts @@ -0,0 +1,18 @@ + + + + + Board + + Chess + + + + + CoverPage + + My Cover + + + + -- cgit v1.2.3