Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/qgis/Quantum-GIS into col…
Browse files Browse the repository at this point in the history
…oramp
  • Loading branch information
etiennesky committed Aug 24, 2012
2 parents 69c3774 + eaecf0c commit ebdd1ad
Show file tree
Hide file tree
Showing 66 changed files with 3,786 additions and 2,147 deletions.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Expand Up @@ -289,6 +289,8 @@ ENDIF (CMAKE_BUILD_TYPE MATCHES Debug OR CMAKE_BUILD_TYPE MATCHES RelWithDebInfo
IF(MSVC)
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -DQGISDEBUG=1")
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DQGISDEBUG=1")
# disable macros that offend std::numeric_limits<T>::min()/max()
ADD_DEFINITIONS(-DNOMINMAX)
ENDIF(MSVC)

#############################################################
Expand Down
7 changes: 0 additions & 7 deletions python/CMakeLists.txt
Expand Up @@ -39,13 +39,6 @@ INCLUDE_DIRECTORIES(
${CMAKE_BINARY_DIR} # qgsconfig.h, qgsversion.h
)


# In Windef.h there are min() and max() macros that interfere with the usage
# of std::numeric_limits<T>::min() and :max() in qgsrasterbands.h.
IF(MSVC)
ADD_DEFINITIONS(-DNOMINMAX)
ENDIF(MSVC)

IF(PYQT4_VERSION_NUM LESS 263680) # 0x040600
SET(SIP_DISABLE_FEATURES ${SIP_DISABLE_FEATURES} PROXY_FACTORY)
ENDIF(PYQT4_VERSION_NUM LESS 263680)
Expand Down
6 changes: 4 additions & 2 deletions python/core/qgscomposermultiframe.sip
Expand Up @@ -9,7 +9,9 @@ public:
enum ResizeMode
{
UseExistingFrames = 0,
ExtendToNextPage //duplicates last frame to next page to fit the total size
ExtendToNextPage, //uses the next page(s) until the content has been printed
RepeatOnEveryPage, //repeats the same frame on every page
RepeatUntilFinished //duplicates last frame to next page to fit the total size
};

QgsComposerMultiFrame( QgsComposition* c, bool createUndoCommands );
Expand Down Expand Up @@ -41,4 +43,4 @@ public:
void deleteFrames();

int nFrames() const;
};
};
3 changes: 2 additions & 1 deletion python/core/qgsrastertransparency.sip
Expand Up @@ -21,7 +21,8 @@ public:

struct TransparentSingleValuePixel
{
double pixelValue;
double min;
double max;
double percentTransparent;
};

Expand Down
1 change: 1 addition & 0 deletions scripts/spelling.dat
Expand Up @@ -456,3 +456,4 @@ writeable:writable
vaild:valid
opps:oops
arount:around
acheive:achieve
2 changes: 2 additions & 0 deletions src/app/composer/qgscomposerhtmlwidget.cpp
Expand Up @@ -13,6 +13,8 @@ QgsComposerHtmlWidget::QgsComposerHtmlWidget( QgsComposerHtml* html, QgsComposer
blockSignals( true );
mResizeModeComboBox->addItem( tr( "Use existing frames" ), QgsComposerMultiFrame::UseExistingFrames );
mResizeModeComboBox->addItem( tr( "Extend to next page" ), QgsComposerMultiFrame::ExtendToNextPage );
mResizeModeComboBox->addItem( tr( "Repeat on every page" ), QgsComposerMultiFrame::RepeatOnEveryPage );
mResizeModeComboBox->addItem( tr( "Repeat until finished" ), QgsComposerMultiFrame::RepeatUntilFinished );
blockSignals( false );
setGuiElementValues();

Expand Down
31 changes: 20 additions & 11 deletions src/app/qgisapp.cpp
Expand Up @@ -163,6 +163,7 @@
#include "qgsrasteriterator.h"
#include "qgsrasterlayer.h"
#include "qgsrasterlayerproperties.h"
#include "qgsrasternuller.h"
#include "qgsrasterrenderer.h"
#include "qgsrasterlayersaveasdialog.h"
#include "qgsrectangle.h"
Expand Down Expand Up @@ -1395,8 +1396,8 @@ void QgisApp::createStatusBar()
mCoordsEdit->setWhatsThis( tr( "Shows the map coordinates at the "
"current cursor position. The display is continuously updated "
"as the mouse is moved. It also allows editing to set the canvas "
"center to a given position." ) );
mCoordsEdit->setToolTip( tr( "Current map coordinate (formatted as x,y)" ) );
"center to a given position. The format is lat,lon or east,north" ) );
mCoordsEdit->setToolTip( tr( "Current map coordinate (lat,lon or east,north)" ) );
statusBar()->addPermanentWidget( mCoordsEdit, 0 );
connect( mCoordsEdit, SIGNAL( editingFinished() ), this, SLOT( userCenter() ) );

Expand Down Expand Up @@ -2409,7 +2410,7 @@ bool QgisApp::addVectorLayers( QStringList const & theLayerQStringList, const QS

}

// make sure at least one layer was succesfully added
// make sure at least one layer was successfully added
if ( myList.count() == 0 )
{
return false;
Expand Down Expand Up @@ -3924,7 +3925,7 @@ void QgisApp::saveAsRasterFile()
return;
}

QgsRasterLayerSaveAsDialog d( rasterLayer->dataProvider(), mMapCanvas->extent(), mMapCanvas->mapRenderer()->destinationCrs() );
QgsRasterLayerSaveAsDialog d( rasterLayer, rasterLayer->dataProvider(), mMapCanvas->extent(), rasterLayer->crs(), mMapCanvas->mapRenderer()->destinationCrs() );
if ( d.exec() == QDialog::Accepted )
{
QgsRasterFileWriter fileWriter( d.outputFileName() );
Expand Down Expand Up @@ -3953,12 +3954,21 @@ void QgisApp::saveAsRasterFile()
QgsDebugMsg( "Cannot set pipe provider" );
return;
}

QgsRasterNuller *nuller = new QgsRasterNuller();
nuller->setNoData( d.noData() );
if ( !pipe->insert( 1, nuller ) )
{
QgsDebugMsg( "Cannot set pipe nuller" );
return;
}

// add projector if necessary
if ( d.outputCrs() != rasterLayer->dataProvider()->crs() )
if ( d.outputCrs() != rasterLayer->crs() )
{
QgsRasterProjector * projector = new QgsRasterProjector;
projector->setCRS( rasterLayer->dataProvider()->crs(), d.outputCrs() );
if ( !pipe->set( projector ) )
projector->setCRS( rasterLayer->crs(), d.outputCrs() );
if ( !pipe->insert( 2, projector ) )
{
QgsDebugMsg( "Cannot set pipe projector" );
return;
Expand All @@ -3977,18 +3987,17 @@ void QgisApp::saveAsRasterFile()
delete pipe;
return;
}
projector->setCRS( rasterLayer->dataProvider()->crs(), d.outputCrs() );
projector->setCRS( rasterLayer->crs(), d.outputCrs() );
}

if ( !pipe->last() )
{
delete pipe;
return;
}
QgsRasterIterator iterator( pipe->last() );
fileWriter.setCreateOptions( d.createOptions() );

fileWriter.writeRaster( &iterator, d.nColumns(), d.nRows(), d.outputRectangle(), d.outputCrs(), &pd );
fileWriter.writeRaster( pipe, d.nColumns(), d.nRows(), d.outputRectangle(), d.outputCrs(), &pd );
delete pipe;
}
}
Expand Down Expand Up @@ -7361,7 +7370,7 @@ bool QgisApp::addRasterLayers( QStringList const &theFileNameQStringList, bool g
else
{
// Issue message box warning unless we are loading from cmd line since
// non-rasters are passed to this function first and then sucessfully
// non-rasters are passed to this function first and then successfully
// loaded afterwards (see main.cpp)

if ( guiWarning )
Expand Down
5 changes: 5 additions & 0 deletions src/app/qgsattributetabledialog.cpp
Expand Up @@ -264,6 +264,8 @@ void QgsAttributeTableDialog::columnBoxInit()
QgsFieldMap fieldMap = mLayer->pendingFields();
QgsFieldMap::Iterator it = fieldMap.begin();

mColumnBox->clear();

for ( ; it != fieldMap.end(); ++it )
if ( mLayer->editType( it.key() ) != QgsVectorLayer::Hidden )
mColumnBox->addItem( it.value().name() );
Expand Down Expand Up @@ -706,6 +708,7 @@ void QgsAttributeTableDialog::on_mAddAttribute_clicked()
}
// update model - a field has been added or updated
mModel->reload( mModel->index( 0, 0 ), mModel->index( mModel->rowCount() - 1, mModel->columnCount() - 1 ) );
columnBoxInit();
}
}

Expand Down Expand Up @@ -747,6 +750,7 @@ void QgsAttributeTableDialog::on_mRemoveAttribute_clicked()
}
// update model - a field has been added or updated
mModel->reload( mModel->index( 0, 0 ), mModel->index( mModel->rowCount() - 1, mModel->columnCount() - 1 ) );
columnBoxInit();
}
}

Expand All @@ -760,6 +764,7 @@ void QgsAttributeTableDialog::on_mOpenFieldCalculator_clicked()
if ( col >= 0 )
{
mModel->reload( mModel->index( 0, col ), mModel->index( mModel->rowCount() - 1, col ) );
columnBoxInit();
}
}
}
Expand Down

0 comments on commit ebdd1ad

Please sign in to comment.