summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFriedrich W. H. Kossebau <kossebau@kde.org>2016-08-06 14:12:58 (GMT)
committerFriedrich W. H. Kossebau <kossebau@kde.org>2016-08-06 15:32:14 (GMT)
commitcf4f8af7476b725aacf32f9443c0e971e8b08ab8 (patch)
tree4e190bb8a5899c4a1f9c9af0b62113002c0a9ef2
parent5752f751d64fa31515610115951c1127377a9a6f (diff)
Initial rewrite of worldclock plasmoid and a new worldmap plasma "wallpaper"
Summary: * installs a plasma-specific marble qml plugin in a private namespace * exposes the property "radius" on MarbleQuickItem * removes unused, but now conflicting Q_PLUGIN_METADATA macro from MarbleDeclarativePlugin (which is currently only part of a shared lib) * some features of old worldclock plasmoid still TODO: * support for timezones * setting a lat/lon to center on Reviewers: rahn, sanjibanb, nienhueser, #marble Reviewed By: nienhueser, #marble Differential Revision: https://phabricator.kde.org/D2354
-rw-r--r--src/CMakeLists.txt4
-rw-r--r--src/lib/marble/declarative/MarbleDeclarativePlugin.h3
-rw-r--r--src/lib/marble/declarative/MarbleQuickItem.cpp11
-rw-r--r--src/lib/marble/declarative/MarbleQuickItem.h4
-rw-r--r--src/plasma/CMakeLists.txt17
-rw-r--r--src/plasma/applets/CMakeLists.txt1
-rw-r--r--src/plasma/applets/worldclock/CMakeLists.txt1
-rw-r--r--src/plasma/applets/worldclock/Messages.sh2
-rw-r--r--src/plasma/applets/worldclock/package/contents/config/config.qml36
-rw-r--r--src/plasma/applets/worldclock/package/contents/config/main.xml40
-rw-r--r--src/plasma/applets/worldclock/package/contents/ui/configMapDisplay.qml72
-rw-r--r--src/plasma/applets/worldclock/package/contents/ui/configTimeZones.qml42
-rw-r--r--src/plasma/applets/worldclock/package/contents/ui/main.qml127
-rw-r--r--src/plasma/applets/worldclock/package/metadata.desktop21
-rw-r--r--src/plasma/qmlplugin/CMakeLists.txt16
-rw-r--r--src/plasma/qmlplugin/qmldir2
-rw-r--r--src/plasma/qmlplugin/qmlplugin.cpp18
-rw-r--r--src/plasma/qmlplugin/qmlplugin.h35
-rw-r--r--src/plasma/wallpapers/CMakeLists.txt1
-rw-r--r--src/plasma/wallpapers/worldmap/Messages.sh2
-rw-r--r--src/plasma/wallpapers/worldmap/contents/config/main.xml18
-rw-r--r--src/plasma/wallpapers/worldmap/contents/ui/config.qml66
-rw-r--r--src/plasma/wallpapers/worldmap/contents/ui/main.qml72
-rw-r--r--src/plasma/wallpapers/worldmap/metadata.desktop13
24 files changed, 620 insertions, 4 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 509bed1..32d5813 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -71,8 +71,6 @@ if(APPLE)
add_subdirectory( mac )
endif(APPLE)
-# FIXME ktimezonewidget.h is gone
-#add_subdirectory( plasmoid )
-
+add_subdirectory( plasma )
add_subdirectory( plasmarunner )
add_subdirectory( thumbnailer )
diff --git a/src/lib/marble/declarative/MarbleDeclarativePlugin.h b/src/lib/marble/declarative/MarbleDeclarativePlugin.h
index 504276d..676021c 100644
--- a/src/lib/marble/declarative/MarbleDeclarativePlugin.h
+++ b/src/lib/marble/declarative/MarbleDeclarativePlugin.h
@@ -21,7 +21,8 @@
*/
class MARBLE_DECLARATIVE_EXPORT MarbleDeclarativePlugin : public QQmlExtensionPlugin
{
- Q_PLUGIN_METADATA(IID "org.kde.marble.MarbleDeclarativePlugin")
+ // Disabled for now while libmarbledeclarative is used as shared library
+ // Q_PLUGIN_METADATA(IID "org.kde.marble.MarbleDeclarativePlugin")
Q_OBJECT
public:
/** Overriding QQmlExtensionPlugin to register types */
diff --git a/src/lib/marble/declarative/MarbleQuickItem.cpp b/src/lib/marble/declarative/MarbleQuickItem.cpp
index df0e918..a2c72f5 100644
--- a/src/lib/marble/declarative/MarbleQuickItem.cpp
+++ b/src/lib/marble/declarative/MarbleQuickItem.cpp
@@ -203,6 +203,7 @@ namespace Marble
connect(this, SIGNAL(heightChanged()), this, SLOT(resizeMap()));
connect(&d->m_map, SIGNAL(visibleLatLonAltBoxChanged(GeoDataLatLonAltBox)), this, SLOT(updatePositionVisibility()));
connect(&d->m_map, SIGNAL(visibleLatLonAltBoxChanged(GeoDataLatLonAltBox)), this, SIGNAL(visibleLatLonAltBoxChanged()));
+ connect(&d->m_map, SIGNAL(radiusChanged(int)), this, SIGNAL(radiusChanged(int)));
connect(&d->m_map, SIGNAL(radiusChanged(int)), this, SIGNAL(zoomChanged()));
connect(&d->m_reverseGeocoding, SIGNAL(reverseGeocodingFinished(GeoDataCoordinates,GeoDataPlacemark)),
this, SLOT(handleReverseGeocoding(GeoDataCoordinates,GeoDataPlacemark)));
@@ -518,6 +519,11 @@ namespace Marble
return QPointF(x, y);
}
+ void MarbleQuickItem::setRadius(int radius)
+ {
+ d->m_map.setRadius(radius);
+ }
+
void MarbleQuickItem::setZoom(int newZoom, FlyToMode mode)
{
d->m_presenter.setZoom(newZoom, mode);
@@ -940,6 +946,11 @@ namespace Marble
return &d->m_inputHandler;
}
+ int MarbleQuickItem::radius() const
+ {
+ return d->m_map.radius();
+ }
+
int MarbleQuickItem::zoom() const
{
return d->m_presenter.logzoom();
diff --git a/src/lib/marble/declarative/MarbleQuickItem.h b/src/lib/marble/declarative/MarbleQuickItem.h
index b36402e..6631306 100644
--- a/src/lib/marble/declarative/MarbleQuickItem.h
+++ b/src/lib/marble/declarative/MarbleQuickItem.h
@@ -36,6 +36,7 @@ namespace Marble
Q_PROPERTY(int mapWidth READ mapWidth WRITE setMapWidth NOTIFY mapWidthChanged)
Q_PROPERTY(int mapHeight READ mapHeight WRITE setMapHeight NOTIFY mapHeightChanged)
Q_PROPERTY(int zoom READ zoom WRITE setZoom NOTIFY zoomChanged)
+ Q_PROPERTY(int radius READ radius WRITE setRadius NOTIFY radiusChanged)
Q_PROPERTY(bool showFrameRate READ showFrameRate WRITE setShowFrameRate NOTIFY showFrameRateChanged)
Q_PROPERTY(Projection projection READ projection WRITE setProjection NOTIFY projectionChanged)
Q_PROPERTY(QString mapThemeId READ mapThemeId WRITE setMapThemeId NOTIFY mapThemeIdChanged)
@@ -76,11 +77,13 @@ namespace Marble
MarbleInputHandler *inputHandler();
int zoom() const;
+ int radius() const;
public Q_SLOTS:
void goHome();
void setZoom(int zoom, FlyToMode mode = Instant);
Q_INVOKABLE void setZoomToMaximumLevel();
+ void setRadius(int radius);
void centerOn(const GeoDataPlacemark& placemark, bool animated = false);
void centerOn(const GeoDataLatLonBox& box, bool animated = false);
void centerOn(const GeoDataCoordinates& coordinate);
@@ -199,6 +202,7 @@ namespace Marble
void angleChanged();
void speedChanged();
void zoomChanged();
+ void radiusChanged(int radius);
void inertialGlobeRotationChanged(bool inertialGlobeRotation);
void placemarkDelegateChanged(QQmlComponent* placemarkDelegate);
diff --git a/src/plasma/CMakeLists.txt b/src/plasma/CMakeLists.txt
new file mode 100644
index 0000000..196834d
--- /dev/null
+++ b/src/plasma/CMakeLists.txt
@@ -0,0 +1,17 @@
+set(KDE_SKIP_UNINSTALL_TARGET ON CACHE BOOL "KDE uninstall target must be disabled")
+find_package(ECM QUIET)
+set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH})
+if(ECM_FOUND)
+ include(KDEInstallDirs)
+endif()
+macro_optional_find_package(KF5 QUIET COMPONENTS Config Plasma Service)
+
+if (NOT KF5_FOUND)
+ return()
+endif()
+
+
+add_subdirectory(qmlplugin)
+
+add_subdirectory(applets)
+add_subdirectory(wallpapers)
diff --git a/src/plasma/applets/CMakeLists.txt b/src/plasma/applets/CMakeLists.txt
new file mode 100644
index 0000000..ff61e5d
--- /dev/null
+++ b/src/plasma/applets/CMakeLists.txt
@@ -0,0 +1 @@
+add_subdirectory(worldclock)
diff --git a/src/plasma/applets/worldclock/CMakeLists.txt b/src/plasma/applets/worldclock/CMakeLists.txt
new file mode 100644
index 0000000..6e280bb
--- /dev/null
+++ b/src/plasma/applets/worldclock/CMakeLists.txt
@@ -0,0 +1 @@
+plasma_install_package(package org.kde.plasma.worldclock)
diff --git a/src/plasma/applets/worldclock/Messages.sh b/src/plasma/applets/worldclock/Messages.sh
new file mode 100644
index 0000000..6cd42cc
--- /dev/null
+++ b/src/plasma/applets/worldclock/Messages.sh
@@ -0,0 +1,2 @@
+#! /usr/bin/env bash
+$XGETTEXT `find . -name \*.qml -o -name \*.cpp` -o $podir/plasma_applet_org.kde.plasma.worldclock.pot
diff --git a/src/plasma/applets/worldclock/package/contents/config/config.qml b/src/plasma/applets/worldclock/package/contents/config/config.qml
new file mode 100644
index 0000000..1b4b14f
--- /dev/null
+++ b/src/plasma/applets/worldclock/package/contents/config/config.qml
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2016 Friedrich W. H. Kossebau <kossebau@kde.org>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This program 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+import QtQuick 2.1
+
+import org.kde.plasma.configuration 2.0
+
+ConfigModel {
+ ConfigCategory {
+ name: i18n("Map Display")
+ icon: "preferences-desktop-display"
+ source: "configMapDisplay.qml"
+ }
+
+/* TODO: readd later
+ ConfigCategory {
+ name: i18n("Time Zones")
+ icon: "preferences-system-time"
+ source: "configTimeZones.qml"
+ }
+*/
+}
diff --git a/src/plasma/applets/worldclock/package/contents/config/main.xml b/src/plasma/applets/worldclock/package/contents/config/main.xml
new file mode 100644
index 0000000..0c62518
--- /dev/null
+++ b/src/plasma/applets/worldclock/package/contents/config/main.xml
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<kcfg xmlns="http://www.kde.org/standards/kcfg/1.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0
+ http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" >
+ <kcfgfile name=""/>
+
+ <group name="General">
+ <entry name="projection" type="Enum">
+ <choices>
+ <choice name="Equirectangular" />
+ <choice name="Mercator" />
+ </choices>
+ <default>Equirectangular</default>
+ </entry>
+
+ <entry name="showDate" type="Bool">
+ <default>false</default>
+ </entry>
+
+ <!-- TODO: readd later
+ <entry name="rotation" type="int">
+ <default>-20</default>
+ </entry>
+
+ <entry name="centerSun" type="Bool">
+ <default>false</default>
+ </entry>
+
+ <entry name="customTimeZone" type="Bool">
+ <default>false</default>
+ </entry>
+
+ <entry name="timeZoneList" type="StringList">
+ <default></default>
+ </entry>
+ -->
+ </group>
+</kcfg>
+
diff --git a/src/plasma/applets/worldclock/package/contents/ui/configMapDisplay.qml b/src/plasma/applets/worldclock/package/contents/ui/configMapDisplay.qml
new file mode 100644
index 0000000..29fc967
--- /dev/null
+++ b/src/plasma/applets/worldclock/package/contents/ui/configMapDisplay.qml
@@ -0,0 +1,72 @@
+/*
+ * Copyright 2016 Friedrich W. H. Kossebau <kossebau@kde.org>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This program 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+import QtQuick 2.1
+import QtQuick.Controls 1.0 as QtControls
+import QtQuick.Layouts 1.0
+
+ColumnLayout {
+ id: mapDisplayPage
+
+ property int cfg_projection: plasmoid.configuration.projection // Enum needs manual set/get for now
+ property alias cfg_showDate: showDateCheckBox.checked
+
+ GridLayout {
+ columns: 2
+
+ QtControls.Label {
+ Layout.row: 0
+ Layout.column: 0
+ Layout.alignment: Qt.AlignRight
+ anchors {
+ verticalCenter: projectionComboBox.verticalCenter
+ }
+ text: i18n("Projection:")
+ }
+
+ QtControls.ComboBox {
+ id: projectionComboBox
+ model: [
+ i18n("Equirectangular"),
+ i18n("Mercator")
+ ]
+ onCurrentIndexChanged: {
+ cfg_projection = currentIndex;
+ }
+ Component.onCompleted: {
+ currentIndex = plasmoid.configuration.projection;
+ }
+ }
+
+ QtControls.Label {
+ Layout.row: 4
+ Layout.column: 0
+ Layout.alignment: Qt.AlignRight
+ text: i18n("Show date:")
+ }
+
+ QtControls.CheckBox {
+ Layout.row: 4
+ Layout.column: 1
+ id: showDateCheckBox
+ }
+ }
+
+ Item { // tighten layout
+ Layout.fillHeight: true
+ }
+}
diff --git a/src/plasma/applets/worldclock/package/contents/ui/configTimeZones.qml b/src/plasma/applets/worldclock/package/contents/ui/configTimeZones.qml
new file mode 100644
index 0000000..97cb8c6
--- /dev/null
+++ b/src/plasma/applets/worldclock/package/contents/ui/configTimeZones.qml
@@ -0,0 +1,42 @@
+/*
+ * Copyright 2016 Friedrich W. H. Kossebau <kossebau@kde.org>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This program 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+import QtQuick 2.1
+import QtQuick.Controls 1.0 as QtControls
+import QtQuick.Layouts 1.0
+
+ColumnLayout {
+ id: timeZonesPage
+
+ property alias cfg_customTimeZone: customTimeZoneCheckBox.checked
+
+ RowLayout {
+ QtControls.Label {
+ text: i18n("Use custom time zone selection:")
+ }
+
+ QtControls.CheckBox {
+ id: customTimeZoneCheckBox
+ }
+ }
+
+ QtControls.TableView {
+ id: timeZoneView
+ Layout.fillHeight: true
+ }
+}
+
diff --git a/src/plasma/applets/worldclock/package/contents/ui/main.qml b/src/plasma/applets/worldclock/package/contents/ui/main.qml
new file mode 100644
index 0000000..9a306d5
--- /dev/null
+++ b/src/plasma/applets/worldclock/package/contents/ui/main.qml
@@ -0,0 +1,127 @@
+/*
+ * Copyright 2016 Friedrich W. H. Kossebau <kossebau@kde.org>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This program 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+import QtQuick 2.1
+import QtQuick.Layouts 1.1
+
+import org.kde.plasma.plasmoid 2.0
+import org.kde.plasma.core 2.0 as PlasmaCore
+import org.kde.plasma.components 2.0 as PlasmaComponents
+import org.kde.plasma.extras 2.0 as PlasmaExtras
+
+import org.kde.marble.private.plasma 0.20
+
+Item {
+ id: root
+
+ readonly property date currentDateTime: dataSource.data.Local ? dataSource.data.Local.DateTime : new Date()
+
+ Plasmoid.toolTipMainText: Qt.formatTime(currentDateTime)
+ Plasmoid.toolTipSubText: Qt.formatDate(currentDateTime, Qt.locale().dateFormat(Locale.LongFormat))
+
+ PlasmaCore.DataSource {
+ id: dataSource
+ engine: "time"
+ connectedSources: ["Local"]
+ interval: 60000
+ intervalAlignment: PlasmaCore.Types.AlignToMinute
+ }
+
+ Plasmoid.preferredRepresentation: Plasmoid.fullRepresentation
+
+ Plasmoid.fullRepresentation: MarbleItem {
+ id: marbleItem
+
+ enabled: false // do not handle input
+ Layout.minimumWidth: units.gridUnit * 20
+ Layout.minimumHeight: units.gridUnit * 10
+
+ radius: {
+ var ratio = width/height;
+ if (projection === MarbleItem.Equirectangular) {
+ if (ratio > 2) {
+ return height / 2;
+ }
+ return width / 4;
+ } else {
+ if (ratio > 1) {
+ return height / 4;
+ }
+ return width / 4
+ }
+ }
+
+ // Theme settings.
+ projection: (plasmoid.configuration.projection === 0) ? MarbleItem.Equirectangular : MarbleItem.Mercator
+ mapThemeId: "earth/bluemarble/bluemarble.dgml"
+
+ // Visibility of layers/plugins.
+ showAtmosphere: false
+ showClouds: false
+ showBackground: false
+
+ showGrid: false
+ showCrosshairs: false
+ showCompass: false
+ showOverviewMap: false
+ showScaleBar: false
+ // TODO: showCredit: false
+
+ Component.onCompleted: {
+ marbleMap.setShowSunShading(true);
+ marbleMap.setShowCityLights(true);
+
+ marbleMap.setShowPlaces(false);
+ marbleMap.setShowOtherPlaces(false);
+ marbleMap.setShowCities(false);
+ marbleMap.setShowTerrain(false);
+
+ // will depend on plasmoid.configuration.centerSun
+ marbleMap.setLockToSubSolarPoint(true);
+ marbleMap.setSubSolarPointIconVisible(true);
+ }
+
+ ColumnLayout {
+ anchors.centerIn: parent
+
+ PlasmaExtras.Heading {
+ id: timeLabel
+
+ Layout.alignment: Qt.AlignHCenter
+
+ level: 1
+ text: plasmoid.configuration.showDate ? Qt.formatDateTime(currentDateTime) : Qt.formatTime(currentDateTime)
+
+ verticalAlignment: Text.AlignVCenter
+ horizontalAlignment: Text.AlignHCenter
+ }
+ /*
+ PlasmaExtras.Heading {
+ id: timezoneLabel
+
+ Layout.alignment: Qt.AlignHCenter
+
+ level: 3
+ text: "Internet"
+
+ visible: text.length > 0
+ horizontalAlignment: Text.AlignHCenter
+ }
+ */
+ }
+ }
+}
diff --git a/src/plasma/applets/worldclock/package/metadata.desktop b/src/plasma/applets/worldclock/package/metadata.desktop
new file mode 100644
index 0000000..f22a5b7
--- /dev/null
+++ b/src/plasma/applets/worldclock/package/metadata.desktop
@@ -0,0 +1,21 @@
+[Desktop Entry]
+Name=World Clock
+# not yet... Comment=Shows the time in different parts of the world
+
+Icon=marble
+Type=Service
+
+X-KDE-ServiceTypes=Plasma/Applet
+
+X-KDE-PluginInfo-Author=Friedrich W. H. Kossebau
+X-KDE-PluginInfo-Email=kossebau@kde.org
+X-KDE-PluginInfo-Name=org.kde.plasma.worldclock
+X-KDE-PluginInfo-Version=0.2
+X-KDE-PluginInfo-Website=https://marble.kde.org/
+X-KDE-PluginInfo-Category=Date and Time
+X-KDE-PluginInfo-License=LGPL
+
+X-Plasma-API=declarativeappletscript
+X-Plasma-StandAloneApp=true
+X-Plasma-NotificationArea=false
+X-Plasma-MainScript=ui/main.qml
diff --git a/src/plasma/qmlplugin/CMakeLists.txt b/src/plasma/qmlplugin/CMakeLists.txt
new file mode 100644
index 0000000..8cb8a81
--- /dev/null
+++ b/src/plasma/qmlplugin/CMakeLists.txt
@@ -0,0 +1,16 @@
+include_directories(
+ ${CMAKE_SOURCE_DIR}/src/lib/marble/declarative
+)
+
+set(marblequick_SRCS
+ qmlplugin.cpp
+)
+
+install(FILES qmldir DESTINATION ${QML_INSTALL_DIR}/org/kde/marble/private/plasma)
+add_library(marblequick SHARED ${marblequick_SRCS})
+
+target_link_libraries(marblequick
+ marbledeclarative
+)
+
+install(TARGETS marblequick DESTINATION ${QML_INSTALL_DIR}/org/kde/marble/private/plasma)
diff --git a/src/plasma/qmlplugin/qmldir b/src/plasma/qmlplugin/qmldir
new file mode 100644
index 0000000..0e503ea
--- /dev/null
+++ b/src/plasma/qmlplugin/qmldir
@@ -0,0 +1,2 @@
+module org.kde.marble.private.plasma
+plugin marblequick
diff --git a/src/plasma/qmlplugin/qmlplugin.cpp b/src/plasma/qmlplugin/qmlplugin.cpp
new file mode 100644
index 0000000..af5acf8
--- /dev/null
+++ b/src/plasma/qmlplugin/qmlplugin.cpp
@@ -0,0 +1,18 @@
+/*
+ * Copyright 2016 Friedrich W. H. Kossebau <kossebau@kde.org>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This program 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "qmlplugin.h"
diff --git a/src/plasma/qmlplugin/qmlplugin.h b/src/plasma/qmlplugin/qmlplugin.h
new file mode 100644
index 0000000..1003c1b
--- /dev/null
+++ b/src/plasma/qmlplugin/qmlplugin.h
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2016 Friedrich W. H. Kossebau <kossebau@kde.org>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This program 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef PLUGIN_H
+#define PLUGIN_H
+
+#include <MarbleDeclarativePlugin.h>
+
+/**
+ * For now installing this separate Marble QtQuick plugin under a private namespace,
+ * org.kde.marble.private.plasma (see qmldir)
+ * until we have sorted out a general public Marble QtQuick plugin API
+ * and libmarbledeclarative is turned back into a plugin instead of shared library
+ */
+class MarbleQuickPlugin : public MarbleDeclarativePlugin
+{
+ Q_OBJECT
+ Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
+};
+
+#endif // PLUGIN_H
diff --git a/src/plasma/wallpapers/CMakeLists.txt b/src/plasma/wallpapers/CMakeLists.txt
new file mode 100644
index 0000000..ede0b7a
--- /dev/null
+++ b/src/plasma/wallpapers/CMakeLists.txt
@@ -0,0 +1 @@
+plasma_install_package(worldmap org.kde.plasma.wallpaper.worldmap wallpapers wallpaper)
diff --git a/src/plasma/wallpapers/worldmap/Messages.sh b/src/plasma/wallpapers/worldmap/Messages.sh
new file mode 100644
index 0000000..f52fb4c
--- /dev/null
+++ b/src/plasma/wallpapers/worldmap/Messages.sh
@@ -0,0 +1,2 @@
+#! /usr/bin/env bash
+$XGETTEXT `find . -name \*.qml` -o $podir/plasma_wallpaper_org.kde.plasma.worldmap.pot
diff --git a/src/plasma/wallpapers/worldmap/contents/config/main.xml b/src/plasma/wallpapers/worldmap/contents/config/main.xml
new file mode 100644
index 0000000..3132a10
--- /dev/null
+++ b/src/plasma/wallpapers/worldmap/contents/config/main.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<kcfg xmlns="http://www.kde.org/standards/kcfg/1.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0
+ http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" >
+ <kcfgfile name=""/>
+
+ <group name="General">
+ <entry name="projection" type="Enum">
+ <choices>
+ <choice name="Equirectangular" />
+ <choice name="Mercator" />
+ </choices>
+ <default>Equirectangular</default>
+ </entry>
+ </group>
+
+</kcfg>
diff --git a/src/plasma/wallpapers/worldmap/contents/ui/config.qml b/src/plasma/wallpapers/worldmap/contents/ui/config.qml
new file mode 100644
index 0000000..93d467e
--- /dev/null
+++ b/src/plasma/wallpapers/worldmap/contents/ui/config.qml
@@ -0,0 +1,66 @@
+/*
+ * Copyright 2016 Friedrich W. H. Kossebau <kossebau@kde.org>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This program 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+import QtQuick 2.1
+import QtQuick.Layouts 1.0
+import QtQuick.Controls 1.0 as QtControls
+
+// for "units"
+import org.kde.plasma.core 2.0 as PlasmaCore
+
+
+ColumnLayout {
+ id: root
+ property int cfg_projection: plasmoid.configuration.projection // Enum needs manual set/get for now
+
+ RowLayout {
+ spacing: units.largeSpacing / 2
+
+ // To allow aligned integration in the settings form,
+ // "formAlignment" is a property injected by the config containment
+ // which defines the offset of the value fields
+ QtControls.Label {
+ Layout.minimumWidth: width
+ Layout.maximumWidth: width
+ width: formAlignment - units.largeSpacing
+ horizontalAlignment: Text.AlignRight
+ anchors {
+ verticalCenter: projectionComboBox.verticalCenter
+ }
+
+ // use i18nd, as textdomain otherwise would be defined by config containment
+ text: i18nd("plasma_wallpaper_org.kde.plasma.worldmap", "Projection:")
+ }
+ QtControls.ComboBox {
+ id: projectionComboBox
+ model: [
+ i18nd("plasma_wallpaper_org.kde.plasma.worldmap", "Equirectangular"),
+ i18nd("plasma_wallpaper_org.kde.plasma.worldmap", "Mercator")
+ ]
+ onCurrentIndexChanged: {
+ cfg_projection = currentIndex;
+ }
+ Component.onCompleted: {
+ currentIndex = plasmoid.configuration.projection;
+ }
+ }
+ }
+
+ Item { // tighten layout
+ Layout.fillHeight: true
+ }
+}
diff --git a/src/plasma/wallpapers/worldmap/contents/ui/main.qml b/src/plasma/wallpapers/worldmap/contents/ui/main.qml
new file mode 100644
index 0000000..5410d9c
--- /dev/null
+++ b/src/plasma/wallpapers/worldmap/contents/ui/main.qml
@@ -0,0 +1,72 @@
+/*
+ * Copyright 2016 Friedrich W. H. Kossebau <kossebau@kde.org>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This program 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+import QtQuick 2.1
+
+import org.kde.plasma.extras 2.0 as PlasmaExtras
+
+import org.kde.marble.private.plasma 0.20
+
+MarbleItem {
+ id: marbleItem
+
+ enabled: false // do not handle input
+
+ radius: {
+ var ratio = width/height;
+ if (projection === MarbleItem.Equirectangular) {
+ if (ratio > 2) {
+ return height / 2;
+ }
+ return width / 4;
+ } else {
+ if (ratio > 1) {
+ return height / 4;
+ }
+ return width / 4
+ }
+ }
+
+ // Theme settings.
+ projection: (wallpaper.configuration.projection === 0) ? MarbleItem.Equirectangular : MarbleItem.Mercator
+ mapThemeId: "earth/bluemarble/bluemarble.dgml"
+
+ // Visibility of layers/plugins.
+ showAtmosphere: false
+ showClouds: false
+ showBackground: false
+
+ showGrid: false
+ showCrosshairs: false
+ showCompass: false
+ showOverviewMap: false
+ showScaleBar: false
+
+ Component.onCompleted: {
+ marbleMap.setShowSunShading(true);
+ marbleMap.setShowCityLights(true);
+
+ marbleMap.setShowPlaces(false);
+ marbleMap.setShowCities(false);
+ marbleMap.setShowTerrain(false);
+ marbleMap.setShowOtherPlaces(false);
+
+ // will depend on wallpaper.configuration.centerSun
+ marbleMap.setLockToSubSolarPoint(true);
+ marbleMap.setSubSolarPointIconVisible(true);
+ }
+}
diff --git a/src/plasma/wallpapers/worldmap/metadata.desktop b/src/plasma/wallpapers/worldmap/metadata.desktop
new file mode 100644
index 0000000..b4d584d
--- /dev/null
+++ b/src/plasma/wallpapers/worldmap/metadata.desktop
@@ -0,0 +1,13 @@
+[Desktop Entry]
+Name=World Map
+Type=Service
+Icon=marble
+
+X-KDE-ServiceTypes=Plasma/Wallpaper
+X-KDE-PluginInfo-Author=Friedrich W. H. Kossebau
+X-KDE-PluginInfo-Email=kossebau@kde.org
+X-KDE-PluginInfo-License=LGPL
+X-KDE-PluginInfo-Name=org.kde.plasma.worldmap
+X-KDE-PluginInfo-Version=0.1
+X-KDE-PluginInfo-Website=https://marble.kde.org/
+X-Plasma-MainScript=ui/main.qml