1 |
import Qt 4.7
|
2 |
import "pagenavigation.js" as Navit
|
3 |
|
4 |
Rectangle {
|
5 |
id: page
|
6 |
|
7 |
width: gui.width; height: gui.height
|
8 |
color: "Black"
|
9 |
opacity: 0
|
10 |
|
11 |
Timer {
|
12 |
id: backTimer
|
13 |
interval: 2000;
|
14 |
onTriggered: Navit.back();
|
15 |
}
|
16 |
|
17 |
function add(description) {
|
18 |
resultTxt.text=bookmarks.AddBookmark(description);
|
19 |
btnOk.opacity=0;
|
20 |
btnCancel.opacity=0;
|
21 |
resultTxt.opacity=1;
|
22 |
backTimer.start()
|
23 |
}
|
24 |
|
25 |
function pageOpen() {
|
26 |
page.opacity = 1;
|
27 |
}
|
28 |
|
29 |
Component.onCompleted: pageOpen();
|
30 |
|
31 |
Behavior on opacity {
|
32 |
NumberAnimation { id: opacityAnimation; duration: 300; alwaysRunToEnd: true }
|
33 |
}
|
34 |
|
35 |
Text {
|
36 |
id: infoTxt;
|
37 |
text: point.coordString; color: "White"; font.pointSize: gui.height/20;
|
38 |
anchors.top:parent.top;anchors.horizontalCenter:parent.horizontalCenter
|
39 |
}
|
40 |
Text {
|
41 |
id: nameTxt;
|
42 |
text: point.pointName; color: "White"; font.pointSize: gui.height/20;
|
43 |
anchors.top:infoTxt.bottom;anchors.topMargin: 5;anchors.horizontalCenter:parent.horizontalCenter
|
44 |
}
|
45 |
|
46 |
TextInput{
|
47 |
id: searchTxt; text: "Enter bookmark name..."
|
48 |
anchors.top: nameTxt.bottom;anchors.topMargin: 5;anchors.horizontalCenter:parent.horizontalCenter
|
49 |
width: page.width; font.pointSize: 14; color: "White";focus: true; readOnly: false
|
50 |
}
|
51 |
|
52 |
|
53 |
ButtonIcon {
|
54 |
id: btnOk; text: "Add"; icon: "gui_active.svg"; onClicked: add(searchTxt.text)
|
55 |
anchors.top: searchTxt.bottom;anchors.topMargin: 5;anchors.right:parent.horizontalCenter;anchors.rightMargin:10
|
56 |
}
|
57 |
ButtonIcon {
|
58 |
id: btnCancel; text: "Cancel"; icon: "gui_inactive.svg"; onClicked: gui.backToPrevPage();
|
59 |
anchors.top: searchTxt.bottom;anchors.topMargin: 5;anchors.left:parent.horizontalCenter;anchors.leftMargin:10
|
60 |
}
|
61 |
|
62 |
Text {
|
63 |
id: resultTxt;
|
64 |
text: point.pointName; color: "White"; font.pointSize: gui.height/20;
|
65 |
anchors.top:btnCancel.bottom;anchors.topMargin: 5;anchors.horizontalCenter:parent.horizontalCenter
|
66 |
opacity: 0
|
67 |
}
|
68 |
|
69 |
Cellar {id: cellar; anchors.bottom: page.bottom; anchors.horizontalCenter: page.horizontalCenter; width: page.width }
|
70 |
}
|