Commit c9bf0b77 authored by Dennis Nienhüser's avatar Dennis Nienhüser

Remove unused marble-touch and QML 1 relicts from declarative library

Might still be useful to implement some stuff in marble-maps, but
having it in git history seems enough for now.
parent f8c0c191
......@@ -4,9 +4,6 @@ if(BUILD_MARBLE_APPS)
add_subdirectory(marble-ui)
add_subdirectory(marble-qt)
add_subdirectory(marble-kde)
if( Qt5Quick_FOUND )
add_subdirectory(marble-touch)
endif( Qt5Quick_FOUND )
endif()
add_subdirectory(behaim)
......
This diff is collapsed.
// This file is part of the Marble Virtual Globe.
//
// This program is free software licensed under the GNU LGPL. You can
// find a copy of this license in LICENSE.txt in the top directory of
// the source code.
//
// Copyright 2011 Dennis Nienhüser <nienhueser@kde.org>
// Copyright 2011 Daniel Marth <danielmarth@gmx.at>
import QtQuick 2.3
import org.kde.edu.marble 0.20
/*
* Page to select activity. This component also contains the model for
* the activities, which stores all relevant information.
*/
Item {
id: activityPage
Item {
id: pageContainer
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: changelog.visible ? changelog.top : parent.bottom
visible: true
Rectangle {
anchors.fill: parent
color: "black"
}
Loader {
id: pageLoader
anchors.fill: parent
}
}
property alias model: activityView.model
property bool shown: false
signal itemSelected
Loader {
id: lazyLoader
}
Image {
anchors.bottom: parent.bottom
anchors.right: parent.right
anchors.margins: 20
source: "qrc:/marble/globe.svg"
smooth: true
width: 360
height: 360
opacity: 0.1
}
// Grid view to display images and names of activities.
ListView {
id: activityView
currentIndex: -1
anchors.top: parent.top
anchors.topMargin: 4
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: changelog.visible ? changelog.top : parent.bottom
//anchors.margins: 9
//anchors.leftMargin: 2
model: activityModel
focus: true
clip: true
spacing: 3
width: parent.width
height: parent.height
delegate:
Item {
id: delegateItem
property bool mouseOver: mouseTracker.containsMouse
width: activityView.width
height: 47
Rectangle {
color: delegateItem.mouseOver ? "#dddddd" : "white"
radius: 10
anchors.fill: parent
Row {
anchors.verticalCenter: parent.verticalCenter
spacing: 5
width: 140
height: parent.height
smooth: true
Item {
width: 2
height: parent.height
}
Image {
id: activityImage
anchors.verticalCenter: parent.verticalCenter
height: 36
width: height
source: imagePath
smooth: true
}
Text {
anchors.verticalCenter: parent.verticalCenter
color: delegateItem.mouseOver ? "#111111" : "black"
text: name
width: 180
font.bold: true
}
}
MouseArea {
id: mouseTracker
anchors.fill: parent
hoverEnabled: true
}
}
MouseArea {
anchors.fill: parent
onClicked: {
activityPage.itemSelected()
activityPage.openActivity( name, path )
}
}
}
}
Text {
id: changelog
anchors.bottom: parent.bottom
anchors.left: parent.left
anchors.right: parent.right
anchors.margins: 10
font.pixelSize: 16
visible: settings.changelogShown !== project.version
color: "white"
text: "New in version " + project.changelog.get(0).version + ": " + project.changelog.get(0).summary
MarbleTouch { id: project }
MouseArea {
anchors.fill: parent
onClicked: openActivity( "qrc:/AboutMarblePage.qml" )
}
}
// Model that stores information about activities.
ListModel {
id: activityModel
property string configureIcon: main.icon( "actions/configure", 48 );
ListElement {
name: "Virtual Globe"
imagePath: "qrc:/icons/activity-virtualglobe.png"
path: "qrc:/activities/VirtualGlobe.qml"
}
ListElement {
name: "Search"
imagePath: "qrc:/icons/activity-search.png"
path: "qrc:/activities/Search.qml"
}
ListElement {
name: "Routing"
imagePath: "qrc:/icons/activity-routing.png"
path: "qrc:/activities/Routing.qml"
}
ListElement {
name: "Tracking"
imagePath: "qrc:/icons/activity-tracking.png"
path: "qrc:/activities/Tracking.qml"
}
ListElement {
name: "Navigation"
imagePath: "qrc:/icons/activity-navigation.png"
path: "qrc:/activities/Navigation.qml"
}
ListElement {
name: "Weather"
imagePath: "qrc:/icons/activity-weather.png"
path: "qrc:/activities/Weather.qml"
}
ListElement {
name: "Community"
imagePath: "qrc:/icons/activity-friends.png"
path: "qrc:/activities/Friends.qml"
}
ListElement {
name: "Space View"
imagePath: "qrc:/icons/activity-spaceview.png"
path: "qrc:/activities/SpaceView.qml"
}
ListElement {
name: "Explore"
imagePath: "qrc:/icons/activity-explore.png"
path: "qrc:/activities/Explore.qml"
}
ListElement {
name: "Info"
imagePath: "qrc:/icons/information.png"
path: "qrc:/AboutMarblePage.qml"
}
ListElement {
name: "Preferences"
imagePath: "qrc:/icons/preferences.png"
path: "qrc:/PreferencesPage.qml"
}
}
function openActivity( name ) {
for ( var i=0; i<activityModel.count; i++ ) {
if ( activityModel.get(i).name === name ) {
switchTo( name, activityModel.get(i).path )
return
}
}
}
function showActivities()
{
pageContainer.visible = false
pageLoader.source = ""
activityView.visible = true
activityPage.shown = true
}
function switchTo( name, path ) {
if ( marbleWidget === null ) {
lazyLoader.source = "qrc:/MainWidget.qml";
marbleWidget = lazyLoader.item
}
settings.lastActivity = name
//pageStack.replace( path, undefined, true )
pageLoader.source = path
pageContainer.visible = true
activityView.visible = false
activityPage.shown = false
}
Timer {
id: loadTimer
interval: 50; running: false; repeat: false
onTriggered: activityPage.initialize()
}
function initializeDelayed() {
if ( marbleWidget === null ) {
loadTimer.running = true
}
}
function initialize() {
if ( marbleWidget === null ) {
lazyLoader.source = "qrc:/MainWidget.qml";
marbleWidget = lazyLoader.item
}
}
}
PROJECT( marble-touch )
INCLUDE_DIRECTORIES(
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
)
set( my_SRCS
main.cpp
)
FILE (GLOB QML_FILES *.qml activities/*.qml)
marble_add_project_resources(${QML_FILES})
qt_add_resources(my_SRCS meego.qrc)
add_executable( marble-touch ${my_SRCS} )
target_link_libraries (
marble-touch
Qt5::Widgets
Qt5::Network
Qt5::WebKitWidgets
${MARBLEWIDGET}
marbledeclarative
)
// This file is part of the Marble Virtual Globe.
//
// This program is free software licensed under the GNU LGPL. You can
// find a copy of this license in LICENSE.txt in the top directory of
// the source code.
//
// Copyright 2013 Andrei Duma <andrei.duma.dorian@gmail.com>
import QtQuick 2.3
import QtMultimediaKit 1.1
import com.nokia.meego 1.0
import org.kde.edu.marble 0.20
Page {
id: cloudSyncPage
tools: ToolBarLayout {
MarbleToolIcon {
iconSource: main.icon( "actions/go-previous-view", 48 );
onClicked: pageStack.pop()
}
}
Row {
id: syncSetting
anchors.top: parent.top
anchors.left: parent.left
anchors.margins: 10
Label {
id: syncLabel
width: 142
text: "Sync:"
anchors.verticalCenter: parent.verticalCenter
}
Switch {
id: syncSwitch
checked: settings.owncloudSync
anchors.verticalCenter: parent.verticalCenter
onCheckedChanged: settings.owncloudSync = checked
}
}
Rectangle {
width: parent.width
anchors.left: parent.left
anchors.top: syncSetting.bottom
anchors.right: parent.right
anchors.margins: 10
Column {
id: labelsColumn
width: 140
spacing: 35
anchors.top: parent.top
anchors.topMargin: 12
Label {
text: "Server:"
}
Label {
text: "Username:"
}
Label {
text: "Password:"
}
}
Column {
anchors.left: labelsColumn.right
anchors.right: parent.right
spacing: 10
TextField {
text: settings.owncloudServer
width: parent.width
readOnly: !syncSwitch.checked
onAccepted: settings.owncloudServer = text
}
TextField {
text: settings.owncloudUsername
width: parent.width
readOnly: !syncSwitch.checked
onAccepted: settings.owncloudUsername = text
}
TextField {
text: settings.owncloudPassword
echoMode: TextInput.Password
width: parent.width
readOnly: !syncSwitch.checked
onAccepted: settings.owncloudPassword = text
}
}
}
}
This diff is collapsed.
// This file is part of the Marble Virtual Globe.
//
// This program is free software licensed under the GNU LGPL. You can
// find a copy of this license in LICENSE.txt in the top directory of
// the source code.
//
// Copyright 2012 Dennis Nienhüser <nienhueser@kde.org>
import QtQuick 2.3
import org.kde.edu.marble 0.20
import QtQuick.Controls 1.4
import QtQuick.Layouts 1.2
Item {
id: preferencesPage
RowLayout {
id: toolBar
anchors.fill: parent
ToolButton {
text: "Home"
onClicked: activitySelection.showActivities()
}
}
NewstuffModel {
id: themeInstallModel
provider: "http://edu.kde.org/marble/newstuff/maps-4.5.xml"
registryFile: "~/.kde/share/apps/knewstuff3/marble.knsregistry"
}
ListView {
id: themeView
anchors.fill: parent
anchors.margins: 5
model: themeInstallModel
delegate: themeDelegate
highlight: Rectangle { radius: 5; color: "lightsteelblue" }
highlightMoveDuration: 200
spacing: 10
currentIndex: -1
}
Component {
id: themeDelegate
Item {
id: delegateRoot
width: parent.width
height: row.height
property bool installing: transitioning
property bool selected: ListView.view.currentIndex === idx
property bool showDetails: selected || installing
property int idx: index
Row {
id: row
spacing: 10
Item {
width: previewIcon.width
height: Math.max(previewIcon.height + (delegateRoot.showDetails ? versionLabel.height + 5 : 0), textItem.height)
Image {
id: previewIcon
anchors.top: parent.top
source: settings.workOffline ? "" : preview
width: 136
height: 136
Image {
id: fallbackIcon
anchors.centerIn: parent
source: "qrc:/icons/activity-virtualglobe.png"
width: 128
height: 128
opacity: (previewIcon.status == Image.Loading || settings.workOffline) ? 1.0 : 0.0
Behavior on opacity { NumberAnimation {} }
}
}
Label {
id: versionLabel
width: parent.width
anchors.top: previewIcon.bottom
anchors.topMargin: 5
visible: delegateRoot.showDetails
text: delegateRoot.showDetails ? "<p><font size=\"-1\">Version: " + version + "<br />" + releasedate + "<br />" + formatSize() + "</font></p>" : ""
function formatSize() {
if (settings.workOffline) {
return ""
}
var length = size
if (length<0) {
return ""
}
var unit = 0
for (var i=0; i<9 && length >= 1000; ++i) {
length /= 1000.0
++unit
}
switch (unit) {
case 0: return length.toFixed(1) + " byte"
case 1: return length.toFixed(1) + " kB"
case 2: return length.toFixed(1) + " MB"
case 3: return length.toFixed(1) + " GB"
case 4: return length.toFixed(1) + " TB"
case 5: return length.toFixed(1) + " PB"
case 6: return length.toFixed(1) + " EB"
case 7: return length.toFixed(1) + " ZB"
case 8: return length.toFixed(1) + " YB"
}
}
}
}
Item {
id: textItem
width: delegateRoot.width - row.spacing - previewIcon.width - 10
height: nameLabel.height + summaryLabel.height + (delegateRoot.showDetails ? installButton.height + 10 : 0)
Label {
id: nameLabel
width: parent.width
text: display
font.bold: upgradable
}
Label {
id: summaryLabel
width: parent.width
anchors.top: nameLabel.bottom
property string details: "<p><font size=\"-1\">Author: " + author + "</font></p><p><font size=\"-1\">License: " + license + "</font></p>"
text: "<p><font size=\"-1\">" + summary + (delegateRoot.showDetails ? details : "") + "</font></p>"
}
ProgressBar {
id: progressBar
visible: delegateRoot.installing
anchors.top: summaryLabel.bottom
width: parent.width - 50
anchors.margins: 20
minimumValue: 0.0
maximumValue: 1.0
indeterminate: true
Connections {
target: themeInstallModel
onInstallationProgressed: {
if (newstuffindex === delegateRoot.idx) {
progressBar.indeterminate = false
progressBar.value = progress
}
}
onInstallationFinished: {
if (newstuffindex === delegateRoot.idx) {
delegateRoot.installing = false
}
}
onInstallationFailed: {
if (newstuffindex === delegateRoot.idx) {
delegateRoot.installing = false
}
}
onUninstallationFinished: {
if (newstuffindex === delegateRoot.idx) {
delegateRoot.installing = false
}
}
}
}
MouseArea {
anchors.fill: parent
onClicked: delegateRoot.ListView.view.currentIndex = delegateRoot.idx
}
ToolButton {
anchors.left: progressBar.right
anchors.leftMargin: 5
anchors.verticalCenter: progressBar.verticalCenter
visible: delegateRoot.installing
width: 40
iconSource: main.icon( "actions/dialog-cancel", 32 );
onClicked: {
progressBar.indeterminate = true
themeInstallModel.cancel(delegateRoot.idx)
}
}
Button {
id: installButton
text: installed && upgradable ? "Upgrade" : "