Skip to content
Permalink
Browse files

Merge remote-tracking branch 'upstream/master'

  • Loading branch information
luipir committed Sep 9, 2013
2 parents 3216390 + c705034 commit 4200046d8cf1853a75b030eeb22fbe4da2193b60
Showing with 644 additions and 493 deletions.
  1. +451 −440 images/images.qrc
  2. BIN images/splash/splash.png
  3. BIN images/splash/splash.xcf.bz2
  4. BIN images/sponsors/aas_300wide.png
  5. BIN images/sponsors/bronze.png
  6. BIN images/sponsors/buttons.xcf
  7. BIN images/sponsors/gaia.png
  8. BIN images/sponsors/geosynergy.png
  9. BIN images/sponsors/gold.png
  10. BIN images/sponsors/ibw.png
  11. BIN images/sponsors/platinum.png
  12. BIN images/sponsors/silver.png
  13. BIN images/sponsors/vorarlberg.png
  14. +7 −3 python/console/console_editor.py
  15. +5 −5 python/plugins/processing/saga/SagaAlgorithmProvider.py
  16. +2 −2 src/analysis/openstreetmap/qgsosmdatabase.cpp
  17. +18 −0 src/app/composer/qgscomposer.cpp
  18. +6 −0 src/app/composer/qgscomposer.h
  19. +8 −0 src/app/main.cpp
  20. +7 −2 src/core/composer/qgscomposeritem.cpp
  21. +1 −1 src/core/composer/qgscomposeritem.h
  22. +11 −9 src/core/composer/qgscomposermap.cpp
  23. +2 −2 src/core/qgsvectorfilewriter.cpp
  24. +2 −2 src/core/raster/qgsrasterblock.cpp
  25. +37 −0 src/gui/qgscomposerview.cpp
  26. +6 −0 src/gui/qgscomposerview.h
  27. +4 −1 src/plugins/grass/qtermwidget/BlockArray.cpp
  28. +8 −4 src/plugins/grass/qtermwidget/k3process.cpp
  29. +6 −3 src/plugins/grass/qtermwidget/k3processcontroller.cpp
  30. +6 −3 src/plugins/grass/qtermwidget/kpty.cpp
  31. +2 −2 src/providers/gpx/qgsgpxfeatureiterator.cpp
  32. +6 −4 src/providers/postgres/qgspostgresconn.cpp
  33. +2 −1 src/providers/postgres/qgspostgresconn.h
  34. +2 −2 src/providers/postgres/qgspostgresfeatureiterator.cpp
  35. +23 −0 src/ui/qgscomposerbase.ui
  36. +18 −3 src/ui/qgssponsorsbase.ui
  37. +4 −4 tests/src/app/testqgisappclipboard.cpp

Large diffs are not rendered by default.

BIN -3.21 KB (99%) images/splash/splash.png
Binary file not shown.
BIN +3.98 KB (100%) images/splash/splash.xcf.bz2
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -240,7 +240,8 @@ def setLexers(self):
chekBoxAPI = self.settings.value("pythonConsole/preloadAPI", True, type=bool)
chekBoxPreparedAPI = self.settings.value("pythonConsole/usePreparedAPIFile", False, type=bool)
if chekBoxAPI:
self.api.loadPrepared(QgsApplication.pkgDataPath() + "/python/qsci_apis/pyqgis_master.pap")
pap = os.path.join(QgsApplication.pkgDataPath(), "python", "qsci_apis", "pyqgis.pap")
self.api.loadPrepared(pap)
elif chekBoxPreparedAPI:
self.api.loadPrepared(self.settings.value("pythonConsole/preparedAPIFile"))
else:
@@ -655,23 +656,26 @@ def keyPressEvent(self, e):
t = unicode(e.text())
## Close bracket automatically
if t in self.opening:
self.beginUndoAction()
i = self.opening.index(t)
if self.hasSelectedText():
self.beginUndoAction()
selText = self.selectedText()
self.removeSelectedText()
if startLine == endLine:
self.insert(self.opening[i] + selText + self.closing[i])
self.setCursorPosition(endLine, endPos+2)
self.endUndoAction()
return
elif startLine < endLine and self.opening[i] in ("'", '"'):
self.insert("'''" + selText + "'''")
self.setCursorPosition(endLine, endPos+3)
self.endUndoAction()
return
else:
self.insert(self.closing[i])
self.endUndoAction()
else:
self.insert(self.closing[i])
self.endUndoAction()
## FIXES #8392 (automatically removes the redundant char
## when autoclosing brackets option is enabled)
if t in [')', ']', '}']:
@@ -67,19 +67,19 @@ def unload(self):
ProcessingConfig.removeSetting(SagaUtils.SAGA_RESAMPLING_REGION_CELLSIZE)
ProcessingConfig.removeSetting(SagaUtils.SAGA_LOG_CONSOLE)
ProcessingConfig.removeSetting(SagaUtils.SAGA_LOG_COMMANDS)


def _loadAlgorithms(self):

def _loadAlgorithms(self):
self.algs = []
saga208 = ProcessingConfig.getSetting(SagaUtils.SAGA_208)
saga208 = ProcessingConfig.getSetting(SagaUtils.SAGA_208)
folder = SagaUtils.sagaDescriptionPath()
for descriptionFile in os.listdir(folder):
if descriptionFile.endswith("txt"):
if descriptionFile.endswith("txt"):
if not saga208:
if descriptionFile.startswith("2.0.8"):
continue
else:
if descriptionFile.startswith("2.1"):
if descriptionFile.startswith("2.1"):
continue
try:
alg = SagaAlgorithm(os.path.join(folder, descriptionFile))
@@ -421,7 +421,7 @@ void QgsOSMDatabase::exportSpatiaLiteNodes( const QString& tableName, const QStr
sqlite3_bind_null( stmtInsert, ++col );
}

sqlite3_bind_blob( stmtInsert, ++col, geom->asWkb(), (int) geom->wkbSize(), SQLITE_STATIC );
sqlite3_bind_blob( stmtInsert, ++col, geom->asWkb(), ( int ) geom->wkbSize(), SQLITE_STATIC );

int insertRes = sqlite3_step( stmtInsert );
if ( insertRes != SQLITE_DONE )
@@ -489,7 +489,7 @@ void QgsOSMDatabase::exportSpatiaLiteWays( bool closed, const QString& tableName
sqlite3_bind_null( stmtInsert, ++col );
}

sqlite3_bind_blob( stmtInsert, ++col, geom->asWkb(), (int) geom->wkbSize(), SQLITE_STATIC );
sqlite3_bind_blob( stmtInsert, ++col, geom->asWkb(), ( int ) geom->wkbSize(), SQLITE_STATIC );

int insertRes = sqlite3_step( stmtInsert );
if ( insertRes != SQLITE_DONE )
@@ -245,6 +245,8 @@ QgsComposer::QgsComposer( QgisApp *qgis, const QString& title )
layoutMenu->addAction( mActionLowerItems );
layoutMenu->addAction( mActionMoveItemsToTop );
layoutMenu->addAction( mActionMoveItemsToBottom );
layoutMenu->addAction( mActionLockItems );
layoutMenu->addAction( mActionUnlockAll );

#ifdef Q_WS_MAC
// this doesn't work on Mac anymore: menuBar()->addMenu( mQgis->windowMenu() );
@@ -1645,6 +1647,22 @@ void QgsComposer::on_mActionUngroupItems_triggered()
}
}

void QgsComposer::on_mActionLockItems_triggered()
{
if ( mView )
{
mView->lockItems();
}
}

void QgsComposer::on_mActionUnlockAll_triggered()
{
if ( mView )
{
mView->unlockAllItems();
}
}

void QgsComposer::on_mActionRaiseItems_triggered()
{
if ( mComposition )
@@ -210,6 +210,12 @@ class QgsComposer: public QMainWindow, private Ui::QgsComposerBase
//! Ungroup selected item group
void on_mActionUngroupItems_triggered();

//! Lock selected items
void on_mActionLockItems_triggered();

//! Unlock all items
void on_mActionUnlockAll_triggered();

//! Move selected items one position up
void on_mActionRaiseItems_triggered();

@@ -253,9 +253,15 @@ void qgisCrash( int signal )
{
// take full stacktrace using gdb
// http://stackoverflow.com/questions/3151779/how-its-better-to-invoke-gdb-from-program-to-print-its-stacktrace
// unfortunately, this is not so simple. the proper method is way more OS-specific
// than this code would suggest, see http://stackoverflow.com/a/1024937

char exename[512];
#if defined(__FreeBSD__)
int len = readlink( "/proc/curproc/file", exename, sizeof( exename ) - 1 );
#else
int len = readlink( "/proc/self/exe", exename, sizeof( exename ) - 1 );
#endif
if ( len < 0 )
{
myPrint( "Could not read link (%d:%s)\n", errno, strerror( errno ) );
@@ -363,7 +369,9 @@ int main( int argc, char *argv[] )
#endif // WIN32

// Set up the custom qWarning/qDebug custom handler
#ifndef ANDROID
qInstallMsgHandler( myMessageOutput );
#endif

#if (defined(linux) && !defined(ANDROID)) || defined(__FreeBSD__)
signal( SIGQUIT, qgisCrash );
@@ -265,11 +265,11 @@ bool QgsComposerItem::_readXML( const QDomElement& itemElem, const QDomDocument&
QString positionLock = itemElem.attribute( "positionLock" );
if ( positionLock.compare( "true", Qt::CaseInsensitive ) == 0 )
{
mItemPositionLocked = true;
setPositionLock( true );
}
else
{
mItemPositionLocked = false;
setPositionLock( false );
}

//position
@@ -802,6 +802,11 @@ void QgsComposerItem::drawFrame( QPainter* p )
}
}

void QgsComposerItem::setPositionLock( bool lock )
{
mItemPositionLocked = lock;
}

void QgsComposerItem::move( double dx, double dy )
{
QTransform t = transform();
@@ -281,7 +281,7 @@ class CORE_EXPORT QgsComposerItem: public QObject, public QGraphicsRectItem

/**Locks / unlocks the item position for mouse drags
@note this method was added in version 1.2*/
void setPositionLock( bool lock ) {mItemPositionLocked = lock;}
void setPositionLock( bool lock );

/**Returns position lock for mouse drags (true means locked)
@note this method was added in version 1.2*/
@@ -41,8 +41,8 @@

QgsComposerMap::QgsComposerMap( QgsComposition *composition, int x, int y, int width, int height )
: QgsComposerItem( x, y, width, height, composition ), mKeepLayerSet( false ),
mOverviewFrameMapId( -1 ), mOverviewBlendMode( QPainter::CompositionMode_SourceOver ), mOverviewInverted( false ), mOverviewCentered( false ),
mGridEnabled( false ), mGridStyle( Solid ),
mOverviewFrameMapId( -1 ), mOverviewBlendMode( QPainter::CompositionMode_SourceOver ), mOverviewInverted( false ), mOverviewCentered( false ),
mGridEnabled( false ), mGridStyle( Solid ),
mGridIntervalX( 0.0 ), mGridIntervalY( 0.0 ), mGridOffsetX( 0.0 ), mGridOffsetY( 0.0 ), mGridAnnotationFontColor( QColor( 0, 0, 0 ) ),
mGridAnnotationPrecision( 3 ), mShowGridAnnotation( false ), mGridBlendMode( QPainter::CompositionMode_SourceOver ),
mLeftGridAnnotationPosition( OutsideMapFrame ), mRightGridAnnotationPosition( OutsideMapFrame ),
@@ -87,8 +87,8 @@ QgsComposerMap::QgsComposerMap( QgsComposition *composition, int x, int y, int w

QgsComposerMap::QgsComposerMap( QgsComposition *composition )
: QgsComposerItem( 0, 0, 10, 10, composition ), mKeepLayerSet( false ), mOverviewFrameMapId( -1 ),
mOverviewBlendMode( QPainter::CompositionMode_SourceOver ), mOverviewInverted( false ), mOverviewCentered( false ),
mGridEnabled( false ), mGridStyle( Solid ),
mOverviewBlendMode( QPainter::CompositionMode_SourceOver ), mOverviewInverted( false ), mOverviewCentered( false ),
mGridEnabled( false ), mGridStyle( Solid ),
mGridIntervalX( 0.0 ), mGridIntervalY( 0.0 ), mGridOffsetX( 0.0 ), mGridOffsetY( 0.0 ), mGridAnnotationFontColor( QColor( 0, 0, 0 ) ),
mGridAnnotationPrecision( 3 ), mShowGridAnnotation( false ), mGridBlendMode( QPainter::CompositionMode_SourceOver ),
mLeftGridAnnotationPosition( OutsideMapFrame ), mRightGridAnnotationPosition( OutsideMapFrame ),
@@ -121,19 +121,21 @@ QgsComposerMap::QgsComposerMap( QgsComposition *composition )
void QgsComposerMap::extentCenteredOnOverview( QgsRectangle& extent ) const
{
extent = mExtent;
if ( ! mOverviewCentered ) {
if ( ! mOverviewCentered )
{
return;
}

if ( mOverviewFrameMapId != -1 ) {
if ( mOverviewFrameMapId != -1 )
{
const QgsComposerMap* overviewFrameMap = mComposition->getComposerMapById( mOverviewFrameMapId );
QgsRectangle otherExtent = overviewFrameMap->extent();

QgsPoint center = otherExtent.center();
QgsRectangle movedExtent( center.x() - mExtent.width() / 2,
center.y() - mExtent.height() / 2,
center.x() - mExtent.width() / 2 + mExtent.width(),
center.y() - mExtent.height() / 2 + mExtent.height() );
center.y() - mExtent.height() / 2,
center.x() - mExtent.width() / 2 + mExtent.width(),
center.y() - mExtent.height() / 2 + mExtent.height() );
extent = movedExtent;
}
}
@@ -669,7 +669,7 @@ OGRFeatureH QgsVectorFileWriter::createFeature( QgsFeature& feature )
return 0;
}

OGRErr err = OGR_G_ImportFromWkb( mGeom2, const_cast<unsigned char *>( geom->asWkb() ), (int) geom->wkbSize() );
OGRErr err = OGR_G_ImportFromWkb( mGeom2, const_cast<unsigned char *>( geom->asWkb() ), ( int ) geom->wkbSize() );
if ( err != OGRERR_NONE )
{
mErrorMessage = QObject::tr( "Feature geometry not imported (OGR error: %1)" )
@@ -685,7 +685,7 @@ OGRFeatureH QgsVectorFileWriter::createFeature( QgsFeature& feature )
}
else if ( geom )
{
OGRErr err = OGR_G_ImportFromWkb( mGeom, const_cast<unsigned char *>( geom->asWkb() ), (int) geom->wkbSize() );
OGRErr err = OGR_G_ImportFromWkb( mGeom, const_cast<unsigned char *>( geom->asWkb() ), ( int ) geom->wkbSize() );
if ( err != OGRERR_NONE )
{
mErrorMessage = QObject::tr( "Feature geometry not imported (OGR error: %1)" )
@@ -324,7 +324,7 @@ bool QgsRasterBlock::isNoData( size_t index )
return false;
}
// TODO: optimize
int row = (int) index / mWidth;
int row = ( int ) index / mWidth;
int column = index % mWidth;
size_t byte = ( size_t )row * mNoDataBitmapWidth + column / 8 ;
int bit = column % 8;
@@ -406,7 +406,7 @@ bool QgsRasterBlock::setIsNoData( size_t index )
}
}
// TODO: optimize
int row = (int) index / mWidth;
int row = ( int ) index / mWidth;
int column = index % mWidth;
size_t byte = ( size_t )row * mNoDataBitmapWidth + column / 8;
int bit = column % 8;
@@ -751,6 +751,43 @@ void QgsComposerView::ungroupItems()
}
}

void QgsComposerView::lockItems()
{
if ( !composition() )
{
return;
}

QList<QgsComposerItem*> selectionList = composition()->selectedComposerItems();
QList<QgsComposerItem*>::iterator itemIter = selectionList.begin();
for ( ; itemIter != selectionList.end(); ++itemIter )
{
( *itemIter )->setPositionLock( true );
}

composition()->clearSelection();
}

void QgsComposerView::unlockAllItems()
{
if ( !composition() )
{
return;
}

//unlock all items in composer
QList<QGraphicsItem *> itemList = composition()->items();
QList<QGraphicsItem *>::iterator itemIt = itemList.begin();
for ( ; itemIt != itemList.end(); ++itemIt )
{
QgsComposerItem* mypItem = dynamic_cast<QgsComposerItem *>( *itemIt );
if ( mypItem )
{
mypItem->setPositionLock( false );
}
}
}

QMainWindow* QgsComposerView::composerWindow()
{
QMainWindow* composerObject = 0;
@@ -76,6 +76,12 @@ class GUI_EXPORT QgsComposerView: public QGraphicsView
/**Ungroups the selected items*/
void ungroupItems();

/**Lock the selected items*/
void lockItems();

/**Unlock all items*/
void unlockAllItems();

QgsComposerView::Tool currentTool() const {return mCurrentTool;}
void setCurrentTool( QgsComposerView::Tool t ) {mCurrentTool = t;}

@@ -211,7 +211,10 @@ bool BlockArray::setHistorySize( size_t newsize )
else
{
decreaseBuffer( newsize );
( void ) ftruncate( ion, length*blocksize );
if( ftruncate( ion, length*blocksize ) < 0 )
{
perror( "ftruncate" );
}
size = newsize;

return true;
@@ -151,7 +151,8 @@ K3Process::setupEnvironment()
}
if ( !d->wd.isEmpty() )
{
( void ) chdir( QFile::encodeName( d->wd ).data() );
if( chdir( QFile::encodeName( d->wd ).data() ) < 0 )
perror( "chdir" );
}
}

@@ -334,13 +335,15 @@ bool K3Process::start( RunMode runmode, Communication comm )

if ( !runPrivileged() )
{
setgid( getgid() );
if( setgid( getgid() ) < 0 )
perror( "setgid" );
#ifdef HAVE_INITGROUPS
if ( pw )
initgroups( pw->pw_name, pw->pw_gid );
#endif
if ( geteuid() != getuid() )
setuid( getuid() );
if( setuid( getuid() ) < 0 )
perror( "setuid" );
if ( geteuid() != getuid() )
_exit( 1 );
}
@@ -356,7 +359,8 @@ bool K3Process::start( RunMode runmode, Communication comm )
execvp( executable, arglist );

char resultByte = 1;
( void ) write( fd[1], &resultByte, 1 );
if( write( fd[1], &resultByte, 1 ) < 0 )
perror( "write" );
_exit( -1 );
}
else if ( pid_ == -1 )

0 comments on commit 4200046

Please sign in to comment.
You can’t perform that action at this time.