Add version information to "About" page

This commit is contained in:
Leon Richardt 2019-09-16 18:37:32 +02:00
parent ddcce73111
commit baf52d7563

View file

@ -1,5 +1,7 @@
#include "AboutPage.hpp" #include "AboutPage.hpp"
#include "common/Modes.hpp"
#include "common/Version.hpp"
#include "debug/Log.hpp" #include "debug/Log.hpp"
#include "util/LayoutCreator.hpp" #include "util/LayoutCreator.hpp"
#include "util/RemoveScrollAreaBackground.hpp" #include "util/RemoveScrollAreaBackground.hpp"
@ -71,6 +73,24 @@ AboutPage::AboutPage()
// } // }
}*/ }*/
auto versionInfo = layout.emplace<QGroupBox>("Version");
{
auto version = Version::getInstance();
QString text = QString("%1 (commit %2%3)")
.arg(version.getFullVersion())
.arg("<a "
"href=\"https://github.com/Chatterino/"
"chatterino2/commit/" +
version.getCommitHash() + "\">" +
version.getCommitHash() + "</a>")
.arg(Modes::getInstance().isNightly ? ", " + version.getDateOfBuild() : "");
auto versionLabel = versionInfo.emplace<QLabel>(text);
versionLabel->setOpenExternalLinks(true);
versionLabel->setTextInteractionFlags(Qt::TextSelectableByMouse |
Qt::LinksAccessibleByMouse);
}
auto licenses = auto licenses =
layout.emplace<QGroupBox>("Open source software used..."); layout.emplace<QGroupBox>("Open source software used...");
{ {