Add about dialog

This commit is contained in:
Elias Projahn 2020-11-08 00:16:56 +01:00
parent 1b8e8ed8d0
commit 5002eee67a
9 changed files with 70 additions and 5 deletions

View file

@ -30,6 +30,7 @@ src/database/models.rs
src/database/mod.rs src/database/mod.rs
src/database/schema.rs src/database/schema.rs
src/database/tables.rs src/database/tables.rs
src/dialogs/about.rs
src/dialogs/ensemble_editor.rs src/dialogs/ensemble_editor.rs
src/dialogs/ensemble_selector.rs src/dialogs/ensemble_selector.rs
src/dialogs/instrument_editor.rs src/dialogs/instrument_editor.rs

View file

@ -7,8 +7,8 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: \n" "Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-11-07 20:26+0100\n" "POT-Creation-Date: 2020-11-08 00:09+0100\n"
"PO-Revision-Date: 2020-11-07 20:27+0100\n" "PO-Revision-Date: 2020-11-08 00:12+0100\n"
"Last-Translator: \n" "Last-Translator: \n"
"Language-Team: \n" "Language-Team: \n"
"Language: de\n" "Language: de\n"
@ -266,7 +266,7 @@ msgstr ""
"Legen Sie los, indem Sie etwas in der Seitenleiste auswählen oder fügen Sie " "Legen Sie los, indem Sie etwas in der Seitenleiste auswählen oder fügen Sie "
"mit dem Knopf oben links neue Aufnahmen zu Ihrer Musikbibliothek hinzu." "mit dem Knopf oben links neue Aufnahmen zu Ihrer Musikbibliothek hinzu."
#: res/ui/window.ui:104 res/ui/window.ui:252 #: res/ui/window.ui:104 res/ui/window.ui:252 src/dialogs/about.rs:10
msgid "Musicus" msgid "Musicus"
msgstr "Musicus" msgstr "Musicus"
@ -287,6 +287,10 @@ msgstr "Ordner auswählen"
msgid "Preferences" msgid "Preferences"
msgstr "Einstellungen" msgstr "Einstellungen"
#: res/ui/window.ui:335
msgid "About Musicus"
msgstr "Über Musicus"
#: res/ui/work_editor.ui:264 #: res/ui/work_editor.ui:264
msgid "No work parts added." msgid "No work parts added."
msgstr "Keine Werkabschnitte hinzugefügt." msgstr "Keine Werkabschnitte hinzugefügt."
@ -307,6 +311,14 @@ msgstr "Werk auswählen"
msgid "Search works …" msgid "Search works …"
msgstr "Werke durchsuchen …" msgstr "Werke durchsuchen …"
#: src/dialogs/about.rs:12
msgid "The classical music player and organizer."
msgstr "Das Programm zum Abspielen und Organisieren von Klassik."
#: src/dialogs/about.rs:14
msgid "Further information and source code"
msgstr "Weitere Informationen und Quellcode"
#: src/dialogs/preferences.rs:30 src/window.rs:70 #: src/dialogs/preferences.rs:30 src/window.rs:70
msgid "Select music library folder" msgid "Select music library folder"
msgstr "Ordner der Musikbibliothek auswählen" msgstr "Ordner der Musikbibliothek auswählen"

View file

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: musicus\n" "Project-Id-Version: musicus\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-11-07 20:26+0100\n" "POT-Creation-Date: 2020-11-08 00:09+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -263,7 +263,7 @@ msgid ""
"your library using the button in the top left corner." "your library using the button in the top left corner."
msgstr "" msgstr ""
#: res/ui/window.ui:104 res/ui/window.ui:252 #: res/ui/window.ui:104 res/ui/window.ui:252 src/dialogs/about.rs:10
msgid "Musicus" msgid "Musicus"
msgstr "" msgstr ""
@ -281,6 +281,10 @@ msgstr ""
msgid "Preferences" msgid "Preferences"
msgstr "" msgstr ""
#: res/ui/window.ui:335
msgid "About Musicus"
msgstr ""
#: res/ui/work_editor.ui:264 #: res/ui/work_editor.ui:264
msgid "No work parts added." msgid "No work parts added."
msgstr "" msgstr ""
@ -301,6 +305,14 @@ msgstr ""
msgid "Search works …" msgid "Search works …"
msgstr "" msgstr ""
#: src/dialogs/about.rs:12
msgid "The classical music player and organizer."
msgstr ""
#: src/dialogs/about.rs:14
msgid "Further information and source code"
msgstr ""
#: src/dialogs/preferences.rs:30 src/window.rs:70 #: src/dialogs/preferences.rs:30 src/window.rs:70
msgid "Select music library folder" msgid "Select music library folder"
msgstr "" msgstr ""

View file

@ -331,6 +331,10 @@
<attribute name="label" translatable="yes">Preferences</attribute> <attribute name="label" translatable="yes">Preferences</attribute>
<attribute name="action">win.preferences</attribute> <attribute name="action">win.preferences</attribute>
</item> </item>
<item>
<attribute name="label" translatable="yes">About Musicus</attribute>
<attribute name="action">win.about</attribute>
</item>
</section> </section>
</menu> </menu>
</interface> </interface>

View file

@ -1 +1,2 @@
pub static VERSION: &str = @VERSION@;
pub static LOCALEDIR: &str = @LOCALEDIR@; pub static LOCALEDIR: &str = @LOCALEDIR@;

22
src/dialogs/about.rs Normal file
View file

@ -0,0 +1,22 @@
use crate::config;
use gettextrs::gettext;
use gtk::prelude::*;
pub fn show_about_dialog<W: IsA<gtk::Window>>(parent: &W) {
let dialog = gtk::AboutDialogBuilder::new()
.transient_for(parent)
.modal(true)
.logo_icon_name("de.johrpan.musicus")
.program_name(&gettext("Musicus"))
.version(config::VERSION)
.comments(&gettext("The classical music player and organizer."))
.website("https://github.com/johrpan/musicus")
.website_label(&gettext("Further information and source code"))
.copyright("© 2020 Elias Projahn")
.license_type(gtk::License::Agpl30)
.authors(vec![String::from("Elias Projahn <johrpan@gmail.com>")])
.build();
dialog.connect_response(|dialog, _| dialog.close());
dialog.show();
}

View file

@ -1,3 +1,6 @@
pub mod about;
pub use about::*;
pub mod ensemble_editor; pub mod ensemble_editor;
pub use ensemble_editor::*; pub use ensemble_editor::*;

View file

@ -3,6 +3,7 @@ localedir = join_paths(prefix, get_option('localedir'))
global_conf = configuration_data() global_conf = configuration_data()
global_conf.set_quoted('LOCALEDIR', localedir) global_conf.set_quoted('LOCALEDIR', localedir)
global_conf.set_quoted('VERSION', meson.project_version())
config_rs = configure_file( config_rs = configure_file(
input: 'config.rs.in', input: 'config.rs.in',
output: 'config.rs', output: 'config.rs',
@ -37,6 +38,7 @@ sources = files(
'database/models.rs', 'database/models.rs',
'database/schema.rs', 'database/schema.rs',
'database/tables.rs', 'database/tables.rs',
'dialogs/about.rs',
'dialogs/ensemble_editor.rs', 'dialogs/ensemble_editor.rs',
'dialogs/ensemble_selector.rs', 'dialogs/ensemble_selector.rs',
'dialogs/instrument_editor.rs', 'dialogs/instrument_editor.rs',

View file

@ -110,6 +110,14 @@ impl Window {
}) })
); );
action!(
result.window,
"about",
clone!(@strong result => move |_, _| {
show_about_dialog(&result.window);
})
);
action!( action!(
result.window, result.window,
"add-person", "add-person",