Skip to content

Commit

Permalink
feat: about window from appdata
Browse files Browse the repository at this point in the history
  • Loading branch information
bragefuglseth committed Sep 17, 2023
1 parent f67f47a commit 5329341
Show file tree
Hide file tree
Showing 51 changed files with 93 additions and 107 deletions.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
93 changes: 47 additions & 46 deletions src/fretboard.gresource.xml → data/fretboard.gresource.xml.in
Original file line number Diff line number Diff line change
@@ -1,58 +1,59 @@
<?xml version="1.0" encoding="UTF-8"?>
<gresources>
<gresource prefix="/dev/bragefuglseth/Fretboard/icons/scalable/actions/">
<file preprocess="xml-stripblanks" alias="dot-symbolic.svg">ui/icons/dot-symbolic.svg</file>
<file preprocess="xml-stripblanks" alias="circle-outline-thick-symbolic.svg">ui/icons/circle-outline-thick-symbolic.svg</file>
<file preprocess="xml-stripblanks" alias="cross-large-symbolic.svg">ui/icons/cross-large-symbolic.svg</file>
<file preprocess="xml-stripblanks" alias="up-large-symbolic.svg">ui/icons/up-large-symbolic.svg</file>
<file preprocess="xml-stripblanks" alias="down-large-symbolic.svg">ui/icons/down-large-symbolic.svg</file>
<file preprocess="xml-stripblanks" alias="checkmark-large-symbolic.svg">ui/icons/checkmark-large-symbolic.svg</file>
<file preprocess="xml-stripblanks" alias="library-symbolic.svg">ui/icons/library-symbolic.svg</file>
<file preprocess="xml-stripblanks" alias="star-outline-rounded-symbolic.svg">ui/icons/star-outline-rounded-symbolic.svg</file>
<file preprocess="xml-stripblanks" alias="star-large-symbolic.svg">ui/icons/star-large-symbolic.svg</file>
<file preprocess="xml-stripblanks" alias="dot-symbolic.svg">icons/dot-symbolic.svg</file>
<file preprocess="xml-stripblanks" alias="circle-outline-thick-symbolic.svg">icons/circle-outline-thick-symbolic.svg</file>
<file preprocess="xml-stripblanks" alias="cross-large-symbolic.svg">icons/cross-large-symbolic.svg</file>
<file preprocess="xml-stripblanks" alias="up-large-symbolic.svg">icons/up-large-symbolic.svg</file>
<file preprocess="xml-stripblanks" alias="down-large-symbolic.svg">icons/down-large-symbolic.svg</file>
<file preprocess="xml-stripblanks" alias="checkmark-large-symbolic.svg">icons/checkmark-large-symbolic.svg</file>
<file preprocess="xml-stripblanks" alias="library-symbolic.svg">icons/library-symbolic.svg</file>
<file preprocess="xml-stripblanks" alias="star-outline-rounded-symbolic.svg">icons/star-outline-rounded-symbolic.svg</file>
<file preprocess="xml-stripblanks" alias="star-large-symbolic.svg">icons/star-large-symbolic.svg</file>
</gresource>

<gresource prefix="/dev/bragefuglseth/Fretboard">
<file preprocess="xml-stripblanks" alias="window.ui">ui/window.ui</file>
<file preprocess="xml-stripblanks" alias="chord-diagram.ui">ui/chord-diagram.ui</file>
<file preprocess="xml-stripblanks" alias="chord-diagram-toggle.ui">ui/chord-diagram-toggle.ui</file>
<file preprocess="xml-stripblanks" alias="chord-diagram-top-toggle.ui">ui/chord-diagram-top-toggle.ui</file>
<file preprocess="xml-stripblanks" alias="barre-spin.ui">ui/barre-spin.ui</file>
<file preprocess="xml-stripblanks" alias="chord-name-entry.ui">ui/chord-name-entry.ui</file>
<file preprocess="xml-stripblanks" alias="chord-preview.ui">ui/chord-preview.ui</file>
<file preprocess="xml-stripblanks" alias="gtk/help-overlay.ui">ui/help-overlay.ui</file>
<file alias="metainfo.xml" preprocess="xml-stripblanks">@[email protected]</file>
<file compressed="true">chords.txt</file>

<file alias="style.css">ui/style.css</file>
<file alias="style-dark.css">ui/style-dark.css</file>
<file alias="style-hc.css">ui/style-hc.css</file>
<file alias="style-hc-dark.css">ui/style-hc-dark.css</file>
<file preprocess="xml-stripblanks" alias="window.ui">gtk/window.ui</file>
<file preprocess="xml-stripblanks" alias="chord-diagram.ui">gtk/chord-diagram.ui</file>
<file preprocess="xml-stripblanks" alias="chord-diagram-toggle.ui">gtk/chord-diagram-toggle.ui</file>
<file preprocess="xml-stripblanks" alias="chord-diagram-top-toggle.ui">gtk/chord-diagram-top-toggle.ui</file>
<file preprocess="xml-stripblanks" alias="barre-spin.ui">gtk/barre-spin.ui</file>
<file preprocess="xml-stripblanks" alias="chord-name-entry.ui">gtk/chord-name-entry.ui</file>
<file preprocess="xml-stripblanks" alias="chord-preview.ui">gtk/chord-preview.ui</file>
<file preprocess="xml-stripblanks" alias="gtk/help-overlay.ui">gtk/help-overlay.ui</file>

<file preprocess="xml-stripblanks" alias="chord-diagram-backdrop-light.svg">ui/assets/chord-diagram-backdrop-light.svg</file>
<file preprocess="xml-stripblanks" alias="chord-diagram-backdrop-dark.svg">ui/assets/chord-diagram-backdrop-dark.svg</file>
<file preprocess="xml-stripblanks" alias="barre-2-light.svg">ui/assets/barre-2-light.svg</file>
<file preprocess="xml-stripblanks" alias="barre-3-light.svg">ui/assets/barre-3-light.svg</file>
<file preprocess="xml-stripblanks" alias="barre-4-light.svg">ui/assets/barre-4-light.svg</file>
<file preprocess="xml-stripblanks" alias="barre-5-light.svg">ui/assets/barre-5-light.svg</file>
<file preprocess="xml-stripblanks" alias="barre-6-light.svg">ui/assets/barre-6-light.svg</file>
<file preprocess="xml-stripblanks" alias="barre-2-dark.svg">ui/assets/barre-2-dark.svg</file>
<file preprocess="xml-stripblanks" alias="barre-3-dark.svg">ui/assets/barre-3-dark.svg</file>
<file preprocess="xml-stripblanks" alias="barre-4-dark.svg">ui/assets/barre-4-dark.svg</file>
<file preprocess="xml-stripblanks" alias="barre-5-dark.svg">ui/assets/barre-5-dark.svg</file>
<file preprocess="xml-stripblanks" alias="barre-6-dark.svg">ui/assets/barre-6-dark.svg</file>
<file alias="style.css">gtk/style.css</file>
<file alias="style-dark.css">gtk/style-dark.css</file>
<file alias="style-hc.css">gtk/style-hc.css</file>
<file alias="style-hc-dark.css">gtk/style-hc-dark.css</file>

<file preprocess="xml-stripblanks" alias="chord-preview-backdrop-light.svg">ui/assets/chord-preview-backdrop-light.svg</file>
<file preprocess="xml-stripblanks" alias="chord-preview-backdrop-dark.svg">ui/assets/chord-preview-backdrop-dark.svg</file>
<file preprocess="xml-stripblanks" alias="prv-barre-2-light.svg">ui/assets/prv-barre-2-light.svg</file>
<file preprocess="xml-stripblanks" alias="prv-barre-3-light.svg">ui/assets/prv-barre-3-light.svg</file>
<file preprocess="xml-stripblanks" alias="prv-barre-4-light.svg">ui/assets/prv-barre-4-light.svg</file>
<file preprocess="xml-stripblanks" alias="prv-barre-5-light.svg">ui/assets/prv-barre-5-light.svg</file>
<file preprocess="xml-stripblanks" alias="prv-barre-6-light.svg">ui/assets/prv-barre-6-light.svg</file>
<file preprocess="xml-stripblanks" alias="prv-barre-2-dark.svg">ui/assets/prv-barre-2-dark.svg</file>
<file preprocess="xml-stripblanks" alias="prv-barre-3-dark.svg">ui/assets/prv-barre-3-dark.svg</file>
<file preprocess="xml-stripblanks" alias="prv-barre-4-dark.svg">ui/assets/prv-barre-4-dark.svg</file>
<file preprocess="xml-stripblanks" alias="prv-barre-5-dark.svg">ui/assets/prv-barre-5-dark.svg</file>
<file preprocess="xml-stripblanks" alias="prv-barre-6-dark.svg">ui/assets/prv-barre-6-dark.svg</file>
<file preprocess="xml-stripblanks" alias="chord-diagram-backdrop-light.svg">assets/chord-diagram-backdrop-light.svg</file>
<file preprocess="xml-stripblanks" alias="chord-diagram-backdrop-dark.svg">assets/chord-diagram-backdrop-dark.svg</file>
<file preprocess="xml-stripblanks" alias="barre-2-light.svg">assets/barre-2-light.svg</file>
<file preprocess="xml-stripblanks" alias="barre-3-light.svg">assets/barre-3-light.svg</file>
<file preprocess="xml-stripblanks" alias="barre-4-light.svg">assets/barre-4-light.svg</file>
<file preprocess="xml-stripblanks" alias="barre-5-light.svg">assets/barre-5-light.svg</file>
<file preprocess="xml-stripblanks" alias="barre-6-light.svg">assets/barre-6-light.svg</file>
<file preprocess="xml-stripblanks" alias="barre-2-dark.svg">assets/barre-2-dark.svg</file>
<file preprocess="xml-stripblanks" alias="barre-3-dark.svg">assets/barre-3-dark.svg</file>
<file preprocess="xml-stripblanks" alias="barre-4-dark.svg">assets/barre-4-dark.svg</file>
<file preprocess="xml-stripblanks" alias="barre-5-dark.svg">assets/barre-5-dark.svg</file>
<file preprocess="xml-stripblanks" alias="barre-6-dark.svg">assets/barre-6-dark.svg</file>

<file compressed="true">chords.txt</file>
<file preprocess="xml-stripblanks" alias="chord-preview-backdrop-light.svg">assets/chord-preview-backdrop-light.svg</file>
<file preprocess="xml-stripblanks" alias="chord-preview-backdrop-dark.svg">assets/chord-preview-backdrop-dark.svg</file>
<file preprocess="xml-stripblanks" alias="prv-barre-2-light.svg">assets/prv-barre-2-light.svg</file>
<file preprocess="xml-stripblanks" alias="prv-barre-3-light.svg">assets/prv-barre-3-light.svg</file>
<file preprocess="xml-stripblanks" alias="prv-barre-4-light.svg">assets/prv-barre-4-light.svg</file>
<file preprocess="xml-stripblanks" alias="prv-barre-5-light.svg">assets/prv-barre-5-light.svg</file>
<file preprocess="xml-stripblanks" alias="prv-barre-6-light.svg">assets/prv-barre-6-light.svg</file>
<file preprocess="xml-stripblanks" alias="prv-barre-2-dark.svg">assets/prv-barre-2-dark.svg</file>
<file preprocess="xml-stripblanks" alias="prv-barre-3-dark.svg">assets/prv-barre-3-dark.svg</file>
<file preprocess="xml-stripblanks" alias="prv-barre-4-dark.svg">assets/prv-barre-4-dark.svg</file>
<file preprocess="xml-stripblanks" alias="prv-barre-5-dark.svg">assets/prv-barre-5-dark.svg</file>
<file preprocess="xml-stripblanks" alias="prv-barre-6-dark.svg">assets/prv-barre-6-dark.svg</file>
</gresource>
</gresources>
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
33 changes: 32 additions & 1 deletion data/meson.build
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
gnome = import('gnome')

blueprints = custom_target('blueprints',
input: files(
'gtk/chord-diagram-toggle.blp',
'gtk/chord-diagram-top-toggle.blp',
'gtk/barre-spin.blp',
'gtk/chord-diagram.blp',
'gtk/chord-name-entry.blp',
'gtk/chord-preview.blp',
'gtk/window.blp',
'gtk/help-overlay.blp',
),
output: '.',
command: [find_program('blueprint-compiler'), 'batch-compile', '@OUTPUT@', '@CURRENT_SOURCE_DIR@', '@INPUT@'],
)

desktop_conf = configuration_data()
desktop_conf.set('icon', application_id)
desktop_file = i18n.merge_file(
Expand Down Expand Up @@ -35,7 +52,21 @@ appstream_file = i18n.merge_file(

appstreamcli = find_program('appstreamcli', required: false, disabler: true)
test('Validate appstream file', appstreamcli,
args: ['validate', '--no-net', '--explain', appstream_file])
args: ['validate', '--no-net', '--explain', appstream_file])

resources_conf = configuration_data()
resources_conf.set('app-id', application_id)
gnome.compile_resources('fretboard',
configure_file(
input: '@[email protected]'.format(meson.project_name()),
output: '@BASENAME@',
configuration: resources_conf
),
gresource_bundle: true,
install: true,
install_dir: pkgdatadir,
dependencies: blueprints,
)

install_data('dev.bragefuglseth.Fretboard.gschema.xml',
install_dir: datadir / 'glib-2.0/schemas'
Expand Down
7 changes: 0 additions & 7 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,9 @@ gettext_package = meson.project_name()

if get_option('profile') == 'development'
profile = 'Devel'
vcs_tag = run_command('git', 'rev-parse', '--short', 'HEAD', check: false).stdout().strip()
if vcs_tag == ''
version_suffix = '-devel'
else
version_suffix = '-@0@'.format(vcs_tag)
endif
application_id = '@0@.@1@'.format(base_id, profile)
else
profile = ''
version_suffix = ''
application_id = base_id
endif

Expand Down
40 changes: 13 additions & 27 deletions src/application.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
*/

use crate::{
config::{APP_ID, VERSION},
config::VERSION,
FretboardWindow,
};
use adw::subclass::prelude::*;
Expand Down Expand Up @@ -108,31 +108,17 @@ impl FretboardApplication {

fn show_about(&self) {
let window = self.active_window().unwrap();
adw::AboutWindow::builder()
.transient_for(&window)
.application_name("Fretboard")
.application_icon(APP_ID)
.developer_name("Brage Fuglseth")
.version(VERSION)
.developers(["Brage Fuglseth https://bragefuglseth.dev"])
.website("https://github.com/bragefuglseth/fretboard")
.issue_url("https://github.com/bragefuglseth/fretboard/issues")
.license_type(gtk::License::Gpl30)
.copyright("© 2023 Brage Fuglseth")
// Translators: Replace "translator-credits" with your names, one name per line
.translator_credits(&gettext("translator-credits"))
.release_notes(&gettext("
<p>This major release of Fretboard brings a bunch of exciting improvements:</p>
<ul>
<li>View different ways to play the same chord, to find the one that suits your situation the best</li>
<li>Bookmark chords to save them for a later practice session or gig</li>
<li>An additional fret in the chord diagram, to help you practice those really tricky positionings</li>
<li>Hover over positions in the chord diagram to see their respective note names</li>
<li>Smarter and more precise chord detection</li>
</ul>
<p>If you would like to come with suggestions, report bugs, translate the app, or contribute otherwise, feel free to reach out!</p>
"))
.build()
.present()
let about = adw::AboutWindow::from_appdata(
"/dev/bragefuglseth/Fretboard/metainfo.xml",
Some(VERSION)
);

about.set_developers(&["Brage Fuglseth"]);
about.set_copyright("© 2023 Brage Fuglseth");
// Translators: Replace "translator-credits" with your names, one name per line
about.set_translator_credits(&gettext("translator-credits"));

about.set_transient_for(Some(&window));
about.present();
}
}
27 changes: 1 addition & 26 deletions src/meson.build
Original file line number Diff line number Diff line change
@@ -1,31 +1,6 @@
gnome = import('gnome')

blueprints = custom_target('blueprints',
input: files(
'ui/chord-diagram-toggle.blp',
'ui/chord-diagram-top-toggle.blp',
'ui/barre-spin.blp',
'ui/chord-diagram.blp',
'ui/chord-name-entry.blp',
'ui/chord-preview.blp',
'ui/window.blp',
'ui/help-overlay.blp',
),
output: '.',
command: [find_program('blueprint-compiler'), 'batch-compile', '@OUTPUT@', '@CURRENT_SOURCE_DIR@', '@INPUT@'],
)

gnome.compile_resources('fretboard',
'fretboard.gresource.xml',
gresource_bundle: true,
install: true,
install_dir: pkgdatadir,
dependencies: blueprints,
)

conf = configuration_data()
conf.set_quoted('APP_ID', application_id)
conf.set_quoted('VERSION', version + version_suffix)
conf.set_quoted('VERSION', version)
conf.set_quoted('GETTEXT_PACKAGE', gettext_package)
conf.set_quoted('LOCALEDIR', localedir)
conf.set_quoted('PKGDATADIR', pkgdatadir)
Expand Down

0 comments on commit 5329341

Please sign in to comment.