mirror of
https://github.com/cookiengineer/audacity
synced 2025-11-23 17:30:17 +01:00
Add Audacuty naming style and fix macOS assertion.
This commit is contained in:
@@ -28,7 +28,7 @@ bool UpdateDataParser::Parse(const VersionPatch::UpdateDataFormat& updateData, V
|
|||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxArrayString UpdateDataParser::splitChangelogSentences(const wxString& changelogContent)
|
wxArrayString UpdateDataParser::SplitChangelogSentences(const wxString& changelogContent)
|
||||||
{
|
{
|
||||||
wxArrayString changelogSentenceList;
|
wxArrayString changelogSentenceList;
|
||||||
|
|
||||||
@@ -122,7 +122,7 @@ void UpdateDataParser::HandleXMLContent(const wxString& content)
|
|||||||
{
|
{
|
||||||
case XmlParsedTags::kDescriptionTag:
|
case XmlParsedTags::kDescriptionTag:
|
||||||
trimedContent.Trim(true).Trim(false);
|
trimedContent.Trim(true).Trim(false);
|
||||||
mVersionPatch->changelog = splitChangelogSentences(trimedContent);
|
mVersionPatch->changelog = SplitChangelogSentences(trimedContent);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case XmlParsedTags::kVersionTag:
|
case XmlParsedTags::kVersionTag:
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ private:
|
|||||||
void HandleXMLContent(const wxString& content) override;
|
void HandleXMLContent(const wxString& content) override;
|
||||||
XMLTagHandler* HandleXMLChild(const wxChar* tag) override;
|
XMLTagHandler* HandleXMLChild(const wxChar* tag) override;
|
||||||
|
|
||||||
wxArrayString splitChangelogSentences(const wxString& changelogContent);
|
wxArrayString SplitChangelogSentences(const wxString& changelogContent);
|
||||||
|
|
||||||
VersionPatch* mVersionPatch{ nullptr };
|
VersionPatch* mVersionPatch{ nullptr };
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -51,27 +51,27 @@ void UpdateManager::Start()
|
|||||||
static std::once_flag flag;
|
static std::once_flag flag;
|
||||||
std::call_once(flag, [&instance] {
|
std::call_once(flag, [&instance] {
|
||||||
instance.mTimer.SetOwner(&instance, ID_TIMER);
|
instance.mTimer.SetOwner(&instance, ID_TIMER);
|
||||||
instance.mTimer.StartOnce();
|
instance.mTimer.StartOnce(1);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void UpdateManager::enableUpdatesChecking(bool enable)
|
void UpdateManager::EnableUpdatesChecking(bool enable)
|
||||||
{
|
{
|
||||||
gPrefs->Write(prefsUpdatePopupDialogShown, enable);
|
gPrefs->Write(prefsUpdatePopupDialogShown, enable);
|
||||||
gPrefs->Flush();
|
gPrefs->Flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool UpdateManager::isUpdatesCheckingEnabled()
|
bool UpdateManager::IsUpdatesCheckingEnabled()
|
||||||
{
|
{
|
||||||
return gPrefs->ReadBool(prefsUpdatePopupDialogShown, true);
|
return gPrefs->ReadBool(prefsUpdatePopupDialogShown, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
VersionPatch UpdateManager::getVersionPatch() const
|
VersionPatch UpdateManager::GetVersionPatch() const
|
||||||
{
|
{
|
||||||
return mVersionPatch;
|
return mVersionPatch;
|
||||||
}
|
}
|
||||||
|
|
||||||
void UpdateManager::getUpdates()
|
void UpdateManager::GetUpdates()
|
||||||
{
|
{
|
||||||
const audacity::network_manager::Request request("https://updates.audacityteam.org/feed/latest.xml");
|
const audacity::network_manager::Request request("https://updates.audacityteam.org/feed/latest.xml");
|
||||||
auto response = audacity::network_manager::NetworkManager::GetInstance().doGet(request);
|
auto response = audacity::network_manager::NetworkManager::GetInstance().doGet(request);
|
||||||
@@ -123,13 +123,13 @@ void UpdateManager::getUpdates()
|
|||||||
|
|
||||||
void UpdateManager::OnTimer(wxTimerEvent& WXUNUSED(event))
|
void UpdateManager::OnTimer(wxTimerEvent& WXUNUSED(event))
|
||||||
{
|
{
|
||||||
if (isUpdatesCheckingEnabled() && isTimeToUpdate())
|
if (IsUpdatesCheckingEnabled() && IsTimeToUpdate())
|
||||||
getUpdates();
|
GetUpdates();
|
||||||
|
|
||||||
mTimer.StartOnce(mTrackingInterval);
|
mTimer.StartOnce(mTrackingInterval);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool UpdateManager::isTimeToUpdate()
|
bool UpdateManager::IsTimeToUpdate()
|
||||||
{
|
{
|
||||||
long long nextUpdatesCheckingTime = std::stoll(
|
long long nextUpdatesCheckingTime = std::stoll(
|
||||||
gPrefs->Read(prefsUpdateScheduledTime, "0").ToStdString());
|
gPrefs->Read(prefsUpdateScheduledTime, "0").ToStdString());
|
||||||
|
|||||||
@@ -33,12 +33,12 @@ public:
|
|||||||
static UpdateManager& GetInstance();
|
static UpdateManager& GetInstance();
|
||||||
static void Start();
|
static void Start();
|
||||||
|
|
||||||
void getUpdates();
|
void GetUpdates();
|
||||||
|
|
||||||
void enableUpdatesChecking(bool enable);
|
void EnableUpdatesChecking(bool enable);
|
||||||
bool isUpdatesCheckingEnabled();
|
bool IsUpdatesCheckingEnabled();
|
||||||
|
|
||||||
VersionPatch getVersionPatch() const;
|
VersionPatch GetVersionPatch() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
UpdateDataParser mUpdateDataParser;
|
UpdateDataParser mUpdateDataParser;
|
||||||
@@ -50,7 +50,7 @@ private:
|
|||||||
void OnTimer(wxTimerEvent& event);
|
void OnTimer(wxTimerEvent& event);
|
||||||
|
|
||||||
/// Scheduling update time for avoiding multiplying update notifications.
|
/// Scheduling update time for avoiding multiplying update notifications.
|
||||||
bool isTimeToUpdate();
|
bool IsTimeToUpdate();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
DECLARE_EVENT_TABLE()
|
DECLARE_EVENT_TABLE()
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ UpdatePopupDialog::UpdatePopupDialog (wxWindow* parent, UpdateManager* updateMan
|
|||||||
S.SetBorder (5);
|
S.SetBorder (5);
|
||||||
|
|
||||||
S.Id (DontShowID).AddCheckBox (
|
S.Id (DontShowID).AddCheckBox (
|
||||||
XO ("Don't show this again at start up"), !mUpdateManager->isUpdatesCheckingEnabled());
|
XO ("Don't show this again at start up"), !mUpdateManager->IsUpdatesCheckingEnabled());
|
||||||
|
|
||||||
S.Prop(1).AddSpace(1, 0, 1);
|
S.Prop(1).AddSpace(1, 0, 1);
|
||||||
|
|
||||||
@@ -80,7 +80,7 @@ void UpdatePopupDialog::OnSkip (wxCommandEvent&)
|
|||||||
|
|
||||||
void UpdatePopupDialog::OnDontShow (wxCommandEvent& event)
|
void UpdatePopupDialog::OnDontShow (wxCommandEvent& event)
|
||||||
{
|
{
|
||||||
mUpdateManager->enableUpdatesChecking(!event.IsChecked());
|
mUpdateManager->EnableUpdatesChecking(!event.IsChecked());
|
||||||
}
|
}
|
||||||
|
|
||||||
HtmlWindow* UpdatePopupDialog::AddHtmlContent (wxWindow* parent)
|
HtmlWindow* UpdatePopupDialog::AddHtmlContent (wxWindow* parent)
|
||||||
@@ -90,7 +90,7 @@ HtmlWindow* UpdatePopupDialog::AddHtmlContent (wxWindow* parent)
|
|||||||
|
|
||||||
// i18n-hint Substitution of version number for %s.
|
// i18n-hint Substitution of version number for %s.
|
||||||
static const auto title = XC("Audacity %s is available!", "update dialog")
|
static const auto title = XC("Audacity %s is available!", "update dialog")
|
||||||
.Format(mUpdateManager->getVersionPatch().version.getString());
|
.Format(mUpdateManager->GetVersionPatch().version.GetString());
|
||||||
|
|
||||||
informationStr
|
informationStr
|
||||||
<< wxT("<html><body><h3>")
|
<< wxT("<html><body><h3>")
|
||||||
@@ -100,7 +100,7 @@ HtmlWindow* UpdatePopupDialog::AddHtmlContent (wxWindow* parent)
|
|||||||
<< wxT("</h5><p>");
|
<< wxT("</h5><p>");
|
||||||
|
|
||||||
informationStr << wxT("<ul>");
|
informationStr << wxT("<ul>");
|
||||||
for (auto& logLine : mUpdateManager->getVersionPatch().changelog)
|
for (auto& logLine : mUpdateManager->GetVersionPatch().changelog)
|
||||||
{
|
{
|
||||||
informationStr << wxT("<li>");
|
informationStr << wxT("<li>");
|
||||||
// We won't to translate downloaded text.
|
// We won't to translate downloaded text.
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ VersionId VersionId::ParseFromString(wxString& versionString)
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
wxString VersionId::getString() const
|
wxString VersionId::GetString() const
|
||||||
{
|
{
|
||||||
return MakeString(mVersion, mRelease, mRevision);
|
return MakeString(mVersion, mRelease, mRevision);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ public:
|
|||||||
static VersionId ParseFromString(wxString& versionString);
|
static VersionId ParseFromString(wxString& versionString);
|
||||||
|
|
||||||
/// Make string with version by MakeString() from instance values.
|
/// Make string with version by MakeString() from instance values.
|
||||||
wxString getString() const;
|
wxString GetString() const;
|
||||||
|
|
||||||
bool operator== (const VersionId& other);
|
bool operator== (const VersionId& other);
|
||||||
bool operator!= (const VersionId& other);
|
bool operator!= (const VersionId& other);
|
||||||
|
|||||||
Reference in New Issue
Block a user