Skip to content
Permalink
Browse files

Fix metadata qmd restore issues described here: #5379 (comment)

  • Loading branch information
timlinux authored and nyalldawson committed Jan 6, 2018
1 parent 3432bf8 commit c436b286cfced392dff4f0b7790220cc975cebc3
Showing with 10 additions and 10 deletions.
  1. +1 −1 src/app/qgisapp.cpp
  2. +4 −4 src/app/qgsrasterlayerproperties.cpp
  3. +5 −5 src/app/qgsvectorlayerproperties.cpp
@@ -12199,7 +12199,7 @@ QgsRasterLayer *QgisApp::addRasterLayerPrivate(
// Let render() do its own cursor management
// QApplication::restoreOverrideCursor();
}

layer->loadDefaultMetadata( ok );
return layer;

} // QgisApp::addRasterLayer
@@ -106,8 +106,8 @@ QgsRasterLayerProperties::QgsRasterLayerProperties( QgsMapLayer *lyr, QgsMapCanv

mBtnStyle = new QPushButton( tr( "Style" ) );
QMenu *menuStyle = new QMenu( this );
menuStyle->addAction( tr( "Load Style..." ), this, SLOT( loadStyle_clicked() ) );
menuStyle->addAction( tr( "Save Style..." ), this, SLOT( saveStyleAs_clicked() ) );
menuStyle->addAction( tr( "Load Style" ), this, SLOT( loadStyle_clicked() ) );
menuStyle->addAction( tr( "Save Style" ), this, SLOT( saveStyleAs_clicked() ) );
menuStyle->addSeparator();
menuStyle->addAction( tr( "Save as Default" ), this, SLOT( saveDefaultStyle_clicked() ) );
menuStyle->addAction( tr( "Restore Default" ), this, SLOT( loadDefaultStyle_clicked() ) );
@@ -117,8 +117,8 @@ QgsRasterLayerProperties::QgsRasterLayerProperties( QgsMapLayer *lyr, QgsMapCanv

mBtnMetadata = new QPushButton( tr( "Metadata" ), this );
QMenu *menuMetadata = new QMenu( this );
mActionLoadMetadata = menuMetadata->addAction( tr( "Load Metadata" ), this, SLOT( loadMetadata() ) );
mActionSaveMetadataAs = menuMetadata->addAction( tr( "Save Metadata" ), this, SLOT( saveMetadataAs() ) );
mActionLoadMetadata = menuMetadata->addAction( tr( "Load Metadata" ), this, SLOT( loadMetadata() ) );
mActionSaveMetadataAs = menuMetadata->addAction( tr( "Save Metadata" ), this, SLOT( saveMetadataAs() ) );
menuMetadata->addSeparator();
menuMetadata->addAction( tr( "Save as Default" ), this, SLOT( saveDefaultMetadata() ) );
menuMetadata->addAction( tr( "Restore Default" ), this, SLOT( loadDefaultMetadata() ) );
@@ -124,8 +124,8 @@ QgsVectorLayerProperties::QgsVectorLayerProperties(

mBtnMetadata = new QPushButton( tr( "Metadata" ), this );
QMenu *menuMetadata = new QMenu( this );
mActionLoadMetadata = menuMetadata->addAction( tr( "Load Metadata" ), this, SLOT( loadMetadata() ) );
mActionSaveMetadataAs = menuMetadata->addAction( tr( "Save Metadata" ), this, SLOT( saveMetadataAs() ) );
mActionLoadMetadata = menuMetadata->addAction( tr( "Load Metadata" ), this, SLOT( loadMetadata() ) );
mActionSaveMetadataAs = menuMetadata->addAction( tr( "Save Metadata" ), this, SLOT( saveMetadataAs() ) );
menuMetadata->addSeparator();
menuMetadata->addAction( tr( "Save as Default" ), this, SLOT( saveDefaultMetadata() ) );
menuMetadata->addAction( tr( "Restore Default" ), this, SLOT( loadDefaultMetadata() ) );
@@ -182,15 +182,15 @@ QgsVectorLayerProperties::QgsVectorLayerProperties(

// Create the menu for the save style button to choose the output format
mSaveAsMenu = new QMenu( this );
mSaveAsMenu->addAction( tr( "QGIS Layer Style File..." ) );
mSaveAsMenu->addAction( tr( "SLD File..." ) );
mSaveAsMenu->addAction( tr( "QGIS Layer Style File" ) );
mSaveAsMenu->addAction( tr( "SLD File" ) );

//Only if the provider support loading & saving styles to db add new choices
if ( mLayer->dataProvider()->isSaveAndLoadStyleToDatabaseSupported() )
{
//for loading
mLoadStyleMenu = new QMenu( this );
mLoadStyleMenu->addAction( tr( "Load from file..." ) );
mLoadStyleMenu->addAction( tr( "Load from file" ) );
mLoadStyleMenu->addAction( tr( "Database styles manager" ) );
//mActionLoadStyle->setContextMenuPolicy( Qt::PreventContextMenu );
mActionLoadStyle->setMenu( mLoadStyleMenu );

0 comments on commit c436b28

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