commit d6a09759fe47515af0a51520dcf3af4c91f541d1 Author: Alexis Drai Date: Wed Jun 7 09:03:22 2023 +0200 :tada: diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..bb7b593 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +# Use target-compatible line endings as the safe default for cross compilation. +* text=auto eol=lf diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..765a51d --- /dev/null +++ b/.gitignore @@ -0,0 +1,105 @@ +# ---> Qt +# C++ objects and libs +*.slo +*.lo +*.o +*.a +*.la +*.lai +*.so +*.so.* +*.dll +*.dylib + +# Qt-es +object_script.*.Release +object_script.*.Debug +*_plugin_import.cpp +/.qmake.cache +/.qmake.stash +*.pro.user +*.pro.user.* +*.qbs.user +*.qbs.user.* +*.moc +moc_*.cpp +moc_*.h +qrc_*.cpp +ui_*.h +*.qmlc +*.jsc +Makefile* +*build-* +*.qm +*.prl + +# Qt unit tests +target_wrapper.* + +# QtCreator +*.autosave + +# QtCreator Qml +*.qmlproject.user +*.qmlproject.user.* + +# QtCreator CMake +CMakeLists.txt.user* + +# QtCreator 4.8< compilation database +compile_commands.json + +# QtCreator local machine specific files for imported projects +*creator.user* + +*_qmlcache.qrc + +# ---> C++ +# Prerequisites +*.d + +# Compiled Object files +*.slo +*.lo +*.o +*.obj + +# Precompiled Headers +*.gch +*.pch + +# Compiled Dynamic libraries +*.so +*.dylib +*.dll + +# Fortran module files +*.mod +*.smod + +# Compiled Static libraries +*.lai +*.la +*.a +*.lib + +# Executables +*.exe +*.out +*.app + +# ---> Linux +*~ + +# temporary files which can be created if a process still has a handle open of a deleted file +.fuse_hidden* + +# KDE directory preferences +.directory + +# Linux trash folder which might appear on any partition or disk +.Trash-* + +# .nfs files are created when an open file is removed but is still being accessed +.nfs* + diff --git a/icons/108x108/qt3.png b/icons/108x108/qt3.png new file mode 100644 index 0000000..ab10628 Binary files /dev/null and b/icons/108x108/qt3.png differ diff --git a/icons/128x128/qt3.png b/icons/128x128/qt3.png new file mode 100644 index 0000000..54375c5 Binary files /dev/null and b/icons/128x128/qt3.png differ diff --git a/icons/172x172/qt3.png b/icons/172x172/qt3.png new file mode 100644 index 0000000..36eee58 Binary files /dev/null and b/icons/172x172/qt3.png differ diff --git a/icons/86x86/qt3.png b/icons/86x86/qt3.png new file mode 100644 index 0000000..ad316d6 Binary files /dev/null and b/icons/86x86/qt3.png differ 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/pages/FirstPage.qml b/qml/pages/FirstPage.qml new file mode 100644 index 0000000..9a00fc3 --- /dev/null +++ b/qml/pages/FirstPage.qml @@ -0,0 +1,43 @@ +import QtQuick 2.0 +import Sailfish.Silica 1.0 + +Page { + id: page + + // The effective value will be restricted by ApplicationWindow.allowedOrientations + allowedOrientations: Orientation.All + + // To enable PullDownMenu, place our content in a SilicaFlickable + SilicaFlickable { + anchors.fill: parent + + // PullDownMenu and PushUpMenu must be declared in SilicaFlickable, SilicaListView or SilicaGridView + PullDownMenu { + MenuItem { + text: qsTr("Show Page 2") + onClicked: pageStack.animatorPush(Qt.resolvedUrl("SecondPage.qml")) + } + } + + // Tell SilicaFlickable the height of its content. + contentHeight: column.height + + // Place our content in a Column. The PageHeader is always placed at the top + // of the page, followed by our content. + Column { + id: column + + width: page.width + spacing: Theme.paddingLarge + PageHeader { + title: qsTr("UI Template") + } + Label { + x: Theme.horizontalPageMargin + text: qsTr("Hello Sailors") + color: Theme.secondaryHighlightColor + font.pixelSize: Theme.fontSizeExtraLarge + } + } + } +} diff --git a/qml/pages/SecondPage.qml b/qml/pages/SecondPage.qml new file mode 100644 index 0000000..6dbadf4 --- /dev/null +++ b/qml/pages/SecondPage.qml @@ -0,0 +1,30 @@ +import QtQuick 2.0 +import Sailfish.Silica 1.0 + +Page { + id: page + + // The effective value will be restricted by ApplicationWindow.allowedOrientations + allowedOrientations: Orientation.All + + SilicaListView { + id: listView + model: 20 + anchors.fill: parent + header: PageHeader { + title: qsTr("Nested Page") + } + delegate: BackgroundItem { + id: delegate + + Label { + x: Theme.horizontalPageMargin + text: qsTr("Item") + " " + index + anchors.verticalCenter: parent.verticalCenter + color: delegate.highlighted ? Theme.highlightColor : Theme.primaryColor + } + onClicked: console.log("Clicked " + index) + } + VerticalScrollDecorator {} + } +} diff --git a/qml/qt3.qml b/qml/qt3.qml new file mode 100644 index 0000000..5709adc --- /dev/null +++ b/qml/qt3.qml @@ -0,0 +1,9 @@ +import QtQuick 2.0 +import Sailfish.Silica 1.0 +import "pages" + +ApplicationWindow { + initialPage: Component { FirstPage { } } + cover: Qt.resolvedUrl("cover/CoverPage.qml") + allowedOrientations: defaultAllowedOrientations +} diff --git a/qt3.desktop b/qt3.desktop new file mode 100644 index 0000000..a8d759d --- /dev/null +++ b/qt3.desktop @@ -0,0 +1,20 @@ +[Desktop Entry] +Type=Application +X-Nemo-Application-Type=silica-qt5 +Icon=qt3 +Exec=qt3 +Name=qt3 +# 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]=qt3 + +[X-Sailjail] +# Replace with your organization as a reverse domain name +OrganizationName=org.myorg +# ApplicationName does not have to be identical to Name +ApplicationName=qt3 +# Add the required permissions here +Permissions= diff --git a/qt3.pro b/qt3.pro new file mode 100644 index 0000000..2fdfc56 --- /dev/null +++ b/qt3.pro @@ -0,0 +1,39 @@ +# 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 = qt3 + +CONFIG += sailfishapp + +SOURCES += src/qt3.cpp + +DISTFILES += qml/qt3.qml \ + qml/cover/CoverPage.qml \ + qml/pages/FirstPage.qml \ + qml/pages/SecondPage.qml \ + rpm/qt3.changes.in \ + rpm/qt3.changes.run.in \ + rpm/qt3.spec \ + translations/*.ts \ + qt3.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/qt3-de.ts diff --git a/rpm/qt3.changes.in b/rpm/qt3.changes.in new file mode 100644 index 0000000..69bb042 --- /dev/null +++ b/rpm/qt3.changes.in @@ -0,0 +1,18 @@ +# Rename this file as qt3.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 +# qt3.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/qt3.changes.run.in b/rpm/qt3.changes.run.in new file mode 100644 index 0000000..6a79202 --- /dev/null +++ b/rpm/qt3.changes.run.in @@ -0,0 +1,24 @@ +#!/bin/bash +# +# Rename this file as qt3.changes.run to let sfdk automatically +# generate changelog from well formatted Git commit messages and tag +# annotations. Note that 'sfdk changelog' must be invoked as 'sfdk-changelog' here. + +sfdk-changelog + +# Here are some basic examples how to change from the default behavior. Run +# 'sfdk --help-maintaining' to learn more. + +# Use a subset of tags +#sfdk-changelog --tags refs/tags/my-prefix/* + +# Group entries by minor revision, suppress headlines for patch-level revisions +#sfdk-changelog --dense '/[0-9]+.[0-9+$' + +# Trim very old changes +#sfdk-changelog --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 +#sfdk-changelog --auto-add-annotations diff --git a/rpm/qt3.spec b/rpm/qt3.spec new file mode 100644 index 0000000..25bf12b --- /dev/null +++ b/rpm/qt3.spec @@ -0,0 +1,41 @@ +Name: qt3 + +Summary: My Sailfish OS Application +Version: 0.1 +Release: 1 +License: LICENSE +URL: http://example.org/ +Source0: %{name}-%{version}.tar.bz2 +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} + +%build + +%qmake5 + +%make_build + + +%install +%qmake5_install + + +desktop-file-install --delete-original --dir %{buildroot}%{_datadir}/applications %{buildroot}%{_datadir}/applications/*.desktop + +%files +%defattr(-,root,root,-) +%{_bindir}/%{name} +%{_datadir}/%{name} +%{_datadir}/applications/%{name}.desktop +%{_datadir}/icons/hicolor/*/apps/%{name}.png diff --git a/src/qt3.cpp b/src/qt3.cpp new file mode 100644 index 0000000..631af3b --- /dev/null +++ b/src/qt3.cpp @@ -0,0 +1,20 @@ +#ifdef QT_QML_DEBUG +#include +#endif + +#include + +int main(int argc, char *argv[]) +{ + // SailfishApp::main() will display "qml/qt3.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/qt3-de.ts b/translations/qt3-de.ts new file mode 100644 index 0000000..8f39883 --- /dev/null +++ b/translations/qt3-de.ts @@ -0,0 +1,37 @@ + + + + + CoverPage + + My Cover + Mein Cover + + + + FirstPage + + Show Page 2 + Zur Seite 2 + + + UI Template + UI-Vorlage + + + Hello Sailors + Hallo Matrosen + + + + SecondPage + + Nested Page + Unterseite + + + Item + Element + + + diff --git a/translations/qt3.ts b/translations/qt3.ts new file mode 100644 index 0000000..7fc118e --- /dev/null +++ b/translations/qt3.ts @@ -0,0 +1,37 @@ + + + + + CoverPage + + My Cover + + + + + FirstPage + + Show Page 2 + + + + UI Template + + + + Hello Sailors + + + + + SecondPage + + Nested Page + + + + Item + + + +