pub struct FileDialog { /* private fields */ }Expand description
The reusable file dialog — transient UI buffers + the current document
identity; the model itself lives in EngineState’s history.
Implementations§
Source§impl FileDialog
impl FileDialog
pub fn edit_component_part( &mut self, docs: &mut Documents, store: &dyn ModelStore, component_id: &str, )
Source§impl FileDialog
impl FileDialog
Sourcepub fn new() -> Self
pub fn new() -> Self
A closed dialog with empty buffers. Document identity (name + clean
baseline) lives on Document, so there is nothing to seed here.
Sourcepub fn busy_activities(&self) -> Vec<Activity>
pub fn busy_activities(&self) -> Vec<Activity>
The dialog’s own work in flight, for the status bar’s working indicator: a KiCad part’s 3D model being parsed off the UI thread.
pub fn instructions_pdf_pending(&self) -> bool
Sourcepub fn plm_save_as_pending(&self) -> bool
pub fn plm_save_as_pending(&self) -> bool
A PLM Save As is writing its copy. The dialog polls that future itself, outside the PLM executor, so automation waits ask here instead.
Sourcepub fn save_generation(&self) -> u64
pub fn save_generation(&self) -> u64
The monotonic successful-save counter — the shell feeds it to the update-components checker as half its staleness key.
Sourcepub fn dispatch(
&mut self,
action: FileAction,
docs: &mut Documents,
store: &dyn ModelStore,
)
pub fn dispatch( &mut self, action: FileAction, docs: &mut Documents, store: &dyn ModelStore, )
Act on a toolbar file button. New acts immediately (it adds a tab, so there is nothing to discard); all browsing flows use the same in-app modal on both platforms.
Sourcepub fn request_pick_file(
&mut self,
store: &dyn ModelStore,
tag: &str,
title: &str,
) -> Result<(), String>
pub fn request_pick_file( &mut self, store: &dyn ModelStore, tag: &str, title: &str, ) -> Result<(), String>
Ask for a file (plm-cad-integration-todo S8 / S14’s “Add file…”). tag
names the asker, which takes the file with Self::take_picked_file;
title heads the chooser. Natively the chooser is this dialog’s own
explorer over the machine’s files (one behaviour on every platform, and
drivable by scripts); in the browser it is the page’s file input.
Err where neither exists.
Sourcepub fn take_picked_file(&mut self, tag: &str) -> Option<PickedFile>
pub fn take_picked_file(&mut self, tag: &str) -> Option<PickedFile>
The file the chooser delivered for tag, once.
Sourcepub fn picking(&self, tag: &str) -> bool
pub fn picking(&self, tag: &str) -> bool
Whether a pick for tag is still open (the chooser is up, or the
browser’s is and has not answered).
Sourcepub fn show(
&mut self,
ctx: &Context,
docs: &mut Documents,
store: &dyn ModelStore,
)
pub fn show( &mut self, ctx: &Context, docs: &mut Documents, store: &dyn ModelStore, )
Draw the modal (if open) and pick up any completed async import. Called every frame by the shell with a ctx-level handle (the modal is ctx-level, like the command palette).
Sourcepub fn request_close(&mut self, docs: &mut Documents, index: usize)
pub fn request_close(&mut self, docs: &mut Documents, index: usize)
CLOSE tab index with the unsaved-changes contract: a DIRTY document
prompts to discard first (the confirm modal); a clean one closes
immediately. The tab strip’s \u{2715} routes here — it is the only
door through which unsaved work can be dropped, so it is the only one
that asks.
Sourcepub fn take_plm_new_part(&mut self) -> bool
pub fn take_plm_new_part(&mut self) -> bool
Save As asked for a new PLM part: the shell opens the PLM pane’s New part form. Once: true the frame after it was chosen.
Sourcepub fn open_document(
&mut self,
docs: &mut Documents,
store: &dyn ModelStore,
name: &str,
)
pub fn open_document( &mut self, docs: &mut Documents, store: &dyn ModelStore, name: &str, )
Open — read a stored document into its own tab (or focus the tab already holding it). The one door every open lane uses: File>Open, the Edit-Part flow, and the session restore’s siblings.
Sourcepub fn request_save_file(
&mut self,
docs: &mut Documents,
store: &dyn ModelStore,
request: SaveRequest,
) -> Result<(), String>
pub fn request_save_file( &mut self, docs: &mut Documents, store: &dyn ModelStore, request: SaveRequest, ) -> Result<(), String>
A panel’s export (the JavaScript editor’s script, a plugin bundle, a
PLM download): hand request to the user through the export door.
Desktop: the Save-file chooser opens. Browser: the download, now.
Err only when the download could not start.
Sourcepub fn take_stl_import(&mut self) -> Option<(MeshImportFormat, String, Vec<u8>)>
pub fn take_stl_import(&mut self) -> Option<(MeshImportFormat, String, Vec<u8>)>
Selecting an STL or a 3MF starts a preview session; only its Accept action edits the destination document.
Sourcepub fn generate_active_family(
&mut self,
docs: &mut Documents,
store: &dyn ModelStore,
save: bool,
) -> Result<GenerateReport, String>
pub fn generate_active_family( &mut self, docs: &mut Documents, store: &dyn ModelStore, save: bool, ) -> Result<GenerateReport, String>
Run the family’s Generate on the ACTIVE document (a family seed) and
keep the report for the automation blob. The one door the automation
command and the table editor’s button share.
Generate the active family. On a PLM store (the document is a
part/…/rev/… revision and the session has a client) the server
writes the members from the family’s SAVED revision: a family with
unsaved edits is refused unless save is set, which saves it first
(plm-cad-integration-todo S9). Everywhere else this is the file-system
Generate, and save is ignored.
Sourcepub fn file_state_json(
&self,
docs: &Documents,
store: &dyn ModelStore,
) -> String
pub fn file_state_json( &self, docs: &Documents, store: &dyn ModelStore, ) -> String
The published state for the headed verifier: current name, dirty flag, backend label, the stored-document list, and the modal’s open/mode.
Auto Trait Implementations§
impl !RefUnwindSafe for FileDialog
impl !Send for FileDialog
impl !Sync for FileDialog
impl !UnwindSafe for FileDialog
impl Forget for FileDialog
impl Freeze for FileDialog
impl Unpin for FileDialog
impl UnsafeUnpin for FileDialog
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.