A modern Music Player Daemon based on Rockbox open source high quality audio player
libadwaita audio rust zig deno mpris rockbox mpd

gtk: add About Dialog

+148 -21
+1 -1
gtk/data/gtk/current_playlist.blp
··· 8 8 9 9 Box { 10 10 orientation: vertical; 11 - halign: fill; 11 + halign: center; 12 12 valign: center; 13 13 hexpand: true; 14 14
gtk/data/gtk/preferences.blp

This is a binary file and will not be displayed.

-5
gtk/data/gtk/window.blp
··· 601 601 } 602 602 } 603 603 604 - item { 605 - label: _("Show Hidden"); 606 - action: "win.show_hidden"; 607 - hidden-when: "action-disabled"; 608 - } 609 604 } 610 605 611 606 section {
+34 -11
gtk/data/meson.build
··· 2 2 conf.set('APP_ID', app_id) 3 3 conf.set('PREFIX', prefix) 4 4 conf.set('VERSION', meson.project_version()) 5 + conf.set('NAME', name) 6 + conf.set('PKGNAME', app_id) 5 7 conf.set('pkgdatadir', pkgdatadir) 6 8 7 - 8 - gnome.compile_resources( 9 - 'rockbox', 10 - configure_file( 11 - input: 'rockbox.gresource.xml.in', 12 - output: 'rockbox.gresource.xml', 9 + appstream_file = i18n.merge_file( 10 + input: configure_file( 11 + input: 'mg.tsirysndr.Rockbox.metainfo.xml.in.in', 12 + output: app_id + '.metainfo.xml.in', 13 13 configuration: conf, 14 14 ), 15 - gresource_bundle: true, 15 + output: app_id + '.metainfo.xml', 16 + po_dir: '../po', 16 17 install: true, 17 - install_dir: pkgdatadir, 18 + install_dir: join_paths(get_option('datadir'), 'metainfo'), 18 19 ) 19 20 20 21 desktop_file = i18n.merge_file( 21 22 input: configure_file( 22 23 input: 'mg.tsirysndr.Rockbox.desktop.in', 23 - output: app_id + '.desktop.in', 24 + output: 'rockbox.desktop.in', 24 25 configuration: conf, 25 26 ), 26 - output: app_id + '.desktop', 27 + output: 'rockbox.desktop', 27 28 type: 'desktop', 28 29 po_dir: '../po', 29 30 install: true, 30 31 install_dir: join_paths(get_option('datadir'), 'applications'), 31 32 ) 32 33 34 + appstreamcli = find_program('appstreamcli', required: false) 35 + if appstreamcli.found() 36 + test( 37 + 'Validate appstream file', 38 + appstreamcli, 39 + args: ['validate', '--no-net', '--explain', appstream_file], 40 + workdir: meson.current_build_dir(), 41 + ) 42 + endif 33 43 34 - subdir('icons') 44 + gnome.compile_resources( 45 + 'rockbox', 46 + configure_file( 47 + input: 'rockbox.gresource.xml.in', 48 + output: 'rockbox.gresource.xml', 49 + configuration: conf, 50 + ), 51 + gresource_bundle: true, 52 + install: true, 53 + install_dir: pkgdatadir, 54 + dependencies: appstream_file, 55 + ) 56 + 57 + subdir('icons')
+63
gtk/data/mg.tsirysndr.Rockbox.metainfo.xml.in.in
··· 1 + <?xml version="1.0" encoding="UTF-8"?> 2 + <component type="desktop-application"> 3 + <!-- Meson Build --> 4 + <id>@APP_ID@</id> 5 + <name>@NAME@</name> 6 + <translation type="gettext">@PKGNAME@</translation> 7 + <launchable type="desktop-id">rockbox.desktop</launchable> 8 + 9 + <!-- General --> 10 + <summary>A Modern Gtk Application for Rockbox</summary> 11 + <description> 12 + <p> 13 + Rockbox is a free replacement for digital music players. And this is a modern Desktop 14 + application built on top of it, 15 + A modified version of Rockbox runs in the background and provides the audio playback 16 + functionality. 17 + </p> 18 + </description> 19 + <content_rating type="oars-1.1" /> 20 + 21 + <!-- Branding --> 22 + <developer_name>Felix Häcker</developer_name> 23 + <developer id="mg.tsirysndr"> 24 + <name>Tsiry Sandratraina</name> 25 + </developer> 26 + <branding> 27 + <color type="primary" scheme_preference="light">#d5b0e7</color> 28 + <color type="primary" scheme_preference="dark">#501a5c</color> 29 + </branding> 30 + 31 + <!-- License --> 32 + <metadata_license>CC0-1.0</metadata_license> 33 + <project_license>GPL-3.0-or-later</project_license> 34 + 35 + <!-- URLs --> 36 + <url type="homepage">https://github.com/tsirysndr/rockbox-zig</url> 37 + <url type="bugtracker">https://github.com/tsirysndr/rockbox-zig/issues</url> 38 + <url type="donation">https://github.com/sponsors/tsirysndr</url> 39 + <url type="contact">tsiry.sndr@fluentci.io</url> 40 + <url type="vcs-browser">https://github.com/tsirysndr/rockbox-zig</url> 41 + <url type="contribute">https://github.com/tsirysndr/rockbox-zig/blob/master/CONTRIBUTING.md</url> 42 + 43 + <!-- Supported Hardware --> 44 + <requires> 45 + <display_length compare="ge">360</display_length> 46 + </requires> 47 + <supports> 48 + <control>keyboard</control> 49 + <control>pointing</control> 50 + <control>touch</control> 51 + </supports> 52 + 53 + <!-- Releases --> 54 + <releases> 55 + <release version="0.1.0" date="2023-12-31"> 56 + <description> 57 + <p>First beta release.</p> 58 + </description> 59 + </release> 60 + </releases> 61 + </component> 62 + 63 +
+1
gtk/data/rockbox.gresource.xml.in
··· 1 1 <?xml version="1.0" encoding="UTF-8"?> 2 2 <gresources> 3 3 <gresource prefix="@PREFIX@/"> 4 + <file preprocess="xml-stripblanks" alias="metainfo.xml">@APP_ID@.metainfo.xml</file> 4 5 <file>icons/jpg/albumart.jpg</file> 5 6 </gresource> 6 7 <gresource prefix="@PREFIX@/icons/scalable/categories/">
+3
gtk/po/LINGUAS
··· 1 + # Please keep this list sorted alphabetically 2 + # 3 + fr
+5
gtk/po/fr.po
··· 1 + 2 + #: data/de.haeckerfelix.Shortwave.metainfo.xml.in.in:5 3 + msgid "@NAME@" 4 + msgstr "@NAME@" 5 +
+11
gtk/src/ui/about_dialog.rs
··· 1 + use adw::prelude::*; 2 + 3 + use crate::ui::window::RbApplicationWindow; 4 + 5 + pub fn show(parent: &RbApplicationWindow) { 6 + let about = adw::AboutDialog::from_appdata("/mg/tsirysndr/Rockbox/metainfo.xml", Some("")); 7 + about.set_designers(&["Tsiry Sandratraina"]); 8 + about.set_developers(&["Tsiry Sandratraina https://github.com/tsirysndr"]); 9 + about.set_copyright("© 2024 Tsiry Sandratraina"); 10 + about.present(Some(parent)); 11 + }
+2 -1
gtk/src/ui/mod.rs
··· 1 - pub mod media_controls; 1 + pub mod about_dialog; 2 2 pub mod album_tracks; 3 3 pub mod artist; 4 4 pub mod file; 5 + pub mod media_controls; 5 6 pub mod pages; 6 7 pub mod song; 7 8 pub mod window;
+28 -3
gtk/src/ui/window.rs
··· 1 1 use crate::api::rockbox::v1alpha1::playback_service_client::PlaybackServiceClient; 2 2 use crate::api::rockbox::v1alpha1::{PlayAllTracksRequest, PlayLikedTracksRequest}; 3 3 use crate::app::RbApplication; 4 + use crate::config; 4 5 use crate::state::AppState; 5 6 use crate::types::track::Track; 7 + use crate::ui::about_dialog; 6 8 use crate::ui::media_controls::MediaControls; 7 9 use crate::ui::pages::album_details::AlbumDetails; 8 10 use crate::ui::pages::albums::Albums; ··· 12 14 use crate::ui::pages::{artists::Artists, files::Files, likes::Likes}; 13 15 use adw::prelude::*; 14 16 use adw::subclass::prelude::*; 15 - use adw::ViewStack; 16 - use adw::{NavigationPage, NavigationView, OverlaySplitView, ToastOverlay, ViewStackPage}; 17 + use adw::{ 18 + AboutDialog, NavigationPage, NavigationView, OverlaySplitView, ToastOverlay, ViewStack, 19 + ViewStackPage, 20 + }; 17 21 use anyhow::Error; 18 22 use glib::subclass; 19 23 use gtk::{ ··· 25 29 use std::thread; 26 30 27 31 mod imp { 28 - 29 32 use super::*; 30 33 31 34 #[derive(Debug, Default, CompositeTemplate)] ··· 167 170 klass.install_action("app.shuffle_all", None, move |win, _action, _parameter| { 168 171 let self_ = imp::RbApplicationWindow::from_obj(win); 169 172 self_.shuffle_all(); 173 + }); 174 + 175 + klass.install_action("app.preferences", None, move |win, _action, _parameter| { 176 + let self_ = imp::RbApplicationWindow::from_obj(win); 177 + self_.go_to_preferences(); 178 + }); 179 + 180 + klass.install_action( 181 + "win.show-help-overlay", 182 + None, 183 + move |win, _action, _parameter| { 184 + let self_ = imp::RbApplicationWindow::from_obj(win); 185 + self_.show_help_overlay(); 186 + }, 187 + ); 188 + 189 + klass.install_action("app.about", None, move |win, _action, _parameter| { 190 + about_dialog::show(win); 170 191 }); 171 192 } 172 193 ··· 565 586 }); 566 587 } 567 588 } 589 + 590 + pub fn go_to_preferences(&self) {} 591 + 592 + pub fn show_help_overlay(&self) {} 568 593 } 569 594 } 570 595