mirror of
https://bitbucket.org/smil3y/kde-extraapps.git
synced 2025-02-23 18:32:53 +00:00
kdeplasma-addons: remove no-op marble wallpaper
marble was never maintained as part of Katana so the wallpaper plugin is most likely not operational now Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
13893a40a9
commit
92d1ed4b36
9 changed files with 0 additions and 961 deletions
|
@ -15,13 +15,6 @@ set_package_properties(KDE4Workspace PROPERTIES
|
|||
PURPOSE "Needed for building several Plasma plugins"
|
||||
)
|
||||
|
||||
macro_optional_find_package(Marble)
|
||||
set_package_properties(Marble PROPERTIES
|
||||
DESCRIPTION "Desktop Globe"
|
||||
URL "http://marble.kde.org"
|
||||
PURPOSE "Marble is used to provide a desktop globe wallpaper for Plasma"
|
||||
)
|
||||
|
||||
macro_optional_find_package(DBusMenuQt)
|
||||
set_package_properties(DBusMenuQt PROPERTIES
|
||||
DESCRIPTION "Library that provides a Qt implementation of the DBusMenu spec"
|
||||
|
|
|
@ -2,9 +2,4 @@ add_subdirectory(potd)
|
|||
add_subdirectory(virus)
|
||||
add_subdirectory(weather)
|
||||
add_subdirectory(qmlwallpapers)
|
||||
|
||||
if(MARBLE_FOUND)
|
||||
add_subdirectory(marble)
|
||||
endif()
|
||||
|
||||
add_subdirectory(pattern)
|
||||
|
|
|
@ -1,19 +0,0 @@
|
|||
project(plasma-wallpaper-marble)
|
||||
|
||||
include_directories(${MARBLE_INCLUDE_DIR})
|
||||
|
||||
set(marble_SRCS
|
||||
marble.cpp
|
||||
config.ui
|
||||
)
|
||||
|
||||
kde4_add_plugin(plasma_wallpaper_marble ${marble_SRCS})
|
||||
|
||||
target_link_libraries(plasma_wallpaper_marble
|
||||
${MARBLE_LIBRARIES}
|
||||
${KDE4_PLASMA_LIBS}
|
||||
${KDE4_KDECORE_LIBS}
|
||||
)
|
||||
|
||||
install(TARGETS plasma_wallpaper_marble DESTINATION ${KDE4_PLUGIN_INSTALL_DIR})
|
||||
install(FILES plasma-wallpaper-marble.desktop DESTINATION ${KDE4_SERVICES_INSTALL_DIR})
|
|
@ -1,3 +0,0 @@
|
|||
#! /usr/bin/env bash
|
||||
$EXTRACTRC *.ui >> rc.cpp
|
||||
$XGETTEXT *.cpp -o $podir/plasma_wallpaper_marble.pot
|
|
@ -1 +0,0 @@
|
|||
* change "Theme" configuration string to "Map theme" after string freeze - done
|
|
@ -1,364 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>MarbleSettingsWidget</class>
|
||||
<widget class="QWidget" name="MarbleSettingsWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>450</width>
|
||||
<height>298</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Map &theme:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>themeList</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="KComboBox" name="themeList">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>125</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Projection:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>projection</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="KComboBox" name="projection">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Globe</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Flat Map</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Mercator</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="text">
|
||||
<string>&Quality:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>quality</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="KComboBox" name="quality">
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Low</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Normal</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>High</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Print</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="label_7">
|
||||
<property name="text">
|
||||
<string>Movement:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>movement</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<widget class="KComboBox" name="movement">
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Interactive</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Follow the sun</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Rotate</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Do not move</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="1">
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="labelRotationLon">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Longitude rotation:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>rotationLon</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QDoubleSpinBox" name="rotationLon">
|
||||
<property name="wrapping">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="suffix">
|
||||
<string comment="how fast the view of the earth is rotated - degrees per second, Longitude">°/s</string>
|
||||
</property>
|
||||
<property name="decimals">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<double>-359.999000000000024</double>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>359.999000000000024</double>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<double>0.001000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="labelRotationLat">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Latitude rotation:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>rotationLat</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QDoubleSpinBox" name="rotationLat">
|
||||
<property name="wrapping">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="suffix">
|
||||
<string comment="how fast the view of the earth is rotated - degrees per second, Latitude">°/s</string>
|
||||
</property>
|
||||
<property name="decimals">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<double>-359.999000000000024</double>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>359.999000000000024</double>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<double>0.001000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="labelTimeout">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Update every:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>timeout</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QDoubleSpinBox" name="timeout">
|
||||
<property name="suffix">
|
||||
<string> seconds</string>
|
||||
</property>
|
||||
<property name="decimals">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<double>0.100000000000000</double>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>3600.000000000000000</double>
|
||||
</property>
|
||||
<property name="value">
|
||||
<double>10.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="13" column="1">
|
||||
<widget class="QCheckBox" name="showPlacemarks">
|
||||
<property name="toolTip">
|
||||
<string>Determines whether all kind of placemarks are shown or not.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Show &placemarks</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="14" column="1">
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>10</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="10" column="1">
|
||||
<widget class="QLabel" name="mouseInstructions">
|
||||
<property name="text">
|
||||
<string>Drag (move the mouse while pressing the left mouse button) to rotate. Use the mouse wheel to zoom in and out.</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="11" column="1">
|
||||
<widget class="Line" name="line">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>KComboBox</class>
|
||||
<extends>QComboBox</extends>
|
||||
<header>kcombobox.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<tabstops>
|
||||
<tabstop>themeList</tabstop>
|
||||
<tabstop>projection</tabstop>
|
||||
<tabstop>quality</tabstop>
|
||||
<tabstop>rotationLon</tabstop>
|
||||
<tabstop>rotationLat</tabstop>
|
||||
</tabstops>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
|
@ -1,354 +0,0 @@
|
|||
/*
|
||||
Copyright 2008-2009 by Frederik Gladhorn <gladhorn@kde.org>
|
||||
Copyright 2008-2009 by Sascha Peilicke <sasch.pe@gmx.de>
|
||||
|
||||
This program 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 2 of
|
||||
the License or (at your option) version 3 or any later version
|
||||
accepted by the membership of KDE e.V. (or its successor approved
|
||||
by the membership of KDE e.V.), which shall act as a proxy
|
||||
defined in Section 14 of version 3 of the license.
|
||||
|
||||
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 General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "marble.h"
|
||||
|
||||
#include <marble/GeoPainter.h>
|
||||
#include <marble/MapThemeManager.h>
|
||||
#include <marble/MarbleMap.h>
|
||||
#include <marble/MarbleModel.h>
|
||||
#include <marble/RenderPlugin.h>
|
||||
#include <marble/SunLocator.h>
|
||||
#include <marble/ViewportParams.h>
|
||||
|
||||
#include <QtGui/qgraphicssceneevent.h>
|
||||
#include <QStandardItemModel>
|
||||
#include <QTimer>
|
||||
|
||||
#define DRAG_THRESHOLD 3 // Distance (pixel) before starting drag updates
|
||||
#define DEFAULT_UPDATE_INTERVAL 300000 // Wait time between redraws in msecs (5 min)
|
||||
|
||||
#define MOVEMENT_KEY "movement" // Type of movement
|
||||
#define ROTATION_LON_KEY "rotateLongitude" // Amount of rotation (degrees/second)
|
||||
#define ROTATION_LAT_KEY "rotateLatitude"
|
||||
#define ROTATION_TIMEOUT_KEY "rotationTimeout"
|
||||
#define POSITION_LON_KEY "positionLongitude" // Last position
|
||||
#define POSITION_LAT_KEY "positionLatitude"
|
||||
#define ZOOM_KEY "zoom" // Zoom distance
|
||||
#define MAP_THEME_KEY "mapTheme" // Marble settings
|
||||
#define PROJECTION_KEY "projection" // Projection type
|
||||
#define QUALITY_KEY "quality" // Render quality
|
||||
#define SHOW_PLACEMARKS_KEY "showPlacemarks"
|
||||
|
||||
namespace Marble {
|
||||
|
||||
MarbleWallpaper::MarbleWallpaper(QObject * parent, const QVariantList & args)
|
||||
: Plasma::Wallpaper(parent, args), m_timer(0), m_map(0)
|
||||
{
|
||||
setPreviewDuringConfiguration(true);
|
||||
KGlobal::locale()->insertCatalog(QLatin1String( "marble" ));
|
||||
}
|
||||
|
||||
MarbleWallpaper::~MarbleWallpaper()
|
||||
{
|
||||
delete m_map;
|
||||
delete m_timer;
|
||||
}
|
||||
|
||||
void MarbleWallpaper::init(const KConfigGroup &config)
|
||||
{
|
||||
qreal home_lon = 0;
|
||||
qreal home_lat = 0;
|
||||
int home_zoom = 0;
|
||||
|
||||
// Only on first start, otherwise opening the config dialog lets us
|
||||
// lose the current position
|
||||
if (!isInitialized()) {
|
||||
m_map = new MarbleMap();
|
||||
|
||||
// Get default position from marble to initialize on first startup (empty config)
|
||||
m_map->model()->home(home_lon, home_lat, home_zoom);
|
||||
m_map->model()->setClockDateTime( QDateTime::currentDateTime().toUTC() );
|
||||
|
||||
// These settings apply to Marble's "satellite" view mostly, e.g. make it beautiful
|
||||
m_map->setShowClouds(true);
|
||||
m_map->setShowCityLights(false);
|
||||
m_map->setShowSunShading(true);
|
||||
|
||||
// Disable all render plugins (scale bar, compass, etc.) except the "stars" plugin
|
||||
foreach (RenderPlugin *item, m_map->renderPlugins()) {
|
||||
if (item->nameId() == QLatin1String( "stars" )) {
|
||||
item->setVisible(true);
|
||||
item->setEnabled(true);
|
||||
} else {
|
||||
item->setVisible(false);
|
||||
item->setEnabled(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Read setting values or use defaults
|
||||
m_mapTheme = config.readEntry(MAP_THEME_KEY, QString::fromLatin1("earth/bluemarble/bluemarble.dgml"));
|
||||
m_movement = static_cast<Movement>(config.readEntry(MOVEMENT_KEY, static_cast<int>(Interactive)));
|
||||
m_positionLon = config.readEntry(POSITION_LON_KEY, home_lon);
|
||||
m_positionLat = config.readEntry(POSITION_LAT_KEY, home_lat);
|
||||
m_projection = static_cast<Projection>(config.readEntry(PROJECTION_KEY, static_cast<int>(Spherical)));
|
||||
m_quality = static_cast<MapQuality>(config.readEntry(QUALITY_KEY, static_cast<int>(NormalQuality)));
|
||||
m_rotationLat = config.readEntry(ROTATION_LAT_KEY, 0.0);
|
||||
m_rotationLon = config.readEntry(ROTATION_LON_KEY, 0.025);
|
||||
m_rotationTimeout = config.readEntry(ROTATION_TIMEOUT_KEY, 10000);
|
||||
m_showPlacemarks = config.readEntry(SHOW_PLACEMARKS_KEY, false);
|
||||
m_zoom = config.readEntry(ZOOM_KEY, home_zoom);
|
||||
|
||||
m_map->setMapThemeId(m_mapTheme);
|
||||
m_map->setProjection(m_projection);
|
||||
m_map->setShowCities(m_showPlacemarks);
|
||||
m_map->setShowOtherPlaces(m_showPlacemarks);
|
||||
m_map->setShowPlaces(m_showPlacemarks);
|
||||
m_map->setShowTerrain(m_showPlacemarks);
|
||||
|
||||
if (!isInitialized()) {
|
||||
qreal radius = pow(M_E, (m_zoom / 200.0));
|
||||
m_map->setRadius(radius);
|
||||
m_map->centerOn(m_positionLon, m_positionLat);
|
||||
}
|
||||
updateGlobe();
|
||||
}
|
||||
|
||||
QWidget *MarbleWallpaper::createConfigurationInterface(QWidget *parent)
|
||||
{
|
||||
QWidget *configWidget = new QWidget(parent);
|
||||
m_ui.setupUi(configWidget);
|
||||
m_ui.movement->setCurrentIndex(static_cast<int>(m_movement));
|
||||
m_ui.projection->setCurrentIndex(static_cast<int>(m_projection));
|
||||
// The first MapQuality value is wireframe, which we don't show in the list
|
||||
m_ui.quality->setCurrentIndex(static_cast<int>(m_quality) - 1);
|
||||
m_ui.rotationLon->setValue(m_rotationLon);
|
||||
m_ui.rotationLat->setValue(m_rotationLat);
|
||||
m_ui.timeout->setValue(m_rotationTimeout / 1000);
|
||||
m_ui.showPlacemarks->setChecked(m_showPlacemarks);
|
||||
|
||||
MapThemeManager themeManager;
|
||||
// FIXME: Going manually through the model is ugly as hell, but plugging the
|
||||
// model into the view didn't work for me
|
||||
for (int i = 0; i < themeManager.mapThemeModel()->rowCount(); i++) {
|
||||
QModelIndex index = themeManager.mapThemeModel()->index(i, 0, QModelIndex());
|
||||
QString theme = themeManager.mapThemeModel()->data(index, Qt::DisplayRole).toString();
|
||||
QIcon icon = qvariant_cast<QIcon>(themeManager.mapThemeModel()->data(index, Qt::DecorationRole));
|
||||
QModelIndex fileIndex = themeManager.mapThemeModel()->index(i, 0, QModelIndex());
|
||||
QString themeFile = themeManager.mapThemeModel()->data(fileIndex, Qt::UserRole + 1).toString();
|
||||
m_ui.themeList->addItem(icon, theme, themeFile);
|
||||
if (m_mapTheme == themeFile) {
|
||||
m_ui.themeList->setCurrentIndex(i);
|
||||
}
|
||||
}
|
||||
|
||||
// Trigger initial visual movement setup
|
||||
updateConfigScreen(static_cast<int>(m_movement));
|
||||
|
||||
connect(m_ui.movement, SIGNAL(currentIndexChanged(int)), SLOT(updateConfigScreen(int)));
|
||||
connect(m_ui.movement, SIGNAL(currentIndexChanged(int)), SLOT(updateSettings()));
|
||||
connect(m_ui.projection, SIGNAL(currentIndexChanged(int)), SLOT(updateSettings()));
|
||||
connect(m_ui.quality, SIGNAL(currentIndexChanged(int)), SLOT(updateSettings()));
|
||||
connect(m_ui.rotationLon, SIGNAL(valueChanged(double)), SLOT(updateSettings()));
|
||||
connect(m_ui.rotationLat, SIGNAL(valueChanged(double)), SLOT(updateSettings()));
|
||||
connect(m_ui.timeout, SIGNAL(valueChanged(double)), SLOT(updateSettings()));
|
||||
connect(m_ui.showPlacemarks, SIGNAL(stateChanged(int)), SLOT(updateSettings()));
|
||||
connect(m_ui.themeList, SIGNAL(currentIndexChanged(int)), SLOT(changeTheme(int)));
|
||||
|
||||
// Notify the plasma background dialog of changes
|
||||
connect(this, SIGNAL(settingsChanged(bool)), parent, SLOT(settingsChanged(bool)));
|
||||
|
||||
return configWidget;
|
||||
}
|
||||
|
||||
void MarbleWallpaper::save(KConfigGroup &config)
|
||||
{
|
||||
if (m_map) {
|
||||
config.writeEntry(MAP_THEME_KEY, m_map->mapThemeId());
|
||||
config.writeEntry(POSITION_LAT_KEY, m_map->centerLatitude());
|
||||
config.writeEntry(POSITION_LON_KEY, m_map->centerLongitude());
|
||||
}
|
||||
|
||||
config.writeEntry(MOVEMENT_KEY, static_cast<int>(m_movement));
|
||||
config.writeEntry(ZOOM_KEY, m_zoom);
|
||||
config.writeEntry(PROJECTION_KEY, static_cast<int>(m_projection));
|
||||
config.writeEntry(QUALITY_KEY, static_cast<int>(m_quality));
|
||||
config.writeEntry(ROTATION_LAT_KEY, m_rotationLat);
|
||||
config.writeEntry(ROTATION_LON_KEY, m_rotationLon);
|
||||
config.writeEntry(ROTATION_TIMEOUT_KEY, m_rotationTimeout);
|
||||
config.writeEntry(SHOW_PLACEMARKS_KEY, m_showPlacemarks);
|
||||
}
|
||||
|
||||
void MarbleWallpaper::paint(QPainter *painter, const QRectF &exposedRect)
|
||||
{
|
||||
// Update the pixmap
|
||||
if (m_pixmap.size() != boundingRect().size().toSize()) {
|
||||
m_pixmap = QPixmap(boundingRect().size().toSize());
|
||||
}
|
||||
if (m_pixmap.size().isEmpty()) {
|
||||
return;
|
||||
}
|
||||
m_map->setSize(m_pixmap.size());
|
||||
m_pixmap.fill(QColor(0x00, 0x00, 0x00, 0xFF));
|
||||
GeoPainter gp(&m_pixmap, m_map->viewport(), m_quality);
|
||||
QRect mapRect(0, 0, m_map->width(), m_map->height());
|
||||
m_map->paint(gp, mapRect);
|
||||
|
||||
// Draw the requested part of the pixmap
|
||||
painter->drawPixmap(exposedRect, m_pixmap, exposedRect.translated(-boundingRect().topLeft()));
|
||||
}
|
||||
|
||||
void MarbleWallpaper::wheelEvent(QGraphicsSceneWheelEvent *event)
|
||||
{
|
||||
if (m_movement == Interactive) {
|
||||
event->accept();
|
||||
m_zoom = qMax(qreal(0), m_zoom + (event->delta() > 0 ? 40 : -40));
|
||||
qreal radius = pow(M_E, (m_zoom / 200.0));
|
||||
m_map->setRadius(radius);
|
||||
|
||||
emit update(boundingRect());
|
||||
}
|
||||
}
|
||||
|
||||
void MarbleWallpaper::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
|
||||
{
|
||||
if (m_movement == Interactive && event->buttons() == Qt::LeftButton) {
|
||||
event->accept();
|
||||
int polarity = m_map->viewport()->polarity();
|
||||
|
||||
qreal radius = (qreal)(m_map->radius());
|
||||
int deltaX = event->screenPos().x() - m_dragStartPositionX;
|
||||
int deltaY = event->screenPos().y() - m_dragStartPositionY;
|
||||
|
||||
// Only start dragging after a certain distance
|
||||
if (abs(deltaX) <= DRAG_THRESHOLD && abs(deltaY) <= DRAG_THRESHOLD) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Reverse spin direction if globe is turned upside down
|
||||
qreal const direction = polarity < 0 ? -1 : 1;
|
||||
|
||||
m_positionLon = RAD2DEG * (qreal)(m_leftPressedTranslationX)
|
||||
- 90.0 * direction * deltaX / radius;
|
||||
m_positionLat = RAD2DEG * (qreal)(m_leftPressedTranslationY)
|
||||
+ 90.0 * deltaY / radius;
|
||||
m_map->centerOn(m_positionLon, m_positionLat);
|
||||
|
||||
emit update(boundingRect());
|
||||
}
|
||||
}
|
||||
|
||||
void MarbleWallpaper::mousePressEvent(QGraphicsSceneMouseEvent *event)
|
||||
{
|
||||
if (m_movement == Interactive && event->buttons() == Qt::LeftButton) {
|
||||
event->accept();
|
||||
|
||||
// On the single event of a mouse button press these
|
||||
// values get stored, to enable us to e.g. calculate the
|
||||
// distance of a mouse drag while the mouse button is
|
||||
// still down.
|
||||
m_dragStartPositionX = event->screenPos().x();
|
||||
m_dragStartPositionY = event->screenPos().y();
|
||||
|
||||
// Calculate translation of center point
|
||||
m_leftPressedTranslationX = m_map->centerLongitude() * DEG2RAD;
|
||||
m_leftPressedTranslationY = m_map->centerLatitude() * DEG2RAD;
|
||||
}
|
||||
}
|
||||
|
||||
void MarbleWallpaper::updateGlobe()
|
||||
{
|
||||
if (!m_timer) {
|
||||
m_timer = new QTimer(this);
|
||||
connect(m_timer, SIGNAL(timeout()), SLOT(updateGlobe()));
|
||||
} else {
|
||||
m_timer->stop();
|
||||
}
|
||||
|
||||
if (m_movement == Rotate || m_movement == FollowSun) {
|
||||
m_timer->setInterval(m_rotationTimeout);
|
||||
} else {
|
||||
m_timer->setInterval(DEFAULT_UPDATE_INTERVAL);
|
||||
}
|
||||
m_timer->start();
|
||||
|
||||
if (m_movement == FollowSun) {
|
||||
m_map->model()->sunLocator()->update();
|
||||
if (m_map->model()->sunLocator()->getLon() == m_map->centerLongitude()) {
|
||||
return;
|
||||
}
|
||||
m_positionLon = m_map->model()->sunLocator()->getLon();
|
||||
m_positionLat = m_map->model()->sunLocator()->getLat();
|
||||
m_map->centerOn(m_positionLon, m_positionLat);
|
||||
} else if (m_movement == Rotate) {
|
||||
m_map->rotateBy(m_rotationLon * m_rotationTimeout / 1000,
|
||||
m_rotationLat * m_rotationTimeout / 1000);
|
||||
m_positionLon = m_map->centerLongitude();
|
||||
m_positionLat = m_map->centerLatitude();
|
||||
}
|
||||
emit update(boundingRect());
|
||||
}
|
||||
|
||||
void MarbleWallpaper::updateSettings()
|
||||
{
|
||||
m_projection = static_cast<Projection>(m_ui.projection->currentIndex());
|
||||
m_rotationLon = m_ui.rotationLon->value();
|
||||
m_rotationLat = m_ui.rotationLat->value();
|
||||
m_rotationTimeout = m_ui.timeout->value() * 1000;
|
||||
// The first MapQuality value is wireframe, which we don't show in the list
|
||||
m_quality = static_cast<MapQuality>(m_ui.quality->currentIndex() + 1);
|
||||
m_showPlacemarks = m_ui.showPlacemarks->isChecked();
|
||||
|
||||
emit settingsChanged(true);
|
||||
}
|
||||
|
||||
void MarbleWallpaper::changeTheme(int index)
|
||||
{
|
||||
m_mapTheme = m_ui.themeList->itemData(index).toString();
|
||||
m_map->setMapThemeId(m_mapTheme);
|
||||
|
||||
emit update(boundingRect());
|
||||
emit settingsChanged(true);
|
||||
}
|
||||
|
||||
void MarbleWallpaper::updateConfigScreen(int index)
|
||||
{
|
||||
m_movement = static_cast<Movement>(index);
|
||||
|
||||
m_ui.mouseInstructions->setVisible(m_movement == Interactive);
|
||||
if (m_movement == Rotate) {
|
||||
m_ui.rotationLat->setVisible(true);
|
||||
m_ui.rotationLon->setVisible(true);
|
||||
m_ui.labelRotationLat->setVisible(true);
|
||||
m_ui.labelRotationLon->setVisible(true);
|
||||
} else {
|
||||
m_ui.rotationLat->setVisible(false);
|
||||
m_ui.rotationLon->setVisible(false);
|
||||
m_ui.labelRotationLat->setVisible(false);
|
||||
m_ui.labelRotationLon->setVisible(false);
|
||||
}
|
||||
if (m_movement == FollowSun || m_movement == Rotate) {
|
||||
m_ui.timeout->setVisible(true);
|
||||
m_ui.labelTimeout->setVisible(true);
|
||||
} else {
|
||||
m_ui.timeout->setVisible(false);
|
||||
m_ui.labelTimeout->setVisible(false);
|
||||
}
|
||||
|
||||
emit settingsChanged(true);
|
||||
}
|
||||
|
||||
} // Marble namespace
|
||||
|
||||
#include "moc_marble.cpp"
|
||||
|
||||
// vim: sw=4 sts=4 et tw=100
|
|
@ -1,101 +0,0 @@
|
|||
/*
|
||||
Copyright 2008-2009 by Frederik Gladhorn <gladhorn@kde.org>
|
||||
Copyright 2008-2009 by Sascha Peilicke <sasch.pe@gmx.de>
|
||||
|
||||
This program 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 2 of
|
||||
the License or (at your option) version 3 or any later version
|
||||
accepted by the membership of KDE e.V. (or its successor approved
|
||||
by the membership of KDE e.V.), which shall act as a proxy
|
||||
defined in Section 14 of version 3 of the license.
|
||||
|
||||
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 General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef MARBLE_WALLPAPER_H
|
||||
#define MARBLE_WALLPAPER_H
|
||||
|
||||
#include "ui_config.h"
|
||||
|
||||
#include <Plasma/Wallpaper>
|
||||
#include <marble/global.h>
|
||||
|
||||
namespace Marble {
|
||||
|
||||
class MarbleMap;
|
||||
|
||||
class MarbleWallpaper : public Plasma::Wallpaper
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
enum Movement {
|
||||
Interactive = 0, //< Allow user interactive navigation
|
||||
FollowSun, //< Rotate by following the sun
|
||||
Rotate, //< Rotate by configured values
|
||||
DontMove
|
||||
};
|
||||
|
||||
MarbleWallpaper(QObject *parent, const QVariantList &args);
|
||||
~MarbleWallpaper();
|
||||
|
||||
/// Show config
|
||||
QWidget * createConfigurationInterface(QWidget *parent);
|
||||
/// Save config
|
||||
void save(KConfigGroup &config);
|
||||
/// Paint the wallpaper
|
||||
void paint(QPainter *painter, const QRectF &exposedRect);
|
||||
|
||||
signals:
|
||||
void settingsChanged(bool);
|
||||
|
||||
protected:
|
||||
void init(const KConfigGroup &config);
|
||||
|
||||
virtual void wheelEvent(QGraphicsSceneWheelEvent *event);
|
||||
virtual void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
|
||||
virtual void mousePressEvent(QGraphicsSceneMouseEvent *event);
|
||||
|
||||
private slots:
|
||||
void updateGlobe(); //< Called by the timer
|
||||
void updateSettings(); //< Changes from the settings dialog
|
||||
void changeTheme(int index); //< Change the map theme
|
||||
void updateConfigScreen(int); //< Updates config screen
|
||||
|
||||
private:
|
||||
Ui_MarbleSettingsWidget m_ui;
|
||||
|
||||
QTimer *m_timer; // Update timer
|
||||
MarbleMap *m_map; // Marble parameters for GeoPainter
|
||||
Projection m_projection; // Type of projection
|
||||
MapQuality m_quality; // Painting quality
|
||||
Movement m_movement; // Current movement/rotation scheme
|
||||
QString m_mapTheme; // Theme of the map
|
||||
bool m_showPlacemarks; // Visibility flag for all placemarks
|
||||
|
||||
qreal m_zoom; // Last saved zoom / distance
|
||||
qreal m_positionLon; // Last saved position lon
|
||||
qreal m_positionLat; // Last saved position lat
|
||||
qreal m_rotationLon; // Used for 'follow sun'
|
||||
qreal m_rotationLat; // Used for 'follow sun'
|
||||
int m_rotationTimeout; // Used for 'follow sun' and 'rotate'
|
||||
|
||||
int m_dragStartPositionX; // position of last button press X
|
||||
int m_dragStartPositionY; // position of last button press Y
|
||||
qreal m_leftPressedTranslationX;
|
||||
qreal m_leftPressedTranslationY;
|
||||
|
||||
QPixmap m_pixmap; // Cached wallpaper
|
||||
};
|
||||
|
||||
K_EXPORT_PLASMA_WALLPAPER(marble, MarbleWallpaper)
|
||||
|
||||
} // namspace Marble
|
||||
|
||||
#endif
|
|
@ -1,107 +0,0 @@
|
|||
[Desktop Entry]
|
||||
Name=Globe
|
||||
Name[ar]=الكرة الأرضية
|
||||
Name[ast]=Globu
|
||||
Name[bs]=Globus
|
||||
Name[ca]=Globus
|
||||
Name[ca@valencia]=Globus
|
||||
Name[cs]=Globus
|
||||
Name[da]=Globus
|
||||
Name[de]=Globus
|
||||
Name[el]=Υδρόγειος
|
||||
Name[en_GB]=Globe
|
||||
Name[es]=Globo
|
||||
Name[et]=Gloobus
|
||||
Name[fi]=Maapallo
|
||||
Name[fr]=Globe
|
||||
Name[ga]=Cruinneog
|
||||
Name[gl]=Globo terráqueo
|
||||
Name[hr]=Globus
|
||||
Name[hu]=Földgömb
|
||||
Name[is]=Hnöttur
|
||||
Name[it]=Globo
|
||||
Name[ja]=地球
|
||||
Name[kk]=Глобус
|
||||
Name[km]=សកល
|
||||
Name[ko]=지구본
|
||||
Name[lt]=Gaublys
|
||||
Name[lv]=Zemeslode
|
||||
Name[mr]=पृथ्वी
|
||||
Name[nb]=Globus
|
||||
Name[nds]=Eer
|
||||
Name[nl]=Globe
|
||||
Name[nn]=Globus
|
||||
Name[pa]=ਗਲੋਬ
|
||||
Name[pl]=Glob
|
||||
Name[pt]=Globo
|
||||
Name[pt_BR]=Globo
|
||||
Name[ro]=Glob
|
||||
Name[ru]=Глобус
|
||||
Name[sk]=Glóbus
|
||||
Name[sl]=Globus
|
||||
Name[sq]=Globi
|
||||
Name[sr]=глобус
|
||||
Name[sr@ijekavian]=глобус
|
||||
Name[sr@ijekavianlatin]=globus
|
||||
Name[sr@latin]=globus
|
||||
Name[sv]=Glob
|
||||
Name[th]=ลูกโลก
|
||||
Name[tr]=Küre
|
||||
Name[ug]=گلوبۇس
|
||||
Name[uk]=Глобус
|
||||
Name[wa]=Bole
|
||||
Name[x-test]=xxGlobexx
|
||||
Name[zh_CN]=地球仪
|
||||
Name[zh_TW]=地球
|
||||
Comment=An interactive map of the world
|
||||
Comment[ar]=خريطة تفاعلية للعالَم
|
||||
Comment[bs]=Interaktivna mapa svijeta
|
||||
Comment[ca]=Un mapa interactiu del món
|
||||
Comment[ca@valencia]=Un mapa interactiu del món
|
||||
Comment[cs]=Interaktivní mapa světa
|
||||
Comment[da]=Et interaktivt verdenskort
|
||||
Comment[de]=Eine interaktive Weltkarte
|
||||
Comment[el]=Ένας διαδραστικός παγκόσμιος χάρτης
|
||||
Comment[en_GB]=An interactive map of the world
|
||||
Comment[es]=Un mapa interactivo del mundo
|
||||
Comment[et]=Interaktiivne maailmakaart
|
||||
Comment[fi]=Vuorovaikutteinen maailmankartta
|
||||
Comment[fr]=Une carte interactive du monde
|
||||
Comment[gl]=Un mapa do mundo interactivo.
|
||||
Comment[hu]=Egy interaktív világtérkép
|
||||
Comment[it]=Una mappa interattiva del mondo
|
||||
Comment[kk]=Интерактивті әлем картасы
|
||||
Comment[ko]=인터랙티브 세계 지도
|
||||
Comment[nb]=Et interaktivt verdenskart
|
||||
Comment[nds]=En brukerstüert Weltkoort
|
||||
Comment[nl]=Een interactieve kaart van de wereld
|
||||
Comment[pl]=Interaktywna mapa świata
|
||||
Comment[pt]=Um mapa interactivo do mundo
|
||||
Comment[pt_BR]=Mapa-múndi interativo
|
||||
Comment[ro]=Hartă interactivă a lumii
|
||||
Comment[ru]=Интерактивная карта мира
|
||||
Comment[sk]=Interaktívna mapa sveta
|
||||
Comment[sl]=Interaktivni zemljevid sveta
|
||||
Comment[sr]=Интерактивна карта света
|
||||
Comment[sr@ijekavian]=Интерактивна карта света
|
||||
Comment[sr@ijekavianlatin]=Interaktivna karta sveta
|
||||
Comment[sr@latin]=Interaktivna karta sveta
|
||||
Comment[sv]=En interaktiv världskarta
|
||||
Comment[tr]=Dünyanın etkileşimli bir haritası
|
||||
Comment[uk]=Інтерактивна карта світу
|
||||
Comment[x-test]=xxAn interactive map of the worldxx
|
||||
Comment[zh_CN]=交互世界地图
|
||||
Comment[zh_TW]=互動世界地圖
|
||||
Type=Service
|
||||
Icon=marble
|
||||
ServiceTypes=Plasma/Wallpaper
|
||||
|
||||
X-KDE-Library=plasma_wallpaper_marble
|
||||
X-KDE-PluginInfo-Author=The Plasma Team
|
||||
X-KDE-PluginInfo-Email=plasma-devel@kde.org
|
||||
X-KDE-PluginInfo-Name=marble
|
||||
X-KDE-PluginInfo-Version=1.0
|
||||
X-KDE-PluginInfo-Website=http://plasma.kde.org/
|
||||
X-KDE-PluginInfo-Depends=
|
||||
X-KDE-PluginInfo-License=GPL
|
||||
X-KDE-PluginInfo-EnabledByDefault=true
|
Loading…
Add table
Reference in a new issue