Skip to content
Permalink
Browse files

Merge pull request #4193 from nyalldawson/proj_widget_api

Rename projection selection widgets and clean up API
  • Loading branch information
nyalldawson committed Feb 27, 2017
2 parents 887ca6f + 5312965 commit 555d1048fbe551088005123fed3b07f73a477153
Showing with 394 additions and 499 deletions.
  1. +2 −0 doc/api_break.dox
  2. +2 −2 python/gui/gui.sip
  3. +0 −64 python/gui/qgsgenericprojectionselector.sip
  4. +39 −0 python/gui/qgsprojectionselectiondialog.sip
  5. +31 −0 python/gui/qgsprojectionselectiontreewidget.sip
  6. +1 −1 python/gui/qgsprojectionselectionwidget.sip
  7. +0 −111 python/gui/qgsprojectionselector.sip
  8. +4 −4 python/plugins/processing/gui/wrappers.py
  9. +5 −7 src/app/composer/qgscomposermapgridwidget.cpp
  10. +1 −1 src/app/dwg/qgsdwgimportdialog.cpp
  11. +1 −1 src/app/ogr/qgsvectorlayersaveasdialog.cpp
  12. +13 −13 src/app/qgisapp.cpp
  13. +3 −5 src/app/qgscustomprojectiondialog.cpp
  14. +1 −1 src/app/qgsdxfexportdialog.cpp
  15. +5 −5 src/app/qgsnewspatialitelayerdialog.cpp
  16. +1 −1 src/app/qgsoptions.cpp
  17. +22 −21 src/app/qgsprojectproperties.cpp
  18. +1 −1 src/app/qgsrasterlayerproperties.cpp
  19. +1 −1 src/app/qgsvectorlayerproperties.cpp
  20. +4 −4 src/gui/CMakeLists.txt
  21. +1 −1 src/gui/qgsnewgeopackagelayerdialog.cpp
  22. +5 −5 src/gui/qgsowssourceselect.cpp
  23. +15 −34 src/gui/{qgsgenericprojectionselector.cpp → qgsprojectionselectiondialog.cpp}
  24. +32 −17 src/gui/{qgsgenericprojectionselector.h → qgsprojectionselectiondialog.h}
  25. +46 −62 src/gui/{qgsprojectionselector.cpp → qgsprojectionselectiontreewidget.cpp}
  26. +95 −73 src/gui/{qgsprojectionselector.h → qgsprojectionselectiontreewidget.h}
  27. +5 −5 src/gui/qgsprojectionselectionwidget.cpp
  28. +3 −3 src/gui/qgsprojectionselectionwidget.h
  29. +1 −1 src/gui/qgsrasterlayersaveasdialog.cpp
  30. +5 −5 src/gui/qgssourceselectdialog.cpp
  31. +2 −2 src/gui/qgssourceselectdialog.h
  32. +4 −4 src/plugins/coordinate_capture/coordinatecapture.cpp
  33. +1 −1 src/plugins/georeferencer/qgstransformsettingsdialog.cpp
  34. +15 −16 src/plugins/grass/qgsgrassnewmapset.cpp
  35. +3 −3 src/plugins/grass/qgsgrassnewmapset.h
  36. +6 −6 src/providers/virtual/qgsvirtuallayersourceselect.cpp
  37. +5 −5 src/providers/wfs/qgswfssourceselect.cpp
  38. +2 −2 src/providers/wfs/qgswfssourceselect.h
  39. +5 −5 src/providers/wms/qgswmssourceselect.cpp
  40. +3 −3 src/ui/qgsgenericprojectionselectorbase.ui
  41. +3 −3 src/ui/qgsprojectpropertiesbase.ui
@@ -257,6 +257,7 @@ should now call QgsCoordinateReferenceSystem::invalidateCache() and QgsCoordinat
- QgsFormAnnotationItem. Use QgsFormAnnotation instead.
- QgsHtmlAnnotationItem. Use QgsHtmlAnnotation instead.
- QgsHttpTransaction. This class was outdated and code should be ported to native Qt or Python implementations.
- QgsGenericProjectionSelector. Use QgsProjectionSelectionTreeWidget instead.
- QgsLabel and QgsLabelAttributes. Replaced by labeling based on PAL library, see QgsLabelingEngine.
- QgsLabelingEngineInterface. Replaced by QgsLabelingEngine.
- QgsLegendInterface was removed. It was replaced by layer tree API (QgsLayerTreeNode class and others).
@@ -276,6 +277,7 @@ should now call QgsCoordinateReferenceSystem::invalidateCache() and QgsCoordinat
- QgsRendererV2DataDefinedMenus was removed. Use QgsPropertyOverrideButton instead.
- QgsSizeScaleWidget. Use QgsPropertyAssistantWidget instead.
- QgsLegacyHelpers.
- QgsProjectionSelector. Use QgsProjectionSelectionDialog instead.
- QgsProviderCountCalcEvent and QgsProviderExtentCalcEvent. These classes were unused in QGIS core and unmaintained.
- QgsWebviewWidgetWrapper was removed. Use QgsExternalResourceWidgetWrapper instead.
- QgsEditorWidgetConfig was removed. Use QVariantMap instead.
@@ -81,7 +81,6 @@
%Include qgsfloatingwidget.sip
%Include qgsfocuswatcher.sip
%Include qgsformannotation.sip
%Include qgsgenericprojectionselector.sip
%Include qgsgeometryrubberband.sip
%Include qgsgradientcolorrampdialog.sip
%Include qgsgradientstopeditor.sip
@@ -138,8 +137,9 @@
%Include qgspluginmanagerinterface.sip
%Include qgspresetcolorrampdialog.sip
%Include qgsprevieweffect.sip
%Include qgsprojectionselectiondialog.sip
%Include qgsprojectionselectiontreewidget.sip
%Include qgsprojectionselectionwidget.sip
%Include qgsprojectionselector.sip
%Include qgspropertyassistantwidget.sip
%Include qgspropertyoverridebutton.sip
%Include qgsquerybuilder.sip

This file was deleted.

@@ -0,0 +1,39 @@
class QgsProjectionSelectionDialog : QDialog //, private Ui::QgsGenericProjectionSelectorBase
{
%TypeHeaderCode
#include <qgsprojectionselectiondialog.h>
%End

public:
/**
* Constructor
*/
QgsProjectionSelectionDialog( QWidget *parent /TransferThis/ = 0,
const Qt::WindowFlags& fl = QgisGui::ModalDialogFlags );

//! Destructor
~QgsProjectionSelectionDialog();

QgsCoordinateReferenceSystem crs() const;

void setMessage( const QString& message );

public slots:


void setCrs( const QgsCoordinateReferenceSystem& crs );

/**
* \brief filters this dialog by the given CRSs
*
* Sets this dialog to filter the available projections to those listed
* by the given Coordinate Reference Systems.
*
* \param crsFilter a list of OGC Coordinate Reference Systems to filter the
* list of projections by. This is useful in (e.g.) WMS situations
* where you just want to offer what the WMS server can support.
*
* \warning This function's behavior is undefined if it is called after the dialog is shown.
*/
void setOgcWmsCrsFilter( const QSet<QString>& crsFilter );
};
@@ -0,0 +1,31 @@
class QgsProjectionSelectionTreeWidget : QWidget
{
%TypeHeaderCode
#include <qgsprojectionselectiontreewidget.h>
%End

public:
QgsProjectionSelectionTreeWidget( QWidget* parent /TransferThis/ );

~QgsProjectionSelectionTreeWidget();

QgsCoordinateReferenceSystem crs() const;

public slots:

void setCrs( const QgsCoordinateReferenceSystem& crs );
void setOgcWmsCrsFilter( const QSet<QString>& crsFilter );
void pushProjectionToFront();

signals:

void crsSelected();
void initialized();
void projectionDoubleClicked();

protected:
void showEvent( QShowEvent * event );

void resizeEvent( QResizeEvent * event );
};

@@ -30,7 +30,7 @@ class QgsProjectionSelectionWidget : QWidget
* Can be used to modify how the projection selector dialog behaves.
* @returns projection selector dialog
*/
QgsGenericProjectionSelector* dialog();
QgsProjectionSelectionDialog* dialog();

/** Returns the currently selected CRS for the widget
* @returns current CRS

This file was deleted.

@@ -56,7 +56,7 @@
QgsFieldComboBox,
QgsFieldExpressionWidget,
QgsFieldProxyModel,
QgsGenericProjectionSelector,
QgsProjectionSelectionDialog,
QgsMapLayerComboBox,
QgsProjectionSelectionWidget,
)
@@ -311,13 +311,13 @@ def createWidget(self):
return widget

def selectProjection(self):
dialog = QgsGenericProjectionSelector(self.widget)
dialog = QgsProjectionSelectionDialog(self.widget)
current_crs = QgsCoordinateReferenceSystem(self.combo.currentText())
if current_crs.isValid():
dialog.setSelectedCrsId(current_crs.srsid())
dialog.setCrs(current_crs)

if dialog.exec_():
self.setValue(dialog.selectedAuthId())
self.setValue(dialog.crs().authid())

def setValue(self, value):
if self.dialogType == DIALOG_MODELER:
@@ -22,7 +22,7 @@
#include "qgsproject.h"
#include "qgssymbollayerutils.h"
#include "qgsstyle.h"
#include "qgsgenericprojectionselector.h"
#include "qgsprojectionselectiondialog.h"
#include "qgscomposition.h"
#include "qgsmapsettings.h"
#include "qgsexpressionbuilderdialog.h"
@@ -1033,18 +1033,16 @@ void QgsComposerMapGridWidget::on_mMapGridCRSButton_clicked()
return;
}

QgsGenericProjectionSelector crsDialog( this );
QgsProjectionSelectionDialog crsDialog( this );
QgsCoordinateReferenceSystem crs = mComposerMapGrid->crs();
QString currentAuthId = crs.isValid() ? crs.authid() : mComposerMap->crs().authid();
crsDialog.setSelectedAuthId( currentAuthId );
crsDialog.setCrs( crs.isValid() ? crs : mComposerMap->crs() );

if ( crsDialog.exec() == QDialog::Accepted )
{
mComposerMap->beginCommand( tr( "Grid CRS changed" ) );
QString selectedAuthId = crsDialog.selectedAuthId();
mComposerMapGrid->setCrs( QgsCoordinateReferenceSystem( selectedAuthId ) );
mComposerMapGrid->setCrs( crsDialog.crs() );
mComposerMap->updateBoundingRect();
mMapGridCRSButton->setText( selectedAuthId );
mMapGridCRSButton->setText( crsDialog.crs().authid() );
mComposerMap->endCommand();
}
}
@@ -38,7 +38,7 @@
#include "qgslinesymbollayer.h"
#include "qgspallabeling.h"
#include "qgsmapcanvas.h"
#include "qgsgenericprojectionselector.h"
#include "qgsprojectionselectiondialog.h"
#include "qgsmessagelog.h"
#include "qgslogger.h"
#include "qgsproperty.h"
@@ -17,7 +17,7 @@
***************************************************************************/
#include "qgslogger.h"
#include "qgsvectorlayersaveasdialog.h"
#include "qgsgenericprojectionselector.h"
#include "qgsprojectionselectiondialog.h"
#include "qgsvectordataprovider.h"
#include "qgscoordinatereferencesystem.h"
#include "qgseditorwidgetfactory.h"

0 comments on commit 555d104

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