• 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
  • src
  • apps
  • marble-touch
  • activities
VirtualGlobe.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 2011 Dennis Nienhüser <earthwings@gentoo.org>
8 // Copyright 2011 Daniel Marth <danielmarth@gmx.at>
9 
10 import QtQuick 1.0
11 import com.nokia.meego 1.0
12 import org.kde.edu.marble 0.11
13 import ".."
14 
15 /*
16  * Page for the virtual globe activity.
17  */
18 Page {
19  id: virtualGlobeActivityPage
20  anchors.fill: parent
21 
22  tools: ToolBarLayout {
23  MarbleToolIcon {
24  iconSource: main.icon( "actions/go-home", 48 );
25  onClicked: main.navigationMenu.open()
26  }
27  ToolButton {
28  id: searchButton
29  checkable: true
30  width: 60
31  flat: true
32  iconSource: main.icon( "actions/edit-find", 48 );
33  }
34  ToolButton {
35  id: themeButton
36  width: 60
37  iconSource: main.icon( "actions/configure", 48 );
38  flat: true
39  onClicked: themeDialog.open()
40 
41  MapThemeModel {
42  id: mapThemeModel
43  mapThemeFilter: MapThemeModel.Extraterrestrial
44  }
45 
46  SelectionDialog {
47  id: themeDialog
48  titleText: "Select Map Theme"
49  selectedIndex: mapThemeModel.indexOf(settings.mapTheme)
50  model: mapThemeModel
51  delegate:
52  Rectangle {
53  id: delegate
54  width: row.width
55  height: row.height
56 
57  color: index === themeDialog.selectedIndex ? "lightsteelblue" : "#00ffffff"
58 
59  Row {
60  id: row
61  Image {
62  id: mapImage
63  source: "image://maptheme/" + mapThemeId
64  smooth: true
65  width: 68
66  height: 68
67  }
68  Label {
69  id: themeLabel
70  text: display
71  color: index === themeDialog.selectedIndex ? "black" : "white"
72  anchors.verticalCenter: parent.verticalCenter
73  }
74  }
75 
76  MouseArea {
77  anchors.fill: parent
78  onClicked: {
79  themeDialog.selectedIndex = index
80  themeDialog.accept()
81  delayedMapThemeSwitch.theme = mapThemeId
82  delayedMapThemeSwitch.start()
83  }
84  }
85  }
86  }
87  }
88  }
89 
90  SearchField {
91  id: searchField
92  anchors.left: parent.left
93  anchors.right: parent.right
94  anchors.top: parent.top
95  visible: searchButton.checked
96  onSearch: {
97  searchField.busy = true
98  marbleWidget.find( term )
99  }
100 
101  Component.onCompleted: {
102  marbleWidget.search.searchFinished.connect( searchFinished )
103  }
104 
105  function searchFinished() {
106  searchField.busy = false
107  }
108  }
109 
110  Item {
111  id: mapContainer
112  anchors.left: parent.left
113  anchors.right: parent.right
114  anchors.top: searchButton.checked ? searchField.bottom : parent.top
115  anchors.bottom: parent.bottom
116 
117  function embedMarbleWidget() {
118  marbleWidget.parent = mapContainer
119  settings.projection = "Spherical"
120  settings.activeRenderPlugins = settings.defaultRenderPlugins
121  settings.mapTheme = "earth/srtm/srtm.dgml"
122  settings.gpsTracking = false
123  settings.showPositionIndicator = false
124  marbleWidget.tracking.positionMarkerType = Tracking.Circle
125  settings.showTrack = false
126  marbleWidget.visible = true
127  }
128 
129  Component.onDestruction: {
130  if ( marbleWidget.parent === mapContainer ) {
131  marbleWidget.parent = null
132  marbleWidget.visible = false
133  }
134  }
135  }
136 
137  Timer {
138  id: delayedMapThemeSwitch
139  property string theme: "earth/srtm/srtm.dgml"
140  interval: 10; running: false; repeat: false
141  onTriggered: settings.mapTheme = theme
142  }
143 
144  onStatusChanged: {
145  if ( status === PageStatus.Activating ) {
146  mapContainer.embedMarbleWidget()
147  }
148  }
149 }
Tracking
Definition: Tracking.qml:16
MarbleWindow::navigationMenu
alias navigationMenu
Definition: harmattan/MarbleWindow.qml:21
ToolButton
SearchField
Definition: SearchField.qml:14
Rectangle
MapThemeModel::Extraterrestrial
Definition: MapThemeModel.h:28
Tracking::Circle
Definition: Tracking.h:48
Item
MarbleWindow::icon
void icon(name, size)
MapThemeModel
Definition: MapThemeModel.h:18
MarbleToolIcon
Definition: harmattan/MarbleToolIcon.qml:10
main
Definition: main.qml:12
SearchField::busy
bool busy
Definition: SearchField.qml:19
Page
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:38:53 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