2026-01-20 12:00:24 -05:00
|
|
|
use anyhow::Result;
|
2025-04-13 12:15:31 -04:00
|
|
|
use cxx_qt_lib::QString;
|
|
|
|
|
|
|
|
|
|
pub mod colors;
|
|
|
|
|
pub mod filesystem;
|
|
|
|
|
|
2026-01-20 12:00:24 -05:00
|
|
|
pub fn run(root_path: std::path::PathBuf) -> Result<()> {
|
2025-04-13 12:15:31 -04:00
|
|
|
println!("Starting the GUI editor at {:?}", root_path);
|
|
|
|
|
|
|
|
|
|
use cxx_qt_lib::{QGuiApplication, QQmlApplicationEngine, QUrl};
|
|
|
|
|
|
|
|
|
|
let mut app = QGuiApplication::new();
|
|
|
|
|
let mut engine = QQmlApplicationEngine::new();
|
|
|
|
|
|
|
|
|
|
if let Some(engine) = engine.as_mut() {
|
|
|
|
|
engine.add_import_path(&QString::from("qml/"));
|
|
|
|
|
}
|
|
|
|
|
if let Some(engine) = engine.as_mut() {
|
|
|
|
|
engine.load(&QUrl::from("qml/main.qml"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if let Some(app) = app.as_mut() {
|
|
|
|
|
app.exec();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Ok(())
|
|
|
|
|
}
|