psa: using 2 flickables
[feedingit] / psa_harmattan / feedingit / deb_dist / feedingit-0.1.0 / debian / feedingit / usr / share / feedingit / qml / main.qml
index 6e34573..0b47445 100644 (file)
@@ -12,6 +12,7 @@ PageStackWindow {
     signal articlesReloadRequest()
     signal addFileSignal(string fullname, string filename)
 
+    property string articleid
     property string feedid
     property string catid
 
@@ -197,7 +198,7 @@ PageStackWindow {
                 id: feedsItem
                 onFeedClicked: {
                     window.feedid = feedid
-                    pageStack.push(articlesPage)
+                    pageStack.push(articlesListPage)
                 }
 
             }
@@ -225,63 +226,93 @@ PageStackWindow {
     }
 
     Component {
-        id: articlesPage
+        id: articlesListPage
         Page {
-            tools: articleTools
+            tools: articleListTools
             property string feedid: window.feedid
+
             ArticleViewer {
                 id: flipper
+
+                onOpenArticle: {
+                    window.articleid = articleid
+                    pageStack.push(articleViewPage)
+                }
             }
 
             ToolBarLayout {
-                id: articleTools
+                id: articleListTools
                 visible: false
                 ToolIcon { iconId: "toolbar-back";
                     onClicked: {
                         myArticlesMenu.close();
-                        if (flipper.articleShown) {
-                            flipper.reload()
-                            flipper.articleShown = false;
-                        } else {
-                            window.feedReloadRequest();
-                            pageStack.pop();
-                        }
+                        window.feedReloadRequest();
+                        pageStack.pop();
+                    }
+                }
+
+                ToolIcon {
+                    platformIconId: "toolbar-view-menu"
+                    anchors.right: (parent === undefined) ? undefined : parent.right
+                    onClicked: (myArticlesMenu.status == DialogStatus.Closed) ? myArticlesMenu.open() : myArticlesMenu.close()
+                }
+            }
+            Connections {
+                 target: window
+                 onArticlesReloadRequest: flipper.reload()
+             }
+        }
+    }
+
+    Component {
+        id: articleViewPage
+        Page {
+            tools: articleTools
+            property string feedid: window.feedid
+
+
+            Articles {
+                id: articlePage
+                property string mainArticleId: window.articleid;
+            }
+
+            ToolBarLayout {
+                id: articleTools
+                visible: false
+                ToolIcon { iconId: "toolbar-back";
+                    onClicked: {
+                        window.articlesReloadRequest();
+                        pageStack.pop();
                     }
                 }
 
                 ToolIcon {
                     platformIconId: "toolbar-previous"
-                    visible: flipper.articleShown
-                    //anchors.right: (parent === undefined) ? undefined : parent.right
-                    onClicked: flipper.prev();
+                    onClicked: articlePage.prev();
                 }
 
                 ToolIcon {
                     platformIconId: "toolbar-share"
-                    visible: flipper.articleShown
-                    //anchors.right: (parent === undefined) ? undefined : parent.right
                     onClicked: {
-                        controller.share(window.feedid, flipper.getCurrentArticleId());
+                        controller.share(window.feedid, articlePage.mainArticleId);
                     }
                 }
 
                 ToolIcon {
                     platformIconId: "toolbar-next"
-                    visible: flipper.articleShown
-                    //anchors.right: (parent === undefined) ? undefined : parent.right
-                    onClicked: flipper.next()
+                    onClicked: articlePage.next()
                 }
 
-                ToolIcon {
-                    platformIconId: "toolbar-view-menu"
-                    anchors.right: (parent === undefined) ? undefined : parent.right
-                    onClicked: (myArticlesMenu.status == DialogStatus.Closed) ? myArticlesMenu.open() : myArticlesMenu.close()
-                }
+//                ToolIcon {
+//                    platformIconId: "toolbar-view-menu"
+//                    anchors.right: (parent === undefined) ? undefined : parent.right
+//                    onClicked: (myArticlesMenu.status == DialogStatus.Closed) ? myArticlesMenu.open() : myArticlesMenu.close()
+//                }
             }
-            Connections {
-                 target: window
-                 onArticlesReloadRequest: flipper.reload()
-             }
+//            Connections {
+//                 target: window
+//                 onArticlesReloadRequest: flipper.reload()
+//             }
         }
     }
 
@@ -356,20 +387,20 @@ PageStackWindow {
         //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();
-                }
-            }
-        }
-    }
+//    Item {
+//        AutomaticUpdate {
+//            id: autoUpdate
+//        }
+
+//        Connections {
+//            target: settings
+//            onAutoUpdateEnabledChanged: {
+//                if (!settings.autoUpdateEnabled) {
+//                    autoUpdate.stop();
+//                } else {
+//                    autoUpdate.start();
+//                }
+//            }
+//        }
+//    }
 }