1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-12-10 14:46:24 +01:00

Bug 1679 - Screenshot Tools 5 second delay non-functional

This commit is contained in:
James Crook
2017-08-14 18:53:44 +01:00
parent e98f08a2de
commit e23acb39eb

View File

@@ -169,15 +169,19 @@ enum
IdDelayCheckBox, IdDelayCheckBox,
IdCaptureFirst, IdCaptureFirst,
IdCaptureWindowContents = IdCaptureFirst, // No point delaying the capture of sets of things.
IdCaptureMenus= IdCaptureFirst,
IdCaptureEffects,
IdCapturePreferences,
// Put all events that need delay between AllDelayed and LastDelayed.
IdAllDelayedEvents,
IdCaptureToolbars =IdAllDelayedEvents,
IdCaptureWindowContents,
IdCaptureFullWindow, IdCaptureFullWindow,
IdCaptureWindowPlus, IdCaptureWindowPlus,
IdCaptureFullScreen, IdCaptureFullScreen,
IdCaptureToolbars,
IdCaptureMenus,
IdCaptureEffects,
IdCapturePreferences,
IdCaptureSelectionBar, IdCaptureSelectionBar,
IdCaptureSpectralSelection, IdCaptureSpectralSelection,
IdCaptureTools, IdCaptureTools,
@@ -198,14 +202,11 @@ enum
IdCaptureSecondTrack, IdCaptureSecondTrack,
IdCaptureLast = IdCaptureSecondTrack, IdCaptureLast = IdCaptureSecondTrack,
IdLastDelayedEvent,
IdToggleBackgroundBlue, IdToggleBackgroundBlue,
IdToggleBackgroundWhite, IdToggleBackgroundWhite,
// Put all events that might need delay below:
IdAllDelayedEvents,
IdLastDelayedEvent,
}; };
BEGIN_EVENT_TABLE(ScreenFrame, wxFrame) BEGIN_EVENT_TABLE(ScreenFrame, wxFrame)
@@ -472,16 +473,20 @@ bool ScreenFrame::ProcessEvent(wxEvent & e)
{ {
int id = e.GetId(); int id = e.GetId();
// If split into two parts to make for easier breakpoint
// when testing timer.
if (mDelayCheckBox && if (mDelayCheckBox &&
mDelayCheckBox->GetValue() && mDelayCheckBox->GetValue() &&
e.IsCommandEvent() && e.IsCommandEvent() &&
e.GetEventType() == wxEVT_COMMAND_BUTTON_CLICKED && e.GetEventType() == wxEVT_COMMAND_BUTTON_CLICKED)
id >= IdAllDelayedEvents && id <= IdLastDelayedEvent && {
if( id >= IdAllDelayedEvents && id <= IdLastDelayedEvent &&
e.GetEventObject() != NULL) { e.GetEventObject() != NULL) {
// safenew because it's a one-shot that deletes itself // safenew because it's a one-shot that deletes itself
ScreenFrameTimer *timer = safenew ScreenFrameTimer(this, e); ScreenFrameTimer *timer = safenew ScreenFrameTimer(this, e);
timer->Start(5000, true); timer->Start(5000, true);
return true; return true;
}
} }
if (e.IsCommandEvent() && e.GetEventObject() == NULL) { if (e.IsCommandEvent() && e.GetEventObject() == NULL) {
@@ -592,14 +597,15 @@ void ScreenFrame::OnCaptureSomething(wxCommandEvent & event)
wxArrayString Names; wxArrayString Names;
Names.Add(wxT("menus"));
Names.Add(wxT("effects"));
Names.Add(wxT("preferences"));
Names.Add(wxT("toolbars"));
Names.Add(wxT("window")); Names.Add(wxT("window"));
Names.Add(wxT("fullwindow")); Names.Add(wxT("fullwindow"));
Names.Add(wxT("windowplus")); Names.Add(wxT("windowplus"));
Names.Add(wxT("fullscreen")); Names.Add(wxT("fullscreen"));
Names.Add(wxT("toolbars"));
Names.Add(wxT("menus"));
Names.Add(wxT("effects"));
Names.Add(wxT("preferences"));
Names.Add(wxT("selectionbar")); Names.Add(wxT("selectionbar"));
Names.Add(wxT("spectralselection")); Names.Add(wxT("spectralselection"));
Names.Add(wxT("tools")); Names.Add(wxT("tools"));