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/linknoteui.c | |
| parent | a14a7a0ccc9de76aeab0b2e4bbf58f1a79deedc2 (diff) | |
New upstream version 5.3.1Beta2upstream/5.3.1Beta2
Diffstat (limited to 'app/bin/linknoteui.c')
| -rw-r--r-- | app/bin/linknoteui.c | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/app/bin/linknoteui.c b/app/bin/linknoteui.c index a47bb58..31cb9de 100644 --- a/app/bin/linknoteui.c +++ b/app/bin/linknoteui.c @@ -28,6 +28,7 @@ #include "include/stringxtc.h" #include "track.h" #include "validator.h" +#include "cundo.h" #define DEFAULTLINKURL "http://www.xtrkcad.org/" #define DEFAULTLINKTITLE "The XTrackCAD Homepage" @@ -116,16 +117,6 @@ LinkDlgUpdate( } } -/** -* Handle Cancel button: restore old values for layer and position -*/ - -static void -LinkEditCancel( wWin_p junk) -{ - ResetIfNotSticky(); - wHide(linkNoteW); -} /** * Handle OK button: make sure the entered URL is syntactically valid, update @@ -141,13 +132,19 @@ LinkEditOK(void *junk) if ( trk == NULL ) { // new note trk = NewNote( -1, linkNoteData.pos, OP_NOTELINK ); + } else { + if ( ! descUndoStarted ) { + UndoStart( _("Update Link Note"), "Update Link Note" ); + descUndoStarted = TRUE; + } + UndoModify( trk ); } struct extraDataNote_t * xx = GET_EXTRA_DATA( trk, T_NOTE, extraDataNote_t ); xx->pos = linkNoteData.pos; SetTrkLayer( trk, linkNoteData.layer ); - MyFree( xx->noteData.linkData.title ); + UndoDeferFree( xx->noteData.linkData.title ); + UndoDeferFree( xx->noteData.linkData.url ); xx->noteData.linkData.title = MyStrdup( linkNoteData.title ); - MyFree( xx->noteData.linkData.url ); xx->noteData.linkData.url = MyStrdup( linkNoteData.url ); SetBoundingBox( trk, xx->pos, xx->pos ); DrawNewTrack( trk ); @@ -167,7 +164,7 @@ CreateEditLinkDialog(char *title) linkNoteW = ParamCreateDialog(&linkNotePG, "", _("Done"), LinkEditOK, - LinkEditCancel, TRUE, NULL, + ParamCancel_Current, TRUE, NULL, F_BLOCK, LinkDlgUpdate); } @@ -176,6 +173,7 @@ CreateEditLinkDialog(char *title) FillLayerList((wList_p)linkNotePLs[I_LAYER].control); ParamLoadControls(&linkNotePG); + descTitle = title; // and show the dialog wShow(linkNoteW); |
