mirror of
https://github.com/johrpan/musicus.git
synced 2025-10-26 11:47:25 +01:00
Add about dialog
This commit is contained in:
parent
1b8e8ed8d0
commit
5002eee67a
9 changed files with 70 additions and 5 deletions
|
|
@ -1 +1,2 @@
|
|||
pub static VERSION: &str = @VERSION@;
|
||||
pub static LOCALEDIR: &str = @LOCALEDIR@;
|
||||
22
src/dialogs/about.rs
Normal file
22
src/dialogs/about.rs
Normal 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();
|
||||
}
|
||||
|
|
@ -1,3 +1,6 @@
|
|||
pub mod about;
|
||||
pub use about::*;
|
||||
|
||||
pub mod ensemble_editor;
|
||||
pub use ensemble_editor::*;
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ localedir = join_paths(prefix, get_option('localedir'))
|
|||
|
||||
global_conf = configuration_data()
|
||||
global_conf.set_quoted('LOCALEDIR', localedir)
|
||||
global_conf.set_quoted('VERSION', meson.project_version())
|
||||
config_rs = configure_file(
|
||||
input: 'config.rs.in',
|
||||
output: 'config.rs',
|
||||
|
|
@ -37,6 +38,7 @@ sources = files(
|
|||
'database/models.rs',
|
||||
'database/schema.rs',
|
||||
'database/tables.rs',
|
||||
'dialogs/about.rs',
|
||||
'dialogs/ensemble_editor.rs',
|
||||
'dialogs/ensemble_selector.rs',
|
||||
'dialogs/instrument_editor.rs',
|
||||
|
|
|
|||
|
|
@ -110,6 +110,14 @@ impl Window {
|
|||
})
|
||||
);
|
||||
|
||||
action!(
|
||||
result.window,
|
||||
"about",
|
||||
clone!(@strong result => move |_, _| {
|
||||
show_about_dialog(&result.window);
|
||||
})
|
||||
);
|
||||
|
||||
action!(
|
||||
result.window,
|
||||
"add-person",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue