mirror of
https://github.com/johrpan/musicus.git
synced 2025-10-26 11:47:25 +01:00
Move about dialog to window
This commit is contained in:
parent
59ea1b9d95
commit
7762d8253f
4 changed files with 20 additions and 26 deletions
|
|
@ -1,21 +0,0 @@
|
|||
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.show();
|
||||
}
|
||||
|
|
@ -1,6 +1,3 @@
|
|||
pub mod about;
|
||||
pub use about::*;
|
||||
|
||||
pub mod login_dialog;
|
||||
pub use login_dialog::*;
|
||||
|
||||
|
|
|
|||
|
|
@ -53,7 +53,6 @@ sources = files(
|
|||
'database/schema.rs',
|
||||
'database/thread.rs',
|
||||
'database/works.rs',
|
||||
'dialogs/about.rs',
|
||||
'dialogs/login_dialog.rs',
|
||||
'dialogs/mod.rs',
|
||||
'dialogs/preferences.rs',
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
use crate::backend::*;
|
||||
use crate::config;
|
||||
use crate::dialogs::*;
|
||||
use crate::import::SourceSelector;
|
||||
use crate::screens::*;
|
||||
|
|
@ -142,7 +143,7 @@ impl Window {
|
|||
result.window,
|
||||
"about",
|
||||
clone!(@strong result => move |_, _| {
|
||||
show_about_dialog(&result.window);
|
||||
result.show_about_dialog();
|
||||
})
|
||||
);
|
||||
|
||||
|
|
@ -210,4 +211,22 @@ impl Window {
|
|||
self.navigator.reset();
|
||||
self.leaflet.set_visible_child(&self.sidebar_box);
|
||||
}
|
||||
|
||||
fn show_about_dialog(&self) {
|
||||
let dialog = gtk::AboutDialogBuilder::new()
|
||||
.transient_for(&self.window)
|
||||
.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.show();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue