Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR will replace the src/file.rs mess with a proper GObject-based class hierarchy to manage saving data into files. Here is how it will work.
CarteroSerializable
This is the IDL for the interface:
CarteroEndpointPane
The EndpointPane has been marked as Serializable. It has received a
dirty
property and it has lost theitem_pane
connection.There are implementations for the Serializable methods:
CarteroItemPane
It expects now a child that implements
CarteroSerializable
. The newserializable()
method will downcast the child into aSerializable
, and it has been validated that the virtual methods of the interface can be called from the ItemPane now.New methods:
file
property (if present), and updates the child pane state by callingfrom_toml()
with the file contents.to_toml()
and saves the string into the file designated by thefile
property, if present.Aside from that, the ItemPane will not care anymore about the type of the child (so it will not cast to EndpointPane directly).
CarteroWindow
It has been updated to use the new integration. The read file and save file actions, triggerable via buttons and menus, now will just call
load_pane()
orsave_pane()
on the currently visible pane. If there is no file associated with the ItemPane, it will still offer to assign a file first via the save file dialog.src/file.rs
Most of the TOML serialization code has been scraped.