diff options
| author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2025-09-20 19:19:34 +0200 |
|---|---|---|
| committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2025-09-20 19:19:34 +0200 |
| commit | e7d20cf352688bf717a01f4e6d9e6f497c2bea4c (patch) | |
| tree | cfd2ef9b569f49af985a6f1ec44f2614f63c8e78 /app/bin/filenoteui.c | |
| parent | a14a7a0ccc9de76aeab0b2e4bbf58f1a79deedc2 (diff) | |
New upstream version 5.3.1Beta2upstream/5.3.1Beta2
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); } |
