mirror of
https://github.com/johrpan/musicus.git
synced 2025-10-26 19:57:25 +01:00
Add welcome page and improve generated code
This commit is contained in:
parent
379923e4ca
commit
f61482c329
11 changed files with 175 additions and 92 deletions
20
src/main.rs
20
src/main.rs
|
|
@ -1,35 +1,23 @@
|
|||
mod application;
|
||||
mod config;
|
||||
mod welcome_page;
|
||||
mod window;
|
||||
|
||||
use self::application::MusicusApplication;
|
||||
use self::window::MusicusWindow;
|
||||
use self::{application::MusicusApplication, window::MusicusWindow};
|
||||
|
||||
use config::{GETTEXT_PACKAGE, LOCALEDIR, PKGDATADIR};
|
||||
use gettextrs::{bind_textdomain_codeset, bindtextdomain, textdomain};
|
||||
use gtk::{gio, glib};
|
||||
use gtk::prelude::*;
|
||||
use gtk::{gio, glib, prelude::*};
|
||||
|
||||
fn main() -> glib::ExitCode {
|
||||
// Set up gettext translations
|
||||
bindtextdomain(GETTEXT_PACKAGE, LOCALEDIR).expect("Unable to bind the text domain");
|
||||
bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8")
|
||||
.expect("Unable to set the text domain encoding");
|
||||
textdomain(GETTEXT_PACKAGE).expect("Unable to switch to the text domain");
|
||||
|
||||
// Load resources
|
||||
let resources = gio::Resource::load(PKGDATADIR.to_owned() + "/musicus.gresource")
|
||||
.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 = MusicusApplication::new("de.johrpan.musicus", &gio::ApplicationFlags::empty());
|
||||
|
||||
// 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.
|
||||
app.run()
|
||||
MusicusApplication::new("de.johrpan.musicus", &gio::ApplicationFlags::empty()).run()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue