X-Git-Url: https://vcs.maemo.org/git/?a=blobdiff_plain;ds=sidebyside;f=src%2Fqml%2FCategories.qml;h=de537486ba8406384defed033bc16177377fed10;hb=a25bd01c676318bb3c0e4b54dd8181b41d6a7f2a;hp=bce5f7b9672b4711bfebff83f8674766dae8e14f;hpb=867a51523b31788a7c77416275935dfee8f0f39f;p=feedingit diff --git a/src/qml/Categories.qml b/src/qml/Categories.qml index bce5f7b..de53748 100644 --- a/src/qml/Categories.qml +++ b/src/qml/Categories.qml @@ -4,6 +4,11 @@ Item { // anchors.fill: parent; width: parent.width; height: parent.height; //anchors.top: parent.top; anchors.bottom: parent.bottom + property bool inEditMode: true + + function reload() { + categories.reload(); + } ListView { id: categoryList; model: categories; delegate: categoryDelegate; z: 6; @@ -14,15 +19,11 @@ Item { id: categories - //source: "http://api.flickr.com/services/feeds/photos_public.gne?"+(tags ? "tags="+tags+"&" : "")+"format=rss2" - //source: "/home/ymarcoz/feedlist.xml" source: "http://localhost:8000/categories" query: "/xml/category" - //namespaceDeclarations: "declare namespace media=\"http://search.yahoo.com/mrss/\";" XmlRole { name: "title"; query: "catname/string()" } XmlRole { name: "catid"; query: "catid/string()"; isKey: true } - } Component { @@ -44,8 +45,28 @@ Item { Text { text: title; color: "white"; width: parent.width; font.bold: true; elide: Text.ElideRight; style: Text.Raised; styleColor: "black" } //Text { text: feedname; width: parent.width; elide: Text.ElideLeft; color: "#cccccc"; style: Text.Raised; styleColor: "black" } } + Item { + x: wrapper.ListView.view.width - 128; y: 12 + height: 58; width: 58; + //anchors.horizontalCenter: parent.horizontalCenter; + Image { source: "common/images/wmEditIcon.png" } + MouseArea { + anchors.fill: parent; onClicked: { container.categoryEdit(catname, catid); } + } + visible: inEditMode + } + Item { + x: wrapper.ListView.view.width - 64; y: 12 + height: 58; width: 58; + //anchors.horizontalCenter: parent.horizontalCenter; + Image { source: "common/images/delete.png" } + MouseArea { + anchors.fill: parent; onClicked: { container.categoryDeleted(catid); } + } + visible: inEditMode + } } - MouseArea { anchors.fill: wrapper; onClicked: { container.categoryClicked(catid); } } + MouseArea { enabled: !inEditMode; anchors.fill: wrapper; onClicked: { container.categoryClicked(catid); } } } } }