Commit 31f9806c authored by Torsten Rahn's avatar Torsten Rahn
Browse files

- Fixes as in 4.1 Branch 833426:

- Make Mouse navigation work after changing projections.
- Make Geopainter work with polygons again (regression).
- Fix Credits for OpenStreetMap according to the license.
- Remove action checkboxes that are accessible via the menu.
- Fix icon names.
- Remove UTM combobox entry as it wasn't implemented in time for KDE 4.1
- Started to fix "pressing clear Cache button issue".


svn path=/trunk/KDE/kdeedu/marble/; revision=833428
parent bc443c86
......@@ -232,15 +232,6 @@
<section name="coordinate-grid" checkable="true" connect="coordinate-grid" spacing="12">
<heading>Coordinate Grid</heading>
</section>
<section name="compass" checkable="true" connect="compass" spacing="12">
<heading>Compass</heading>
</section>
<section name="scalebar" checkable="true" connect="scalebar" spacing="12">
<heading>Scale Bar</heading>
</section>
</legend>
</document>
</dgml>
......@@ -217,19 +217,9 @@
</item>
</section>
<section name="coordinate-grid" checkable="true" connect="coordinate-grid" spacing="12">
<heading>Coordinate Grid</heading>
</section>
<section name="compass" checkable="true" connect="compass" spacing="12">
<heading>Compass</heading>
</section>
<section name="scalebar" checkable="true" connect="scalebar" spacing="12">
<heading>Scale Bar</heading>
</section>
</legend>
</document>
</dgml>
......@@ -244,15 +244,6 @@
<section name="coordinate-grid" checkable="true" connect="coordinate-grid" spacing="12">
<heading>Coordinate Grid</heading>
</section>
<section name="compass" checkable="true" connect="compass" spacing="12">
<heading>Compass</heading>
</section>
<section name="scalebar" checkable="true" connect="scalebar" spacing="12">
<heading>Scale Bar</heading>
</section>
</legend>
</document>
</dgml>
......@@ -224,18 +224,9 @@
</item>
</section>
<section name="coordinate-grid" checkable="true" connect="coordinate-grid" spacing="12">
<heading>Coordinate Grid</heading>
</section>
<section name="compass" checkable="true" connect="compass" spacing="12">
<heading>Compass</heading>
</section>
<section name="scalebar" checkable="true" connect="scalebar" spacing="12">
<heading>Scale Bar</heading>
</section>
</legend>
</document>
</dgml>
......@@ -285,14 +285,6 @@
<section name="coordinate-grid" checkable="true" connect="coordinate-grid" spacing="12">
<heading>Coordinate Grid</heading>
</section>
<section name="compass" checkable="true" connect="compass" spacing="12">
<heading>Compass</heading>
</section>
<section name="scalebar" checkable="true" connect="scalebar" spacing="12">
<heading>Scale Bar</heading>
</section>
</legend>
</document>
</dgml>
......@@ -285,14 +285,6 @@
<section name="coordinate-grid" checkable="true" connect="coordinate-grid" spacing="12">
<heading>Coordinate Grid</heading>
</section>
<section name="compass" checkable="true" connect="compass" spacing="12">
<heading>Compass</heading>
</section>
<section name="scalebar" checkable="true" connect="scalebar" spacing="12">
<heading>Scale Bar</heading>
</section>
</legend>
</document>
</dgml>
......@@ -335,14 +335,6 @@
<section name="coordinate-grid" checkable="true" connect="coordinate-grid" spacing="12">
<heading>Coordinate Grid</heading>
</section>
<section name="compass" checkable="true" connect="compass" spacing="12">
<heading>Compass</heading>
</section>
<section name="scalebar" checkable="true" connect="scalebar" spacing="12">
<heading>Scale Bar</heading>
</section>
</legend>
</document>
</dgml>
......@@ -288,14 +288,6 @@
<section name="coordinate-grid" checkable="true" connect="coordinate-grid" spacing="12">
<heading>Coordinate Grid</heading>
</section>
<section name="compass" checkable="true" connect="compass" spacing="12">
<heading>Compass</heading>
</section>
<section name="scalebar" checkable="true" connect="scalebar" spacing="12">
<heading>Scale Bar</heading>
</section>
</legend>
</document>
</dgml>
......@@ -289,14 +289,6 @@
<section name="coordinate-grid" checkable="true" connect="coordinate-grid" spacing="12">
<heading>Coordinate Grid</heading>
</section>
<section name="compass" checkable="true" connect="compass" spacing="12">
<heading>Compass</heading>
</section>
<section name="scalebar" checkable="true" connect="scalebar" spacing="12">
<heading>Scale Bar</heading>
</section>
</legend>
</document>
</dgml>
......@@ -18,6 +18,12 @@
#include <kparts/part.h>
#include <kparts/componentfactory.h>
#include <QtCore/QDebug>
// GeoData
#include <GeoSceneDocument.h>
#include <GeoSceneHead.h>
// Local dir
#include "ControlView.h"
#include "marble_part.h"
......@@ -40,6 +46,10 @@ MainWindow::MainWindow( const QString& marbleDataPath, QWidget *parent )
m_part->createInfoBoxesMenu();
setAutoSaveSettings();
connect( marbleWidget(), SIGNAL( themeChanged( QString ) ),
this, SLOT( setMapTitle() ) );
setMapTitle();
}
MainWindow::~MainWindow()
......@@ -57,4 +67,9 @@ MarbleWidget* MainWindow::marbleWidget() const
return m_part->controlView()->marbleWidget();
}
void MainWindow::setMapTitle()
{
setCaption( marbleWidget()->mapTheme()->head()->name() );
}
#include "KdeMainWindow.moc"
......@@ -32,6 +32,9 @@ class MainWindow : public KXmlGuiWindow
ControlView* marbleControl() const;
MarbleWidget* marbleWidget() const;
public slots:
void setMapTitle();
private:
MarblePart *m_part;
};
......
......@@ -42,6 +42,11 @@ bool CacheStoragePolicy::updateFile( const QString &fileName, const QByteArray &
return true;
}
void CacheStoragePolicy::clearCache()
{
m_cache.clear();
}
QString CacheStoragePolicy::lastErrorMessage() const
{
return m_errorMsg;
......
......@@ -41,6 +41,11 @@ class MARBLE_EXPORT CacheStoragePolicy : public StoragePolicy
*/
bool updateFile( const QString &fileName, const QByteArray &data );
/**
* Clears the cache.
*/
void clearCache();
/**
* Returns the last error message.
*/
......
......@@ -15,6 +15,7 @@
// Qt
#include <QtCore/QDebug>
#include <QtCore/QDir>
#include <QtCore/QDirIterator>
#include <QtCore/QFile>
#include <QtCore/QFileInfo>
......@@ -75,6 +76,17 @@ bool FileStoragePolicy::updateFile( const QString &fileName, const QByteArray &d
return true;
}
void FileStoragePolicy::clearCache()
{
QDirIterator it( m_dataDirectory, QDirIterator::Subdirectories );
while (it.hasNext()) {
qDebug() << it.next();
// if( it.fileName().endsWith(".jpg") )
// QFile::remove( it.fileName() );
}
}
QString FileStoragePolicy::lastErrorMessage() const
{
return m_errorMsg;
......
......@@ -38,6 +38,11 @@ class FileStoragePolicy : public StoragePolicy
*/
bool updateFile( const QString &fileName, const QByteArray &data );
/**
* Clears the cache.
*/
void clearCache();
/**
* Returns the last error message.
*/
......
......@@ -48,7 +48,7 @@ class GeoPainterPrivate
{
int x, y;
bool previousGlobeHidesPoint;
//AbstractProjection *projection = m_viewport->currentProjection();
AbstractProjection *projection = m_viewport->currentProjection();
if ( isGeoProjected == false ) {
......@@ -58,7 +58,7 @@ class GeoPainterPrivate
GeoDataPoint *itPoint = const_cast<GeoDataPoint *>( points );
while ( itPoint < points + pointCount ) {
bool globeHidesPoint;
//bool isVisible = projection->screenCoordinates( *itPoint, m_viewport, x, y, globeHidesPoint );
bool isVisible = projection->screenCoordinates( *itPoint, m_viewport, x, y, globeHidesPoint );
if ( itPoint == points ){
polygon = new QPolygon;
......
......@@ -72,7 +72,7 @@
MarbleMapPrivate::MarbleMapPrivate( MarbleMap *parent )
: m_parent( parent ),
m_persistentTileCacheLimit( 1024*1024*300 ), // 300 MB
m_volatileTileCacheLimit( 1024*3 ) // 3 KB
m_volatileTileCacheLimit( 1024*1024*30 ) // 30 MB
{
/* NOOP */
}
......@@ -1138,6 +1138,7 @@ FileViewModel* MarbleMap::fileViewModel() const
void MarbleMap::clearPersistentTileCache()
{
}
void MarbleMap::setPersistentTileCacheLimit( quint64 kiloBytes )
......
......@@ -104,11 +104,6 @@ p, li { white-space: pre-wrap; }
<string>Degree (Decimal)</string>
</property>
</item>
<item>
<property name="text" >
<string>UTM</string>
</property>
</item>
</widget>
</item>
</layout>
......@@ -342,7 +337,7 @@ p, li { white-space: pre-wrap; }
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" >
<property name="sizeHint" stdset="0" >
<size>
<width>446</width>
<height>20</height>
......
......@@ -470,12 +470,7 @@ void MarbleWidget::zoomView(int newZoom)
// We only have to repaint the background every time if the globe
// doesn't cover the whole image.
if ( ! d->m_map->mapCoversViewport() ) {
setAttribute( Qt::WA_NoSystemBackground, false );
}
else {
setAttribute( Qt::WA_NoSystemBackground, true );
}
setAttribute( Qt::WA_NoSystemBackground, d->m_map->mapCoversViewport() );
emit distanceChanged( distanceString() );
......@@ -572,12 +567,7 @@ void MarbleWidget::centerOn( const GeoDataPoint &position, bool animated )
d->m_map->centerOn( lon, lat );
}
if ( d->m_map->mapCoversViewport() ) {
setAttribute(Qt::WA_NoSystemBackground, true );
}
else {
setAttribute(Qt::WA_NoSystemBackground, false );
}
setAttribute(Qt::WA_NoSystemBackground, d->m_map->mapCoversViewport() );
repaint();
}
......@@ -616,14 +606,10 @@ void MarbleWidget::setProjection( Projection projection )
{
d->m_map->setProjection( projection );
if ( d->m_map->mapCoversViewport() ) {
setAttribute( Qt::WA_NoSystemBackground, true );
}
else {
setAttribute( Qt::WA_NoSystemBackground, false );
}
setAttribute( Qt::WA_NoSystemBackground, d->m_map->mapCoversViewport() );
repaint();
setActiveRegion();
}
void MarbleWidget::setProjection( int projection )
......@@ -712,12 +698,7 @@ void MarbleWidget::resizeEvent (QResizeEvent*)
// Redefine the area where the mousepointer becomes a navigationarrow
setActiveRegion();
if ( d->m_map->mapCoversViewport() ) {
setAttribute(Qt::WA_NoSystemBackground, true );
}
else {
setAttribute(Qt::WA_NoSystemBackground, false );
}
setAttribute(Qt::WA_NoSystemBackground, d->m_map->mapCoversViewport() );
repaint();
}
......
......@@ -27,6 +27,8 @@ class StoragePolicy
virtual bool updateFile( const QString &fileName, const QByteArray &data ) = 0;
virtual void clearCache() = 0;
virtual QString lastErrorMessage() const = 0;
};
......
......@@ -56,6 +56,7 @@ void SunControlWidget::showSunClicked(bool checked)
void SunControlWidget::nowClicked(bool checked)
{
Q_UNUSED( checked )
m_sunLocator->datetime()->setNow();
updateDateTime();
}
......
......@@ -618,20 +618,20 @@ void MarblePart::editSettings()
QWidget *w_viewSettings = new QWidget( 0 );
w_viewSettings->setObjectName( "view_page" );
ui_viewSettings.setupUi( w_viewSettings );
m_configDialog->addPage( w_viewSettings, i18n( "View" ), "preferences-view" );
m_configDialog->addPage( w_viewSettings, i18n( "View" ), "configure" );
// navigation page
Ui_MarbleNavigationSettingsWidget ui_navigationSettings;
QWidget *w_navigationSettings = new QWidget( 0 );
w_navigationSettings->setObjectName( "navigation_page" );
ui_navigationSettings.setupUi( w_navigationSettings );
m_configDialog->addPage( w_navigationSettings, i18n( "Navigation" ), "preferences-navigation" );
m_configDialog->addPage( w_navigationSettings, i18n( "Navigation" ), "transform-move" );
// cache page
MarbleCacheSettingsWidget *w_cacheSettings =
new MarbleCacheSettingsWidget();
w_cacheSettings->setObjectName( "cache_page" );
m_configDialog->addPage( w_cacheSettings, i18n( "Cache & Proxy" ), "preferences-cache" );
m_configDialog->addPage( w_cacheSettings, i18n( "Cache & Proxy" ), "preferences-web-browser-cache" );
connect( w_cacheSettings, SIGNAL( clearVolatileCache() ), m_controlView->marbleWidget(), SLOT( clearVolatileTileCache() ) );
connect( w_cacheSettings, SIGNAL( clearPersistentCache() ), m_controlView->marbleWidget(), SLOT( clearPersistentTileCache() ) );
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment