diff options
| author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2025-09-20 19:20:03 +0200 |
|---|---|---|
| committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2025-09-20 19:20:03 +0200 |
| commit | b45d74b60dfb7e23911df6b0523890e42f711267 (patch) | |
| tree | 42bb5764b05bd3bc5bffadb55f4375e6dce8a521 /app/bin/filenoteui.c | |
| parent | 6c1a798b0302034a7fdcaf93b8f014e2e458c2a0 (diff) | |
| parent | 63ec5715054be18ac4db5675e067b41c955d03b9 (diff) | |
Merge branch 'feature/upstream' into develop
Diffstat (limited to 'app/bin/filenoteui.c')
| -rw-r--r-- | app/bin/filenoteui.c | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/app/bin/filenoteui.c b/app/bin/filenoteui.c index 9b1c2d5..3cef58f 100644 --- a/app/bin/filenoteui.c +++ b/app/bin/filenoteui.c @@ -29,6 +29,7 @@ #include "paths.h" #include "include/stringxtc.h" #include "track.h" +#include "cundo.h" #define MYMIN(x, y) (((x) < (y)) ? (x) : (y)) @@ -198,16 +199,6 @@ FileDlgUpdate( /** - * Handle Cancel button: restore old values for layer and position - */ - -static void -FileEditCancel( wWin_p junk) -{ - ResetIfNotSticky(); - wHide(fileNoteW); -} -/** * Handle OK button: make sure the entered filename is syntactically valid, update * the layout and close the dialog * @@ -221,13 +212,19 @@ FileEditOK(void *junk) if ( trk == NULL ) { // new file note trk = NewNote( -1, fileNoteData.pos, OP_NOTEFILE ); + } else { + if ( ! descUndoStarted ) { + UndoStart( _("Update File Note"), "Update File Note" ); + descUndoStarted = TRUE; + } + UndoModify( trk ); } struct extraDataNote_t * xx = GET_EXTRA_DATA( trk, T_NOTE, extraDataNote_t ); xx->pos = fileNoteData.pos; SetTrkLayer( trk, fileNoteData.layer ); - MyFree( xx->noteData.fileData.title ); + UndoDeferFree( xx->noteData.fileData.title ); + UndoDeferFree( xx->noteData.fileData.path ); xx->noteData.fileData.title = MyStrdup( fileNoteData.title ); - MyFree( xx->noteData.fileData.path ); xx->noteData.fileData.path = MyStrdup( fileNoteData.path ); SetBoundingBox( trk, xx->pos, xx->pos ); DrawNewTrack( trk ); @@ -251,7 +248,7 @@ static void CreateEditFileDialog(char * windowTitle) fileNoteW = ParamCreateDialog(&fileNotePG, "", _("Done"), FileEditOK, - FileEditCancel, TRUE, NULL, + ParamCancel_Current, TRUE, NULL, F_BLOCK, FileDlgUpdate); } @@ -262,6 +259,7 @@ static void CreateEditFileDialog(char * windowTitle) ParamLoadControls(&fileNotePG); wControlActive(fileNotePLs[I_OPEN].control, (IsFileValid(fileNoteData.path)?TRUE:FALSE)); + descTitle = windowTitle; wShow(fileNoteW); } |
