Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/QGIS/qgis
Browse files Browse the repository at this point in the history
  • Loading branch information
tomkralidis committed Feb 24, 2015
2 parents a292914 + 94f9ae2 commit 0b874ce
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 35 deletions.
11 changes: 10 additions & 1 deletion python/gui/qgsattributedialog.sip
Expand Up @@ -48,7 +48,16 @@ class QgsAttributeDialog : QDialog
*/
void setHighlight( QgsHighlight *h );

QDialog *dialog();
/**
* @brief Returns reference to self. Only here for legacy compliance
*
* @return this
*
* @deprecated Do not use. Just use this object itself. Or QgsAttributeForm if you want to embed.
*/
QDialog *dialog() /Deprecated/;

QgsAttributeForm *attributeForm();

const QgsFeature* feature();

Expand Down
48 changes: 24 additions & 24 deletions src/app/gps/qgsgpsinformationwidget.cpp
Expand Up @@ -136,28 +136,28 @@ QgsGPSInformationWidget::QgsGPSInformationWidget( QgsMapCanvas * thepCanvas, QWi
);

// grids, axes
QwtPolarGrid * mypSatellitesGrid = new QwtPolarGrid();
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!
mypSatellitesGrid->setPen( QPen( Qt::black ) );
mpSatellitesGrid = new QwtPolarGrid();
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!
mpSatellitesGrid->setPen( QPen( Qt::black ) );
QPen minorPen( Qt::gray ); // moved outside of for loop; NOTE setting the minor pen isn't necessary if the minor grids aren't shown
for ( int scaleId = 0; scaleId < QwtPolar::ScaleCount; scaleId++ )
{
//mypSatellitesGrid->showGrid( scaleId );
//mypSatellitesGrid->showMinorGrid(scaleId);
mypSatellitesGrid->setMinorGridPen( scaleId, minorPen );
//mpSatellitesGrid->showGrid( scaleId );
//mpSatellitesGrid->showMinorGrid(scaleId);
mpSatellitesGrid->setMinorGridPen( scaleId, minorPen );
}
// mypSatellitesGrid->setAxisPen( QwtPolar::AxisAzimuth, QPen( Qt::black ) );

mypSatellitesGrid->showAxis( QwtPolar::AxisAzimuth, true );
mypSatellitesGrid->showAxis( QwtPolar::AxisLeft, false ); //alt axis
mypSatellitesGrid->showAxis( QwtPolar::AxisRight, false );//alt axis
mypSatellitesGrid->showAxis( QwtPolar::AxisTop, false );//alt axis
mypSatellitesGrid->showAxis( QwtPolar::AxisBottom, false );//alt axis
mypSatellitesGrid->showGrid( QwtPolar::ScaleAzimuth, false ); // hide the grid; just show ticks at edge
mypSatellitesGrid->showGrid( QwtPolar::ScaleRadius, true );
// mypSatellitesGrid->showMinorGrid( QwtPolar::ScaleAzimuth, true );
mypSatellitesGrid->showMinorGrid( QwtPolar::ScaleRadius, true ); // for 22.5, 67.5 degree circles
mypSatellitesGrid->attach( mpSatellitesWidget );
// mpSatellitesGrid->setAxisPen( QwtPolar::AxisAzimuth, QPen( Qt::black ) );

mpSatellitesGrid->showAxis( QwtPolar::AxisAzimuth, true );
mpSatellitesGrid->showAxis( QwtPolar::AxisLeft, false ); //alt axis
mpSatellitesGrid->showAxis( QwtPolar::AxisRight, false );//alt axis
mpSatellitesGrid->showAxis( QwtPolar::AxisTop, false );//alt axis
mpSatellitesGrid->showAxis( QwtPolar::AxisBottom, false );//alt axis
mpSatellitesGrid->showGrid( QwtPolar::ScaleAzimuth, false ); // hide the grid; just show ticks at edge
mpSatellitesGrid->showGrid( QwtPolar::ScaleRadius, true );
// mpSatellitesGrid->showMinorGrid( QwtPolar::ScaleAzimuth, true );
mpSatellitesGrid->showMinorGrid( QwtPolar::ScaleRadius, true ); // for 22.5, 67.5 degree circles
mpSatellitesGrid->attach( mpSatellitesWidget );

//QwtLegend *legend = new QwtLegend;
//mpSatellitesWidget->insertLegend(legend, QwtPolarPlot::BottomLegend);
Expand Down Expand Up @@ -253,8 +253,12 @@ QgsGPSInformationWidget::~QgsGPSInformationWidget()
disconnectGps();
}

if ( mpMapMarker )
delete mpMapMarker;
delete mpMapMarker;
delete mpRubberBand;

#if (WITH_QWTPOLAR)
delete mpSatellitesGrid;
#endif

QSettings mySettings;
mySettings.setValue( "/gps/lastPort", mCboDevices->itemData( mCboDevices->currentIndex() ).toString() );
Expand Down Expand Up @@ -303,10 +307,6 @@ QgsGPSInformationWidget::~QgsGPSInformationWidget()
mySettings.setValue( "/gps/panMode", "none" );
}

if ( mpRubberBand )
{
delete mpRubberBand;
}
}

void QgsGPSInformationWidget::on_mSpinTrackWidth_valueChanged( int theValue )
Expand Down
2 changes: 2 additions & 0 deletions src/app/gps/qgsgpsinformationwidget.h
Expand Up @@ -25,6 +25,7 @@
#include <qwt_plot_curve.h>
#if (WITH_QWTPOLAR)
#include <qwt_polar_plot.h>
#include <qwt_polar_grid.h>
#include <qwt_polar_marker.h>
#endif

Expand Down Expand Up @@ -89,6 +90,7 @@ class QgsGPSInformationWidget: public QWidget, private Ui::QgsGPSInformationWidg
QwtPlotCurve * mpCurve;
#if (WITH_QWTPOLAR)
QwtPolarPlot * mpSatellitesWidget;
QwtPolarGrid *mpSatellitesGrid;
QList< QwtPolarMarker * > mMarkerList;
#endif
void createRubberBand();
Expand Down
28 changes: 18 additions & 10 deletions src/app/qgsbookmarks.cpp
Expand Up @@ -265,7 +265,10 @@ void QgsBookmarks::zoomToBookmark()

void QgsBookmarks::importFromXML()
{
QString fileName = QFileDialog::getOpenFileName( this, tr( "Import Bookmarks" ), ".",
QSettings settings;

QString lastUsedDir = settings.value( "/Bookmark/LastUsedDirectory", QVariant() ).toString();
QString fileName = QFileDialog::getOpenFileName( this, tr( "Import Bookmarks" ), lastUsedDir,
tr( "XML files (*.xml *XML)" ) );
if ( fileName.isEmpty() )
{
Expand Down Expand Up @@ -296,21 +299,21 @@ void QgsBookmarks::importFromXML()
for ( int i = 0;i < nodeList.count(); i++ )
{
QDomNode bookmark = nodeList.at( i );
QDomElement name = bookmark.firstChildElement( "Name" );
QDomElement prjname = bookmark.firstChildElement( "Project" );
QDomElement xmin = bookmark.firstChildElement( "xMin" );
QDomElement xmax = bookmark.firstChildElement( "xMax" );
QDomElement ymin = bookmark.firstChildElement( "yMin" );
QDomElement ymax = bookmark.firstChildElement( "yMax" );
QDomElement srid = bookmark.firstChildElement( "SRID" );
QDomElement name = bookmark.firstChildElement( tr( "Name" ) );
QDomElement prjname = bookmark.firstChildElement( tr( "Project" ) );
QDomElement xmin = bookmark.firstChildElement( tr( "xMin" ) );
QDomElement xmax = bookmark.firstChildElement( tr( "xMax" ) );
QDomElement ymin = bookmark.firstChildElement( tr( "yMin" ) );
QDomElement ymax = bookmark.firstChildElement( tr( "yMax" ) );
QDomElement srid = bookmark.firstChildElement( tr( "SRID" ) );

queries += "INSERT INTO tbl_bookmarks(bookmark_id,name,project_name,xmin,ymin,xmax,ymax,projection_srid)"
" VALUES (NULL,"
"'" + name.text() + "',"
"'" + prjname.text() + "',"
+ xmin.text() + ","
+ xmax.text() + ","
+ ymin.text() + ","
+ xmax.text() + ","
+ ymax.text() + ","
+ srid.text() + ");";
}
Expand Down Expand Up @@ -338,7 +341,10 @@ void QgsBookmarks::importFromXML()

void QgsBookmarks::exportToXML()
{
QString fileName = QFileDialog::getSaveFileName( this, tr( "Export bookmarks" ), ".",
QSettings settings;

QString lastUsedDir = settings.value( "/Bookmark/LastUsedDirectory", QVariant() ).toString();
QString fileName = QFileDialog::getSaveFileName( this, tr( "Export bookmarks" ), lastUsedDir,
tr( "XML files( *.xml *.XML )" ) );
if ( fileName.isEmpty() )
{
Expand Down Expand Up @@ -388,4 +394,6 @@ void QgsBookmarks::exportToXML()
out.setCodec( "UTF - 8" );
doc.save( out, 2 );
f.close();

settings.setValue( "/Bookmark/LastUsedDirectory", QFileInfo( fileName ).path() );
}

0 comments on commit 0b874ce

Please sign in to comment.