From 88f96024570abca5a3aec654286cf8a1de713d0f Mon Sep 17 00:00:00 2001 From: Reboot-Codes Date: Mon, 7 Jul 2025 14:10:00 -0700 Subject: [PATCH] Almost done with ratchet scaffolding --- toolbox/carbon-steel/src/repos/mod.rs | 1 + .../src/screens/configurator/gestures/mod.rs | 100 ++++++++++++++++-- .../configurator/gestures/pack_detail.rs | 79 ++++++++++++++ .../ratchet/src/screens/configurator/mod.rs | 21 +++- .../screens/configurator/modules/detail.rs | 79 ++++++++++++++ .../src/screens/configurator/modules/mod.rs | 89 +++++++++++++++- .../src/screens/configurator/repos/detail.rs | 34 ++++-- toolbox/ratchet/src/screens/welcome/mod.rs | 2 +- toolbox/ratchet/src/screens/wizard/mod.rs | 45 ++++---- .../screens/wizard/steps/connection_type.rs | 34 ++++++ .../wizard/steps/from_scratch_intro.rs | 45 ++++++++ .../ratchet/src/screens/wizard/steps/mod.rs | 3 + .../src/screens/wizard/steps/use_case.rs | 74 +++++++++++++ toolbox/ratchet/src/util/mod.rs | 1 + toolbox/ratchet/src/util/open_link.rs | 12 +++ toolbox/ratchet/src/util/spawn_editor.rs | 14 +++ 16 files changed, 584 insertions(+), 49 deletions(-) create mode 100644 toolbox/ratchet/src/screens/configurator/gestures/pack_detail.rs create mode 100644 toolbox/ratchet/src/screens/configurator/modules/detail.rs create mode 100644 toolbox/ratchet/src/screens/wizard/steps/connection_type.rs create mode 100644 toolbox/ratchet/src/screens/wizard/steps/from_scratch_intro.rs create mode 100644 toolbox/ratchet/src/screens/wizard/steps/mod.rs create mode 100644 toolbox/ratchet/src/screens/wizard/steps/use_case.rs create mode 100644 toolbox/ratchet/src/util/open_link.rs create mode 100644 toolbox/ratchet/src/util/spawn_editor.rs diff --git a/toolbox/carbon-steel/src/repos/mod.rs b/toolbox/carbon-steel/src/repos/mod.rs index 6ab364d..2f77446 100644 --- a/toolbox/carbon-steel/src/repos/mod.rs +++ b/toolbox/carbon-steel/src/repos/mod.rs @@ -17,6 +17,7 @@ pub struct Module { #[derive(Debug, Clone)] pub struct App { pub name: String, + pub installed: bool, } #[derive(Debug, Clone)] diff --git a/toolbox/ratchet/src/screens/configurator/gestures/mod.rs b/toolbox/ratchet/src/screens/configurator/gestures/mod.rs index 316c2e6..244d8d4 100644 --- a/toolbox/ratchet/src/screens/configurator/gestures/mod.rs +++ b/toolbox/ratchet/src/screens/configurator/gestures/mod.rs @@ -1,20 +1,106 @@ +pub mod pack_detail; + use carbon_steel::repos::GesturePack; use iced::{ Element, - widget::text, + widget::{ + button, + column, + horizontal_space, + row, + text, + }, }; use log::debug; +use std::collections::HashMap; use crate::{ Message, - screens::configurator::ConfiguratorScreen, + screens::configurator::{ + ConfiguratorScreen, + ConfiguratorTab, + }, }; -pub fn gestures_tab( - _configurator_screen: &ConfiguratorScreen, - content: &mut Vec>, -) { +pub fn gestures_tab(configurator_screen: &ConfiguratorScreen, content: &mut Vec>) { debug!("Gestures Tab"); - content.push(text("Gestures").into()); + content.push(text("Gestures").size(24).into()); + + let mut gesture_packs = HashMap::new(); + + if configurator_screen.focused_on_repo { + let repo_id = configurator_screen.current_repo.clone().unwrap(); + for (gesture_pack_id, module_config) in configurator_screen + .repos + .get(&repo_id) + .unwrap() + .gesture_packs + .clone() + .iter() + { + gesture_packs.insert( + (repo_id.clone(), gesture_pack_id.clone()), + module_config.clone(), + ); + } + } else { + for (repo_id, repo_config) in configurator_screen.repos.clone().iter() { + for (gesture_pack_id, gesture_pack_config) in repo_config.gesture_packs.clone().iter() { + gesture_packs.insert( + (repo_id.clone(), gesture_pack_id.clone()), + gesture_pack_config.clone(), + ); + } + } + } + + content.push( + column( + as Clone>::clone(&gesture_packs) + .into_iter() + .map(|(ids, gesture_pack_config)| { + let (repo_id, gesture_pack_id) = ids; + let repos = &configurator_screen.repos.clone(); + let repo_name = repos.get(&repo_id).unwrap().name.clone(); + + debug!( + "Found \"{}\", with config: {:?}", + gesture_pack_id.clone(), + gesture_pack_config.clone() + ); + + // TODO: App badges + let badges = vec![]; + + button( + row(vec![ + column(vec![ + column(vec![ + text(gesture_pack_config.name).size(18).into(), + text(repo_name.clone()).size(14).into(), + ]) + .into(), + row(badges).spacing(3).into(), + ]) + .spacing(3) + .into(), + horizontal_space().into(), + ]) + .spacing(3), + ) + // TODO: Repo management sub_screen + .on_press(Message::SetConfiguratorTab( + ConfiguratorTab::GesturePackDetail( + repo_id.clone(), + gesture_pack_id.clone(), + Box::new(ConfiguratorTab::Gestures), + ), + )) + .into() + }) + .collect::>>(), + ) + .into(), + ); } diff --git a/toolbox/ratchet/src/screens/configurator/gestures/pack_detail.rs b/toolbox/ratchet/src/screens/configurator/gestures/pack_detail.rs new file mode 100644 index 0000000..964be09 --- /dev/null +++ b/toolbox/ratchet/src/screens/configurator/gestures/pack_detail.rs @@ -0,0 +1,79 @@ +use anyhow::Context; +use iced::{ + Element, + alignment, + widget::{ + button, + horizontal_space, + row, + text, + }, +}; +use iced_fonts::{ + REQUIRED_FONT, + required::{ + RequiredIcons, + icon_to_string, + }, +}; + +use crate::{ + Message, + screens::configurator::{ + ConfiguratorScreen, + ConfiguratorTab, + }, +}; + +pub fn gesture_pack_detail_tab( + configurator_screen: &ConfiguratorScreen, + content: &mut Vec>, + repo_id: &String, + gesture_pack_id: &String, + prev_screen: &Box, +) { + let repo = configurator_screen + .repos + .get(repo_id) + .with_context(|| { + format!( + "ConfiguratorScreen::update() should've ensured that repo: \"{}\" existed in the repo cache", + repo_id + ) + }) + .unwrap(); + + let gesture_pack = repo + .gesture_packs + .get(gesture_pack_id) + .with_context(|| { + format!( + "ConfiguratorScreen::update() should've ensured that gesture pack: \"{}\" existed in the repo cache", + gesture_pack_id + ) + }) + .unwrap(); + + content.push( + row(vec![ + (match &**prev_screen { + ConfiguratorTab::None => horizontal_space().into(), + _ => button(row(vec![ + text(icon_to_string(RequiredIcons::CaretLeftFill)) + .font(REQUIRED_FONT) + .width(iced::Length::Shrink) + .align_y(alignment::Vertical::Center) + .into(), + text("Back").into(), + ])) + .on_press(Message::SetConfiguratorTab(*prev_screen.clone())) + .into(), + }), + horizontal_space().into(), + button("Settings").into(), + ]) + .into(), + ); + + content.push(text(gesture_pack.name.clone()).size(24).into()); +} diff --git a/toolbox/ratchet/src/screens/configurator/mod.rs b/toolbox/ratchet/src/screens/configurator/mod.rs index 97e2a2c..a79c2c2 100644 --- a/toolbox/ratchet/src/screens/configurator/mod.rs +++ b/toolbox/ratchet/src/screens/configurator/mod.rs @@ -38,8 +38,14 @@ use crate::{ apps_tab, detail::app_detail_tab, }, - gestures::gestures_tab, - modules::modules_tab, + gestures::{ + gestures_tab, + pack_detail::gesture_pack_detail_tab, + }, + modules::{ + detail::module_detail_tab, + modules_tab, + }, overview::overview_tab, repos::{ detail::repo_detail_tab, @@ -67,9 +73,9 @@ pub enum ConfiguratorTab { Overview, None, Modules, - // TODO: ModuleDetail(String), + ModuleDetail(String, String, Box), Gestures, - // TODO: GestureDetail(String), + GesturePackDetail(String, String, Box), Apps, AppDetail(String, String, Box), Repos, @@ -112,6 +118,7 @@ impl ConfiguratorScreen { "com.reboot-codes.clover.CORE.home".to_string(), App { name: "Home".to_string(), + installed: true, }, ); @@ -166,6 +173,12 @@ impl ConfiguratorScreen { ConfiguratorTab::AppDetail(repo_id, app_id, prev_screen) => { app_detail_tab(self, &mut content, repo_id, app_id, prev_screen) } + ConfiguratorTab::ModuleDetail(repo_id, module_id, prev_screen) => { + module_detail_tab(self, &mut content, repo_id, module_id, prev_screen) + } + ConfiguratorTab::GesturePackDetail(repo_id, module_id, prev_screen) => { + gesture_pack_detail_tab(self, &mut content, repo_id, module_id, prev_screen) + } ConfiguratorTab::None => {} } diff --git a/toolbox/ratchet/src/screens/configurator/modules/detail.rs b/toolbox/ratchet/src/screens/configurator/modules/detail.rs new file mode 100644 index 0000000..2546199 --- /dev/null +++ b/toolbox/ratchet/src/screens/configurator/modules/detail.rs @@ -0,0 +1,79 @@ +use anyhow::Context; +use iced::{ + Element, + alignment, + widget::{ + button, + horizontal_space, + row, + text, + }, +}; +use iced_fonts::{ + REQUIRED_FONT, + required::{ + RequiredIcons, + icon_to_string, + }, +}; + +use crate::{ + Message, + screens::configurator::{ + ConfiguratorScreen, + ConfiguratorTab, + }, +}; + +pub fn module_detail_tab( + configurator_screen: &ConfiguratorScreen, + content: &mut Vec>, + repo_id: &String, + module_id: &String, + prev_screen: &Box, +) { + let repo = configurator_screen + .repos + .get(repo_id) + .with_context(|| { + format!( + "ConfiguratorScreen::update() should've ensured that repo: \"{}\" existed in the repo cache", + repo_id + ) + }) + .unwrap(); + + let module = repo + .modules + .get(module_id) + .with_context(|| { + format!( + "ConfiguratorScreen::update() should've ensured that module: \"{}\" existed in the repo cache", + module_id + ) + }) + .unwrap(); + + content.push( + row(vec![ + (match &**prev_screen { + ConfiguratorTab::None => horizontal_space().into(), + _ => button(row(vec![ + text(icon_to_string(RequiredIcons::CaretLeftFill)) + .font(REQUIRED_FONT) + .width(iced::Length::Shrink) + .align_y(alignment::Vertical::Center) + .into(), + text("Back").into(), + ])) + .on_press(Message::SetConfiguratorTab(*prev_screen.clone())) + .into(), + }), + horizontal_space().into(), + button("Settings").into(), + ]) + .into(), + ); + + content.push(text(module.name.clone()).size(24).into()); +} diff --git a/toolbox/ratchet/src/screens/configurator/modules/mod.rs b/toolbox/ratchet/src/screens/configurator/modules/mod.rs index f3803cc..b851f7f 100644 --- a/toolbox/ratchet/src/screens/configurator/modules/mod.rs +++ b/toolbox/ratchet/src/screens/configurator/modules/mod.rs @@ -1,17 +1,98 @@ +pub mod detail; + use carbon_steel::repos::Module; use iced::{ Element, - widget::text, + widget::{ + button, + column, + horizontal_space, + row, + text, + }, }; use log::debug; +use std::collections::HashMap; use crate::{ Message, - screens::configurator::ConfiguratorScreen, + screens::configurator::{ + ConfiguratorScreen, + ConfiguratorTab, + }, }; -pub fn modules_tab(_configurator_screen: &ConfiguratorScreen, content: &mut Vec>) { +pub fn modules_tab(configurator_screen: &ConfiguratorScreen, content: &mut Vec>) { debug!("Modules Tab"); - content.push(text("Modules").into()); + content.push(text("Modules").size(24).into()); + + let mut modules = HashMap::new(); + + if configurator_screen.focused_on_repo { + let repo_id = configurator_screen.current_repo.clone().unwrap(); + for (app_id, module_config) in configurator_screen + .repos + .get(&repo_id) + .unwrap() + .modules + .clone() + .iter() + { + modules.insert((repo_id.clone(), app_id.clone()), module_config.clone()); + } + } else { + for (repo_id, repo_config) in configurator_screen.repos.clone().iter() { + for (app_id, module_config) in repo_config.modules.clone().iter() { + modules.insert((repo_id.clone(), app_id.clone()), module_config.clone()); + } + } + } + + content.push( + column( + as Clone>::clone(&modules) + .into_iter() + .map(|(ids, module_config)| { + let (repo_id, module_id) = ids; + let repos = &configurator_screen.repos.clone(); + let repo_name = repos.get(&repo_id).unwrap().name.clone(); + + debug!( + "Found \"{}\", with config: {:?}", + module_id.clone(), + module_config.clone() + ); + + // TODO: App badges + let badges = vec![]; + + button( + row(vec![ + column(vec![ + column(vec![ + text(module_config.name).size(18).into(), + text(repo_name.clone()).size(14).into(), + ]) + .into(), + row(badges).spacing(3).into(), + ]) + .spacing(3) + .into(), + horizontal_space().into(), + ]) + .spacing(3), + ) + // TODO: Repo management sub_screen + .on_press(Message::SetConfiguratorTab(ConfiguratorTab::ModuleDetail( + repo_id.clone(), + module_id.clone(), + Box::new(ConfiguratorTab::Modules), + ))) + .into() + }) + .collect::>>(), + ) + .into(), + ); } diff --git a/toolbox/ratchet/src/screens/configurator/repos/detail.rs b/toolbox/ratchet/src/screens/configurator/repos/detail.rs index 056a5d4..ce7ec9d 100644 --- a/toolbox/ratchet/src/screens/configurator/repos/detail.rs +++ b/toolbox/ratchet/src/screens/configurator/repos/detail.rs @@ -68,9 +68,19 @@ pub fn repo_detail_tab( if !repo_config.modules.is_empty() { let mut section = vec![text("Modules").size(20).into()]; - for (_module_id, module_config) in repo_config.modules.iter() { - // TODO: Go to module detail tab - section.push(button(column(vec![text(module_config.name.clone()).into()])).into()); + for (module_id, module_config) in repo_config.modules.iter() { + section.push( + button(column(vec![text(module_config.name.clone()).into()])) + .on_press(Message::SetConfiguratorTab(ConfiguratorTab::ModuleDetail( + repo_id.clone(), + module_id.clone(), + Box::new(ConfiguratorTab::RepoDetail( + repo_id.clone(), + prev_screen.clone(), + )), + ))) + .into(), + ); } content.push(column(section).spacing(6).into()); @@ -79,9 +89,21 @@ pub fn repo_detail_tab( if !repo_config.gesture_packs.is_empty() { let mut section = vec![text("Gesture Packs").size(20).into()]; - for (_pack_id, pack_config) in repo_config.gesture_packs.iter() { - // TODO: Go to gesture pack detail tab - section.push(button(column(vec![text(pack_config.name.clone()).into()])).into()); + for (gesture_pack_id, gesture_pack_config) in repo_config.gesture_packs.iter() { + section.push( + button(column(vec![text(gesture_pack_config.name.clone()).into()])) + .on_press(Message::SetConfiguratorTab( + ConfiguratorTab::GesturePackDetail( + repo_id.clone(), + gesture_pack_id.clone(), + Box::new(ConfiguratorTab::RepoDetail( + repo_id.clone(), + prev_screen.clone(), + )), + ), + )) + .into(), + ); } content.push(column(section).spacing(6).into()); diff --git a/toolbox/ratchet/src/screens/welcome/mod.rs b/toolbox/ratchet/src/screens/welcome/mod.rs index aa93178..5f30ed3 100644 --- a/toolbox/ratchet/src/screens/welcome/mod.rs +++ b/toolbox/ratchet/src/screens/welcome/mod.rs @@ -85,7 +85,7 @@ impl WelcomeScreen { row(vec![ button("From Scratch") .on_press(crate::Message::MoveToScreen(MoveToScreen::Wizard( - WizardStep::Intro, + WizardStep::FromScratchIntro, ))) .into(), button("to an Existing Instance") diff --git a/toolbox/ratchet/src/screens/wizard/mod.rs b/toolbox/ratchet/src/screens/wizard/mod.rs index 98ae806..6c677a8 100644 --- a/toolbox/ratchet/src/screens/wizard/mod.rs +++ b/toolbox/ratchet/src/screens/wizard/mod.rs @@ -1,5 +1,14 @@ +pub mod steps; + use crate::{ - screens::MoveToScreen, + screens::{ + MoveToScreen, + wizard::steps::{ + connection_type::connection_type, + from_scratch_intro::from_scratch_intro, + use_case::use_case, + }, + }, util::menu::gen_menu_bar, }; use iced::{ @@ -17,7 +26,8 @@ use log::debug; #[derive(Default, Debug, Clone)] pub struct WizardScreen { - step: WizardStep, + pub step: WizardStep, + pub first_step: WizardStep, } #[derive(Debug, Clone, Default)] @@ -33,6 +43,7 @@ impl WizardScreen { ( WizardScreen { step: starting_point, + first_step: starting_point, }, Task::none(), ) @@ -52,30 +63,9 @@ impl WizardScreen { controls.push(horizontal_space().into()); match self.step { - WizardStep::Intro => { - elements.push(text("introduction").into()); - - controls.push(button("Back").into()); - controls.push( - button("Forward") - .on_press(crate::Message::SetWizardStep(WizardStep::ConnectionType)) - .into(), - ); - } - WizardStep::ConnectionType => { - elements.push(text("existing connection type").into()); - - controls.push( - button("Back") - .on_press(crate::Message::SetWizardStep(WizardStep::Intro)) - .into(), - ); - controls.push( - button("Finish") - .on_press(crate::Message::SetWizardStep(WizardStep::Finishing)) - .into(), - ); - } + WizardStep::FromScratchIntro => from_scratch_intro(self, &mut elements, &mut controls), + WizardStep::UseCase => use_case(self, &mut elements, &mut controls), + WizardStep::ConnectionType => connection_type(self, &mut elements, &mut controls), WizardStep::Finishing => { elements.push(text("Connecting to: ").into()); @@ -134,7 +124,8 @@ impl WizardScreen { #[derive(Default, Debug, Clone, Copy)] pub enum WizardStep { #[default] - Intro, + FromScratchIntro, + UseCase, ConnectionType, Finishing, } diff --git a/toolbox/ratchet/src/screens/wizard/steps/connection_type.rs b/toolbox/ratchet/src/screens/wizard/steps/connection_type.rs new file mode 100644 index 0000000..328a6e8 --- /dev/null +++ b/toolbox/ratchet/src/screens/wizard/steps/connection_type.rs @@ -0,0 +1,34 @@ +use iced::{ + Element, + widget::{ + button, + text, + }, +}; + +use crate::{ + Message, + screens::wizard::{ + WizardScreen, + WizardStep, + }, +}; + +pub fn connection_type( + wizard_screen: &WizardScreen, + elements: &mut Vec>, + controls: &mut Vec>, +) { + elements.push(text("existing connection type").into()); + + controls.push( + button("Back") + .on_press(crate::Message::SetWizardStep(WizardStep::UseCase)) + .into(), + ); + controls.push( + button("Finish") + .on_press(crate::Message::SetWizardStep(WizardStep::Finishing)) + .into(), + ); +} diff --git a/toolbox/ratchet/src/screens/wizard/steps/from_scratch_intro.rs b/toolbox/ratchet/src/screens/wizard/steps/from_scratch_intro.rs new file mode 100644 index 0000000..c2793e2 --- /dev/null +++ b/toolbox/ratchet/src/screens/wizard/steps/from_scratch_intro.rs @@ -0,0 +1,45 @@ +use iced::{ + Element, + widget::{ + button, + row, + text, + }, +}; + +use crate::{ + Message, + screens::wizard::{ + WizardScreen, + WizardStep, + }, +}; + +pub fn from_scratch_intro( + _wizard_screen: &WizardScreen, + elements: &mut Vec>, + controls: &mut Vec>, +) { + elements.push(text("Creating an Instance from Scratch").size(20).into()); + elements.push(text("Thanks for choosing to use Clover for your bodily extensions! This wizard will guide you in creating a Clover instance from scratch using commonly available, hobbist parts and open source software; then constructing, and flashing your setup with Clover compatible firmware.").into()); + elements.push( + text("This copy of Ratchet has the full Clover documentation embeded for your convinience! Having the documentation open while you plan, setup, and use Clover for the first time is highly recommended.") + .into(), + ); + elements.push( + row(vec![ + button("Click here to view the embeded docs (new window), or...").into(), + button("Here to view the online version.").into(), + ]) + .spacing(6) + .into(), + ); + elements.push(text("Press \"Forward\" to continue.").into()); + + controls.push(button("Back").into()); + controls.push( + button("Forward") + .on_press(crate::Message::SetWizardStep(WizardStep::UseCase)) + .into(), + ); +} diff --git a/toolbox/ratchet/src/screens/wizard/steps/mod.rs b/toolbox/ratchet/src/screens/wizard/steps/mod.rs new file mode 100644 index 0000000..c643e88 --- /dev/null +++ b/toolbox/ratchet/src/screens/wizard/steps/mod.rs @@ -0,0 +1,3 @@ +pub mod connection_type; +pub mod from_scratch_intro; +pub mod use_case; diff --git a/toolbox/ratchet/src/screens/wizard/steps/use_case.rs b/toolbox/ratchet/src/screens/wizard/steps/use_case.rs new file mode 100644 index 0000000..b5e3b0c --- /dev/null +++ b/toolbox/ratchet/src/screens/wizard/steps/use_case.rs @@ -0,0 +1,74 @@ +use iced::{ + Element, + widget::{ + button, + column, + row, + text, + }, +}; +use iced_fonts::{ + REQUIRED_FONT, + required::{ + RequiredIcons, + icon_to_string, + }, +}; + +use crate::{ + Message, + screens::wizard::{ + WizardScreen, + WizardStep, + }, +}; + +#[derive(Debug, Clone)] +pub enum UseCase { + Fursuit, + Cosplay, + Cyborg, +} + +pub fn use_case( + _wizard_screen: &WizardScreen, + elements: &mut Vec>, + controls: &mut Vec>, +) { + elements.push(text("Choose a Use Case").size(20).into()); + + elements.push(text("To begin planning your setup, you'll want to figure out what you'll primarily be using Clover for.").into()); + + let bullets: Vec<(&str, Element, UseCase)> = vec![ + ("Fursuit", text("In this context, the fursuit can have many modules and features added to enable prolonged use of the fursuit; including expression replication, utility applications, and hardware regulation. You don't have to wear your suit all day, however, that is 100% possible with this option").into(), UseCase::Fursuit), + ("Cosplay", text("Clover will have multiple utility gestures configured for cosplaying at short, and longer intervals").into(), UseCase::Cosplay) + ]; + elements.push( + column( + bullets + .into_iter() + .map(|(label, element, chosen_use_case)| { + row(vec![ + text(icon_to_string(RequiredIcons::CaretRightFill)) + .font(REQUIRED_FONT) + .width(iced::Length::Shrink) + .align_y(iced::alignment::Vertical::Center) + .into(), + text(label).into(), + column(vec![element, button("Use!").into()]).into(), + ]) + .into() + }) + .collect::>>(), + ) + .spacing(6) + .into(), + ); + + controls.push(button("Back").into()); + controls.push( + button("Forward") + .on_press(crate::Message::SetWizardStep(WizardStep::ConnectionType)) + .into(), + ); +} diff --git a/toolbox/ratchet/src/util/mod.rs b/toolbox/ratchet/src/util/mod.rs index 7d4847d..6afa6db 100644 --- a/toolbox/ratchet/src/util/mod.rs +++ b/toolbox/ratchet/src/util/mod.rs @@ -1,2 +1,3 @@ pub mod get_app_data_dir; pub mod menu; +pub mod spawn_editor; diff --git a/toolbox/ratchet/src/util/open_link.rs b/toolbox/ratchet/src/util/open_link.rs new file mode 100644 index 0000000..f18655e --- /dev/null +++ b/toolbox/ratchet/src/util/open_link.rs @@ -0,0 +1,12 @@ +use anyhow::anyhow; + +pub fn spawn_editor(_path: &String, _use_servo: bool) -> Result<(), anyhow::Error> { + let ret = Err(anyhow!("Did not attempt to open link!")); + + #[cfg(target_os = "linux")] + #[cfg(target_os = "windows")] + #[cfg(target_os = "macos")] + todo!(); + + ret +} diff --git a/toolbox/ratchet/src/util/spawn_editor.rs b/toolbox/ratchet/src/util/spawn_editor.rs new file mode 100644 index 0000000..c3b9619 --- /dev/null +++ b/toolbox/ratchet/src/util/spawn_editor.rs @@ -0,0 +1,14 @@ +use std::path::Path; + +use anyhow::anyhow; + +pub fn spawn_editor(_path: &Path) -> Result<(), anyhow::Error> { + let ret = Err(anyhow!("Did not attempt to spawn editor!")); + + #[cfg(target_os = "linux")] + #[cfg(target_os = "windows")] + #[cfg(target_os = "macos")] + todo!(); + + ret +} -- 2.51.2