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
23namespace cloud::audiocom
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(
56 wxEVT_BUTTON,
57 [this](auto)
58 {
60 GetServiceConfig().GetOAuthLoginPage()) });
61 EndModal(wxID_RETRY);
62 });
63
64 btn->SetDefault();
65 }
66 s.EndHorizontalLay();
67
68 }
69 s.EndInvisiblePanel();
70 }
71 s.EndVerticalLay();
72
73 Layout();
74 Fit();
75 Center();
76
77 Bind(
78 wxEVT_CHAR_HOOK,
79 [this](auto& evt)
80 {
81 if (!IsEscapeKey(evt))
82 {
83 evt.Skip();
84 return;
85 }
86
87 EndModal(wxID_CANCEL);
88 });
89}
90
92{
93}
94
95} // namespace cloud::audiocom
Declare functions to perform UTF-8 to std::wstring conversions.
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:630
bool OpenInDefaultBrowser(const wxString &url)
Open an URL in default browser.
Definition: BasicUI.cpp:240
wxString ToWXString(const std::string &str)
const ServiceConfig & GetServiceConfig()
Returns the instance of the ServiceConfig.