summaryrefslogtreecommitdiff
path: root/Userland/Applications/Spreadsheet/SpreadsheetModel.h
diff options
context:
space:
mode:
authorZack Penn <zack@sysdevs.org>2022-02-19 14:03:50 -0600
committerAli Mohammad Pur <Ali.mpfard@gmail.com>2022-02-21 16:04:48 +0330
commite41dfa6599c9768e81147c04cd4f5d1c697a4d54 (patch)
tree741782ba2124c02bad43d5b90aad6661096d6a9a /Userland/Applications/Spreadsheet/SpreadsheetModel.h
parentd00781de36f8f9c22d77ad2e1f2d6d3279a9b8f5 (diff)
downloadserenity-e41dfa6599c9768e81147c04cd4f5d1c697a4d54.zip
Spreadsheet: Add undo/redo implementation
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
Diffstat (limited to 'Userland/Applications/Spreadsheet/SpreadsheetModel.h')
-rw-r--r--Userland/Applications/Spreadsheet/SpreadsheetModel.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/Userland/Applications/Spreadsheet/SpreadsheetModel.h b/Userland/Applications/Spreadsheet/SpreadsheetModel.h
index f28411db23..5c6dcb36a5 100644
--- a/Userland/Applications/Spreadsheet/SpreadsheetModel.h
+++ b/Userland/Applications/Spreadsheet/SpreadsheetModel.h
@@ -29,6 +29,8 @@ public:
void update();
+ Function<void(Cell&, String&)> on_cell_data_change;
+
private:
explicit SheetModel(Sheet& sheet)
: m_sheet(sheet)