Skip to content

Commit 0b874ce

Browse files
committed
Merge branch 'master' of https://github.com/QGIS/qgis
2 parents a292914 + 94f9ae2 commit 0b874ce

File tree

4 files changed

+54
-35
lines changed

4 files changed

+54
-35
lines changed

python/gui/qgsattributedialog.sip

+10-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,16 @@ class QgsAttributeDialog : QDialog
4848
*/
4949
void setHighlight( QgsHighlight *h );
5050

51-
QDialog *dialog();
51+
/**
52+
* @brief Returns reference to self. Only here for legacy compliance
53+
*
54+
* @return this
55+
*
56+
* @deprecated Do not use. Just use this object itself. Or QgsAttributeForm if you want to embed.
57+
*/
58+
QDialog *dialog() /Deprecated/;
59+
60+
QgsAttributeForm *attributeForm();
5261

5362
const QgsFeature* feature();
5463

src/app/gps/qgsgpsinformationwidget.cpp

+24-24
Original file line numberDiff line numberDiff line change
@@ -136,28 +136,28 @@ QgsGPSInformationWidget::QgsGPSInformationWidget( QgsMapCanvas * thepCanvas, QWi
136136
);
137137

138138
// grids, axes
139-
QwtPolarGrid * mypSatellitesGrid = new QwtPolarGrid();
140-
mypSatellitesGrid->setGridAttribute( QwtPolarGrid::AutoScaling, false ); // This fixes the issue of autoscaling on the Radius grid. It is ON by default AND is separate from the scaleData.doAutoScale in QwtPolarPlot::setScale(), etc. THIS IS VERY TRICKY!
141-
mypSatellitesGrid->setPen( QPen( Qt::black ) );
139+
mpSatellitesGrid = new QwtPolarGrid();
140+
mpSatellitesGrid->setGridAttribute( QwtPolarGrid::AutoScaling, false ); // This fixes the issue of autoscaling on the Radius grid. It is ON by default AND is separate from the scaleData.doAutoScale in QwtPolarPlot::setScale(), etc. THIS IS VERY TRICKY!
141+
mpSatellitesGrid->setPen( QPen( Qt::black ) );
142142
QPen minorPen( Qt::gray ); // moved outside of for loop; NOTE setting the minor pen isn't necessary if the minor grids aren't shown
143143
for ( int scaleId = 0; scaleId < QwtPolar::ScaleCount; scaleId++ )
144144
{
145-
//mypSatellitesGrid->showGrid( scaleId );
146-
//mypSatellitesGrid->showMinorGrid(scaleId);
147-
mypSatellitesGrid->setMinorGridPen( scaleId, minorPen );
145+
//mpSatellitesGrid->showGrid( scaleId );
146+
//mpSatellitesGrid->showMinorGrid(scaleId);
147+
mpSatellitesGrid->setMinorGridPen( scaleId, minorPen );
148148
}
149-
// mypSatellitesGrid->setAxisPen( QwtPolar::AxisAzimuth, QPen( Qt::black ) );
150-
151-
mypSatellitesGrid->showAxis( QwtPolar::AxisAzimuth, true );
152-
mypSatellitesGrid->showAxis( QwtPolar::AxisLeft, false ); //alt axis
153-
mypSatellitesGrid->showAxis( QwtPolar::AxisRight, false );//alt axis
154-
mypSatellitesGrid->showAxis( QwtPolar::AxisTop, false );//alt axis
155-
mypSatellitesGrid->showAxis( QwtPolar::AxisBottom, false );//alt axis
156-
mypSatellitesGrid->showGrid( QwtPolar::ScaleAzimuth, false ); // hide the grid; just show ticks at edge
157-
mypSatellitesGrid->showGrid( QwtPolar::ScaleRadius, true );
158-
// mypSatellitesGrid->showMinorGrid( QwtPolar::ScaleAzimuth, true );
159-
mypSatellitesGrid->showMinorGrid( QwtPolar::ScaleRadius, true ); // for 22.5, 67.5 degree circles
160-
mypSatellitesGrid->attach( mpSatellitesWidget );
149+
// mpSatellitesGrid->setAxisPen( QwtPolar::AxisAzimuth, QPen( Qt::black ) );
150+
151+
mpSatellitesGrid->showAxis( QwtPolar::AxisAzimuth, true );
152+
mpSatellitesGrid->showAxis( QwtPolar::AxisLeft, false ); //alt axis
153+
mpSatellitesGrid->showAxis( QwtPolar::AxisRight, false );//alt axis
154+
mpSatellitesGrid->showAxis( QwtPolar::AxisTop, false );//alt axis
155+
mpSatellitesGrid->showAxis( QwtPolar::AxisBottom, false );//alt axis
156+
mpSatellitesGrid->showGrid( QwtPolar::ScaleAzimuth, false ); // hide the grid; just show ticks at edge
157+
mpSatellitesGrid->showGrid( QwtPolar::ScaleRadius, true );
158+
// mpSatellitesGrid->showMinorGrid( QwtPolar::ScaleAzimuth, true );
159+
mpSatellitesGrid->showMinorGrid( QwtPolar::ScaleRadius, true ); // for 22.5, 67.5 degree circles
160+
mpSatellitesGrid->attach( mpSatellitesWidget );
161161

162162
//QwtLegend *legend = new QwtLegend;
163163
//mpSatellitesWidget->insertLegend(legend, QwtPolarPlot::BottomLegend);
@@ -253,8 +253,12 @@ QgsGPSInformationWidget::~QgsGPSInformationWidget()
253253
disconnectGps();
254254
}
255255

256-
if ( mpMapMarker )
257-
delete mpMapMarker;
256+
delete mpMapMarker;
257+
delete mpRubberBand;
258+
259+
#if (WITH_QWTPOLAR)
260+
delete mpSatellitesGrid;
261+
#endif
258262

259263
QSettings mySettings;
260264
mySettings.setValue( "/gps/lastPort", mCboDevices->itemData( mCboDevices->currentIndex() ).toString() );
@@ -303,10 +307,6 @@ QgsGPSInformationWidget::~QgsGPSInformationWidget()
303307
mySettings.setValue( "/gps/panMode", "none" );
304308
}
305309

306-
if ( mpRubberBand )
307-
{
308-
delete mpRubberBand;
309-
}
310310
}
311311

312312
void QgsGPSInformationWidget::on_mSpinTrackWidth_valueChanged( int theValue )

src/app/gps/qgsgpsinformationwidget.h

+2
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#include <qwt_plot_curve.h>
2626
#if (WITH_QWTPOLAR)
2727
#include <qwt_polar_plot.h>
28+
#include <qwt_polar_grid.h>
2829
#include <qwt_polar_marker.h>
2930
#endif
3031

@@ -89,6 +90,7 @@ class QgsGPSInformationWidget: public QWidget, private Ui::QgsGPSInformationWidg
8990
QwtPlotCurve * mpCurve;
9091
#if (WITH_QWTPOLAR)
9192
QwtPolarPlot * mpSatellitesWidget;
93+
QwtPolarGrid *mpSatellitesGrid;
9294
QList< QwtPolarMarker * > mMarkerList;
9395
#endif
9496
void createRubberBand();

src/app/qgsbookmarks.cpp

+18-10
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,10 @@ void QgsBookmarks::zoomToBookmark()
265265

266266
void QgsBookmarks::importFromXML()
267267
{
268-
QString fileName = QFileDialog::getOpenFileName( this, tr( "Import Bookmarks" ), ".",
268+
QSettings settings;
269+
270+
QString lastUsedDir = settings.value( "/Bookmark/LastUsedDirectory", QVariant() ).toString();
271+
QString fileName = QFileDialog::getOpenFileName( this, tr( "Import Bookmarks" ), lastUsedDir,
269272
tr( "XML files (*.xml *XML)" ) );
270273
if ( fileName.isEmpty() )
271274
{
@@ -296,21 +299,21 @@ void QgsBookmarks::importFromXML()
296299
for ( int i = 0;i < nodeList.count(); i++ )
297300
{
298301
QDomNode bookmark = nodeList.at( i );
299-
QDomElement name = bookmark.firstChildElement( "Name" );
300-
QDomElement prjname = bookmark.firstChildElement( "Project" );
301-
QDomElement xmin = bookmark.firstChildElement( "xMin" );
302-
QDomElement xmax = bookmark.firstChildElement( "xMax" );
303-
QDomElement ymin = bookmark.firstChildElement( "yMin" );
304-
QDomElement ymax = bookmark.firstChildElement( "yMax" );
305-
QDomElement srid = bookmark.firstChildElement( "SRID" );
302+
QDomElement name = bookmark.firstChildElement( tr( "Name" ) );
303+
QDomElement prjname = bookmark.firstChildElement( tr( "Project" ) );
304+
QDomElement xmin = bookmark.firstChildElement( tr( "xMin" ) );
305+
QDomElement xmax = bookmark.firstChildElement( tr( "xMax" ) );
306+
QDomElement ymin = bookmark.firstChildElement( tr( "yMin" ) );
307+
QDomElement ymax = bookmark.firstChildElement( tr( "yMax" ) );
308+
QDomElement srid = bookmark.firstChildElement( tr( "SRID" ) );
306309

307310
queries += "INSERT INTO tbl_bookmarks(bookmark_id,name,project_name,xmin,ymin,xmax,ymax,projection_srid)"
308311
" VALUES (NULL,"
309312
"'" + name.text() + "',"
310313
"'" + prjname.text() + "',"
311314
+ xmin.text() + ","
312-
+ xmax.text() + ","
313315
+ ymin.text() + ","
316+
+ xmax.text() + ","
314317
+ ymax.text() + ","
315318
+ srid.text() + ");";
316319
}
@@ -338,7 +341,10 @@ void QgsBookmarks::importFromXML()
338341

339342
void QgsBookmarks::exportToXML()
340343
{
341-
QString fileName = QFileDialog::getSaveFileName( this, tr( "Export bookmarks" ), ".",
344+
QSettings settings;
345+
346+
QString lastUsedDir = settings.value( "/Bookmark/LastUsedDirectory", QVariant() ).toString();
347+
QString fileName = QFileDialog::getSaveFileName( this, tr( "Export bookmarks" ), lastUsedDir,
342348
tr( "XML files( *.xml *.XML )" ) );
343349
if ( fileName.isEmpty() )
344350
{
@@ -388,4 +394,6 @@ void QgsBookmarks::exportToXML()
388394
out.setCodec( "UTF - 8" );
389395
doc.save( out, 2 );
390396
f.close();
397+
398+
settings.setValue( "/Bookmark/LastUsedDirectory", QFileInfo( fileName ).path() );
391399
}

0 commit comments

Comments
 (0)