Enables the ability to undo changes in metadata without undoing chages
in data. Previously there was only CellUndoData which cannot undo things
such as changes in cell background color.
We have a new, improved string type coming up in AK (OOM aware, no null
state), and while it's going to use UTF-8, the name UTF8String is a
mouthful - so let's free up the String name by renaming the existing
class.
Making the old one have an annoying name will hopefully also help with
quick adoption :^)
Each of these strings would previously rely on StringView's char const*
constructor overload, which would call __builtin_strlen on the string.
Since we now have operator ""sv, we can replace these with much simpler
versions. This opens the door to being able to remove
StringView(char const*).
No functional changes.
Instead of having the undo operation only be able to undo one cell
for a given undo, make it able to handle multiple cells at a time.
Please enter the commit message for your changes. Lines starting
The Spreadsheet application currently does not support undo/redo,
and with this update, we are starting the process of adding this feature
:-)
Additionally, the save dialog has been updated to use
GUI::MessageBox::ask_about_unsaved_changes() for system cohesity.
Spreadsheet: Add basic undo functinoality
The spreadsheet application now has basic support for undo. Testing of
this feature is limited, and may not work as intended yet.
Spreadsheet: Add callback when a cell's value is changed
In addition to the callback being added, this commit also exposes the
SheetModel class via a getter in SpreadSheetView.
Spreadsheet: Remove debug statements and use cell change callback
This commit uses the on_cell_data_change callback from within the
SheetModel class. This allows for us to push/pop changes to the undo
stack.
With this, we have basic Undo/Redo functionality :-)
Spreadsheet: Actually add window::set_modified
Spreadsheet: Const-correctness :-)
Spreadsheet: Reorder the edit menu actions
Most of the models were just calling did_update anyway, which is
pointless since it can be unified to the base Model class. Instead, code
calling update() will now call invalidate(), which functions identically
and is more obvious in what it does.
Additionally, a default implementation is provided, which removes the
need to add empty implementations of update() for each model subclass.
Co-Authored-By: Ali Mohammad Pur <ali.mpfard@gmail.com>
SPDX License Identifiers are a more compact / standardized
way of representing file license information.
See: https://spdx.dev/resources/use/#identifiers
This was done with the `ambr` search and replace tool.
ambr --no-parent-ignore --key-from-file --rep-from-file key.txt rep.txt *