summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorakashihi <akashihi@ffa7fe5e-494d-0410-b361-a75ebd5db220>2010-04-02 07:14:56 +0000
committerakashihi <akashihi@ffa7fe5e-494d-0410-b361-a75ebd5db220>2010-04-02 07:14:56 +0000
commitcd85e0fb0ed2b86f1d636f83636358204cec4731 (patch)
treed2146eddb769c5d7b5b0840c1ae23f365fd3f75e
parent454ba43b8b5fb9c9be41c869974f4b357738c2d2 (diff)
downloadnavit-svn-cd85e0fb0ed2b86f1d636f83636358204cec4731.tar.gz
Add:gui/qml:point type is now exposed to qml engine as a property
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit/navit@3111 ffa7fe5e-494d-0410-b361-a75ebd5db220
-rw-r--r--gui/qml/ngqpoint.h15
-rw-r--r--gui/qml/skins/navit/point.qml4
2 files changed, 13 insertions, 6 deletions
diff --git a/gui/qml/ngqpoint.h b/gui/qml/ngqpoint.h
index f4e83feb..909844eb 100644
--- a/gui/qml/ngqpoint.h
+++ b/gui/qml/ngqpoint.h
@@ -8,7 +8,7 @@ class NGQPoint : public QObject {
Q_PROPERTY(QString coordString READ coordString CONSTANT);
Q_PROPERTY(QString pointName READ pointName CONSTANT);
- Q_PROPERTY(QString py READ py CONSTANT);
+ Q_PROPERTY(QString pointType READ pointType CONSTANT);
public:
NGQPoint(struct gui_priv* this_,struct point* p,NGQPointTypes type=MapPoint,QObject *parent=NULL) : QObject(parent) {
this->object=this_;
@@ -60,12 +60,15 @@ public slots:
QString coordString() {
return this->coord;
}
- QString px() {
- char buffer[1024];
- coord_format(this->g.lat,this->g.lng,DEGREES_MINUTES_SECONDS,buffer,sizeof(buffer));
- return QString(buffer);
+ QString pointType() {
+ switch(this->type) {
+ case MapPoint:
+ return QString("MapPoint");
+ case Bookmark:
+ return QString("Bookmark");
+ }
+ return QString("");
}
- QString py() { return QString().setNum(p.y); }
protected:
QString _coordString() {
char latc='N',lngc='E';
diff --git a/gui/qml/skins/navit/point.qml b/gui/qml/skins/navit/point.qml
index f2c23d88..d1839429 100644
--- a/gui/qml/skins/navit/point.qml
+++ b/gui/qml/skins/navit/point.qml
@@ -8,6 +8,9 @@ Rectangle {
opacity: 0
function pageOpen() {
+ if (point.pointType!="Bookmark") {
+ btnBookmark.opacity=1;
+ }
page.opacity = 1;
}
@@ -54,6 +57,7 @@ Rectangle {
}
ButtonIcon {
id: btnBookmark; text: "Add as\na Bookmark"; icon: "gui_bookmark.svg"; onClicked: gui.setPage("PageBookmarksAdd.qml")
+ opacity: 0;
}
ButtonIcon {
id: btnInfo; text: "Point\ninformation"; icon: "gui_menu.svg"; onClicked: console.log("Implement me!");