[Marble-commits] KDE/kdeedu/marble/src
Jens-Michael Hoffmann
jensmh at gmx.de
Wed May 12 22:49:41 CEST 2010
SVN commit 1125983 by jmhoffmann:
DownloadRegionDialog: Do not reuse the visible region of the last invocation,
but update it everytime the dialog is shown. This helps also to get rid of
ViewportParams inside DownloadRegionDialog.
M +7 -14 lib/DownloadRegionDialog.cpp
M +2 -3 lib/DownloadRegionDialog.h
M +4 -2 marble_part.cpp
--- trunk/KDE/kdeedu/marble/src/lib/DownloadRegionDialog.cpp #1125982:1125983
@@ -26,7 +26,7 @@
#include <QtGui/QVBoxLayout>
#include "AbstractScanlineTextureMapper.h"
-#include "GeoDataLatLonBox.h"
+#include "GeoDataLatLonAltBox.h"
#include "GeoSceneTexture.h"
#include "MarbleDebug.h"
#include "MarbleMath.h"
@@ -35,7 +35,6 @@
#include "TileId.h"
#include "TileLevelRangeWidget.h"
#include "TileLoaderHelper.h"
-#include "ViewportParams.h"
namespace Marble
{
@@ -45,9 +44,7 @@
class DownloadRegionDialog::Private
{
public:
- Private( ViewportParams const * const viewport,
- MarbleModel const * const model,
- QDialog * const dialog );
+ Private( MarbleModel const * const model, QDialog * const dialog );
QWidget * createSelectionMethodBox();
QLayout * createTilesCounter();
QWidget * createOkCancelButtonBox();
@@ -66,14 +63,12 @@
int m_originatingTileLevel;
int m_minimumAllowedTileLevel;
int m_maximumAllowedTileLevel;
- ViewportParams const * const m_viewport;
MarbleModel const * const m_model;
GeoSceneTexture const * m_textureLayer;
GeoDataLatLonBox m_visibleRegion;
};
-DownloadRegionDialog::Private::Private( ViewportParams const * const viewport,
- MarbleModel const * const model,
+DownloadRegionDialog::Private::Private( MarbleModel const * const model,
QDialog * const dialog )
: m_dialog( dialog ),
m_latLonBoxWidget( new LatLonBoxWidget ),
@@ -85,10 +80,9 @@
m_originatingTileLevel( model->textureMapper()->tileZoomLevel() ),
m_minimumAllowedTileLevel( -1 ),
m_maximumAllowedTileLevel( -1 ),
- m_viewport( viewport ),
m_model( model ),
m_textureLayer( model->textureMapper()->textureLayer() ),
- m_visibleRegion( viewport->viewLatLonAltBox() )
+ m_visibleRegion()
{
m_latLonBoxWidget->setEnabled( false );
m_latLonBoxWidget->setLatLonBox( m_visibleRegion );
@@ -180,11 +174,10 @@
}
-DownloadRegionDialog::DownloadRegionDialog( ViewportParams const * const viewport,
- MarbleModel const * const model,
- QWidget * const parent, Qt::WindowFlags const f )
+DownloadRegionDialog::DownloadRegionDialog( MarbleModel const * const model, QWidget * const parent,
+ Qt::WindowFlags const f )
: QDialog( parent, f ),
- d( new Private( viewport, model, this ))
+ d( new Private( model, this ))
{
setWindowTitle( tr( "Download Region" ));
--- trunk/KDE/kdeedu/marble/src/lib/DownloadRegionDialog.h #1125982:1125983
@@ -33,9 +33,8 @@
Q_OBJECT
public:
- DownloadRegionDialog( ViewportParams const * const viewport,
- MarbleModel const * const model,
- QWidget * const parent = 0, Qt::WindowFlags const f = 0 );
+ explicit DownloadRegionDialog( MarbleModel const * const model, QWidget * const parent = 0,
+ Qt::WindowFlags const f = 0 );
void setAllowedTileLevelRange( int const minimumTileLevel,
int const maximumTileLevel );
--- trunk/KDE/kdeedu/marble/src/marble_part.cpp #1125982:1125983
@@ -991,10 +991,9 @@
void MarblePart::showDownloadRegionDialog()
{
- ViewportParams * const viewport = m_controlView->marbleWidget()->map()->viewParams()->viewport();
MarbleModel * const model = m_controlView->marbleWidget()->map()->model();
if ( !m_downloadRegionDialog ) {
- m_downloadRegionDialog = new DownloadRegionDialog( viewport, model, widget() );
+ m_downloadRegionDialog = new DownloadRegionDialog( model, widget() );
// it might be tempting to move the connects to DownloadRegionDialog's "accepted" and
// "applied" signals, be aware that the "hidden" signal might be come before the "accepted"
// signal, leading to a too early disconnect.
@@ -1006,6 +1005,9 @@
}
// FIXME: get allowed range from current map theme
m_downloadRegionDialog->setAllowedTileLevelRange( 0, 18 );
+ ViewportParams const * const viewport =
+ m_controlView->marbleWidget()->map()->viewParams()->viewport();
+ m_downloadRegionDialog->setVisibleLatLonAltBox( viewport->viewLatLonAltBox() );
m_downloadRegionDialog->show();
m_downloadRegionDialog->raise();
More information about the Marble-commits
mailing list