Debian Codegraph @

src/ui/about_dialog.rs

raw ◀ ▶
1 Debian patch touch this file
1 // Fragments - about_dialog.rs
2 // Copyright (C) 2022-2024 Felix Häcker <[email protected]>
3 //
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation, either version 3 of the License, or
7 // (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
13 //
14 // You should have received a copy of the GNU General Public License
15 // along with this program. If not, see <https://www.gnu.org/licenses/>.
16
17 use adw::prelude::*;
18
19 use crate::config;
20 use crate::i18n::i18n;
21 use crate::ui::FrgApplicationWindow;
22
23 pub fn show(parent: &FrgApplicationWindow) {
24 let dialog = adw::AboutDialog::from_appdata(
25 &format!("{}/metainfo.xml", config::PATH_ID),
26 Some(config::VERSION),
27 );
28
29 let _version = match config::PROFILE {
30 "development" => {
31 dialog.set_debug_info(&format!("Git Commit: {}", config::VCS_TAG));
32 format!("{}-devel", config::VERSION)
33 }
34 _ => config::VERSION.to_string(),
35 };
36
37 dialog.set_version("3.0.0");
38 dialog.set_developers(&[
39 "Felix Häcker <[email protected]>",
40 "Bilal Elmoussaoui <[email protected]>",
41 "Maximiliano Sandoval <[email protected]>",
42 ]);
43 dialog.set_designers(&["Tobias Bernard", "Jakub Steiner", "Sam Hewitt"]);
44 dialog.set_translator_credits(&i18n("translator-credits"));
45
•46 dialog.present(Some(parent));
47 }