1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-12-02 10:24:11 +01:00

OP-1453 - Add mouse area to new version text that will launch the

software download page when clicked.
Strip CR from end of version read from website.
This commit is contained in:
dwillis 2014-08-24 01:29:33 +01:00
parent b1b086e09a
commit efeeb705b5
3 changed files with 13 additions and 4 deletions

View File

@ -117,10 +117,12 @@ Rectangle {
anchors.horizontalCenter: parent.horizontalCenter
width: textOpVersion.width + textOpVersionAvailable.width
spacing: 16
Text {
id: textOpVersion
color: "#c4c0c0"
text: welcomePlugin.versionString
verticalAlignment: Text.AlignTop
anchors.left: parent.anchors.left
font.bold: true
styleColor: "#00000000"
@ -136,7 +138,13 @@ Rectangle {
styleColor: "#00000000"
horizontalAlignment: Text.AlignHCenter
font.pixelSize: 14
anchors.right: parent.right
anchors.left: textOpVersion.right
MouseArea{
width: parent.width
height: parent.height
onClicked: welcomePlugin.openUrl("http://wiki.openpilot.org/display/BUILDS/OpenPilot+Software+Downloads")
}
}
}
}

View File

@ -153,10 +153,11 @@ void WelcomeMode::networkResponseReady(QNetworkReply* reply)
if(reply != NULL)
{
QString version(reply->readAll());
QString trimmedVersion = version.trimmed();
if(version != VersionInfo::revision())
if(trimmedVersion != VersionInfo::tagOrHash8())
{
m_newVersionText = tr("(Update Available: %1)").arg(version);
m_newVersionText = tr("(Update Available: %1) ").arg(trimmedVersion);
emit newVersionTextChanged();
}
}

View File

@ -71,7 +71,7 @@ public:
}
QString versionString() const
{
return tr("OpenPilot GCS Version: %1").arg(VersionInfo::revision());
return tr("OpenPilot GCS Version: %1 ").arg(VersionInfo::tagOrHash8());
}
QString newVersionText() const
{