use gtk::prelude::*; use std::env; const APP_ID_DEV: &str = "com.luminescent-dreams.fitnesstrax.dev"; const APP_ID_PROD: &str = "com.luminescent-dreams.fitnesstrax"; const RESOURCE_BASE_PATH_DEV: &str = "/com/luminescent-dreams/fitnesstrax/dev/"; const RESOURCE_BASE_PATH_PROD: &str = "/com/luminescent-dreams/fitnesstrax/"; struct AppState {} struct AppWindow { window: adw::ApplicationWindow, } fn main() { let (app_id, base_path) = if std::env::var_os("ENV") == Some("dev".into()) { (APP_ID_DEV, RESOURCE_BASE_PATH_DEV) } else { (APP_ID_PROD, RESOURCE_BASE_PATH_PROD) }; let settings = gio::Settings::new(app_id); println!("database path: {}", settings.string("series-path")); let app = adw::Application::builder() .application_id(app_id) .resource_base_path(base_path) .build(); /* let runtime = tokio::runtime::Builder::new_multi_thread() .enable_all() .build() .unwrap(); */ let app = adw::Application::builder() .application_id("com.luminescent-dreams.fitnesstrax") .resource_base_path("/com/luminescent-dreams/fitnesstrax") .build(); app.connect_activate(move |app| { let window = adw::ApplicationWindow::new(app); window.present(); }); let args: Vec = env::args().collect(); ApplicationExtManual::run_with_args(&app, &args); }