Skip to content

Commit

Permalink
Remove web view widget in favor of attachment (external resource) (#4074
Browse files Browse the repository at this point in the history
)

* remove photo widget config
* remove webview widget
* Remove mention of duplicate widgets
* Update api break
* migrate web view widgets to attachments
  • Loading branch information
3nids committed Feb 1, 2017
1 parent f720106 commit b340f04
Show file tree
Hide file tree
Showing 15 changed files with 13 additions and 772 deletions.
4 changes: 4 additions & 0 deletions doc/api_break.dox
Expand Up @@ -249,6 +249,7 @@ Use QgsComposerAttributeTableV2 instead.
- QgsCRSCache was removed. QgsCoordinateReferenceSystem now internally uses a cache for CRS creation,
so there is no longer a need for the separate cache class. Code which previously called QgsCRSCache::updateCRSCache()
should now call QgsCoordinateReferenceSystem::invalidateCache() and QgsCoordinateTransformCache::instance()->invalidateCrs( authid ).
- QgsFileNameWidgetWrapper was removed. Use QgsExternalResourceWidgetWrapper instead.
- QgsFormAnnotationItem. Use QgsFormAnnotation instead.
- QgsHtmlAnnotationItem. Use QgsHtmlAnnotation instead.
- QgsHttpTransaction. This class was outdated and code should be ported to native Qt or Python implementations.
Expand All @@ -264,11 +265,13 @@ should now call QgsCoordinateReferenceSystem::invalidateCache() and QgsCoordinat
- QgsMapCanvasMap. It is an internal class used by map canvas.
- QgsMapLayerRegistry. Its functionality has been moved to QgsProject.
- QgsMapRenderer. It has been replaced by QgsMapRendererJob with subclasses and QgsMapSettings.
- QgsPhotoWidgetWrapper was removed. Use QgsExternalResourceWidgetWrapper instead.
- QgsPseudoColorShader. This shader has been broken for some time and was replaced by QgsSingleBandPseudoColorRenderer.
- QgsProjectBadLayerGuiHandler was removed. It was unused in QGIS code and barely useful. Implement your own QgsProjectBadLayerHandler subclass if needed.
- QgsRendererV2DataDefinedMenus was removed. Use QgsDataDefinedButton instead.
- QgsLegacyHelpers.
- QgsProviderCountCalcEvent and QgsProviderExtentCalcEvent. These classes were unused in QGIS core and unmaintained.
- QgsWebviewWidgetWrapper was removed. Use QgsExternalResourceWidgetWrapper instead.
- QgsEditorWidgetConfig was removed. Use QVariantMap instead.
- QgsSvgAnnotationItem. Use QgsSvgAnnotation instead.
- QgsSymbologyV2Conversion was removed. Reading of renderers from pre-1.0 versions is not supported anymore.
Expand Down Expand Up @@ -850,6 +853,7 @@ QgsDiagramInterpolationSettings {#qgis_api_break_3_0_QgsDiagramInterpolat

QgsDiagramRenderer {#qgis_api_break_3_0_QgsDiagramRenderer}
------------------

- xform, fields were no longer required and are removed.
- referencedFields() no longer takes a QgsFields argument.
- renderDiagram() now takes an optional data defined overrides collection argument.
Expand Down
9 changes: 9 additions & 0 deletions src/core/qgsprojectfiletransform.cpp
Expand Up @@ -716,6 +716,15 @@ void QgsProjectFileTransform::transform2990()
else if ( ewv2Type == QStringLiteral( "FileName" ) )
{
editWidgetElement.setAttribute( "type", QStringLiteral( "ExternalResource" ) );

editWidgetConfiguration.insert( QStringLiteral( "RelativeStorage" ), 1 );
}
else if ( ewv2Type == QStringLiteral( "WebView" ) )
{
editWidgetElement.setAttribute( "type", QStringLiteral( "ExternalResource" ) );

editWidgetConfiguration.insert( QStringLiteral( "DocumentViewerHeight" ), editWidgetConfiguration.value( QStringLiteral( "Height" ) ) );
editWidgetConfiguration.insert( QStringLiteral( "DocumentViewerWidth" ), editWidgetConfiguration.value( QStringLiteral( "Width" ) ) );
editWidgetConfiguration.insert( QStringLiteral( "RelativeStorage" ), 1 );
}

Expand Down
24 changes: 0 additions & 24 deletions src/gui/CMakeLists.txt
Expand Up @@ -315,15 +315,6 @@ SET(QGIS_GUI_SRCS
qgsfiledownloader.cpp
)

IF (WITH_QTWEBKIT)
SET(QGIS_GUI_SRCS
${QGIS_GUI_SRCS}
editorwidgets/qgswebviewconfigdlg.cpp
editorwidgets/qgswebviewwidgetfactory.cpp
editorwidgets/qgswebviewwidgetwrapper.cpp
)
ENDIF (WITH_QTWEBKIT)


IF (WITH_TOUCH)
SET(QGIS_GUI_SRCS
Expand Down Expand Up @@ -614,14 +605,6 @@ SET(QGIS_GUI_MOC_HDRS
layertree/qgslayertreeviewdefaultactions.h
)

IF (WITH_QTWEBKIT)
SET(QGIS_GUI_MOC_HDRS
${QGIS_GUI_MOC_HDRS}
editorwidgets/qgswebviewconfigdlg.h
editorwidgets/qgswebviewwidgetwrapper.h
)
ENDIF (WITH_QTWEBKIT)

QT5_WRAP_CPP(QGIS_GUI_MOC_SRCS ${QGIS_GUI_MOC_HDRS})

IF(MSVC)
Expand Down Expand Up @@ -710,13 +693,6 @@ SET(QGIS_GUI_HDRS
symbology-ng/qgssymbolwidgetcontext.h
)

IF (WITH_QTWEBKIT)
SET(QGIS_GUI_HDRS
${QGIS_GUI_HDRS}
editorwidgets/qgswebviewwidgetfactory.h
)
ENDIF (WITH_QTWEBKIT)

IF (WITH_TOUCH)
SET(QGIS_GUI_HDRS
${QGIS_GUI_HDRS}
Expand Down
7 changes: 0 additions & 7 deletions src/gui/editorwidgets/core/qgseditorwidgetregistry.cpp
Expand Up @@ -39,9 +39,6 @@
#include "qgsuuidwidgetfactory.h"
#include "qgsvaluemapwidgetfactory.h"
#include "qgsvaluerelationwidgetfactory.h"
#ifdef WITH_QTWEBKIT
#include "qgswebviewwidgetfactory.h"
#endif


QgsEditorWidgetRegistry* QgsEditorWidgetRegistry::instance()
Expand All @@ -63,9 +60,6 @@ void QgsEditorWidgetRegistry::initEditors( QgsMapCanvas *mapCanvas, QgsMessageBa
reg->registerWidget( QStringLiteral( "CheckBox" ), new QgsCheckboxWidgetFactory( tr( "Check Box" ) ) );
reg->registerWidget( QStringLiteral( "ValueRelation" ), new QgsValueRelationWidgetFactory( tr( "Value Relation" ) ) );
reg->registerWidget( QStringLiteral( "UuidGenerator" ), new QgsUuidWidgetFactory( tr( "Uuid Generator" ) ) );
#ifdef WITH_QTWEBKIT
reg->registerWidget( QStringLiteral( "WebView" ), new QgsWebViewWidgetFactory( tr( "Web View" ) ) );
#endif
reg->registerWidget( QStringLiteral( "Color" ), new QgsColorWidgetFactory( tr( "Color" ) ) );
reg->registerWidget( QStringLiteral( "RelationReference" ), new QgsRelationReferenceFactory( tr( "Relation Reference" ), mapCanvas, messageBar ) );
reg->registerWidget( QStringLiteral( "DateTime" ), new QgsDateTimeEditFactory( tr( "Date/Time" ) ) );
Expand Down Expand Up @@ -94,7 +88,6 @@ QgsEditorWidgetSetup QgsEditorWidgetRegistry::findBest( const QgsVectorLayer* vl
if ( !setup.isNull() )
return setup;
}

return mAutoConf.editorWidgetSetup( vl, fieldName );
}

Expand Down
40 changes: 0 additions & 40 deletions src/gui/editorwidgets/qgsphotoconfigdlg.cpp

This file was deleted.

42 changes: 0 additions & 42 deletions src/gui/editorwidgets/qgsphotoconfigdlg.h

This file was deleted.

40 changes: 0 additions & 40 deletions src/gui/editorwidgets/qgswebviewconfigdlg.cpp

This file was deleted.

42 changes: 0 additions & 42 deletions src/gui/editorwidgets/qgswebviewconfigdlg.h

This file was deleted.

35 changes: 0 additions & 35 deletions src/gui/editorwidgets/qgswebviewwidgetfactory.cpp

This file was deleted.

35 changes: 0 additions & 35 deletions src/gui/editorwidgets/qgswebviewwidgetfactory.h

This file was deleted.

0 comments on commit b340f04

Please sign in to comment.