forked from 1b-agent/opencadstudio-upstream
refactor: move resource/IO root modules under io/
Relocate three root-level modules into io/, where they belong by concern: - update_check.rs -> io/update_check.rs (its own doc-comment notes it mirrors how crate::io wraps blocking calls in async). - patterns.rs, linetypes.rs -> io/ (standard resource catalogs parsed from asset files and populated into the document — IO-shaped work). Fix the moved files' include_str! paths (one level deeper), add the mod declarations to io/mod.rs, drop them from lib.rs/main.rs, and re-point all crate:: references to crate::io::. No behavior change. Co-Authored-By: Claude Opus 4.8 <[email protected]>
This commit is contained in:
1 parent
bbdbd0850b
commit
415dbe08d4
15 files changed
+18
-21
No files matched your search
+1
-1
@@ -1,5 +1,5 @@
|
||||
use crate::command::CadCommand;
|
||||
use crate::linetypes;
|
||||
use crate::io::linetypes;
|
||||
use crate::modules::draw::modify::refedit::RefEditSession;
|
||||
use crate::scene::pick::grip::GripEdit;
|
||||
use crate::scene::GripDef;
|
||||
|
||||
+1
-1
@@ -60,7 +60,7 @@ impl OpenCADStudio {
|
||||
} else {
|
||||
lt.name.clone()
|
||||
};
|
||||
let art = crate::linetypes::extract_pattern(<.description);
|
||||
let art = crate::io::linetypes::extract_pattern(<.description);
|
||||
ui::properties::LinetypeItem { name, art }
|
||||
})
|
||||
.collect();
|
||||
|
||||
+2
-2
@@ -1476,7 +1476,7 @@ pub enum Message {
|
||||
Noop,
|
||||
/// GitHub releases API returned a result. `Some(version)` means a
|
||||
/// newer release exists; we open the update-notice window.
|
||||
UpdateCheckResult(Option<crate::update_check::UpdateInfo>),
|
||||
UpdateCheckResult(Option<crate::io::update_check::UpdateInfo>),
|
||||
/// User dismissed the update-notice window.
|
||||
UpdateNoticeClose,
|
||||
/// First-launch default-association prompt: user accepted — register this
|
||||
@@ -2072,7 +2072,7 @@ impl OpenCADStudio {
|
||||
s.main_window = Some(id);
|
||||
let open_main = open_task.map(|_| Message::Noop);
|
||||
let check_update = Task::perform(
|
||||
crate::update_check::check_for_update(),
|
||||
crate::io::update_check::check_for_update(),
|
||||
Message::UpdateCheckResult,
|
||||
);
|
||||
let focus_cmd = s.focus_cmd_input();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use super::helpers::{entity_type_key, entity_type_label, title_case_word};
|
||||
use super::{OpenCADStudio, VARIES_LABEL};
|
||||
use crate::linetypes;
|
||||
use crate::io::linetypes;
|
||||
use crate::scene::view::dispatch;
|
||||
use crate::ui;
|
||||
use acadrust::{EntityType, Handle};
|
||||
|
||||
@@ -341,7 +341,7 @@ pub(super) fn on_open_file(&mut self) -> Task<Message> {
|
||||
self.tabs[i].scene.selected = rustc_hash::FxHashSet::default();
|
||||
self.tabs[i].scene.preview_wires = vec![];
|
||||
self.tabs[i].scene.current_layout = "Model".to_string();
|
||||
crate::linetypes::populate_document(&mut self.tabs[i].scene.document);
|
||||
crate::io::linetypes::populate_document(&mut self.tabs[i].scene.document);
|
||||
self.tabs[i].properties = PropertiesPanel::empty();
|
||||
// Seed the current table / multileader style from the file's
|
||||
// header so the ✓ marks the right one (text/dim/mline come from
|
||||
|
||||
@@ -537,7 +537,7 @@ impl OpenCADStudio {
|
||||
let i = self.active_tab;
|
||||
self.push_undo_snapshot(i, "CLEAR");
|
||||
self.tabs[i].scene.clear();
|
||||
crate::linetypes::populate_document(&mut self.tabs[i].scene.document);
|
||||
crate::io::linetypes::populate_document(&mut self.tabs[i].scene.document);
|
||||
self.tabs[i].properties = PropertiesPanel::empty();
|
||||
let doc_layers = self.tabs[i].scene.document.layers.clone();
|
||||
let vp_info = self.tabs[i].scene.viewport_list();
|
||||
@@ -2449,7 +2449,7 @@ impl OpenCADStudio {
|
||||
Task::none()
|
||||
}
|
||||
Message::UpdateNoticeOpenRelease => {
|
||||
crate::sys::open_url(crate::update_check::RELEASES_PAGE);
|
||||
crate::sys::open_url(crate::io::update_check::RELEASES_PAGE);
|
||||
self.close_active_modal();
|
||||
Task::none()
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user