Audacity 3.2.0
Public Member Functions | Private Attributes | List of all members
anonymous_namespace{AudioComPrefsPanel.cpp}::AudioComPrefsPanel Class Referencefinal
Inheritance diagram for anonymous_namespace{AudioComPrefsPanel.cpp}::AudioComPrefsPanel:
[legend]
Collaboration diagram for anonymous_namespace{AudioComPrefsPanel.cpp}::AudioComPrefsPanel:
[legend]

Public Member Functions

 AudioComPrefsPanel (wxWindow *parent, wxWindowID winid)
 
bool Commit () override
 
void Cancel () override
 
void PopulateOrExchange (ShuttleGui &S) override
 
ComponentInterfaceSymbol GetSymbol () const override
 
TranslatableString GetDescription () const override
 
void Browse ()
 
- Public Member Functions inherited from PrefsPanel
 PrefsPanel (wxWindow *parent, wxWindowID winid, const TranslatableString &title)
 
virtual ~PrefsPanel ()
 
virtual void Preview ()
 
virtual bool Commit ()=0
 
virtual PluginPath GetPath () const override
 
virtual VendorSymbol GetVendor () const override
 
virtual wxString GetVersion () const override
 
virtual bool ShowsPreviewButton ()
 
virtual void PopulateOrExchange (ShuttleGui &WXUNUSED(S))
 
virtual ManualPageID HelpPageName ()
 If not empty string, the Help button is added below the panel. More...
 
virtual void Cancel ()
 
- Public Member Functions inherited from wxPanelWrapper
 wxPanelWrapper ()
 
 wxPanelWrapper (wxWindow *parent, wxWindowID winid=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL|wxNO_BORDER, const TranslatableString &name=XO("Panel"))
 
bool Create (wxWindow *parent, wxWindowID winid=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL|wxNO_BORDER, const TranslatableString &name=XO("Panel"))
 
void SetLabel (const TranslatableString &label)
 
void SetName (const TranslatableString &name)
 
void SetToolTip (const TranslatableString &toolTip)
 
void SetName ()
 
- Public Member Functions inherited from wxTabTraversalWrapper< wxPanel >
 wxTabTraversalWrapper (Args &&... args)
 
 wxTabTraversalWrapper (const wxTabTraversalWrapper &)=delete
 
 wxTabTraversalWrapper (wxTabTraversalWrapper &&)=delete
 
wxTabTraversalWrapperoperator= (const wxTabTraversalWrapper &)=delete
 
wxTabTraversalWrapperoperator= (wxTabTraversalWrapper &&)=delete
 

Private Attributes

wxTextCtrl * mCloudProjectsSavePath {}
 
Observer::Subscription mFrequencySubscription
 
sync::CloudLocationMode mSaveLocationMode
 
sync::CloudLocationMode mExportLocationMode
 

Additional Inherited Members

- Public Types inherited from PrefsPanel
using Factories = std::vector< PrefsPanel::PrefsNode >
 
using Factory = std::function< PrefsPanel *(wxWindow *parent, wxWindowID winid, AudacityProject *) >
 
- Static Public Member Functions inherited from PrefsPanel
static FactoriesDefaultFactories ()
 

Detailed Description

Definition at line 37 of file AudioComPrefsPanel.cpp.

Constructor & Destructor Documentation

◆ AudioComPrefsPanel()

anonymous_namespace{AudioComPrefsPanel.cpp}::AudioComPrefsPanel::AudioComPrefsPanel ( wxWindow *  parent,
wxWindowID  winid 
)
inline

Definition at line 40 of file AudioComPrefsPanel.cpp.

41 : PrefsPanel { parent, winid, XO("Cloud") }
42 {
45
48 }
XO("Cut/Copy/Paste")
@ eIsCreatingFromPrefs
Definition: ShuttleGui.h:46
#define S(N)
Definition: ToChars.cpp:64
Enum ReadEnum() const
Definition: Prefs.h:534
Base class for a panel in the PrefsDialog. Classes derived from this class include BatchPrefs,...
Definition: PrefsPanel.h:51
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Definition: ShuttleGui.h:640
EnumSetting< CloudLocationMode > SaveLocationMode
EnumSetting< CloudLocationMode > ExportLocationMode

References eIsCreatingFromPrefs, audacity::cloud::audiocom::sync::ExportLocationMode, EnumSetting< Enum >::ReadEnum(), S, and audacity::cloud::audiocom::sync::SaveLocationMode.

Here is the call graph for this function:

Member Function Documentation

◆ Browse()

void anonymous_namespace{AudioComPrefsPanel.cpp}::AudioComPrefsPanel::Browse ( )
inline

Definition at line 188 of file AudioComPrefsPanel.cpp.

189 {
190 const auto currentPath = CloudProjectsSavePath.Read();
191
193 this, XO("Choose a location to place the temporary directory"),
194 currentPath);
195 int retval = dlog.ShowModal();
196
197 if (retval != wxID_CANCEL && !dlog.GetPath().empty())
198 {
199 wxFileName tmpDirPath;
200 tmpDirPath.AssignDir(dlog.GetPath());
201
203 tmpDirPath.GetFullPath(),
204 XO("Temporary files directory cannot be on a FAT drive.")))
205 {
206 return;
207 }
208
210 dlog.GetPath(), XO("Cannot set the preference.")))
211 {
212 return;
213 }
214
215 mCloudProjectsSavePath->SetValue(
216 tmpDirPath.GetPath(wxPATH_GET_VOLUME | wxPATH_GET_SEPARATOR));
217 }
218 }
bool Read(T *pVar) const
overload of Read returning a boolean that is true if the value was previously defined *‍/
Definition: Prefs.h:207
FILES_API bool WritableLocationCheck(const FilePath &path, const TranslatableString &message)
Check location on writable access and return true if checked successfully.
FILES_API bool FATFilesystemDenied(const FilePath &path, const TranslatableString &msg, const BasicUI::WindowPlacement &placement={})

References audacity::cloud::audiocom::CloudProjectsSavePath, TempDirectory::FATFilesystemDenied(), Setting< T >::Read(), FileNames::WritableLocationCheck(), and XO().

Here is the call graph for this function:

◆ Cancel()

void anonymous_namespace{AudioComPrefsPanel.cpp}::AudioComPrefsPanel::Cancel ( )
inlineoverridevirtual

Reimplemented from PrefsPanel.

Definition at line 66 of file AudioComPrefsPanel.cpp.

67 {
68 // ChoiceSetting ignores transactions, so we need to reset the values
71 }
bool WriteEnum(Enum value)
Definition: Prefs.h:546

References audacity::cloud::audiocom::sync::ExportLocationMode, audacity::cloud::audiocom::sync::SaveLocationMode, and EnumSetting< Enum >::WriteEnum().

Here is the call graph for this function:

◆ Commit()

bool anonymous_namespace{AudioComPrefsPanel.cpp}::AudioComPrefsPanel::Commit ( )
inlineoverridevirtual

Implements PrefsPanel.

Definition at line 50 of file AudioComPrefsPanel.cpp.

51 {
54
57
58 // Enum settings are not cacheable, so we need to invalidate them
59 // sync::SaveLocationMode.Invalidate();
60 // sync::ExportLocationMode.Invalidate();
62
63 return true;
64 }
@ eIsSavingToPrefs
Definition: ShuttleGui.h:47
void Invalidate() override
Definition: Prefs.h:289

References audacity::cloud::audiocom::CloudProjectsSavePath, audacity::cloud::audiocom::DaysToKeepFiles, eIsSavingToPrefs, Setting< T >::Invalidate(), audacity::cloud::audiocom::sync::MixdownDialogShown, and S.

Here is the call graph for this function:

◆ GetDescription()

TranslatableString anonymous_namespace{AudioComPrefsPanel.cpp}::AudioComPrefsPanel::GetDescription ( ) const
inlineoverridevirtual

Implements ComponentInterface.

Definition at line 183 of file AudioComPrefsPanel.cpp.

184 {
185 return XO("Preferences for Cloud");
186 }

References XO().

Here is the call graph for this function:

◆ GetSymbol()

ComponentInterfaceSymbol anonymous_namespace{AudioComPrefsPanel.cpp}::AudioComPrefsPanel::GetSymbol ( ) const
inlineoverridevirtual

Implements ComponentInterface.

Definition at line 178 of file AudioComPrefsPanel.cpp.

179 {
180 return ComponentInterfaceSymbol { XO("Cloud") };
181 }
ComponentInterfaceSymbol pairs a persistent string identifier used internally with an optional,...

References XO().

Here is the call graph for this function:

◆ PopulateOrExchange()

void anonymous_namespace{AudioComPrefsPanel.cpp}::AudioComPrefsPanel::PopulateOrExchange ( ShuttleGui S)
inlineoverride

Definition at line 73 of file AudioComPrefsPanel.cpp.

74 {
75 S.SetBorder(2);
76 S.StartScroller();
77 {
78 S.SetBorder(8);
79
80 S.StartStatic(XO("Account"));
81 {
82 S.SetBorder(8);
83 S.AddWindow(
85 GetUserService(), true,
86 AudiocomTrace::PrefsPanel, S.GetParent() },
87 wxEXPAND);
88 }
89 S.EndStatic();
90
91 S.StartStatic(XO("Export behavior"));
92 {
93 S.SetBorder(8);
94 auto checkBox = S.AddCheckBox(
95 XO("S&how 'How would you like to export?' dialog"),
97 sync::CloudLocationMode::Ask);
98
99 checkBox->Bind(
100 wxEVT_CHECKBOX,
101 [this](auto& event)
102 {
104 event.IsChecked() ? sync::CloudLocationMode::Ask :
105 sync::CloudLocationMode::Local);
106 });
107 }
108 S.EndStatic();
109
110 S.StartStatic(XO("Save behavior"));
111 {
112 S.SetBorder(4);
113
114 const auto initialMode =
115 static_cast<int>(sync::SaveLocationMode.ReadEnum());
116
117 auto BindRadioButton = [](auto* button, auto mode)
118 {
119 button->Bind(
120 wxEVT_RADIOBUTTON,
121 [mode](auto& event)
122 {
124 static_cast<sync::CloudLocationMode>(mode));
125 });
126 };
127
128 S.StartInvisiblePanel(4);
129 {
130 BindRadioButton(S.AddRadioButton(
131 XO("Always &ask"),
132 static_cast<int>(sync::CloudLocationMode::Ask),
133 initialMode),
134 sync::CloudLocationMode::Ask);
135 BindRadioButton(S.AddRadioButtonToGroup(
136 XO("Always &save to cloud"),
137 static_cast<int>(sync::CloudLocationMode::Cloud),
138 initialMode),
139 sync::CloudLocationMode::Cloud);
140 BindRadioButton(S.AddRadioButtonToGroup(
141 XO("Always save to the co&mputer"),
142 static_cast<int>(sync::CloudLocationMode::Local),
143 initialMode),
144 sync::CloudLocationMode::Local);
145 }
146 S.EndInvisiblePanel();
147 }
148 S.EndStatic();
149
150 S.StartStatic(XO("Temporary Cloud files directory"));
151 {
152 S.SetBorder(8);
153 S.StartMultiColumn(3, wxEXPAND);
154 {
155 S.SetStretchyCol(1);
156
157 mCloudProjectsSavePath = S.TieTextBox(XXO("&Location:"), CloudProjectsSavePath, 30);
158 S.AddButton(XXO("&Browse..."))
159 ->Bind(wxEVT_BUTTON, [this](auto&) { Browse(); });
160 }
161 S.EndMultiColumn();
162
163 S.SetBorder(8);
164 S.StartMultiColumn(3);
165 {
166 S.NameSuffix(XO("days"))
167 .TieIntegerTextBox(
168 XXO("&Remove temporary files after:"), DaysToKeepFiles, 10);
169 S.AddFixedText(XO("days"), true);
170 }
171 S.EndMultiColumn();
172 }
173 S.EndStatic();
174 }
175 S.EndScroller();
176 }
XXO("&Cut/Copy/Paste Toolbar")
#define safenew
Definition: MemoryX.h:10
UserService & GetUserService()
OAuthService & GetOAuthService()
Returns the instance of the OAuthService.
const ServiceConfig & GetServiceConfig()
Returns the instance of the ServiceConfig.

References audacity::cloud::audiocom::CloudProjectsSavePath, audacity::cloud::audiocom::DaysToKeepFiles, audacity::cloud::audiocom::sync::ExportLocationMode, audacity::cloud::audiocom::GetOAuthService(), audacity::cloud::audiocom::GetServiceConfig(), audacity::cloud::audiocom::GetUserService(), PrefsPanel, EnumSetting< Enum >::ReadEnum(), S, safenew, audacity::cloud::audiocom::sync::SaveLocationMode, EnumSetting< Enum >::WriteEnum(), XO(), and XXO().

Here is the call graph for this function:

Member Data Documentation

◆ mCloudProjectsSavePath

wxTextCtrl* anonymous_namespace{AudioComPrefsPanel.cpp}::AudioComPrefsPanel::mCloudProjectsSavePath {}
private

Definition at line 221 of file AudioComPrefsPanel.cpp.

◆ mExportLocationMode

sync::CloudLocationMode anonymous_namespace{AudioComPrefsPanel.cpp}::AudioComPrefsPanel::mExportLocationMode
private

Definition at line 225 of file AudioComPrefsPanel.cpp.

◆ mFrequencySubscription

Observer::Subscription anonymous_namespace{AudioComPrefsPanel.cpp}::AudioComPrefsPanel::mFrequencySubscription
private

Definition at line 222 of file AudioComPrefsPanel.cpp.

◆ mSaveLocationMode

sync::CloudLocationMode anonymous_namespace{AudioComPrefsPanel.cpp}::AudioComPrefsPanel::mSaveLocationMode
private

Definition at line 224 of file AudioComPrefsPanel.cpp.


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