Audacity 3.2.0
Functions | Variables
audacity::cloud::audiocom::anonymous_namespace{AuthorizationHandler.cpp} Namespace Reference

Functions

std::optional< AuthResultWaitForAuth (std::future< std::optional< AuthResult > > future, const AudacityProject *project)
 

Variables

AuthorizationHandler handler
 

Function Documentation

◆ WaitForAuth()

std::optional< AuthResult > audacity::cloud::audiocom::anonymous_namespace{AuthorizationHandler.cpp}::WaitForAuth ( std::future< std::optional< AuthResult > >  future,
const AudacityProject project 
)

Definition at line 36 of file AuthorizationHandler.cpp.

39{
40 using namespace sync;
41
42 if (
43 future.wait_for(std::chrono::milliseconds { 100 }) !=
44 std::future_status::ready)
45 {
46 auto waitResult =
47 WaitForActionDialog {
48 project, XO("Waiting for audio.com"),
49 XO("An action on audio.com is required before you can continue. You can cancel this operation."),
50 false
51 }
52 .ShowDialog(
53 [&future]() -> DialogButtonIdentifier
54 {
55 if (
56 future.wait_for(std::chrono::milliseconds { 50 }) !=
57 std::future_status::ready)
58 return {};
59
60 return { L"done" };
61 });
62
63 if (waitResult == WaitForActionDialog::CancelButtonIdentifier())
64 return AuthResult { AuthResult::Status::Cancelled, {} };
65 }
66
67 if (GetOAuthService().HasAccessToken())
68 return AuthResult { AuthResult::Status::Authorised, {} };
69
70 return future.get();
71}
XO("Cut/Copy/Paste")
const auto project
TaggedIdentifier< DialogButtonIdentifierTag > DialogButtonIdentifier
OAuthService & GetOAuthService()
Returns the instance of the OAuthService.

References audacity::cloud::audiocom::AuthResult::Authorised, audacity::cloud::audiocom::AuthResult::Cancelled, audacity::cloud::audiocom::GetOAuthService(), project, and XO().

Referenced by audacity::cloud::audiocom::PerformBlockingAuth().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ handler

AuthorizationHandler audacity::cloud::audiocom::anonymous_namespace{AuthorizationHandler.cpp}::handler

Definition at line 34 of file AuthorizationHandler.cpp.

Referenced by Append(), AppendCheckItem(), AppendItem(), AppendRadioItem(), anonymous_namespace{Prefs.cpp}::PreferencesResetHandlerRegistry::BeginReset(), LV2Editor::BuildFancy(), KeyboardCapture::Capture(), XMLFileReader::charHandler(), NumericEditor::Create(), ProjectSerializer::Decode(), audacity::cloud::audiocom::OAuthService::DoAuthorise(), CommandManager::DoRepeatProcess(), anonymous_namespace{ProjectSerializer.cpp}::XMLTagHandlerAdapter::EmitStartTag(), XMLFileReader::endElement(), anonymous_namespace{Prefs.cpp}::PreferencesResetHandlerRegistry::EndReset(), anonymous_namespace{ProjectSerializer.cpp}::XMLTagHandlerAdapter::EndTag(), EventMonitor::EventMonitor(), CommandManager::ExecuteCommand(), EventMonitor::FilterEvent(), for(), AccessibleLinksFormatter::FormatLink(), audacity::cloud::audiocom::GetAuthorizationHandler(), EventMonitor::HandleCapture(), AUPImportFileHandle::HandleControlPoint(), AUPImportFileHandle::HandleEnvelope(), AUPImportFileHandle::HandleLabel(), AUPImportFileHandle::HandleLabelTrack(), AUPImportFileHandle::HandleNoteTrack(), AUPImportFileHandle::HandleTimeTrack(), AUPImportFileHandle::HandleWaveClip(), AUPImportFileHandle::HandleWaveTrack(), AUPImportFileHandle::HandleXMLTag(), anonymous_namespace{WaveTrackControls.cpp}::initFn(), KeyboardCapture::IsHandler(), anonymous_namespace{MenuHelper.cpp}::LoadEffectsMenuGroups(), internal::x11::RunLoop::OnEvent(), internal::x11::RunLoop::OnTimer(), AccessibleLinksFormatter::Populate(), anonymous_namespace{Prefs.cpp}::PreferencesResetHandlerRegistry::Register(), PreferencesResetHandler::Register(), internal::x11::RunLoop::registerEventHandler(), internal::x11::RunLoop::registerTimer(), audacity::sentry::Report::ReportImpl::Send(), LV2AtomPortState::SendToDialog(), XMLFileReader::startElement(), CrashReportContext::StartHandler(), anonymous_namespace{ProjectStatus.cpp}::Dispatcher::Subscribe(), ProjectStatusFieldsRegistry::Subscribe(), internal::x11::RunLoop::unregisterEventHandler(), internal::x11::RunLoop::unregisterTimer(), and anonymous_namespace{ProjectSerializer.cpp}::XMLTagHandlerAdapter::WriteData().