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

kanagram

  • sources
  • kde-4.12
  • kdeedu
  • kanagram
  • src
  • plasma-active
  • package
  • contents
  • ui
plasma-active/package/contents/ui/MainSettingsPage.qml
Go to the documentation of this file.
1 /******************************************************************************
2  * This file is part of the Kanagram project
3  * Copyright (C) 2012 Laszlo Papp <lpapp@kde.org>
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18  */
19 
20 import QtQuick 1.1
21 
22 import org.kde.plasma.components 0.1
23 
24 Page {
25 
26  property int settingsPageMargins: 15;
27 
28  Dialog {
29  id: anagramResolveTimeUserGuideDialog;
30  content: i18n("<b>Anagram resolve time</b>: Maximum allowed time for resolving the anagram");
31  }
32 
33  Dialog {
34  id: hintShowDurationUserGuideDialog;
35  content: i18n("<b>Hint show duration:</b> The duration for showing the hint for the current anagram");
36  }
37 
38  Dialog {
39  id: soundsUserGuideDialog;
40  content: i18n("<b>Sounds:</b> Turn all the sounds on or off inside the game");
41  }
42 
43  function pushPage(file) {
44  var component = Qt.createComponent(file)
45  if (component.status == Component.Ready)
46  pageStack.push(component);
47  else
48  console.log("Error loading component:", component.errorString());
49  }
50 
51  SelectionDialog {
52  id: languageSelectionDialog;
53  titleText: i18n("Select a language");
54  selectedIndex: kanagramGame.dataLanguageSelectedIndex();
55 
56  model: kanagramGame.languageNames();
57 
58  onSelectedIndexChanged: {
59  kanagramGame.dataLanguage = model[selectedIndex];
60  rootWindow.languageSelectionChanged = true;
61  }
62  }
63 
64  Connections {
65  target: kanagramEngineHelper;
66 
67  onHintHideTimeChanged: {
68  hintAppearanceSlider.value = kanagramEngineHelper.hintHideTime;
69  }
70 
71  onResolveTimeChanged: {
72  resolveTimeSlider.value = kanagramEngineHelper.resolveTime;
73  }
74 
75  onUseSoundsChanged: {
76  soundsSwitch.checked = kanagramEngineHelper.useSounds;
77  }
78  }
79 
80  Component.onCompleted: {
81  hintAppearanceSlider.value = kanagramEngineHelper.hintHideTime;
82  resolveTimeSlider.value = kanagramEngineHelper.resolveTime;
83  soundsSwitch.checked = kanagramEngineHelper.useSounds;
84  }
85 
86 
87  Rectangle {
88  id: settingsPageMainRectangle;
89  color: "black";
90  anchors.fill: parent;
91 
92  Flickable {
93  anchors {
94  fill: parent;
95  margins: settingsPageMargins;
96  }
97 
98  contentWidth: settingsPageMainColumn.width;
99  contentHeight: settingsPageMainColumn.height;
100 
101  Column {
102  id: settingsPageMainColumn;
103  width: settingsPageMainRectangle.width - 2*settingsPageMargins;
104 
105  spacing: 10;
106 
107  Label {
108  width: parent.width;
109  text: i18n("Kanagram Settings");
110  font.pixelSize: 32;
111  }
112 
113  Image {
114  id: separator1;
115  width: parent.width;
116  height: 2;
117  fillMode: Image.TileHorizontally;
118  source: "separator.png";
119  }
120 
121  Column {
122  width: parent.width;
123  spacing: 5;
124 
125  Item {
126  height: childrenRect.height;
127  width: parent.width;
128 
129  Label {
130  id: hintAppearanceLabel;
131 
132  anchors {
133  left: parent.left;
134  verticalCenter: parent.verticalCenter;
135  }
136 
137  text: i18n("Hint show duration in seconds");
138  font.bold: true;
139  }
140 
141  ToolIcon {
142  iconSource: "image://theme/icon-l-user-guide-main-view"
143 
144  anchors {
145  right: parent.right;
146  verticalCenter: parent.verticalCenter;
147  }
148 
149  onClicked: {
150  hintShowDurationUserGuideDialog.open();
151  }
152  }
153  }
154 
155  Slider {
156  id: hintAppearanceSlider;
157  width: parent.width - 10;
158  stepSize: 1;
159  valueIndicatorVisible: true;
160  minimumValue: 0;
161  maximumValue: 10;
162  anchors.horizontalCenter: parent.horizontalCenter;
163 
164  onValueChanged: {
165  kanagramEngineHelper.hintHideTime = value;
166  }
167  }
168  }
169 
170  Image {
171  id: separator2;
172  width: parent.width;
173  height: 2;
174  fillMode: Image.TileHorizontally;
175  source: "separator.png";
176  }
177 
178  Column {
179  width: parent.width;
180  spacing: 5;
181 
182  Item {
183  height: childrenRect.height;
184  width: parent.width;
185 
186  Label {
187  id: resolveTimeLabel;
188 
189  anchors {
190  left: parent.left;
191  verticalCenter: parent.verticalCenter;
192  }
193 
194  text: i18n("Anagram resolve time in seconds");
195  font.bold: true;
196  }
197 
198  ToolIcon {
199  iconSource: "image://theme/icon-l-user-guide-main-view"
200 
201  anchors {
202  right: parent.right;
203  verticalCenter: parent.verticalCenter;
204  }
205 
206  onClicked: {
207  anagramResolveTimeUserGuideDialog.open();
208  }
209  }
210  }
211 
212  Slider {
213  id: resolveTimeSlider;
214  width: parent.width - 10;
215  stepSize: 15;
216  valueIndicatorVisible: true;
217  minimumValue: 0;
218  maximumValue: 300;
219  anchors.horizontalCenter: parent.horizontalCenter;
220 
221  onValueChanged: {
222  kanagramEngineHelper.resolveTime = value;
223  }
224  }
225  }
226 
227  Image {
228  id: separator3;
229  width: parent.width;
230  height: 2;
231  fillMode: Image.TileHorizontally;
232  source: "separator.png";
233  }
234 
235  Item {
236  height: childrenRect.height;
237  width: parent.width;
238 
239  Label {
240  anchors {
241  left: parent.left;
242  verticalCenter: parent.verticalCenter;
243  }
244 
245  text: i18n("Sounds");
246  font.bold: true;
247  }
248 
249  ToolIcon {
250  iconSource: "image://theme/icon-l-user-guide-main-view"
251 
252  anchors {
253  right: soundsSwitch.left;
254  verticalCenter: parent.verticalCenter;
255  }
256 
257  onClicked: {
258  soundsUserGuideDialog.open();
259  }
260  }
261 
262  Switch {
263  id: soundsSwitch;
264  anchors {
265  right: parent.right;
266  verticalCenter: parent.verticalCenter;
267  }
268 
269  onCheckedChanged: {
270  kanagramEngineHelper.useSounds = checked;
271  }
272  }
273  }
274 
275  Image {
276  id: separator4;
277  width: parent.width;
278  height: 2;
279  fillMode: Image.TileHorizontally;
280  source: "separator.png";
281  }
282 
283  ListItem {
284  iconSource: "preferences-desktop-locale.png";
285  titleText: i18n("Language");
286  subtitleText: kanagramGame.dataLanguage ? kanagramGame.dataLanguage : "English";
287  iconId: "textinput-combobox-arrow";
288  iconVisible: true;
289  mousePressed: languageSelectionMouseArea.pressed;
290 
291  MouseArea {
292  id: languageSelectionMouseArea;
293  anchors.fill: parent;
294  onClicked: {
295  languageSelectionDialog.open();
296  }
297  }
298  }
299  }
300  }
301  }
302 
303  tools: commonTools;
304 }
Dialog
ListItem
Definition: ListItem.qml:22
Rectangle
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:35:35 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kanagram

Skip menu "kanagram"
  • Main Page
  • Namespace List
  • 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