Audacity 3.2.0
|
ProgressDialog Class. More...
#include <ProgressDialog.h>
Public Types | |
using | MessageColumn = std::vector< TranslatableString > |
using | MessageTable = std::vector< MessageColumn > |
Public Member Functions | |
ProgressDialog () | |
Methods for ProgressDialog. More... | |
ProgressDialog (const TranslatableString &title, const TranslatableString &message={}, int flags=pdlgDefaultFlags, const TranslatableString &sRemainingLabelText={}) | |
virtual | ~ProgressDialog () |
bool | Create (const TranslatableString &title, const TranslatableString &message={}, int flags=pdlgDefaultFlags, const TranslatableString &sRemainingLabelText={}) |
void | Reinit () override |
Reset the dialog state. More... | |
void | SetDialogTitle (const TranslatableString &title) override |
Change the dialog's title. More... | |
ProgressResult | Update (int value, const TranslatableString &message={}) |
ProgressResult | Update (double current, const TranslatableString &message={}) |
ProgressResult | Update (double current, double total, const TranslatableString &message={}) |
ProgressResult | Update (wxULongLong_t current, wxULongLong_t total, const TranslatableString &message={}) |
ProgressResult | Update (wxLongLong current, wxLongLong total, const TranslatableString &message={}) |
ProgressResult | Update (wxLongLong_t current, wxLongLong_t total, const TranslatableString &message={}) |
ProgressResult | Update (int current, int total, const TranslatableString &message={}) |
ProgressResult | Poll (unsigned long long numerator, unsigned long long denominator, const TranslatableString &message={}) override |
Update the bar and poll for clicks. Call only on the main thread. More... | |
void | SetMessage (const TranslatableString &message) override |
Change an existing dialog's message. More... | |
Public Member Functions inherited from wxDialogWrapper | |
wxDialogWrapper () | |
wxDialogWrapper (wxWindow *parent, wxWindowID id, const TranslatableString &title, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxDEFAULT_DIALOG_STYLE, const TranslatableString &name=XO("Dialog")) | |
bool | Create (wxWindow *parent, wxWindowID id, const TranslatableString &title, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxDEFAULT_DIALOG_STYLE, const TranslatableString &name=XO("Dialog")) |
void | SetTitle (const TranslatableString &title) |
void | SetLabel (const TranslatableString &title) |
void | SetName (const TranslatableString &title) |
void | SetName () |
Public Member Functions inherited from wxTabTraversalWrapper< wxDialog > | |
wxTabTraversalWrapper (Args &&... args) | |
wxTabTraversalWrapper (const wxTabTraversalWrapper &)=delete | |
wxTabTraversalWrapper (wxTabTraversalWrapper &&)=delete | |
wxTabTraversalWrapper & | operator= (const wxTabTraversalWrapper &)=delete |
wxTabTraversalWrapper & | operator= (wxTabTraversalWrapper &&)=delete |
virtual | ~ProgressDialog () |
virtual ProgressResult | Poll (unsigned long long numerator, unsigned long long denominator, const TranslatableString &message={})=0 |
Update the bar and poll for clicks. Call only on the main thread. More... | |
virtual void | SetMessage (const TranslatableString &message)=0 |
Change an existing dialog's message. More... | |
virtual void | SetDialogTitle (const TranslatableString &title)=0 |
Change the dialog's title. More... | |
virtual void | Reinit ()=0 |
Reset the dialog state. More... | |
Protected Member Functions | |
ProgressDialog (const TranslatableString &title, const MessageTable &columns, int flags=pdlgDefaultFlags, const TranslatableString &sRemainingLabelText={}) | |
bool | Create (const TranslatableString &title, const MessageTable &columns, int flags=pdlgDefaultFlags, const TranslatableString &sRemainingLabelText={}) |
Protected Attributes | |
wxWindowRef | mHadFocus |
wxStaticText * | mElapsed |
wxStaticText * | mRemaining |
wxGauge * | mGauge |
wxLongLong_t | mStartTime |
wxLongLong_t | mLastUpdate |
wxLongLong_t | mYieldTimer |
wxLongLong_t | mElapsedTime {} |
int | mLastValue |
bool | mCancel |
bool | mStop |
bool | mIsTransparent |
bool | m_bShowElapsedTime = true |
bool | m_bConfirmAction = false |
Private Member Functions | |
void | Init () |
bool | SearchForWindow (const wxWindowList &list, const wxWindow *searchfor) const |
void | OnCancel (wxCommandEvent &e) |
void | OnStop (wxCommandEvent &e) |
void | OnCloseWindow (wxCloseEvent &e) |
void | Beep () const |
bool | ConfirmAction (const TranslatableString &sPrompt, const TranslatableString &sTitle, int iButtonID=-1) |
void | AddMessageAsColumn (wxBoxSizer *pSizer, const MessageColumn &column, bool bFirstColumn) |
Private Attributes | |
wxEventLoopGuarantor | mLoop |
std::unique_ptr< wxWindowDisabler > | mDisable |
wxStaticText * | mMessage {} |
int | mLastW { 0 } |
int | mLastH { 0 } |
std::chrono::nanoseconds | mTotalPollTime {} |
unsigned | mPollsCount { 0 } |
std::chrono::nanoseconds | mTotalYieldTime {} |
unsigned | mYieldsCount { 0 } |
ProgressDialog Class.
Custom progress dialog with Audacity specific semantics.
Definition at line 50 of file ProgressDialog.h.
using ProgressDialog::MessageColumn = std::vector< TranslatableString > |
Definition at line 63 of file ProgressDialog.h.
using ProgressDialog::MessageTable = std::vector< MessageColumn > |
Definition at line 64 of file ProgressDialog.h.
ProgressDialog::ProgressDialog | ( | ) |
Methods for ProgressDialog.
Definition at line 1000 of file ProgressDialog.cpp.
ProgressDialog::ProgressDialog | ( | const TranslatableString & | title, |
const TranslatableString & | message = {} , |
||
int | flags = pdlgDefaultFlags , |
||
const TranslatableString & | sRemainingLabelText = {} |
||
) |
Definition at line 1005 of file ProgressDialog.cpp.
References Create(), and title.
|
protected |
Definition at line 1014 of file ProgressDialog.cpp.
References Create(), and title.
|
virtual |
Reimplemented from BasicUI::ProgressDialog.
Definition at line 1026 of file ProgressDialog.cpp.
References Beep(), mDisable, mElapsedTime, mHadFocus, mPollsCount, mTotalPollTime, mTotalYieldTime, mYieldsCount, SearchForWindow(), and ExportProgressUI::Show().
|
private |
Definition at line 1125 of file ProgressDialog.cpp.
References mMessage, safenew, and anonymous_namespace{LogWindow.cpp}::sText.
Referenced by Create().
|
private |
Definition at line 1647 of file ProgressDialog.cpp.
References beep, gPrefs, mStartTime, name, audacity::BasicSettings::Read(), and wxT().
Referenced by ~ProgressDialog().
|
private |
Definition at line 1686 of file ProgressDialog.cpp.
References m_bConfirmAction.
Referenced by OnCancel(), OnCloseWindow(), and OnStop().
|
protected |
Definition at line 1176 of file ProgressDialog.cpp.
References _, AddMessageAsColumn(), wxDialogWrapper::Create(), Init(), m_bConfirmAction, m_bShowElapsedTime, mDisable, mElapsed, mGauge, mHadFocus, mRemaining, pdlgConfirmStopCancel, pdlgHideCancelButton, pdlgHideElapsedTime, pdlgHideStopButton, Reinit(), safenew, wxDialogWrapper::SetName(), title, wxT(), and XO().
bool ProgressDialog::Create | ( | const TranslatableString & | title, |
const TranslatableString & | message = {} , |
||
int | flags = pdlgDefaultFlags , |
||
const TranslatableString & | sRemainingLabelText = {} |
||
) |
Definition at line 1157 of file ProgressDialog.cpp.
References Create(), mLastH, mLastW, title, and TranslatableString::Translation().
Referenced by Create(), and ProgressDialog().
|
private |
Definition at line 1063 of file ProgressDialog.cpp.
References BasicUI::FindFocus(), and mHadFocus.
Referenced by Create().
|
private |
Definition at line 1615 of file ProgressDialog.cpp.
References ConfirmAction(), mCancel, and XO().
|
private |
Definition at line 1638 of file ProgressDialog.cpp.
References ConfirmAction(), mCancel, and XO().
|
private |
Definition at line 1626 of file ProgressDialog.cpp.
References ConfirmAction(), mCancel, mStop, and XO().
|
overridevirtual |
Update the bar and poll for clicks. Call only on the main thread.
Implements BasicUI::ProgressDialog.
Definition at line 1528 of file ProgressDialog.cpp.
References Update().
|
overridevirtual |
Reset the dialog state.
Implements BasicUI::ProgressDialog.
Definition at line 1084 of file ProgressDialog.cpp.
References mCancel, mElapsedTime, mIsTransparent, mLastUpdate, mLastValue, mPollsCount, mStartTime, mStop, mTotalPollTime, mTotalYieldTime, mYieldsCount, mYieldTimer, and ExportProgressUI::Show().
Referenced by Create().
|
private |
Definition at line 1602 of file ProgressDialog.cpp.
References SearchForWindow().
Referenced by SearchForWindow(), and ~ProgressDialog().
|
overridevirtual |
Change the dialog's title.
Implements BasicUI::ProgressDialog.
Definition at line 1119 of file ProgressDialog.cpp.
References wxDialogWrapper::SetTitle(), and title.
|
overridevirtual |
Change an existing dialog's message.
Implements BasicUI::ProgressDialog.
Definition at line 1554 of file ProgressDialog.cpp.
References TranslatableString::empty(), mLastH, mLastW, mMessage, and TranslatableString::Translation().
Referenced by Update().
ProgressResult ProgressDialog::Update | ( | double | current, |
const TranslatableString & | message = {} |
||
) |
Definition at line 1458 of file ProgressDialog.cpp.
References Update().
ProgressResult ProgressDialog::Update | ( | double | current, |
double | total, | ||
const TranslatableString & | message = {} |
||
) |
Definition at line 1538 of file ProgressDialog.cpp.
References Update().
ProgressResult ProgressDialog::Update | ( | int | current, |
int | total, | ||
const TranslatableString & | message = {} |
||
) |
Definition at line 1515 of file ProgressDialog.cpp.
References Update().
ProgressResult ProgressDialog::Update | ( | int | value, |
const TranslatableString & | message = {} |
||
) |
Definition at line 1354 of file ProgressDialog.cpp.
References BasicUI::Cancelled, m_bShowElapsedTime, mCancel, mElapsed, mElapsedTime, mGauge, mIsTransparent, mLastUpdate, mLastValue, mPollsCount, mRemaining, mStartTime, mStop, mTotalPollTime, mTotalYieldTime, mYieldsCount, mYieldTimer, SetMessage(), BasicUI::Stopped, BasicUI::Success, and wxT().
Referenced by ImportRaw(), TransportUtilities::PlayCurrentRegionAndWait(), TransportUtilities::PlayPlayRegionAndWait(), Poll(), TransportUtilities::RecordAndWait(), RemoveDependencies(), and Update().
ProgressResult ProgressDialog::Update | ( | wxLongLong | current, |
wxLongLong | total, | ||
const TranslatableString & | message = {} |
||
) |
Definition at line 1483 of file ProgressDialog.cpp.
References Update().
ProgressResult ProgressDialog::Update | ( | wxLongLong_t | current, |
wxLongLong_t | total, | ||
const TranslatableString & | message = {} |
||
) |
Definition at line 1499 of file ProgressDialog.cpp.
References Update().
ProgressResult ProgressDialog::Update | ( | wxULongLong_t | current, |
wxULongLong_t | total, | ||
const TranslatableString & | message = {} |
||
) |
Definition at line 1467 of file ProgressDialog.cpp.
References Update().
|
protected |
Definition at line 130 of file ProgressDialog.h.
Referenced by ConfirmAction(), and Create().
|
protected |
Definition at line 129 of file ProgressDialog.h.
Referenced by Create(), Update(), and TimerProgressDialog::UpdateProgress().
|
protected |
Definition at line 123 of file ProgressDialog.h.
Referenced by OnCancel(), OnCloseWindow(), OnStop(), Reinit(), Update(), and TimerProgressDialog::UpdateProgress().
|
private |
Definition at line 151 of file ProgressDialog.h.
Referenced by Create(), and ~ProgressDialog().
|
protected |
Definition at line 113 of file ProgressDialog.h.
Referenced by Create(), Update(), and TimerProgressDialog::UpdateProgress().
|
protected |
Definition at line 120 of file ProgressDialog.h.
Referenced by Reinit(), Update(), and ~ProgressDialog().
|
protected |
Definition at line 115 of file ProgressDialog.h.
Referenced by Create(), Update(), and TimerProgressDialog::UpdateProgress().
|
protected |
Definition at line 111 of file ProgressDialog.h.
Referenced by Create(), Init(), and ~ProgressDialog().
|
protected |
Definition at line 126 of file ProgressDialog.h.
Referenced by Reinit(), Update(), and TimerProgressDialog::UpdateProgress().
|
private |
Definition at line 155 of file ProgressDialog.h.
Referenced by Create(), and SetMessage().
|
protected |
Definition at line 118 of file ProgressDialog.h.
Referenced by Reinit(), Update(), and TimerProgressDialog::UpdateProgress().
|
protected |
Definition at line 121 of file ProgressDialog.h.
Referenced by Reinit(), Update(), and TimerProgressDialog::UpdateProgress().
|
private |
Definition at line 154 of file ProgressDialog.h.
Referenced by Create(), and SetMessage().
|
private |
Definition at line 149 of file ProgressDialog.h.
|
private |
Definition at line 153 of file ProgressDialog.h.
Referenced by AddMessageAsColumn(), and SetMessage().
|
private |
Definition at line 158 of file ProgressDialog.h.
Referenced by Reinit(), Update(), and ~ProgressDialog().
|
protected |
Definition at line 114 of file ProgressDialog.h.
Referenced by Create(), Update(), and TimerProgressDialog::UpdateProgress().
|
protected |
Definition at line 117 of file ProgressDialog.h.
Referenced by Beep(), Reinit(), Update(), and TimerProgressDialog::UpdateProgress().
|
protected |
Definition at line 124 of file ProgressDialog.h.
Referenced by OnStop(), Reinit(), Update(), and TimerProgressDialog::UpdateProgress().
|
private |
Definition at line 157 of file ProgressDialog.h.
Referenced by Reinit(), Update(), and ~ProgressDialog().
|
private |
Definition at line 159 of file ProgressDialog.h.
Referenced by Reinit(), Update(), and ~ProgressDialog().
|
private |
Definition at line 160 of file ProgressDialog.h.
Referenced by Reinit(), Update(), and ~ProgressDialog().
|
protected |
Definition at line 119 of file ProgressDialog.h.