Permalink
Browse files

Updated to latest version of Ubuntu components. Removed toolbar as pa…

…rt of this.

Added new About Popover.
  • Loading branch information...
Aaron Hastings
Aaron Hastings committed Dec 21, 2014
1 parent 4ee8666 commit 0af12fd1cd7aef8c32d646d6af706b6432890387
Showing with 89 additions and 60 deletions.
  1. +5 −2 DublinWheels.qml
  2. +1 −1 DublinWheels.qmlproject
  3. +51 −0 ui/AboutPopover.qml
  4. +2 −2 ui/BikeStationPopover.qml
  5. +30 −14 ui/MainPage.qml
  6. +0 −41 ui/Toolbar.qml
@@ -4,13 +4,16 @@ import U1db 1.0 as U1db
import "ui"

MainView {
objectName: "mainView"
id: mainView

applicationName: "org.thecosmicfrog.dublinwheels"
property string version: "0.12"

useDeprecatedToolbar: false

//automaticOrientation: true

width: units.gu(44)
width: units.gu(45)
height: units.gu(78)

function getLastStationIndex(lastStation, stationsModel) {
@@ -1,7 +1,7 @@
import QmlProject 1.1

Project {
mainFile: "main.qml"
mainFile: "DublinWheels.qml"

/* Include .qml, .js, and image files from current directory and subdirectories */
QmlFiles {
@@ -0,0 +1,51 @@
import QtQuick 2.0
import Ubuntu.Components 1.1
import Ubuntu.Components.ListItems 1.0 as ListItem
import Ubuntu.Components.Popups 1.0

Component {
id: popoverComponent

Popover {
id: aboutPopover

Column {
id: aboutColumn

anchors {
left: parent.left
right: parent.right
}

ListItem.Header {
text: "DublinWheels\tv" + version
}

ListItem.Standard {
text: "Written by Aaron Hastings (thecosmicfrog)"

onClicked: Qt.openUrlExternally("https://github.com/thecosmicfrog")
}

ListItem.Standard {
text: "License: GNU GPLv3"
}

ListItem.Standard {
text: "Source code, bugs and feature requests:<br>
<a href=\"https://github.com/thecosmicfrog/DublinWheels\">github.com/thecosmicfrog/DublinWheels</a>"

onClicked: Qt.openUrlExternally("https://github.com/thecosmicfrog/DublinWheels")
}

ListItem.SingleControl {
highlightWhenPressed: false

control: Button {
text: "Close"
onClicked: PopupUtils.close(aboutPopover)
}
}
}
}
}
@@ -1,7 +1,7 @@
import QtQuick 2.0
import Ubuntu.Components 1.1
import Ubuntu.Components.ListItems 0.1 as ListItem
import Ubuntu.Components.Popups 0.1
import Ubuntu.Components.ListItems 1.0 as ListItem
import Ubuntu.Components.Popups 1.0

Component {
id: popoverComponent
@@ -1,11 +1,13 @@
import QtQuick 2.0
import Ubuntu.Components 1.1
import Ubuntu.Components.Popups 0.1
import Ubuntu.Components.Popups 1.0
import QtLocation 5.0
import QtPositioning 5.2
import QtQuick.XmlListModel 2.0

Page {
id: mainPage

title: i18n.tr("DublinWheels")

// Always begin by loading the selected stop.
@@ -45,6 +47,32 @@ Page {
}
}

head.actions: [
Action {
id: reloadAction

iconName: "reload"
text: "Reload"

onTriggered: {
activityIndicator.running = true
queryBikesWorker.sendMessage({'station': stationsModel.get(stationSelector.selectedIndex).name})
}
},
Action {
id: aboutAction

iconName: "info"
text: "About"

onTriggered: PopupUtils.open(aboutPopover)
}
]

AboutPopover {
id: aboutPopover
}

Item {
id: selectStationRow

@@ -222,6 +250,7 @@ Page {
id: poiImage
width: units.gu(3)
height: units.gu(3)

source: "../img/place_icon.svg"

MouseArea {
@@ -241,17 +270,4 @@ Page {
}
}
}

tools: Toolbar {
ToolbarButton {
id: reloadButton

text: "Reload"
iconSource: "../img/reload.png"
onTriggered: {
activityIndicator.running = true
queryBikesWorker.sendMessage({'station': stationsModel.get(stationSelector.selectedIndex).name})
}
}
}
}

This file was deleted.

Oops, something went wrong.

0 comments on commit 0af12fd

Please sign in to comment.