Skip to content

Commit 5d5f355

Browse files
committedNov 20, 2012
Merge branch 'master' of https://github.com/qgis/Quantum-GIS
2 parents cb07ae4 + 0533e2d commit 5d5f355

22 files changed

+306
-177
lines changed
 

‎python/gui/qgsmapoverviewcanvas.sip

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class QgsMapOverviewCanvas : QWidget
2626

2727
void enableAntiAliasing( bool flag );
2828

29-
void updateFullExtent( const QgsRectangle& rect );
29+
void updateFullExtent();
3030

3131
public slots:
3232

‎python/plugins/sextante/taudem/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
FILE(GLOB PY_FILES *.py)
22
FILE(GLOB DESCR_FILES description/*.txt)
3-
FILE(GLOB HELP_FILES help/*.html)
3+
FILE(GLOB HELP_FILES help/*.*)
44

55
PLUGIN_INSTALL(sextante taudem ${PY_FILES})
66
PLUGIN_INSTALL(sextante taudem/description ${DESCR_FILES})

‎src/app/qgisapp.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3377,6 +3377,9 @@ bool QgisApp::addProject( QString projectFile )
33773377
}
33783378
}
33793379

3380+
// load PAL engine settings
3381+
mLBL->loadEngineSettings();
3382+
33803383
emit projectRead(); // let plug-ins know that we've read in a new
33813384
// project so that they can check any project
33823385
// specific plug-in state

‎src/app/qgsannotationwidget.cpp

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ QgsAnnotationWidget::QgsAnnotationWidget( QgsAnnotationItem* item, QWidget * par
4242
}
4343
mFrameWidthSpinBox->setValue( mItem->frameBorderWidth() );
4444
mFrameColorButton->setColor( mItem->frameColor() );
45+
mBackgroundColorButton->setColor( mItem->frameBackgroundColor() );
4546

4647
const QgsMarkerSymbolV2* symbol = mItem->markerSymbol();
4748
if ( symbol )
@@ -66,6 +67,7 @@ void QgsAnnotationWidget::apply()
6667
mItem->setMapPositionFixed( mMapPositionFixedCheckBox->checkState() == Qt::Checked );
6768
mItem->setFrameBorderWidth( mFrameWidthSpinBox->value() );
6869
mItem->setFrameColor( mFrameColorButton->color() );
70+
mItem->setFrameBackgroundColor( mBackgroundColorButton->color() );
6971
mItem->setMarkerSymbol( mMarkerSymbol );
7072
mMarkerSymbol = 0; //item takes ownership
7173
mItem->update();
@@ -129,3 +131,24 @@ void QgsAnnotationWidget::updateCenterIcon()
129131
mMapMarkerButton->setIcon( icon );
130132
}
131133

134+
void QgsAnnotationWidget::on_mBackgroundColorButton_clicked()
135+
{
136+
if ( !mItem )
137+
{
138+
return;
139+
}
140+
141+
QColor bgColor;
142+
#if QT_VERSION >= 0x040500
143+
bgColor = QColorDialog::getColor( mItem->frameBackgroundColor(), 0, tr( "Select background color" ), QColorDialog::ShowAlphaChannel );
144+
#else
145+
bgColor = QColorDialog::getColor( mItem->frameBackgroundColor() );
146+
#endif
147+
148+
if ( bgColor.isValid() )
149+
{
150+
mItem->setFrameBackgroundColor( bgColor );
151+
mBackgroundColorButton->setColor( bgColor );
152+
}
153+
}
154+

‎src/app/qgsannotationwidget.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ class QgsAnnotationWidget: public QWidget, private Ui::QgsAnnotationWidgetBase
3737
private slots:
3838
void on_mMapMarkerButton_clicked();
3939
void on_mFrameColorButton_clicked();
40+
void on_mBackgroundColorButton_clicked();
4041

4142
private:
4243
QgsAnnotationItem* mItem;

‎src/app/qgslabelengineconfigdialog.cpp

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,18 @@
1515
#include "qgslabelengineconfigdialog.h"
1616

1717
#include "qgspallabeling.h"
18+
#include <pal/pal.h>
19+
20+
#include <QPushButton>
1821

1922
QgsLabelEngineConfigDialog::QgsLabelEngineConfigDialog( QgsPalLabeling* lbl, QWidget* parent )
2023
: QDialog( parent ), mLBL( lbl )
2124
{
2225
setupUi( this );
2326

2427
connect( buttonBox, SIGNAL( accepted() ), this, SLOT( onOK() ) );
28+
connect( buttonBox->button( QDialogButtonBox::RestoreDefaults ), SIGNAL( clicked() ),
29+
this, SLOT( setDefaults() ) );
2530

2631
// search method
2732
cboSearchMethod->setCurrentIndex( mLBL->searchMethod() );
@@ -36,6 +41,8 @@ QgsLabelEngineConfigDialog::QgsLabelEngineConfigDialog( QgsPalLabeling* lbl, QWi
3641
chkShowCandidates->setChecked( mLBL->isShowingCandidates() );
3742

3843
chkShowAllLabels->setChecked( mLBL->isShowingAllLabels() );
44+
45+
mSaveWithProjectChkBox->setChecked( mLBL->isStoredWithProject() );
3946
}
4047

4148

@@ -52,5 +59,24 @@ void QgsLabelEngineConfigDialog::onOK()
5259

5360
mLBL->setShowingAllLabels( chkShowAllLabels->isChecked() );
5461

62+
if ( mSaveWithProjectChkBox->isChecked() )
63+
{
64+
mLBL->saveEngineSettings();
65+
}
66+
else if ( mLBL->isStoredWithProject() )
67+
{
68+
mLBL->clearEngineSettings();
69+
}
5570
accept();
5671
}
72+
73+
void QgsLabelEngineConfigDialog::setDefaults()
74+
{
75+
pal::Pal p;
76+
cboSearchMethod->setCurrentIndex(( int )p.getSearch() );
77+
spinCandPoint->setValue( p.getPointP() );
78+
spinCandLine->setValue( p.getLineP() );
79+
spinCandPolygon->setValue( p.getPolyP() );
80+
chkShowCandidates->setChecked( false );
81+
chkShowAllLabels->setChecked( false );
82+
}

‎src/app/qgslabelengineconfigdialog.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ class QgsLabelEngineConfigDialog : public QDialog, private Ui::QgsEngineConfigDi
2929

3030
public slots:
3131
void onOK();
32+
/** @note Added in QGIS 1.9 */
33+
void setDefaults();
3234

3335
protected:
3436
QgsPalLabeling* mLBL;

‎src/app/qgsoptions.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WFlags fl ) :
429429
cbxCreateRasterLegendIcons->setChecked( settings.value( "/qgis/createRasterLegendIcons", true ).toBool() );
430430
cbxCopyWKTGeomFromTable->setChecked( settings.value( "/qgis/copyGeometryAsWKT", true ).toBool() );
431431
leNullValue->setText( settings.value( "qgis/nullValue", "NULL" ).toString() );
432-
cbxIgnoreShapeEncoding->setChecked( settings.value( "/qgis/ignoreShapeEncoding", false ).toBool() );
432+
cbxIgnoreShapeEncoding->setChecked( settings.value( "/qgis/ignoreShapeEncoding", true ).toBool() );
433433

434434
cmbLegendDoubleClickAction->setCurrentIndex( settings.value( "/qgis/legendDoubleClickAction", 0 ).toInt() );
435435

‎src/app/qgssvgannotationdialog.cpp

Lines changed: 39 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -22,24 +22,25 @@
2222
#include <QFileInfo>
2323
#include <QGraphicsScene>
2424

25-
QgsSvgAnnotationDialog::QgsSvgAnnotationDialog( QgsSvgAnnotationItem* item, QWidget * parent, Qt::WindowFlags f):
25+
QgsSvgAnnotationDialog::QgsSvgAnnotationDialog( QgsSvgAnnotationItem* item, QWidget * parent, Qt::WindowFlags f ):
2626
QDialog( parent, f ), mItem( item ), mEmbeddedWidget( 0 )
2727
{
28-
setupUi( this );
29-
mEmbeddedWidget = new QgsAnnotationWidget( mItem );
30-
mEmbeddedWidget->show();
31-
mStackedWidget->addWidget( mEmbeddedWidget );
32-
mStackedWidget->setCurrentWidget( mEmbeddedWidget );
28+
setupUi( this );
29+
setWindowTitle( tr( "SVG annotation" ) );
30+
mEmbeddedWidget = new QgsAnnotationWidget( mItem );
31+
mEmbeddedWidget->show();
32+
mStackedWidget->addWidget( mEmbeddedWidget );
33+
mStackedWidget->setCurrentWidget( mEmbeddedWidget );
3334

34-
if( mItem )
35-
{
36-
mFileLineEdit->setText( mItem->filePath() );
37-
}
35+
if ( mItem )
36+
{
37+
mFileLineEdit->setText( mItem->filePath() );
38+
}
3839

39-
QObject::connect( mButtonBox, SIGNAL( accepted() ), this, SLOT( applySettingsToItem() ) );
40-
QPushButton* deleteButton = new QPushButton( tr( "Delete" ) );
41-
QObject::connect( deleteButton, SIGNAL( clicked() ), this, SLOT( deleteItem() ) );
42-
mButtonBox->addButton( deleteButton, QDialogButtonBox::RejectRole );
40+
QObject::connect( mButtonBox, SIGNAL( accepted() ), this, SLOT( applySettingsToItem() ) );
41+
QPushButton* deleteButton = new QPushButton( tr( "Delete" ) );
42+
QObject::connect( deleteButton, SIGNAL( clicked() ), this, SLOT( deleteItem() ) );
43+
mButtonBox->addButton( deleteButton, QDialogButtonBox::RejectRole );
4344
}
4445

4546
QgsSvgAnnotationDialog::QgsSvgAnnotationDialog(): QDialog(), mItem( 0 ), mEmbeddedWidget( 0 )
@@ -54,38 +55,38 @@ QgsSvgAnnotationDialog::~QgsSvgAnnotationDialog()
5455

5556
void QgsSvgAnnotationDialog::on_mBrowseToolButton_clicked()
5657
{
57-
QString directory;
58-
QFileInfo fi( mFileLineEdit->text() );
59-
if ( fi.exists() )
60-
{
61-
directory = fi.absolutePath();
62-
}
63-
QString filename = QFileDialog::getOpenFileName( 0, tr( "html" ), directory, "*.html" );
64-
mFileLineEdit->setText( filename );
58+
QString directory;
59+
QFileInfo fi( mFileLineEdit->text() );
60+
if ( fi.exists() )
61+
{
62+
directory = fi.absolutePath();
63+
}
64+
QString filename = QFileDialog::getOpenFileName( 0, tr( "Select SVG file" ), directory, tr( "SVG files" ) + " (*.svg)" );
65+
mFileLineEdit->setText( filename );
6566
}
6667

6768
void QgsSvgAnnotationDialog::applySettingsToItem()
6869
{
69-
if ( mEmbeddedWidget )
70-
{
71-
mEmbeddedWidget->apply();
72-
}
70+
if ( mEmbeddedWidget )
71+
{
72+
mEmbeddedWidget->apply();
73+
}
7374

74-
if( mItem )
75-
{
76-
mItem->setFilePath( mFileLineEdit->text() );
77-
mItem->update();
78-
}
75+
if ( mItem )
76+
{
77+
mItem->setFilePath( mFileLineEdit->text() );
78+
mItem->update();
79+
}
7980

8081
}
8182

8283
void QgsSvgAnnotationDialog::deleteItem()
8384
{
84-
QGraphicsScene* scene = mItem->scene();
85-
if ( scene )
86-
{
87-
scene->removeItem( mItem );
88-
}
89-
delete mItem;
90-
mItem = 0;
85+
QGraphicsScene* scene = mItem->scene();
86+
if ( scene )
87+
{
88+
scene->removeItem( mItem );
89+
}
90+
delete mItem;
91+
mItem = 0;
9192
}

‎src/app/qgstextannotationdialog.cpp

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ QgsTextAnnotationDialog::QgsTextAnnotationDialog( QgsTextAnnotationItem* item, Q
3232
{
3333
mTextDocument = mItem->document();
3434
mTextEdit->setDocument( mTextDocument );
35-
mBackgroundColorButton->setColor( mItem->frameBackgroundColor() );
3635
}
3736
setCurrentFontPropertiesToGui();
3837

@@ -148,24 +147,3 @@ void QgsTextAnnotationDialog::deleteItem()
148147
mItem = 0;
149148
}
150149

151-
void QgsTextAnnotationDialog::on_mBackgroundColorButton_clicked()
152-
{
153-
if ( !mItem )
154-
{
155-
return;
156-
}
157-
158-
QColor bgColor;
159-
#if QT_VERSION >= 0x040500
160-
bgColor = QColorDialog::getColor( mItem->frameBackgroundColor(), 0, tr( "Select background color" ), QColorDialog::ShowAlphaChannel );
161-
#else
162-
bgColor = QColorDialog::getColor( mItem->frameBackgroundColor() );
163-
#endif
164-
165-
if ( bgColor.isValid() )
166-
{
167-
mItem->setFrameBackgroundColor( bgColor );
168-
mBackgroundColorButton->setColor( bgColor );
169-
}
170-
}
171-

‎src/app/qgstextannotationdialog.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ class QgsTextAnnotationDialog: public QDialog, private Ui::QgsTextAnnotationDial
4444
void on_mFontColorButton_clicked();
4545
void setCurrentFontPropertiesToGui();
4646
void deleteItem();
47-
void on_mBackgroundColorButton_clicked();
4847
};
4948

5049
#endif // QGSTEXTANNOTATIONDIALOG_H

‎src/core/qgspallabeling.cpp

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
#include <qgsvectordataprovider.h>
5050
#include <qgsgeometry.h>
5151
#include <qgsmaprenderer.h>
52+
#include <qgsproject.h>
5253
#include <QMessageBox>
5354

5455
using namespace pal;
@@ -1929,6 +1930,48 @@ void QgsPalLabeling::drawLabelBuffer( QPainter* p, QString text, const QFont& fo
19291930
p->drawPath( path );
19301931
}
19311932

1933+
void QgsPalLabeling::loadEngineSettings()
1934+
{
1935+
// start with engine defaults for new project, or project that has no saved settings
1936+
Pal p;
1937+
bool saved = false;
1938+
mSearch = ( QgsPalLabeling::Search )( QgsProject::instance()->readNumEntry(
1939+
"PAL", "/SearchMethod", ( int )p.getSearch(), &saved ) );
1940+
mCandPoint = QgsProject::instance()->readNumEntry(
1941+
"PAL", "/CandidatesPoint", p.getPointP(), &saved );
1942+
mCandLine = QgsProject::instance()->readNumEntry(
1943+
"PAL", "/CandidatesLine", p.getLineP(), &saved );
1944+
mCandPolygon = QgsProject::instance()->readNumEntry(
1945+
"PAL", "/CandidatesPolygon", p.getPolyP(), &saved );
1946+
mShowingCandidates = QgsProject::instance()->readBoolEntry(
1947+
"PAL", "/ShowingCandidates", false, &saved );
1948+
mShowingAllLabels = QgsProject::instance()->readBoolEntry(
1949+
"PAL", "/ShowingAllLabels", false, &saved );
1950+
mSavedWithProject = saved;
1951+
}
1952+
1953+
void QgsPalLabeling::saveEngineSettings()
1954+
{
1955+
QgsProject::instance()->writeEntry( "PAL", "/SearchMethod", ( int )mSearch );
1956+
QgsProject::instance()->writeEntry( "PAL", "/CandidatesPoint", mCandPoint );
1957+
QgsProject::instance()->writeEntry( "PAL", "/CandidatesLine", mCandLine );
1958+
QgsProject::instance()->writeEntry( "PAL", "/CandidatesPolygon", mCandPolygon );
1959+
QgsProject::instance()->writeEntry( "PAL", "/ShowingCandidates", mShowingCandidates );
1960+
QgsProject::instance()->writeEntry( "PAL", "/ShowingAllLabels", mShowingAllLabels );
1961+
mSavedWithProject = true;
1962+
}
1963+
1964+
void QgsPalLabeling::clearEngineSettings()
1965+
{
1966+
QgsProject::instance()->removeEntry( "PAL", "/SearchMethod" );
1967+
QgsProject::instance()->removeEntry( "PAL", "/CandidatesPoint" );
1968+
QgsProject::instance()->removeEntry( "PAL", "/CandidatesLine" );
1969+
QgsProject::instance()->removeEntry( "PAL", "/CandidatesPolygon" );
1970+
QgsProject::instance()->removeEntry( "PAL", "/ShowingCandidates" );
1971+
QgsProject::instance()->removeEntry( "PAL", "/ShowingAllLabels" );
1972+
mSavedWithProject = false;
1973+
}
1974+
19321975
QgsLabelingEngineInterface* QgsPalLabeling::clone()
19331976
{
19341977
QgsPalLabeling* lbl = new QgsPalLabeling();

‎src/core/qgspallabeling.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,14 @@ class CORE_EXPORT QgsPalLabeling : public QgsLabelingEngineInterface
314314
const QColor& bufferColor = QColor( 255, 255, 255 ), bool drawBuffer = false );
315315
static void drawLabelBuffer( QPainter* p, QString text, const QFont& font, double size, QColor color , Qt::PenJoinStyle joinstyle = Qt::BevelJoin, bool noFill = false );
316316

317+
//! load/save engine settings to project file
318+
//! @note added in QGIS 1.9
319+
void loadEngineSettings();
320+
void saveEngineSettings();
321+
void clearEngineSettings();
322+
bool isStoredWithProject() const { return mSavedWithProject; }
323+
void setStoredWithProject( bool store ) { mSavedWithProject = store; }
324+
317325
protected:
318326
// hashtable of layer settings, being filled during labeling
319327
QHash<QgsVectorLayer*, QgsPalLayerSettings> mActiveLayers;
@@ -333,6 +341,8 @@ class CORE_EXPORT QgsPalLabeling : public QgsLabelingEngineInterface
333341

334342
bool mShowingAllLabels; // whether to avoid collisions or not
335343

344+
bool mSavedWithProject; // whether engine settings have been read from project file
345+
336346
QgsLabelSearchTree* mLabelSearchTree;
337347
};
338348

‎src/gui/qgsannotationitem.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,7 @@ void QgsAnnotationItem::_writeXML( QDomDocument& doc, QDomElement& itemElem ) co
397397
annotationElem.setAttribute( "canvasPosY", QString::number( canvasPos.y() ) );
398398
annotationElem.setAttribute( "frameBorderWidth", QString::number( mFrameBorderWidth ) );
399399
annotationElem.setAttribute( "frameColor", mFrameColor.name() );
400+
annotationElem.setAttribute( "frameColorAlpha", mFrameColor.alpha() );
400401
annotationElem.setAttribute( "frameBackgroundColor", mFrameBackgroundColor.name() );
401402
annotationElem.setAttribute( "frameBackgroundColorAlpha", mFrameBackgroundColor.alpha() );
402403
annotationElem.setAttribute( "visible", isVisible() );
@@ -428,6 +429,7 @@ void QgsAnnotationItem::_readXML( const QDomDocument& doc, const QDomElement& an
428429
mMapPosition = mapPos;
429430
mFrameBorderWidth = annotationElem.attribute( "frameBorderWidth", "0.5" ).toDouble();
430431
mFrameColor.setNamedColor( annotationElem.attribute( "frameColor", "#000000" ) );
432+
mFrameColor.setAlpha( annotationElem.attribute( "frameColorAlpha", "255" ).toInt() );
431433
mFrameBackgroundColor.setNamedColor( annotationElem.attribute( "frameBackgroundColor" ) );
432434
mFrameBackgroundColor.setAlpha( annotationElem.attribute( "frameBackgroundColorAlpha", "255" ).toInt() );
433435
mFrameSize.setWidth( annotationElem.attribute( "frameWidth", "50" ).toDouble() );

‎src/gui/qgsmapcanvas.cpp

Lines changed: 31 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -265,45 +265,48 @@ void QgsMapCanvas::setLayerSet( QList<QgsMapCanvasLayer> &layers )
265265
bool layerSetChanged = layerSetOld != layerSet;
266266

267267
// update only if needed
268-
if ( !layerSetChanged )
269-
return;
270-
271-
QgsDebugMsg( "Layer changed to: " + layerSet.join( ", " ) );
272-
273-
for ( i = 0; i < layerCount(); i++ )
268+
if ( layerSetChanged )
274269
{
275-
// Add check if vector layer when disconnecting from selectionChanged slot
276-
// Ticket #811 - racicot
277-
QgsMapLayer *currentLayer = layer( i );
278-
disconnect( currentLayer, SIGNAL( repaintRequested() ), this, SLOT( refresh() ) );
279-
disconnect( currentLayer, SIGNAL( screenUpdateRequested() ), this, SLOT( updateMap() ) );
280-
QgsVectorLayer *isVectLyr = qobject_cast<QgsVectorLayer *>( currentLayer );
281-
if ( isVectLyr )
270+
QgsDebugMsg( "Layers changed to: " + layerSet.join( ", " ) );
271+
272+
for ( i = 0; i < layerCount(); i++ )
282273
{
283-
disconnect( currentLayer, SIGNAL( selectionChanged() ), this, SLOT( selectionChangedSlot() ) );
274+
// Add check if vector layer when disconnecting from selectionChanged slot
275+
// Ticket #811 - racicot
276+
QgsMapLayer *currentLayer = layer( i );
277+
disconnect( currentLayer, SIGNAL( repaintRequested() ), this, SLOT( refresh() ) );
278+
disconnect( currentLayer, SIGNAL( screenUpdateRequested() ), this, SLOT( updateMap() ) );
279+
QgsVectorLayer *isVectLyr = qobject_cast<QgsVectorLayer *>( currentLayer );
280+
if ( isVectLyr )
281+
{
282+
disconnect( currentLayer, SIGNAL( selectionChanged() ), this, SLOT( selectionChangedSlot() ) );
283+
}
284284
}
285-
}
286285

287-
mMapRenderer->setLayerSet( layerSet );
286+
mMapRenderer->setLayerSet( layerSet );
288287

289-
for ( i = 0; i < layerCount(); i++ )
290-
{
291-
// Add check if vector layer when connecting to selectionChanged slot
292-
// Ticket #811 - racicot
293-
QgsMapLayer *currentLayer = layer( i );
294-
connect( currentLayer, SIGNAL( repaintRequested() ), this, SLOT( refresh() ) );
295-
connect( currentLayer, SIGNAL( screenUpdateRequested() ), this, SLOT( updateMap() ) );
296-
QgsVectorLayer *isVectLyr = qobject_cast<QgsVectorLayer *>( currentLayer );
297-
if ( isVectLyr )
288+
for ( i = 0; i < layerCount(); i++ )
298289
{
299-
connect( currentLayer, SIGNAL( selectionChanged() ), this, SLOT( selectionChangedSlot() ) );
290+
// Add check if vector layer when connecting to selectionChanged slot
291+
// Ticket #811 - racicot
292+
QgsMapLayer *currentLayer = layer( i );
293+
connect( currentLayer, SIGNAL( repaintRequested() ), this, SLOT( refresh() ) );
294+
connect( currentLayer, SIGNAL( screenUpdateRequested() ), this, SLOT( updateMap() ) );
295+
QgsVectorLayer *isVectLyr = qobject_cast<QgsVectorLayer *>( currentLayer );
296+
if ( isVectLyr )
297+
{
298+
connect( currentLayer, SIGNAL( selectionChanged() ), this, SLOT( selectionChangedSlot() ) );
299+
}
300300
}
301+
302+
QgsDebugMsg( "Layers have changed, refreshing" );
303+
emit layersChanged();
304+
305+
refresh();
301306
}
302307

303308
if ( mMapOverview )
304309
{
305-
mMapOverview->updateFullExtent( fullExtent() );
306-
307310
QStringList& layerSetOvOld = mMapOverview->layerSet();
308311
if ( layerSetOvOld != layerSetOverview )
309312
{
@@ -314,12 +317,6 @@ void QgsMapCanvas::setLayerSet( QList<QgsMapCanvasLayer> &layers )
314317
// because full extent might have changed
315318
updateOverview();
316319
}
317-
318-
QgsDebugMsg( "Layers have changed, refreshing" );
319-
emit layersChanged();
320-
321-
refresh();
322-
323320
} // setLayerSet
324321

325322
void QgsMapCanvas::enableOverviewMode( QgsMapOverviewCanvas* overview )
@@ -514,11 +511,6 @@ void QgsMapCanvas::updateFullExtent()
514511
QgsDebugMsg( "updating full extent" );
515512

516513
mMapRenderer->updateFullExtent();
517-
if ( mMapOverview )
518-
{
519-
mMapOverview->updateFullExtent( fullExtent() );
520-
updateOverview();
521-
}
522514
refresh();
523515
}
524516

‎src/gui/qgsmapoverviewcanvas.cpp

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ void QgsMapOverviewCanvas::paintEvent( QPaintEvent* pe )
9595
{
9696
mPixmap = QPixmap( mNewSize );
9797
mMapRenderer->setOutputSize( mNewSize, mPixmap.logicalDpiX() );
98+
updateFullExtent();
9899
mNewSize = QSize();
99100
refresh();
100101
}
@@ -106,10 +107,12 @@ void QgsMapOverviewCanvas::paintEvent( QPaintEvent* pe )
106107

107108
void QgsMapOverviewCanvas::drawExtentRect()
108109
{
110+
if ( !mMapCanvas || !mMapRenderer ) return;
111+
109112
const QgsRectangle& extent = mMapCanvas->extent();
110113

111114
// show only when valid extent is set
112-
if ( extent.isEmpty() )
115+
if ( extent.isEmpty() || mMapRenderer->extent().isEmpty() )
113116
{
114117
mPanningWidget->hide();
115118
return;
@@ -290,11 +293,23 @@ void QgsMapOverviewCanvas::setBackgroundColor( const QColor& color )
290293

291294
void QgsMapOverviewCanvas::setLayerSet( const QStringList& layerSet )
292295
{
296+
QgsDebugMsg( "layerSet: " + layerSet.join( ", " ) );
297+
if ( !mMapRenderer ) return;
293298
mMapRenderer->setLayerSet( layerSet );
299+
mMapRenderer->updateFullExtent();
300+
updateFullExtent();
294301
}
295302

296-
void QgsMapOverviewCanvas::updateFullExtent( const QgsRectangle& rect )
303+
void QgsMapOverviewCanvas::updateFullExtent()
297304
{
305+
if ( !mMapRenderer ) return;
306+
QgsRectangle rect;
307+
if ( !mMapRenderer->layerSet().isEmpty() )
308+
{
309+
rect = mMapRenderer->fullExtent();
310+
// expand a bit to keep features on margin
311+
rect.scale( 1.1 );
312+
}
298313
mMapRenderer->setExtent( rect );
299314
drawExtentRect();
300315
}

‎src/gui/qgsmapoverviewcanvas.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class GUI_EXPORT QgsMapOverviewCanvas : public QWidget
5959

6060
void enableAntiAliasing( bool flag ) { mAntiAliasing = flag; }
6161

62-
void updateFullExtent( const QgsRectangle& rect );
62+
void updateFullExtent();
6363

6464
public slots:
6565

‎src/providers/ogr/qgsogrprovider.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ QgsOgrProvider::QgsOgrProvider( QString const & uri )
206206
QgsApplication::registerOgrDrivers();
207207

208208
QSettings settings;
209-
CPLSetConfigOption( "SHAPE_ENCODING", settings.value( "/qgis/ignoreShapeEncoding", false ).toBool() ? "" : 0 );
209+
CPLSetConfigOption( "SHAPE_ENCODING", settings.value( "/qgis/ignoreShapeEncoding", true ).toBool() ? "" : 0 );
210210

211211
// set the selection rectangle pointer to 0
212212
mSelectionRectangle = 0;

‎src/ui/qgsannotationwidgetbase.ui

Lines changed: 34 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@
66
<rect>
77
<x>0</x>
88
<y>0</y>
9-
<width>213</width>
10-
<height>152</height>
9+
<width>180</width>
10+
<height>151</height>
1111
</rect>
1212
</property>
1313
<property name="windowTitle">
1414
<string>Form</string>
1515
</property>
16-
<layout class="QGridLayout" name="gridLayout">
16+
<layout class="QGridLayout" name="gridLayout_2">
1717
<item row="0" column="0">
1818
<widget class="QCheckBox" name="mMapPositionFixedCheckBox">
1919
<property name="text">
@@ -22,8 +22,8 @@
2222
</widget>
2323
</item>
2424
<item row="1" column="0">
25-
<layout class="QHBoxLayout" name="horizontalLayout">
26-
<item>
25+
<layout class="QGridLayout" name="gridLayout">
26+
<item row="0" column="0">
2727
<widget class="QLabel" name="mMapMarkerLabel">
2828
<property name="text">
2929
<string>Map marker</string>
@@ -33,18 +33,14 @@
3333
</property>
3434
</widget>
3535
</item>
36-
<item>
36+
<item row="0" column="1">
3737
<widget class="QPushButton" name="mMapMarkerButton">
3838
<property name="text">
3939
<string/>
4040
</property>
4141
</widget>
4242
</item>
43-
</layout>
44-
</item>
45-
<item row="2" column="0">
46-
<layout class="QHBoxLayout" name="horizontalLayout_2">
47-
<item>
43+
<item row="1" column="0">
4844
<widget class="QLabel" name="mFrameWidthLabel">
4945
<property name="text">
5046
<string>Frame width</string>
@@ -54,14 +50,33 @@
5450
</property>
5551
</widget>
5652
</item>
57-
<item>
53+
<item row="1" column="1">
5854
<widget class="QDoubleSpinBox" name="mFrameWidthSpinBox"/>
5955
</item>
60-
</layout>
61-
</item>
62-
<item row="3" column="0">
63-
<layout class="QHBoxLayout" name="horizontalLayout_3">
64-
<item>
56+
<item row="2" column="0">
57+
<widget class="QLabel" name="mBackgroundColorLabel">
58+
<property name="text">
59+
<string>Background color</string>
60+
</property>
61+
<property name="buddy">
62+
<cstring>mBackgroundColorButton</cstring>
63+
</property>
64+
</widget>
65+
</item>
66+
<item row="2" column="1">
67+
<widget class="QgsColorButton" name="mBackgroundColorButton">
68+
<property name="sizePolicy">
69+
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
70+
<horstretch>0</horstretch>
71+
<verstretch>0</verstretch>
72+
</sizepolicy>
73+
</property>
74+
<property name="text">
75+
<string/>
76+
</property>
77+
</widget>
78+
</item>
79+
<item row="3" column="0">
6580
<widget class="QLabel" name="mFrameColorLabel">
6681
<property name="text">
6782
<string>Frame color</string>
@@ -71,10 +86,10 @@
7186
</property>
7287
</widget>
7388
</item>
74-
<item>
89+
<item row="3" column="1">
7590
<widget class="QgsColorButton" name="mFrameColorButton">
7691
<property name="sizePolicy">
77-
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
92+
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
7893
<horstretch>0</horstretch>
7994
<verstretch>0</verstretch>
8095
</sizepolicy>

‎src/ui/qgsengineconfigdialog.ui

Lines changed: 59 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,16 @@
66
<rect>
77
<x>0</x>
88
<y>0</y>
9-
<width>316</width>
10-
<height>328</height>
9+
<width>336</width>
10+
<height>352</height>
1111
</rect>
1212
</property>
13+
<property name="minimumSize">
14+
<size>
15+
<width>336</width>
16+
<height>0</height>
17+
</size>
18+
</property>
1319
<property name="windowTitle">
1420
<string>Dialog</string>
1521
</property>
@@ -209,14 +215,49 @@
209215
<property name="verticalSpacing">
210216
<number>6</number>
211217
</property>
212-
<item row="0" column="1">
213-
<widget class="QLabel" name="label_5">
218+
<item row="1" column="0">
219+
<spacer name="horizontalSpacer_3">
220+
<property name="orientation">
221+
<enum>Qt::Horizontal</enum>
222+
</property>
223+
<property name="sizeType">
224+
<enum>QSizePolicy::Fixed</enum>
225+
</property>
226+
<property name="sizeHint" stdset="0">
227+
<size>
228+
<width>8</width>
229+
<height>8</height>
230+
</size>
231+
</property>
232+
</spacer>
233+
</item>
234+
<item row="1" column="1">
235+
<widget class="QLabel" name="label_6">
236+
<property name="sizePolicy">
237+
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
238+
<horstretch>0</horstretch>
239+
<verstretch>0</verstretch>
240+
</sizepolicy>
241+
</property>
214242
<property name="text">
215-
<string>Show all labels and features for all layers</string>
243+
<string>(i.e. including colliding objects)</string>
216244
</property>
217245
</widget>
218246
</item>
219-
<item row="0" column="0">
247+
<item row="1" column="2">
248+
<spacer name="horizontalSpacer_4">
249+
<property name="orientation">
250+
<enum>Qt::Horizontal</enum>
251+
</property>
252+
<property name="sizeHint" stdset="0">
253+
<size>
254+
<width>40</width>
255+
<height>20</height>
256+
</size>
257+
</property>
258+
</spacer>
259+
</item>
260+
<item row="0" column="0" colspan="3">
220261
<widget class="QCheckBox" name="chkShowAllLabels">
221262
<property name="sizePolicy">
222263
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
@@ -225,21 +266,27 @@
225266
</sizepolicy>
226267
</property>
227268
<property name="text">
228-
<string/>
269+
<string>Show all labels and features for all layers</string>
229270
</property>
230271
</widget>
231272
</item>
232-
<item row="2" column="0" colspan="2">
273+
<item row="2" column="0" colspan="3">
233274
<widget class="QCheckBox" name="chkShowCandidates">
234275
<property name="text">
235276
<string>Show candidates (for debugging)</string>
236277
</property>
237278
</widget>
238279
</item>
239-
<item row="1" column="1">
240-
<widget class="QLabel" name="label_6">
280+
<item row="3" column="0" colspan="3">
281+
<widget class="QCheckBox" name="mSaveWithProjectChkBox">
282+
<property name="layoutDirection">
283+
<enum>Qt::LeftToRight</enum>
284+
</property>
241285
<property name="text">
242-
<string>(i.e. including colliding objects)</string>
286+
<string>Save settings with project</string>
287+
</property>
288+
<property name="checked">
289+
<bool>false</bool>
243290
</property>
244291
</widget>
245292
</item>
@@ -264,7 +311,7 @@
264311
<enum>Qt::Horizontal</enum>
265312
</property>
266313
<property name="standardButtons">
267-
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
314+
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok|QDialogButtonBox::RestoreDefaults</set>
268315
</property>
269316
</widget>
270317
</item>

‎src/ui/qgsformannotationdialogbase.ui

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
</rect>
1212
</property>
1313
<property name="windowTitle">
14-
<string>Dialog</string>
14+
<string>Form annotation</string>
1515
</property>
1616
<layout class="QGridLayout" name="gridLayout">
1717
<item row="0" column="0">

‎src/ui/qgstextannotationdialogbase.ui

Lines changed: 10 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -70,37 +70,20 @@
7070
</item>
7171
</layout>
7272
</item>
73+
<item row="3" column="0">
74+
<widget class="QDialogButtonBox" name="mButtonBox">
75+
<property name="orientation">
76+
<enum>Qt::Horizontal</enum>
77+
</property>
78+
<property name="standardButtons">
79+
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
80+
</property>
81+
</widget>
82+
</item>
7383
<item row="1" column="0">
7484
<widget class="QTextEdit" name="mTextEdit"/>
7585
</item>
7686
<item row="2" column="0">
77-
<layout class="QHBoxLayout" name="horizontalLayout_2">
78-
<item>
79-
<widget class="QLabel" name="mBackgroundColorLabel">
80-
<property name="text">
81-
<string>Background color</string>
82-
</property>
83-
<property name="buddy">
84-
<cstring>mBackgroundColorButton</cstring>
85-
</property>
86-
</widget>
87-
</item>
88-
<item>
89-
<widget class="QgsColorButton" name="mBackgroundColorButton">
90-
<property name="sizePolicy">
91-
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
92-
<horstretch>0</horstretch>
93-
<verstretch>0</verstretch>
94-
</sizepolicy>
95-
</property>
96-
<property name="text">
97-
<string/>
98-
</property>
99-
</widget>
100-
</item>
101-
</layout>
102-
</item>
103-
<item row="3" column="0">
10487
<widget class="QStackedWidget" name="mStackedWidget">
10588
<property name="currentIndex">
10689
<number>0</number>
@@ -109,16 +92,6 @@
10992
<widget class="QWidget" name="page_2"/>
11093
</widget>
11194
</item>
112-
<item row="4" column="0">
113-
<widget class="QDialogButtonBox" name="mButtonBox">
114-
<property name="orientation">
115-
<enum>Qt::Horizontal</enum>
116-
</property>
117-
<property name="standardButtons">
118-
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
119-
</property>
120-
</widget>
121-
</item>
12295
</layout>
12396
</widget>
12497
<customwidgets>
@@ -135,7 +108,6 @@
135108
<tabstop>mItalicsPushButton</tabstop>
136109
<tabstop>mFontColorButton</tabstop>
137110
<tabstop>mTextEdit</tabstop>
138-
<tabstop>mBackgroundColorButton</tabstop>
139111
<tabstop>mButtonBox</tabstop>
140112
</tabstops>
141113
<resources/>

0 commit comments

Comments
 (0)
Please sign in to comment.