Skip to content

Commit

Permalink
Merge remote branch 'origin/master' into wcs2
Browse files Browse the repository at this point in the history
  • Loading branch information
blazek committed Jul 12, 2012
2 parents c840ce1 + b70a0c6 commit 37ab951
Show file tree
Hide file tree
Showing 71 changed files with 9,345 additions and 5,846 deletions.
1 change: 1 addition & 0 deletions doc/AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,4 @@ Alessandro Furieri <a.furieri at lqt.it>
Alexander Bruy <alexander.bruy@gmail.com>
Marco Bernasocchi <marco at bernawebdesign dot ch>
Nathan Woodrow <woodrow.nathan at gmail.com>
Etienne Tourigny <etourigny.dev at gmail.com>
70 changes: 35 additions & 35 deletions doc/TRANSLATORS

Large diffs are not rendered by default.

Binary file modified doc/qgis-download-stats.ods
Binary file not shown.
2,593 changes: 1,544 additions & 1,049 deletions i18n/qgis_de.ts

Large diffs are not rendered by default.

1,381 changes: 807 additions & 574 deletions i18n/qgis_gl_ES.ts

Large diffs are not rendered by default.

8,423 changes: 4,878 additions & 3,545 deletions i18n/qgis_zh_TW.ts

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion ms-windows/osgeo4w/browser.bat.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ call "%OSGEO4W_ROOT%"\apps\grass\grass-@grassversion@\etc\env.bat
@echo off
path %PATH%;%OSGEO4W_ROOT%\apps\@package@\bin;%OSGEO4W_ROOT%\apps\grass\grass-@grassversion@\lib
set QGIS_PREFIX_PATH=%OSGEO4W_ROOT:\=/%/apps/@package@
start "Quantum GIS Browser" /B "%OSGEO4W_ROOT%"\@package@-browser.exe %*
start "Quantum GIS Browser" /B "%OSGEO4W_ROOT%"\bin\@package@-browser.exe %*
2 changes: 2 additions & 0 deletions python/core/core.sip
Original file line number Diff line number Diff line change
Expand Up @@ -100,3 +100,5 @@
%Include qgsgpsdconnection.sip
%Include qgsnmeaconnection.sip
%Include qgsgpsdetector.sip

%Include qgspaintenginehack.sip
53 changes: 44 additions & 9 deletions python/core/qgscomposermap.sip
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ class QgsComposerMap : QgsComposerItem
enum GridAnnotationPosition
{
InsideMapFrame = 0,
OutsideMapFrame
OutsideMapFrame,
Disabled
};

enum GridAnnotationDirection
Expand All @@ -47,6 +48,21 @@ class QgsComposerMap : QgsComposerItem
BoundaryDirection
};

/**Enum for different frame borders*/
enum Border
{
Left,
Right,
Bottom,
Top
};

enum GridFrameStyle
{
NoGridFrame = 0,
Zebra //black / white pattern
};

/**@deprecated*/
void draw( QPainter *painter, const QgsRectangle& extent, const QSize& size, int dpi );

Expand Down Expand Up @@ -195,20 +211,32 @@ class QgsComposerMap : QgsComposerItem
void setShowGridAnnotation( bool show );
bool showGridAnnotation() const;

/**Sets position of grid annotations. Possibilities are inside or outside of the map frame
@note this function was added in version 1.4*/
void setGridAnnotationPosition( GridAnnotationPosition p );
GridAnnotationPosition gridAnnotationPosition() const;
/**Sets position of grid annotations. Possibilities are inside / outside of the map frame or disabled
@note this function was added in version 1.9*/
void setGridAnnotationPosition( GridAnnotationPosition p, QgsComposerMap::Border border );
/**@note: this function was added in version 1.9*/
GridAnnotationPosition gridAnnotationPosition( QgsComposerMap::Border border ) const;

/**Sets distance between map frame and annotations
@note this function was added in version 1.4*/
void setAnnotationFrameDistance( double d );
double annotationFrameDistance() const;

/**Sets grid annotation direction. Can be horizontal, vertical, direction of axis and horizontal and vertical
@note this function was added in version 1.4*/
void setGridAnnotationDirection( GridAnnotationDirection d );
GridAnnotationDirection gridAnnotationDirection() const;
/**Sets grid annotation direction. Can be horizontal or vertical
@note this function was added in version 1.9*/
void setGridAnnotationDirection( GridAnnotationDirection d, QgsComposerMap::Border border );
/**@note: this function was added in version 1.9*/
GridAnnotationDirection gridAnnotationDirection( QgsComposerMap::Border border ) const;

/**Set grid frame style (NoGridFrame or Zebra)
@note: this function was added in version 1.9*/
void setGridFrameStyle( GridFrameStyle style );
GridFrameStyle gridFrameStyle() const;

/**Set grid frame width
@note: this function was added in version 1.9*/
void setGridFrameWidth( double w );
double gridFrameWidth() const;

/**In case of annotations, the bounding rectangle can be larger than the map item rectangle
@note this function was added in version 1.4*/
Expand All @@ -226,6 +254,13 @@ class QgsComposerMap : QgsComposerItem

void updateItem();

/**Sets overview frame map. -1 disables the overview frame
@note: this function was added in version 1.9*/
void setOverviewFrameMap( int mapId );
/**Returns id of overview frame (or -1 if no overfiew frame)
@note: this function was added in version 1.9*/
int overviewFrameMapId() const;

public slots:

/**Called if map canvas has changed*/
Expand Down
8 changes: 8 additions & 0 deletions python/core/qgspaintenginehack.sip
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
class QgsPaintEngineHack : QPaintEngine
{
%TypeHeaderCode
#include <qgspaintenginehack.h>
%End
public:
static void fixEngineFlags( QPaintEngine *engine );
};
2 changes: 1 addition & 1 deletion python/plugins/fTools/tools/doValidate.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def __init__(self, iface):
def closeEvent(self, e):
settings = QSettings()
settings.setValue( "/fTools/ValidateDialog/geometry", QVariant(self.saveGeometry()) )
QMainWindow.closeEvent(self, e)
QDialog.closeEvent(self, e)
del self.marker

def keyPressEvent( self, e ):
Expand Down
Binary file modified resources/srs.db
Binary file not shown.
2 changes: 1 addition & 1 deletion scripts/tsstat.pl
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
uk => 'Сергей Якунин',
vi => 'Bùi Hữu Mạnh',
zh_CN => 'Zhang Jun',
zh_TW => 'Nungyao Lin',
zh_TW => 'Nung-yao Lin',
};

my $maxn;
Expand Down
87 changes: 31 additions & 56 deletions src/app/composer/qgscomposer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
#include "qgsmessageviewer.h"
#include "qgscontexthelp.h"
#include "qgscursors.h"
#include "qgspaintenginehack.h"

#include <QCloseEvent>
#include <QCheckBox>
Expand Down Expand Up @@ -524,38 +525,6 @@ void QgsComposer::on_mActionRefreshView_triggered()
mComposition->update();
}

// Hack to workaround Qt #5114 by disabling PatternTransform
class QgsPaintEngineHack : public QPaintEngine
{
public:
void fixFlags()
{
gccaps = 0;
gccaps |= ( QPaintEngine::PrimitiveTransform
// | QPaintEngine::PatternTransform
| QPaintEngine::PixmapTransform
| QPaintEngine::PatternBrush
// | QPaintEngine::LinearGradientFill
// | QPaintEngine::RadialGradientFill
// | QPaintEngine::ConicalGradientFill
| QPaintEngine::AlphaBlend
// | QPaintEngine::PorterDuff
| QPaintEngine::PainterPaths
| QPaintEngine::Antialiasing
| QPaintEngine::BrushStroke
| QPaintEngine::ConstantOpacity
| QPaintEngine::MaskedBrush
// | QPaintEngine::PerspectiveTransform
| QPaintEngine::BlendModes
// | QPaintEngine::ObjectBoundingModeGradients
#if QT_VERSION >= 0x040500
| QPaintEngine::RasterOpModes
#endif
| QPaintEngine::PaintOutsidePaintEvent
);
}
};

void QgsComposer::on_mActionExportAsPDF_triggered()
{
QSettings myQSettings; // where we keep last used filter in persistent state
Expand All @@ -582,13 +551,7 @@ void QgsComposer::on_mActionExportAsPDF_triggered()
printer.setOutputFileName( outputFileName );
printer.setPaperSize( QSizeF( mComposition->paperWidth(), mComposition->paperHeight() ), QPrinter::Millimeter );

QPaintEngine *engine = printer.paintEngine();
if ( engine )
{
QgsPaintEngineHack *hack = static_cast<QgsPaintEngineHack*>( engine );
hack->fixFlags();
}

QgsPaintEngineHack::fixEngineFlags( printer.paintEngine() );
print( printer );
}

Expand Down Expand Up @@ -1131,23 +1094,8 @@ void QgsComposer::showEvent( QShowEvent* event )
{
if ( event->spontaneous() ) //event from the window system
{
//go through maps and restore original preview modes (show on demand after loading from project file)
QMap< QgsComposerMap*, int >::iterator mapIt = mMapsToRestore.begin();
for ( ; mapIt != mMapsToRestore.end(); ++mapIt )
{
mapIt.key()->setPreviewMode(( QgsComposerMap::PreviewMode )( mapIt.value() ) );
mapIt.key()->cache();
mapIt.key()->update();
}
mMapsToRestore.clear();

//create composer picture widget previews
QList< QgsComposerPictureWidget* >::iterator picIt = mPicturePreviews.begin();
for ( ; picIt != mPicturePreviews.end(); ++picIt )
{
( *picIt )->addStandardDirectoriesToPreview();
}
mPicturePreviews.clear();
restoreComposerMapStates();
initialiseComposerPicturePreviews();
}

#ifdef Q_WS_MAC
Expand Down Expand Up @@ -1542,6 +1490,9 @@ void QgsComposer::cleanupAfterTemplateRead()
}
}
}

restoreComposerMapStates();
initialiseComposerPicturePreviews();
}

void QgsComposer::on_mActionPageSetup_triggered()
Expand All @@ -1554,3 +1505,27 @@ void QgsComposer::on_mActionPageSetup_triggered()
QPageSetupDialog pageSetupDialog( &mPrinter, this );
pageSetupDialog.exec();
}

void QgsComposer::restoreComposerMapStates()
{
//go through maps and restore original preview modes (show on demand after loading from project file)
QMap< QgsComposerMap*, int >::iterator mapIt = mMapsToRestore.begin();
for ( ; mapIt != mMapsToRestore.end(); ++mapIt )
{
mapIt.key()->setPreviewMode(( QgsComposerMap::PreviewMode )( mapIt.value() ) );
mapIt.key()->cache();
mapIt.key()->update();
}
mMapsToRestore.clear();
}

void QgsComposer::initialiseComposerPicturePreviews()
{
//create composer picture widget previews
QList< QgsComposerPictureWidget* >::iterator picIt = mPicturePreviews.begin();
for ( ; picIt != mPicturePreviews.end(); ++picIt )
{
( *picIt )->addStandardDirectoriesToPreview();
}
mPicturePreviews.clear();
}
8 changes: 8 additions & 0 deletions src/app/composer/qgscomposer.h
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,14 @@ class QgsComposer: public QMainWindow, private Ui::QgsComposerBase
//! Removes all the item from the graphics scene and deletes them
void deleteItems();

//! Restores composer map preview states.
//! Initially after reading from xml, states are set to rectangle to achieve faster project loading.
void restoreComposerMapStates();

//! Fills icons into composer picture widgets
//! To make loading from project faster, the previews are generated when the composer becomes visible.
void initialiseComposerPicturePreviews();

/**Composer title*/
QString mTitle;

Expand Down
Loading

0 comments on commit 37ab951

Please sign in to comment.