mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-01-18 03:52:11 +01:00
Merge branch 'next' into translations_next
This commit is contained in:
commit
c49e53977f
190
ground/openpilotgcs/src/plugins/welcome/qml/ActivityPanel.qml
Normal file
190
ground/openpilotgcs/src/plugins/welcome/qml/ActivityPanel.qml
Normal file
@ -0,0 +1,190 @@
|
||||
import QtQuick 1.1
|
||||
|
||||
Item {
|
||||
id: container
|
||||
width: 100
|
||||
height: 62
|
||||
|
||||
signal clicked(string url)
|
||||
|
||||
Text {
|
||||
id: header
|
||||
text: qsTr("Project Activity")
|
||||
width: parent.width - 32
|
||||
color: "#44515c"
|
||||
font {
|
||||
pointSize: 14
|
||||
weight: Font.Bold
|
||||
}
|
||||
}
|
||||
|
||||
Image {
|
||||
id: refresh
|
||||
width: 16
|
||||
height: 16
|
||||
source: "images/refresh.png"
|
||||
anchors.left: header.right
|
||||
anchors.leftMargin: 6
|
||||
anchors.verticalCenter: header.verticalCenter
|
||||
MouseArea {
|
||||
id: mouseAreaRefresh
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
onClicked: {
|
||||
xmlModel.reload()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
ListView {
|
||||
id: view
|
||||
width: parent.width
|
||||
spacing: 8
|
||||
anchors { top: header.bottom; topMargin: 14; bottom: parent.bottom }
|
||||
model: xmlModel
|
||||
delegate: listDelegate
|
||||
clip: true
|
||||
}
|
||||
|
||||
ScrollDecorator {
|
||||
flickableItem: view
|
||||
}
|
||||
|
||||
XmlListModel {
|
||||
id: xmlModel
|
||||
source: "http://progress.openpilot.org/activity?maxResults=30&streams=key+IS+OP"
|
||||
query: "/feed/entry"
|
||||
namespaceDeclarations: "declare default element namespace 'http://www.w3.org/2005/Atom';
|
||||
declare namespace activity='http://activitystrea.ms/spec/1.0/';
|
||||
declare namespace media='http://purl.org/syndication/atommedia';"
|
||||
|
||||
XmlRole { name: "author"; query: "author/name/string()" }
|
||||
XmlRole { name: "authorLink"; query: "author/uri/string()" }
|
||||
XmlRole { name: "authorPhoto"; query: "author/link[@rel = 'photo' and @media:height='16']/@href/string()" }
|
||||
|
||||
XmlRole { name: "action"; query: "category/@term/string()" }
|
||||
XmlRole { name: "actionLink"; query: "link[@rel = 'alternate']/@href/string()" }
|
||||
XmlRole { name: "actionTitle"; query: "activity:object/title/string()" }
|
||||
XmlRole { name: "actionSummary"; query: "activity:object/summary/string()" }
|
||||
XmlRole { name: "actionTargetTitle"; query: "activity:target/summary/string()" }
|
||||
XmlRole { name: "actionTargetSummary"; query: "activity:target/summary/string()" }
|
||||
|
||||
XmlRole { name: "applicationIcon"; query: "link[@rel = 'http://streams.atlassian.com/syndication/icon']/@href/string()" }
|
||||
}
|
||||
|
||||
Component {
|
||||
id: listDelegate
|
||||
Item {
|
||||
id: item
|
||||
width: view.width
|
||||
height: column.height
|
||||
Column {
|
||||
id: column
|
||||
Row {
|
||||
id: topRow
|
||||
spacing: 8
|
||||
Image {
|
||||
id: photo
|
||||
width: 16
|
||||
height: 16
|
||||
source: authorPhoto
|
||||
MouseArea {
|
||||
id: mouseArea
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
onClicked: {
|
||||
container.clicked(authorLink)
|
||||
}
|
||||
}
|
||||
}
|
||||
Text {
|
||||
id: name
|
||||
text: author
|
||||
width: container.width - photo.width - icon.width - 24
|
||||
color: mouseArea2.containsMouse ? "#224d81" : "black"
|
||||
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
||||
horizontalAlignment: Text.AlignLeft
|
||||
verticalAlignment: Text.AlignTop
|
||||
textFormat: Text.RichText
|
||||
elide: Text.ElideRight
|
||||
font.bold: true
|
||||
MouseArea {
|
||||
id: mouseArea2
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
onClicked: {
|
||||
container.clicked(authorLink)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Image {
|
||||
id: icon
|
||||
width: 16
|
||||
height: 16
|
||||
source: applicationIcon
|
||||
}
|
||||
}
|
||||
Row {
|
||||
id: middleRow
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: 25
|
||||
property string prefix: ""
|
||||
Text {
|
||||
width: container.width - anchors.leftMargin - icon.width - 24 - 8
|
||||
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
||||
textFormat: Text.RichText
|
||||
elide: Text.ElideRight
|
||||
text: {
|
||||
switch(action) {
|
||||
case "commented":
|
||||
case "comment": parent.prefix = qsTr("Commented on "); break;
|
||||
case "post":
|
||||
case "created": parent.prefix = qsTr("Created "); break;
|
||||
case "create-and-start": parent.prefix = qsTr("Created and started "); break;
|
||||
case "complete": parent.prefix = qsTr("Completed "); break;
|
||||
case "close":
|
||||
case "closed": parent.prefix = qsTr("Closed "); break;
|
||||
case "abandon": parent.prefix = qsTr("Abandoned "); break;
|
||||
case "commit": parent.prefix = qsTr("Committed "); break;
|
||||
case "resolved": parent.prefix = qsTr("Resolved "); break;
|
||||
case "start": parent.prefix = qsTr("Started "); break;
|
||||
case "started": parent.prefix = qsTr("Started working on "); break;
|
||||
case "stopped": parent.prefix = qsTr("Stopped working on "); break;
|
||||
case "Code Review": parent.prefix = qsTr("Requested code review on "); break;
|
||||
case "Testing": parent.prefix = qsTr("Requested testing of "); break;
|
||||
case "": parent.prefix = qsTr("Updated "); break;
|
||||
default: parent.prefix = action.substr(0, 1).toUpperCase() + action.substr(1) + " " ; break;
|
||||
}
|
||||
parent.prefix = "<font color='#224d81'>" + parent.prefix + "</font>"
|
||||
if(action == "commented" || action == "comment" || (action == "" && actionSummary == "")) {
|
||||
if(actionTargetTitle != actionTargetSummary) {
|
||||
parent.prefix + actionTargetTitle + ": " + actionTargetSummary
|
||||
} else {
|
||||
parent.prefix + actionTargetTitle
|
||||
}
|
||||
}
|
||||
else {
|
||||
if(actionSummary == "") {
|
||||
parent.prefix + actionTitle
|
||||
} else {
|
||||
parent.prefix + actionTitle + ": " + actionSummary
|
||||
}
|
||||
}
|
||||
}
|
||||
color: mouseArea3.containsMouse ? "#224d81" : "black"
|
||||
MouseArea {
|
||||
id: mouseArea3
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
onClicked: {
|
||||
container.clicked(actionLink)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -4,43 +4,70 @@ import QtQuick 1.1
|
||||
Item {
|
||||
property alias sourceSize: background.sourceSize
|
||||
width: sourceSize.width
|
||||
height: 300
|
||||
height: 400
|
||||
|
||||
BorderImage {
|
||||
id: background
|
||||
x: 0
|
||||
y: 0
|
||||
anchors.rightMargin: 0
|
||||
anchors.bottomMargin: 0
|
||||
anchors.leftMargin: 0
|
||||
anchors.topMargin: 0
|
||||
anchors.fill: parent
|
||||
|
||||
border { left: 30; top: 30; right: 30; bottom: 30 }
|
||||
source: "images/welcome-news-bg.png"
|
||||
}
|
||||
|
||||
NewsPanel {
|
||||
id: newsPanel
|
||||
SitesPanel {
|
||||
id: sites
|
||||
height: 50
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.top: parent.top
|
||||
anchors.bottom: parent.bottom
|
||||
width: parent.width*0.6
|
||||
anchors.margins: 32
|
||||
|
||||
onClicked: welcomePlugin.openUrl(url)
|
||||
}
|
||||
|
||||
//better to use image instead
|
||||
Rectangle {
|
||||
id: separator
|
||||
id: vertSeparator
|
||||
height: 1
|
||||
width: sites.width-20
|
||||
anchors.horizontalCenter: sites.horizontalCenter
|
||||
anchors.top: sites.bottom
|
||||
anchors.margins: 16
|
||||
color: "#A0A0A0"
|
||||
}
|
||||
|
||||
NewsPanel {
|
||||
id: newsPanel
|
||||
anchors.left: parent.left
|
||||
anchors.top: sites.bottom
|
||||
anchors.bottom: parent.bottom
|
||||
width: parent.width*0.45
|
||||
anchors.margins: 32
|
||||
|
||||
onClicked: welcomePlugin.openUrl(url)
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
id: horizSeparator
|
||||
width: 1
|
||||
height: parent.height*0.7
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
height: newsPanel.height-20
|
||||
anchors.verticalCenter: newsPanel.verticalCenter
|
||||
anchors.left: newsPanel.right
|
||||
anchors.margins: 16
|
||||
color: "#A0A0A0"
|
||||
}
|
||||
|
||||
SitesPanel {
|
||||
ActivityPanel {
|
||||
id: activityPanel
|
||||
anchors.left: newsPanel.right
|
||||
anchors.right: parent.right
|
||||
anchors.top: parent.top
|
||||
anchors.top: sites.bottom
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.right: parent.right
|
||||
anchors.margins: 32
|
||||
|
||||
onClicked: welcomePlugin.openUrl(url)
|
||||
|
@ -21,26 +21,26 @@ Item {
|
||||
|
||||
ListModel {
|
||||
id: sitesModel
|
||||
ListElement { title: "OpenPilot Home"; link: "http://www.openpilot.org" }
|
||||
ListElement { title: "OpenPilot Wiki"; link: "http://wiki.openpilot.org" }
|
||||
ListElement { title: "OpenPilot Store"; link: "http://www.openpilot.org/hardware/get-hardware/" }
|
||||
ListElement { title: "OpenPilot Forums"; link: "http://forums.openpilot.org" }
|
||||
ListElement { title: "OpenPilot Code Reviews"; link: "http://git.openpilot.org" }
|
||||
ListElement { title: "OpenPilot Progress Tracker"; link: "http://progress.openpilot.org" }
|
||||
ListElement { title: "Home"; link: "http://www.openpilot.org" }
|
||||
ListElement { title: "Wiki"; link: "http://wiki.openpilot.org" }
|
||||
ListElement { title: "Store"; link: "http://www.openpilot.org/hardware/get-hardware/" }
|
||||
ListElement { title: "Forums"; link: "http://forums.openpilot.org" }
|
||||
ListElement { title: "Code Reviews"; link: "http://git.openpilot.org" }
|
||||
ListElement { title: "Progress Tracker"; link: "http://progress.openpilot.org" }
|
||||
}
|
||||
|
||||
ListView {
|
||||
id: view
|
||||
width: parent.width
|
||||
anchors { top: header.bottom; topMargin: 14; leftMargin: 32; bottom: parent.bottom }
|
||||
width: 839
|
||||
anchors.topMargin: 30
|
||||
anchors { top: parent.top; bottom: parent.bottom }
|
||||
orientation: ListView.Horizontal
|
||||
model: sitesModel
|
||||
spacing: 8
|
||||
spacing: 80
|
||||
|
||||
delegate: Text {
|
||||
text: title
|
||||
width: view.width
|
||||
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
||||
|
||||
font {
|
||||
pointSize: 12
|
||||
weight: Font.Bold
|
||||
|
BIN
ground/openpilotgcs/src/plugins/welcome/qml/images/refresh.png
Normal file
BIN
ground/openpilotgcs/src/plugins/welcome/qml/images/refresh.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 298 B |
@ -32,7 +32,8 @@ Rectangle {
|
||||
// top - 48% - Icons - 27% - CommunityWidget - 25% - bottom
|
||||
y: (parent.height - buttons.height - communityPanel.height) * 0.48
|
||||
width: parent.width
|
||||
spacing: (parent.height - buttons.height - communityPanel.height) * 0.27
|
||||
height: 600
|
||||
spacing: (parent.height - buttons.height - communityPanel.height) * 0.1
|
||||
|
||||
Row {
|
||||
//if the buttons grid overlaps vertically with the wizard buttons,
|
||||
@ -106,7 +107,7 @@ Rectangle {
|
||||
id: communityPanel
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
width: Math.min(sourceSize.width, container.width)
|
||||
height: Math.min(300, container.height*0.5)
|
||||
height: Math.min(450, container.height*0.5)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -32,5 +32,7 @@
|
||||
<file>qml/images/bttn-vehwizard-off.png</file>
|
||||
<file>qml/images/wizard-off.png</file>
|
||||
<file>qml/images/wizard-on.png</file>
|
||||
<file>qml/ActivityPanel.qml</file>
|
||||
<file>qml/images/refresh.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
Loading…
x
Reference in New Issue
Block a user