mod-manager/src/main.rs

56 lines
2 KiB
Rust
Raw Normal View History

2023-12-21 11:30:30 +00:00
/*
Copyright (c) 2023 Tine Jozelj
2023-12-21 09:38:30 +00:00
2023-12-21 11:30:30 +00:00
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
2023-12-21 09:38:30 +00:00
2023-12-21 11:30:30 +00:00
mod api;
2023-12-21 09:38:30 +00:00
mod application;
2023-12-21 11:30:30 +00:00
mod config;
2023-12-21 18:24:38 +00:00
mod settings;
2023-12-21 11:30:30 +00:00
mod windows;
2023-12-21 09:38:30 +00:00
2023-12-21 11:30:30 +00:00
use self::application::ModManagerApplication;
use config::{GETTEXT_PACKAGE, LOCALEDIR, RESOURCES_FILE};
2023-12-21 09:38:30 +00:00
use gettextrs::{gettext, LocaleCategory};
use gtk::{gio, glib};
fn main() -> glib::ExitCode {
// Initialize logger
tracing_subscriber::fmt::init();
2023-12-21 11:30:30 +00:00
// Set up gettext translations
2023-12-21 09:38:30 +00:00
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("Mod Manager"));
2023-12-21 11:30:30 +00:00
// Load resources
let resources = gio::Resource::load(RESOURCES_FILE).expect("Could not load resources");
gio::resources_register(&resources);
// Create a new GtkApplication. The application manages our main loop,
// application windows, integration with the window manager/compositor, and
// desktop features such as file opening and single-instance applications.
let app = ModManagerApplication::new(&gio::ApplicationFlags::empty());
2023-12-21 09:38:30 +00:00
2023-12-21 11:30:30 +00:00
// Run the application. This function will block until the application
// exits. Upon return, we have our exit code to return to the shell. (This
// is the code you see when you do `echo $?` after running a command in a
// terminal.
2023-12-21 09:38:30 +00:00
app.run()
}