diff --git a/src/gui/editing.cpp b/src/gui/editing.cpp index ea12eb591..f299b1af2 100644 --- a/src/gui/editing.cpp +++ b/src/gui/editing.cpp @@ -66,6 +66,8 @@ void FurnaceGUI::prepareUndo(ActionType action) { e->curPat[i].getPattern(e->curOrders->ord[i][curOrder],false)->copyOn(oldPat[i]); } break; + case GUI_UNDO_REPLACE: // this is handled by doReplace() + break; } } @@ -86,7 +88,7 @@ void FurnaceGUI::makeUndo(ActionType action) { if (oldOrders.ord[i][j]!=e->curOrders->ord[i][j]) { s.ord.push_back(UndoOrderData(subSong,i,j,oldOrders.ord[i][j],e->curOrders->ord[i][j])); } - } + }SATGDIOPTASDIOKP;ASDTG } s.oldOrdersLen=oldOrdersLen; s.newOrdersLen=e->curSubSong->ordersLen; @@ -126,6 +128,8 @@ void FurnaceGUI::makeUndo(ActionType action) { doPush=true; } break; + case GUI_UNDO_REPLACE: // this is handled by doReplace() + break; } if (doPush) { MARK_MODIFIED; @@ -943,6 +947,7 @@ void FurnaceGUI::doUndo() { case GUI_UNDO_PATTERN_FLIP: case GUI_UNDO_PATTERN_COLLAPSE: case GUI_UNDO_PATTERN_EXPAND: + case GUI_UNDO_REPLACE: for (UndoPatternData& i: us.pat) { e->changeSongP(i.subSong); DivPattern* p=e->curPat[i.chan].getPattern(i.pat,true); @@ -991,6 +996,7 @@ void FurnaceGUI::doRedo() { case GUI_UNDO_PATTERN_FLIP: case GUI_UNDO_PATTERN_COLLAPSE: case GUI_UNDO_PATTERN_EXPAND: + case GUI_UNDO_REPLACE: for (UndoPatternData& i: us.pat) { e->changeSongP(i.subSong); DivPattern* p=e->curPat[i.chan].getPattern(i.pat,true); diff --git a/src/gui/findReplace.cpp b/src/gui/findReplace.cpp index d5548c0fb..5dae95bc5 100644 --- a/src/gui/findReplace.cpp +++ b/src/gui/findReplace.cpp @@ -189,6 +189,12 @@ void FurnaceGUI::doFind() { queryViewingResults=true; } +/* issues with the find and replace function: + - doesn't mark the module as modified + - can't undo + - replace notes to anything starting from C-0 to lower notes will have an octave higher, so set it to replace to C-0 it will becom C-1, b_1 will become B-0 and so on +*/ + void FurnaceGUI::doReplace() { doFind(); queryViewingResults=false; @@ -399,6 +405,10 @@ void FurnaceGUI::doReplace() { for (int i=0; i