diff --git a/.github/workflows/flatpak.yml b/.github/workflows/flatpak.yml index e08dd64a..d9674a0b 100644 --- a/.github/workflows/flatpak.yml +++ b/.github/workflows/flatpak.yml @@ -1,42 +1,24 @@ name: Flatpak +on: + push: + branches: + - main + pull_request: -on: [push, pull_request] - -concurrency: +concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: flatpak: runs-on: ubuntu-latest - container: - image: bilelmoussaoui/flatpak-github-actions:gnome-43 + image: bilelmoussaoui/flatpak-github-actions:gnome-45 options: --privileged - - strategy: - matrix: - arch: [x86_64, aarch64] - # Don't fail the whole workflow if one architecture fails - fail-fast: false steps: - - uses: actions/checkout@v2 - - - name: Install deps - run: | - dnf -y install docker - if: ${{ matrix.arch == 'aarch64' }} - - - name: Set up QEMU - id: qemu - uses: docker/setup-qemu-action@v1 - with: - platforms: arm64 - if: ${{ matrix.arch == 'aarch64' }} - - - uses: bilelmoussaoui/flatpak-github-actions/flatpak-builder@v4 + - uses: actions/checkout@v4 + - uses: flatpak/flatpak-github-actions/flatpak-builder@v6.2 with: - bundle: dippi-${{ matrix.arch }}.flatpak + bundle: dippi.flatpak manifest-path: com.github.cassidyjames.dippi.json cache-key: "flatpak-builder-${{ github.sha }}" - arch: ${{ matrix.arch }} diff --git a/.github/workflows/gettext.yml b/.github/workflows/gettext.yml index 74cddfc4..5f622154 100644 --- a/.github/workflows/gettext.yml +++ b/.github/workflows/gettext.yml @@ -12,6 +12,10 @@ on: - 'po/POTFILES.in' - 'po/extra/LINGUAS' - 'po/extra/POTFILES.in' + - '.github/workflows/gettext.yml' + +permissions: + contents: write concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -19,34 +23,27 @@ concurrency: jobs: build: - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest + container: + image: fedora:39 steps: - - uses: actions/checkout@v2 - name: Install deps run: | - sudo apt-get update - sudo apt-get install -y \ - appstream \ - gettext\ + sudo dnf update -y + sudo dnf install -y \ + appstream-devel \ + gettext-devel \ git \ - libadwaita-1-dev \ - libgtk-4-dev \ - libxml2-utils \ + gtk4-devel \ + libadwaita-devel \ + libxml2-devel \ meson \ - policykit-1 \ - sudo \ - valac + vala - - name: Build libadwaita - run: | - git clone https://gitlab.gnome.org/GNOME/libadwaita.git /tmp/libadwaita - cd /tmp/libadwaita - git checkout 1.2.0 - meson . _build -Dexamples=false - ninja -C _build - sudo ninja -C _build install - cd - - rm -rf /tmp/libadwaita + - name: Checkout + uses: actions/checkout@v4 + with: + token: ${{ secrets.GITHUB_TOKEN }} - name: Build run: | @@ -56,20 +53,17 @@ jobs: - name: Regenerate translation files run: | - ninja -C _build $(git ls-files | grep \.pot$ | sed 's/.*\///' | sed 's/.pot/-update-po/') + ninja -C _build com.github.cassidyjames.dippi-pot + ninja -C _build com.github.cassidyjames.dippi-update-po - - name: Commit & push + - name: Commit continue-on-error: true run: | - echo "Configuring git credentials…" - git remote set-url origin https://x-access-token:"$GITHUB_TOKEN"@github.com/"$GITHUB_REPOSITORY".git - git config --local user.email "actions@github.com" - git config --local user.name "GitHub Actions" - - echo "Committing…" - git checkout main - git add . - git commit --message "Update translation files" - - echo "Pushing…" - git push --set-upstream origin main || true + # FILES_CHANGED=$(git diff --name-only | wc -l) + # if [[ $FILES_CHANGED != 0 ]]; then + git config --global --add safe.directory "$GITHUB_WORKSPACE" + git config --global user.email "actions@github.com" + git config --global user.name "GitHub Actions" + git commit -am "Update translation files" + git push + # fi diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 0eb7e4ea..3e53e282 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -16,7 +16,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Lint run: io.elementary.vala-lint -d . diff --git a/build-aux/meson/post_install.py b/build-aux/meson/post_install.py deleted file mode 100644 index 141e1aef..00000000 --- a/build-aux/meson/post_install.py +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/env python3 - -import os -import subprocess - -prefix = os.environ.get('MESON_INSTALL_PREFIX', '/usr/local') -datadir = os.path.join(prefix, 'share') -schemadir = os.path.join(os.environ['MESON_INSTALL_PREFIX'], 'share', 'glib-2.0', 'schemas') - -# Packaging tools define DESTDIR and this isn't needed for them -if 'DESTDIR' not in os.environ: - print('Updating icon cache...') - icon_cache_dir = os.path.join(datadir, 'icons', 'hicolor') - if not os.path.exists(icon_cache_dir): - os.makedirs(icon_cache_dir) - subprocess.call(['gtk-update-icon-cache', '-qtf', icon_cache_dir]) - - print('Updating desktop database...') - desktop_database_dir = os.path.join(datadir, 'applications') - if not os.path.exists(desktop_database_dir): - os.makedirs(desktop_database_dir) - subprocess.call(['update-desktop-database', '-q', desktop_database_dir]) - - print('Compiling gsettings schemas...') - subprocess.call(['glib-compile-schemas', schemadir]) diff --git a/com.github.cassidyjames.dippi.json b/com.github.cassidyjames.dippi.json index 2698d672..d866ce20 100644 --- a/com.github.cassidyjames.dippi.json +++ b/com.github.cassidyjames.dippi.json @@ -1,7 +1,7 @@ { "app-id": "com.github.cassidyjames.dippi", "runtime" : "org.gnome.Platform", - "runtime-version": "44", + "runtime-version": "45", "sdk": "org.gnome.Sdk", "command": "com.github.cassidyjames.dippi", "finish-args": [ diff --git a/data/gresource.xml b/data/gresource.xml index d35e1e0b..7e4f8bff 100644 --- a/data/gresource.xml +++ b/data/gresource.xml @@ -1,8 +1,9 @@ - - style.css - style-dark.css + + metainfo.appdata.xml.in + styles/style.css + styles/dark.css icons/com.github.cassidyjames.dippi.svg diff --git a/data/meson.build b/data/meson.build index 75fa51a1..40150b79 100644 --- a/data/meson.build +++ b/data/meson.build @@ -11,7 +11,7 @@ install_data( i18n.merge_file( input: 'launcher.desktop.in', output: meson.project_name() + '.desktop', - po_dir: meson.source_root() / 'po' / 'extra', + po_dir: meson.project_source_root() / 'po' / 'extra', type: 'desktop', install: true, install_dir: get_option('datadir') / 'applications' @@ -20,7 +20,7 @@ i18n.merge_file( i18n.merge_file( input: 'metainfo.appdata.xml.in', output: meson.project_name() + '.metainfo.xml', - po_dir: meson.source_root() / 'po' / 'extra', + po_dir: meson.project_source_root() / 'po' / 'extra', type: 'xml', install: true, install_dir: get_option('datadir') / 'metainfo' @@ -34,12 +34,3 @@ if desktop_file_validate.found() args: meson.current_build_dir () / meson.project_name() + '.desktop' ) endif - -# appstreamcli = find_program(['appstreamcli', 'appstream-util'], required:false) -# if appstreamcli.found() -# test ( -# 'Validate appdata file', -# appstreamcli, -# args: ['validate', meson.current_build_dir () / meson.project_name() + '.appdata.xml'] -# ) -# endif diff --git a/data/metainfo.appdata.xml.in b/data/metainfo.appdata.xml.in index 9da952ec..9e1d031f 100644 --- a/data/metainfo.appdata.xml.in +++ b/data/metainfo.appdata.xml.in @@ -35,6 +35,15 @@ com.github.cassidyjames.dippi + + +

GNOME 45 and crash fix

+
+ + Crash when typing zero into pixel-size field + Titles wrap with GNOME 45 + +

Translations and GNOME 44

@@ -310,35 +319,35 @@
- https://raw.githubusercontent.com/cassidyjames/dippi/master/data/screenshots/default.png + https://raw.githubusercontent.com/cassidyjames/dippi/4.0.6/data/screenshots/default.png - https://raw.githubusercontent.com/cassidyjames/dippi/master/data/screenshots/default-dark.png + https://raw.githubusercontent.com/cassidyjames/dippi/4.0.6/data/screenshots/default-dark.png - https://raw.githubusercontent.com/cassidyjames/dippi/master/data/screenshots/hidpi.png + https://raw.githubusercontent.com/cassidyjames/dippi/4.0.6/data/screenshots/hidpi.png - https://raw.githubusercontent.com/cassidyjames/dippi/master/data/screenshots/hidpi-dark.png + https://raw.githubusercontent.com/cassidyjames/dippi/4.0.6/data/screenshots/hidpi-dark.png - https://raw.githubusercontent.com/cassidyjames/dippi/master/data/screenshots/problematic.png + https://raw.githubusercontent.com/cassidyjames/dippi/4.0.6/data/screenshots/problematic.png - https://raw.githubusercontent.com/cassidyjames/dippi/master/data/screenshots/problematic-dark.png + https://raw.githubusercontent.com/cassidyjames/dippi/4.0.6/data/screenshots/problematic-dark.png - https://raw.githubusercontent.com/cassidyjames/dippi/master/data/screenshots/lodpi.png + https://raw.githubusercontent.com/cassidyjames/dippi/4.0.6/data/screenshots/lodpi.png - https://raw.githubusercontent.com/cassidyjames/dippi/master/data/screenshots/lodpi-dark.png + https://raw.githubusercontent.com/cassidyjames/dippi/4.0.6/data/screenshots/lodpi-dark.png Cassidy James Blaede https://cassidyjames.com/dippi https://github.com/cassidyjames/dippi/issues - https://github.com/cassidyjames/dippi/tree/master/po#readme + https://github.com/cassidyjames/dippi/tree/main/po#readme https://cassidyjames.com/pay https://cassidyjames.com/support diff --git a/data/style-dark.css b/data/styles/dark.css similarity index 100% rename from data/style-dark.css rename to data/styles/dark.css diff --git a/data/style.css b/data/styles/style.css similarity index 100% rename from data/style.css rename to data/styles/style.css diff --git a/meson.build b/meson.build index c99a22f7..aeba9a66 100644 --- a/meson.build +++ b/meson.build @@ -1,7 +1,8 @@ project( 'com.github.cassidyjames.dippi', 'vala', 'c', - version: '4.0.5' + version: '4.0.6', + meson_version: '>=0.58', ) gnome = import('gnome') @@ -34,14 +35,11 @@ executable( asresources, config_file, dependencies: [ - dependency('glib-2.0'), dependency('gtk4'), - dependency('libadwaita-1'), + dependency('libadwaita-1', version: '>=1.4'), meson.get_compiler('c').find_library('m', required : false) ], install: true ) subdir('data') subdir('po') - -meson.add_install_script('build-aux' / 'meson'/ 'post_install.py') diff --git a/po/extra/meson.build b/po/extra/meson.build index c609b472..97fca5c8 100644 --- a/po/extra/meson.build +++ b/po/extra/meson.build @@ -1,6 +1,6 @@ i18n.gettext('extra', args: [ - '--directory=' + meson.source_root(), + '--directory=' + meson.project_source_root(), '--from-code=UTF-8' ], preset: 'glib', diff --git a/po/meson.build b/po/meson.build index e2c9b353..c70a95f8 100644 --- a/po/meson.build +++ b/po/meson.build @@ -1,6 +1,6 @@ i18n.gettext(meson.project_name(), args: [ - '--directory=' + meson.source_root(), + '--directory=' + meson.project_source_root(), '--from-code=UTF-8' ] ) diff --git a/src/App.vala b/src/App.vala index f809a7ae..a978156e 100644 --- a/src/App.vala +++ b/src/App.vala @@ -4,11 +4,6 @@ */ public class Dippi.App : Adw.Application { - public const string NAME = "Dippi"; - public const string DEVELOPER = "Cassidy James Blaede"; - public const string EMAIL = "c@ssidyjam.es"; - public const string URL = "https://cassidyjames.com"; - public App () { Object ( application_id: APP_ID, @@ -29,7 +24,6 @@ public class Dippi.App : Adw.Application { "W", }); - quit_action.activate.connect (() => { if (app_window != null) { app_window.destroy (); diff --git a/src/MainWindow.vala b/src/MainWindow.vala index 90327b6f..2b837c3b 100644 --- a/src/MainWindow.vala +++ b/src/MainWindow.vala @@ -41,9 +41,7 @@ public class Dippi.MainWindow : Adw.ApplicationWindow { public MainWindow (Gtk.Application application) { Object ( application: application, - icon_name: APP_ID, - resizable: false, - title: App.NAME + resizable: false ); } @@ -53,33 +51,40 @@ public class Dippi.MainWindow : Adw.ApplicationWindow { }; about_button.add_css_class ("dim-label"); - var about_window = new Adw.AboutWindow () { + var about_window = new Adw.AboutWindow.from_appdata ( + "/com/github/cassidyjames/dippi/metainfo.xml", VERSION + ) { transient_for = this, hide_on_close = true, - application_icon = APP_ID, - application_name = App.NAME, - developer_name = App.DEVELOPER, - version = VERSION, - comments = _("Input a few simple details and figure out the aspect ratio, DPI, and other details of a particular display. Great for deciding which laptop or external monitor to purchase, and if it would be considered HiDPI."), - - website = "https://cassidyjames.com/dippi", - issue_url = "https://github.com/cassidyjames/dippi/issues", - - // Credits - developers = { "%s <%s>".printf (App.DEVELOPER, App.EMAIL) }, - designers = { "%s %s".printf (App.DEVELOPER, App.URL) }, artists = { "Micah Ilbery https://micahilbery.com", }, /// The translator credits. Please translate this with your name(s). translator_credits = _("translator-credits"), - - // Legal - copyright = "Copyright © 2018–2023 %s".printf (App.DEVELOPER), - license_type = Gtk.License.GPL_3_0, }; + about_window.developers = { + "%s %s".printf ( + about_window.developer_name, + about_window.website + ), + }; + about_window.designers = { + "%s %s".printf ( + about_window.developer_name, + about_window.website + ), + }; + about_window.copyright = "© 2018–%i %s".printf ( + new DateTime.now_local ().get_year (), + about_window.developer_name + ); + + // Set MainWindow properties from the AppData already fetched and parsed + // by the AboutWindow construction + this.icon_name = about_window.application_icon; + this.title = about_window.application_name; var header = new Adw.HeaderBar () { title_widget = new Gtk.Label (null) @@ -561,7 +566,7 @@ public class Dippi.MainWindow : Adw.ApplicationWindow { var title_label = new Gtk.Label (title) { halign = Gtk.Align.START, valign = Gtk.Align.END, - wrap = true, + wrap = false, }; title_label.add_css_class ("title-1"); title_label.add_css_class (style_class);