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 36 of file AudioComPrefsPanel.cpp.

Constructor & Destructor Documentation

◆ AudioComPrefsPanel()

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

Definition at line 39 of file AudioComPrefsPanel.cpp.

40 : PrefsPanel { parent, winid, XO("Cloud") }
41 {
44
47 }
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 186 of file AudioComPrefsPanel.cpp.

187 {
188 const auto currentPath = CloudProjectsSavePath.Read();
189
191 this, XO("Choose a location to place the temporary directory"),
192 currentPath);
193 int retval = dlog.ShowModal();
194
195 if (retval != wxID_CANCEL && !dlog.GetPath().empty())
196 {
197 wxFileName tmpDirPath;
198 tmpDirPath.AssignDir(dlog.GetPath());
199
201 tmpDirPath.GetFullPath(),
202 XO("Temporary files directory cannot be on a FAT drive.")))
203 {
204 return;
205 }
206
208 dlog.GetPath(), XO("Cannot set the preference.")))
209 {
210 return;
211 }
212
213 mCloudProjectsSavePath->SetValue(
214 tmpDirPath.GetPath(wxPATH_GET_VOLUME | wxPATH_GET_SEPARATOR));
215 }
216 }
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 65 of file AudioComPrefsPanel.cpp.

66 {
67 // ChoiceSetting ignores transactions, so we need to reset the values
70 }
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 49 of file AudioComPrefsPanel.cpp.

50 {
53
56
57 // Enum settings are not cacheable, so we need to invalidate them
58 // sync::SaveLocationMode.Invalidate();
59 // sync::ExportLocationMode.Invalidate();
61
62 return true;
63 }
@ 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 181 of file AudioComPrefsPanel.cpp.

182 {
183 return XO("Preferences for Cloud");
184 }

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 176 of file AudioComPrefsPanel.cpp.

177 {
178 return ComponentInterfaceSymbol { XO("Cloud") };
179 }
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 72 of file AudioComPrefsPanel.cpp.

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

◆ mExportLocationMode

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

Definition at line 223 of file AudioComPrefsPanel.cpp.

◆ mFrequencySubscription

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

Definition at line 220 of file AudioComPrefsPanel.cpp.

◆ mSaveLocationMode

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

Definition at line 222 of file AudioComPrefsPanel.cpp.


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