Include user's operating system information in the About page (#3663)

Co-authored-by: Rasmus Karlsson <rasmus.karlsson@pajlada.com>
This commit is contained in:
Mm2PL
2022-04-09 12:55:27 +00:00
committed by GitHub
parent c399d4dbe9
commit 45e8d1d96e
2 changed files with 30 additions and 10 deletions
+1
View File
@@ -5,6 +5,7 @@
- Minor: Added quotation marks in the permitted/blocked Automod messages for clarity. (#3654) - Minor: Added quotation marks in the permitted/blocked Automod messages for clarity. (#3654)
- Minor: Adjust large stream thumbnail to 16:9 (#3655) - Minor: Adjust large stream thumbnail to 16:9 (#3655)
- Minor: Fixed being unable to load Twitch Usercards from the `/mentions` tab. (#3623) - Minor: Fixed being unable to load Twitch Usercards from the `/mentions` tab. (#3623)
- Minor: Add information about the user's operating system in the About page. (#3663)
- Bugfix: Fixed live notifications for usernames containing uppercase characters. (#3646) - Bugfix: Fixed live notifications for usernames containing uppercase characters. (#3646)
- Dev: Use Game Name returned by Get Streams instead of querying it from the Get Games API. (#3662) - Dev: Use Game Name returned by Get Streams instead of querying it from the Get Games API. (#3662)
+29 -10
View File
@@ -85,16 +85,35 @@ AboutPage::AboutPage()
auto versionInfo = layout.emplace<QGroupBox>("Version"); auto versionInfo = layout.emplace<QGroupBox>("Version");
{ {
auto version = Version::instance(); auto version = Version::instance();
QString text = QString("%1 (commit %2%3)") QString osInfo = QSysInfo::prettyProductName() +
.arg(version.fullVersion()) ", kernel: " + QSysInfo::kernelVersion();
.arg("<a " if (version.isFlatpak())
"href=\"https://github.com/Chatterino/" {
"chatterino2/commit/" + osInfo += ", running from Flatpak";
version.commitHash() + "\">" + }
version.commitHash() + "</a>")
.arg(Modes::instance().isNightly QString commitHashLink =
? ", built on " + version.dateOfBuild() QString("<a "
: ""); "href=\"https://github.com/Chatterino/chatterino2/"
"commit/%1\">%1</a>")
.arg(version.commitHash());
QString nightlyBuildInfo;
if (Modes::instance().isNightly)
{
nightlyBuildInfo =
QString(", built on %1").arg(version.dateOfBuild());
}
QString supportedOS;
if (!version.isSupportedOS())
{
supportedOS = "(unsupported OS)";
}
QString text = QString("%1 (commit %2%3) running on %4 %5")
.arg(version.fullVersion(), commitHashLink,
nightlyBuildInfo, osInfo, supportedOS);
auto versionLabel = versionInfo.emplace<QLabel>(text); auto versionLabel = versionInfo.emplace<QLabel>(text);
versionLabel->setOpenExternalLinks(true); versionLabel->setOpenExternalLinks(true);