Audacity 3.2.0
LinkFailedDialog.cpp
Go to the documentation of this file.
1/* SPDX-License-Identifier: GPL-2.0-or-later */
2/*!********************************************************************
3
4 Audacity: A Digital Audio Editor
5
6 LinkFailedDialog.cpp
7
8 Dmitry Vedenko
9
10**********************************************************************/
11#include "LinkFailedDialog.h"
12
13#include <wx/button.h>
14
15#include "CodeConversions.h"
16#include "ServiceConfig.h"
17
18#include "ShuttleGui.h"
19
20#include "HelpSystem.h"
21
22
24{
25
28 parent, wxID_ANY, XO("Link account"), wxDefaultPosition, { 442, -1 },
29 wxDEFAULT_DIALOG_STYLE)
30{
31 SetMinSize({ 442, -1 });
32 ShuttleGui s(this, eIsCreating);
33
34 s.StartVerticalLay();
35 {
36 s.StartInvisiblePanel(16);
37 {
38 s.SetBorder(0);
39
40 s.AddFixedText(
41 XO("We were unable to link your account. Please try again."),
42 false, 410);
43
44 s.AddSpace(0, 16, 0);
45
46 s.StartHorizontalLay(wxEXPAND, 0);
47 {
48 s.AddSpace(1, 0, 1);
49
50 s.AddButton(XO("&Cancel"))
51 ->Bind(wxEVT_BUTTON, [this](auto) { EndModal(wxID_CANCEL); });
52
53 auto btn = s.AddButton(XO("&Try again"));
54
55 btn->Bind(wxEVT_BUTTON, [this, trace](auto) {
57 GetServiceConfig().GetOAuthLoginPage(trace)) });
58 EndModal(wxID_RETRY);
59 });
60
61 btn->SetDefault();
62 }
63 s.EndHorizontalLay();
64
65 }
66 s.EndInvisiblePanel();
67 }
68 s.EndVerticalLay();
69
70 Layout();
71 Fit();
72 Center();
73
74 Bind(
75 wxEVT_CHAR_HOOK,
76 [this](auto& evt)
77 {
78 if (!IsEscapeKey(evt))
79 {
80 evt.Skip();
81 return;
82 }
83
84 EndModal(wxID_CANCEL);
85 });
86}
87
89{
90}
91
92} // namespace audacity::cloud::audiocom
Declare functions to perform UTF-8 to std::wstring conversions.
AudiocomTrace
Definition: ExportUtils.h:27
XO("Cut/Copy/Paste")
@ eIsCreating
Definition: ShuttleGui.h:37
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Definition: ShuttleGui.h:640
bool OpenInDefaultBrowser(const wxString &url)
Open an URL in default browser.
Definition: BasicUI.cpp:246
const ServiceConfig & GetServiceConfig()
Returns the instance of the ServiceConfig.
wxString ToWXString(const std::string &str)