import QtQuick 1.1 import com.nokia.symbian 1.1 import "settings.js" as Settings PageStackWindow { id: appWindow property bool showCategories Page { id: mainPage tools: mainTools ToolBarLayout { id: mainTools ToolButton { iconSource: "toolbar-back" anchors.left: (parent === undefined) ? undefined : parent.left onClicked: appWindow.pageStack.depth <= 1 ? Qt.quit() : appWindow.pageStack.pop() } ToolButton { iconSource: "toolbar-view-menu" anchors.right: (parent === undefined) ? undefined : parent.right onClicked: (myMenu.status === DialogStatus.Closed) ? myMenu.open() : myMenu.close() } } function load() { mainLoader.source = (appWindow.width / appWindow.height > 1.5) ? "MainPageLandscape.qml" : "MainPagePortrait.qml" } Connections { target: appWindow onWidthChanged: { mainPage.load() } onHeightChanged: { mainPage.load() } } Loader {id: mainLoader; anchors.fill: parent;} onStatusChanged: { if (status == PageStatus.Activating) { activatingAnimation.start() } } SequentialAnimation { id: activatingAnimation running: false NumberAnimation { target:mainPage; property:"opacity"; from: 0; to: 1; duration:500 } } } SettingsPage { id: programSettings showCategoryIds: showCategories ? true : false onSaveSettings: { Settings.setSetting("showCategories", (programSettings.showCategoryIds ? "show" : "hide")); } } Page { id: helpPage tools: commonTools function load() { helpLoader.source = "HelpPage.qml" } Loader {id: helpLoader; anchors.fill: parent;} } Page { id: aboutPage tools: commonTools ToolBarLayout { id: commonTools ToolButton { iconSource: "toolbar-back" anchors.left: (parent === undefined) ? undefined : parent.left onClicked: pageStack.pop(); } ToolButton { iconSource: "toolbar-view-menu" anchors.right: (parent === undefined) ? undefined : parent.right onClicked: (myMenu.status === DialogStatus.Closed) ? myMenu.open() : myMenu.close() } } function load() { aboutLoader.source = "AboutPage.qml" } Loader {id: aboutLoader; anchors.fill: parent;} } Menu { id: myMenu visualParent: pageStack MenuLayout { MenuItem { text: "Настройки" onClicked: { pageStack.push(programSettings) } } MenuItem { text: "Справка" onClicked: { myMenu.close(); helpPage.load(); pageStack.push(helpPage); } } MenuItem { text: "О программе" onClicked: { myMenu.close(); aboutPage.load(); pageStack.push(aboutPage); } } MenuItem { text: "Другие приложения" onClicked: { Qt.openUrlExternally("http://store.ovi.com/publisher/FRUCT") } } } } Image { id: splashImage anchors.fill: parent source: "qrc:/gfx/splash-portrait.png" SequentialAnimation { id:splashanimation PauseAnimation { duration: 3000 } PropertyAnimation { target: splashImage duration: 700 properties: "opacity" to: 0 } } } Component.onCompleted: { splashanimation.start() mainPage.load() pageStack.push(mainPage) Settings.initialize() // show or hide categories ids on thumbnails var categoriesSetting = Settings.getSetting('showCategories') if (categoriesSetting == 'show') showCategories = true; else showCategories = false; } }