From ad5d2a8599b3fdc526afec891208bebbc62783ee Mon Sep 17 00:00:00 2001 From: ramox81 <184937705+ramox81@users.noreply.github.com> Date: Mon, 5 Oct 2026 10:00:28 +0300 Subject: [PATCH] Sheet sets: wizard paths, Turkish step names and codec pin Co-Authored-By: Claude Opus 5.5 --- Cargo.lock | 1 + Cargo.toml | 2 +- locales/tr-TR/opencadstudio.ftl | 4 ++-- src/app/commands/sheet_set.rs | 27 ++++++++++++++++++++------- src/ui/window/sheet_set.rs | 2 +- 5 files changed, 25 insertions(+), 11 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 378e66a6f..7d6d8182e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4206,6 +4206,7 @@ dependencies = [ [[package]] name = "opencadcodec" version = "0.5.5" +source = "git+https://github.com/ramox81/cadcodec.git?rev=19aec85#19aec855cf38d1dbdaf32d09c69343fc479bfbf9" dependencies = [ "ahash 0.8.12", "anyhow", diff --git a/Cargo.toml b/Cargo.toml index 6c34b44e3..c59d8bd1c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -91,7 +91,7 @@ block2 = "0.5" objc2-foundation = { version = "0.2", features = ["NSArray", "NSURL", "NSString", "NSObject", "NSNotification", "NSThread", "NSEnumerator"] } [patch."https://github.com/HakanSeven12/opencadcodec.git"] -opencadcodec = { path = "../cadcodec-sheetset" } +opencadcodec = { git = "https://github.com/ramox81/cadcodec.git", rev = "19aec85" } [patch.crates-io] iced_core = { git = "https://github.com/iced-rs/iced.git", rev = "23604ff22ab0aad9e00b9327cb7b8546ed84db39" } diff --git a/locales/tr-TR/opencadstudio.ftl b/locales/tr-TR/opencadstudio.ftl index b7888a699..8448b40e6 100644 --- a/locales/tr-TR/opencadstudio.ftl +++ b/locales/tr-TR/opencadstudio.ftl @@ -1917,7 +1917,7 @@ common = .allow-selection-cycling = Allow selection cycling .allow-writing-to-source-file = Allow writing to source file .break-specify-second-break-point-or-first-point = BREAK Specify second break point or [First point]: - .begin = Begin + .begin = Başla .chamferedge-select-a-base-face-edge = CHAMFEREDGE: select a base face edge. .cannot-delete-beyond-this = Cannot delete beyond this. .cell-range = Cell range @@ -2168,7 +2168,7 @@ common = .select-surfaces-to-thicken = Select surfaces to thicken: .selected-objects-in-current-drawing = Selected objects in current drawing .set-cell-styles = Set cell styles - .sheet = Sheet + .sheet = Sayfa .show-associativity = Show associativity .show-command-prompting-and-command-input-near-crosshairs = Show command prompting and command input near crosshairs .show-count-column = Show count column diff --git a/src/app/commands/sheet_set.rs b/src/app/commands/sheet_set.rs index 73d7ecef8..809ffd874 100644 --- a/src/app/commands/sheet_set.rs +++ b/src/app/commands/sheet_set.rs @@ -434,6 +434,16 @@ impl OpenCADStudio { sync_wizard_draft(&mut w); let set = w.draft.sheet_set().id().to_string(); let mut p = build_properties(&w.draft, &set, None); + // The set is not written yet: show where it will be. + for row in &mut p.rows { + match row.key { + RowKey::ReadOnly if row.label == "Sheet set data file" => { + row.value = crate::ui::window::sheet_set::wizard_dst_path(&w) + } + RowKey::Folder(_) if row.value.is_empty() => row.value = w.folder.clone(), + _ => {} + } + } p.wizard = Some(Box::new(w)); self.sheet_set.dialog = Some(SsDialog::Properties(p)); } @@ -684,8 +694,8 @@ impl OpenCADStudio { doc.set_sheet_set_data(&SheetSetData { layout_handle: handle, layout_name: reference.name, - sheet_dwg_name: path.clone(), - sheet_set_file_name: db.path.clone().unwrap_or_default(), + sheet_dwg_name: ss::native_path(&path), + sheet_set_file_name: ss::native_path(db.path.as_deref().unwrap_or_default()), sheet_set_version: db.file_revision(), update_count: previous.update_count + 1, update_time: utc_stamp(), @@ -888,9 +898,12 @@ impl OpenCADStudio { let mut db = w.draft.clone(); db.path = Some(path.clone()); let set = db.sheet_set().id().to_string(); - if db.file_reference(&set, "NewSheetLocation").is_none() { - db.set_file_reference(&set, "NewSheetLocation", &w.folder); - } + // Written again now the `.dst` has a place, so it carries its relative path. + let location = db + .file_reference(&set, "NewSheetLocation") + .filter(|f| !f.is_empty()) + .unwrap_or_else(|| w.folder.clone()); + db.set_file_reference(&set, "NewSheetLocation", &location); // Existing drawings: a subset per folder, a sheet per chosen layout. if w.existing { for folder in &w.folders { @@ -1061,7 +1074,7 @@ impl OpenCADStudio { let Some(sheet) = db.add_sheet(&f.component, &f.number, &title, "") else { return Task::none(); }; - let file = path.to_string_lossy().to_string(); + let file = ss::native_path(&path.to_string_lossy()); db.set_layout_reference( &sheet, "Layout", @@ -1076,7 +1089,7 @@ impl OpenCADStudio { layout_handle: handle.to_lowercase(), layout_name, sheet_dwg_name: file.clone(), - sheet_set_file_name: dst, + sheet_set_file_name: ss::native_path(&dst), sheet_set_version: revision, update_count: 1, update_time: utc_stamp(), diff --git a/src/ui/window/sheet_set.rs b/src/ui/window/sheet_set.rs index 690de72dc..18d3f37b1 100644 --- a/src/ui/window/sheet_set.rs +++ b/src/ui/window/sheet_set.rs @@ -754,7 +754,7 @@ fn wizard_view<'a>(w: &'a Wizard) -> Element<'a, Message> { /// Where the wizard writes the `.dst`. pub fn wizard_dst_path(w: &Wizard) -> String { - std::path::Path::new(&w.folder).join(format!("{}.dst", w.name.trim())).to_string_lossy().to_string() + ss::native_path(&std::path::Path::new(&w.folder).join(format!("{}.dst", w.name.trim())).to_string_lossy()) } fn properties_view<'a>(p: &'a Properties) -> Element<'a, Message> {