Skip to content
Permalink
Browse files

[FEATURE] Add style/history tab to style dock

  • Loading branch information
NathanW2 committed May 10, 2016
1 parent 948c1f0 commit ca914f118e070edda47af6a231c1d496e795ac43
Showing with 4,025 additions and 3,744 deletions.
  1. +18 −0 python/core/qgsmaplayer.sip
  2. +15 −0 python/core/qgsvectorlayer.sip
  3. +6 −1 python/core/raster/qgsrasterlayer.sip
  4. +19 −0 python/gui/symbology-ng/qgsrendererv2propertiesdialog.sip
  5. +6 −0 python/gui/symbology-ng/qgsrendererv2widget.sip
  6. +9 −6 src/app/qgisapp.cpp
  7. +1 −0 src/app/qgisapp.h
  8. +118 −31 src/app/qgsmapstylingwidget.cpp
  9. +26 −1 src/app/qgsmapstylingwidget.h
  10. +6 −7 src/app/qgsundowidget.cpp
  11. +3 −3 src/app/qgsundowidget.h
  12. +5 −0 src/core/qgsmaplayer.cpp
  13. +20 −0 src/core/qgsmaplayer.h
  14. +126 −119 src/core/qgsvectorlayer.cpp
  15. +15 −0 src/core/qgsvectorlayer.h
  16. +1 −0 src/core/raster/qgscolorrampshader.cpp
  17. +1 −1 src/core/raster/qgscolorrampshader.h
  18. +11 −0 src/core/raster/qgsrasterlayer.cpp
  19. +6 −0 src/core/raster/qgsrasterlayer.h
  20. +24 −21 src/core/symbology-ng/qgscategorizedsymbolrendererv2.cpp
  21. +1 −0 src/gui/symbology-ng/qgs25drendererwidget.cpp
  22. +10 −0 src/gui/symbology-ng/qgscategorizedsymbolrendererv2widget.cpp
  23. +6 −0 src/gui/symbology-ng/qgsgraduatedsymbolrendererv2widget.cpp
  24. +7 −0 src/gui/symbology-ng/qgsheatmaprendererwidget.cpp
  25. +43 −0 src/gui/symbology-ng/qgsrendererv2propertiesdialog.cpp
  26. +18 −1 src/gui/symbology-ng/qgsrendererv2propertiesdialog.h
  27. +6 −0 src/gui/symbology-ng/qgsrendererv2widget.h
  28. +3 −0 src/gui/symbology-ng/qgsrulebasedrendererv2widget.cpp
  29. +1 −0 src/gui/symbology-ng/qgssinglesymbolrendererv2widget.cpp
  30. +2 −2 src/gui/symbology-ng/qgssymbolv2selectordialog.cpp
  31. +54 −10 src/ui/qgscategorizedsymbolrendererv2widget.ui
  32. +107 −89 src/ui/qgsgraduatedsymbolrendererv2widget.ui
  33. +38 −28 src/ui/qgshistogramwidgetbase.ui
  34. +1 −1 src/ui/qgslabelingwidget.ui
  35. +51 −54 src/ui/qgsrendererv2propsdialogbase.ui
  36. +135 −122 src/ui/qgssymbolv2selectordialogbase.ui
  37. +44 −242 src/ui/qgsvectorlayerpropertiesbase.ui
  38. +1 −1 src/ui/symbollayer/qgsdashspacedialogbase.ui
  39. +7 −10 src/ui/symbollayer/qgsgeometrygeneratorwidgetbase.ui
  40. +6 −9 src/ui/symbollayer/qgsheatmaprendererwidgetbase.ui
  41. +6 −16 src/ui/symbollayer/widget_centroidfill.ui
  42. +464 −447 src/ui/symbollayer/widget_ellipse.ui
  43. +383 −373 src/ui/symbollayer/widget_fontmarker.ui
  44. +396 −379 src/ui/symbollayer/widget_gradientfill.ui
  45. +6 −6 src/ui/symbollayer/widget_linepatternfill.ui
  46. +6 −6 src/ui/symbollayer/widget_markerline.ui
  47. +2 −11 src/ui/symbollayer/widget_pointpatternfill.ui
  48. +240 −254 src/ui/symbollayer/widget_rasterfill.ui
  49. +207 −195 src/ui/symbollayer/widget_shapeburstfill.ui
  50. +130 −140 src/ui/symbollayer/widget_simplefill.ui
  51. +305 −287 src/ui/symbollayer/widget_simplemarker.ui
  52. +235 −244 src/ui/symbollayer/widget_svgfill.ui
  53. +433 −392 src/ui/symbollayer/widget_svgmarker.ui
  54. +235 −235 src/ui/symbollayer/widget_symbolslist.ui
@@ -458,6 +458,13 @@ class QgsMapLayer : QObject
*/
virtual bool readSymbology( const QDomNode& node, QString& errorMessage ) = 0;

/** Read the style for the current layer from the Dom node supplied.
* @param node node that will contain the style definition for this layer.
* @param errorMessage reference to string that will be updated with any error messages
* @return true in case of success.
*/
virtual bool readStyle( const QDomNode& node, QString& errorMessage ) = 0;

/** Write the symbology for the layer into the docment provided.
* @param node the node that will have the style element added to it.
* @param doc the document that will have the QDomNode added.
@@ -466,9 +473,20 @@ class QgsMapLayer : QObject
*/
virtual bool writeSymbology( QDomNode &node, QDomDocument& doc, QString& errorMessage ) const = 0;

/** Write just the style information for the layer into the document
* @param node the node that will have the style element added to it.
* @param doc the document that will have the QDomNode added.
* @param errorMessage reference to string that will be updated with any error messages
* @return true in case of success.
*/
virtual bool writeStyle( QDomNode& node, QDomDocument& doc, QString& errorMessage ) const = 0;

/** Return pointer to layer's undo stack */
QUndoStack *undoStack();

/** Return pointer to layer's style undo stack */
QUndoStack *undoStackStyles();

/* Layer legendUrl information */
void setLegendUrl( const QString& legendUrl );
QString legendUrl() const;
@@ -493,6 +493,13 @@ class QgsVectorLayer : QgsMapLayer
*/
bool readSymbology( const QDomNode& node, QString& errorMessage );

/** Read the style for the current layer from the Dom node supplied.
* @param node node that will contain the style definition for this layer.
* @param errorMessage reference to string that will be updated with any error messages
* @return true in case of success.
*/
bool readStyle( const QDomNode& node, QString& errorMessage );

/** Write the symbology for the layer into the docment provided.
* @param node the node that will have the style element added to it.
* @param doc the document that will have the QDomNode added.
@@ -501,6 +508,14 @@ class QgsVectorLayer : QgsMapLayer
*/
bool writeSymbology( QDomNode& node, QDomDocument& doc, QString& errorMessage ) const;

/** Write just the style information for the layer into the document
* @param node the node that will have the style element added to it.
* @param doc the document that will have the QDomNode added.
* @param errorMessage reference to string that will be updated with any error messages
* @return true in case of success.
*/
bool writeStyle( QDomNode& node, QDomDocument& doc, QString& errorMessage ) const;

bool writeSld( QDomNode& node, QDomDocument& doc, QString& errorMessage ) const;
bool readSld( const QDomNode& node, QString& errorMessage );

@@ -234,14 +234,19 @@ class QgsRasterLayer : QgsMapLayer
/** \brief Read the symbology for the current layer from the Dom node supplied */
bool readSymbology( const QDomNode& node, QString& errorMessage );

/** \brief Read the style information for the current layer from the Dom node supplied */
bool readStyle(const QDomNode &node, QString &errorMessage);

/** \brief Reads layer specific state from project file Dom node */
bool readXml( const QDomNode& layer_node );

/** \brief Write the symbology for the layer into the docment provided */
bool writeSymbology( QDomNode&, QDomDocument& doc, QString& errorMessage ) const;

/** \brief Write the style for the layer into the docment provided */
bool writeStyle(QDomNode &node, QDomDocument &doc, QString &errorMessage) const;

/** \brief Write layer specific state to project file Dom node */
bool writeXml( QDomNode & layer_node, QDomDocument & doc );

};

@@ -23,14 +23,33 @@ class QgsRendererV2PropertiesDialog : QDialog
*/
void layerVariablesChanged();

/**
* Emmited when something on the widget has changed.
* All widgets will fire this event to notify of an internal change.
*/
void widgetChanged();

public slots:
//! called when user changes renderer type
void rendererChanged();

//! Apply the changes from the dialog to the layer.
void apply();

//! Apply and accept the changes for the dialog.
void onOK();

protected:
/**
* Connect the given slot to the value changed event for the set of widgets
* Each widget is checked for type and the common type of signal is connected
* to the slot.
*
* @param widgets The list of widgets to check.
* @param slot The slot to connect to the signals.
*/
void connectValueChanged( QList<QWidget *> widgets, const char *slot );


//! Reimplements dialog keyPress event so we can ignore it
void keyPressEvent( QKeyEvent * event );
@@ -47,6 +47,12 @@ class QgsRendererV2Widget : QWidget
*/
void layerVariablesChanged();

/**
* Emmited when something on the widget has changed.
* All widgets will fire this event to notify of an internal change.
*/
void widgetChanged();

protected:
/** Subclasses may provide the capability of changing multiple symbols at once by implementing the following two methods
and by connecting the slot contextMenuViewCategories(const QPoint&)*/
@@ -678,6 +678,9 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, bool skipVersionCh
mUndoWidget = new QgsUndoWidget( nullptr, mMapCanvas );
mUndoWidget->setObjectName( "Undo" );

mUndoDock = new QDockWidget( tr( "Undo/Redo Panel" ), nullptr );
mUndoDock->setWidget( mUndoWidget );

// Advanced Digitizing dock
mAdvancedDigitizingDockWidget = new QgsAdvancedDigitizingDockWidget( mMapCanvas, this );
mAdvancedDigitizingDockWidget->setObjectName( "AdvancedDigitizingTools" );
@@ -721,8 +724,8 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, bool skipVersionCh
// initialize the plugin manager
mPluginManager = new QgsPluginManager( this, restorePlugins );

addDockWidget( Qt::LeftDockWidgetArea, mUndoWidget );
mUndoWidget->hide();
addDockWidget( Qt::LeftDockWidgetArea, mUndoDock );
mUndoDock->hide();

mMapStylingDock = new QDockWidget( this );
mMapStylingDock->setWindowTitle( tr( "Map Styling" ) );
@@ -10001,7 +10004,7 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer* layer )
mActionCopyStyle->setEnabled( false );
mActionPasteStyle->setEnabled( false );

mUndoWidget->dockContents()->setEnabled( false );
mUndoDock->widget()->setEnabled( false );
mActionUndo->setEnabled( false );
mActionRedo->setEnabled( false );
mActionSimplifyFeature->setEnabled( false );
@@ -10103,7 +10106,7 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer* layer )
mActionToggleEditing->setEnabled( canSupportEditing && !vlayer->readOnly() );
mActionToggleEditing->setChecked( canSupportEditing && isEditable );
mActionSaveLayerEdits->setEnabled( canSupportEditing && isEditable && vlayer->isModified() );
mUndoWidget->dockContents()->setEnabled( canSupportEditing && isEditable );
mUndoDock->widget()->setEnabled( canSupportEditing && isEditable );
mActionUndo->setEnabled( canSupportEditing );
mActionRedo->setEnabled( canSupportEditing );

@@ -10209,7 +10212,7 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer* layer )
}
else
{
mUndoWidget->dockContents()->setEnabled( false );
mUndoDock->widget()->setEnabled( false );
mActionUndo->setEnabled( false );
mActionRedo->setEnabled( false );
}
@@ -10262,7 +10265,7 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer* layer )
mActionToggleEditing->setEnabled( false );
mActionToggleEditing->setChecked( false );
mActionSaveLayerEdits->setEnabled( false );
mUndoWidget->dockContents()->setEnabled( false );
mUndoDock->widget()->setEnabled( false );
mActionUndo->setEnabled( false );
mActionRedo->setEnabled( false );
mActionSaveLayerDefinition->setEnabled( true );
@@ -1687,6 +1687,7 @@ class APP_EXPORT QgisApp : public QMainWindow, private Ui::MainWindow
static QgisApp *smInstance;

QgsUndoWidget *mUndoWidget;
QDockWidget *mUndoDock;

QgsBrowserDockWidget *mBrowserWidget;
QgsBrowserDockWidget *mBrowserWidget2;

0 comments on commit ca914f1

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