![]() |
Audacity 3.2.0
|
Classes | |
struct | ErrorDialogOptions |
Options for variations of error dialogs; the default is for modal dialogs. More... | |
class | GenericProgressDialog |
Abstraction of a progress dialog with undefined time-to-completion estimate. More... | |
struct | MessageBoxOptions |
struct | Point |
A pair of screen coordinates, x increasing rightward, y downward. More... | |
class | ProgressDialog |
Abstraction of a progress dialog with well defined time-to-completion estimate. More... | |
class | Services |
Abstract class defines a few user interface services, not mentioning particular toolkits. More... | |
class | WindowPlacement |
Subclasses may hold information such as a parent window pointer for a dialog. More... | |
Functions | |
Services * | Get () |
Fetch the global instance, or nullptr if none is yet installed. More... | |
Services * | Install (Services *pInstance) |
Install an implementation; return the previously installed instance. More... | |
Functions that invoke global Services | |
These dispatch to the global Services, if supplied. If none was supplied, they are mostly no-ops, with exceptions as noted. All should be called on the main thread only, except as noted. | |
void | CallAfter (Action action) |
Schedule an action to be done later, and in the main thread. More... | |
void | Yield () |
Dispatch waiting events, including actions enqueued by CallAfter. More... | |
void | ShowErrorDialog (const WindowPlacement &placement, const TranslatableString &dlogTitle, const TranslatableString &message, const ManualPageID &helpPage, const ErrorDialogOptions &options={}) |
Show an error dialog with a link to the manual for further help. More... | |
MessageBoxResult | ShowMessageBox (const TranslatableString &message, MessageBoxOptions options={}) |
Show a modal message box with either Ok or Yes and No, and optionally Cancel. More... | |
std::unique_ptr< ProgressDialog > | MakeProgress (const TranslatableString &title, const TranslatableString &message, unsigned flags=(ProgressShowStop|ProgressShowCancel), const TranslatableString &remainingLabelText={}) |
Create and display a progress dialog. More... | |
std::unique_ptr< GenericProgressDialog > | MakeGenericProgress (const WindowPlacement &placement, const TranslatableString &title, const TranslatableString &message) |
Create and display a progress dialog (return nullptr if Services not installed) More... | |
int | ShowMultiDialog (const TranslatableString &message, const TranslatableString &title, const TranslatableStrings &buttons, const ManualPageID &helpPage, const TranslatableString &boxMsg, bool log) |
Display a dialog with radio buttons. More... | |
Variables | |
static Services * | theInstance = nullptr |
static std::recursive_mutex | sActionsMutex |
static std::vector< Action > | sActions |
Types used in the Services interface | |
enum class | ErrorDialogType { ModelessError , ModalError , ModalErrorReport } |
enum class | Icon { None , Warning , Error , Question , Information } |
enum class | Button { Default , Ok , YesNo } |
enum class | MessageBoxResult : int { None , Yes , No , Ok , Cancel } |
enum | ProgressDialogOptions : unsigned { ProgressShowStop = (1 << 0) , ProgressShowCancel = (1 << 1) , ProgressHideTime = (1 << 2) , ProgressConfirmStopOrCancel = (1 << 3) } |
enum class | ProgressResult : unsigned { Cancelled = 0 , Success , Failed , Stopped } |
using | Action = std::function< void()> |
TranslatableString | DefaultCaption () |
"Message", suitably translated More... | |
using BasicUI::Action = typedef std::function<void()> |
|
strong |
|
strong |
Enumerator | |
---|---|
ModelessError | |
ModalError | |
ModalErrorReport | If error reporting is enabled, may give option to send; if not, then like ModalError |
Definition at line 40 of file BasicUI.h.
|
strong |
|
strong |
enum BasicUI::ProgressDialogOptions : unsigned |
Enumerator | |
---|---|
ProgressShowStop | |
ProgressShowCancel | |
ProgressHideTime | |
ProgressConfirmStopOrCancel |
Definition at line 137 of file BasicUI.h.
|
strong |
Enumerator | |
---|---|
Cancelled | |
Success | |
Failed | |
Stopped |
BASIC_UI_API void BasicUI::CallAfter | ( | Action | action | ) |
Schedule an action to be done later, and in the main thread.
This function may be called in other threads than the main. If no Services are yet installed, the action is not lost, but may be dispatched by Yield(). The action may itself invoke CallAfter to enqueue other actions.
Definition at line 38 of file BasicUI.cpp.
References Get(), sActions, and sActionsMutex.
Referenced by AdornedRulerPanel::AdornedRulerPanel(), PrefsListener::Broadcast(), AudacityException::EnqueueAction(), UndoManager::EnqueueMessage(), Journal::Events::FailedEventSerialization(), AsyncPluginValidator::Impl::HandleInternalError(), ProjectWindow::HandleResize(), AsyncPluginValidator::Impl::HandleResult(), AudacityApp::InitPart2(), NotifyingSelectedRegion::Notify(), TrackPanel::OnAudioIO(), AudacityApp::OnExceptionInMainLoop(), App::OnInit(), AudacityApp::OnInit(), AudacityApp::OnInit0(), AdornedRulerPanel::OnLeave(), TrackPanel::OnMouseEvent(), IncompatiblePluginsDialog::OnPluginManagerClicked(), ErrorReportDialog::OnSend(), TrackList::QueueEvent(), ProjectWindow::RedrawProject(), AdornedRulerPanel::Refresh(), TrackPanel::Refresh(), and TrackPanelAx::SetFocus().
BASIC_UI_API TranslatableString BasicUI::DefaultCaption | ( | ) |
"Message", suitably translated
Definition at line 70 of file BasicUI.cpp.
References XO.
Referenced by MessageBoxException::DelayedHandlerAction(), and MP3ImportFileHandle::ErrorCB().
BASIC_UI_API Services * BasicUI::Get | ( | ) |
Fetch the global instance, or nullptr if none is yet installed.
Definition at line 26 of file BasicUI.cpp.
References theInstance.
Referenced by audacity::sentry::AddExceptionContext(), audacity::sentry::anonymous_namespace{SentryReport.cpp}::AddOSContext(), CallAfter(), audacity::network_manager::CurlHandleManager::CurlHandleManager(), VST3EffectsModule::FindModulePaths(), FindProjectFrame(), UndoManager::Get(), anonymous_namespace{ProjectWindows.cpp}::ProjectWindows::Get(), GetAttachedWindows(), PlatformCompatibility::GetExecutablePath(), Languages::GetLanguages(), GetProjectFrame(), GetProjectPanel(), UpdateManager::GetUpdates(), anonymous_namespace{FileNames.cpp}::GetUserTargetDir(), UpdateDataParser::HandleXMLTag(), anonymous_namespace{PluginMenus.cpp}::IsBundledPlugin(), MakeGenericProgress(), EffectSettingsAccess::ModifySettings(), Grid::OnKeyDown(), anonymous_namespace{PluginMenus.cpp}::PopulateEffectsMenu(), NyquistEffect::Process(), RemoveDependencies(), anonymous_namespace{WaveTrackAffordanceControls.cpp}::SelectedClipOfFocusedTrack(), audacity::sentry::anonymous_namespace{SentryReport.cpp}::SerializeException(), SetProjectFrame(), SetProjectPanel(), ShowMultiDialog(), and Yield().
Install an implementation; return the previously installed instance.
Definition at line 28 of file BasicUI.cpp.
References theInstance.
Referenced by AudacityApp::OnInit0().
|
inline |
Create and display a progress dialog (return nullptr if Services not installed)
This function makes a "generic" progress dialog, for the case when time to completion cannot be estimated, but some indication of progress is still given
Definition at line 289 of file BasicUI.h.
Referenced by DBConnection::Close(), ProjectFileIO::RenameOrWarn(), and ProjectFileIO::SaveProject().
|
inline |
Create and display a progress dialog.
flags | bitwise OR of values in ProgressDialogOptions |
remainingLabelText | if not empty substitutes for "Remaining Time:" |
Definition at line 271 of file BasicUI.h.
Referenced by EffectBase::DoEffect(), UpdateManager::GetUpdates(), MixAndRender(), SqliteSampleBlockFactory::OnBeginPurge(), TrackActions::Handler::OnResample(), EffectBase::Preview(), and PluginStartupRegistration::Run().
|
inline |
Show an error dialog with a link to the manual for further help.
placement | how to parent the dialog |
dlogTitle | Text for title bar |
message | The main message text |
helpPage | Identifies manual page (and maybe an anchor) |
Definition at line 241 of file BasicUI.h.
Referenced by MessageBoxException::DelayedHandlerAction(), ProjectAudioManager::DoRecord(), ProjectFileManager::DoSave(), MP3ImportFileHandle::ErrorCB(), TempDirectory::FATFilesystemDenied(), UpdateManager::GetUpdates(), ProjectFileManager::Import(), ProjectAudioManager::PlayPlayRegion(), EffectBase::Preview(), ProjectFileIO::ProjectFileIO(), ExportPCM::ReportTooBigError(), ProjectFileManager::SaveCopy(), ShowDiskFullExportErrorDialog(), ProjectFileIO::ShowError(), ShowExportErrorDialog(), AudioIO::StartMonitoring(), MenuManager::TellUserWhyDisallowed(), and TempDirectory::TempDir().
|
inline |
Show a modal message box with either Ok or Yes and No, and optionally Cancel.
Definition at line 256 of file BasicUI.h.
Referenced by anonymous_namespace{Registry.cpp}::BadPath(), ConfirmSave(), CreateDirectory(), ThemeBase::CreateImageCache(), ThemeBase::CreateOneImageCache(), MessageBoxException::DelayedHandlerAction(), DoMessageBox(), PluginManager::DropFile(), VST3Effect::ExportPresets(), Journal::Events::FailedEventSerialization(), ThemeBase::LoadOneThemeComponents(), VST3Effect::LoadPreset(), anonymous_namespace{MIDIPlay.h}::MIDIPlay::MIDIPlay(), ThemeBase::ReadImageCache(), and Sequence::WriteXML().
|
inline |
Display a dialog with radio buttons.
message | main message in the dialog |
title | dialog title |
buttons | labels for individual radio buttons |
boxMsg | label for the group of buttons |
helpPage | identifies a manual page |
log | whether to add a "Show Log for Details" push button |
Definition at line 309 of file BasicUI.h.
Referenced by ModuleManager::TryLoadModules().
BASIC_UI_API void BasicUI::Yield | ( | ) |
Dispatch waiting events, including actions enqueued by CallAfter.
This function must be called by the main thread. Actions enqueued by CallAfter before Services were installed will be dispatched in the sequence they were enqueued, unless an exception thrown by one of them stops the dispatching.
Definition at line 49 of file BasicUI.cpp.
References Get(), sActions, and sActionsMutex.
|
static |
Definition at line 36 of file BasicUI.cpp.
Referenced by CallAfter(), and Yield().
|
static |
Definition at line 35 of file BasicUI.cpp.
Referenced by CallAfter(), and Yield().
|
static |
Definition at line 24 of file BasicUI.cpp.