Audacity 3.2.0
Static Public Member Functions | Private Member Functions | List of all members
audacity::cloud::audiocom::sync::SyncFailedDialog Class Referencefinal

#include <SyncFailedDialog.h>

Inheritance diagram for audacity::cloud::audiocom::sync::SyncFailedDialog:
[legend]
Collaboration diagram for audacity::cloud::audiocom::sync::SyncFailedDialog:
[legend]

Static Public Member Functions

static void OnOpen (const CloudSyncError &error)
 
static void OnSave (const CloudSyncError &error)
 
static void OnOpen (const ResponseResult &error)
 
static void OnSave (const ResponseResult &error)
 
- Static Public Member Functions inherited from audacity::cloud::audiocom::sync::AudioComDialogBase
static DialogButtonIdentifier CancelButtonIdentifier ()
 

Private Member Functions

 SyncFailedDialog (const AudacityProject *project, const TranslatableString &message, const std::string &log, DialogMode dialogMode)
 

Additional Inherited Members

- Public Member Functions inherited from audacity::cloud::audiocom::sync::AudioComDialogBase
DialogButtonIdentifier ShowDialog (std::function< DialogButtonIdentifier()> poller={})
 
- Protected Types inherited from audacity::cloud::audiocom::sync::AudioComDialogBase
enum class  DialogMode { Opening , Saving }
 
enum  ButtonType { None = 0 , DefaultButton = 1 , EscButton = 2 }
 
- Protected Member Functions inherited from audacity::cloud::audiocom::sync::AudioComDialogBase
 AudioComDialogBase (const AudacityProject *project, const DialogIdentifier &optionalPrefsIdentifier={}, DialogMode dialogMode=DialogMode::Saving)
 
virtual ~AudioComDialogBase ()=default
 
void AddTitle (const TranslatableString &title)
 
void AddParagraph (const TranslatableString &paragraph)
 
void AddButton (DialogButtonIdentifier identifier, const TranslatableString &text, int type=None)
 
void SetDialogTitle (const TranslatableString &dialog)
 
virtual bool HasSeparator () const
 
void EndDialog (DialogButtonIdentifier identifier)
 

Detailed Description

Definition at line 20 of file SyncFailedDialog.h.

Constructor & Destructor Documentation

◆ SyncFailedDialog()

audacity::cloud::audiocom::sync::SyncFailedDialog::SyncFailedDialog ( const AudacityProject project,
const TranslatableString message,
const std::string &  log,
DialogMode  dialogMode 
)
private

Definition at line 128 of file SyncFailedDialog.cpp.

131 : AudioComDialogBase { project, {}, dialogMode }
132{
133 AddTitle(XO("Sync failed"));
134
135 AddParagraph(message);
136
137 if (!log.empty())
138 AddParagraph(XO("Error details:\n%s").Format(ToWXString(log)));
139
141}
XO("Cut/Copy/Paste")
const auto project
Abstract base class used in importing a file.
void AddTitle(const TranslatableString &title)
void AddButton(DialogButtonIdentifier identifier, const TranslatableString &text, int type=None)
AudioComDialogBase(const AudacityProject *project, const DialogIdentifier &optionalPrefsIdentifier={}, DialogMode dialogMode=DialogMode::Saving)
void AddParagraph(const TranslatableString &paragraph)
wxString ToWXString(const std::string &str)

Member Function Documentation

◆ OnOpen() [1/2]

void audacity::cloud::audiocom::sync::SyncFailedDialog::OnOpen ( const CloudSyncError error)
static

Definition at line 80 of file SyncFailedDialog.cpp.

81{
82 if (error.Type == CloudSyncError::None)
83 return;
84
85 auto message = GetMessage(error);
86
87 SyncFailedDialog dialog { nullptr, message, error.ErrorMessage,
89 dialog.ShowDialog();
90}
SyncFailedDialog(const AudacityProject *project, const TranslatableString &message, const std::string &log, DialogMode dialogMode)

References audacity::cloud::audiocom::sync::CloudSyncError::ErrorMessage, audacity::cloud::audiocom::sync::anonymous_namespace{SyncFailedDialog.cpp}::GetMessage(), audacity::cloud::audiocom::sync::CloudSyncError::None, audacity::cloud::audiocom::sync::AudioComDialogBase::Opening, and audacity::cloud::audiocom::sync::CloudSyncError::Type.

Referenced by audacity::cloud::audiocom::sync::anonymous_namespace{CloudProjectOpenUtils.cpp}::HandleFailure().

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

◆ OnOpen() [2/2]

void audacity::cloud::audiocom::sync::SyncFailedDialog::OnOpen ( const ResponseResult error)
static

Definition at line 104 of file SyncFailedDialog.cpp.

105{
106 if (error.Code == SyncResultCode::Success)
107 return;
108
109 auto message = GetMessage(error);
110
111 SyncFailedDialog dialog { nullptr, message, error.Content,
113 dialog.ShowDialog();
114}

References audacity::cloud::audiocom::ResponseResult::Code, audacity::cloud::audiocom::ResponseResult::Content, audacity::cloud::audiocom::sync::anonymous_namespace{SyncFailedDialog.cpp}::GetMessage(), audacity::cloud::audiocom::sync::AudioComDialogBase::Opening, and audacity::cloud::audiocom::Success.

Here is the call graph for this function:

◆ OnSave() [1/2]

void audacity::cloud::audiocom::sync::SyncFailedDialog::OnSave ( const CloudSyncError error)
static

Definition at line 92 of file SyncFailedDialog.cpp.

93{
94 if (error.Type == CloudSyncError::None)
95 return;
96
97 auto message = GetMessage(error);
98
99 SyncFailedDialog dialog { nullptr, message, error.ErrorMessage,
101 dialog.ShowDialog();
102}

References audacity::cloud::audiocom::sync::CloudSyncError::ErrorMessage, audacity::cloud::audiocom::sync::anonymous_namespace{SyncFailedDialog.cpp}::GetMessage(), audacity::cloud::audiocom::sync::CloudSyncError::None, audacity::cloud::audiocom::sync::AudioComDialogBase::Saving, and audacity::cloud::audiocom::sync::CloudSyncError::Type.

Here is the call graph for this function:

◆ OnSave() [2/2]

void audacity::cloud::audiocom::sync::SyncFailedDialog::OnSave ( const ResponseResult error)
static

Definition at line 116 of file SyncFailedDialog.cpp.

117{
118 if (error.Code == SyncResultCode::Success)
119 return;
120
121 auto message = GetMessage(error);
122
123 SyncFailedDialog dialog { nullptr, message, error.Content,
125 dialog.ShowDialog();
126}

References audacity::cloud::audiocom::ResponseResult::Code, audacity::cloud::audiocom::ResponseResult::Content, audacity::cloud::audiocom::sync::anonymous_namespace{SyncFailedDialog.cpp}::GetMessage(), audacity::cloud::audiocom::sync::AudioComDialogBase::Saving, and audacity::cloud::audiocom::Success.

Here is the call graph for this function:

The documentation for this class was generated from the following files: