• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeedu API Reference
  • KDE Home
  • Contact Us
 

marble

  • sources
  • kde-4.12
  • kdeedu
  • marble
  • examples
  • qml
  • cloud-sync
cloudsync.qml
Go to the documentation of this file.
1 // This file is part of the Marble Virtual Globe.
2 //
3 // This program is free software licensed under the GNU LGPL. You can
4 // find a copy of this license in LICENSE.txt in the top directory of
5 // the source code.
6 //
7 // Copyright 2013 Dennis Nienhüser <earthwings@gentoo.org>
8 
9 import QtQuick 1.0
10 import org.kde.edu.marble 0.11
11 
12 Rectangle {
13  id: screen
14  width: 1024; height: 768
15 
16  MarbleWidget {
17  id: map
18  anchors.top: parent.top
19  anchors.right: parent.right
20  anchors.bottom: parent.bottom
21  anchors.left: routeView.right
22 
23  mapThemeId: "earth/openstreetmap/openstreetmap.dgml"
24  activeFloatItems: [ "compass", "scalebar", "progress" ]
25  }
26 
27  CloudSync {
28  id: cloudSync
29  map: map
30  }
31 
32  Column {
33  id: credentialsColumn
34  anchors.top: parent.top
35  anchors.left: parent.left
36  anchors.margins: 10
37  width: routeView.width
38  spacing: 10
39 
40  InputField {
41  label: "Server:"
42  text: "myowncloudserver.com"
43  onAccepted: cloudSync.owncloudServer = text
44  }
45 
46  InputField {
47  label: "User:"
48  text: "myuser"
49  onAccepted: cloudSync.owncloudUsername = text
50  }
51 
52  InputField {
53  label: "Password:"
54  text: "mypassword"
55  onAccepted: cloudSync.owncloudPassword = text
56  echoMode: TextInput.Password
57  }
58  }
59 
60  ListView {
61  id: routeView
62  anchors.top: credentialsColumn.bottom
63  anchors.topMargin: 5
64  anchors.left: parent.left
65  anchors.bottom: parent.bottom
66  width: 400
67  clip: true
68 
69  model: cloudSync.routeModel
70  delegate: routeViewDelegate
71  spacing: 5
72  }
73 
74  Component {
75  id: routeViewDelegate
76 
77  Rectangle {
78  width: routeView.width
79  height: Math.max( previewImage.height, nameText.height+buttonRow.height )
80 
81  Image {
82  id: previewImage
83  source: previewUrl
84  width: 128; height: 128
85  anchors.left: parent.left
86  }
87 
88  Text {
89  id: nameText
90  text: name
91  anchors.left: previewImage.right
92  anchors.leftMargin: 5
93  anchors.right: parent.right
94  wrapMode: Text.WrapAtWordBoundaryOrAnywhere
95  }
96 
97  Row {
98  id: buttonRow
99  anchors.top: nameText.bottom
100  anchors.left: nameText.left
101  anchors.leftMargin: 5
102  spacing: 5
103 
104  Button {
105  id: downloadArea
106  visible: !isCached && isOnCloud
107 
108  label: "Download"
109  color: "green"
110 
111  onClicked: {
112  cloudSync.downloadRoute( identifier )
113  }
114  }
115 
116  Button {
117  id: deleteFromCloudArea
118  visible: !isCached
119 
120  label: "Delete from cloud"
121  color: "red"
122 
123  onClicked: {
124  cloudSync.deleteRouteFromCloud( identifier )
125  }
126  }
127 
128  Button {
129  id: openArea
130  visible: isCached
131 
132  label: "Open"
133  color: "blue"
134 
135  onClicked: {
136  cloudSync.openRoute( identifier )
137  }
138  }
139 
140  Button {
141  id: removeFromCacheArea
142  visible: isCached
143 
144  label: "Remove from device"
145  color: "yellow"
146 
147  onClicked: {
148  cloudSync.removeRouteFromDevice( identifier )
149  }
150  }
151 
152  Button {
153  id: uploadArea
154  visible: isCached && !isOnCloud
155 
156  label: "Upload"
157  color: "grey"
158 
159  onClicked: {
160  cloudSync.uploadRoute( identifier )
161  }
162  }
163  }
164  }
165  }
166 }
Button
Definition: cloud-sync/Button.qml:11
Rectangle
InputField
Definition: InputField.qml:11
CloudSync
Definition: CloudSync.h:22
MarbleWidget
Wraps a Marble::MarbleWidget, providing access to important properties and methods.
Definition: MarbleDeclarativeWidget.h:50
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:38:49 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

marble

Skip menu "marble"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • kstars
  • libkdeedu
  •   keduvocdocument
  • marble
  • parley
  • rocs
  •   App
  •   RocsCore
  •   VisualEditor
  •   stepcore

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal