[Kde-bindings] KDE/kdeedu/marble/src
Bernhard Beschow
bbeschow at cs.tu-berlin.de
Tue Nov 30 15:00:17 UTC 2010
SVN commit 1202358 by beschow:
pass MarbleWidget instead of MarbleModel to DownloadRegionDialog
CCMAIL: kde-bindings at kde.org
M +1 -2 QtMainWindow.cpp
M +11 -8 lib/DownloadRegionDialog.cpp
M +2 -2 lib/DownloadRegionDialog.h
M +1 -1 marble_part.cpp
--- trunk/KDE/kdeedu/marble/src/QtMainWindow.cpp #1202357:1202358
@@ -1136,9 +1136,8 @@
void MainWindow::showDownloadRegionDialog()
{
- MarbleModel *const model = m_controlView->marbleWidget()->model();
if ( !m_downloadRegionDialog ) {
- m_downloadRegionDialog = new DownloadRegionDialog( model, m_controlView );
+ m_downloadRegionDialog = new DownloadRegionDialog( m_controlView->marbleWidget(), m_controlView );
// 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.
--- trunk/KDE/kdeedu/marble/src/lib/DownloadRegionDialog.cpp #1202357:1202358
@@ -33,6 +33,7 @@
#include "MarbleDebug.h"
#include "MarbleMath.h"
#include "MarbleModel.h"
+#include "MarbleWidget.h"
#include "LatLonBoxWidget.h"
#include "TileId.h"
#include "TileLevelRangeWidget.h"
@@ -53,7 +54,7 @@
class DownloadRegionDialog::Private
{
public:
- Private( MarbleModel *const model, QDialog * const dialog );
+ Private( MarbleWidget *const widget, QDialog * const dialog );
QWidget * createSelectionMethodBox();
QLayout * createTilesCounter();
QWidget * createOkCancelButtonBox();
@@ -75,13 +76,14 @@
QPushButton * m_applyButton;
int m_visibleTileLevel;
MarbleModel const*const m_model;
+ MarbleWidget const*const m_widget;
GeoSceneTexture const * m_textureLayer;
SelectionMethod m_selectionMethod;
GeoDataLatLonBox m_visibleRegion;
RoutingModel *m_routingModel;
};
-DownloadRegionDialog::Private::Private( MarbleModel * const model,
+DownloadRegionDialog::Private::Private( MarbleWidget * const widget,
QDialog * const dialog )
: m_dialog( dialog ),
m_visibleRegionMethodButton( 0 ),
@@ -95,12 +97,13 @@
m_tileSizeInfo( 0 ),
m_okButton( 0 ),
m_applyButton( 0 ),
- m_visibleTileLevel( model->tileZoomLevel() ),
- m_model( model ),
- m_textureLayer( model->textureLayer() ),
+ m_visibleTileLevel( widget->model()->tileZoomLevel() ),
+ m_model( widget->model() ),
+ m_widget( widget ),
+ m_textureLayer( widget->model()->textureLayer() ),
m_selectionMethod( VisibleRegionMethod ),
m_visibleRegion(),
- m_routingModel( model->routingManager()->routingModel() )
+ m_routingModel( widget->model()->routingManager()->routingModel() )
{
m_latLonBoxWidget->setEnabled( false );
m_latLonBoxWidget->setLatLonBox( m_visibleRegion );
@@ -250,10 +253,10 @@
return false;
}
-DownloadRegionDialog::DownloadRegionDialog( MarbleModel *const model, QWidget * const parent,
+DownloadRegionDialog::DownloadRegionDialog( MarbleWidget *const widget, QWidget * const parent,
Qt::WindowFlags const f )
: QDialog( parent, f ),
- d( new Private( model, this ))
+ d( new Private( widget, this ))
{
setWindowTitle( tr( "Download Region" ));
QVBoxLayout * const layout = new QVBoxLayout;
--- trunk/KDE/kdeedu/marble/src/lib/DownloadRegionDialog.h #1202357:1202358
@@ -29,7 +29,7 @@
namespace Marble
{
class GeoDataLatLonAltBox;
-class MarbleModel;
+class MarbleWidget;
class ViewportParams;
class MARBLE_EXPORT DownloadRegionDialog: public QDialog
{
@@ -38,7 +38,7 @@
public:
enum SelectionMethod { VisibleRegionMethod, SpecifiedRegionMethod, RouteDownloadMethod };
- explicit DownloadRegionDialog( MarbleModel *const model, QWidget * const parent = 0,
+ explicit DownloadRegionDialog( MarbleWidget *const widget, QWidget * const parent = 0,
Qt::WindowFlags const f = 0 );
~DownloadRegionDialog();
void setAllowedTileLevelRange( int const minimumTileLevel,
--- trunk/KDE/kdeedu/marble/src/marble_part.cpp #1202357:1202358
@@ -1153,7 +1153,7 @@
{
MarbleModel * const model = m_controlView->marbleWidget()->model();
if ( !m_downloadRegionDialog ) {
- m_downloadRegionDialog = new DownloadRegionDialog( model, widget() );
+ m_downloadRegionDialog = new DownloadRegionDialog( m_controlView->marbleWidget(), 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.
More information about the Kde-bindings
mailing list