-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a safe Rust wrapper for the dialog file browser methods and the DialogsFileBrowserOptions type. Rename the DialogsApp::show() method to show_message() and create new show_file_browser() method. Add a getter method to FuriString to provide access to the inner sys::FuriString via a raw pointer because a sys::FuriString is needed by a few of the Furi C API functions. Extend the storage example to open a file browser and have the user select the file that was just written to the file system. Note: The Furi C struct is named DialogsFileBrowserOptions, but all other dialog types and functions are singular instead of plural. The Rust type is named DialogFileBrowserOptions. The DialogFileBrowserOptions type uses setter methods that return Self so they can be chained together in the builder pattern. The DialogFileBrowserOptions includes a Rust unit type phantom data member. The type or size does not really matter, but PhantomData does require a sized type. We just need one struct member to carry the lifetime parameter so that CStr and Icon references are not dropped until the struct goes out of scope.
- Loading branch information
Showing
4 changed files
with
139 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters