Update of /cvsroot/audacity/audacity-src/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv2541
Modified Files: Menus.cpp Log Message: Patch from Vidyashankar to fix P5 "Pressing OK in Preferences removes action-specific text in last Undo menu item" (also fixes Redo menu item) Index: Menus.cpp =================================================================== RCS file: /cvsroot/audacity/audacity-src/src/Menus.cpp,v retrieving revision 1.530 retrieving revision 1.531 diff -u -d -r1.530 -r1.531 --- Menus.cpp 18 Oct 2009 19:58:17 -0000 1.530 +++ Menus.cpp 20 Oct 2009 23:32:09 -0000 1.531 @@ -330,7 +330,18 @@ c->SetDefaultFlags(AudioIONotBusyFlag | TimeSelectedFlag | TracksSelectedFlag, AudioIONotBusyFlag | TimeSelectedFlag | TracksSelectedFlag); - c->AddItem(wxT("Undo"), _("&Undo"), FN(OnUndo), wxT("Ctrl+Z"), + wxString undoStr = _(""); + UndoManager *undoMgr = GetUndoManager(); + if(undoMgr->UndoAvailable()) + { + wxString undoDescription = _(""); + unsigned int state = undoMgr->GetCurrentState(); + undoMgr->GetShortDescription(state, &undoDescription); + undoStr = _("&Undo " + undoDescription); + } + else + undoStr = _("Can't Undo"); + c->AddItem(wxT("Undo"), undoStr, FN(OnUndo), wxT("Ctrl+Z"), AudioIONotBusyFlag | UndoAvailableFlag, AudioIONotBusyFlag | UndoAvailableFlag); @@ -342,7 +353,17 @@ wxT("Ctrl+Shift+Z"); #endif - c->AddItem(wxT("Redo"), _("&Redo"), FN(OnRedo), key, + wxString redoStr = _(""); + if(undoMgr->RedoAvailable()) + { + wxString redoDescription = _(""); + unsigned int state = undoMgr->GetCurrentState(); + undoMgr->GetShortDescription(state + 1, &redoDescription); // redo state is current state + 1 + redoStr = _("&Redo " + redoDescription); + } + else + redoStr = _("Can't Redo"); + c->AddItem(wxT("Redo"), redoStr, FN(OnRedo), key, AudioIONotBusyFlag | RedoAvailableFlag, AudioIONotBusyFlag | RedoAvailableFlag); ------------------------------------------------------------------------------ Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference _______________________________________________ Audacity-cvs mailing list Audacity-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/audacity-cvs