Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
automatic indentation update (r9281-r9365)
git-svn-id: http://svn.osgeo.org/qgis/trunk@9366 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Sep 21, 2008
1 parent 02e17b5 commit 73eb705
Show file tree
Hide file tree
Showing 27 changed files with 203 additions and 201 deletions.
70 changes: 35 additions & 35 deletions src/app/composer/qgscomposer.cpp
Expand Up @@ -435,10 +435,10 @@ void QgsComposer::on_mActionPrint_activated( void )
return;
}

if(containsWMSLayer())
{
showWMSPrintingWarning();
}
if ( containsWMSLayer() )
{
showWMSPrintingWarning();
}

QPrinter printer;

Expand Down Expand Up @@ -492,10 +492,10 @@ void QgsComposer::on_mActionPrint_activated( void )

void QgsComposer::on_mActionExportAsImage_activated( void )
{
if(containsWMSLayer())
{
showWMSPrintingWarning();
}
if ( containsWMSLayer() )
{
showWMSPrintingWarning();
}

// Image size
int width = ( int )( mComposition->printoutResolution() * mComposition->paperWidth() / 25.4 );
Expand Down Expand Up @@ -567,7 +567,7 @@ void QgsComposer::on_mActionExportAsImage_activated( void )
)
);

myQFileDialog->setFileMode(QFileDialog::AnyFile);
myQFileDialog->setFileMode( QFileDialog::AnyFile );

// set the filter to the last one used
myQFileDialog->selectFilter( myLastUsedFilter );
Expand All @@ -587,7 +587,7 @@ void QgsComposer::on_mActionExportAsImage_activated( void )
}

myOutputFileNameQString = myQFileDialog->selectedFiles().last();
qWarning(myOutputFileNameQString.toLocal8Bit().data());
qWarning( myOutputFileNameQString.toLocal8Bit().data() );
QString myFilterString = myQFileDialog->selectedFilter();
QgsDebugMsg( QString( "Selected filter: %1" ).arg( myFilterString ) );
QgsDebugMsg( QString( "Image type: %1" ).arg( myFilterMap[myFilterString] ) );
Expand Down Expand Up @@ -618,10 +618,10 @@ void QgsComposer::on_mActionExportAsImage_activated( void )

void QgsComposer::on_mActionExportAsSVG_activated( void )
{
if(containsWMSLayer())
{
showWMSPrintingWarning();
}
if ( containsWMSLayer() )
{
showWMSPrintingWarning();
}

QString myQSettingsLabel = "/UI/displaySVGWarning";
QSettings myQSettings;
Expand Down Expand Up @@ -1102,18 +1102,18 @@ bool QgsComposer::containsWMSLayer() const
QgsComposerItem* currentItem = 0;
QgsComposerMap* currentMap = 0;

for(; item_it != mItemWidgetMap.constEnd(); ++item_it)
for ( ; item_it != mItemWidgetMap.constEnd(); ++item_it )
{
currentItem = item_it.key();
currentMap = dynamic_cast<QgsComposerMap*>( currentItem );
if ( currentMap )
{
currentItem = item_it.key();
currentMap = dynamic_cast<QgsComposerMap*>(currentItem);
if(currentMap)
{
if(currentMap->containsWMSLayer())
{
return true;
}
}
if ( currentMap->containsWMSLayer() )
{
return true;
}
}
}
return false;
}

Expand All @@ -1123,15 +1123,15 @@ void QgsComposer::showWMSPrintingWarning()
QSettings myQSettings;

bool displayWMSWarning = myQSettings.value( myQSettingsLabel, true ).toBool();
if(displayWMSWarning)
{
QgsMessageViewer* m = new QgsMessageViewer( this );
m->setWindowTitle( tr( "Project contains WMS layers" ) );
m->setMessage(tr("Some WMS servers (e.g. UMN mapserver) have a limit for the WIDTH and HEIGHT parameter. Printing layers from such servers may exceed this limit. If this is the case, the WMS layer will not be printed"), QgsMessageOutput::MessageText);
m->setCheckBoxText( tr( "Don't show this message again" ) );
m->setCheckBoxState( Qt::Unchecked );
m->setCheckBoxVisible( true );
m->setCheckBoxQSettingsLabel( myQSettingsLabel );
m->exec();
}
if ( displayWMSWarning )
{
QgsMessageViewer* m = new QgsMessageViewer( this );
m->setWindowTitle( tr( "Project contains WMS layers" ) );
m->setMessage( tr( "Some WMS servers (e.g. UMN mapserver) have a limit for the WIDTH and HEIGHT parameter. Printing layers from such servers may exceed this limit. If this is the case, the WMS layer will not be printed" ), QgsMessageOutput::MessageText );
m->setCheckBoxText( tr( "Don't show this message again" ) );
m->setCheckBoxState( Qt::Unchecked );
m->setCheckBoxVisible( true );
m->setCheckBoxQSettingsLabel( myQSettingsLabel );
m->exec();
}
}
8 changes: 4 additions & 4 deletions src/app/composer/qgscomposermapwidget.cpp
Expand Up @@ -230,10 +230,10 @@ void QgsComposerMapWidget::updateGuiElements()

//composer map extent
QgsRect composerMapExtent = mComposerMap->extent();
mXMinLineEdit->setText( QString::number( composerMapExtent.xMin(), 'f', 3));
mXMaxLineEdit->setText( QString::number( composerMapExtent.xMax(), 'f', 3));
mYMinLineEdit->setText( QString::number( composerMapExtent.yMin(), 'f', 3));
mYMaxLineEdit->setText( QString::number( composerMapExtent.yMax(), 'f', 3));
mXMinLineEdit->setText( QString::number( composerMapExtent.xMin(), 'f', 3 ) );
mXMaxLineEdit->setText( QString::number( composerMapExtent.xMax(), 'f', 3 ) );
mYMinLineEdit->setText( QString::number( composerMapExtent.yMin(), 'f', 3 ) );
mYMaxLineEdit->setText( QString::number( composerMapExtent.yMax(), 'f', 3 ) );
}
}

Expand Down
6 changes: 3 additions & 3 deletions src/app/legend/qgslegendlayerfile.cpp
Expand Up @@ -274,11 +274,11 @@ void QgsLegendLayerFile::saveAsShapefileGeneral( bool saveOnlySelection )
{
destCRS = QgisApp::instance()->mapCanvas()->mapRenderer()->destinationSrs();
}

QgsGenericProjectionSelector * mySelector = new QgsGenericProjectionSelector();
mySelector->setSelectedCrsId( destCRS.srsid() );
mySelector->setMessage(tr("Select the coordinate reference system for the saved shapefile.") +
tr("The data points will be transformed from the layer coordinate reference system."));
mySelector->setMessage( tr( "Select the coordinate reference system for the saved shapefile." ) +
tr( "The data points will be transformed from the layer coordinate reference system." ) );

if ( mySelector->exec() )
{
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsattributetable.cpp
Expand Up @@ -559,7 +559,7 @@ void QgsAttributeTable::bringSelectedToTop()
for ( QList<QTableWidgetSelectionRange>::iterator iter = selections.begin();iter != selections.end();++iter )
{
removeselection = true;
while ( swaptorow<rowCount() && item( swaptorow, 0 )->isSelected() )//selections are not necessary stored in ascending order
while ( swaptorow < rowCount() && item( swaptorow, 0 )->isSelected() )//selections are not necessary stored in ascending order
{
++swaptorow;
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsmaptoolidentify.cpp
Expand Up @@ -252,7 +252,7 @@ void QgsMapToolIdentify::identifyVectorLayer( const QgsPoint& point )

// toLayerCoordinates will throw an exception for an 'invalid' point.
// For example, if you project a world map onto a globe using EPSG 2163
// and then click somewhere off the globe, an exception will be thrown.
// and then click somewhere off the globe, an exception will be thrown.
try
{
// create the search rectangle
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsmaptoolselect.cpp
Expand Up @@ -96,7 +96,7 @@ void QgsMapToolSelect::canvasReleaseEvent( QMouseEvent * e )
QgsVectorLayer* vlayer = dynamic_cast<QgsVectorLayer*>( mCanvas->currentLayer() );
// toLayerCoordinates will throw an exception for an 'invalid' rectangle.
// For example, if you project a world map onto a globe using EPSG 2163
// and then click somewhere off the globe, an exception will be thrown.
// and then click somewhere off the globe, an exception will be thrown.
try
{
search = toLayerCoordinates( vlayer, search );
Expand Down
8 changes: 4 additions & 4 deletions src/app/qgsrasterlayerproperties.cpp
Expand Up @@ -1384,7 +1384,7 @@ void QgsRasterLayerProperties::apply()
myNewColorRampItem.value = myCurrentItem->text( 0 ).toDouble();
myNewColorRampItem.color = myCurrentItem->background( 1 ).color();
myNewColorRampItem.label = myCurrentItem->text( 2 );

//Simple insertion sort - speed is not a huge factor here
inserted = false;
myCurrentIndex = 0;
Expand Down Expand Up @@ -1590,9 +1590,9 @@ void QgsRasterLayerProperties::on_buttonBuildPyramids_clicked()
{
QMessageBox::warning( this, tr( "Building pyramids failed." ),
tr( "Building pyramid overviews is not supported on this type of raster." ) );
//TODO: should really read -- Building pyramid overviews is not supported for 'warped virtual dataset'. -- But in feature freeze, and translation requests have already gone out PJE20080912
//TODO: should really read -- Building pyramid overviews is not supported for 'warped virtual dataset'. -- But in feature freeze, and translation requests have already gone out PJE20080912
}

}


Expand Down Expand Up @@ -2649,7 +2649,7 @@ void QgsRasterLayerProperties::handleColormapTreeWidgetDoubleClick( QTreeWidgetI
{
item->setFlags( Qt::ItemIsEnabled | Qt::ItemIsSelectable );
//show color dialog
QColor newColor = QColorDialog::getColor(item->background(column).color());
QColor newColor = QColorDialog::getColor( item->background( column ).color() );
if ( newColor.isValid() )
{
item->setBackground( 1, QBrush( newColor ) );
Expand Down
2 changes: 1 addition & 1 deletion src/core/composer/qgscomposeritem.h
Expand Up @@ -79,7 +79,7 @@ class CORE_EXPORT QgsComposerItem: public QGraphicsRectItem
@param delta value from wheel event that describes magnitude and direction (positive /negative number)
@param x x-position of mouse cursor (in item coordinates)
@param y y-position of mouse cursor (in item coordinates)*/
virtual void zoomContent( int delta, double x, double y) {}
virtual void zoomContent( int delta, double x, double y ) {}

/**Sets this items bound in scene coordinates such that 1 item size units
corresponds to 1 scene size unit*/
Expand Down
128 changes: 64 additions & 64 deletions src/core/composer/qgscomposermap.cpp
Expand Up @@ -280,62 +280,62 @@ void QgsComposerMap::moveContent( double dx, double dy )
}
}

void QgsComposerMap::zoomContent( int delta, double x, double y)
void QgsComposerMap::zoomContent( int delta, double x, double y )
{
QSettings settings;

//read zoom mode
//0: zoom, 1: zoom and recenter, 2: zoom to cursor, 3: nothing
int zoomMode = settings.value("/qgis/wheel_action", 0 ).toInt();
if(zoomMode == 3) //do nothing
{
return;
}
//0: zoom, 1: zoom and recenter, 2: zoom to cursor, 3: nothing
int zoomMode = settings.value( "/qgis/wheel_action", 0 ).toInt();
if ( zoomMode == 3 ) //do nothing
{
return;
}

double zoomFactor = settings.value( "/qgis/zoom_factor", 2.0 ).toDouble();

double zoomFactor = settings.value("/qgis/zoom_factor", 2.0).toDouble();

//find out new center point
double centerX = (mExtent.xMax() + mExtent.xMin()) / 2;
double centerY = (mExtent.yMax() + mExtent.yMin()) / 2;
double centerX = ( mExtent.xMax() + mExtent.xMin() ) / 2;
double centerY = ( mExtent.yMax() + mExtent.yMin() ) / 2;

if(zoomMode != 0)
if ( zoomMode != 0 )
{
//find out map coordinates of mouse position
double mapMouseX = mExtent.xMin() + ( x / rect().width() ) * ( mExtent.xMax() - mExtent.xMin() );
double mapMouseY = mExtent.yMin() + ( 1 - ( y / rect().height() ) ) * ( mExtent.yMax() - mExtent.yMin() );
if ( zoomMode == 1 ) //zoom and recenter
{
//find out map coordinates of mouse position
double mapMouseX = mExtent.xMin() + (x / rect().width()) * (mExtent.xMax() - mExtent.xMin());
double mapMouseY = mExtent.yMin() + (1 - (y / rect().height())) * (mExtent.yMax() - mExtent.yMin());
if(zoomMode == 1) //zoom and recenter
{
centerX = mapMouseX;
centerY = mapMouseY;
}
else if(zoomMode == 2) //zoom to cursor
{
centerX = mapMouseX + (centerX - mapMouseX) * (1.0 / zoomFactor);
centerY = mapMouseY + (centerY - mapMouseY) * (1.0 / zoomFactor);
}
centerX = mapMouseX;
centerY = mapMouseY;
}
else if ( zoomMode == 2 ) //zoom to cursor
{
centerX = mapMouseX + ( centerX - mapMouseX ) * ( 1.0 / zoomFactor );
centerY = mapMouseY + ( centerY - mapMouseY ) * ( 1.0 / zoomFactor );
}
}

double newIntervalX, newIntervalY;

if(delta > 0)
{
newIntervalX = (mExtent.xMax() - mExtent.xMin()) / zoomFactor;
newIntervalY = (mExtent.yMax() - mExtent.yMin()) / zoomFactor;
}
else if(delta < 0)
{
newIntervalX = (mExtent.xMax() - mExtent.xMin()) * zoomFactor;
newIntervalY = (mExtent.yMax() - mExtent.yMin()) * zoomFactor;
}
if ( delta > 0 )
{
newIntervalX = ( mExtent.xMax() - mExtent.xMin() ) / zoomFactor;
newIntervalY = ( mExtent.yMax() - mExtent.yMin() ) / zoomFactor;
}
else if ( delta < 0 )
{
newIntervalX = ( mExtent.xMax() - mExtent.xMin() ) * zoomFactor;
newIntervalY = ( mExtent.yMax() - mExtent.yMin() ) * zoomFactor;
}
else //no need to zoom
{
return;
}
{
return;
}

mExtent.setXMaximum(centerX + newIntervalX / 2);
mExtent.setXMinimum(centerX - newIntervalX / 2);
mExtent.setYMaximum(centerY + newIntervalY / 2);
mExtent.setYMinimum(centerY - newIntervalY / 2);
mExtent.setXMaximum( centerX + newIntervalX / 2 );
mExtent.setXMinimum( centerX - newIntervalX / 2 );
mExtent.setYMaximum( centerY + newIntervalY / 2 );
mExtent.setYMinimum( centerY - newIntervalY / 2 );

emit extentChanged();
cache();
Expand Down Expand Up @@ -405,35 +405,35 @@ void QgsComposerMap::setOffset( double xOffset, double yOffset )

bool QgsComposerMap::containsWMSLayer() const
{
if(!mMapRenderer)
{
return false;
}
if ( !mMapRenderer )
{
return false;
}

QStringList layers = mMapRenderer->layerSet();

QStringList::const_iterator layer_it = layers.constBegin();
QgsMapLayer* currentLayer = 0;

for(; layer_it != layers.constEnd(); ++layer_it)
for ( ; layer_it != layers.constEnd(); ++layer_it )
{
currentLayer = QgsMapLayerRegistry::instance()->mapLayer( *layer_it );
if ( currentLayer )
{
currentLayer = QgsMapLayerRegistry::instance()->mapLayer(*layer_it);
if(currentLayer)
{
QgsRasterLayer* currentRasterLayer = dynamic_cast<QgsRasterLayer*>(currentLayer);
if(currentRasterLayer)
{
const QgsRasterDataProvider* rasterProvider = 0;
if(rasterProvider = currentRasterLayer->dataProvider())
{
if(rasterProvider->name() == "wms")
{
return true;
}
}
}
}
QgsRasterLayer* currentRasterLayer = dynamic_cast<QgsRasterLayer*>( currentLayer );
if ( currentRasterLayer )
{
const QgsRasterDataProvider* rasterProvider = 0;
if ( rasterProvider = currentRasterLayer->dataProvider() )
{
if ( rasterProvider->name() == "wms" )
{
return true;
}
}
}
}
}
return false;
}

Expand Down
2 changes: 1 addition & 1 deletion src/core/composer/qgscomposermap.h
Expand Up @@ -91,7 +91,7 @@ class CORE_EXPORT QgsComposerMap : /*public QWidget, private Ui::QgsComposerMapB
@param delta value from wheel event that describes magnitude and direction (positive /negative number)
@param x x-coordinate of mouse position in item coordinates
@param y y-coordinate of mouse position in item coordinates*/
void zoomContent( int delta, double x, double y);
void zoomContent( int delta, double x, double y );

/**Sets new scene rectangle bounds and recalculates hight and extent*/
void setSceneRect( const QRectF& rectangle );
Expand Down

0 comments on commit 73eb705

Please sign in to comment.