Init with GTK Rust Template

This commit is contained in:
ranfdev
2023-07-23 18:15:23 +02:00
commit c3de2224a8
34 changed files with 1335 additions and 0 deletions

28
src/main.rs Normal file
View File

@ -0,0 +1,28 @@
mod application;
#[rustfmt::skip]
mod config;
mod window;
use gettextrs::{gettext, LocaleCategory};
use gtk::{gio, glib};
use self::application::ExampleApplication;
use self::config::{GETTEXT_PACKAGE, LOCALEDIR, RESOURCES_FILE};
fn main() -> glib::ExitCode {
// Initialize logger
tracing_subscriber::fmt::init();
// Prepare i18n
gettextrs::setlocale(LocaleCategory::LcAll, "");
gettextrs::bindtextdomain(GETTEXT_PACKAGE, LOCALEDIR).expect("Unable to bind the text domain");
gettextrs::textdomain(GETTEXT_PACKAGE).expect("Unable to switch to the text domain");
glib::set_application_name(&gettext("Notify"));
let res = gio::Resource::load(RESOURCES_FILE).expect("Could not load gresource file");
gio::resources_register(&res);
let app = ExampleApplication::default();
app.run()
}