Audacity 3.2.0
Enumerations | Functions | Variables
anonymous_namespace{LoginDialog.cpp} Namespace Reference

Enumerations

enum  { ID_SIGNIN , ID_CREATE_ACCOUNT , ID_WITH_GOOGLE , ID_WITH_FACEBOOK }
 

Functions

auto DialogNameForMode (LoginDialog::Mode mode)
 
AButtonMakeLoginButton (wxWindow *parent, wxWindowID id, int imageId, const TranslatableString &label)
 
wxStaticText * MakeLabel (wxWindow *parent, const wxString &text)
 
auto DefaultErrorHandler (LoginDialog *dialog, LoginDialog::Mode mode)
 

Variables

constexpr auto RestorePasswordURL = "https://audio.com/auth/forgot-password"
 

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
ID_SIGNIN 
ID_CREATE_ACCOUNT 
ID_WITH_GOOGLE 
ID_WITH_FACEBOOK 

Definition at line 21 of file LoginDialog.cpp.

Function Documentation

◆ DefaultErrorHandler()

auto anonymous_namespace{LoginDialog.cpp}::DefaultErrorHandler ( LoginDialog dialog,
LoginDialog::Mode  mode 
)

Definition at line 62 of file LoginDialog.cpp.

63 {
64 return [weak = wxWeakRef(dialog), mode](auto code, auto error)
65 {
66 BasicUI::CallAfter([weak, mode, code, error = std::string(error)]
67 {
68 using namespace BasicUI;
69 if (mode == LoginDialog::Mode::Create)
70 {
71 ShowMessageBox(XXO("Oops! It looks like there was an issue with your input.\n"
72 "Please ensure your email is correct and "
73 "that your password is at least 8 characters long"),
74 MessageBoxOptions {}.IconStyle(Icon::Error));
75 }
76 else
77 {
78 ShowMessageBox(XXO("Sorry, but it seems the email or password you entered is incorrect.\n"
79 "Please double-check your credentials and try again!"),
80 MessageBoxOptions {}.IconStyle(Icon::Error));
81 }
82 if(weak)
83 weak->Enable();
84 });
85 };
86 }
XXO("&Cut/Copy/Paste Toolbar")
void CallAfter(Action action)
Schedule an action to be done later, and in the main thread.
Definition: BasicUI.cpp:214
MessageBoxResult ShowMessageBox(const TranslatableString &message, MessageBoxOptions options={})
Show a modal message box with either Ok or Yes and No, and optionally Cancel.
Definition: BasicUI.h:287
MessageBoxOptions && IconStyle(Icon style) &&
Definition: BasicUI.h:104

References BasicUI::CallAfter(), LoginDialog::Create, BasicUI::MessageBoxOptions::IconStyle(), BasicUI::ShowMessageBox(), and XXO().

Referenced by LoginDialog::ContinueCreateAccount(), and LoginDialog::ContinueSignIn().

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

◆ DialogNameForMode()

auto anonymous_namespace{LoginDialog.cpp}::DialogNameForMode ( LoginDialog::Mode  mode)

Definition at line 29 of file LoginDialog.cpp.

30 {
31 return mode == LoginDialog::Mode::Create
32 ? XO("Create cloud account")
33 : XO("Sign in to cloud");
34 }
XO("Cut/Copy/Paste")

References LoginDialog::Create, and XO().

Here is the call graph for this function:

◆ MakeLabel()

wxStaticText * anonymous_namespace{LoginDialog.cpp}::MakeLabel ( wxWindow *  parent,
const wxString &  text 
)

Definition at line 55 of file LoginDialog.cpp.

56 {
57 auto label = safenew wxStaticText(parent, wxID_ANY, text);
58 label->SetForegroundColour(theTheme.Colour(clrTrackPanelText));
59 return label;
60 }
#define safenew
Definition: MemoryX.h:10
TranslatableString label
Definition: TagsEditor.cpp:165
THEME_API Theme theTheme
Definition: Theme.cpp:82
wxColour & Colour(int iIndex)

References ThemeBase::Colour(), label, safenew, and theTheme.

Referenced by LoginDialog::LayoutControls().

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

◆ MakeLoginButton()

AButton * anonymous_namespace{LoginDialog.cpp}::MakeLoginButton ( wxWindow *  parent,
wxWindowID  id,
int  imageId,
const TranslatableString label 
)

Definition at line 36 of file LoginDialog.cpp.

37 {
38 const auto button = safenew AButton(parent, id);
39 button->SetButtonType(AButton::FrameTextHButton);
40 button->SetImages(
41 theTheme.Image(bmpHButtonNormal),
42 theTheme.Image(bmpHButtonHover),
43 theTheme.Image(bmpHButtonDown),
44 theTheme.Image(bmpHButtonHover),
45 theTheme.Image(bmpHButtonDisabled));
46 button->SetFrameMid(2);
47 button->SetIcon(theTheme.Image(imageId));
48 button->SetLabel(label);
49 button->SetMinSize({206, 40});
50 button->SetSize(206, 40);
51 button->SetForegroundColour(theTheme.Colour(clrTrackPanelText));
52 return button;
53 }
A wxButton with mouse-over behaviour.
Definition: AButton.h:104
@ FrameTextHButton
Definition: AButton.h:116
wxImage & Image(int iIndex)

References ThemeBase::Colour(), AButton::FrameTextHButton, ThemeBase::Image(), label, safenew, and theTheme.

Referenced by LoginDialog::LayoutControls().

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

Variable Documentation

◆ RestorePasswordURL

constexpr auto anonymous_namespace{LoginDialog.cpp}::RestorePasswordURL = "https://audio.com/auth/forgot-password"
constexpr

Definition at line 19 of file LoginDialog.cpp.

Referenced by LoginDialog::LayoutControls().