1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798 |
- /****************************************************************************
- **
- ** Copyright (C) 2012 Róbert Márki
- **
- ** This file is part of Web Feeds.
- **
- ** Web Feeds is free software: you can redistribute it and/or modify
- ** it under the terms of the GNU General Public License as published by
- ** the Free Software Foundation, either version 3 of the License, or
- ** (at your option) any later version.
- **
- ** Web Feeds 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 General Public License for more details.
- **
- ** You should have received a copy of the GNU General Public License
- ** along with Web Feeds. If not, see <http://www.gnu.org/licenses/>.
- ****************************************************************************/
- import QtQuick 1.1
- import com.nokia.meego 1.0
- import com.nokia.extras 1.1
- import WebFeeds 1.0
- import GoogleReader 1.0
- import "../../../../shared/qml/UIConstants.js" as UIConstants
- import "../../../../shared/qml" as Shared
- import "../delegates" as Delegates
- import "../misc" as Misc
- import "../buttons" as Buttons
- Shared.CommonPage {
- id: root
- property variant service: root.rootItem.service
- property bool __serviceBusy: service ? service.busy : false
- property bool userInteractionEnabled: !root.__serviceBusy && !(root.pageStack && root.pageStack.busy)
- && ((root.rootItem != null) && !root.rootItem.editingBusy)
- contentsBusy: root.__serviceBusy
- function pageForItem(item) {
- var itemType = item.itemType;
- if(itemType == GoogleReaderItem.ItFolderItem)
- return "/plugins/google_reader/qml/pages/FolderPage.qml";
- else if((itemType == GoogleReaderItem.ItFeedItem)
- || (itemType == GoogleReaderItem.ItEverythingTagItem)
- || (itemType == GoogleReaderItem.ItStarredTagItem)
- || (itemType == GoogleReaderItem.ItTagItem))
- return "/plugins/google_reader/qml/pages/FeedPage.qml";
- else if(itemType == GoogleReaderItem.ItStoryItem)
- return "/plugins/google_reader/qml/pages/StoryPage.qml";
- else
- return "";
- }
- Component {
- id: delegateComponent
- Delegates.GoogleReaderPageListDelegate {
- service: root.rootItem.service;
- onReleased: {
- createPageForItem(listPageContents.itemForRow(row));
- }
- onHolded: showContextMenuForItem(listPageContents.itemForRow(row));
- }
- }
- contents: Shared.CommonListPageContents {
- id: listPageContents
- rootItem: root.rootItem
- rootIndex: webFeedsApp.pageItemModel.index(root.rootItem);
- busy: root.contentsBusy
- emptyListText: qsTr("No subscriptions")
- pageHeader: Shared.CommonPageHeader {
- titleText: root.rootItem.title
- subTitleColor: UIConstants.HEADER_SUBTITLE_COLOR
- titleColor: "white"
- backgrounColor: UIConstants.HIGHLIGHT_COLOR
- titleFont: UIConstants.FONT_FAMILY_LIGHT
- rightHelperItem: Misc.HeaderCountBubble {
- busy: root.rootItem.busy
- unreadCount: root.rootItem.unreadCount
- limit: service.unreadCountLimit
- }
- Shared.Separator {
- id: separator
- anchors.bottom: parent.bottom
- }
- }
- cacheBuffer: UIConstants.DEFAULT_DELEGATE_HEIGHT * 64
- delegate: delegateComponent
- }
- tools: Shared.CommonToolBarLayout {
- enabled: root.userInteractionEnabled
- Shared.BackToolButton {pageItem: root.rootItem; page: root}
- Buttons.MarkEverythingAsReadToolButton {pageItem: root.rootItem}
- Buttons.AddFeedToolButton {pageItem: root.rootItem;}
- Shared.MenuToolButton {pageItem: root.rootItem; page: root}
- }
- }
|