MCPcopy Create free account
hub / github.com/audacity/audacity / AddHtmlContent

Method AddHtmlContent

src/update/UpdatePopupDialog.cpp:95–174  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

93}
94
95HtmlWindow* UpdatePopupDialog::AddHtmlContent (wxWindow* parent)
96{
97 wxStringOutputStream o;
98 wxTextOutputStream informationStr (o);
99
100#if AUDACITY_BUILD_LEVEL == 0
101 const auto versionPostfix = " Alpha";
102#elif AUDACITY_BUILD_LEVEL == 1
103 const auto versionPostfix = " Beta";
104#else
105 const auto versionPostfix = "";
106#endif
107
108 informationStr
109 << wxT("<html><body><h3>")
110 // i18n-hint Substitution of version number for %s.
111 << XC("Audacity %s is available!", "update dialog")
112 .Format(
113 mVersionPatch.version.GetString() + versionPostfix)
114 .Translation()
115 << wxT("</h3>");
116
117 // Display description if available
118 if (!mVersionPatch.description.IsEmpty())
119 {
120 informationStr << wxT("<p>") << mVersionPatch.description << wxT("</p>");
121 }
122
123 informationStr << wxT("<h5>")
124 << XC("Changelog", "update dialog")
125 << wxT("</h5><p>");
126
127 informationStr << wxT("<ul>");
128 for (const auto& item : mVersionPatch.changelog)
129 {
130 informationStr << wxT("<li>");
131
132 // Display version if present
133 if (!item.version.IsEmpty())
134 {
135 informationStr << wxT("<b>From ") << item.version << wxT(":</b> ");
136 }
137
138 // Display changelog text
139 informationStr << item.text;
140 informationStr << wxT("</li>");
141 }
142 informationStr << wxT("</ul></p>");
143
144 informationStr << wxT("<p>");
145 wxString releaseUrl = mVersionPatch.releaseNotesUrl.IsEmpty()
146 ? wxString("https://github.com/audacity/audacity/releases")
147 : mVersionPatch.releaseNotesUrl;
148 informationStr << wxT("<a href = \"") << releaseUrl << wxT("\">");
149 informationStr << XC("Read more on GitHub", "update dialog");
150 informationStr << wxT("</a>");
151 informationStr << wxT("</p>");
152

Callers

nothing calls this directly

Calls 8

TranslationMethod · 0.80
GetHeightMethod · 0.80
wxStringClass · 0.50
wxSizeClass · 0.50
GetStringMethod · 0.45
IsEmptyMethod · 0.45
LayoutMethod · 0.45
SetSizeMethod · 0.45

Tested by

no test coverage detected