Audacity 3.2.0
ProjectVersionConflictDialog.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 NotCloudProjectDialog.cpp
7
8 Dmitry Vedenko
9
10**********************************************************************/
11
13
15{
16namespace
17{
18struct DialogProperties final
19{
24 bool HasCancelButton {};
25};
26
28 { XO("Project version conflict detected"),
29 XO("There's a newer version of this Audacity project on Audio.com. Saving this project will replace it as the newest version instead."),
30 XO("Save this project"), XO("Discard and open latest version"), false },
31 { XO("Project version conflict detected"),
32 XO("Project contains unsaved changes. There's a newer version of this Audacity project on Audio.com. Discarding changes will open the latest version instead."),
33 XO("Open local project"), XO("Discard and open latest version"), true },
34 { XO("Cloud project conflict"),
35 XO("You are attempting to open a new active version of this project when there is already one open. Please select which version you wish to remain open."),
36 XO("Keep currently open version"), XO("Open new version"), false },
37};
38} // namespace
39
43{
44 const auto& properties = dialogProperties[static_cast<int>(openMode)];
45
46 AddTitle(properties.Title);
47 AddParagraph(properties.Message);
48
49 if (properties.HasCancelButton)
51
53 UseLocalIdentifier(), properties.LocalButtonText,
54 !properties.HasCancelButton ? EscButton : 0);
55
56 AddButton(UseRemoteIdentifier(), properties.RemoteButtonText, DefaultButton);
57}
58
60{
61 return { L"local" };
62}
63
65{
66 return { L"remote" };
67}
68} // namespace audacity::cloud::audiocom::sync
XO("Cut/Copy/Paste")
const auto project
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Definition: Project.h:90
Holds a msgid for the translation catalog; may also bind format arguments.
void AddTitle(const TranslatableString &title)
void AddButton(DialogButtonIdentifier identifier, const TranslatableString &text, int type=None)
void AddParagraph(const TranslatableString &paragraph)
ProjectVersionConflictDialog(const AudacityProject *project, ProjectVersionConflictDialogMode openMode)