psa: new icon, increased listing font size
[feedingit] / psa_harmattan / feedingit / deb_dist / feedingit-0.1.0 / debian / feedingit / usr / share / feedingit / qml / main.qml
index 2fda083..6e34573 100644 (file)
@@ -1,7 +1,6 @@
 import QtQuick 1.0
 import com.nokia.meego 1.0
 
-
 PageStackWindow {
     id: window
     initialPage: categoryPage
@@ -10,10 +9,39 @@ PageStackWindow {
     signal longPressFeed(string key)
     signal categoryReloadRequest()
     signal feedReloadRequest()
+    signal articlesReloadRequest()
+    signal addFileSignal(string fullname, string filename)
+
     property string feedid
     property string catid
 
-    Component.onCompleted: theme.inverted= true
+    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: {
         unsubscribeFeedMenu.key = key
@@ -41,9 +69,8 @@ PageStackWindow {
         id: myMenu
         visualParent: pageStack
         MenuLayout {
-            MenuItem { text: qsTr("Settings"); onClicked: {}  }
-            MenuItem { text: qsTr("Invert Theme"); onClicked: { theme.inverted = !theme.inverted }  }
-            MenuItem { text: qsTr("Add Feeds"); onClicked: { pageStack.push(addFeedPage)  } }
+            MenuItem { text: qsTr("Settings"); onClicked: {pageStack.push(settingsPage)}  }
+            MenuItem { text: qsTr("Manage Subscriptions"); onClicked: { pageStack.push(addFeedPage)  } }
             MenuItem { text: qsTr("Update All Categories"); onClicked: controller.updateAll(); }
             MenuItem { text: qsTr("About FeedingIt"); onClicked: query.open(); }
         }
@@ -62,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(); }
         }
@@ -126,7 +157,7 @@ PageStackWindow {
         id: query
         icon: "common/images/feedingit.png"
         titleText: "Feedingit RSS Reader"
-        message: "Version: 0.0.9"
+        message: "Version: n9-0.1.0"
         +"<br><br>FeedingIt RSS Reader.<br>"
         +"<br>&copy; 2011 feedingit.marcoz.org"
         +"<br>http://feedingit.marcoz.org"
@@ -176,6 +207,7 @@ PageStackWindow {
                 ToolIcon { iconId: "toolbar-back";
                     onClicked: {
                         myArticlesMenu.close();
+                        window.categoryReloadRequest()
                         pageStack.pop();
                     }
                 }
@@ -208,8 +240,8 @@ PageStackWindow {
                     onClicked: {
                         myArticlesMenu.close();
                         if (flipper.articleShown) {
-                            flipper.articleShown = false;
                             flipper.reload()
+                            flipper.articleShown = false;
                         } else {
                             window.feedReloadRequest();
                             pageStack.pop();
@@ -225,6 +257,15 @@ PageStackWindow {
                 }
 
                 ToolIcon {
+                    platformIconId: "toolbar-share"
+                    visible: flipper.articleShown
+                    //anchors.right: (parent === undefined) ? undefined : parent.right
+                    onClicked: {
+                        controller.share(window.feedid, flipper.getCurrentArticleId());
+                    }
+                }
+
+                ToolIcon {
                     platformIconId: "toolbar-next"
                     visible: flipper.articleShown
                     //anchors.right: (parent === undefined) ? undefined : parent.right
@@ -237,15 +278,98 @@ PageStackWindow {
                     onClicked: (myArticlesMenu.status == DialogStatus.Closed) ? myArticlesMenu.open() : myArticlesMenu.close()
                 }
             }
+            Connections {
+                 target: window
+                 onArticlesReloadRequest: flipper.reload()
+             }
         }
     }
 
     Component {
         id: addFeedPage
-        AddFeed {}
+        AddFeed {
+            id: addFeedItem
+
+            Connections {
+                 target: window
+                 onAddFileSignal: addFeedItem.addFileToDialog(fullname, filename)
+             }
+        }
+    }
+
+    Component {
+        id: settingsPage
+        SettingsPage {
+            id: settingsItem
+            tools: commonTools
+        }
     }
 
     Settings {
         id: settings
     }
+
+    Rectangle {
+        id: banner
+        x: 10
+        width: parent.width - 20
+        height: bannerText.height + 20
+        y: 50
+        z:8
+
+        visible: false
+        radius: 4
+        border.color: "white"
+        color: "black"
+
+        Text {
+            id: bannerText
+            anchors.centerIn: parent
+            font.pixelSize: 24
+            //text: "Test"
+            color: "white"
+            wrapMode: Text.WordWrap;
+        }
+
+        Timer {
+            id: bannerTimer
+            interval: 3000
+            repeat: false
+            running: false
+            onTriggered: banner.visible = false
+        }
+
+        function show(str) {
+            bannerText.text = str;
+            banner.visible = true
+            bannerTimer.start()
+        }
+
+        MouseArea {
+            anchors.fill: parent
+            onClicked: {
+                bannerTimer.stop()
+                banner.visible= false
+            }
+        }
+
+        //text: "This is an info banner with no icon"
+    }
+
+    Item {
+        AutomaticUpdate {
+            id: autoUpdate
+        }
+
+        Connections {
+            target: settings
+            onAutoUpdateEnabledChanged: {
+                if (!settings.autoUpdateEnabled) {
+                    autoUpdate.stop();
+                } else {
+                    autoUpdate.start();
+                }
+            }
+        }
+    }
 }