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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 30 additions and 10 deletions

View file

@ -5,6 +5,7 @@
- Minor: Added quotation marks in the permitted/blocked Automod messages for clarity. (#3654)
- Minor: Adjust large stream thumbnail to 16:9 (#3655)
- 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)
- Dev: Use Game Name returned by Get Streams instead of querying it from the Get Games API. (#3662)

View file

@ -85,16 +85,35 @@ AboutPage::AboutPage()
auto versionInfo = layout.emplace<QGroupBox>("Version");
{
auto version = Version::instance();
QString text = QString("%1 (commit %2%3)")
.arg(version.fullVersion())
.arg("<a "
"href=\"https://github.com/Chatterino/"
"chatterino2/commit/" +
version.commitHash() + "\">" +
version.commitHash() + "</a>")
.arg(Modes::instance().isNightly
? ", built on " + version.dateOfBuild()
: "");
QString osInfo = QSysInfo::prettyProductName() +
", kernel: " + QSysInfo::kernelVersion();
if (version.isFlatpak())
{
osInfo += ", running from Flatpak";
}
QString commitHashLink =
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);
versionLabel->setOpenExternalLinks(true);