-
Notifications
You must be signed in to change notification settings - Fork 87
Conversation
crates/core/src/share.rs
Outdated
pub fn export( | ||
addons: HashMap<Flavor, Vec<Addon>>, | ||
output_dir: impl AsRef<Path>, | ||
) -> Result<(), error::FilesystemError> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With this function, we can easily just pass a cloned map of the addons and it'll save it to the supplied path as "ajour-addons.yml"
crates/core/src/share.rs
Outdated
pub fn parse_only_needed( | ||
existing_addons: HashMap<Flavor, Vec<Addon>>, | ||
import_string: String, | ||
) -> Result<HashMap<Flavor, Vec<Data>>, serde_yaml::Error> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no "import" function because I envision us just hooking right into the existing "install" process on the gui update loop. So this just parses the file and removes collisions. The resulting output has all the data needed to hook right into what Message::Interaction(Interaction::InstallAddon
does.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should instead return a Parsed
structure that has the hashmap, but also a field that tells how many collisions were removed so we can display this in gui
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added the Parsed structure in latest commit
I think we change the |
@casperstorm Import / export buttons are hooked up and work great! As a phase 2, it'd be nice to have a "Confirmation" screen with the parsed addons prior to installing, where we can display how many collisions were removed and even allow "deselecting" addons. |
Another cool idea would be to add the export file to backups! |
Also, we need to build out the CLI command for this functionality. |
Code looks great @tarkah. fatal runtime error: Rust cannot catch foreign exceptions
[1] 39509 abort cargo run Running Update from the repo:
https://github.com/balthild/native-dialog-rs/#why-the-program-crashed-when-opening-a-dialog-on-macos |
This LGTM for a first iteration. After merge to master we update all translations. |
cb6abca
to
b316e4b
Compare
Resolves: #659
Initial commit, this only adds the proposed data structure for exporting and a couple functions
Checklist
CHANGELOG.md
if knowledge of this change could be valuable to users