diff --git a/.github/workflows/makefile.yml b/.github/workflows/makefile.yml new file mode 100644 index 0000000..0f34648 --- /dev/null +++ b/.github/workflows/makefile.yml @@ -0,0 +1,58 @@ +name: SailfishOS App CI (aarch64, armv7hl, i486) +env: + sfos_target: 4.5.0.16 + +on: + push: + # tags: + # - 'v*-sfos4.2' + branches: + - 'master' + #pull_request: + # branches: + # - sfos4.2 + +jobs: + build: + runs-on: ubuntu-20.04 + + steps: + - uses: actions/checkout@v2 + + - name: Prepare + run: mkdir RPMS + + - name: Build armv7hl + uses: coderus/github-sfos-build@master + with: + release: ${{ env.sfos_target }} + arch: armv7hl + + - name: Build i486 + uses: coderus/github-sfos-build@master + with: + release: ${{ env.sfos_target }} + arch: i486 + + - name: Build aarch64 + uses: coderus/github-sfos-build@master + with: + release: ${{ env.sfos_target }} + arch: aarch64 + + - name: Upload build result + uses: actions/upload-artifact@v4 + with: + name: rpm-build-result + path: RPMS + - name: Checkout + uses: actions/checkout@v4 + - name: Release + uses: softprops/action-gh-release@v2 + #if: startsWith(github.ref, 'refs/tags/') + with: + files: | + /workspace/RPMS/jolla-settings-screenmonitor-${{ github.ref_name }}-1.aarch64 + /workspace/RPMS/jolla-settings-screenmonitor-${{ github.ref_name }}-1.armv7hl + /workspace/RPMS/jolla-settings-screenmonitor-${{ github.ref_name }}-1.i486 + jolla-settings-screenmonitor.changes diff --git a/.gitignore b/.gitignore index 95edb2a..814ef4a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,8 @@ jolla-settings-screenmonitor.pro.user +jolla-settings-screenmonitor.pro.user.* jolla-settings-screenmonitor.pro.autosave +jolla-settings-screenmonitor.pro.user.0a580b9 + +service/ScreenMonitor RPMS/ diff --git a/jolla-settings-screenmonitor.pro b/jolla-settings-screenmonitor.pro index 1e866e0..8c8247e 100644 --- a/jolla-settings-screenmonitor.pro +++ b/jolla-settings-screenmonitor.pro @@ -12,6 +12,7 @@ TEMPLATE = aux TARGET = jolla-settings-screenmonitor jolla-settings-screenmonitor.depends += ScreenMonitor +screenmonitor-executable.CONFIG += no_check_exist #CONFIG += sailfishapp @@ -30,7 +31,7 @@ screenmonitor-dbus-configuration.files = service/dbus/eu.medesimo.ScreenMonitor. screenmonitor-dbus-service.path = /usr/share/dbus-1/system-services screenmonitor-dbus-service.files = service/dbus/eu.medesimo.ScreenMonitor.service -screenmonitor-systemd.path = /lib/systemd/system +screenmonitor-systemd.path = /usr/lib/systemd/system screenmonitor-systemd.files = service/dbus/ScreenMonitor.service INSTALLS += \ @@ -39,29 +40,60 @@ INSTALLS += \ screenmonitor-executable \ screenmonitor-dbus-configuration \ screenmonitor-dbus-service \ - screenmonitor-systemd + screenmonitor-systemd OTHER_FILES += \ rpm/jolla-settings-screenmonitor.spec \ rpm/jolla-settings-screenmonitor.yaml \ - service/dbus_interface.vala \ - service/ScreenMonitor.vala \ - service/ScreenMonitor \ - service/UnixTimer.vala \ - service/service.vala \ - service/Makefile \ - service/dbus/eu.medesimo.ScreenMonitor.service \ - service/dbus/eu.medesimo.ScreenMonitor.conf \ - service/dbus/Makefile \ + service/dbus_interface.vala \ + service/ScreenMonitor.vala \ + service/ScreenMonitor \ + service/UnixTimer.vala \ + service/service.vala \ + service/Makefile \ + service/dbus/eu.medesimo.ScreenMonitor.service \ + service/dbus/eu.medesimo.ScreenMonitor.conf \ + service/dbus/Makefile \ service/UnixTimer.vala \ settings/DetailItem.qml \ rpm/jolla-settings-screenmonitor.changes \ service/FileWatcher.vala -# to disable building translations every time, comment out the -# following CONFIG line -#CONFIG += sailfishapp_i18n -#TRANSLATIONS += translations/jolla-settings-screenmonitor-de.ts +TRANSLATIONS += $$files(translations/$${TARGET}-*.ts) +TS_FILE = $${_PRO_FILE_PWD_}/translations/$${TARGET}*.ts +HAVE_TRANSLATIONS = 0 + +TRANSLATION_SOURCES += $$_PRO_FILE_PWD_/settings/ + +# prefix all TRANSLATIONS with the src dir +# the qm files are generated from the ts files copied to out dir +for(t, TRANSLATIONS) { + TRANSLATIONS_IN += $${_PRO_FILE_PWD_}/$$t + TRANSLATIONS_OUT += $${OUT_PWD}/$$t + HAVE_TRANSLATIONS = 1 +} + +qm.files = $$replace(TRANSLATIONS_OUT, \.ts, .qm) +qm.path = /usr/share/translations +qm.CONFIG += no_check_exist + +# update the ts files in the src dir and then copy them to the out dir +qm.commands += lupdate -noobsolete $${TRANSLATION_SOURCES} -ts $${TS_FILE} && \ + mkdir -p translations && \ + [ \"$${OUT_PWD}\" != \"$${_PRO_FILE_PWD_}\" -a $$HAVE_TRANSLATIONS -eq 1 ] && \ + cp -af $${TRANSLATIONS_IN} $${OUT_PWD}/translations || : + +# create the qm files +qm.commands += ; [ $$HAVE_TRANSLATIONS -eq 1 ] && lrelease -nounfinished $${TRANSLATIONS_OUT} || : + +# special case: as TS_FILE serves as both source file as well as +# the English translation source, create the en qm file from it: +qm.files += $$replace(TS_FILE, \.ts, -en.qm) +qm.commands += lrelease -nounfinished $$TS_FILE -qm $$replace(TS_FILE, \.ts, -en.qm) + +INSTALLS += qm + +OTHER_FILES += $$TRANSLATIONS # This is needed to compile the DBus service screenmonitor-service.target = ScreenMonitor diff --git a/rpm/jolla-settings-screenmonitor.changes b/rpm/jolla-settings-screenmonitor.changes index eeb33f9..5a2ceb1 100644 --- a/rpm/jolla-settings-screenmonitor.changes +++ b/rpm/jolla-settings-screenmonitor.changes @@ -8,6 +8,20 @@ # * date Author's Name version-release # - Summary of changes +* Sat May 04 2024 NSC IT Solutions (NIS) 1.0.8-1 +- Add Swedish translation (thanks to https://github.com/eson57 ) + +* Thu Apr 04 2024 NSC IT Solutions (NIS) 1.0.7-1 +- Fix Icon size (thanks to https://github.com/carmenfdezb ) +- Add Spanish translation (thanks to https://github.com/carmenfdezb ) +- Add German translation + +* Fri Mar 29 2024 NSC IT Solutions (NIS) 1.0.6-1 +- Fix the build for aarch64 on modern SailfishOS-versions: +- Changed call to systemd to new path +- Fixed inclusion of systemd-service in RPM packaging + + * Sun Jun 14 2020 Juanro49 1.0.4-1 - jolla-settings-screenmonitor.qml: Fix show percentages in DetailItems - jolla-settings-screenmonitor.yaml: Add nemo-qml-plugin-contextkit-qt5 dependency to fix compatibility with Sailfish OS 3.0.3 (Rokua)+ diff --git a/rpm/jolla-settings-screenmonitor.spec b/rpm/jolla-settings-screenmonitor.spec index 9a910a7..f8c30d8 100644 --- a/rpm/jolla-settings-screenmonitor.spec +++ b/rpm/jolla-settings-screenmonitor.spec @@ -1,6 +1,6 @@ # # Do NOT Edit the Auto-generated Part! -# Generated by: spectacle version 0.27 +# Generated by: spectacle version 0.32 # Name: jolla-settings-screenmonitor @@ -13,7 +13,7 @@ Name: jolla-settings-screenmonitor %{!?qtc_make:%define qtc_make make} %{?qtc_builddir:%define _builddir %qtc_builddir} Summary: jolla-settings-screenmonitor -Version: 1.0.4 +Version: 1.0.8 Release: 1 Group: Applications/System License: GPL2 @@ -61,20 +61,21 @@ rm -rf %{buildroot} %preun # >> preun -/bin/systemctl disable ScreenMonitor.service +/usr/bin/systemctl disable ScreenMonitor.service # << preun %post # >> post -/bin/systemctl enable ScreenMonitor.service +/usr/bin/systemctl enable ScreenMonitor.service # << post %files %defattr(-,root,root,-) -%{_bindir} +%{_bindir}/ScreenMonitor %{_sysconfdir}/dbus-1 %{_datadir}/dbus-1 %{_datadir}/jolla-settings -/lib/systemd/system +%{_datadir}/translations/%{name}-*.qm +%{_unitdir}/ScreenMonitor.service # >> files # << files diff --git a/rpm/jolla-settings-screenmonitor.yaml b/rpm/jolla-settings-screenmonitor.yaml index 01e1b1f..fa34bc8 100644 --- a/rpm/jolla-settings-screenmonitor.yaml +++ b/rpm/jolla-settings-screenmonitor.yaml @@ -1,6 +1,6 @@ Name: jolla-settings-screenmonitor Summary: jolla-settings-screenmonitor -Version: 1.0.4 +Version: 1.0.8 Release: 1 # The contents of the Group field should be one of the groups listed here: # http://gitorious.org/meego-developer-tools/spectacle/blobs/master/data/GROUPS @@ -38,11 +38,12 @@ Requires: # All installed files Files: - - '%{_bindir}' + - '%{_bindir}/ScreenMonitor' - '%{_sysconfdir}/dbus-1' - '%{_datadir}/dbus-1' - '%{_datadir}/jolla-settings' - - '/lib/systemd/system' + - '%{_datadir}/translations/%{name}-*.qm' + - '%{_unitdir}/ScreenMonitor.service' # 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/settings/icon.png b/settings/icon.png index 6829880..09a6d69 100644 Binary files a/settings/icon.png and b/settings/icon.png differ diff --git a/settings/jolla-settings-screenmonitor.qml b/settings/jolla-settings-screenmonitor.qml index e8fe659..c82b2e7 100644 --- a/settings/jolla-settings-screenmonitor.qml +++ b/settings/jolla-settings-screenmonitor.qml @@ -160,7 +160,7 @@ Page { font.pixelSize: Theme.fontSizeHuge horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignVCenter - text: qsTrId("%1%").arg(percentage) + text: qsTrId("%1%").arg(percentage) } } @@ -186,13 +186,13 @@ Page { DetailItem { width: parent.width label: qsTr("Battery") - value: qsTrId("%1%").arg(batteryPercentage.value) + value: qsTrId("%1%").arg(batteryPercentage.value) } DetailItem { width: parent.width label: qsTr("Brightness") - value: qsTrId("%1%").arg(brightness) + value: qsTrId("%1%").arg(brightness) } } diff --git a/settings/screenmonitor.json b/settings/screenmonitor.json index fda6d06..d921d2f 100644 --- a/settings/screenmonitor.json +++ b/settings/screenmonitor.json @@ -1,5 +1,5 @@ { - "translation_catalog": "settings-system", + "translation_catalog": "jolla-settings-screenmonitor", "entries": [ { "path": "system_settings/info", @@ -9,7 +9,7 @@ "order": 600 }, { - "path": "system_settings/info/screenmonitor", + "path": "system_settings/info/screenmonitor", "title": "Screen usage", "translation_id": "settings_system-screenmonitor", "type": "page", diff --git a/translations/jolla-settings-screenmonitor-de.ts b/translations/jolla-settings-screenmonitor-de.ts new file mode 100644 index 0000000..a3189ea --- /dev/null +++ b/translations/jolla-settings-screenmonitor-de.ts @@ -0,0 +1,70 @@ + + + + + + + + + + + + jolla-settings-screenmonitor + + No data + Keine Daten + + + Since last reset + Seit dem letzten Zurücksetzen + + + Since the phone start-up + Seit dem Starten des Geräts + + + Since the disconnection from the charger + Seit dem Trennen des Ladegeräts + + + %1 day, + %1 Tag, + + + %1 days, + %1 Tage, + + + %1 hour, + %1 Stunde, + + + %1 hours, + %1 Stunden, + + + %1 minute + %1 Minute, + + + %1 minutes + %1 Minuten + + + Reset + Zurücksetzen + + + Screen usage + Bildschirmnutzung + + + Battery + Akku + + + Brightness + Helligkeit + + + diff --git a/translations/jolla-settings-screenmonitor-es.ts b/translations/jolla-settings-screenmonitor-es.ts new file mode 100644 index 0000000..6ab16e1 --- /dev/null +++ b/translations/jolla-settings-screenmonitor-es.ts @@ -0,0 +1,70 @@ + + + + + + + + + + + + jolla-settings-screenmonitor + + No data + No hay datos + + + Since last reset + Desde el último reinicio + + + Since the phone start-up + Desde el arranque del teléfono + + + Since the disconnection from the charger + Desde la desconexión del cargador + + + %1 day, + %1 día, + + + %1 days, + %1 días, + + + %1 hour, + %1 hora, + + + %1 hours, + %1 horas, + + + %1 minute + %1 minuto + + + %1 minutes + %1 minutos + + + Reset + Reiniciar + + + Screen usage + Uso de pantalla + + + Battery + Batería + + + Brightness + Brillo + + + diff --git a/translations/jolla-settings-screenmonitor-sv.ts b/translations/jolla-settings-screenmonitor-sv.ts new file mode 100644 index 0000000..d2907b5 --- /dev/null +++ b/translations/jolla-settings-screenmonitor-sv.ts @@ -0,0 +1,70 @@ + + + + + + + + + + + + jolla-settings-screenmonitor + + No data + Ingen data + + + Since last reset + Sedan senaste återställning + + + Since the phone start-up + Sedan telefonens uppstart + + + Since the disconnection from the charger + Sedan bortkoppling från batteriladdare + + + %1 day, + %1 dag, + + + %1 days, + %1 dagar, + + + %1 hour, + %1 timma, + + + %1 hours, + %1 timmar, + + + %1 minute + %1 minut + + + %1 minutes + %1 minuter + + + Reset + Återställ + + + Screen usage + Skärmanvändning + + + Battery + Batteri + + + Brightness + Ljusstyrka + + + diff --git a/translations/jolla-settings-screenmonitor.ts b/translations/jolla-settings-screenmonitor.ts new file mode 100644 index 0000000..600d3f6 --- /dev/null +++ b/translations/jolla-settings-screenmonitor.ts @@ -0,0 +1,70 @@ + + + + + + + + + + + + jolla-settings-screenmonitor + + No data + + + + Since last reset + + + + Since the phone start-up + + + + Since the disconnection from the charger + + + + %1 day, + + + + %1 days, + + + + %1 hour, + + + + %1 hours, + + + + %1 minute + + + + %1 minutes + + + + Reset + + + + Screen usage + + + + Battery + + + + Brightness + + + +