From 0fe7b22103d5934c2aeedd5d37a539930005ff4d Mon Sep 17 00:00:00 2001 From: Leland Lucius Date: Mon, 17 Aug 2015 21:48:10 -0500 Subject: [PATCH] Revert to appmodel progresss dialogs only --- src/widgets/ProgressDialog.cpp | 45 ++++++++++++---------------------- src/widgets/ProgressDialog.h | 10 +++----- 2 files changed, 20 insertions(+), 35 deletions(-) diff --git a/src/widgets/ProgressDialog.cpp b/src/widgets/ProgressDialog.cpp index e36748eb4..7941a63fc 100644 --- a/src/widgets/ProgressDialog.cpp +++ b/src/widgets/ProgressDialog.cpp @@ -996,7 +996,7 @@ ProgressDialog::ProgressDialog() ProgressDialog::ProgressDialog(const wxString & title, const wxString & message, - ProgressDialogFlags flags) + int flags) : wxDialog() { Init(); @@ -1016,10 +1016,6 @@ ProgressDialog::~ProgressDialog() delete mDisable; mDisable = NULL; } - else if (mTopParent) - { - mTopParent->Enable(true); - } Beep(); } @@ -1028,13 +1024,12 @@ void ProgressDialog::Init() { mLastValue = 0; mDisable = NULL; - mTopParent = NULL; mIsTransparent = true; } bool ProgressDialog::Create(const wxString & title, const wxString & message, - ProgressDialogFlags flags) + int flags) { wxWindow *parent = GetParentForModalDialog(NULL, 0); @@ -1179,27 +1174,19 @@ bool ProgressDialog::Create(const wxString & title, wxDialog::Show(true); - if (flags & pdlgAppModal) - { - // Even though we won't necessarily show the dialog due to the 500ms - // delay, we MUST disable other windows/menus anyway since we run the risk - // of allowing other tasks to run before this one is complete. - // - // Reviewed this code per Proposed Features #1, at - // http://wiki.audacityteam.org/wiki/Proposal_Timer_Record_Improvements. - // Note that this causes a problem for Timer Record wait dialog - // (see TimerRecordDialog::RunWaitDialog()), because it makes it - // impossible to do any editing, even in other open projects, - // while waiting for Timer Record to start -- and then also - // while it's recording, it has a ProgressDialog, so really, - // no editing in any project until Timer Record finishes. - mDisable = new wxWindowDisabler(this); - } - else - { - mTopParent = wxGetTopLevelParent(GetParent()); - mTopParent->Enable(false); - } + // Even though we won't necessarily show the dialog due to the 500ms + // delay, we MUST disable other windows/menus anyway since we run the risk + // of allowing other tasks to run before this one is complete. + // + // Reviewed this code per Proposed Features #1, at + // http://wiki.audacityteam.org/wiki/Proposal_Timer_Record_Improvements. + // Note that this causes a problem for Timer Record wait dialog + // (see TimerRecordDialog::RunWaitDialog()), because it makes it + // impossible to do any editing, even in other open projects, + // while waiting for Timer Record to start -- and then also + // while it's recording, it has a ProgressDialog, so really, + // no editing in any project until Timer Record finishes. + mDisable = new wxWindowDisabler(this); return true; } @@ -1469,7 +1456,7 @@ void ProgressDialog::Beep() const TimerProgressDialog::TimerProgressDialog(const wxLongLong_t duration, const wxString & title, const wxString & message /*= wxEmptyString*/, - ProgressDialogFlags flags /*= pdlgEmptyFlags*/) + int flags /*= pdlgEmptyFlags*/) : ProgressDialog(title, message, flags) { mDuration = duration; diff --git a/src/widgets/ProgressDialog.h b/src/widgets/ProgressDialog.h index 886b9b426..f51d307ff 100644 --- a/src/widgets/ProgressDialog.h +++ b/src/widgets/ProgressDialog.h @@ -40,9 +40,8 @@ enum ProgressDialogFlags pdlgEmptyFlags = 0x00000000, pdlgHideStopButton = 0x00000001, pdlgHideCancelButton = 0x00000002, - pdlgAppModal = 0x00000004, - pdlgDefaultFlags = pdlgAppModal + pdlgDefaultFlags = pdlgEmptyFlags }; //////////////////////////////////////////////////////////// @@ -53,10 +52,10 @@ class AUDACITY_DLL_API ProgressDialog:public wxDialog { public: ProgressDialog(); - ProgressDialog(const wxString & title, const wxString & message = wxEmptyString, ProgressDialogFlags flags = pdlgDefaultFlags); + ProgressDialog(const wxString & title, const wxString & message = wxEmptyString, int flags = pdlgDefaultFlags); virtual ~ProgressDialog(); - virtual bool Create(const wxString & title, const wxString & message = wxEmptyString, ProgressDialogFlags flags = pdlgDefaultFlags); + virtual bool Create(const wxString & title, const wxString & message = wxEmptyString, int flags = pdlgDefaultFlags); int Update(int value, const wxString & message = wxEmptyString); int Update(double current, const wxString & message = wxEmptyString); @@ -92,7 +91,6 @@ private: // This guarantees we have an active event loop...possible during OnInit() wxEventLoopGuarantor mLoop; - wxWindow *mTopParent; wxWindowDisabler *mDisable; wxStaticText *mMessage; @@ -108,7 +106,7 @@ public: TimerProgressDialog(const wxLongLong_t duration, const wxString & title, const wxString & message = wxEmptyString, - ProgressDialogFlags flags = pdlgEmptyFlags); + int flags = pdlgDefaultFlags); int Update(const wxString & message = wxEmptyString); protected: