mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-02-20 10:54:14 +01:00
Merged in filnet/librepilot/LP-425_add_credits_to_about_dialog (pull request #340)
LP-425 add credits to about dialog
This commit is contained in:
commit
8b656cfa2b
@ -58,8 +58,8 @@ AboutDialog::AboutDialog(QWidget *parent) :
|
||||
"Built on %4 at %5<br/>"
|
||||
"Based on Qt %6 (%7 bit)<br/>"
|
||||
"<br/>"
|
||||
"© The %8 Project, %9. All rights reserved.<br/>"
|
||||
"© The OpenPilot Project 2010-2015. All rights reserved.<br/>"
|
||||
"\u00A9 The %8 Project, %9. All rights reserved.<br/>"
|
||||
"\u00A9 The OpenPilot Project 2010-2015. All rights reserved.<br/>"
|
||||
).arg(
|
||||
VersionInfo::revision().left(60), // %1
|
||||
VersionInfo::uavoHash().left(8), // %2
|
||||
@ -72,9 +72,35 @@ AboutDialog::AboutDialog(QWidget *parent) :
|
||||
VersionInfo::year() // %9
|
||||
);
|
||||
|
||||
// %1 = name, %2 = description, %3 = url, %4 = image url (not used)
|
||||
// <td><img src=\"%4\" size=\"32\"></td>
|
||||
QString creditRow = "<tr padding=10><td><b>%1</b>%2<br/></td><td><a href=\"%3\">%3</a></td></tr>";
|
||||
|
||||
// uses Text.StyledText (see http://doc.qt.io/qt-5/qml-qtquick-text.html#textFormat-prop)
|
||||
const QString credits = "<table width=\"100%\">"
|
||||
+ creditRow.arg("Tau Labs", "", "http://www.taulabs.org")
|
||||
+ creditRow.arg("dRonin", "", "http://www.dronin.org")
|
||||
+ creditRow.arg("OpenSceneGraph", "<br/>Open source high performance 3D graphics toolkit", "http://www.openscenegraph.org", "http://www.openscenegraph.org/images/osg64.png")
|
||||
+ creditRow.arg("osgEarth", "<br/>Geospatial SDK for OpenSceneGraph", "http://osgearth.org")
|
||||
+ creditRow.arg("MSYS2", "<br/>An independent rewrite of MSYS", "https://sourceforge.net/p/msys2/wiki/Home")
|
||||
+ creditRow.arg("The Qt Company", "", "http://www.qt.io")
|
||||
+ "</table>";
|
||||
|
||||
// uses Text.StyledText (see http://doc.qt.io/qt-5/qml-qtquick-text.html#textFormat-prop)
|
||||
const QString license = tr("This program is free software; you can redistribute it and/or "
|
||||
"modify it under the terms of the GNU General Public License "
|
||||
"as published by the Free Software Foundation; either version 3 "
|
||||
"of the License, or (at your option) any later version.\n"
|
||||
"The program is provided AS IS with NO WARRANTY OF ANY KIND, "
|
||||
"INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE."
|
||||
);
|
||||
|
||||
|
||||
QQuickView *view = new QQuickView();
|
||||
view->rootContext()->setContextProperty("dialog", this);
|
||||
view->rootContext()->setContextProperty("version", description);
|
||||
view->rootContext()->setContextProperty("credits", credits);
|
||||
view->rootContext()->setContextProperty("license", license);
|
||||
view->setResizeMode(QQuickView::SizeRootObjectToView);
|
||||
view->setSource(QUrl("qrc:/core/qml/AboutDialog.qml"));
|
||||
|
||||
|
@ -2,7 +2,8 @@
|
||||
******************************************************************************
|
||||
*
|
||||
* @file aboutdialog.qml
|
||||
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2013.
|
||||
* @author The LibrePilot Team http://www.librepilot.org Copyright (C) 2016.
|
||||
* The OpenPilot Team, http://www.openpilot.org Copyright (C) 2013.
|
||||
*
|
||||
*****************************************************************************/
|
||||
/*
|
||||
@ -20,23 +21,21 @@
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
import QtQuick 2.1
|
||||
import QtQuick.Layouts 1.0
|
||||
import QtQuick.Controls 1.0
|
||||
import QtQuick 2.6
|
||||
import QtQuick.Layouts 1.2
|
||||
import QtQuick.Controls 1.2
|
||||
|
||||
Rectangle {
|
||||
id: container
|
||||
width: 600
|
||||
height: 400
|
||||
height: 480
|
||||
|
||||
property AuthorsModel authors: AuthorsModel {}
|
||||
|
||||
ColumnLayout {
|
||||
id: columnLayout1
|
||||
anchors.fill: parent
|
||||
spacing: 10
|
||||
RowLayout {
|
||||
id: rowLayout1
|
||||
opacity: 1
|
||||
Image {
|
||||
id: logo
|
||||
@ -72,10 +71,10 @@ Rectangle {
|
||||
anchors.fill: parent
|
||||
Text {
|
||||
id: headerLabel
|
||||
text: qsTr("LibrePilot Ground Control Station")
|
||||
Layout.fillWidth: true
|
||||
font.pixelSize: 14
|
||||
font.bold: true
|
||||
text: qsTr("LibrePilot Ground Control Station")
|
||||
}
|
||||
Text {
|
||||
id: versionLabel
|
||||
@ -84,56 +83,66 @@ Rectangle {
|
||||
wrapMode: Text.WordWrap
|
||||
text: version
|
||||
}
|
||||
Text {
|
||||
id: licenseLabel
|
||||
Layout.fillWidth: true
|
||||
font.pixelSize: 9
|
||||
wrapMode: Text.WordWrap
|
||||
text: qsTr("This program is free software; you can redistribute it and/or " +
|
||||
"modify it under the terms of the GNU General Public License " +
|
||||
"as published by the Free Software Foundation; either version 3 " +
|
||||
"of the License, or (at your option) any later version.\n" +
|
||||
"The program is provided AS IS with NO WARRANTY OF ANY KIND, " +
|
||||
"INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.")
|
||||
}
|
||||
|
||||
Text {
|
||||
id: contributorLabel
|
||||
text: qsTr("Contributors")
|
||||
Layout.fillWidth: true
|
||||
font.pixelSize: 14
|
||||
font.bold: true
|
||||
|
||||
}
|
||||
ScrollView {
|
||||
TabView {
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
frameVisible: true
|
||||
ListView {
|
||||
id: authorsView
|
||||
anchors.fill: parent
|
||||
|
||||
spacing: 3
|
||||
model: authors
|
||||
delegate: Text {
|
||||
font.pixelSize: 12
|
||||
text: name
|
||||
Tab {
|
||||
title: qsTr("Contributors")
|
||||
anchors.leftMargin: 6
|
||||
ScrollView {
|
||||
frameVisible: false
|
||||
ListView {
|
||||
id: authorsView
|
||||
anchors.fill: parent
|
||||
spacing: 3
|
||||
model: authors
|
||||
delegate: Text {
|
||||
font.pixelSize: 12
|
||||
text: name
|
||||
}
|
||||
clip: true
|
||||
}
|
||||
}
|
||||
clip: true
|
||||
}
|
||||
Tab {
|
||||
title: qsTr("Credits")
|
||||
// margin hack to fix broken UI when frameVisible is false
|
||||
anchors.margins: 1
|
||||
anchors.rightMargin: 0
|
||||
TextArea {
|
||||
readOnly: true
|
||||
frameVisible: false
|
||||
wrapMode: TextEdit.WordWrap
|
||||
textFormat: TextEdit.RichText
|
||||
text: credits
|
||||
onLinkActivated: Qt.openUrlExternally(link)
|
||||
}
|
||||
}
|
||||
Tab {
|
||||
title: qsTr("License")
|
||||
// margin hack to fix broken UI when frameVisible is false
|
||||
anchors.margins: 1
|
||||
anchors.rightMargin: 0
|
||||
TextArea {
|
||||
readOnly: true
|
||||
frameVisible: false
|
||||
wrapMode: TextEdit.WordWrap
|
||||
textFormat: TextEdit.RichText
|
||||
text: license
|
||||
onLinkActivated: Qt.openUrlExternally(link)
|
||||
}
|
||||
}
|
||||
}
|
||||
Button {
|
||||
id: button
|
||||
anchors.right: parent.right
|
||||
anchors.bottom: parent.bottom
|
||||
text: qsTr("Ok")
|
||||
activeFocusOnPress: true
|
||||
onClicked: dialog.close()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Button {
|
||||
id: button
|
||||
text: qsTr("Ok")
|
||||
activeFocusOnPress: true
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: 10
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.bottomMargin: 10
|
||||
onClicked: dialog.close()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user