Revert to appmodel progresss dialogs only
This commit is contained in:
parent
48ed1fe767
commit
0fe7b22103
|
@ -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;
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue