diff options
author | akashihi <akashihi@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2010-03-24 17:57:42 +0000 |
---|---|---|
committer | akashihi <akashihi@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2010-03-24 17:57:42 +0000 |
commit | 48543f11251e811ac1b5265b5c240fb12225ec42 (patch) | |
tree | 5b3ac3731c49a8ccd12706511ab025c7676d2e97 | |
parent | 05417caf60fc67102efa318e580db980af61d1ce (diff) | |
download | navit-svn-48543f11251e811ac1b5265b5c240fb12225ec42.tar.gz |
Add:gui/qml:Added bookmarks deletion
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit/navit@3084 ffa7fe5e-494d-0410-b361-a75ebd5db220
-rw-r--r-- | gui/qml/gui_qml.cpp | 9 | ||||
-rw-r--r-- | gui/qml/skins/navit/PageBookmarks.qml | 24 |
2 files changed, 26 insertions, 7 deletions
diff --git a/gui/qml/gui_qml.cpp b/gui/qml/gui_qml.cpp index 3af550e2..7e037293 100644 --- a/gui/qml/gui_qml.cpp +++ b/gui/qml/gui_qml.cpp @@ -480,6 +480,15 @@ public slots: return "Success"; } } + QString Delete(QString bookmark) { + struct attr attr; + navit_get_attr(this->object->nav, attr_bookmarks, &attr, NULL); + if (!bookmarks_del_bookmark(attr.u.bookmarks, bookmark.toLocal8Bit().constData()) ) { + return "Failed!"; + } else { + return "Success"; + } + } void setPoint(QString bookmark) { struct attr attr; struct item* item; diff --git a/gui/qml/skins/navit/PageBookmarks.qml b/gui/qml/skins/navit/PageBookmarks.qml index 0b73138c..7b52d783 100644 --- a/gui/qml/skins/navit/PageBookmarks.qml +++ b/gui/qml/skins/navit/PageBookmarks.qml @@ -39,15 +39,25 @@ Rectangle { Item { id: wrapper width: list.width; height: 20 - Column { - x: 5; y: 5 - Text { text: itemName; color: "White" } - } - MouseRegion { - id:delegateMouse + Text { id: txtItem; text: itemName; color: "White" + width: list.width-imgDelete.width + MouseRegion { + id:delegateMouse anchors.fill: parent onClicked: bookmarkClick(itemId,itemIcon,itemName,itemPath); - } + } + + } + Image { + id: imgDelete; source: gui.iconPath+"gui_inactive.svg"; anchors.right: wrapper.right;anchors.rightMargin: 5; + width: 20; height: 20 + + MouseRegion { + id:delegateMouseDelete + anchors.fill: parent + onClicked: { bookmarks.Delete(itemId); bookmarks.getAttrList(""); } + } + } } } |