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

Merge pull request #31 from skarlsso/skarlsso/LP-26_update_welcome_page_plugin

skarlsso/LP-26_update_welcome_page_plugin
This commit is contained in:
a*morale 2015-07-19 14:08:31 +02:00
commit 1d0ac6667f
3 changed files with 29 additions and 38 deletions

View File

@ -54,24 +54,19 @@ Item {
XmlListModel {
id: xmlModel
source: "http://progress.openpilot.org/activity?maxResults=30&streams=key+IS+OP"
source: "https://github.com/librepilot/LibrePilot/commits/next.atom"
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';"
declare namespace media='http://search.yahoo.com/mrss/';"
XmlRole { name: "author"; query: "author/name/string()" }
XmlRole { name: "authorEmail"; query: "author/email/string()" }
XmlRole { name: "authorLink"; query: "author/uri/string()" }
XmlRole { name: "authorPhoto"; query: "author/link[@rel = 'photo' and @media:height='16']/@href/string()" }
XmlRole { name: "authorPhoto"; query: "media:thumbnail/@url/string()" }
XmlRole { name: "action"; query: "category/@term/string()" }
XmlRole { name: "action"; query: "substring-before(substring-after(id/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()" }
XmlRole { name: "actionTitle"; query: "title/string()" }
}
Component {
@ -101,7 +96,15 @@ Item {
}
Text {
id: name
text: author
text: {
if (author != "") {
author
} else if (authorEmail != "") {
authorEmail
} else {
"Unknown Author"
}
}
width: container.width - photo.width - icon.width - 24
color: mouseArea2.containsMouse ? "#224d81" : "black"
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
@ -124,7 +127,8 @@ Item {
id: icon
width: 16
height: 16
source: applicationIcon
// No image for GitHub commits.
// source: applicationIcon
}
}
Row {
@ -150,6 +154,7 @@ Item {
case "closed": prefix = qsTr("Closed "); break;
case "abandon": prefix = qsTr("Abandoned "); break;
case "commit": prefix = qsTr("Committed "); break;
case "Commit": prefix = qsTr("Committed "); break;
case "resolved": prefix = qsTr("Resolved "); break;
case "start": prefix = qsTr("Started "); break;
case "started": prefix = qsTr("Started working on "); break;
@ -160,20 +165,7 @@ Item {
default: prefix = action.substr(0, 1).toUpperCase() + action.substr(1) + " " ; break;
}
prefix = "<font color='#224d81'>" + prefix + "</font>"
if(action == "commented" || action == "comment" || (action == "" && actionSummary == "")) {
if(actionTargetTitle != actionTargetSummary) {
prefix + actionTargetTitle + ": " + actionTargetSummary
} else {
prefix + actionTargetTitle
}
}
else {
if(actionSummary == "") {
prefix + actionTitle
} else {
prefix + actionTitle + ": " + actionSummary
}
}
prefix + actionTitle
}
color: mouseArea3.containsMouse ? "#224d81" : "black"
MouseArea {

View File

@ -35,12 +35,13 @@ Item {
XmlListModel {
id: xmlModel
source: "http://www.openpilot.org/feed/"
query: "/rss/channel/item"
source: "http://forum.librepilot.org/index.php?board=11.0&amp;action=.xml&amp;type=atom&amp;sa=news"
query: "/feed/entry"
namespaceDeclarations: "declare default element namespace 'http://www.w3.org/2005/Atom';"
XmlRole { name: "title"; query: "title/string()" }
XmlRole { name: "description"; query: "description/string()" }
XmlRole { name: "link"; query: "link/string()" }
XmlRole { name: "description"; query: "summary/string()" }
XmlRole { name: "link"; query: "link/@href/string()" }
}
Component {
@ -64,7 +65,7 @@ Item {
Text {
text: description
width: view.width - 4
textFormat: text.indexOf("&") > 0 ? Text.StyledText : Text.PlainText
textFormat: Text.RichText
maximumLineCount: 3
wrapMode: Text.WordWrap
elide: Text.ElideRight

View File

@ -10,7 +10,7 @@ Item {
Text {
id: header
text: qsTr("OpenPilot Websites")
text: qsTr("Websites")
width: parent.width
color: "#44515c"
font {
@ -23,19 +23,17 @@ Item {
id: sitesModel
ListElement { link: "http://www.librepilot.org" }
ListElement { link: "http://wiki.openpilot.org" }
ListElement { link: "http://www.openpilot.org/hardware/get-hardware/" }
ListElement { link: "http://forum.librepilot.org" }
ListElement { link: "http://github.com/librepilot" }
ListElement { link: "http://github.com/librepilot/LibrePilot/pulls" }
ListElement { link: "http://github.com/librepilot/LibrePilot/issues" }
function title(index){
if (title["text"] === undefined) {
title.text = [
qsTr("Home"),
qsTr("Wiki"),
qsTr("Store"),
qsTr("Forums"),
qsTr("Code Reviews"),
qsTr("Progress Tracker")
qsTr("Pull Requests"),
qsTr("Progress")
]
}
return title.text[index]