forked from 1b-agent/opencadstudio-upstream
feat(plot): PSETUPIN and page-setup import, page setup for new layouts
- PSETUPIN / -PSETUPIN: with no arguments a file picker offers the chosen drawing's named page setups in the Plot dialog; `PSETUPIN <file>` opens the same chooser on that file; `PSETUPIN <file> *` or `PSETUPIN <file> name,name` import straight away. Same-named setups are replaced, the import is one undo step, and the report counts both. - The Plot dialog's page-setup list gains "Import…": the chooser shows the source drawing's setups with a tick each, All, Import and Cancel, and selects the first imported setup afterwards. The source is read off the UI thread with the same reader the editor uses for its own setups (`scene::document_page_setups`), and handles that only meant something in the source drawing (plot view, visual style) are dropped on import. - Options → General → Plotting: "Show the page setup for new layouts" opens the Plot / Page Setup dialog whenever a layout is created (persisted with the plot preferences). Tests: the document reader, the command (all / named / unknown / missing file / undo) against a drawing saved by the app, the chooser flow, and the new-layout option. Nine new strings in all 21 locales. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
7efb04a666
commit
74936063f9
35 files changed
+786
-48
No files matched your search
+25
-14
@@ -77,6 +77,8 @@ pub struct AppPrefs {
|
||||
pub right_click_mode: RightClickMode,
|
||||
/// SHORTCUTMENUDURATION: time-sensitive hold threshold, ms.
|
||||
pub right_click_hold_ms: i32,
|
||||
/// Open the Plot / Page Setup dialog for every new layout.
|
||||
pub page_setup_on_new_layout: bool,
|
||||
}
|
||||
|
||||
/// The fixed locations the Files page lists.
|
||||
@@ -323,6 +325,29 @@ pub fn view_window<'a>(
|
||||
]
|
||||
.spacing(10)
|
||||
.align_y(iced::Center),
|
||||
Space::new().height(22),
|
||||
text(crate::t!("Plotting")).size(15),
|
||||
Space::new().height(10),
|
||||
row![
|
||||
text(crate::t!("Plot device, paper, scale and plot styles"))
|
||||
.size(12)
|
||||
.width(Fill),
|
||||
button(text(crate::t!("Plot and Page Setup…")).size(11))
|
||||
.on_press(Message::PlotDialogOpen)
|
||||
.padding([4, 10])
|
||||
.style(button::secondary),
|
||||
]
|
||||
.spacing(10)
|
||||
.align_y(iced::Center),
|
||||
Space::new().height(10),
|
||||
row![
|
||||
iced::widget::checkbox(prefs.page_setup_on_new_layout)
|
||||
.on_toggle(Message::PageSetupOnNewLayoutChanged)
|
||||
.size(15),
|
||||
text(crate::t!("Show the page setup for new layouts")).size(12),
|
||||
]
|
||||
.spacing(8)
|
||||
.align_y(iced::Center),
|
||||
]
|
||||
.spacing(0)
|
||||
.width(sizing.width);
|
||||
@@ -418,20 +443,6 @@ pub fn view_window<'a>(
|
||||
]
|
||||
.spacing(8)
|
||||
.align_y(iced::Center),
|
||||
Space::new().height(22),
|
||||
text(crate::t!("Plotting")).size(15),
|
||||
Space::new().height(10),
|
||||
row![
|
||||
text(crate::t!("Plot device, paper, scale and plot styles"))
|
||||
.size(12)
|
||||
.width(Fill),
|
||||
button(text(crate::t!("Plot and Page Setup…")).size(11))
|
||||
.on_press(Message::PlotDialogOpen)
|
||||
.padding([4, 10])
|
||||
.style(button::secondary),
|
||||
]
|
||||
.spacing(10)
|
||||
.align_y(iced::Center),
|
||||
]
|
||||
.spacing(0)
|
||||
.width(sizing.width);
|
||||
|
||||
Reference in new issue
Block a user