• 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
PreferencesPage.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 QtMultimediaKit 1.1
12 import com.nokia.meego 1.0
13 import org.kde.edu.marble 0.11
14 
15 /*
16  * General preferences
17  */
18 Page {
19  id: preferencesPage
20 
21  tools: ToolBarLayout {
22  MarbleToolIcon {
23  iconSource: main.icon( "actions/go-home", 48 );
24  onClicked: main.showNavigation()
25  }
26  }
27 
28  Flickable {
29  id: pageFlickable
30  anchors.fill: parent
31  anchors.margins: 5
32 
33  contentHeight: pageGrid.height
34 
35  Grid {
36  id: pageGrid
37  width: parent.width - 20
38 
39  columns: main.inPortrait ? 1 : 2
40  rows: 10 / columns
41  spacing: main.inPortrait ? 10 : 5
42 
43  property int leftRowWidth: main.inPortrait ? width : 250
44  property int rightRowWidth: main.inPortrait ? width : width - leftRowWidth - spacing
45 
46  Label {
47  id: offlineLabel
48  width: pageGrid.leftRowWidth
49  text: "Connection"
50  }
51 
52  Item {
53  id: onlineSettings
54  width: pageGrid.rightRowWidth
55  height: onlineHelp.height + onlineSwitch.height
56 
57  Switch {
58  id: onlineSwitch
59  height: 40
60  checked: !settings.workOffline
61  onCheckedChanged: settings.workOffline = !checked
62  }
63 
64  Label {
65  id: onlineLabel
66  anchors.left: onlineSwitch.right
67  anchors.right: parent.right
68  anchors.leftMargin: 5
69  anchors.verticalCenter: onlineSwitch.verticalCenter
70  text: "Online"
71  }
72 
73  Label {
74  id: onlineHelp
75  anchors.top: onlineSwitch.bottom
76  anchors.topMargin: 5
77  anchors.left: onlineSwitch.left
78  anchors.right: parent.right
79 
80  property string activatedText: "Map data is downloaded as needed. Search and route calculation use online services."
81  property string deactivatedText: "Only data available offline is used to display maps, search and calculate routes."
82 
83  color: "gray"
84  text: onlineSwitch.checked ? activatedText : deactivatedText
85 
86  font.pixelSize: 16
87  verticalAlignment: Text.AlignVCenter
88  }
89  }
90 
91  Label {
92  width: pageGrid.leftRowWidth
93  text: "Screensaver"
94  }
95 
96  Item {
97  id: screensaverSettings
98  width: pageGrid.rightRowWidth
99  height: screensaverHelp.height + Math.max(screensaverSwitch.height, screensaverLabel.height)
100 
101  Switch {
102  id: screensaverSwitch
103  height: 40
104  checked: settings.inhibitScreensaver
105  onCheckedChanged: settings.inhibitScreensaver = checked
106  }
107 
108  Label {
109  id: screensaverLabel
110  anchors.left: screensaverSwitch.right
111  anchors.leftMargin: 5
112  anchors.right: parent.right
113  anchors.verticalCenter: screensaverSwitch.verticalCenter
114  text: "Navigation disables screensaver"
115  }
116 
117  Label {
118  id: screensaverHelp
119  anchors.top: screensaverSwitch.bottom
120  anchors.left: screensaverSwitch.left
121  anchors.right: parent.right
122  anchors.topMargin: 5
123 
124  property string activatedText: "The automatic start of the screensaver is inhibited in the Tracking activity. You can still enable it manually."
125  property string deactivatedText: "The screensaver is starting according to your device settings."
126 
127  color: "gray"
128  text: screensaverSwitch.checked ? activatedText : deactivatedText
129  font.pixelSize: 16
130  }
131  }
132 
133  Label {
134  width: pageGrid.leftRowWidth
135  text: "Voice Navigation"
136  }
137 
138  Item {
139  id: speakerSettings
140  width: pageGrid.rightRowWidth
141  height: speakersSwitch.height + speakersItem.height
142 
143  ButtonRow {
144  id: speakersSwitch
145  width: parent.width
146  checkedButton: settings.voiceNavigationMuted ? b1 : ( settings.voiceNavigationSoundEnabled ? b2 : b3 )
147 
148  Button {
149  id: b1
150  text: "Disabled"
151  onCheckedChanged: {
152  if (checked) {
153  settings.voiceNavigationMuted = true
154  speakerHelp.text = "Turn instructions are not announced by sound/voice."
155  }
156  }
157  }
158 
159  Button {
160  id: b2
161  text: "Sound"
162  onCheckedChanged: {
163  if (checked) {
164  settings.voiceNavigationMuted = false
165  settings.voiceNavigationSoundEnabled = true
166  speakerHelp.text = "A sound is played when approaching turn points during Navigation."
167  }
168  }
169  }
170 
171  Button {
172  id: b3
173  text: "Speaker"
174  onCheckedChanged: {
175  if (checked) {
176  settings.voiceNavigationMuted = false
177  settings.voiceNavigationSoundEnabled = false
178  speakerHelp.text = "Turn instructions are spoken when approaching them."
179  }
180  }
181  property SelectionDialog dialog
182  onClicked: {
183  if (dialog === null) {
184  dialog = speakerComponent.createObject(b3)
185  }
186  dialog.open()
187  }
188 
189  Component {
190  id: speakerComponent
191  SelectionDialog {
192  id: speakerDialog
193  titleText: "Voice Navigation Speaker"
194  selectedIndex: speakers.indexOf(settings.voiceNavigationSpeaker)
195 
196  model: SpeakersModel {
197  id: speakers
198  onCountChanged: speakerDialog.selectedIndex = speakers.indexOf(settings.voiceNavigationSpeaker)
199  onInstallationProgressed: {
200  progressBar.indeterminate = false
201  progressBar.value = progress
202  }
203  onInstallationFinished: {
204  progressBar.visible = false
205  settings.voiceNavigationSpeaker = speakers.path(speakersDialog.selectedIndex)
206  voiceNavigationPreviewButton.enabled = true
207  }
208  }
209 
210  onAccepted: {
211  if ( speakers.isLocal(selectedIndex) ) {
212  settings.voiceNavigationSpeaker = speakers.path(selectedIndex)
213  } else {
214  voiceNavigationPreviewButton.enabled = false
215  progressBar.visible = true
216  speakers.install(selectedIndex)
217  }
218  }
219  }
220  }
221  }
222  }
223 
224  Item {
225  id: speakersItem
226  anchors.right: parent.right
227  anchors.left: parent.left
228  anchors.top: speakersSwitch.bottom
229  anchors.topMargin: 5
230  height: Math.max(speakerHelp.height, voiceNavigationPreviewButton.height)
231 
232  Label {
233  id: speakerHelp
234  visible: !progressBar.visible
235  anchors.left: parent.left
236  anchors.right: voiceNavigationPreviewButton.left
237  color: "gray"
238  font.pixelSize: 16
239  }
240 
241  ProgressBar {
242  id: progressBar
243  visible: false
244  anchors.left: parent.left
245  anchors.right: voiceNavigationPreviewButton.left
246  minimumValue: 0.0
247  maximumValue: 1.0
248  indeterminate: true
249  }
250 
251  ToolButton {
252  id: voiceNavigationPreviewButton
253  anchors.right: parent.right
254  anchors.margins: 5
255  visible: !settings.voiceNavigationMuted
256  iconSource: main.icon( "actions/media-playback-start", 48 );
257  checkable: true
258  checked: false
259  width: 60
260 
261  VoiceNavigation {
262  id: voiceNavigationPreview
263  speaker: settings.voiceNavigationSpeaker
264  isSpeakerEnabled: !settings.voiceNavigationSoundEnabled
265  }
266 
267  Audio {
268  id: voiceNavigationPreviewPlayer
269  source: "file://" + voiceNavigationPreview.preview
270  playing: voiceNavigationPreviewButton.checked
271  onStatusChanged: {
272  if ( status == Audio.EndOfMedia ) {
273  voiceNavigationPreviewButton.checked = false
274  }
275  }
276  }
277  }
278  }
279  }
280 
281  Label {
282  width: pageGrid.leftRowWidth
283  text: "Street Map Theme"
284  }
285 
286  Item {
287  width: pageGrid.rightRowWidth
288  height: themeSelectionButton.height + mapThemeLabel.height
289 
290  Button {
291  id: themeSelectionButton
292  text: mapThemeModel.name(settings.streetMapTheme)
293  onClicked: themeDialog.open()
294 
295  MapThemeModel {
296  id: mapThemeModel
297  mapThemeFilter: MapThemeModel.Extraterrestrial | MapThemeModel.LowZoom
298  }
299 
300  SelectionDialog {
301  id: themeDialog
302  titleText: "Street Map Theme"
303  selectedIndex: mapThemeModel.indexOf(settings.streetMapTheme)
304 
305  model: mapThemeModel
306 
307  delegate:
308  Rectangle {
309  id: delegate
310  width: row.width
311  height: row.height
312 
313  color: index === themeDialog.selectedIndex ? "lightsteelblue" : "#00ffffff"
314 
315  Row {
316  id: row
317  Image {
318  id: mapImage
319  source: "image://maptheme/" + mapThemeId
320  smooth: true
321  width: 68
322  height: 68
323  }
324  Label {
325  id: themeLabel
326  text: display
327  color: index === themeDialog.selectedIndex ? "black" : "white"
328  anchors.verticalCenter: parent.verticalCenter
329  }
330  }
331 
332  MouseArea {
333  anchors.fill: parent
334  onClicked: {
335  themeDialog.selectedIndex = index
336  themeDialog.accept()
337  settings.streetMapTheme = mapThemeId
338  }
339  }
340  }
341  }
342  }
343 
344  Label {
345  id: mapThemeLabel
346  anchors.top: themeSelectionButton.bottom
347  width: pageGrid.rightRowWidth
348  color: "gray"
349  text: "Select the map to use in the Search, Routing, Navigation, Tracking and Friends activities."
350  font.pixelSize: 16
351  }
352  }
353 
354  Label {
355  width: pageGrid.leftRowWidth
356  text: "Data Management"
357  }
358 
359  Item {
360  width: pageGrid.rightRowWidth
361  height: manageThemeButton.height
362 
363  Button {
364  id: manageThemeButton
365  width: pageGrid.rightRowWidth / 2 - 5
366  text: "Map Themes"
367  onClicked: pageStack.push(themePage)
368  Component {
369  id: themePage
370  MapThemePage { }
371  }
372  }
373 
374  Button {
375  id: manageOfflineDataButton
376  anchors.left: manageThemeButton.right
377  anchors.leftMargin: 5
378  anchors.right: parent.right
379  text: "Offline Data"
380  onClicked: pageStack.push(offlineDataPage)
381  Component {
382  id: offlineDataPage
383  OfflineDataPage { }
384  }
385  }
386 
387  Button {
388  id: manageCloudSyncButton
389  anchors.top: manageThemeButton.bottom
390  anchors.topMargin: 5
391  anchors.left: parent.left;
392  anchors.right: parent.right;
393  text: "Manage Cloud Sync"
394  onClicked: pageStack.push(cloudSyncPage)
395  Component {
396  id: cloudSyncPage
397  CloudSyncPage { }
398  }
399  }
400  }
401  }
402  }
403 
404  ScrollDecorator {
405  flickableItem: pageFlickable
406  }
407 }
Button
Definition: cloud-sync/Button.qml:11
ToolButton
CloudSyncPage
Definition: CloudSyncPage.qml:12
Switch
Rectangle
OfflineDataPage
Definition: OfflineDataPage.qml:12
MapThemeModel::Extraterrestrial
Definition: MapThemeModel.h:28
MapThemePage
Definition: MapThemePage.qml:12
Item
MarbleWindow::inPortrait
bool inPortrait
Definition: harmattan/MarbleWindow.qml:17
MarbleWindow::icon
void icon(name, size)
MapThemeModel
Definition: MapThemeModel.h:18
MarbleToolIcon
Definition: harmattan/MarbleToolIcon.qml:10
MarbleWindow::showNavigation
void showNavigation()
main
Definition: main.qml:12
MapThemeModel::LowZoom
Definition: MapThemeModel.h:29
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:38:52 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