diff --git a/build-aux/create-release.sh b/build-aux/create-release.sh index 9b54ed7..595f311 100644 --- a/build-aux/create-release.sh +++ b/build-aux/create-release.sh @@ -1,6 +1,7 @@ #!/bin/sh slug="flare" +url_slug="$slug" app_id="de.schmidhuberj.Flare" gitlab_project_id="37464215" @@ -42,7 +43,7 @@ echo "> Updating CHANGELOG.md." if ! grep -q "## \[$1\]" CHANGELOG.md; then sed -i "s/## \[Unreleased\]/## \[Unreleased\]\n\n## \[$1\] - $date/" CHANGELOG.md - sed -r -i "s|\[Unreleased\]: https://gitlab.com/schmiddi-on-mobile/$slug/-/compare/(.*)...master|\[Unreleased\]: https://gitlab.com/schmiddi-on-mobile/$slug/-/compare/$1...master\n[$1]: https://gitlab.com/schmiddi-on-mobile/$slug/-/compare/\1...$1|" CHANGELOG.md + sed -r -i "s|\[Unreleased\]: https://gitlab.com/schmiddi-on-mobile/$url_slug/-/compare/(.*)...master|\[Unreleased\]: https://gitlab.com/schmiddi-on-mobile/$url_slug/-/compare/$1...master\n[$1]: https://gitlab.com/schmiddi-on-mobile/$url_slug/-/compare/\1...$1|" CHANGELOG.md fi @@ -57,17 +58,11 @@ changelog_newline=$(echo $changelog) if ! grep -q "|\n \n \n $changelog_newline\n \n |" "data/$app_id.metainfo.xml.in.in" + sed -i "s||\n \n \n $changelog_newline\n \n |" "data/$app_id.metainfo.xml.in.in" fi -echo "> Updating about window." - -sed -i "s|release-notes: .*|release-notes: \"$changelog_newline\";|" data/resources/ui/about.blp.in - - - echo "> Running the application" if command -v run 2>&1 > /dev/null; then @@ -142,7 +137,7 @@ git push && git push --tags echo "> Waiting for CI to finish. This will take approximately 30 minutes. You will be notified once CI is finished." -until curl -I --fail "https://gitlab.com/api/v4/projects/${gitlab_project_id}/packages/generic/$slug/$1/$slug-$1.tar.xz" &> /dev/null; do +until curl -I --fail "https://gitlab.com/api/v4/projects/${gitlab_project_id}/packages/generic/$url_slug/$1/$slug-$1.tar.xz" &> /dev/null; do # Try again in 2 minutes sleep 120 done @@ -165,8 +160,8 @@ done echo "> Detected open Flatpak PR to monitor: $pr_number. Depending on the current Flathub buildbot usage, the build can take a long time to complete. You will be notified once the build succeeds." comments=$(curl "https://api.github.com/repos/flathub/$app_id/issues/$pr_number/comments" 2> /dev/null) -while ! echo "$comments" | grep "Build.*successful" &> /dev/null; do - if echo "$comments" | grep "Build.*failed" &> /dev/null; then +while ! echo "$comments" | grep "build.*succeeded" &> /dev/null; do + if echo "$comments" | grep "build.*failed" &> /dev/null; then notify-send "Flathub build failed" "Please resolve manually." echo "! Flathub build failed. Please resolve manually." exit 1 diff --git a/data/de.schmidhuberj.Flare.metainfo.xml.in.in b/data/de.schmidhuberj.Flare.metainfo.xml.in.in index 997d0ec..bed306c 100644 --- a/data/de.schmidhuberj.Flare.metainfo.xml.in.in +++ b/data/de.schmidhuberj.Flare.metainfo.xml.in.in @@ -38,22 +38,22 @@ - +

Fixed

  • Images as attachments being cut off in messages.
- +

Fixed

  • Some channel names not displaying in the header bar, for example due to an ascii heart.
  • Images sent not being downloadable for other people.
- +

Fixed

  • Ignore one more networking-related error.
  • Don't stop receiving messages after an error occurred when receiving a message.
- +

Fixed

    @@ -66,7 +66,7 @@
- +

Fixed

    @@ -74,7 +74,7 @@
- +

HOTFIX

    @@ -82,7 +82,7 @@
- +

Fixed

    @@ -94,7 +94,7 @@
- +

Security

    @@ -106,7 +106,7 @@
- +

HOTFIX

    @@ -114,7 +114,7 @@
- +

HOTFIX

    @@ -122,7 +122,7 @@
- +

Fixed

    @@ -130,7 +130,7 @@
- +

Chores

    @@ -138,7 +138,7 @@
- +

Changed

    @@ -152,7 +152,7 @@
- +

Chores

    @@ -162,7 +162,7 @@
- +

HOTFIX

    @@ -174,7 +174,7 @@
- +

Chores

    @@ -192,7 +192,7 @@
- +

HOTFIX

    @@ -211,7 +211,7 @@
- +

Fixes

    @@ -220,7 +220,7 @@
- +

Added

    @@ -239,7 +239,7 @@
- +

Added

    @@ -247,7 +247,7 @@
- +

HOTFIX

    @@ -267,7 +267,7 @@
- +

Added

    @@ -280,7 +280,7 @@
- +

Added

    @@ -301,7 +301,7 @@
- +

HOTFIX

    @@ -313,7 +313,7 @@
- +

Fixed

    @@ -325,7 +325,7 @@
- +

HOTFIX

    @@ -356,7 +356,7 @@
- +

Added

    @@ -376,7 +376,7 @@
- +

Added

    @@ -388,7 +388,7 @@
- +

HOTFIX

    @@ -400,7 +400,7 @@
- +

Added

    @@ -424,7 +424,7 @@
- +

Changed

    @@ -443,7 +443,7 @@
- +

Added

    @@ -459,7 +459,7 @@
- +

Added

    @@ -474,7 +474,7 @@
- +

Changed

    @@ -491,7 +491,7 @@
- +

Added

    @@ -504,7 +504,7 @@
- +

HOTFIX

    @@ -512,7 +512,7 @@
- +

BREAKING

    @@ -543,7 +543,7 @@
- +

Added

    @@ -556,7 +556,7 @@
- +

Fixed

    @@ -565,7 +565,7 @@
- +

Fixed

    @@ -575,7 +575,7 @@
- +

HOTFIX

    @@ -583,7 +583,7 @@
- +

Changed

    @@ -598,7 +598,7 @@
- +

HOTFIX:

    @@ -606,7 +606,7 @@
- +

Added:

    @@ -625,7 +625,7 @@
- +

Added:

    @@ -646,7 +646,7 @@
- +

Added:

    @@ -672,7 +672,7 @@
- +

Added:

    @@ -687,7 +687,7 @@
- +

Added:

    @@ -703,7 +703,7 @@
- +

Added:

    @@ -720,57 +720,57 @@
- +

Hotfix for crash without libsecret set up.

- +

Fix gschema not being installed.

- +

Implemented device name for linking, added support for video attachment, configurable lazy-load attachments, bug fixes.

- +

Hotfix for not beeing able to link and unlink the device.

- +

UI updates, more translations, bug fixing.

- +

Added ability to upload and download attachments, added ability to remove reply and attachments before sending, fixed some bugs mainly regarding reply messages.

- +

Fixed many bugs, including wrong association for messages to channels, wrongly displayed channel names as "Note to self" and a few crashes.

- +

Fix message receiving, sending attachments.

- +

Bug fixing, error handling, russian and german translation, small UI updates.

- +

Small UI changes, change of license.

- +

Initial Release.

diff --git a/data/meson.build b/data/meson.build index 70ebd7d..a39997e 100644 --- a/data/meson.build +++ b/data/meson.build @@ -1,5 +1,4 @@ subdir('icons') -subdir('resources') # Desktop file desktop_conf = configuration_data() @@ -66,3 +65,5 @@ install_data( # Compile schemas settings_schemas = [ '@0@.gschema.xml'.format(base_id) ] gnome.compile_schemas(depend_files: files(settings_schemas)) + +subdir('resources') diff --git a/data/resources/meson.build b/data/resources/meson.build index f80592b..7fc00b7 100644 --- a/data/resources/meson.build +++ b/data/resources/meson.build @@ -1,9 +1,6 @@ -subdir('ui') - # Blueprint blueprints = custom_target('blueprints', input: files( - 'ui/about.blp', 'ui/attachment.blp', 'ui/call_message_item.blp', 'ui/channel_messages.blp', @@ -41,11 +38,17 @@ blueprints = custom_target('blueprints', ) # Resources +resources_conf = configuration_data() +resources_conf.set('app-id', application_id) resources = gnome.compile_resources( 'resources', - 'resources.gresource.xml', + configure_file( + input: 'resources.gresource.xml.in', + output: '@BASENAME@', + configuration: resources_conf, + ), gresource_bundle: true, - install: false, + install: true, install_dir: pkgdatadir, - dependencies: blueprints, + dependencies: [ appdata, blueprints ], ) diff --git a/data/resources/resources.gresource.xml b/data/resources/resources.gresource.xml.in similarity index 98% rename from data/resources/resources.gresource.xml rename to data/resources/resources.gresource.xml.in index ae611dd..8604fe2 100644 --- a/data/resources/resources.gresource.xml +++ b/data/resources/resources.gresource.xml.in @@ -17,7 +17,6 @@ ui/preferences_window.ui ui/shortcuts.ui ui/text_entry.ui - ui/about.ui ui/dialog_unlink.ui ui/dialog_clear_messages.ui ui/call_message_item.ui @@ -41,6 +40,7 @@ style.css style-dark.css style-hc.css + @app-id@.metainfo.xml icons/scalable/status/view-more-horizontal-symbolic.svg icons/scalable/status/phonelink2-symbolic.svg diff --git a/data/resources/ui/about.blp.in b/data/resources/ui/about.blp.in deleted file mode 100644 index 64614dd..0000000 --- a/data/resources/ui/about.blp.in +++ /dev/null @@ -1,18 +0,0 @@ -using Gtk 4.0; -using Adw 1; - -Adw.AboutDialog about { - application-icon: "icon"; - application-name: "Flare"; - version: "@VERSION@"; - comments: "Chat with your friends on Signal"; - issue-url: "https://gitlab.com/schmiddi-on-mobile/flare/-/issues"; - support-url: "https://matrix.to/#/%23flare-signal:matrix.org"; - website: "https://mobile.schmidhuberj.de/flare"; - developer-name: "Julian Schmidhuber"; - translator-credits: _("translator-credits"); - // TODO: string[] is not supported by Blueprint, so artists need to be hardcoded - copyright: "© 2022 Julian Schmidhuber"; - license-type: agpl_3_0_only; - release-notes: "

Fixed

  • Images as attachments being cut off in messages.
"; -} diff --git a/data/resources/ui/meson.build b/data/resources/ui/meson.build deleted file mode 100644 index 7eb8d14..0000000 --- a/data/resources/ui/meson.build +++ /dev/null @@ -1,19 +0,0 @@ -global_conf = configuration_data() -global_conf.set('APP_ID', application_id) -global_conf.set('PKGDATADIR', pkgdatadir) -global_conf.set('PROFILE', profile) -global_conf.set('VERSION', version + version_suffix) -global_conf.set('GETTEXT_PACKAGE', gettext_package) -global_conf.set('LOCALEDIR', localedir) -global_conf.set('BUILD_DIR', meson.project_build_root()) -config = configure_file( - input: 'about.blp.in', - output: 'about.blp', - configuration: global_conf -) -run_command( - 'cp', - meson.project_build_root() / 'data' / 'resources' / 'ui' / 'about.blp', - meson.project_source_root() / 'data' / 'resources' / 'ui' / 'about.blp', - check: true -) diff --git a/src/gui/window.rs b/src/gui/window.rs index dc027c1..22b0878 100644 --- a/src/gui/window.rs +++ b/src/gui/window.rs @@ -75,10 +75,10 @@ impl Window { } pub mod imp { - use crate::prelude::*; + use crate::{config, prelude::*}; use std::{env, path::PathBuf}; - use adw::{AboutDialog, AlertDialog, EntryRow, ResponseAppearance}; + use adw::{AlertDialog, EntryRow, ResponseAppearance}; use gio::{Cancellable, Settings, SimpleAction, SimpleActionGroup}; use glib::subclass::InitializingObject; use glib::{BindingFlags, BoxedAnyObject, Propagation}; @@ -352,17 +352,24 @@ pub mod imp { log::trace!("Setting up about-page action"); let action_about = SimpleAction::new("about", None); action_about.connect_activate(clone!( - #[weak] + #[weak(rename_to = window)] obj, move |_, _| { - let builder = Builder::from_resource("/ui/about.ui"); - let about: AboutDialog = builder - .object("about") - .expect("about.ui to have at least one object about"); - // TODO: Replace this in Blueprint when string[] is supported - about.set_artists(&["David Lapshin "]); - about.add_link("GitLab", "https://gitlab.com/schmiddi-on-mobile/flare"); - about.present(Some(&obj)); + let about_dialog = adw::AboutDialog::from_appdata( + &(config::RESOURCES_PATH.to_owned() + config::APP_ID + ".metainfo.xml"), + Some(env!("CARGO_PKG_VERSION")), + ); + + about_dialog.set_comments(env!("CARGO_PKG_DESCRIPTION")); + about_dialog.set_developers( + &(env!("CARGO_PKG_AUTHORS").split(':').collect::>()), + ); + // translators: One per line: How you want to be credited as a, e.g. by the name you use, and optionally an email address ("Edgar Allan Poe ") + about_dialog.set_translator_credits(&gettextrs::gettext("translator-credits")); + about_dialog.set_artists(&["David Lapshin "]); + about_dialog.add_link("GitLab", "https://gitlab.com/schmiddi-on-mobile/flare"); + + about_dialog.present(Some(&window)); } ));