mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-14 00:07:35 -04:00
Add project metadata mode to QgsMetadataWidget
This commit is contained in:
parent
b10be8a8a3
commit
f4ed93e1ca
@ -39,6 +39,14 @@ using QgsNativeMetadataValidator.
|
||||
|
||||
%TypeHeaderCode
|
||||
#include "qgsabstractmetadatabase.h"
|
||||
%End
|
||||
%ConvertToSubClassCode
|
||||
if ( dynamic_cast< QgsLayerMetadata * >( sipCpp ) != NULL )
|
||||
sipType = sipType_QgsLayerMetadata;
|
||||
else if ( dynamic_cast< QgsLayerMetadata * >( sipCpp ) != NULL )
|
||||
sipType = sipType_QgsProjectMetadata;
|
||||
else
|
||||
sipType = NULL;
|
||||
%End
|
||||
public:
|
||||
|
||||
@ -127,6 +135,13 @@ Constructor for Link.
|
||||
|
||||
virtual ~QgsAbstractMetadataBase();
|
||||
|
||||
virtual QgsAbstractMetadataBase *clone() const = 0 /Factory/;
|
||||
%Docstring
|
||||
Clones the metadata object.
|
||||
|
||||
.. versionadded:: 3.2
|
||||
%End
|
||||
|
||||
QString identifier() const;
|
||||
%Docstring
|
||||
A reference, URI, URL or some other mechanism to identify the resource.
|
||||
|
@ -115,6 +115,9 @@ Constructor for Constraint.
|
||||
Constructor for QgsLayerMetadata.
|
||||
%End
|
||||
|
||||
virtual QgsLayerMetadata *clone() const /Factory/;
|
||||
|
||||
|
||||
QString fees() const;
|
||||
%Docstring
|
||||
Returns any fees associated with using the resource.
|
||||
|
@ -46,6 +46,9 @@ using QgsNativeProjectMetadataValidator.
|
||||
Constructor for QgsProjectMetadata.
|
||||
%End
|
||||
|
||||
virtual QgsProjectMetadata *clone() const /Factory/;
|
||||
|
||||
|
||||
QString author() const;
|
||||
%Docstring
|
||||
Returns the project author string.
|
||||
|
@ -10,7 +10,7 @@
|
||||
|
||||
|
||||
|
||||
class QgsAbstractMetadataBaseWidget : QWidget
|
||||
class QgsMetadataWidget : QWidget
|
||||
{
|
||||
%Docstring
|
||||
A wizard to edit metadata on a map layer.
|
||||
@ -23,7 +23,13 @@ class QgsAbstractMetadataBaseWidget : QWidget
|
||||
%End
|
||||
public:
|
||||
|
||||
QgsAbstractMetadataBaseWidget( QWidget *parent, QgsMapLayer *layer = 0 );
|
||||
enum Mode
|
||||
{
|
||||
LayerMetadata,
|
||||
ProjectMetadata,
|
||||
};
|
||||
|
||||
QgsMetadataWidget( QWidget *parent /TransferThis/ = 0, QgsMapLayer *layer = 0 );
|
||||
%Docstring
|
||||
Constructor for the wizard.
|
||||
|
||||
@ -33,26 +39,49 @@ the layer's metadata..
|
||||
.. seealso:: :py:func:`setMetadata`
|
||||
%End
|
||||
|
||||
void setMetadata( const QgsLayerMetadata &metadata );
|
||||
void setMode( Mode mode );
|
||||
%Docstring
|
||||
Sets the widget's current ``mode``.
|
||||
|
||||
.. versionadded:: 3.2
|
||||
|
||||
.. seealso:: :py:func:`mode`
|
||||
%End
|
||||
|
||||
Mode mode() const;
|
||||
%Docstring
|
||||
Returns the widget's current mode.
|
||||
|
||||
.. versionadded:: 3.2
|
||||
|
||||
.. seealso:: :py:func:`setMode`
|
||||
%End
|
||||
|
||||
void setMetadata( const QgsAbstractMetadataBase *metadata );
|
||||
%Docstring
|
||||
Sets the ``metadata`` to display in the widget.
|
||||
|
||||
This method can be called after constructing a QgsAbstractMetadataBaseWidget in order
|
||||
to set the displayed metadata to custom, non-layer based metadata.
|
||||
|
||||
Calling this method will automatically setMode() to the correct mode corresponding
|
||||
to the specified ``metadata`` object.
|
||||
|
||||
.. seealso:: :py:func:`metadata`
|
||||
%End
|
||||
|
||||
QgsLayerMetadata metadata();
|
||||
QgsAbstractMetadataBase *metadata() /Factory/;
|
||||
%Docstring
|
||||
Returns a QgsLayerMetadata object representing the current state of the widget.
|
||||
Returns a QgsAbstractMetadataBase object representing the current state of the widget.
|
||||
|
||||
Caller takes ownership of the returned object.
|
||||
|
||||
.. seealso:: :py:func:`saveMetadata`
|
||||
%End
|
||||
|
||||
void saveMetadata( QgsLayerMetadata &layerMetadata );
|
||||
void saveMetadata( QgsAbstractMetadataBase *metadata );
|
||||
%Docstring
|
||||
Save all fields in a QgsLayerMetadata object.
|
||||
Save all fields in a metadata object.
|
||||
|
||||
.. seealso:: :py:func:`metadata`
|
||||
|
||||
|
@ -253,7 +253,7 @@ QgsRasterLayerProperties::QgsRasterLayerProperties( QgsMapLayer *lyr, QgsMapCanv
|
||||
|
||||
QVBoxLayout *layout = new QVBoxLayout( metadataFrame );
|
||||
layout->setMargin( 0 );
|
||||
mMetadataWidget = new QgsAbstractMetadataBaseWidget( this, mRasterLayer );
|
||||
mMetadataWidget = new QgsMetadataWidget( this, mRasterLayer );
|
||||
mMetadataWidget->layout()->setContentsMargins( -1, 0, -1, 0 );
|
||||
mMetadataWidget->setMapCanvas( mMapCanvas );
|
||||
layout->addWidget( mMetadataWidget );
|
||||
@ -1903,7 +1903,7 @@ void QgsRasterLayerProperties::loadMetadata()
|
||||
//reset if the default style was loaded OK only
|
||||
if ( defaultLoadedFlag )
|
||||
{
|
||||
mMetadataWidget->setMetadata( mRasterLayer->metadata() );
|
||||
mMetadataWidget->setMetadata( &mRasterLayer->metadata() );
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1965,7 +1965,7 @@ void QgsRasterLayerProperties::loadDefaultMetadata()
|
||||
//reset if the default metadata was loaded OK only
|
||||
if ( defaultLoadedFlag )
|
||||
{
|
||||
mMetadataWidget->setMetadata( mRasterLayer->metadata() );
|
||||
mMetadataWidget->setMetadata( &mRasterLayer->metadata() );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -33,7 +33,7 @@ class QgsPointXY;
|
||||
class QgsMapLayer;
|
||||
class QgsMapCanvas;
|
||||
class QgsRasterLayer;
|
||||
class QgsAbstractMetadataBaseWidget;
|
||||
class QgsMetadataWidget;
|
||||
class QgsRasterRenderer;
|
||||
class QgsRasterRendererWidget;
|
||||
class QgsRasterHistogramWidget;
|
||||
@ -181,7 +181,7 @@ class APP_EXPORT QgsRasterLayerProperties : public QgsOptionsDialogBase, private
|
||||
//bool mRasterLayerIsInternal;
|
||||
|
||||
QgsRasterRendererWidget *mRendererWidget = nullptr;
|
||||
QgsAbstractMetadataBaseWidget *mMetadataWidget = nullptr;
|
||||
QgsMetadataWidget *mMetadataWidget = nullptr;
|
||||
|
||||
bool rasterIsMultiBandColor();
|
||||
|
||||
|
@ -240,7 +240,7 @@ QgsVectorLayerProperties::QgsVectorLayerProperties(
|
||||
// Metadata tab, before the syncToLayer
|
||||
QVBoxLayout *metadataLayout = new QVBoxLayout( metadataFrame );
|
||||
metadataLayout->setMargin( 0 );
|
||||
mMetadataWidget = new QgsAbstractMetadataBaseWidget( this, mLayer );
|
||||
mMetadataWidget = new QgsMetadataWidget( this, mLayer );
|
||||
mMetadataWidget->layout()->setContentsMargins( -1, 0, -1, 0 );
|
||||
mMetadataWidget->setMapCanvas( QgisApp::instance()->mapCanvas() );
|
||||
metadataLayout->addWidget( mMetadataWidget );
|
||||
@ -560,7 +560,7 @@ void QgsVectorLayerProperties::syncToLayer()
|
||||
mVector3DWidget->setLayer( mLayer );
|
||||
#endif
|
||||
|
||||
mMetadataWidget->setMetadata( mLayer->metadata() );
|
||||
mMetadataWidget->setMetadata( &mLayer->metadata() );
|
||||
|
||||
} // syncToLayer()
|
||||
|
||||
@ -1017,7 +1017,7 @@ void QgsVectorLayerProperties::loadMetadata()
|
||||
//reset if the default style was loaded OK only
|
||||
if ( defaultLoadedFlag )
|
||||
{
|
||||
mMetadataWidget->setMetadata( mLayer->metadata() );
|
||||
mMetadataWidget->setMetadata( &mLayer->metadata() );
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1092,7 +1092,7 @@ void QgsVectorLayerProperties::loadDefaultMetadata()
|
||||
//reset if the default metadata was loaded OK only
|
||||
if ( defaultLoadedFlag )
|
||||
{
|
||||
mMetadataWidget->setMetadata( mLayer->metadata() );
|
||||
mMetadataWidget->setMetadata( &mLayer->metadata() );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -43,7 +43,7 @@ class QgsAttributesFormProperties;
|
||||
class QgsRendererPropertiesDialog;
|
||||
class QgsMapLayerConfigWidgetFactory;
|
||||
class QgsMapLayerConfigWidget;
|
||||
class QgsAbstractMetadataBaseWidget;
|
||||
class QgsMetadataWidget;
|
||||
class QgsPanelWidget;
|
||||
class QgsVectorLayer3DRendererWidget;
|
||||
|
||||
@ -244,7 +244,7 @@ class APP_EXPORT QgsVectorLayerProperties : public QgsOptionsDialogBase, private
|
||||
|
||||
void showHelp();
|
||||
|
||||
QgsAbstractMetadataBaseWidget *mMetadataWidget = nullptr;
|
||||
QgsMetadataWidget *mMetadataWidget = nullptr;
|
||||
|
||||
QAction *mAuxiliaryLayerActionNew = nullptr;
|
||||
QAction *mAuxiliaryLayerActionClear = nullptr;
|
||||
|
@ -52,6 +52,18 @@ class QDomDocument;
|
||||
*/
|
||||
class CORE_EXPORT QgsAbstractMetadataBase
|
||||
{
|
||||
|
||||
#ifdef SIP_RUN
|
||||
SIP_CONVERT_TO_SUBCLASS_CODE
|
||||
if ( dynamic_cast< QgsLayerMetadata * >( sipCpp ) != NULL )
|
||||
sipType = sipType_QgsLayerMetadata;
|
||||
else if ( dynamic_cast< QgsLayerMetadata * >( sipCpp ) != NULL )
|
||||
sipType = sipType_QgsProjectMetadata;
|
||||
else
|
||||
sipType = NULL;
|
||||
SIP_END
|
||||
#endif
|
||||
|
||||
public:
|
||||
|
||||
// NOTE - these really belong in a separate namespace, but SIP says no, I want to make you waste more time
|
||||
@ -249,6 +261,12 @@ class CORE_EXPORT QgsAbstractMetadataBase
|
||||
|
||||
virtual ~QgsAbstractMetadataBase() = default;
|
||||
|
||||
/**
|
||||
* Clones the metadata object.
|
||||
* \since QGIS 3.2
|
||||
*/
|
||||
virtual QgsAbstractMetadataBase *clone() const = 0 SIP_FACTORY;
|
||||
|
||||
/**
|
||||
* A reference, URI, URL or some other mechanism to identify the resource.
|
||||
* \see setIdentifier()
|
||||
|
@ -18,6 +18,11 @@
|
||||
#include "qgslayermetadata.h"
|
||||
#include "qgsmaplayer.h"
|
||||
|
||||
QgsLayerMetadata *QgsLayerMetadata::clone() const
|
||||
{
|
||||
return new QgsLayerMetadata( *this );
|
||||
}
|
||||
|
||||
QString QgsLayerMetadata::fees() const
|
||||
{
|
||||
return mFees;
|
||||
|
@ -169,6 +169,8 @@ class CORE_EXPORT QgsLayerMetadata : public QgsAbstractMetadataBase
|
||||
*/
|
||||
QgsLayerMetadata() = default;
|
||||
|
||||
QgsLayerMetadata *clone() const override SIP_FACTORY;
|
||||
|
||||
/**
|
||||
* Returns any fees associated with using the resource.
|
||||
* An empty string will be returned if no fees are set.
|
||||
|
@ -62,6 +62,11 @@ bool QgsProjectMetadata::operator==( const QgsProjectMetadata &metadataOther )
|
||||
mCreationDateTime == metadataOther.mCreationDateTime ;
|
||||
}
|
||||
|
||||
QgsProjectMetadata *QgsProjectMetadata::clone() const
|
||||
{
|
||||
return new QgsProjectMetadata( *this );
|
||||
}
|
||||
|
||||
QString QgsProjectMetadata::author() const
|
||||
{
|
||||
return mAuthor;
|
||||
|
@ -57,6 +57,8 @@ class CORE_EXPORT QgsProjectMetadata : public QgsAbstractMetadataBase
|
||||
*/
|
||||
QgsProjectMetadata() = default;
|
||||
|
||||
QgsProjectMetadata *clone() const override SIP_FACTORY;
|
||||
|
||||
/**
|
||||
* Returns the project author string.
|
||||
* \see setAuthor()
|
||||
|
@ -510,6 +510,7 @@ void QgsProject::clear()
|
||||
mTrustLayerMetadata = false;
|
||||
mCustomVariables.clear();
|
||||
mMetadata = QgsProjectMetadata();
|
||||
mMetadata.setCreationDateTime( QDateTime::currentDateTime() );
|
||||
emit metadataChanged();
|
||||
|
||||
QgsCoordinateTransformContext context;
|
||||
|
@ -29,16 +29,14 @@
|
||||
#include "qgslayermetadatavalidator.h"
|
||||
#include "qgsapplication.h"
|
||||
#include "qgsmapcanvas.h"
|
||||
#include "qgsprojectmetadata.h"
|
||||
#include "qgsproject.h"
|
||||
|
||||
QgsAbstractMetadataBaseWidget::QgsAbstractMetadataBaseWidget( QWidget *parent, QgsMapLayer *layer )
|
||||
QgsMetadataWidget::QgsMetadataWidget( QWidget *parent, QgsMapLayer *layer )
|
||||
: QWidget( parent ),
|
||||
mLayer( layer )
|
||||
{
|
||||
setupUi( this );
|
||||
if ( mLayer )
|
||||
{
|
||||
mMetadata = mLayer->metadata();
|
||||
}
|
||||
tabWidget->setCurrentIndex( 0 );
|
||||
|
||||
// Disable the encoding
|
||||
@ -87,27 +85,27 @@ QgsAbstractMetadataBaseWidget::QgsAbstractMetadataBaseWidget( QWidget *parent, Q
|
||||
listHistory->setModel( mHistoryModel );
|
||||
|
||||
// Connect signals and slots
|
||||
connect( tabWidget, &QTabWidget::currentChanged, this, &QgsAbstractMetadataBaseWidget::updatePanel );
|
||||
connect( btnAutoSource, &QPushButton::clicked, this, &QgsAbstractMetadataBaseWidget::fillSourceFromLayer );
|
||||
connect( btnAddVocabulary, &QPushButton::clicked, this, &QgsAbstractMetadataBaseWidget::addVocabulary );
|
||||
connect( btnRemoveVocabulary, &QPushButton::clicked, this, &QgsAbstractMetadataBaseWidget::removeSelectedVocabulary );
|
||||
connect( btnAddRight, &QPushButton::clicked, this, &QgsAbstractMetadataBaseWidget::addRight );
|
||||
connect( btnRemoveRight, &QPushButton::clicked, this, &QgsAbstractMetadataBaseWidget::removeSelectedRight );
|
||||
connect( btnAddLicence, &QPushButton::clicked, this, &QgsAbstractMetadataBaseWidget::addLicence );
|
||||
connect( btnRemoveLicence, &QPushButton::clicked, this, &QgsAbstractMetadataBaseWidget::removeSelectedLicence );
|
||||
connect( btnAddConstraint, &QPushButton::clicked, this, &QgsAbstractMetadataBaseWidget::addConstraint );
|
||||
connect( btnRemoveConstraint, &QPushButton::clicked, this, &QgsAbstractMetadataBaseWidget::removeSelectedConstraint );
|
||||
connect( btnSetCrsFromLayer, &QPushButton::clicked, this, &QgsAbstractMetadataBaseWidget::fillCrsFromLayer );
|
||||
connect( btnSetCrsFromProvider, &QPushButton::clicked, this, &QgsAbstractMetadataBaseWidget::fillCrsFromProvider );
|
||||
connect( btnAddAddress, &QPushButton::clicked, this, &QgsAbstractMetadataBaseWidget::addAddress );
|
||||
connect( btnRemoveAddress, &QPushButton::clicked, this, &QgsAbstractMetadataBaseWidget::removeSelectedAddress );
|
||||
connect( btnAddLink, &QPushButton::clicked, this, &QgsAbstractMetadataBaseWidget::addLink );
|
||||
connect( btnRemoveLink, &QPushButton::clicked, this, &QgsAbstractMetadataBaseWidget::removeSelectedLink );
|
||||
connect( btnAddHistory, &QPushButton::clicked, this, &QgsAbstractMetadataBaseWidget::addHistory );
|
||||
connect( btnRemoveHistory, &QPushButton::clicked, this, &QgsAbstractMetadataBaseWidget::removeSelectedHistory );
|
||||
connect( btnNewCategory, &QPushButton::clicked, this, &QgsAbstractMetadataBaseWidget::addNewCategory );
|
||||
connect( btnAddDefaultCategory, &QPushButton::clicked, this, &QgsAbstractMetadataBaseWidget::addDefaultCategories );
|
||||
connect( btnRemoveCategory, &QPushButton::clicked, this, &QgsAbstractMetadataBaseWidget::removeSelectedCategories );
|
||||
connect( tabWidget, &QTabWidget::currentChanged, this, &QgsMetadataWidget::updatePanel );
|
||||
connect( btnAutoSource, &QPushButton::clicked, this, &QgsMetadataWidget::fillSourceFromLayer );
|
||||
connect( btnAddVocabulary, &QPushButton::clicked, this, &QgsMetadataWidget::addVocabulary );
|
||||
connect( btnRemoveVocabulary, &QPushButton::clicked, this, &QgsMetadataWidget::removeSelectedVocabulary );
|
||||
connect( btnAddRight, &QPushButton::clicked, this, &QgsMetadataWidget::addRight );
|
||||
connect( btnRemoveRight, &QPushButton::clicked, this, &QgsMetadataWidget::removeSelectedRight );
|
||||
connect( btnAddLicence, &QPushButton::clicked, this, &QgsMetadataWidget::addLicence );
|
||||
connect( btnRemoveLicence, &QPushButton::clicked, this, &QgsMetadataWidget::removeSelectedLicence );
|
||||
connect( btnAddConstraint, &QPushButton::clicked, this, &QgsMetadataWidget::addConstraint );
|
||||
connect( btnRemoveConstraint, &QPushButton::clicked, this, &QgsMetadataWidget::removeSelectedConstraint );
|
||||
connect( btnSetCrsFromLayer, &QPushButton::clicked, this, &QgsMetadataWidget::fillCrsFromLayer );
|
||||
connect( btnSetCrsFromProvider, &QPushButton::clicked, this, &QgsMetadataWidget::fillCrsFromProvider );
|
||||
connect( btnAddAddress, &QPushButton::clicked, this, &QgsMetadataWidget::addAddress );
|
||||
connect( btnRemoveAddress, &QPushButton::clicked, this, &QgsMetadataWidget::removeSelectedAddress );
|
||||
connect( btnAddLink, &QPushButton::clicked, this, &QgsMetadataWidget::addLink );
|
||||
connect( btnRemoveLink, &QPushButton::clicked, this, &QgsMetadataWidget::removeSelectedLink );
|
||||
connect( btnAddHistory, &QPushButton::clicked, this, &QgsMetadataWidget::addHistory );
|
||||
connect( btnRemoveHistory, &QPushButton::clicked, this, &QgsMetadataWidget::removeSelectedHistory );
|
||||
connect( btnNewCategory, &QPushButton::clicked, this, &QgsMetadataWidget::addNewCategory );
|
||||
connect( btnAddDefaultCategory, &QPushButton::clicked, this, &QgsMetadataWidget::addDefaultCategories );
|
||||
connect( btnRemoveCategory, &QPushButton::clicked, this, &QgsMetadataWidget::removeSelectedCategories );
|
||||
|
||||
fillComboBox();
|
||||
if ( !mLayer )
|
||||
@ -116,31 +114,99 @@ QgsAbstractMetadataBaseWidget::QgsAbstractMetadataBaseWidget( QWidget *parent, Q
|
||||
btnAutoEncoding->setEnabled( false );
|
||||
btnSetCrsFromLayer->setEnabled( false );
|
||||
}
|
||||
setMetadata( mMetadata );
|
||||
}
|
||||
|
||||
void QgsAbstractMetadataBaseWidget::setMetadata( const QgsLayerMetadata &layerMetadata )
|
||||
{
|
||||
mMetadata = layerMetadata;
|
||||
setPropertiesFromLayer();
|
||||
}
|
||||
|
||||
QgsLayerMetadata QgsAbstractMetadataBaseWidget::metadata()
|
||||
{
|
||||
QgsLayerMetadata md;
|
||||
saveMetadata( md );
|
||||
return md;
|
||||
}
|
||||
|
||||
void QgsAbstractMetadataBaseWidget::fillSourceFromLayer()
|
||||
{
|
||||
if ( mLayer )
|
||||
{
|
||||
lineEditIdentifier->setText( mLayer->publicSource() );
|
||||
mMetadata.reset( mLayer->metadata().clone() );
|
||||
setUiFromMetadata();
|
||||
}
|
||||
}
|
||||
|
||||
void QgsAbstractMetadataBaseWidget::addVocabulary()
|
||||
void QgsMetadataWidget::setMode( QgsMetadataWidget::Mode mode )
|
||||
{
|
||||
QString type;
|
||||
QString typeUpper;
|
||||
mMode = mode;
|
||||
switch ( mMode )
|
||||
{
|
||||
case LayerMetadata:
|
||||
type = tr( "dataset" );
|
||||
typeUpper = tr( "Dataset" );
|
||||
mEncodingFrame->show();
|
||||
mAuthorFrame->hide();
|
||||
btnAutoSource->setEnabled( mLayer );
|
||||
break;
|
||||
|
||||
case ProjectMetadata:
|
||||
type = tr( "project" );
|
||||
typeUpper = tr( "Project" );
|
||||
mEncodingFrame->hide();
|
||||
mAuthorFrame->show();
|
||||
tabWidget->removeTab( 4 );
|
||||
tabWidget->removeTab( 3 );
|
||||
btnAutoSource->setEnabled( true );
|
||||
break;
|
||||
}
|
||||
|
||||
mIdLabel->setText( tr( "This page describes the basic attribution of the %1. Please use the tooltips for more information." ).arg( type ) );
|
||||
mLabelCategories->setText( tr( "%1 categories." ).arg( typeUpper ) );
|
||||
mLabelContact->setText( tr( "Contact describe the owner of the %1." ).arg( type ) );
|
||||
mLabelLinks->setText( tr( "Links describe ancillary resources and information related to this %1." ).arg( type ) );
|
||||
mLabelHistory->setText( tr( "History about the %1." ).arg( type ) );
|
||||
btnAutoSource->setText( tr( "Set from %1" ).arg( mMode == LayerMetadata ? tr( "layer" ) : tr( "project" ) ) );
|
||||
}
|
||||
|
||||
void QgsMetadataWidget::setMetadata( const QgsAbstractMetadataBase *metadata )
|
||||
{
|
||||
if ( !metadata )
|
||||
return;
|
||||
|
||||
if ( dynamic_cast< const QgsLayerMetadata * >( metadata ) )
|
||||
setMode( LayerMetadata );
|
||||
else if ( dynamic_cast< const QgsProjectMetadata * >( metadata ) )
|
||||
setMode( ProjectMetadata );
|
||||
|
||||
mMetadata.reset( metadata->clone() );
|
||||
setUiFromMetadata();
|
||||
}
|
||||
|
||||
QgsAbstractMetadataBase *QgsMetadataWidget::metadata()
|
||||
{
|
||||
std::unique_ptr< QgsAbstractMetadataBase > md;
|
||||
switch ( mMode )
|
||||
{
|
||||
case LayerMetadata:
|
||||
md = qgis::make_unique< QgsLayerMetadata >();
|
||||
break;
|
||||
|
||||
case ProjectMetadata:
|
||||
md = qgis::make_unique< QgsProjectMetadata >();
|
||||
break;
|
||||
|
||||
}
|
||||
saveMetadata( md.get() );
|
||||
return md.release();
|
||||
}
|
||||
|
||||
void QgsMetadataWidget::fillSourceFromLayer()
|
||||
{
|
||||
switch ( mMode )
|
||||
{
|
||||
case LayerMetadata:
|
||||
if ( mLayer )
|
||||
{
|
||||
lineEditIdentifier->setText( mLayer->publicSource() );
|
||||
}
|
||||
break;
|
||||
|
||||
case ProjectMetadata:
|
||||
lineEditIdentifier->setText( QgsProject::instance()->fileName() );
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void QgsMetadataWidget::addVocabulary()
|
||||
{
|
||||
int row = tabKeywords->rowCount();
|
||||
tabKeywords->setRowCount( row + 1 );
|
||||
@ -155,7 +221,7 @@ void QgsAbstractMetadataBaseWidget::addVocabulary()
|
||||
tabKeywords->setItem( row, 1, pCell );
|
||||
}
|
||||
|
||||
void QgsAbstractMetadataBaseWidget::removeSelectedVocabulary()
|
||||
void QgsMetadataWidget::removeSelectedVocabulary()
|
||||
{
|
||||
QItemSelectionModel *selectionModel = tabKeywords->selectionModel();
|
||||
const QModelIndexList selectedRows = selectionModel->selectedRows();
|
||||
@ -165,7 +231,7 @@ void QgsAbstractMetadataBaseWidget::removeSelectedVocabulary()
|
||||
}
|
||||
}
|
||||
|
||||
void QgsAbstractMetadataBaseWidget::addLicence()
|
||||
void QgsMetadataWidget::addLicence()
|
||||
{
|
||||
QString newLicence = QInputDialog::getItem( this, tr( "New Licence" ), tr( "New Licence" ), parseLicenses(), 0, true );
|
||||
if ( tabLicenses->findItems( newLicence, Qt::MatchExactly ).isEmpty() )
|
||||
@ -177,7 +243,7 @@ void QgsAbstractMetadataBaseWidget::addLicence()
|
||||
}
|
||||
}
|
||||
|
||||
void QgsAbstractMetadataBaseWidget::removeSelectedLicence()
|
||||
void QgsMetadataWidget::removeSelectedLicence()
|
||||
{
|
||||
QItemSelectionModel *selectionModel = tabLicenses->selectionModel();
|
||||
const QModelIndexList selectedRows = selectionModel->selectedRows();
|
||||
@ -187,7 +253,7 @@ void QgsAbstractMetadataBaseWidget::removeSelectedLicence()
|
||||
}
|
||||
}
|
||||
|
||||
void QgsAbstractMetadataBaseWidget::addRight()
|
||||
void QgsMetadataWidget::addRight()
|
||||
{
|
||||
QString newRight = QInputDialog::getText( this, tr( "New Right" ), tr( "New Right" ) );
|
||||
QStringList existingRights = mRightsModel->stringList();
|
||||
@ -198,7 +264,7 @@ void QgsAbstractMetadataBaseWidget::addRight()
|
||||
}
|
||||
}
|
||||
|
||||
void QgsAbstractMetadataBaseWidget::removeSelectedRight()
|
||||
void QgsMetadataWidget::removeSelectedRight()
|
||||
{
|
||||
QItemSelectionModel *selection = listRights->selectionModel();
|
||||
if ( selection->hasSelection() )
|
||||
@ -212,20 +278,20 @@ void QgsAbstractMetadataBaseWidget::removeSelectedRight()
|
||||
}
|
||||
}
|
||||
|
||||
void QgsAbstractMetadataBaseWidget::addConstraint()
|
||||
void QgsMetadataWidget::addConstraint()
|
||||
{
|
||||
int row = mConstraintsModel->rowCount();
|
||||
mConstraintsModel->setItem( row, 0, new QStandardItem( QString( tr( "undefined %1" ) ).arg( row + 1 ) ) );
|
||||
mConstraintsModel->setItem( row, 1, new QStandardItem( QString( tr( "undefined %1" ) ).arg( row + 1 ) ) );
|
||||
}
|
||||
|
||||
void QgsAbstractMetadataBaseWidget::removeSelectedConstraint()
|
||||
void QgsMetadataWidget::removeSelectedConstraint()
|
||||
{
|
||||
const QModelIndexList selectedRows = tabConstraints->selectionModel()->selectedRows();
|
||||
mConstraintsModel->removeRow( selectedRows[0].row() );
|
||||
}
|
||||
|
||||
void QgsAbstractMetadataBaseWidget::crsChanged()
|
||||
void QgsMetadataWidget::crsChanged()
|
||||
{
|
||||
if ( ( mCrs.isValid() ) && ( mLayer ) )
|
||||
{
|
||||
@ -258,7 +324,7 @@ void QgsAbstractMetadataBaseWidget::crsChanged()
|
||||
}
|
||||
}
|
||||
|
||||
void QgsAbstractMetadataBaseWidget::addAddress()
|
||||
void QgsMetadataWidget::addAddress()
|
||||
{
|
||||
int row = tabAddresses->rowCount();
|
||||
tabAddresses->setRowCount( row + 1 );
|
||||
@ -284,7 +350,7 @@ void QgsAbstractMetadataBaseWidget::addAddress()
|
||||
tabAddresses->setItem( row, 5, new QTableWidgetItem() );
|
||||
}
|
||||
|
||||
void QgsAbstractMetadataBaseWidget::removeSelectedAddress()
|
||||
void QgsMetadataWidget::removeSelectedAddress()
|
||||
{
|
||||
QItemSelectionModel *selectionModel = tabAddresses->selectionModel();
|
||||
const QModelIndexList selectedRows = selectionModel->selectedRows();
|
||||
@ -294,19 +360,19 @@ void QgsAbstractMetadataBaseWidget::removeSelectedAddress()
|
||||
}
|
||||
}
|
||||
|
||||
void QgsAbstractMetadataBaseWidget::fillCrsFromLayer()
|
||||
void QgsMetadataWidget::fillCrsFromLayer()
|
||||
{
|
||||
mCrs = mLayer->crs();
|
||||
crsChanged();
|
||||
}
|
||||
|
||||
void QgsAbstractMetadataBaseWidget::fillCrsFromProvider()
|
||||
void QgsMetadataWidget::fillCrsFromProvider()
|
||||
{
|
||||
mCrs = mLayer->dataProvider()->crs();
|
||||
crsChanged();
|
||||
}
|
||||
|
||||
void QgsAbstractMetadataBaseWidget::addLink()
|
||||
void QgsMetadataWidget::addLink()
|
||||
{
|
||||
int row = mLinksModel->rowCount();
|
||||
mLinksModel->setItem( row, 0, new QStandardItem( QString( tr( "undefined %1" ) ).arg( row + 1 ) ) );
|
||||
@ -318,13 +384,13 @@ void QgsAbstractMetadataBaseWidget::addLink()
|
||||
mLinksModel->setItem( row, 6, new QStandardItem() );
|
||||
}
|
||||
|
||||
void QgsAbstractMetadataBaseWidget::removeSelectedLink()
|
||||
void QgsMetadataWidget::removeSelectedLink()
|
||||
{
|
||||
const QModelIndexList selectedRows = tabLinks->selectionModel()->selectedRows();
|
||||
mLinksModel->removeRow( selectedRows[0].row() );
|
||||
}
|
||||
|
||||
void QgsAbstractMetadataBaseWidget::addHistory()
|
||||
void QgsMetadataWidget::addHistory()
|
||||
{
|
||||
QString newHistory = QInputDialog::getText( this, tr( "New History" ), tr( "New History" ) );
|
||||
QStringList existingHistory = mHistoryModel->stringList();
|
||||
@ -335,7 +401,7 @@ void QgsAbstractMetadataBaseWidget::addHistory()
|
||||
}
|
||||
}
|
||||
|
||||
void QgsAbstractMetadataBaseWidget::removeSelectedHistory()
|
||||
void QgsMetadataWidget::removeSelectedHistory()
|
||||
{
|
||||
QItemSelectionModel *selection = listHistory->selectionModel();
|
||||
if ( selection->hasSelection() )
|
||||
@ -349,7 +415,7 @@ void QgsAbstractMetadataBaseWidget::removeSelectedHistory()
|
||||
}
|
||||
}
|
||||
|
||||
void QgsAbstractMetadataBaseWidget::fillComboBox()
|
||||
void QgsMetadataWidget::fillComboBox()
|
||||
{
|
||||
// Set default values in type combobox
|
||||
// It is advised to use the ISO 19115 MD_ScopeCode values. E.g. 'dataset' or 'series'.
|
||||
@ -381,52 +447,52 @@ void QgsAbstractMetadataBaseWidget::fillComboBox()
|
||||
}
|
||||
}
|
||||
|
||||
void QgsAbstractMetadataBaseWidget::setPropertiesFromLayer()
|
||||
void QgsMetadataWidget::setUiFromMetadata()
|
||||
{
|
||||
// Parent ID
|
||||
lineEditParentId->setText( mMetadata.parentIdentifier() );
|
||||
lineEditParentId->setText( mMetadata->parentIdentifier() );
|
||||
|
||||
// Identifier
|
||||
if ( ! mMetadata.identifier().isEmpty() )
|
||||
if ( ! mMetadata->identifier().isEmpty() )
|
||||
{
|
||||
lineEditIdentifier->setText( mMetadata.identifier() );
|
||||
lineEditIdentifier->setText( mMetadata->identifier() );
|
||||
}
|
||||
|
||||
// Title
|
||||
if ( ! mMetadata.title().isEmpty() )
|
||||
if ( ! mMetadata->title().isEmpty() )
|
||||
{
|
||||
lineEditTitle->setText( mMetadata.title() );
|
||||
lineEditTitle->setText( mMetadata->title() );
|
||||
}
|
||||
|
||||
// Type
|
||||
if ( ! mMetadata.type().isEmpty() )
|
||||
if ( ! mMetadata->type().isEmpty() )
|
||||
{
|
||||
if ( comboType->findText( mMetadata.type() ) == -1 )
|
||||
if ( comboType->findText( mMetadata->type() ) == -1 )
|
||||
{
|
||||
comboType->addItem( mMetadata.type() );
|
||||
comboType->addItem( mMetadata->type() );
|
||||
}
|
||||
comboType->setCurrentIndex( comboType->findText( mMetadata.type() ) );
|
||||
comboType->setCurrentIndex( comboType->findText( mMetadata->type() ) );
|
||||
}
|
||||
|
||||
// Language
|
||||
if ( ! mMetadata.language().isEmpty() )
|
||||
if ( ! mMetadata->language().isEmpty() )
|
||||
{
|
||||
if ( comboLanguage->findText( mMetadata.language() ) == -1 )
|
||||
if ( comboLanguage->findText( mMetadata->language() ) == -1 )
|
||||
{
|
||||
comboLanguage->addItem( mMetadata.language() );
|
||||
comboLanguage->addItem( mMetadata->language() );
|
||||
}
|
||||
comboLanguage->setCurrentIndex( comboLanguage->findText( mMetadata.language() ) );
|
||||
comboLanguage->setCurrentIndex( comboLanguage->findText( mMetadata->language() ) );
|
||||
}
|
||||
|
||||
// Abstract
|
||||
textEditAbstract->setPlainText( mMetadata.abstract() );
|
||||
textEditAbstract->setPlainText( mMetadata->abstract() );
|
||||
|
||||
// Categories
|
||||
mCategoriesModel->setStringList( mMetadata.categories() );
|
||||
mCategoriesModel->setStringList( mMetadata->categories() );
|
||||
|
||||
// Keywords
|
||||
tabKeywords->setRowCount( 0 );
|
||||
QMapIterator<QString, QStringList> i( mMetadata.keywords() );
|
||||
QMapIterator<QString, QStringList> i( mMetadata->keywords() );
|
||||
while ( i.hasNext() )
|
||||
{
|
||||
i.next();
|
||||
@ -436,69 +502,78 @@ void QgsAbstractMetadataBaseWidget::setPropertiesFromLayer()
|
||||
tabKeywords->item( currentRow, 1 )->setText( i.value().join( QStringLiteral( "," ) ) );
|
||||
}
|
||||
|
||||
// Fees
|
||||
lineEditFees->setText( mMetadata.fees() );
|
||||
|
||||
// Licenses
|
||||
tabLicenses->setRowCount( 0 );
|
||||
const QStringList &licenses = mMetadata.licenses();
|
||||
for ( const QString &licence : licenses )
|
||||
if ( QgsLayerMetadata *layerMetadata = dynamic_cast< QgsLayerMetadata * >( mMetadata.get() ) )
|
||||
{
|
||||
int currentRow = tabLicenses->rowCount();
|
||||
tabLicenses->setRowCount( currentRow + 1 );
|
||||
QTableWidgetItem *pCell = tabLicenses->item( currentRow, 0 );
|
||||
if ( !pCell )
|
||||
|
||||
// Fees
|
||||
lineEditFees->setText( layerMetadata->fees() );
|
||||
|
||||
// Licenses
|
||||
tabLicenses->setRowCount( 0 );
|
||||
const QStringList &licenses = layerMetadata->licenses();
|
||||
for ( const QString &licence : licenses )
|
||||
{
|
||||
pCell = new QTableWidgetItem;
|
||||
tabLicenses->setItem( currentRow, 0, pCell );
|
||||
int currentRow = tabLicenses->rowCount();
|
||||
tabLicenses->setRowCount( currentRow + 1 );
|
||||
QTableWidgetItem *pCell = tabLicenses->item( currentRow, 0 );
|
||||
if ( !pCell )
|
||||
{
|
||||
pCell = new QTableWidgetItem;
|
||||
tabLicenses->setItem( currentRow, 0, pCell );
|
||||
}
|
||||
pCell->setText( licence );
|
||||
}
|
||||
|
||||
// Rights
|
||||
mRightsModel->setStringList( layerMetadata->rights() );
|
||||
|
||||
// Constraints
|
||||
const QList<QgsLayerMetadata::Constraint> &constraints = layerMetadata->constraints();
|
||||
for ( const QgsLayerMetadata::Constraint &constraint : constraints )
|
||||
{
|
||||
int row = mConstraintsModel->rowCount();
|
||||
mConstraintsModel->setItem( row, 0, new QStandardItem( constraint.type ) );
|
||||
mConstraintsModel->setItem( row, 1, new QStandardItem( constraint.constraint ) );
|
||||
}
|
||||
|
||||
// CRS
|
||||
mCrs = layerMetadata->crs();
|
||||
crsChanged();
|
||||
|
||||
// Spatial extent
|
||||
const QList<QgsLayerMetadata::SpatialExtent> &spatialExtents = layerMetadata->extent().spatialExtents();
|
||||
if ( ! spatialExtents.isEmpty() )
|
||||
{
|
||||
// Even if it's a list, it's supposed to store the same extent in different CRS.
|
||||
spatialExtentSelector->setOutputCrs( spatialExtents.at( 0 ).extentCrs );
|
||||
spatialExtentSelector->setOriginalExtent( spatialExtents.at( 0 ).bounds.toRectangle(), spatialExtents.at( 0 ).extentCrs );
|
||||
spatialExtentSelector->setOutputExtentFromOriginal();
|
||||
spinBoxZMaximum->setValue( spatialExtents.at( 0 ).bounds.zMaximum() );
|
||||
spinBoxZMinimum->setValue( spatialExtents.at( 0 ).bounds.zMinimum() );
|
||||
}
|
||||
|
||||
// Temporal extent
|
||||
const QList<QgsDateTimeRange> &temporalExtents = layerMetadata->extent().temporalExtents();
|
||||
if ( ! temporalExtents.isEmpty() )
|
||||
{
|
||||
// Even if it's a list, it seems we use only one for now (cf discussion with Tom)
|
||||
dateTimeFrom->setDateTime( temporalExtents.at( 0 ).begin() );
|
||||
dateTimeTo->setDateTime( temporalExtents.at( 0 ).end() );
|
||||
}
|
||||
else
|
||||
{
|
||||
dateTimeFrom->clear();
|
||||
dateTimeTo->clear();
|
||||
}
|
||||
pCell->setText( licence );
|
||||
}
|
||||
|
||||
// Rights
|
||||
mRightsModel->setStringList( mMetadata.rights() );
|
||||
|
||||
// Constraints
|
||||
const QList<QgsLayerMetadata::Constraint> &constraints = mMetadata.constraints();
|
||||
for ( const QgsLayerMetadata::Constraint &constraint : constraints )
|
||||
else if ( QgsProjectMetadata *projectMetadata = dynamic_cast< QgsProjectMetadata * >( mMetadata.get() ) )
|
||||
{
|
||||
int row = mConstraintsModel->rowCount();
|
||||
mConstraintsModel->setItem( row, 0, new QStandardItem( constraint.type ) );
|
||||
mConstraintsModel->setItem( row, 1, new QStandardItem( constraint.constraint ) );
|
||||
}
|
||||
|
||||
// CRS
|
||||
mCrs = mMetadata.crs();
|
||||
crsChanged();
|
||||
|
||||
// Spatial extent
|
||||
const QList<QgsLayerMetadata::SpatialExtent> &spatialExtents = mMetadata.extent().spatialExtents();
|
||||
if ( ! spatialExtents.isEmpty() )
|
||||
{
|
||||
// Even if it's a list, it's supposed to store the same extent in different CRS.
|
||||
spatialExtentSelector->setOutputCrs( spatialExtents.at( 0 ).extentCrs );
|
||||
spatialExtentSelector->setOriginalExtent( spatialExtents.at( 0 ).bounds.toRectangle(), spatialExtents.at( 0 ).extentCrs );
|
||||
spatialExtentSelector->setOutputExtentFromOriginal();
|
||||
spinBoxZMaximum->setValue( spatialExtents.at( 0 ).bounds.zMaximum() );
|
||||
spinBoxZMinimum->setValue( spatialExtents.at( 0 ).bounds.zMinimum() );
|
||||
}
|
||||
|
||||
// Temporal extent
|
||||
const QList<QgsDateTimeRange> &temporalExtents = mMetadata.extent().temporalExtents();
|
||||
if ( ! temporalExtents.isEmpty() )
|
||||
{
|
||||
// Even if it's a list, it seems we use only one for now (cf discussion with Tom)
|
||||
dateTimeFrom->setDateTime( temporalExtents.at( 0 ).begin() );
|
||||
dateTimeTo->setDateTime( temporalExtents.at( 0 ).end() );
|
||||
}
|
||||
else
|
||||
{
|
||||
dateTimeFrom->clear();
|
||||
dateTimeTo->clear();
|
||||
mLineEditAuthor->setText( projectMetadata->author() );
|
||||
mCreationDateTimeEdit->setDateTime( projectMetadata->creationDateTime() );
|
||||
}
|
||||
|
||||
// Contacts
|
||||
const QList<QgsAbstractMetadataBase::Contact> &contacts = mMetadata.contacts();
|
||||
const QList<QgsAbstractMetadataBase::Contact> &contacts = mMetadata->contacts();
|
||||
if ( ! contacts.isEmpty() )
|
||||
{
|
||||
// Only one contact supported in the UI for now
|
||||
@ -530,7 +605,7 @@ void QgsAbstractMetadataBaseWidget::setPropertiesFromLayer()
|
||||
}
|
||||
|
||||
// Links
|
||||
const QList<QgsAbstractMetadataBase::Link> &links = mMetadata.links();
|
||||
const QList<QgsAbstractMetadataBase::Link> &links = mMetadata->links();
|
||||
mLinksModel->setRowCount( 0 );
|
||||
for ( const QgsAbstractMetadataBase::Link &link : links )
|
||||
{
|
||||
@ -545,17 +620,20 @@ void QgsAbstractMetadataBaseWidget::setPropertiesFromLayer()
|
||||
}
|
||||
|
||||
// History
|
||||
mHistoryModel->setStringList( mMetadata.history() );
|
||||
mHistoryModel->setStringList( mMetadata->history() );
|
||||
}
|
||||
|
||||
void QgsAbstractMetadataBaseWidget::saveMetadata( QgsLayerMetadata &layerMetadata )
|
||||
void QgsMetadataWidget::saveMetadata( QgsAbstractMetadataBase *metadata )
|
||||
{
|
||||
layerMetadata.setParentIdentifier( lineEditParentId->text() );
|
||||
layerMetadata.setIdentifier( lineEditIdentifier->text() );
|
||||
layerMetadata.setTitle( lineEditTitle->text() );
|
||||
layerMetadata.setType( comboType->currentText() );
|
||||
layerMetadata.setLanguage( comboLanguage->currentText() );
|
||||
layerMetadata.setAbstract( textEditAbstract->toPlainText() );
|
||||
if ( !metadata )
|
||||
return;
|
||||
|
||||
metadata->setParentIdentifier( lineEditParentId->text() );
|
||||
metadata->setIdentifier( lineEditIdentifier->text() );
|
||||
metadata->setTitle( lineEditTitle->text() );
|
||||
metadata->setType( comboType->currentText() );
|
||||
metadata->setLanguage( comboLanguage->currentText() );
|
||||
metadata->setAbstract( textEditAbstract->toPlainText() );
|
||||
|
||||
// Keywords, it will save categories too.
|
||||
syncFromCategoriesTabToKeywordsTab();
|
||||
@ -564,57 +642,73 @@ void QgsAbstractMetadataBaseWidget::saveMetadata( QgsLayerMetadata &layerMetadat
|
||||
{
|
||||
keywords.insert( tabKeywords->item( i, 0 )->text(), tabKeywords->item( i, 1 )->text().split( ',' ) );
|
||||
}
|
||||
layerMetadata.setKeywords( keywords );
|
||||
metadata->setKeywords( keywords );
|
||||
|
||||
// Fees
|
||||
layerMetadata.setFees( lineEditFees->text() );
|
||||
|
||||
// Licenses
|
||||
QStringList licenses;
|
||||
for ( int i = 0; i < tabLicenses->rowCount() ; i++ )
|
||||
switch ( mMode )
|
||||
{
|
||||
licenses.append( tabLicenses->item( i, 0 )->text() );
|
||||
case LayerMetadata:
|
||||
{
|
||||
QgsLayerMetadata *layerMetadata = static_cast< QgsLayerMetadata * >( metadata );
|
||||
// Fees
|
||||
layerMetadata->setFees( lineEditFees->text() );
|
||||
|
||||
// Licenses
|
||||
QStringList licenses;
|
||||
for ( int i = 0; i < tabLicenses->rowCount() ; i++ )
|
||||
{
|
||||
licenses.append( tabLicenses->item( i, 0 )->text() );
|
||||
}
|
||||
layerMetadata->setLicenses( licenses );
|
||||
|
||||
// Rights
|
||||
layerMetadata->setRights( mRightsModel->stringList() );
|
||||
|
||||
// Constraints
|
||||
QList<QgsLayerMetadata::Constraint> constraints;
|
||||
for ( int row = 0; row < mConstraintsModel->rowCount() ; row++ )
|
||||
{
|
||||
QgsLayerMetadata::Constraint constraint;
|
||||
constraint.type = mConstraintsModel->item( row, 0 )->text();
|
||||
constraint.constraint = mConstraintsModel->item( row, 1 )->text();
|
||||
constraints.append( constraint );
|
||||
}
|
||||
layerMetadata->setConstraints( constraints );
|
||||
|
||||
// CRS
|
||||
if ( mCrs.isValid() )
|
||||
{
|
||||
layerMetadata->setCrs( mCrs );
|
||||
}
|
||||
|
||||
// Extent
|
||||
QgsLayerMetadata::SpatialExtent spatialExtent;
|
||||
spatialExtent.bounds = QgsBox3d( spatialExtentSelector->outputExtent() );
|
||||
spatialExtent.bounds.setZMinimum( spinBoxZMinimum->value() );
|
||||
spatialExtent.bounds.setZMaximum( spinBoxZMaximum->value() );
|
||||
spatialExtent.extentCrs = spatialExtentSelector->outputCrs();
|
||||
QList<QgsLayerMetadata::SpatialExtent> spatialExtents;
|
||||
spatialExtents.append( spatialExtent );
|
||||
QList<QgsDateTimeRange> temporalExtents;
|
||||
temporalExtents.append( QgsDateTimeRange( dateTimeFrom->dateTime(), dateTimeTo->dateTime() ) );
|
||||
QgsLayerMetadata::Extent extent;
|
||||
extent.setSpatialExtents( spatialExtents );
|
||||
extent.setTemporalExtents( temporalExtents );
|
||||
layerMetadata->setExtent( extent );
|
||||
break;
|
||||
}
|
||||
|
||||
case ProjectMetadata:
|
||||
{
|
||||
QgsProjectMetadata *projectMetadata = static_cast< QgsProjectMetadata * >( metadata );
|
||||
projectMetadata->setAuthor( mLineEditAuthor->text() );
|
||||
projectMetadata->setCreationDateTime( mCreationDateTimeEdit->dateTime() );
|
||||
break;
|
||||
}
|
||||
}
|
||||
layerMetadata.setLicenses( licenses );
|
||||
|
||||
// Rights
|
||||
layerMetadata.setRights( mRightsModel->stringList() );
|
||||
|
||||
// Constraints
|
||||
QList<QgsLayerMetadata::Constraint> constraints;
|
||||
for ( int row = 0; row < mConstraintsModel->rowCount() ; row++ )
|
||||
{
|
||||
QgsLayerMetadata::Constraint constraint;
|
||||
constraint.type = mConstraintsModel->item( row, 0 )->text();
|
||||
constraint.constraint = mConstraintsModel->item( row, 1 )->text();
|
||||
constraints.append( constraint );
|
||||
}
|
||||
layerMetadata.setConstraints( constraints );
|
||||
|
||||
// CRS
|
||||
if ( mCrs.isValid() )
|
||||
{
|
||||
layerMetadata.setCrs( mCrs );
|
||||
}
|
||||
|
||||
// Extent
|
||||
QgsLayerMetadata::SpatialExtent spatialExtent;
|
||||
spatialExtent.bounds = QgsBox3d( spatialExtentSelector->outputExtent() );
|
||||
spatialExtent.bounds.setZMinimum( spinBoxZMinimum->value() );
|
||||
spatialExtent.bounds.setZMaximum( spinBoxZMaximum->value() );
|
||||
spatialExtent.extentCrs = spatialExtentSelector->outputCrs();
|
||||
QList<QgsLayerMetadata::SpatialExtent> spatialExtents;
|
||||
spatialExtents.append( spatialExtent );
|
||||
QList<QgsDateTimeRange> temporalExtents;
|
||||
temporalExtents.append( QgsDateTimeRange( dateTimeFrom->dateTime(), dateTimeTo->dateTime() ) );
|
||||
QgsLayerMetadata::Extent extent;
|
||||
extent.setSpatialExtents( spatialExtents );
|
||||
extent.setTemporalExtents( temporalExtents );
|
||||
layerMetadata.setExtent( extent );
|
||||
|
||||
// Contacts, only one contact supported in the UI for now.
|
||||
// We don't want to lost data if more than one contact, so we update only the first one.
|
||||
QList<QgsAbstractMetadataBase::Contact> contacts = mMetadata.contacts();
|
||||
QList<QgsAbstractMetadataBase::Contact> contacts = mMetadata->contacts();
|
||||
if ( contacts.size() > 0 )
|
||||
contacts.removeFirst();
|
||||
QgsAbstractMetadataBase::Contact contact;
|
||||
@ -639,7 +733,7 @@ void QgsAbstractMetadataBaseWidget::saveMetadata( QgsLayerMetadata &layerMetadat
|
||||
}
|
||||
contact.addresses = addresses;
|
||||
contacts.insert( 0, contact );
|
||||
layerMetadata.setContacts( contacts );
|
||||
metadata->setContacts( contacts );
|
||||
|
||||
// Links
|
||||
QList<QgsAbstractMetadataBase::Link> links;
|
||||
@ -655,19 +749,30 @@ void QgsAbstractMetadataBaseWidget::saveMetadata( QgsLayerMetadata &layerMetadat
|
||||
link.size = mLinksModel->item( row, 6 )->text();
|
||||
links.append( link );
|
||||
}
|
||||
layerMetadata.setLinks( links );
|
||||
metadata->setLinks( links );
|
||||
|
||||
// History
|
||||
layerMetadata.setHistory( mHistoryModel->stringList() );
|
||||
metadata->setHistory( mHistoryModel->stringList() );
|
||||
}
|
||||
|
||||
bool QgsAbstractMetadataBaseWidget::checkMetadata()
|
||||
bool QgsMetadataWidget::checkMetadata()
|
||||
{
|
||||
QgsLayerMetadata metadata = QgsLayerMetadata();
|
||||
saveMetadata( metadata );
|
||||
QgsNativeMetadataValidator validator;
|
||||
std::unique_ptr< QgsAbstractMetadataBase > md( metadata() );
|
||||
|
||||
std::unique_ptr< QgsNativeMetadataBaseValidator > validator;
|
||||
switch ( mMode )
|
||||
{
|
||||
case LayerMetadata:
|
||||
validator = qgis::make_unique< QgsNativeMetadataValidator>();
|
||||
break;
|
||||
|
||||
case ProjectMetadata:
|
||||
validator = qgis::make_unique< QgsNativeProjectMetadataValidator>();
|
||||
break;
|
||||
}
|
||||
|
||||
QList<QgsAbstractMetadataBaseValidator::ValidationResult> validationResults;
|
||||
bool results = validator.validate( &metadata, validationResults );
|
||||
bool results = validator->validate( md.get(), validationResults );
|
||||
|
||||
QString errors;
|
||||
if ( !results )
|
||||
@ -696,7 +801,7 @@ bool QgsAbstractMetadataBaseWidget::checkMetadata()
|
||||
return results;
|
||||
}
|
||||
|
||||
QMap<QString, QString> QgsAbstractMetadataBaseWidget::parseLanguages()
|
||||
QMap<QString, QString> QgsMetadataWidget::parseLanguages()
|
||||
{
|
||||
QMap<QString, QString> countries;
|
||||
countries.insert( QString(), QString() ); // We add an empty line, because it's not compulsory.
|
||||
@ -739,7 +844,7 @@ QMap<QString, QString> QgsAbstractMetadataBaseWidget::parseLanguages()
|
||||
return countries;
|
||||
}
|
||||
|
||||
QStringList QgsAbstractMetadataBaseWidget::parseLicenses()
|
||||
QStringList QgsMetadataWidget::parseLicenses()
|
||||
{
|
||||
QStringList wordList;
|
||||
wordList.append( QString() ); // We add an empty line, because it's not compulsory.
|
||||
@ -763,7 +868,7 @@ QStringList QgsAbstractMetadataBaseWidget::parseLicenses()
|
||||
return wordList;
|
||||
}
|
||||
|
||||
QStringList QgsAbstractMetadataBaseWidget::parseLinkTypes()
|
||||
QStringList QgsMetadataWidget::parseLinkTypes()
|
||||
{
|
||||
QStringList wordList;
|
||||
wordList.append( QString() ); // We add an empty line, because it's not compulsory.
|
||||
@ -787,7 +892,7 @@ QStringList QgsAbstractMetadataBaseWidget::parseLinkTypes()
|
||||
return wordList;
|
||||
}
|
||||
|
||||
QStringList QgsAbstractMetadataBaseWidget::parseMimeTypes()
|
||||
QStringList QgsMetadataWidget::parseMimeTypes()
|
||||
{
|
||||
QStringList wordList;
|
||||
wordList.append( QString() ); // We add an empty line, because it's not compulsory.
|
||||
@ -809,7 +914,7 @@ QStringList QgsAbstractMetadataBaseWidget::parseMimeTypes()
|
||||
return wordList;
|
||||
}
|
||||
|
||||
QMap<QString, QString> QgsAbstractMetadataBaseWidget::parseTypes()
|
||||
QMap<QString, QString> QgsMetadataWidget::parseTypes()
|
||||
{
|
||||
QMap<QString, QString> types;
|
||||
types.insert( QString(), QString() ); // We add an empty line, because it's not compulsory.
|
||||
@ -832,23 +937,32 @@ QMap<QString, QString> QgsAbstractMetadataBaseWidget::parseTypes()
|
||||
return types;
|
||||
}
|
||||
|
||||
void QgsAbstractMetadataBaseWidget::setMapCanvas( QgsMapCanvas *canvas )
|
||||
void QgsMetadataWidget::setMapCanvas( QgsMapCanvas *canvas )
|
||||
{
|
||||
if ( canvas )
|
||||
spatialExtentSelector->setCurrentExtent( canvas->extent(), canvas->mapSettings().destinationCrs() );
|
||||
}
|
||||
|
||||
void QgsAbstractMetadataBaseWidget::acceptMetadata()
|
||||
void QgsMetadataWidget::acceptMetadata()
|
||||
{
|
||||
saveMetadata( mMetadata );
|
||||
if ( mLayer )
|
||||
saveMetadata( mMetadata.get() );
|
||||
switch ( mMode )
|
||||
{
|
||||
// Save layer metadata properties
|
||||
mLayer->setMetadata( mMetadata );
|
||||
case LayerMetadata:
|
||||
if ( mLayer )
|
||||
{
|
||||
// Save layer metadata properties
|
||||
mLayer->setMetadata( *static_cast< QgsLayerMetadata * >( mMetadata.get() ) );
|
||||
}
|
||||
break;
|
||||
|
||||
case ProjectMetadata:
|
||||
QgsProject::instance()->setMetadata( *static_cast< QgsProjectMetadata * >( mMetadata.get() ) );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void QgsAbstractMetadataBaseWidget::syncFromCategoriesTabToKeywordsTab()
|
||||
void QgsMetadataWidget::syncFromCategoriesTabToKeywordsTab()
|
||||
{
|
||||
if ( mCategoriesModel->rowCount() > 0 )
|
||||
{
|
||||
@ -869,7 +983,7 @@ void QgsAbstractMetadataBaseWidget::syncFromCategoriesTabToKeywordsTab()
|
||||
}
|
||||
}
|
||||
|
||||
void QgsAbstractMetadataBaseWidget::updatePanel()
|
||||
void QgsMetadataWidget::updatePanel()
|
||||
{
|
||||
int index = tabWidget->currentIndex();
|
||||
QString currentTabText = tabWidget->widget( index )->objectName();
|
||||
@ -900,7 +1014,7 @@ void QgsAbstractMetadataBaseWidget::updatePanel()
|
||||
}
|
||||
}
|
||||
|
||||
void QgsAbstractMetadataBaseWidget::addNewCategory()
|
||||
void QgsMetadataWidget::addNewCategory()
|
||||
{
|
||||
bool ok;
|
||||
QString text = QInputDialog::getText( this, tr( "New Category" ),
|
||||
@ -918,7 +1032,7 @@ void QgsAbstractMetadataBaseWidget::addNewCategory()
|
||||
}
|
||||
}
|
||||
|
||||
void QgsAbstractMetadataBaseWidget::addDefaultCategories()
|
||||
void QgsMetadataWidget::addDefaultCategories()
|
||||
{
|
||||
const QModelIndexList selectedIndexes = listDefaultCategories->selectionModel()->selectedIndexes();
|
||||
QStringList defaultCategoriesList = mDefaultCategoriesModel->stringList();
|
||||
@ -937,7 +1051,7 @@ void QgsAbstractMetadataBaseWidget::addDefaultCategories()
|
||||
mCategoriesModel->sort( 0 );
|
||||
}
|
||||
|
||||
void QgsAbstractMetadataBaseWidget::removeSelectedCategories()
|
||||
void QgsMetadataWidget::removeSelectedCategories()
|
||||
{
|
||||
const QModelIndexList selectedIndexes = listCategories->selectionModel()->selectedIndexes();
|
||||
QStringList categories = mCategoriesModel->stringList();
|
||||
@ -973,7 +1087,7 @@ QWidget *LinkItemDelegate::createEditor( QWidget *parent, const QStyleOptionView
|
||||
QComboBox *typeEditor = new QComboBox( parent );
|
||||
typeEditor->setEditable( true );
|
||||
QStringListModel *model = new QStringListModel( parent );
|
||||
model->setStringList( QgsAbstractMetadataBaseWidget::parseLinkTypes() );
|
||||
model->setStringList( QgsMetadataWidget::parseLinkTypes() );
|
||||
typeEditor->setModel( model );
|
||||
return typeEditor;
|
||||
}
|
||||
@ -983,7 +1097,7 @@ QWidget *LinkItemDelegate::createEditor( QWidget *parent, const QStyleOptionView
|
||||
QComboBox *mimeEditor = new QComboBox( parent );
|
||||
mimeEditor->setEditable( true );
|
||||
QStringListModel *model = new QStringListModel( parent );
|
||||
model->setStringList( QgsAbstractMetadataBaseWidget::parseMimeTypes() );
|
||||
model->setStringList( QgsMetadataWidget::parseMimeTypes() );
|
||||
mimeEditor->setModel( model );
|
||||
return mimeEditor;
|
||||
}
|
||||
|
@ -35,12 +35,22 @@
|
||||
* \since QGIS 3.0
|
||||
*/
|
||||
|
||||
class GUI_EXPORT QgsAbstractMetadataBaseWidget : public QWidget, private Ui::QgsAbstractMetadataBaseWidget
|
||||
class GUI_EXPORT QgsMetadataWidget : public QWidget, private Ui::QgsAbstractMetadataBaseWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
|
||||
/**
|
||||
* Widget modes.
|
||||
* \since QGIS 3.2
|
||||
*/
|
||||
enum Mode
|
||||
{
|
||||
LayerMetadata = 0, //!< Show layer metadata
|
||||
ProjectMetadata, //!< Show project metadata
|
||||
};
|
||||
|
||||
/**
|
||||
* Constructor for the wizard.
|
||||
*
|
||||
@ -49,7 +59,21 @@ class GUI_EXPORT QgsAbstractMetadataBaseWidget : public QWidget, private Ui::Qgs
|
||||
|
||||
* \see setMetadata()
|
||||
*/
|
||||
QgsAbstractMetadataBaseWidget( QWidget *parent, QgsMapLayer *layer = nullptr );
|
||||
QgsMetadataWidget( QWidget *parent SIP_TRANSFERTHIS = nullptr, QgsMapLayer *layer = nullptr );
|
||||
|
||||
/**
|
||||
* Sets the widget's current \a mode.
|
||||
* \since QGIS 3.2
|
||||
* \see mode()
|
||||
*/
|
||||
void setMode( Mode mode );
|
||||
|
||||
/**
|
||||
* Returns the widget's current mode.
|
||||
* \since QGIS 3.2
|
||||
* \see setMode()
|
||||
*/
|
||||
Mode mode() const { return mMode; }
|
||||
|
||||
/**
|
||||
* Sets the \a metadata to display in the widget.
|
||||
@ -57,23 +81,29 @@ class GUI_EXPORT QgsAbstractMetadataBaseWidget : public QWidget, private Ui::Qgs
|
||||
* This method can be called after constructing a QgsAbstractMetadataBaseWidget in order
|
||||
* to set the displayed metadata to custom, non-layer based metadata.
|
||||
*
|
||||
* Calling this method will automatically setMode() to the correct mode corresponding
|
||||
* to the specified \a metadata object.
|
||||
*
|
||||
* \see metadata()
|
||||
*/
|
||||
void setMetadata( const QgsLayerMetadata &metadata );
|
||||
void setMetadata( const QgsAbstractMetadataBase *metadata );
|
||||
|
||||
/**
|
||||
* Returns a QgsLayerMetadata object representing the current state of the widget.
|
||||
* Returns a QgsAbstractMetadataBase object representing the current state of the widget.
|
||||
*
|
||||
* Caller takes ownership of the returned object.
|
||||
*
|
||||
* \see saveMetadata()
|
||||
*/
|
||||
QgsLayerMetadata metadata();
|
||||
QgsAbstractMetadataBase *metadata() SIP_FACTORY;
|
||||
|
||||
/**
|
||||
* Save all fields in a QgsLayerMetadata object.
|
||||
* Save all fields in a metadata object.
|
||||
* \see metadata()
|
||||
* \see acceptMetadata()
|
||||
* \see checkMetadata()
|
||||
*/
|
||||
void saveMetadata( QgsLayerMetadata &layerMetadata );
|
||||
void saveMetadata( QgsAbstractMetadataBase *metadata );
|
||||
|
||||
/**
|
||||
* Check if values in the wizard are correct.
|
||||
@ -149,12 +179,15 @@ class GUI_EXPORT QgsAbstractMetadataBaseWidget : public QWidget, private Ui::Qgs
|
||||
private:
|
||||
|
||||
void fillComboBox();
|
||||
void setPropertiesFromLayer();
|
||||
void setUiFromMetadata();
|
||||
void syncFromCategoriesTabToKeywordsTab();
|
||||
|
||||
Mode mMode = LayerMetadata;
|
||||
|
||||
QStringList mDefaultCategories;
|
||||
QgsMapLayer *mLayer = nullptr;
|
||||
QgsCoordinateReferenceSystem mCrs;
|
||||
QgsLayerMetadata mMetadata;
|
||||
std::unique_ptr< QgsAbstractMetadataBase > mMetadata;
|
||||
QStandardItemModel *mConstraintsModel = nullptr;
|
||||
QStandardItemModel *mLinksModel = nullptr;
|
||||
QStringListModel *mCategoriesModel = nullptr;
|
||||
|
@ -66,14 +66,14 @@
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<height>670</height>
|
||||
<y>-52</y>
|
||||
<width>786</width>
|
||||
<height>721</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_15">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_11">
|
||||
<widget class="QLabel" name="mIdLabel">
|
||||
<property name="text">
|
||||
<string>This page describes the basic attribution of the dataset. Please use the tooltips for more information.</string>
|
||||
</property>
|
||||
@ -173,6 +173,73 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QFrame" name="mAuthorFrame">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout" columnstretch="0,1">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_13">
|
||||
<property name="toolTip">
|
||||
<string>Returns the human readable name of the resource, typically displayed in search results.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Creation date</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QDateTimeEdit" name="mCreationDateTimeEdit">
|
||||
<property name="displayFormat">
|
||||
<string>yyyy-mm-dd HH:mm</string>
|
||||
</property>
|
||||
<property name="calendarPopup">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0" colspan="2">
|
||||
<widget class="QLineEdit" name="mLineEditAuthor">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Returns the human readable name of the resource, typically displayed in search results.</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0" colspan="2">
|
||||
<widget class="QLabel" name="label_11">
|
||||
<property name="toolTip">
|
||||
<string>Returns the human readable name of the resource, typically displayed in search results.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Author</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="toolTip">
|
||||
@ -244,33 +311,60 @@
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_24">
|
||||
<property name="text">
|
||||
<string>Encoding</string>
|
||||
<widget class="QFrame" name="mEncodingFrame">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_18">
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_24">
|
||||
<property name="text">
|
||||
<string>Encoding</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_8">
|
||||
<item>
|
||||
<widget class="QComboBox" name="comboEncoding">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnAutoEncoding">
|
||||
<property name="text">
|
||||
<string>Set from layer</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_8">
|
||||
<item>
|
||||
<widget class="QComboBox" name="comboEncoding">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnAutoEncoding">
|
||||
<property name="text">
|
||||
<string>Set from layer</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
@ -286,7 +380,7 @@
|
||||
</attribute>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_14">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_25">
|
||||
<widget class="QLabel" name="mLabelCategories">
|
||||
<property name="text">
|
||||
<string>Dataset categories.</string>
|
||||
</property>
|
||||
@ -575,7 +669,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<height>670</height>
|
||||
<height>634</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_16">
|
||||
@ -956,7 +1050,7 @@
|
||||
</attribute>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_10">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_16">
|
||||
<widget class="QLabel" name="mLabelContact">
|
||||
<property name="text">
|
||||
<string>Contact describe the owner of the dataset.</string>
|
||||
</property>
|
||||
@ -981,7 +1075,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>778</width>
|
||||
<height>628</height>
|
||||
<height>586</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
@ -1235,7 +1329,7 @@
|
||||
</attribute>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_5">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_13">
|
||||
<widget class="QLabel" name="mLabelLinks">
|
||||
<property name="toolTip">
|
||||
<string>a list of online resources associated with the resource.</string>
|
||||
</property>
|
||||
@ -1310,7 +1404,7 @@
|
||||
</attribute>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_17">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_30">
|
||||
<widget class="QLabel" name="mLabelHistory">
|
||||
<property name="text">
|
||||
<string>History about the dataset.</string>
|
||||
</property>
|
||||
@ -1422,6 +1516,8 @@
|
||||
<tabstop>btnAutoSource</tabstop>
|
||||
<tabstop>lineEditTitle</tabstop>
|
||||
<tabstop>comboType</tabstop>
|
||||
<tabstop>mLineEditAuthor</tabstop>
|
||||
<tabstop>mCreationDateTimeEdit</tabstop>
|
||||
<tabstop>comboLanguage</tabstop>
|
||||
<tabstop>textEditAbstract</tabstop>
|
||||
<tabstop>comboEncoding</tabstop>
|
||||
|
Loading…
x
Reference in New Issue
Block a user