Add:gui/qml:Added bookmarks deletion
authorakashihi <akashihi@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Wed, 24 Mar 2010 17:57:42 +0000 (17:57 +0000)
committerakashihi <akashihi@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Wed, 24 Mar 2010 17:57:42 +0000 (17:57 +0000)
git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@3084 ffa7fe5e-494d-0410-b361-a75ebd5db220

navit/navit/gui/qml/gui_qml.cpp
navit/navit/gui/qml/skins/navit/PageBookmarks.qml

index 3af550e..7e03729 100644 (file)
@@ -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;
index 0b73138..7b52d78 100644 (file)
@@ -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(""); }
+                       }
+               }
          }
      }