/**************************************************************************** ** ** Copyright (C) 2011 Nokia Institute of Technology. ** All rights reserved. ** Contact: Manager (renato.chencarek@openbossa.org) ** ** This file is part of the Incredible Circus project. ** ** GNU Lesser General Public License Usage ** ** This file may be used under the terms of the GNU Lesser General Public ** License version 2.1 as published by the Free Software Foundation and ** appearing in the file LICENSE.LGPL included in the packaging of this ** file. Please review the following information to ensure the GNU Lesser ** General Public License version 2.1 requirements will be met: ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ****************************************************************************/ import QtQuick 1.1 import "widgets" Item { id: root signal nextClicked() signal backClicked() signal achievementsClicked() property alias currentIndex: carousel.currentIndex function updateStars() { carousel.updateStars() } Image { anchors { top: parent.top horizontalCenter: parent.horizontalCenter topMargin: 26 * scaleFactor } source: "image://cache/common/circus_title.png" } Frame { id: frame background: "image://cache/common/frameback.png" anchors { verticalCenter: parent.verticalCenter horizontalCenter: parent.horizontalCenter } Carousel { id: carousel anchors.fill: parent model: manager.worlds onClicked: { var world = manager.worlds[currentIndex]; if (world.url != "") { // v1.2 - Full Game Soon if (world.url == "none") return; Qt.openUrlExternally(world.url); return; } if (!world.locked) { manager.currentWorld = world; root.nextClicked(); } } onCurrentIndexChanged: { if (currentIndex >= 0) { var obj = manager.worlds[currentIndex]; frame.title = obj.circusName; root.updateStars() if (currentIndex > 0) { if (manager.worlds[currentIndex].locked && manager.isBronzeStarsComplete(currentIndex - 1)) manager.worlds[currentIndex].unlock(); } } } } Image { anchors { left: parent.left verticalCenter: parent.verticalCenter leftMargin: -6 * scaleFactor } source: "image://cache/common/frame_shadow_left.png" } Image { anchors { right: parent.right verticalCenter: parent.verticalCenter rightMargin: -6 * scaleFactor } source: "image://cache/common/frame_shadow_right.png" } } BottomBar { Button { id: btBack text: qsTr("Back") onClicked: root.backClicked() } ImageButton { visible: achievements != null source: "image://cache/buttons/bt_achievements.png" onClicked: { achievements.load(); // loading/updating achievements list root.achievementsClicked(); } } } }