summaryrefslogtreecommitdiff
path: root/schist_desktop_gui/src/main.rs
diff options
context:
space:
mode:
authorJoe Carstairs <me@joeac.net>2025-08-25 16:35:45 +0000
committerjoeac <me@joeac.net>2025-08-25 16:35:45 +0000
commitfe85652e4d3e8906824baddaafd05d19105579b8 (patch)
tree31b56e31cbf289a34ec1d6707becf3c60933b56f /schist_desktop_gui/src/main.rs
parentd082a30de6a0cbd1fbe2ab5a4316db0891004129 (diff)
task-072
Co-authored-by: Joe Carstairs <jcarstairs@scottlogic.com> Reviewed-on: https://git.joeac.net/joeac/schist/pulls/3 Co-authored-by: Joe Carstairs <me@joeac.net> Co-committed-by: Joe Carstairs <me@joeac.net>
Diffstat (limited to 'schist_desktop_gui/src/main.rs')
-rw-r--r--schist_desktop_gui/src/main.rs33
1 files changed, 13 insertions, 20 deletions
diff --git a/schist_desktop_gui/src/main.rs b/schist_desktop_gui/src/main.rs
index 24aedc0..6dd2622 100644
--- a/schist_desktop_gui/src/main.rs
+++ b/schist_desktop_gui/src/main.rs
@@ -1,6 +1,8 @@
mod config;
-mod connection;
+mod database_connection;
+mod dialog;
mod gui;
+mod paths;
mod settings;
mod shortcut;
mod style;
@@ -8,31 +10,22 @@ mod theme;
mod traits;
mod window_settings;
+pub use database_connection::DatabaseConnection;
+
use anyhow::Context;
-use diesel_migrations::MigrationHarness;
-use schist_schema::migrations::MIGRATIONS;
use crate::{
- config::Config,
- connection::establish_connection,
- gui::Gui,
- settings::make_settings,
- theme::make_theme,
+ config::Config, gui::Gui, settings::make_settings, theme::make_theme,
window_settings::make_window_settings,
};
fn main() -> anyhow::Result<()> {
let config = Config::default();
- let mut connection = establish_connection()
- .context("Failed to establish database connection")?;
- connection.run_pending_migrations(MIGRATIONS)
- .expect("Failed to run pending database migrations");
-
-iced::application("Schist", Gui::update, Gui::view)
- .settings(make_settings(&config.clone()))
- .subscription(gui::subscription)
- .theme(make_theme)
- .window(make_window_settings(&config.clone()))
- .run_with(move || Gui::new(&mut connection))
- .context("Failed to run Schist GUI")
+ iced::application("Schist", Gui::update, Gui::view)
+ .settings(make_settings(&config.clone()))
+ .subscription(gui::subscription)
+ .theme(make_theme)
+ .window(make_window_settings(&config.clone()))
+ .run_with(Gui::new)
+ .context("Failed to run Schist GUI")
}