Skip to content

Commit

Permalink
More api cleanups mainly affecting gui
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@9233 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
timlinux committed Aug 31, 2008
1 parent 7d0dcbd commit 26f71d0
Show file tree
Hide file tree
Showing 45 changed files with 134 additions and 134 deletions.
2 changes: 1 addition & 1 deletion python/gui/qgisinterface.sip
Expand Up @@ -31,7 +31,7 @@ class QgisInterface : QObject
//! Zoom to full extent of map layers
virtual void zoomFull()=0;
//! Zoom to previous view extent
virtual void zoomPrevious()=0;
virtual void zoomToPrevious()=0;
//! Zoome to extent of the active layer
virtual void zoomActiveLayer()=0;

Expand Down
16 changes: 8 additions & 8 deletions python/gui/qgsmapcanvas.sip
Expand Up @@ -11,13 +11,13 @@ class QgsMapCanvasLayer
%End

public:
QgsMapCanvasLayer(QgsMapLayer* layer, bool visible = TRUE, bool inOverview = FALSE);
QgsMapCanvasLayer(QgsMapLayer* layer, bool visible = TRUE, bool isInOverview = FALSE);

void setVisible(bool visible);
void setInOverview(bool inOverview);
void setInOverview(bool isInOverview);

bool isVisible() const;
bool inOverview() const;
bool isInOverview() const;

QgsMapLayer* layer();
//const QgsMapLayer* layer() const;
Expand Down Expand Up @@ -68,7 +68,7 @@ class QgsMapCanvas : QGraphicsView
QPixmap& canvasPixmap();

//! Get the last reported scale of the canvas
double getScale();
double scale();

//! Clear the map canvas
void clear();
Expand All @@ -85,10 +85,10 @@ class QgsMapCanvas : QGraphicsView
void setExtent(const QgsRect & r);

//! Zoom to the full extent of all layers
void zoomFullExtent();
void zoomToFullExtent();

//! Zoom to the previous extent (view)
void zoomPreviousExtent();
void zoomToPreviousExtent();

/**Zooms to the extend of the selected features*/
void zoomToSelected();
Expand Down Expand Up @@ -165,7 +165,7 @@ class QgsMapCanvas : QGraphicsView
void enableAntiAliasing(bool theFlag);

//! Select which Qt class to render with
void useQImageToRender(bool theFlag);
void useImageToRender(bool theFlag);

// following 2 methods should be moved elsewhere or changed to private
// currently used by pan map tool
Expand Down Expand Up @@ -272,7 +272,7 @@ class QgsMapCanvas : QGraphicsView
void moveCanvasContents(bool reset = FALSE);

//! called on resize or changed extent to notify canvas items to change their rectangle
void updateCanvasItemsPositions();
void updateCanvasItemPositions();


}; // class QgsMapCanvas
Expand Down
4 changes: 2 additions & 2 deletions python/gui/qgsmapcanvasitem.sip
Expand Up @@ -42,10 +42,10 @@ class QgsMapCanvasItem : QGraphicsItem
void setRect(const QgsRect& r);

//! transformation from screen coordinates to map coordinates
QgsPoint toMapCoords(const QPoint& point);
QgsPoint toMapCoordinates(const QPoint& point);

//! transformation from map coordinates to screen coordinates
QPointF toCanvasCoords(const QgsPoint& point);
QPointF toCanvasCoordinates(const QgsPoint& point);

};

Expand Down
2 changes: 1 addition & 1 deletion python/gui/qgsmapcanvasmap.sip
Expand Up @@ -33,7 +33,7 @@ class QgsMapCanvasMap : QGraphicsRectItem

void enableAntiAliasing(bool flag);

void useQImageToRender(bool flag);
void useImageToRender(bool flag);

//! renders map using QgsMapRender to mPixmap
void render();
Expand Down
2 changes: 1 addition & 1 deletion python/gui/qgsmapoverviewcanvas.sip
Expand Up @@ -17,7 +17,7 @@ class QgsMapOverviewCanvas : QWidget
void refresh();

//! changes background color
void setbgColor(const QColor& color);
void setBackgroundColor(const QColor& color);

//! updates layer set for overview
void setLayerSet(const QStringList& layerSet);
Expand Down
12 changes: 6 additions & 6 deletions python/gui/qgsmaptool.sip
Expand Up @@ -57,7 +57,7 @@ class QgsMapTool : QObject
/** Check whether this MapTool performs a zoom or pan operation.
* If it does, we will be able to perform the zoom and then
* resume operations with the original / previously used tool.*/
virtual bool isZoomTool();
virtual bool isTransient();

/** Check whether this MapTool performs an edit operation.
* If it does, we will deactivate it when editing is turned off
Expand All @@ -76,19 +76,19 @@ class QgsMapTool : QObject
QgsMapTool(QgsMapCanvas* canvas /TransferThis/);

//! transformation from screen coordinates to map coordinates
QgsPoint toMapCoords(const QPoint& point);
QgsPoint toMapCoordinates(const QPoint& point);

//! transformation from screen coordinates to layer's coordinates
QgsPoint toLayerCoords(QgsMapLayer* layer, const QPoint& point);
QgsPoint toLayerCoordinates(QgsMapLayer* layer, const QPoint& point);

//! trnasformation from map coordinates to layer's coordinates
QgsPoint toLayerCoords(QgsMapLayer* layer, const QgsPoint& point);
QgsPoint toLayerCoordinates(QgsMapLayer* layer, const QgsPoint& point);

//! trnasformation of the rect from map coordinates to layer's coordinates
QgsRect toLayerCoords(QgsMapLayer* layer, const QgsRect& rect);
QgsRect toLayerCoordinates(QgsMapLayer* layer, const QgsRect& rect);

//! transformation from map coordinates to screen coordinates
QPoint toCanvasCoords(const QgsPoint& point);
QPoint toCanvasCoordinates(const QgsPoint& point);


};
Expand Down
2 changes: 1 addition & 1 deletion python/gui/qgsmaptoolpan.sip
Expand Up @@ -18,7 +18,7 @@ class QgsMapToolPan : QgsMapTool
//! Overridden mouse release event
virtual void canvasReleaseEvent(QMouseEvent * e);

virtual bool isZoomTool();
virtual bool isTransient();

};

2 changes: 1 addition & 1 deletion python/gui/qgsmaptoolzoom.sip
Expand Up @@ -18,7 +18,7 @@ class QgsMapToolZoom : QgsMapTool
//! Overridden mouse release event
virtual void canvasReleaseEvent(QMouseEvent * e);

virtual bool isZoomTool();
virtual bool isTransient();

};

10 changes: 5 additions & 5 deletions src/app/legend/qgslegend.cpp
Expand Up @@ -511,7 +511,7 @@ void QgsLegend::addLayer( QgsMapLayer * layer )

// first layer?
if ( mMapCanvas->layerCount() == 1 )
mMapCanvas->zoomFullExtent();
mMapCanvas->zoomToFullExtent();
setCurrentItem( llayer );
//make the QTreeWidget item up-to-date
doItemsLayout();
Expand Down Expand Up @@ -910,7 +910,7 @@ bool QgsLegend::writeXML( QDomNode & legendnode, QDomDocument & document )
legendlayerfilenode.setAttribute( "visible", llf->isVisible() );

// show in overview flag
legendlayerfilenode.setAttribute( "inOverview", llf->isInOverview() );
legendlayerfilenode.setAttribute( "isInOverview", llf->isInOverview() );
}
break;

Expand Down Expand Up @@ -1035,7 +1035,7 @@ bool QgsLegend::readXML( QDomNode& legendnode )

// load layer's visibility and 'show in overview' flag
theLegendLayerFile->setVisible( atoi( childelem.attribute( "visible", "1" ).toUtf8() ) ); //Default is visible
theLegendLayerFile->setInOverview( atoi( childelem.attribute( "inOverview" ).toUtf8() ) );
theLegendLayerFile->setInOverview( atoi( childelem.attribute( "isInOverview" ).toUtf8() ) );

// set the check state
blockSignals( true );
Expand Down Expand Up @@ -1399,15 +1399,15 @@ void QgsLegend::updateOverview()
mMapCanvas->updateOverview();
}

void QgsLegend::setOverviewAllLayers( bool inOverview )
void QgsLegend::setOverviewAllLayers( bool isInOverview )
{
QTreeWidgetItem* theItem = firstItem();
while ( theItem )
{
QgsLegendLayerFile* llf = dynamic_cast<QgsLegendLayerFile*>( theItem );
if ( llf )
{
llf->setInOverview( inOverview );
llf->setInOverview( isInOverview );
}
theItem = nextItem( theItem );
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/legend/qgslegend.h
Expand Up @@ -154,7 +154,7 @@ class QgsLegend : public QTreeWidget
void updateOverview();

/**Show/remove all layer in/from overview*/
void setOverviewAllLayers( bool inOverview );
void setOverviewAllLayers( bool isInOverview );

/**Adds an entry to mPixmapWidthValues*/
void addPixmapWidthValue( int width );
Expand Down
14 changes: 7 additions & 7 deletions src/app/legend/qgslegendlayerfile.cpp
Expand Up @@ -102,7 +102,7 @@ void QgsLegendLayerFile::updateLegendItem()
{
QPixmap pix = legend()->pixmaps().mOriginalPixmap;

if ( mLyr.inOverview() )
if ( mLyr.isInOverview() )
{
//add overview glasses to the pixmap
QPainter p( &pix );
Expand Down Expand Up @@ -130,12 +130,12 @@ void QgsLegendLayerFile::updateLegendItem()

}

void QgsLegendLayerFile::setIconAppearance( bool inOverview,
void QgsLegendLayerFile::setIconAppearance( bool isInOverview,
bool editable )
{
QPixmap newIcon( getOriginalPixmap() );

if ( inOverview )
if ( isInOverview )
{
// Overlay the overview icon on the default icon
QPixmap myPixmap = QgisApp::getThemePixmap( "mIconOverview.png" );
Expand Down Expand Up @@ -189,14 +189,14 @@ bool QgsLegendLayerFile::isVisible()
return mLyr.isVisible();
}

void QgsLegendLayerFile::setInOverview( bool inOverview )
void QgsLegendLayerFile::setInOverview( bool isInOverview )
{
mLyr.setInOverview( inOverview );
mLyr.setInOverview( isInOverview );
}

bool QgsLegendLayerFile::isInOverview()
{
return mLyr.inOverview();
return mLyr.isInOverview();
}

void QgsLegendLayerFile::showInOverview()
Expand Down Expand Up @@ -333,7 +333,7 @@ void QgsLegendLayerFile::addToPopupMenu( QMenu& theMenu, QAction* toggleEditingA
QAction* showInOverviewAction = theMenu.addAction( tr( "&Show in overview" ), this, SLOT( showInOverview() ) );
showInOverviewAction->setCheckable( true );
showInOverviewAction->blockSignals( true );
showInOverviewAction->setChecked( mLyr.inOverview() );
showInOverviewAction->setChecked( mLyr.isInOverview() );
showInOverviewAction->blockSignals( false );

// remove from canvas
Expand Down
4 changes: 2 additions & 2 deletions src/app/legend/qgslegendlayerfile.h
Expand Up @@ -46,7 +46,7 @@ class QgsLegendLayerFile : public QgsLegendItem

QPixmap getOriginalPixmap() const;

void setIconAppearance( bool inOverview, bool editable );
void setIconAppearance( bool isInOverview, bool editable );

/**Returns a label for a layer. Is static such that
the name can be passed to the constructor of QgsLegendLayerFile*/
Expand All @@ -55,7 +55,7 @@ class QgsLegendLayerFile : public QgsLegendItem
void setVisible( bool visible = TRUE );
bool isVisible();

void setInOverview( bool inOverview = TRUE );
void setInOverview( bool isInOverview = TRUE );
bool isInOverview();

/** called to add appropriate menu items to legend's popup menu */
Expand Down
18 changes: 9 additions & 9 deletions src/app/qgisapp.cpp
Expand Up @@ -728,7 +728,7 @@ void QgisApp::createActions()
mActionZoomLast = new QAction( getThemeIcon( "mActionZoomLast.png" ), tr( "Zoom Last" ), this );
//mActionZoomLast->setShortcut(tr("Ctrl+O","Zoom to Last Extent"));
mActionZoomLast->setStatusTip( tr( "Zoom to Last Extent" ) );
connect( mActionZoomLast, SIGNAL( triggered() ), this, SLOT( zoomPrevious() ) );
connect( mActionZoomLast, SIGNAL( triggered() ), this, SLOT( zoomToPrevious() ) );

mActionZoomActualSize = new QAction( tr( "Zoom Actual Size" ), this );
mActionZoomActualSize->setStatusTip( tr( "Zoom to Actual Size" ) );
Expand Down Expand Up @@ -825,7 +825,7 @@ void QgisApp::createActions()
mActionAddToOverview = new QAction( getThemeIcon( "mActionInOverview.png" ), tr( "Add to Overview" ), this );
mActionAddToOverview->setShortcut( tr( "O", "Add current layer to overview map" ) );
mActionAddToOverview->setStatusTip( tr( "Add current layer to overview map" ) );
connect( mActionAddToOverview, SIGNAL( triggered() ), this, SLOT( inOverview() ) );
connect( mActionAddToOverview, SIGNAL( triggered() ), this, SLOT( isInOverview() ) );
mActionAddToOverview->setEnabled( false );

mActionAddAllToOverview = new QAction( getThemeIcon( "mActionAddAllToOverview.png" ), tr( "Add All to Overview" ), this );
Expand Down Expand Up @@ -1596,7 +1596,7 @@ void QgisApp::createOverview()
// moved here to set anti aliasing to both map canvas and overview
QSettings mySettings;
mMapCanvas->enableAntiAliasing( mySettings.value( "/qgis/enable_anti_aliasing", false ).toBool() );
mMapCanvas->useQImageToRender( mySettings.value( "/qgis/use_qimage_to_render", false ).toBool() );
mMapCanvas->useImageToRender( mySettings.value( "/qgis/use_qimage_to_render", false ).toBool() );

int action = mySettings.value( "/qgis/wheel_action", 0 ).toInt();
double zoomFactor = mySettings.value( "/qgis/zoom_factor", 2 ).toDouble();
Expand Down Expand Up @@ -3650,15 +3650,15 @@ void QgisApp::pan()

void QgisApp::zoomFull()
{
mMapCanvas->zoomFullExtent();
mMapCanvas->zoomToFullExtent();
// notify the project we've made a change
QgsProject::instance()->dirty( true );

}

void QgisApp::zoomPrevious()
void QgisApp::zoomToPrevious()
{
mMapCanvas->zoomPreviousExtent();
mMapCanvas->zoomToPreviousExtent();
// notify the project we've made a change
QgsProject::instance()->dirty( true );

Expand Down Expand Up @@ -4078,7 +4078,7 @@ void QgisApp::showScale( double theScale )

void QgisApp::userScale()
{
double currentScale = mMapCanvas->getScale();
double currentScale = mMapCanvas->scale();

QStringList parts = mScaleEdit->text().split( ':' );
if ( parts.size() == 2 )
Expand All @@ -4096,7 +4096,7 @@ void QgisApp::userScale()


// toggle overview status
void QgisApp::inOverview()
void QgisApp::isInOverview()
{
mMapLegend->legendLayerShowInOverview();
}
Expand Down Expand Up @@ -4477,7 +4477,7 @@ void QgisApp::options()

QSettings mySettings;
mMapCanvas->enableAntiAliasing( mySettings.value( "/qgis/enable_anti_aliasing" ).toBool() );
mMapCanvas->useQImageToRender( mySettings.value( "/qgis/use_qimage_to_render" ).toBool() );
mMapCanvas->useImageToRender( mySettings.value( "/qgis/use_qimage_to_render" ).toBool() );

int action = mySettings.value( "/qgis/wheel_action", 0 ).toInt();
double zoomFactor = mySettings.value( "/qgis/zoom_factor", 2 ).toDouble();
Expand Down
4 changes: 2 additions & 2 deletions src/app/qgisapp.h
Expand Up @@ -312,7 +312,7 @@ class QgisApp : public QMainWindow
//! Zoom to full extent
void zoomFull();
//! Zoom to the previous extent
void zoomPrevious();
void zoomToPrevious();
//! Zoom to selected features
void zoomToSelected();

Expand Down Expand Up @@ -358,7 +358,7 @@ class QgisApp : public QMainWindow
void addDatabaseLayer();
//#endif
/** toggles whether the current selected layer is in overview or not */
void inOverview();
void isInOverview();
//! Slot to show the map coordinate position of the mouse cursor
void showMouseCoordinate( QgsPoint & );
//! Slot to show current map scale;
Expand Down
4 changes: 2 additions & 2 deletions src/app/qgisappinterface.cpp
Expand Up @@ -47,9 +47,9 @@ void QgisAppInterface::zoomFull()
qgis->zoomFull();
}

void QgisAppInterface::zoomPrevious()
void QgisAppInterface::zoomToPrevious()
{
qgis->zoomPrevious();
qgis->zoomToPrevious();
}

void QgisAppInterface::zoomActiveLayer()
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgisappinterface.h
Expand Up @@ -46,7 +46,7 @@ class QgisAppInterface : public QgisInterface
//! Zoom map to full extent
void zoomFull();
//! Zoom map to previous extent
void zoomPrevious();
void zoomToPrevious();
//! Zoom to active layer
void zoomActiveLayer();

Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsmaptooladdfeature.cpp
Expand Up @@ -103,7 +103,7 @@ void QgsMapToolAddFeature::canvasReleaseEvent( QMouseEvent * e )
idPoint = snapPointFromResults( snapResults, e->pos() );
try
{
savePoint = toLayerCoords( vlayer, idPoint );
savePoint = toLayerCoordinates( vlayer, idPoint );
QgsDebugMsg( "savePoint = " + savePoint.toString() );
}
catch ( QgsCsException &cse )
Expand Down

0 comments on commit 26f71d0

Please sign in to comment.