psa: added progress bar for updates
authorYves Marcoz <yves@marcoz.org>
Sun, 27 Nov 2011 18:21:14 +0000 (10:21 -0800)
committerYves Marcoz <yves@marcoz.org>
Sun, 27 Nov 2011 18:21:14 +0000 (10:21 -0800)
26 files changed:
psa_harmattan/feedingit/deb_dist/feedingit-0.1.0/debian/changelog
psa_harmattan/feedingit/deb_dist/feedingit-0.1.0/debian/feedingit/DEBIAN/md5sums
psa_harmattan/feedingit/deb_dist/feedingit-0.1.0/debian/feedingit/usr/share/doc/feedingit/changelog.Debian.gz
psa_harmattan/feedingit/deb_dist/feedingit-0.1.0/debian/feedingit/usr/share/feedingit/feedingit.py
psa_harmattan/feedingit/deb_dist/feedingit-0.1.0/debian/feedingit/usr/share/feedingit/qml/ArticleViewer.qml
psa_harmattan/feedingit/deb_dist/feedingit-0.1.0/debian/feedingit/usr/share/feedingit/qml/Categories.qml
psa_harmattan/feedingit/deb_dist/feedingit-0.1.0/debian/feedingit/usr/share/feedingit/qml/Feeds.qml
psa_harmattan/feedingit/deb_dist/feedingit-0.1.0/debian/feedingit/usr/share/feedingit/qml/main.qml
psa_harmattan/feedingit/deb_dist/feedingit-0.1.0/debian/rules
psa_harmattan/feedingit/deb_dist/feedingit-0.1.0/pysrc/feedingit.py
psa_harmattan/feedingit/deb_dist/feedingit-0.1.0/pysrc/opml_lib.py [new file with mode: 0644]
psa_harmattan/feedingit/deb_dist/feedingit-0.1.0/qml/ArticleViewer.qml
psa_harmattan/feedingit/deb_dist/feedingit-0.1.0/qml/Categories.qml
psa_harmattan/feedingit/deb_dist/feedingit-0.1.0/qml/Feeds.qml
psa_harmattan/feedingit/deb_dist/feedingit-0.1.0/qml/main.qml
psa_harmattan/feedingit/deb_dist/feedingit_0.1.0-1.debian.tar.gz
psa_harmattan/feedingit/deb_dist/feedingit_0.1.0-1.dsc
psa_harmattan/feedingit/deb_dist/feedingit_0.1.0-1_all.deb
psa_harmattan/feedingit/deb_dist/feedingit_0.1.0-1_i386.changes
psa_harmattan/feedingit/deb_dist/feedingit_0.1.0.orig.tar.gz
psa_harmattan/feedingit/pysrc/feedingit.py
psa_harmattan/feedingit/qml/ArticleViewer.qml
psa_harmattan/feedingit/qml/Categories.qml
psa_harmattan/feedingit/qml/Feeds.qml
psa_harmattan/feedingit/qml/main.qml
src/rss_sqlite.py

index 3de8cca..ff07922 100644 (file)
@@ -2,4 +2,4 @@ feedingit (0.1.0-1) unstable; urgency=low
 
   * source package automatically created by stdeb 0.6.0+git
 
- -- Yves <yves@marcoz.org>  Tue, 22 Nov 2011 22:22:26 -0800
+ -- Yves <yves@marcoz.org>  Sat, 26 Nov 2011 19:02:24 -0800
index 890272f..ca9f130 100644 (file)
@@ -1,14 +1,14 @@
 4420c31f88de68fe6e1b7637abb06196  usr/bin/feedingit
 6a42e9aebedfd157062bd5a9616dc935  usr/share/applications/feedingit.desktop
 eda8cc6ffe8d842d6dfe0244b01b3042  usr/share/dbus-1/services/feedingit_status.service
-301a8b27cfd7e30ebab34a41261bbff9  usr/share/doc/feedingit/changelog.Debian.gz
+02f9471c7bed6d36f056f3a7e29abeef  usr/share/doc/feedingit/changelog.Debian.gz
 bac2be6ae9673ee5096e20e8b714c9cd  usr/share/feedingit/BeautifulSoup.py
 8f6e980f2e1154103a90763be6c00dc4  usr/share/feedingit/XmlHandler.py
 d41d8cd98f00b204e9800998ecf8427e  usr/share/feedingit/__init__.py
 f35343aa0ea95526b6af4ed8193526c2  usr/share/feedingit/config.py
 b4b00de5dccaf56d81a9dab1eeac63e1  usr/share/feedingit/debugging.py
 fae02e730b76761d43a626fe19828d5e  usr/share/feedingit/download.py
-2d66e6a5954a47fc2124878c31b199c4  usr/share/feedingit/feedingit.py
+056fe7a92a3fcd6fb404ad4525d55fca  usr/share/feedingit/feedingit.py
 afa4f462892136f59beaf96b6bf1cf96  usr/share/feedingit/feedparser.py
 c1a0c0a9ccefd64d1e27bddb817c72a3  usr/share/feedingit/httpprogresshandler.py
 f1e9ba0f44786f513659a7fa3111fc8a  usr/share/feedingit/jobmanager.py
@@ -17,12 +17,12 @@ d9c0665dfdd5cf19f1529ce88af95134  usr/share/feedingit/opml.py
 7c3358bb2e3cba866248e75556a159d3  usr/share/feedingit/opml_lib.py
 4ef0e77dd5685db3a51306fd7ccf585f  usr/share/feedingit/qml/AddFeed.qml
 af27062fdba0bc7a3df92116e8340d19  usr/share/feedingit/qml/ArticleDisplay.qml
-9b095f75f329ce61bd4170b0037dc9c4  usr/share/feedingit/qml/ArticleViewer.qml
+ff581d603af7729c20d031cd68d73f7c  usr/share/feedingit/qml/ArticleViewer.qml
 15083e9a1fac05c8efaaa085dfabcbcb  usr/share/feedingit/qml/Articles.qml
 77bf6a1d2d0f265ee16c492886f96ede  usr/share/feedingit/qml/AutomaticUpdate.qml
-8f480702a2107a8017fdd94226b9b7d4  usr/share/feedingit/qml/Categories.qml
+051dc2769c9bddcafc65cdc26049ba88  usr/share/feedingit/qml/Categories.qml
 cd30f5eaec0885358261d7a96bfaf8cd  usr/share/feedingit/qml/FeedingIt.qml
-3f5a5feca57160c2956a38579a325816  usr/share/feedingit/qml/Feeds.qml
+afdb98e07e8b5e066e745a5df9de09b9  usr/share/feedingit/qml/Feeds.qml
 bec5fe4599a3ad5799ed96d7ed81fb5f  usr/share/feedingit/qml/MainPage.qml
 9b6a3459afcc30b21a641ef0c24deb5c  usr/share/feedingit/qml/Settings.qml
 c60a530cf5c92c8c08e0a073444172e1  usr/share/feedingit/qml/SettingsPage.qml
@@ -61,7 +61,7 @@ af11b73b195513d08c17723b41db0b04  usr/share/feedingit/qml/common/images/wmBackIc
 1c7751b124aa1bdf4b89ec76cdf815a2  usr/share/feedingit/qml/i18n/FeedingIt.ts
 7790a99425dd7c1046e6ae3b1ee72a03  usr/share/feedingit/qml/i18n/qml_en.qm
 1674fcce45bcf3319e61d19a9adf4fdd  usr/share/feedingit/qml/i18n/qml_en.ts
-2fbe22ed5a06214de3998bbb6f46b30b  usr/share/feedingit/qml/main.qml
+6a1fcf3584c62e4817505bee45477b72  usr/share/feedingit/qml/main.qml
 e3b4184531f29bbf86d812f9b8adacc2  usr/share/feedingit/rss_sqlite.py
 721777a26cd2a5b8466ce2aa2b99fad7  usr/share/feedingit/update_feeds.py
 6ccf12dc4379e91800ae8505b2e86082  usr/share/feedingit/updatedbus.py
index 9fd6269..071f1a7 100644 (file)
Binary files a/psa_harmattan/feedingit/deb_dist/feedingit-0.1.0/debian/feedingit/usr/share/doc/feedingit/changelog.Debian.gz and b/psa_harmattan/feedingit/deb_dist/feedingit-0.1.0/debian/feedingit/usr/share/doc/feedingit/changelog.Debian.gz differ
index 9755a3d..fbf58ff 100644 (file)
@@ -11,6 +11,8 @@ import codecs
 import dbus
 # import python dbus GLib mainloop support
 import dbus.mainloop.glib
+# Enable glib main loop support
+dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
 
 # Comment the line below if you don't want to use OpenGL for QML rendering or if it is not supported
 from PySide import QtOpenGL,  QtCore
@@ -39,7 +41,9 @@ class Controller(QtCore.QObject):
                         completed, in_progress, queued,
                         bytes_downloaded, bytes_updated, bytes_per_second,
                         feed_updated):
-        pass
+        logger.info(feed_updated)
+        total = completed + in_progress + queued
+        root.updateProgress(total, completed)
     
     def update_started(self):
         root.updateStarted()
@@ -112,6 +116,7 @@ class Controller(QtCore.QObject):
     def markAllAsRead(self, key):
         feed = listing.getFeed(key)
         feed.markAllAsRead()
+        listing.updateUnread(key)
 
     @QtCore.Slot(str, str)
     def setEntryRead(self, key, articleid):
@@ -217,23 +222,22 @@ def main():
     controller = Controller(listing)
  
     # listen on dbus for download update progress
-    dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
     bus = dbus.SessionBus()
-#        bus.add_signal_receiver(handler_function=self.update_progress,
-#                                bus_name=None,
-#                                signal_name='UpdateProgress',
-#                                dbus_interface='org.marcoz.feedingit',
-#                                path='/org/marcoz/feedingit/update')
-#    bus.add_signal_receiver(handler_function=controller.update_started,
-#                            bus_name=None,
-#                            signal_name='UpdateStarted',
-#                            dbus_interface='org.marcoz.feedingit',
-#                            path='/org/marcoz/feedingit/update')
-#    bus.add_signal_receiver(handler_function=controller.update_finished,
-#                            bus_name=None,
-#                            signal_name='UpdateFinished',
-#                            dbus_interface='org.marcoz.feedingit',
-#                            path='/org/marcoz/feedingit/update')
+    bus.add_signal_receiver(handler_function=controller.update_progress,
+                            bus_name=None,
+                            signal_name='UpdateProgress',
+                            dbus_interface='org.marcoz.feedingit',
+                            path='/org/marcoz/feedingit/update')
+    bus.add_signal_receiver(handler_function=controller.update_started,
+                            bus_name=None,
+                            signal_name='UpdateStarted',
+                            dbus_interface='org.marcoz.feedingit',
+                            path='/org/marcoz/feedingit/update')
+    bus.add_signal_receiver(handler_function=controller.update_finished,
+                            bus_name=None,
+                            signal_name='UpdateFinished',
+                            dbus_interface='org.marcoz.feedingit',
+                            path='/org/marcoz/feedingit/update')
  
     global root
     rc = view.rootContext()
index f974ddb..9bb29b4 100644 (file)
@@ -1,4 +1,5 @@
 import Qt 4.7
+import com.nokia.meego 1.0
 
 Item {
     id: articleViewer
@@ -56,9 +57,12 @@ Item {
         id: articleList; /*model: visualModel.parts.list;*/ z: 6
         model: articles
         delegate: listing
-        width: parent.width; height: parent.height; /*x: 0;*/
+        width: parent.width;
+        height: updateBarFeeds.visible? parent.height-updateBarFeeds.height : parent.height;
+        /*x: 0;*/
         cacheBuffer: 100;
         flickDeceleration: 1500
+        visible: articles.status==XmlListModel.Ready
     }
 
     ListView {
@@ -66,7 +70,9 @@ Item {
         model: articles;
         delegate: viewer
         orientation: ListView.Horizontal
-        width: parent.width; height: parent.height; visible: false; z:8
+        width: parent.width;
+        height: updateBarFeeds.visible? parent.height-updateBarFeeds.height : parent.height;
+        visible: false; z:8
         //onCurrentIndexChanged: photosGridView.positionViewAtIndex(currentIndex, GridView.Contain)
         highlightRangeMode: ListView.StrictlyEnforceRange; snapMode: ListView.SnapOneItem
         //cacheBuffer: 5;
@@ -75,19 +81,43 @@ Item {
         highlightMoveDuration: 300;
     }
 
+    ProgressBar {
+        id: updateBar
+        minimumValue: 0
+        maximumValue: 100
+        value: window.updateProgressValue
+        visible: window.isUpdateInProgress
+        width: parent.width
+        anchors.bottom: parent.bottom
+    }
+
     Rectangle {
         id: noArticle
         //width: parent.width; height: parent.height;
-        //color: "#000000"
-        anchors.centerIn: parent;
+        color: "black"
+        opacity: 0.8
+
+        //anchors.centerIn: parent;
+        anchors.fill: parent
         visible: false;
         z:8;
-        Text { id: noText; color: "#ffffff"; anchors.centerIn: parent; text: qsTr("No articles available"); }
-        Image { id: loadingImage; anchors.centerIn: parent; source: "common/images/loading.png";
-            height: 96; width: 96;
-            NumberAnimation on rotation {
-                from: 0; to: 360; running: (loadingImage.visible == true); loops: Animation.Infinite; duration: 900
-            }
+        Text {
+            id: noText; color: "#ffffff"; anchors.centerIn: parent; text: qsTr("No articles available");
+            font.pixelSize: settings.mainTextSize
+        }
+
+        BusyIndicator {
+                     id: loadingIndicator
+                     anchors.centerIn: parent;
+                     running: visible
+                     visible: false
+                     platformStyle: BusyIndicatorStyle { size: "large" }
+        }
+
+        MouseArea {
+            // Disable clicks when this item is visible
+            anchors.fill: parent
+            enabled: parent.visible
         }
 
         states: [ State {
@@ -96,14 +126,21 @@ Item {
             PropertyChanges { target: loadingImage; visible: false; }
             PropertyChanges { target: noText; visible: true; }
             }, State {
-            name: "loading"; when: articles.count==0 && articles.status != XmlListModel.Ready
+            name: "loading"; when: articles.status != XmlListModel.Ready
             PropertyChanges { target: noArticle; visible: true; }
             PropertyChanges { target: noText; visible: false; }
-            PropertyChanges { target: loadingImage; visible: true; }
+            PropertyChanges { target: loadingIndicator; visible: true; }
             }
         ]
     }
 
+    Rectangle {
+        id: reloading
+        visible: articles.status != XmlListModel.Ready
+
+
+    }
+
     Component {
             id: listing;
 
@@ -123,11 +160,12 @@ Item {
                     width: listItem.width - 6;
 
                     anchors.margins: 5
-                    verticalAlignment: Text.AlignVCenter; text: title;
+                    verticalAlignment: Text.AlignVCenter;
+                    text: title;
                     color: (unread=="True") ? settings.mainTextColour : settings.secondaryTextColour;
 
                      wrapMode: Text.WordWrap; font.bold: false;
-                    font.pointSize: 18
+                    font.pixelSize: settings.mainTextSize
                 }
                 MouseArea { anchors.fill: listItem;
                     onClicked: { articleView.positionViewAtIndex(index, ListView.Contain); articleView.visible = true; }
@@ -142,7 +180,7 @@ Item {
             id: flipItem;
             width: articleViewer.width; height: articleViewer.height;
 
-            property string url: (articleView.visible && Math.abs(articleView.currentIndex-index)<2) ? path: "";
+            //property string url: (articleView.visible && Math.abs(articleView.currentIndex-index)<2) ? path: "";
             property string html: controller.getArticle(articleViewer.feedid, articleid)
             ArticleDisplay {
                 zoomEnabled: articleViewer.zoomEnabled;
@@ -154,15 +192,10 @@ Item {
                     StateChangeScript {
                         name: "myScript"
                         script: {
-                            flipItem.url=path;
+                            //flipItem.url=path;
                             controller.setEntryRead(articleViewer.feedid, articleid)
                         }
                     }
-                    }, State {
-                        name: 'articleIsClose'; when: articleView.visible && Math.abs(articleView.currentIndex-index)<2;
-                        StateChangeScript {
-                            script: { flipItem.url=path; }
-                        }
                     }
                 ]
             }
@@ -182,5 +215,4 @@ Item {
         XmlRole { name: "unread"; query: "unread/string()"; isKey: true}
     }
 
-
 }
index 4469ba1..be7205e 100644 (file)
@@ -1,4 +1,5 @@
 import Qt 4.7
+import com.nokia.meego 1.0
 
 Item {
 //    anchors.fill: parent;
@@ -15,7 +16,20 @@ Item {
 
     ListView {
         id: categoryList; model: categories; delegate: categoryDelegate; z: 6;
-        cacheBuffer: 100; width: parent.width; height: parent.height;
+        cacheBuffer: 100; width: parent.width;
+        height: updateBarFeeds.visible? parent.height-updateBarFeeds.height : parent.height;
+        clip: true
+        /*height: parent.height;*/
+    }
+
+    ProgressBar {
+        id: updateBar
+        minimumValue: 0
+        maximumValue: 100
+        value: window.updateProgressValue
+        visible: window.isUpdateInProgress
+        anchors.bottom: parent.bottom
+        width: parent.width
     }
 
     XmlListModel {
index 8df8c5e..318faa1 100644 (file)
@@ -1,4 +1,5 @@
 import Qt 4.7
+import com.nokia.meego 1.0
 
 Item {
     property string catid : parent.catid
@@ -19,9 +20,21 @@ Item {
 
     ListView {
         id: feedList; model: feeds; delegate: feedDelegate; z: 6
-        width: parent.width; height: parent.height; /*x: 0;*/
+        width: parent.width; height: updateBarFeeds.visible? parent.height-updateBarFeeds.height : parent.height; /*x: 0;*/
         cacheBuffer: 100;
         flickDeceleration: 1500
+        clip: true
+    }
+
+    ProgressBar {
+        id: updateBarFeeds
+        minimumValue: 0
+        maximumValue: 100
+        value: window.updateProgressValue
+        visible: window.isUpdateInProgress
+        anchors.bottom: parent.bottom
+        z: 8
+        width: parent.width
     }
 
     XmlListModel {
index 0ade188..267d1a6 100644 (file)
@@ -9,21 +9,38 @@ PageStackWindow {
     signal longPressFeed(string key)
     signal categoryReloadRequest()
     signal feedReloadRequest()
+    signal articlesReloadRequest()
     signal addFileSignal(string fullname, string filename)
 
     property string feedid
     property string catid
 
+    property bool isUpdateInProgress: false
+    property int updateProgressValue: 0
+
     function addFileNotification(fullname, filename) {
         window.addFileSignal(fullname,filename)
     }
 
     function updateStarted() {
         banner.show(qsTr("Update Started"))
+        updateProgressValue = 0
+        isUpdateInProgress = true
     }
 
     function updateFinished() {
+        categoryReloadRequest()
+        feedReloadRequest()
         banner.show(qsTr("Updated Completed"))
+        isUpdateInProgress = false
+    }
+
+    function updateProgress(total, completed) {
+        if (total>0) {
+            updateProgressValue = Math.round(100*completed/total);
+        } else {
+            updateProgressValue = 0
+        }
     }
 
     onLongPressFeed: {
@@ -72,7 +89,11 @@ PageStackWindow {
         id: myArticlesMenu
         visualParent: pageStack
         MenuLayout {
-            MenuItem { text: qsTr("Mark All As Read"); onClicked: controller.markAllAsRead(feedid); }
+            MenuItem { text: qsTr("Mark All As Read"); onClicked: {
+                    controller.markAllAsRead(feedid);
+                    articlesReloadRequest()
+                }
+            }
             MenuItem { text: qsTr("Update Feed"); onClicked: controller.updateFeed(feedid); }
             //MenuItem { text: qsTr("About FeedingIt"); onClicked: query.open(); }
         }
@@ -248,6 +269,10 @@ PageStackWindow {
                     onClicked: (myArticlesMenu.status == DialogStatus.Closed) ? myArticlesMenu.open() : myArticlesMenu.close()
                 }
             }
+            Connections {
+                 target: window
+                 onArticlesReloadRequest: flipper.reload()
+             }
         }
     }
 
index c263b26..d6c6b51 100755 (executable)
@@ -1,7 +1,7 @@
 #!/usr/bin/make -f
 
 # This file was automatically generated by stdeb 0.6.0+git at
-# Tue, 22 Nov 2011 22:22:26 -0800
+# Sat, 26 Nov 2011 19:02:24 -0800
 
 %:
        dh $@ --with python2 --buildsystem=python_distutils
index 9755a3d..fbf58ff 100644 (file)
@@ -11,6 +11,8 @@ import codecs
 import dbus
 # import python dbus GLib mainloop support
 import dbus.mainloop.glib
+# Enable glib main loop support
+dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
 
 # Comment the line below if you don't want to use OpenGL for QML rendering or if it is not supported
 from PySide import QtOpenGL,  QtCore
@@ -39,7 +41,9 @@ class Controller(QtCore.QObject):
                         completed, in_progress, queued,
                         bytes_downloaded, bytes_updated, bytes_per_second,
                         feed_updated):
-        pass
+        logger.info(feed_updated)
+        total = completed + in_progress + queued
+        root.updateProgress(total, completed)
     
     def update_started(self):
         root.updateStarted()
@@ -112,6 +116,7 @@ class Controller(QtCore.QObject):
     def markAllAsRead(self, key):
         feed = listing.getFeed(key)
         feed.markAllAsRead()
+        listing.updateUnread(key)
 
     @QtCore.Slot(str, str)
     def setEntryRead(self, key, articleid):
@@ -217,23 +222,22 @@ def main():
     controller = Controller(listing)
  
     # listen on dbus for download update progress
-    dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
     bus = dbus.SessionBus()
-#        bus.add_signal_receiver(handler_function=self.update_progress,
-#                                bus_name=None,
-#                                signal_name='UpdateProgress',
-#                                dbus_interface='org.marcoz.feedingit',
-#                                path='/org/marcoz/feedingit/update')
-#    bus.add_signal_receiver(handler_function=controller.update_started,
-#                            bus_name=None,
-#                            signal_name='UpdateStarted',
-#                            dbus_interface='org.marcoz.feedingit',
-#                            path='/org/marcoz/feedingit/update')
-#    bus.add_signal_receiver(handler_function=controller.update_finished,
-#                            bus_name=None,
-#                            signal_name='UpdateFinished',
-#                            dbus_interface='org.marcoz.feedingit',
-#                            path='/org/marcoz/feedingit/update')
+    bus.add_signal_receiver(handler_function=controller.update_progress,
+                            bus_name=None,
+                            signal_name='UpdateProgress',
+                            dbus_interface='org.marcoz.feedingit',
+                            path='/org/marcoz/feedingit/update')
+    bus.add_signal_receiver(handler_function=controller.update_started,
+                            bus_name=None,
+                            signal_name='UpdateStarted',
+                            dbus_interface='org.marcoz.feedingit',
+                            path='/org/marcoz/feedingit/update')
+    bus.add_signal_receiver(handler_function=controller.update_finished,
+                            bus_name=None,
+                            signal_name='UpdateFinished',
+                            dbus_interface='org.marcoz.feedingit',
+                            path='/org/marcoz/feedingit/update')
  
     global root
     rc = view.rootContext()
diff --git a/psa_harmattan/feedingit/deb_dist/feedingit-0.1.0/pysrc/opml_lib.py b/psa_harmattan/feedingit/deb_dist/feedingit-0.1.0/pysrc/opml_lib.py
new file mode 100644 (file)
index 0000000..4de756b
--- /dev/null
@@ -0,0 +1,65 @@
+#!/usr/bin/env python2.5
+
+# 
+# Copyright (c) 2007-2008 INdT.
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+#  This program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#  GNU Lesser General Public License for more details.
+#
+#  You should have received a copy of the GNU Lesser General Public License
+#  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+
+# ============================================================================
+# Name        : FeedingIt.py
+# Author      : Yves Marcoz
+# Version     : 0.2.2
+# Description : Simple RSS Reader
+# ============================================================================
+
+from xml.dom.minidom import parse, parseString
+import time
+from os.path import isfile, dirname
+import logging
+logger = logging.getLogger(__name__)
+
+def getOpmlText(listing):
+    time_now = time.strftime('%a, %d %b %Y %H:%M:%S GMT', time.gmtime())
+    opml_text = """<?xml version="1.0" encoding="UTF-8"?>
+<opml version="1.0">
+<head>
+    <title>Feeding It Export</title>
+</head>
+<body>
+"""
+    for key in listing.getListOfFeeds():
+        title = listing.getFeedTitle(key)
+        url = listing.getFeedUrl(key)
+        if not title == "Archived Articles": 
+            opml_text += """\n\t\t<outline  type="rss" text="%s" title="%s" xmlUrl="%s"/>""" % (sanitize(title), sanitize(title), sanitize(url))
+    opml_text += """\n</body>\n</opml>\n"""
+    return opml_text
+    
+def sanitize(text):
+    from cgi import escape
+    return escape(text).encode('ascii', 'xmlcharrefreplace')
+        
+def parseOpml(opmlData):
+    feeds = []
+    dom1 = parseString(opmlData)
+
+    outlines = dom1.getElementsByTagName('outline')
+    for outline in outlines:
+        title = outline.getAttribute('text')
+        url = outline.getAttribute('xmlUrl')
+        if url == "":
+            url = outline.getAttribute('htmlUrl')
+        if not url == "":
+            feeds.append( (title, url) )
+    return feeds
\ No newline at end of file
index f974ddb..9bb29b4 100644 (file)
@@ -1,4 +1,5 @@
 import Qt 4.7
+import com.nokia.meego 1.0
 
 Item {
     id: articleViewer
@@ -56,9 +57,12 @@ Item {
         id: articleList; /*model: visualModel.parts.list;*/ z: 6
         model: articles
         delegate: listing
-        width: parent.width; height: parent.height; /*x: 0;*/
+        width: parent.width;
+        height: updateBarFeeds.visible? parent.height-updateBarFeeds.height : parent.height;
+        /*x: 0;*/
         cacheBuffer: 100;
         flickDeceleration: 1500
+        visible: articles.status==XmlListModel.Ready
     }
 
     ListView {
@@ -66,7 +70,9 @@ Item {
         model: articles;
         delegate: viewer
         orientation: ListView.Horizontal
-        width: parent.width; height: parent.height; visible: false; z:8
+        width: parent.width;
+        height: updateBarFeeds.visible? parent.height-updateBarFeeds.height : parent.height;
+        visible: false; z:8
         //onCurrentIndexChanged: photosGridView.positionViewAtIndex(currentIndex, GridView.Contain)
         highlightRangeMode: ListView.StrictlyEnforceRange; snapMode: ListView.SnapOneItem
         //cacheBuffer: 5;
@@ -75,19 +81,43 @@ Item {
         highlightMoveDuration: 300;
     }
 
+    ProgressBar {
+        id: updateBar
+        minimumValue: 0
+        maximumValue: 100
+        value: window.updateProgressValue
+        visible: window.isUpdateInProgress
+        width: parent.width
+        anchors.bottom: parent.bottom
+    }
+
     Rectangle {
         id: noArticle
         //width: parent.width; height: parent.height;
-        //color: "#000000"
-        anchors.centerIn: parent;
+        color: "black"
+        opacity: 0.8
+
+        //anchors.centerIn: parent;
+        anchors.fill: parent
         visible: false;
         z:8;
-        Text { id: noText; color: "#ffffff"; anchors.centerIn: parent; text: qsTr("No articles available"); }
-        Image { id: loadingImage; anchors.centerIn: parent; source: "common/images/loading.png";
-            height: 96; width: 96;
-            NumberAnimation on rotation {
-                from: 0; to: 360; running: (loadingImage.visible == true); loops: Animation.Infinite; duration: 900
-            }
+        Text {
+            id: noText; color: "#ffffff"; anchors.centerIn: parent; text: qsTr("No articles available");
+            font.pixelSize: settings.mainTextSize
+        }
+
+        BusyIndicator {
+                     id: loadingIndicator
+                     anchors.centerIn: parent;
+                     running: visible
+                     visible: false
+                     platformStyle: BusyIndicatorStyle { size: "large" }
+        }
+
+        MouseArea {
+            // Disable clicks when this item is visible
+            anchors.fill: parent
+            enabled: parent.visible
         }
 
         states: [ State {
@@ -96,14 +126,21 @@ Item {
             PropertyChanges { target: loadingImage; visible: false; }
             PropertyChanges { target: noText; visible: true; }
             }, State {
-            name: "loading"; when: articles.count==0 && articles.status != XmlListModel.Ready
+            name: "loading"; when: articles.status != XmlListModel.Ready
             PropertyChanges { target: noArticle; visible: true; }
             PropertyChanges { target: noText; visible: false; }
-            PropertyChanges { target: loadingImage; visible: true; }
+            PropertyChanges { target: loadingIndicator; visible: true; }
             }
         ]
     }
 
+    Rectangle {
+        id: reloading
+        visible: articles.status != XmlListModel.Ready
+
+
+    }
+
     Component {
             id: listing;
 
@@ -123,11 +160,12 @@ Item {
                     width: listItem.width - 6;
 
                     anchors.margins: 5
-                    verticalAlignment: Text.AlignVCenter; text: title;
+                    verticalAlignment: Text.AlignVCenter;
+                    text: title;
                     color: (unread=="True") ? settings.mainTextColour : settings.secondaryTextColour;
 
                      wrapMode: Text.WordWrap; font.bold: false;
-                    font.pointSize: 18
+                    font.pixelSize: settings.mainTextSize
                 }
                 MouseArea { anchors.fill: listItem;
                     onClicked: { articleView.positionViewAtIndex(index, ListView.Contain); articleView.visible = true; }
@@ -142,7 +180,7 @@ Item {
             id: flipItem;
             width: articleViewer.width; height: articleViewer.height;
 
-            property string url: (articleView.visible && Math.abs(articleView.currentIndex-index)<2) ? path: "";
+            //property string url: (articleView.visible && Math.abs(articleView.currentIndex-index)<2) ? path: "";
             property string html: controller.getArticle(articleViewer.feedid, articleid)
             ArticleDisplay {
                 zoomEnabled: articleViewer.zoomEnabled;
@@ -154,15 +192,10 @@ Item {
                     StateChangeScript {
                         name: "myScript"
                         script: {
-                            flipItem.url=path;
+                            //flipItem.url=path;
                             controller.setEntryRead(articleViewer.feedid, articleid)
                         }
                     }
-                    }, State {
-                        name: 'articleIsClose'; when: articleView.visible && Math.abs(articleView.currentIndex-index)<2;
-                        StateChangeScript {
-                            script: { flipItem.url=path; }
-                        }
                     }
                 ]
             }
@@ -182,5 +215,4 @@ Item {
         XmlRole { name: "unread"; query: "unread/string()"; isKey: true}
     }
 
-
 }
index 4469ba1..be7205e 100644 (file)
@@ -1,4 +1,5 @@
 import Qt 4.7
+import com.nokia.meego 1.0
 
 Item {
 //    anchors.fill: parent;
@@ -15,7 +16,20 @@ Item {
 
     ListView {
         id: categoryList; model: categories; delegate: categoryDelegate; z: 6;
-        cacheBuffer: 100; width: parent.width; height: parent.height;
+        cacheBuffer: 100; width: parent.width;
+        height: updateBarFeeds.visible? parent.height-updateBarFeeds.height : parent.height;
+        clip: true
+        /*height: parent.height;*/
+    }
+
+    ProgressBar {
+        id: updateBar
+        minimumValue: 0
+        maximumValue: 100
+        value: window.updateProgressValue
+        visible: window.isUpdateInProgress
+        anchors.bottom: parent.bottom
+        width: parent.width
     }
 
     XmlListModel {
index 8df8c5e..318faa1 100644 (file)
@@ -1,4 +1,5 @@
 import Qt 4.7
+import com.nokia.meego 1.0
 
 Item {
     property string catid : parent.catid
@@ -19,9 +20,21 @@ Item {
 
     ListView {
         id: feedList; model: feeds; delegate: feedDelegate; z: 6
-        width: parent.width; height: parent.height; /*x: 0;*/
+        width: parent.width; height: updateBarFeeds.visible? parent.height-updateBarFeeds.height : parent.height; /*x: 0;*/
         cacheBuffer: 100;
         flickDeceleration: 1500
+        clip: true
+    }
+
+    ProgressBar {
+        id: updateBarFeeds
+        minimumValue: 0
+        maximumValue: 100
+        value: window.updateProgressValue
+        visible: window.isUpdateInProgress
+        anchors.bottom: parent.bottom
+        z: 8
+        width: parent.width
     }
 
     XmlListModel {
index 0ade188..267d1a6 100644 (file)
@@ -9,21 +9,38 @@ PageStackWindow {
     signal longPressFeed(string key)
     signal categoryReloadRequest()
     signal feedReloadRequest()
+    signal articlesReloadRequest()
     signal addFileSignal(string fullname, string filename)
 
     property string feedid
     property string catid
 
+    property bool isUpdateInProgress: false
+    property int updateProgressValue: 0
+
     function addFileNotification(fullname, filename) {
         window.addFileSignal(fullname,filename)
     }
 
     function updateStarted() {
         banner.show(qsTr("Update Started"))
+        updateProgressValue = 0
+        isUpdateInProgress = true
     }
 
     function updateFinished() {
+        categoryReloadRequest()
+        feedReloadRequest()
         banner.show(qsTr("Updated Completed"))
+        isUpdateInProgress = false
+    }
+
+    function updateProgress(total, completed) {
+        if (total>0) {
+            updateProgressValue = Math.round(100*completed/total);
+        } else {
+            updateProgressValue = 0
+        }
     }
 
     onLongPressFeed: {
@@ -72,7 +89,11 @@ PageStackWindow {
         id: myArticlesMenu
         visualParent: pageStack
         MenuLayout {
-            MenuItem { text: qsTr("Mark All As Read"); onClicked: controller.markAllAsRead(feedid); }
+            MenuItem { text: qsTr("Mark All As Read"); onClicked: {
+                    controller.markAllAsRead(feedid);
+                    articlesReloadRequest()
+                }
+            }
             MenuItem { text: qsTr("Update Feed"); onClicked: controller.updateFeed(feedid); }
             //MenuItem { text: qsTr("About FeedingIt"); onClicked: query.open(); }
         }
@@ -248,6 +269,10 @@ PageStackWindow {
                     onClicked: (myArticlesMenu.status == DialogStatus.Closed) ? myArticlesMenu.open() : myArticlesMenu.close()
                 }
             }
+            Connections {
+                 target: window
+                 onArticlesReloadRequest: flipper.reload()
+             }
         }
     }
 
index 7d03c7b..5df8e7b 100644 (file)
Binary files a/psa_harmattan/feedingit/deb_dist/feedingit_0.1.0-1.debian.tar.gz and b/psa_harmattan/feedingit/deb_dist/feedingit_0.1.0-1.debian.tar.gz differ
index 91e403f..cd5f9d7 100644 (file)
@@ -7,11 +7,11 @@ Maintainer: Yves <yves@marcoz.org>
 Standards-Version: 3.9.1
 Build-Depends: python-all (>= 2.6.6-3), debhelper (>= 7.4.3)
 Checksums-Sha1: 
- e5f65ada2e86e277a6bcaa2b20ea777ba6f4b737 180581 feedingit_0.1.0.orig.tar.gz
- 7b771ace5d2d2e3490781f7ac62e3987341d342b 891 feedingit_0.1.0-1.debian.tar.gz
+ 6d5bc21c6f2417b44a263823878b49a97fc7ea7d 180866 feedingit_0.1.0.orig.tar.gz
+ aec80753f27ec09a133bea574b4ba8a3f0c5cb71 928 feedingit_0.1.0-1.debian.tar.gz
 Checksums-Sha256: 
- 0afcdeeab2d42793ec4a00f713c306013713a8774f357af641e6439d14102b9c 180581 feedingit_0.1.0.orig.tar.gz
- 0cacff3585e8b42417c2511d2320f4e805c64a05ecb91c792156b04f3e30071a 891 feedingit_0.1.0-1.debian.tar.gz
+ a19f03efd945809fe24163dd57b5d4b5dd19b5a9513de35a44fe13034493950a 180866 feedingit_0.1.0.orig.tar.gz
+ bd7e95514a57e8c4c8f828173e78e7de591e31ec6faee3e30ca1fc90f7482a08 928 feedingit_0.1.0-1.debian.tar.gz
 Files: 
- 98f4e91b86fd3a072c36164a110f26a3 180581 feedingit_0.1.0.orig.tar.gz
- f5d22be10077603c0e69040ae344e0a5 891 feedingit_0.1.0-1.debian.tar.gz
+ cce13155ea234f8e40613ad751477553 180866 feedingit_0.1.0.orig.tar.gz
+ 6398c006b84d313a600c863cf9718e08 928 feedingit_0.1.0-1.debian.tar.gz
index e37bc5d..3154d96 100644 (file)
Binary files a/psa_harmattan/feedingit/deb_dist/feedingit_0.1.0-1_all.deb and b/psa_harmattan/feedingit/deb_dist/feedingit_0.1.0-1_all.deb differ
index 76b6d14..6221772 100644 (file)
@@ -1,5 +1,5 @@
 Format: 1.8
-Date: Tue, 22 Nov 2011 22:22:26 -0800
+Date: Sat, 26 Nov 2011 19:02:24 -0800
 Source: feedingit
 Binary: feedingit
 Architecture: source all
@@ -15,17 +15,17 @@ Changes:
  .
    * source package automatically created by stdeb 0.6.0+git
 Checksums-Sha1: 
- 8978b9c334d9b03ce85da487c732570f6bc8e606 753 feedingit_0.1.0-1.dsc
- e5f65ada2e86e277a6bcaa2b20ea777ba6f4b737 180581 feedingit_0.1.0.orig.tar.gz
- 7b771ace5d2d2e3490781f7ac62e3987341d342b 891 feedingit_0.1.0-1.debian.tar.gz
- 9ec99592e16ba5cb4457641ea127e99c406ac525 170420 feedingit_0.1.0-1_all.deb
+ abbf19fa4a6d3cc7ba6842d9063af44ce3a7f2a3 753 feedingit_0.1.0-1.dsc
+ 6d5bc21c6f2417b44a263823878b49a97fc7ea7d 180866 feedingit_0.1.0.orig.tar.gz
+ aec80753f27ec09a133bea574b4ba8a3f0c5cb71 928 feedingit_0.1.0-1.debian.tar.gz
+ 5315a14980298945cc69c8710a3ce4d3b9b99eab 170828 feedingit_0.1.0-1_all.deb
 Checksums-Sha256: 
- 379e5f42f84d8527581c0dee7e90246c61cf9f37bd2c180fc8e525016218032f 753 feedingit_0.1.0-1.dsc
- 0afcdeeab2d42793ec4a00f713c306013713a8774f357af641e6439d14102b9c 180581 feedingit_0.1.0.orig.tar.gz
- 0cacff3585e8b42417c2511d2320f4e805c64a05ecb91c792156b04f3e30071a 891 feedingit_0.1.0-1.debian.tar.gz
- 123701ee75b629780017100590c77669c85ca9ebf03645b1ccea6364bdacb70f 170420 feedingit_0.1.0-1_all.deb
+ ef4bbd119cd3896ef22d344b8ea422eed4ab85d257ff37ed5f5a6b4124d48526 753 feedingit_0.1.0-1.dsc
+ a19f03efd945809fe24163dd57b5d4b5dd19b5a9513de35a44fe13034493950a 180866 feedingit_0.1.0.orig.tar.gz
+ bd7e95514a57e8c4c8f828173e78e7de591e31ec6faee3e30ca1fc90f7482a08 928 feedingit_0.1.0-1.debian.tar.gz
+ fc1193d8de2cd27b4f973b405ca4f1fa354c0b827e63db0b3444690203c278c9 170828 feedingit_0.1.0-1_all.deb
 Files: 
- 096e3f8e5374b7970439c6b2c8faad5d 753 user/development optional feedingit_0.1.0-1.dsc
- 98f4e91b86fd3a072c36164a110f26a3 180581 user/development optional feedingit_0.1.0.orig.tar.gz
- f5d22be10077603c0e69040ae344e0a5 891 user/development optional feedingit_0.1.0-1.debian.tar.gz
- 0f976c22ff42daa15771094a276ff675 170420 user/development optional feedingit_0.1.0-1_all.deb
+ ad3dd1da27746027b697f569454e37a1 753 user/development optional feedingit_0.1.0-1.dsc
+ cce13155ea234f8e40613ad751477553 180866 user/development optional feedingit_0.1.0.orig.tar.gz
+ 6398c006b84d313a600c863cf9718e08 928 user/development optional feedingit_0.1.0-1.debian.tar.gz
+ f24d0d88620c2c35b2046f6b75e8519e 170828 user/development optional feedingit_0.1.0-1_all.deb
index 1ce91c5..4533e15 100644 (file)
Binary files a/psa_harmattan/feedingit/deb_dist/feedingit_0.1.0.orig.tar.gz and b/psa_harmattan/feedingit/deb_dist/feedingit_0.1.0.orig.tar.gz differ
index 198cf42..fbf58ff 100644 (file)
@@ -41,7 +41,9 @@ class Controller(QtCore.QObject):
                         completed, in_progress, queued,
                         bytes_downloaded, bytes_updated, bytes_per_second,
                         feed_updated):
-        pass
+        logger.info(feed_updated)
+        total = completed + in_progress + queued
+        root.updateProgress(total, completed)
     
     def update_started(self):
         root.updateStarted()
@@ -114,6 +116,7 @@ class Controller(QtCore.QObject):
     def markAllAsRead(self, key):
         feed = listing.getFeed(key)
         feed.markAllAsRead()
+        listing.updateUnread(key)
 
     @QtCore.Slot(str, str)
     def setEntryRead(self, key, articleid):
@@ -220,11 +223,11 @@ def main():
  
     # listen on dbus for download update progress
     bus = dbus.SessionBus()
-#        bus.add_signal_receiver(handler_function=self.update_progress,
-#                                bus_name=None,
-#                                signal_name='UpdateProgress',
-#                                dbus_interface='org.marcoz.feedingit',
-#                                path='/org/marcoz/feedingit/update')
+    bus.add_signal_receiver(handler_function=controller.update_progress,
+                            bus_name=None,
+                            signal_name='UpdateProgress',
+                            dbus_interface='org.marcoz.feedingit',
+                            path='/org/marcoz/feedingit/update')
     bus.add_signal_receiver(handler_function=controller.update_started,
                             bus_name=None,
                             signal_name='UpdateStarted',
index f974ddb..9bb29b4 100644 (file)
@@ -1,4 +1,5 @@
 import Qt 4.7
+import com.nokia.meego 1.0
 
 Item {
     id: articleViewer
@@ -56,9 +57,12 @@ Item {
         id: articleList; /*model: visualModel.parts.list;*/ z: 6
         model: articles
         delegate: listing
-        width: parent.width; height: parent.height; /*x: 0;*/
+        width: parent.width;
+        height: updateBarFeeds.visible? parent.height-updateBarFeeds.height : parent.height;
+        /*x: 0;*/
         cacheBuffer: 100;
         flickDeceleration: 1500
+        visible: articles.status==XmlListModel.Ready
     }
 
     ListView {
@@ -66,7 +70,9 @@ Item {
         model: articles;
         delegate: viewer
         orientation: ListView.Horizontal
-        width: parent.width; height: parent.height; visible: false; z:8
+        width: parent.width;
+        height: updateBarFeeds.visible? parent.height-updateBarFeeds.height : parent.height;
+        visible: false; z:8
         //onCurrentIndexChanged: photosGridView.positionViewAtIndex(currentIndex, GridView.Contain)
         highlightRangeMode: ListView.StrictlyEnforceRange; snapMode: ListView.SnapOneItem
         //cacheBuffer: 5;
@@ -75,19 +81,43 @@ Item {
         highlightMoveDuration: 300;
     }
 
+    ProgressBar {
+        id: updateBar
+        minimumValue: 0
+        maximumValue: 100
+        value: window.updateProgressValue
+        visible: window.isUpdateInProgress
+        width: parent.width
+        anchors.bottom: parent.bottom
+    }
+
     Rectangle {
         id: noArticle
         //width: parent.width; height: parent.height;
-        //color: "#000000"
-        anchors.centerIn: parent;
+        color: "black"
+        opacity: 0.8
+
+        //anchors.centerIn: parent;
+        anchors.fill: parent
         visible: false;
         z:8;
-        Text { id: noText; color: "#ffffff"; anchors.centerIn: parent; text: qsTr("No articles available"); }
-        Image { id: loadingImage; anchors.centerIn: parent; source: "common/images/loading.png";
-            height: 96; width: 96;
-            NumberAnimation on rotation {
-                from: 0; to: 360; running: (loadingImage.visible == true); loops: Animation.Infinite; duration: 900
-            }
+        Text {
+            id: noText; color: "#ffffff"; anchors.centerIn: parent; text: qsTr("No articles available");
+            font.pixelSize: settings.mainTextSize
+        }
+
+        BusyIndicator {
+                     id: loadingIndicator
+                     anchors.centerIn: parent;
+                     running: visible
+                     visible: false
+                     platformStyle: BusyIndicatorStyle { size: "large" }
+        }
+
+        MouseArea {
+            // Disable clicks when this item is visible
+            anchors.fill: parent
+            enabled: parent.visible
         }
 
         states: [ State {
@@ -96,14 +126,21 @@ Item {
             PropertyChanges { target: loadingImage; visible: false; }
             PropertyChanges { target: noText; visible: true; }
             }, State {
-            name: "loading"; when: articles.count==0 && articles.status != XmlListModel.Ready
+            name: "loading"; when: articles.status != XmlListModel.Ready
             PropertyChanges { target: noArticle; visible: true; }
             PropertyChanges { target: noText; visible: false; }
-            PropertyChanges { target: loadingImage; visible: true; }
+            PropertyChanges { target: loadingIndicator; visible: true; }
             }
         ]
     }
 
+    Rectangle {
+        id: reloading
+        visible: articles.status != XmlListModel.Ready
+
+
+    }
+
     Component {
             id: listing;
 
@@ -123,11 +160,12 @@ Item {
                     width: listItem.width - 6;
 
                     anchors.margins: 5
-                    verticalAlignment: Text.AlignVCenter; text: title;
+                    verticalAlignment: Text.AlignVCenter;
+                    text: title;
                     color: (unread=="True") ? settings.mainTextColour : settings.secondaryTextColour;
 
                      wrapMode: Text.WordWrap; font.bold: false;
-                    font.pointSize: 18
+                    font.pixelSize: settings.mainTextSize
                 }
                 MouseArea { anchors.fill: listItem;
                     onClicked: { articleView.positionViewAtIndex(index, ListView.Contain); articleView.visible = true; }
@@ -142,7 +180,7 @@ Item {
             id: flipItem;
             width: articleViewer.width; height: articleViewer.height;
 
-            property string url: (articleView.visible && Math.abs(articleView.currentIndex-index)<2) ? path: "";
+            //property string url: (articleView.visible && Math.abs(articleView.currentIndex-index)<2) ? path: "";
             property string html: controller.getArticle(articleViewer.feedid, articleid)
             ArticleDisplay {
                 zoomEnabled: articleViewer.zoomEnabled;
@@ -154,15 +192,10 @@ Item {
                     StateChangeScript {
                         name: "myScript"
                         script: {
-                            flipItem.url=path;
+                            //flipItem.url=path;
                             controller.setEntryRead(articleViewer.feedid, articleid)
                         }
                     }
-                    }, State {
-                        name: 'articleIsClose'; when: articleView.visible && Math.abs(articleView.currentIndex-index)<2;
-                        StateChangeScript {
-                            script: { flipItem.url=path; }
-                        }
                     }
                 ]
             }
@@ -182,5 +215,4 @@ Item {
         XmlRole { name: "unread"; query: "unread/string()"; isKey: true}
     }
 
-
 }
index 4469ba1..be7205e 100644 (file)
@@ -1,4 +1,5 @@
 import Qt 4.7
+import com.nokia.meego 1.0
 
 Item {
 //    anchors.fill: parent;
@@ -15,7 +16,20 @@ Item {
 
     ListView {
         id: categoryList; model: categories; delegate: categoryDelegate; z: 6;
-        cacheBuffer: 100; width: parent.width; height: parent.height;
+        cacheBuffer: 100; width: parent.width;
+        height: updateBarFeeds.visible? parent.height-updateBarFeeds.height : parent.height;
+        clip: true
+        /*height: parent.height;*/
+    }
+
+    ProgressBar {
+        id: updateBar
+        minimumValue: 0
+        maximumValue: 100
+        value: window.updateProgressValue
+        visible: window.isUpdateInProgress
+        anchors.bottom: parent.bottom
+        width: parent.width
     }
 
     XmlListModel {
index 8df8c5e..318faa1 100644 (file)
@@ -1,4 +1,5 @@
 import Qt 4.7
+import com.nokia.meego 1.0
 
 Item {
     property string catid : parent.catid
@@ -19,9 +20,21 @@ Item {
 
     ListView {
         id: feedList; model: feeds; delegate: feedDelegate; z: 6
-        width: parent.width; height: parent.height; /*x: 0;*/
+        width: parent.width; height: updateBarFeeds.visible? parent.height-updateBarFeeds.height : parent.height; /*x: 0;*/
         cacheBuffer: 100;
         flickDeceleration: 1500
+        clip: true
+    }
+
+    ProgressBar {
+        id: updateBarFeeds
+        minimumValue: 0
+        maximumValue: 100
+        value: window.updateProgressValue
+        visible: window.isUpdateInProgress
+        anchors.bottom: parent.bottom
+        z: 8
+        width: parent.width
     }
 
     XmlListModel {
index 0ade188..6892179 100644 (file)
@@ -9,21 +9,38 @@ PageStackWindow {
     signal longPressFeed(string key)
     signal categoryReloadRequest()
     signal feedReloadRequest()
+    signal articlesReloadRequest()
     signal addFileSignal(string fullname, string filename)
 
     property string feedid
     property string catid
 
+    property bool isUpdateInProgress: false
+    property int updateProgressValue: 0
+
     function addFileNotification(fullname, filename) {
         window.addFileSignal(fullname,filename)
     }
 
     function updateStarted() {
         banner.show(qsTr("Update Started"))
+        updateProgressValue = 0
+        isUpdateInProgress = true
     }
 
     function updateFinished() {
+        categoryReloadRequest()
+        feedReloadRequest()
         banner.show(qsTr("Updated Completed"))
+        isUpdateInProgress = false
+    }
+
+    function updateProgress(total, completed) {
+        if (total>0) {
+            updateProgressValue = Math.round(100*completed/total);
+        } else {
+            updateProgressValue = 0
+        }
     }
 
     onLongPressFeed: {
@@ -72,7 +89,11 @@ PageStackWindow {
         id: myArticlesMenu
         visualParent: pageStack
         MenuLayout {
-            MenuItem { text: qsTr("Mark All As Read"); onClicked: controller.markAllAsRead(feedid); }
+            MenuItem { text: qsTr("Mark All As Read"); onClicked: {
+                    controller.markAllAsRead(feedid);
+                    articlesReloadRequest()
+                }
+            }
             MenuItem { text: qsTr("Update Feed"); onClicked: controller.updateFeed(feedid); }
             //MenuItem { text: qsTr("About FeedingIt"); onClicked: query.open(); }
         }
@@ -219,8 +240,8 @@ PageStackWindow {
                     onClicked: {
                         myArticlesMenu.close();
                         if (flipper.articleShown) {
-                            flipper.articleShown = false;
                             flipper.reload()
+                            flipper.articleShown = false;
                         } else {
                             window.feedReloadRequest();
                             pageStack.pop();
@@ -248,6 +269,10 @@ PageStackWindow {
                     onClicked: (myArticlesMenu.status == DialogStatus.Closed) ? myArticlesMenu.open() : myArticlesMenu.close()
                 }
             }
+            Connections {
+                 target: window
+                 onArticlesReloadRequest: flipper.reload()
+             }
         }
     }
 
index 9bc7a8a..773753b 100644 (file)
@@ -1305,7 +1305,7 @@ class Listing(BaseObject):
         if wc().available ():
             try:
                 del wc()[key]
-            except KeyError:
+            except KeyError, woodchuck.Error:
                 logger.debug("Removing unregistered feed %s failed" % (key,))
 
         rank = self.db.execute("SELECT rank FROM feeds WHERE id=?;", (key,) ).fetchone()[0]