mirror of
https://github.com/qgis/QGIS.git
synced 2025-06-22 00:02:40 -04:00
single dialog to save all types (QML, SLD, DataBase)
This commit is contained in:
parent
cb9774022f
commit
5e6c382328
@ -874,7 +874,7 @@ record in the users style table in their personal qgis.db)
|
||||
.. seealso:: :py:func:`loadNamedStyle`
|
||||
%End
|
||||
|
||||
virtual QString saveNamedStyle( const QString &uri, bool &resultFlag /Out/ );
|
||||
virtual QString saveNamedStyle( const QString &uri, bool &resultFlag /Out/, StyleCategories categories = AllStyleCategories );
|
||||
%Docstring
|
||||
Save the properties of this layer as a named style
|
||||
(either as a .qml file on disk or as a
|
||||
|
@ -66,7 +66,6 @@ SET(QGIS_APP_SRCS
|
||||
qgspuzzlewidget.cpp
|
||||
qgsversionmigration.cpp
|
||||
qgsrulebasedlabelingwidget.cpp
|
||||
qgssavestyletodbdialog.cpp
|
||||
qgssnappinglayertreemodel.cpp
|
||||
qgssnappingwidget.cpp
|
||||
qgsstatusbarcoordinateswidget.cpp
|
||||
@ -138,7 +137,7 @@ SET(QGIS_APP_SRCS
|
||||
qgssvgannotationdialog.cpp
|
||||
qgsundowidget.cpp
|
||||
qgsvectorlayerlegendwidget.cpp
|
||||
qgsvectorlayerloadsavestyledialog.cpp
|
||||
qgsvectorlayersavestyledialog.cpp
|
||||
qgsvectorlayerproperties.cpp
|
||||
qgsmapthemes.cpp
|
||||
qgshandlebadlayers.cpp
|
||||
@ -290,7 +289,6 @@ SET (QGIS_APP_MOC_HDRS
|
||||
qgsmapsavedialog.h
|
||||
qgspuzzlewidget.h
|
||||
qgsrulebasedlabelingwidget.h
|
||||
qgssavestyletodbdialog.h
|
||||
qgssnappinglayertreemodel.h
|
||||
qgssnappingwidget.h
|
||||
qgsstatusbarcoordinateswidget.h
|
||||
@ -378,7 +376,7 @@ SET (QGIS_APP_MOC_HDRS
|
||||
qgstextannotationdialog.h
|
||||
qgsundowidget.h
|
||||
qgsvectorlayerlegendwidget.h
|
||||
qgsvectorlayerloadsavestyledialog.h
|
||||
qgsvectorlayersavestyledialog.h
|
||||
qgsvectorlayerproperties.h
|
||||
qgsmapthemes.h
|
||||
qgshandlebadlayers.h
|
||||
|
@ -1,113 +0,0 @@
|
||||
/***************************************************************************
|
||||
qgssavestyletodbdialog.cpp
|
||||
---------------------
|
||||
begin : April 2013
|
||||
copyright : (C) 2013 by Emilio Loi
|
||||
email : loi at faunalia dot it
|
||||
***************************************************************************
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
#include "qgssavestyletodbdialog.h"
|
||||
|
||||
#include "qgssettings.h"
|
||||
|
||||
#include <QFileDialog>
|
||||
#include <QDomDocument>
|
||||
#include <QMessageBox>
|
||||
#include <QDateTime>
|
||||
|
||||
QgsSaveStyleToDbDialog::QgsSaveStyleToDbDialog( QWidget *parent )
|
||||
: QDialog( parent )
|
||||
{
|
||||
setupUi( this );
|
||||
connect( mFilePickButton, &QToolButton::clicked, this, &QgsSaveStyleToDbDialog::mFilePickButton_clicked );
|
||||
setWindowTitle( QStringLiteral( "Save Style in Database" ) );
|
||||
mDescriptionEdit->setTabChangesFocus( true );
|
||||
setTabOrder( mNameEdit, mDescriptionEdit );
|
||||
setTabOrder( mDescriptionEdit, mUseAsDefault );
|
||||
setTabOrder( mUseAsDefault, buttonBox );
|
||||
|
||||
QgsSettings settings;
|
||||
restoreGeometry( settings.value( QStringLiteral( "Windows/saveStyleToDb/geometry" ) ).toByteArray() );
|
||||
|
||||
connect( buttonBox, &QDialogButtonBox::helpRequested, this, &QgsSaveStyleToDbDialog::showHelp );
|
||||
}
|
||||
|
||||
QgsSaveStyleToDbDialog::~QgsSaveStyleToDbDialog()
|
||||
{
|
||||
QgsSettings settings;
|
||||
settings.setValue( QStringLiteral( "Windows/saveStyleToDb/geometry" ), saveGeometry() );
|
||||
}
|
||||
|
||||
QString QgsSaveStyleToDbDialog::getName()
|
||||
{
|
||||
return mNameEdit->text();
|
||||
}
|
||||
|
||||
QString QgsSaveStyleToDbDialog::getDescription()
|
||||
{
|
||||
return mDescriptionEdit->toPlainText();
|
||||
}
|
||||
|
||||
bool QgsSaveStyleToDbDialog::isDefault()
|
||||
{
|
||||
return mUseAsDefault->isChecked();
|
||||
}
|
||||
|
||||
QString QgsSaveStyleToDbDialog::getUIFileContent()
|
||||
{
|
||||
return mUIFileContent;
|
||||
}
|
||||
|
||||
void QgsSaveStyleToDbDialog::accept()
|
||||
{
|
||||
if ( getName().isEmpty() )
|
||||
{
|
||||
QMessageBox::information( this, tr( "Save Style in Database" ), tr( "A name is mandatory." ) );
|
||||
return;
|
||||
}
|
||||
QDialog::accept();
|
||||
}
|
||||
|
||||
void QgsSaveStyleToDbDialog::mFilePickButton_clicked()
|
||||
{
|
||||
QgsSettings myQSettings; // where we keep last used filter in persistent state
|
||||
QString myLastUsedDir = myQSettings.value( QStringLiteral( "style/lastStyleDir" ), QDir::homePath() ).toString();
|
||||
|
||||
QString myFileName = QFileDialog::getOpenFileName( this, tr( "Attach Qt Designer UI File" ), myLastUsedDir, tr( "Qt Designer UI file .ui" ) + " (*.ui)" );
|
||||
if ( myFileName.isNull() )
|
||||
{
|
||||
return;
|
||||
}
|
||||
QFileInfo myFI( myFileName );
|
||||
QFile uiFile( myFI.filePath() );
|
||||
|
||||
QString myPath = myFI.path();
|
||||
myQSettings.setValue( QStringLiteral( "style/lastStyleDir" ), myPath );
|
||||
|
||||
if ( uiFile.open( QIODevice::ReadOnly ) )
|
||||
{
|
||||
QString content( uiFile.readAll() );
|
||||
QDomDocument doc;
|
||||
|
||||
if ( !doc.setContent( content ) || doc.documentElement().tagName().compare( QLatin1String( "ui" ) ) )
|
||||
{
|
||||
QMessageBox::warning( this, tr( "Attach UI File" ),
|
||||
tr( "The selected file does not appear to be a valid Qt Designer UI file." ) );
|
||||
return;
|
||||
}
|
||||
mUIFileContent = content;
|
||||
mFileNameLabel->setText( myFI.fileName() );
|
||||
}
|
||||
}
|
||||
|
||||
void QgsSaveStyleToDbDialog::showHelp()
|
||||
{
|
||||
QgsHelp::openHelp( QStringLiteral( "introduction/general_tools.html#save-and-share-layer-properties" ) );
|
||||
}
|
@ -1,48 +0,0 @@
|
||||
/***************************************************************************
|
||||
qgssavestyletodbdialog.h
|
||||
---------------------
|
||||
begin : April 2013
|
||||
copyright : (C) 2013 by Emilio Loi
|
||||
email : loi at faunalia dot it
|
||||
***************************************************************************
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef QGSSAVESTYLETODBDIALOG_H
|
||||
#define QGSSAVESTYLETODBDIALOG_H
|
||||
|
||||
#include "ui_qgssavetodbdialog.h"
|
||||
#include "qgsguiutils.h"
|
||||
#include "qgis_app.h"
|
||||
#include "qgshelp.h"
|
||||
|
||||
class APP_EXPORT QgsSaveStyleToDbDialog : public QDialog, private Ui::QgsSaveToDBDialog
|
||||
{
|
||||
QString mUIFileContent;
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit QgsSaveStyleToDbDialog( QWidget *parent = nullptr );
|
||||
|
||||
~QgsSaveStyleToDbDialog() override;
|
||||
|
||||
signals:
|
||||
|
||||
public slots:
|
||||
QString getUIFileContent();
|
||||
QString getName();
|
||||
QString getDescription();
|
||||
bool isDefault();
|
||||
void mFilePickButton_clicked();
|
||||
void accept() override;
|
||||
|
||||
private slots:
|
||||
void showHelp();
|
||||
|
||||
};
|
||||
|
||||
#endif // QGSSAVESTYLETODBDIALOG_H
|
@ -1,96 +0,0 @@
|
||||
/***************************************************************************
|
||||
qgsvectorlayerloadsavestyledialog.h
|
||||
--------------------------------------
|
||||
Date : September 2018
|
||||
Copyright : (C) 2018 by Denis Rouzaud
|
||||
Email : denis@opengis.ch
|
||||
***************************************************************************
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
#include <QListWidgetItem>
|
||||
#include <QMessageBox>
|
||||
|
||||
#include "qgsvectorlayerloadsavestyledialog.h"
|
||||
#include "qgsvectorlayer.h"
|
||||
#include "qgssettings.h"
|
||||
#include "qgisapp.h"
|
||||
#include "qgshelp.h"
|
||||
|
||||
QgsVectorLayerLoadSaveStyleDialog::QgsVectorLayerLoadSaveStyleDialog( QgsVectorLayer *layer, Mode mode, QWidget *parent )
|
||||
: QDialog( parent )
|
||||
, mLayer( layer )
|
||||
, mMode( mode )
|
||||
{
|
||||
setupUi( this );
|
||||
|
||||
QString providerName = mLayer->providerType();
|
||||
if ( providerName == QLatin1String( "ogr" ) )
|
||||
{
|
||||
providerName = mLayer->dataProvider()->storageType();
|
||||
if ( providerName == QLatin1String( "GPKG" ) )
|
||||
providerName = QStringLiteral( "GeoPackage" );
|
||||
}
|
||||
|
||||
//QStringLiteral( "style/lastStyleDir" )
|
||||
|
||||
QgsSettings settings;
|
||||
QgsMapLayer::StyleCategories lastStyleCategories = settings.flagValue( QStringLiteral( "style/lastStyleCategories" ), QgsMapLayer::AllStyleCategories );
|
||||
|
||||
|
||||
switch ( mMode )
|
||||
{
|
||||
case Save:
|
||||
mModeLabel->setText( tr( "Save" ) );
|
||||
mStyleTypeComboBox->addItem( tr( "from file" ), GenericFile );
|
||||
if ( mLayer->dataProvider()->isSaveAndLoadStyleToDatabaseSupported() )
|
||||
mStyleTypeComboBox->addItem( tr( "from database (%1)" ).arg( providerName ), DB );
|
||||
break;
|
||||
case Load:
|
||||
mModeLabel->setText( tr( "Load" ) );
|
||||
mStyleTypeComboBox->addItem( tr( "as QGIS QML style file" ), QML );
|
||||
mStyleTypeComboBox->addItem( tr( "as SLD style file" ), SLD );
|
||||
if ( mLayer->dataProvider()->isSaveAndLoadStyleToDatabaseSupported() )
|
||||
mStyleTypeComboBox->addItem( tr( "in database (%1)" ).arg( providerName ), DB );
|
||||
break;
|
||||
}
|
||||
|
||||
connect( mStyleTypeComboBox, qgis::overload<int>::of( &QComboBox::currentIndexChanged ), this, [ = ]( int idx ) {mFileWidget->setVisible( mStyleTypeComboBox->itemData( idx ) != DB );} );
|
||||
|
||||
for ( QgsMapLayer::StyleCategory category : qgsEnumMap<QgsMapLayer::StyleCategory>().keys() )
|
||||
{
|
||||
if ( category == QgsMapLayer::AllStyleCategories )
|
||||
continue;
|
||||
|
||||
QgsMapLayer::ReadableStyleCategory readableCategory = QgsMapLayer::readableStyleCategory( category );
|
||||
|
||||
QListWidgetItem *item = new QListWidgetItem( readableCategory.icon(), readableCategory.name(), mStyleCategoriesListWidget );
|
||||
item->setFlags( item->flags() | Qt::ItemIsUserCheckable );
|
||||
item->setCheckState( lastStyleCategories.testFlag( category ) ? Qt::Checked : Qt::Unchecked );
|
||||
item->setData( Qt::UserRole, category );
|
||||
}
|
||||
}
|
||||
|
||||
void QgsVectorLayerLoadSaveStyleDialog::accept()
|
||||
{
|
||||
bool ok = true;
|
||||
QgsMapLayer::StyleCategories lastStyleCategories;
|
||||
for ( int row = 0; row < mStyleCategoriesListWidget->count(); ++row )
|
||||
{
|
||||
QListWidgetItem *item = mStyleCategoriesListWidget->item( row );
|
||||
if ( item->checkState() == Qt::Checked )
|
||||
lastStyleCategories |= static_cast<QgsMapLayer::StyleCategory>( item->data( Qt::UserRole ).toInt() );
|
||||
}
|
||||
|
||||
if ( ok )
|
||||
{
|
||||
QgsSettings settings;
|
||||
settings.setFlagValue( QStringLiteral( "style/lastStyleCategories" ), lastStyleCategories );
|
||||
close();
|
||||
}
|
||||
}
|
@ -43,7 +43,6 @@
|
||||
#include "qgspluginmetadata.h"
|
||||
#include "qgspluginregistry.h"
|
||||
#include "qgsproject.h"
|
||||
#include "qgssavestyletodbdialog.h"
|
||||
#include "qgsloadstylefromdbdialog.h"
|
||||
#include "qgsvectorlayer.h"
|
||||
#include "qgsvectorlayerjoininfo.h"
|
||||
@ -63,7 +62,7 @@
|
||||
#include "qgslabelinggui.h"
|
||||
#include "qgssymbollayer.h"
|
||||
#include "qgsgeometryfixes.h"
|
||||
#include "qgsvectorlayerloadsavestyledialog.h"
|
||||
#include "qgsvectorlayersavestyledialog.h"
|
||||
|
||||
#include "layertree/qgslayertreelayer.h"
|
||||
#include "qgslayertree.h"
|
||||
@ -119,7 +118,7 @@ QgsVectorLayerProperties::QgsVectorLayerProperties(
|
||||
mBtnStyle = new QPushButton( tr( "Style" ), this );
|
||||
QMenu *menuStyle = new QMenu( this );
|
||||
mActionLoadStyle = menuStyle->addAction( tr( "Load Style" ), this, &QgsVectorLayerProperties::loadStyle_clicked );
|
||||
menuStyle->addAction( tr( "Save Style" ), this, &QgsVectorLayerProperties::saveStyleAs );
|
||||
menuStyle->addAction( tr( "Save Style…" ), this, &QgsVectorLayerProperties::saveStyleAs );
|
||||
menuStyle->addSeparator();
|
||||
menuStyle->addAction( tr( "Save as Default" ), this, SLOT( saveDefaultStyle_clicked() ) );
|
||||
menuStyle->addAction( tr( "Restore Default" ), this, SLOT( loadDefaultStyle_clicked() ) );
|
||||
@ -1123,30 +1122,49 @@ void QgsVectorLayerProperties::loadDefaultMetadata()
|
||||
|
||||
void QgsVectorLayerProperties::saveStyleAs()
|
||||
{
|
||||
QgsVectorLayerLoadSaveStyleDialog dlg( mLayer, QgsVectorLayerLoadSaveStyleDialog::Save );
|
||||
dlg.exec();
|
||||
QgsVectorLayerSaveStyleDialog dlg( mLayer );
|
||||
QgsSettings settings;
|
||||
|
||||
/*
|
||||
QgsSettings myQSettings; // where we keep last used filter in persistent state
|
||||
QString myLastUsedDir = myQSettings.value( QStringLiteral( "style/lastStyleDir" ), QDir::homePath() ).toString();
|
||||
if ( dlg.exec() )
|
||||
{
|
||||
apply();
|
||||
|
||||
if ( styleType == DB )
|
||||
bool defaultLoadedFlag = false;
|
||||
|
||||
StyleType type = dlg.currentStyleType();
|
||||
switch ( type )
|
||||
{
|
||||
QString infoWindowTitle = QObject::tr( "Save style to DB (%1)" ).arg( mLayer->providerType() );
|
||||
QString msgError;
|
||||
|
||||
QgsSaveStyleToDbDialog askToUser;
|
||||
//Ask the user for a name and a description about the style
|
||||
if ( askToUser.exec() == QDialog::Accepted )
|
||||
case QML:
|
||||
case SLD:
|
||||
{
|
||||
QString styleName = askToUser.getName();
|
||||
QString styleDesc = askToUser.getDescription();
|
||||
QString uiFileContent = askToUser.getUIFileContent();
|
||||
bool isDefault = askToUser.isDefault();
|
||||
QString message;
|
||||
QString filePath = dlg.outputFilePath();
|
||||
if ( type == QML )
|
||||
message = mLayer->saveNamedStyle( filePath, defaultLoadedFlag, dlg.styleCategories() );
|
||||
else
|
||||
message = mLayer->saveSldStyle( filePath, defaultLoadedFlag );
|
||||
|
||||
apply();
|
||||
//reset if the default style was loaded OK only
|
||||
if ( defaultLoadedFlag )
|
||||
{
|
||||
syncToLayer();
|
||||
}
|
||||
else
|
||||
{
|
||||
//let the user know what went wrong
|
||||
QMessageBox::information( this, tr( "Save Style" ), message );
|
||||
}
|
||||
|
||||
mLayer->saveStyleToDatabase( styleName, styleDesc, isDefault, uiFileContent, msgError );
|
||||
break;
|
||||
}
|
||||
case DB:
|
||||
{
|
||||
QString infoWindowTitle = QObject::tr( "Save style to DB (%1)" ).arg( mLayer->providerType() );
|
||||
QString msgError;
|
||||
|
||||
QgsVectorLayerSaveStyleDialog::SaveToDbSettings dbSettings = dlg.saveToDbSettings();
|
||||
|
||||
mLayer->saveStyleToDatabase( dbSettings.name, dbSettings.description, dbSettings.isDefault, dbSettings.uiFileContent, msgError );
|
||||
|
||||
if ( !msgError.isNull() )
|
||||
{
|
||||
@ -1156,73 +1174,10 @@ void QgsVectorLayerProperties::saveStyleAs()
|
||||
{
|
||||
QgisApp::instance()->messageBar()->pushMessage( infoWindowTitle, tr( "Style saved" ), Qgis::Info, QgisApp::instance()->messageTimeout() );
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
return;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
QString format, extension;
|
||||
if ( styleType == SLD )
|
||||
{
|
||||
format = tr( "SLD File" ) + " (*.sld)";
|
||||
extension = QStringLiteral( ".sld" );
|
||||
}
|
||||
else
|
||||
{
|
||||
format = tr( "QGIS Layer Style File" ) + " (*.qml)";
|
||||
extension = QgsMapLayer::extensionPropertyType( QgsMapLayer::Style );
|
||||
}
|
||||
|
||||
QString myOutputFileName = QFileDialog::getSaveFileName( this, tr( "Save Layer Properties as Style File" ),
|
||||
myLastUsedDir, format );
|
||||
if ( myOutputFileName.isNull() ) //dialog canceled
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
apply(); // make sure the style to save is uptodate
|
||||
|
||||
QString myMessage;
|
||||
bool defaultLoadedFlag = false;
|
||||
|
||||
//ensure the user never omitted the extension from the file name
|
||||
if ( !myOutputFileName.endsWith( extension, Qt::CaseInsensitive ) )
|
||||
{
|
||||
myOutputFileName += extension;
|
||||
}
|
||||
|
||||
if ( styleType == SLD )
|
||||
{
|
||||
// convert to SLD
|
||||
myMessage = mLayer->saveSldStyle( myOutputFileName, defaultLoadedFlag );
|
||||
}
|
||||
else
|
||||
{
|
||||
myMessage = mLayer->saveNamedStyle( myOutputFileName, defaultLoadedFlag );
|
||||
}
|
||||
|
||||
//reset if the default style was loaded OK only
|
||||
if ( defaultLoadedFlag )
|
||||
{
|
||||
syncToLayer();
|
||||
}
|
||||
else
|
||||
{
|
||||
//let the user know what went wrong
|
||||
QMessageBox::information( this, tr( "Save Style" ), myMessage );
|
||||
}
|
||||
|
||||
QFileInfo myFI( myOutputFileName );
|
||||
QString myPath = myFI.path();
|
||||
// Persist last used dir
|
||||
myQSettings.setValue( QStringLiteral( "style/lastStyleDir" ), myPath );
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
void QgsVectorLayerProperties::loadStyleMenuTriggered( QAction *action )
|
||||
|
@ -53,10 +53,11 @@ class APP_EXPORT QgsVectorLayerProperties : public QgsOptionsDialogBase, private
|
||||
public:
|
||||
enum StyleType
|
||||
{
|
||||
QML = 0,
|
||||
QML,
|
||||
SLD,
|
||||
DB,
|
||||
};
|
||||
Q_ENUM( StyleType )
|
||||
|
||||
QgsVectorLayerProperties( QgsVectorLayer *lyr = nullptr, QWidget *parent = nullptr, Qt::WindowFlags fl = QgsGuiUtils::ModalDialogFlags );
|
||||
|
||||
|
196
src/app/qgsvectorlayersavestyledialog.cpp
Normal file
196
src/app/qgsvectorlayersavestyledialog.cpp
Normal file
@ -0,0 +1,196 @@
|
||||
/***************************************************************************
|
||||
qgsvectorlayersavestyledialog.h
|
||||
--------------------------------------
|
||||
Date : September 2018
|
||||
Copyright : (C) 2018 by Denis Rouzaud
|
||||
Email : denis@opengis.ch
|
||||
***************************************************************************
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
#include <QListWidgetItem>
|
||||
#include <QMessageBox>
|
||||
|
||||
#include "qgsvectorlayersavestyledialog.h"
|
||||
#include "qgsvectorlayer.h"
|
||||
#include "qgssettings.h"
|
||||
#include "qgshelp.h"
|
||||
|
||||
QgsVectorLayerSaveStyleDialog::QgsVectorLayerSaveStyleDialog( QgsVectorLayer *layer, QWidget *parent )
|
||||
: QDialog( parent )
|
||||
, mLayer( layer )
|
||||
{
|
||||
setupUi( this );
|
||||
QgsSettings settings;
|
||||
|
||||
QString providerName = mLayer->providerType();
|
||||
if ( providerName == QLatin1String( "ogr" ) )
|
||||
{
|
||||
providerName = mLayer->dataProvider()->storageType();
|
||||
if ( providerName == QLatin1String( "GPKG" ) )
|
||||
providerName = QStringLiteral( "GeoPackage" );
|
||||
}
|
||||
|
||||
QString myLastUsedDir = settings.value( QStringLiteral( "style/lastStyleDir" ), QDir::homePath() ).toString();
|
||||
|
||||
// save style type combobox
|
||||
connect( mStyleTypeComboBox, qgis::overload<int>::of( &QComboBox::currentIndexChanged ), this, [ = ]( int idx )
|
||||
{
|
||||
Q_UNUSED( idx );
|
||||
QgsVectorLayerProperties::StyleType type = currentStyleType();
|
||||
mSaveToFileWidget->setVisible( type != QgsVectorLayerProperties::DB );
|
||||
mSaveToDbWidget->setVisible( type == QgsVectorLayerProperties::DB );
|
||||
mStyleCategoriesListWidget->setEnabled( type == QgsVectorLayerProperties::QML );
|
||||
mFileWidget->setFilter( type == QgsVectorLayerProperties::QML ? tr( "QGIS Layer Style File (*.qml)" ) : tr( "SLD File (*.sld)" ) );
|
||||
} );
|
||||
mStyleTypeComboBox->addItem( tr( "as QGIS QML style file" ), QgsVectorLayerProperties::QML );
|
||||
mStyleTypeComboBox->addItem( tr( "as SLD style file" ), QgsVectorLayerProperties::SLD );
|
||||
if ( mLayer->dataProvider()->isSaveAndLoadStyleToDatabaseSupported() )
|
||||
mStyleTypeComboBox->addItem( tr( "in database (%1)" ).arg( providerName ), QgsVectorLayerProperties::DB );
|
||||
|
||||
|
||||
// Save to DB setup
|
||||
mDbStyleDescriptionEdit->setTabChangesFocus( true );
|
||||
setTabOrder( mDbStyleNameEdit, mDbStyleDescriptionEdit );
|
||||
setTabOrder( mDbStyleDescriptionEdit, mDbStyleUseAsDefault );
|
||||
mDbStyleUIFileWidget->setDefaultRoot( myLastUsedDir );
|
||||
mDbStyleUIFileWidget->setFilter( tr( "Qt Designer UI file (*.ui)" ) );
|
||||
connect( mDbStyleUIFileWidget, &QgsFileWidget::fileChanged, this, &QgsVectorLayerSaveStyleDialog::readUiFileContent );
|
||||
connect( buttonBox, &QDialogButtonBox::helpRequested, this, &QgsVectorLayerSaveStyleDialog::showDbHelp );
|
||||
|
||||
// save to file setup
|
||||
mFileWidget->setStorageMode( QgsFileWidget::SaveFile );
|
||||
mFileWidget->setDefaultRoot( myLastUsedDir );
|
||||
|
||||
// fill style categories
|
||||
QgsMapLayer::StyleCategories lastStyleCategories = settings.flagValue( QStringLiteral( "style/lastStyleCategories" ), QgsMapLayer::AllStyleCategories );
|
||||
for ( QgsMapLayer::StyleCategory category : qgsEnumMap<QgsMapLayer::StyleCategory>().keys() )
|
||||
{
|
||||
if ( category == QgsMapLayer::AllStyleCategories )
|
||||
continue;
|
||||
|
||||
QgsMapLayer::ReadableStyleCategory readableCategory = QgsMapLayer::readableStyleCategory( category );
|
||||
|
||||
QListWidgetItem *item = new QListWidgetItem( readableCategory.icon(), readableCategory.name(), mStyleCategoriesListWidget );
|
||||
item->setFlags( item->flags() | Qt::ItemIsUserCheckable );
|
||||
item->setCheckState( lastStyleCategories.testFlag( category ) ? Qt::Checked : Qt::Unchecked );
|
||||
item->setData( Qt::UserRole, category );
|
||||
}
|
||||
|
||||
restoreGeometry( settings.value( QStringLiteral( "Windows/saveVectorLayerStyleTo/geometry" ) ).toByteArray() );
|
||||
}
|
||||
|
||||
void QgsVectorLayerSaveStyleDialog::accept()
|
||||
{
|
||||
bool ok = true;
|
||||
QgsSettings settings;
|
||||
|
||||
switch ( currentStyleType() )
|
||||
{
|
||||
case QgsVectorLayerProperties::QML:
|
||||
case QgsVectorLayerProperties::SLD:
|
||||
{
|
||||
if ( mFileWidget->filePath().isEmpty() )
|
||||
{
|
||||
QMessageBox::information( this, tr( "Save Style in file" ), tr( "Select a file destination." ) );
|
||||
ok = false;
|
||||
}
|
||||
settings.setFlagValue( QStringLiteral( "style/lastStyleCategories" ), styleCategories() );
|
||||
break;
|
||||
}
|
||||
|
||||
case QgsVectorLayerProperties::DB:
|
||||
{
|
||||
if ( mDbStyleNameEdit->text().isEmpty() )
|
||||
{
|
||||
QMessageBox::information( this, tr( "Save Style in Database" ), tr( "A name is mandatory." ) );
|
||||
ok = false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
} ;
|
||||
|
||||
if ( ok )
|
||||
{
|
||||
QDialog::accept();
|
||||
}
|
||||
}
|
||||
|
||||
QgsVectorLayerSaveStyleDialog::~QgsVectorLayerSaveStyleDialog()
|
||||
{
|
||||
QgsSettings settings;
|
||||
settings.setValue( QStringLiteral( "Windows/saveVectorLayerStyleTo/geometry" ), saveGeometry() );
|
||||
}
|
||||
|
||||
QgsVectorLayerSaveStyleDialog::SaveToDbSettings QgsVectorLayerSaveStyleDialog::saveToDbSettings() const
|
||||
{
|
||||
SaveToDbSettings settings;
|
||||
settings.name = mDbStyleNameEdit->text();
|
||||
settings.description = mDbStyleDescriptionEdit->toPlainText();
|
||||
settings.isDefault = mDbStyleUseAsDefault->isChecked();
|
||||
settings.uiFileContent = mUiFileContent;
|
||||
return settings;
|
||||
}
|
||||
|
||||
QString QgsVectorLayerSaveStyleDialog::outputFilePath() const
|
||||
{
|
||||
return mFileWidget->filePath();
|
||||
}
|
||||
|
||||
QgsMapLayer::StyleCategories QgsVectorLayerSaveStyleDialog::styleCategories() const
|
||||
{
|
||||
QgsMapLayer::StyleCategories categories;
|
||||
for ( int row = 0; row < mStyleCategoriesListWidget->count(); ++row )
|
||||
{
|
||||
QListWidgetItem *item = mStyleCategoriesListWidget->item( row );
|
||||
if ( item->checkState() == Qt::Checked )
|
||||
categories |= item->data( Qt::UserRole ).value<QgsMapLayer::StyleCategory>();
|
||||
}
|
||||
return categories;
|
||||
}
|
||||
|
||||
QgsVectorLayerProperties::StyleType QgsVectorLayerSaveStyleDialog::currentStyleType() const
|
||||
{
|
||||
return mStyleTypeComboBox->currentData().value<QgsVectorLayerProperties::StyleType>();
|
||||
}
|
||||
|
||||
void QgsVectorLayerSaveStyleDialog::readUiFileContent( const QString &filePath )
|
||||
{
|
||||
QgsSettings myQSettings; // where we keep last used filter in persistent state
|
||||
mUiFileContent = QString();
|
||||
|
||||
if ( filePath.isNull() )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
QFileInfo myFI( filePath );
|
||||
QFile uiFile( myFI.filePath() );
|
||||
|
||||
QString myPath = myFI.path();
|
||||
myQSettings.setValue( QStringLiteral( "style/lastStyleDir" ), myPath );
|
||||
|
||||
if ( uiFile.open( QIODevice::ReadOnly ) )
|
||||
{
|
||||
QString content( uiFile.readAll() );
|
||||
QDomDocument doc;
|
||||
|
||||
if ( !doc.setContent( content ) || doc.documentElement().tagName().compare( QLatin1String( "ui" ) ) )
|
||||
{
|
||||
QMessageBox::warning( this, tr( "Attach UI File" ),
|
||||
tr( "The selected file does not appear to be a valid Qt Designer UI file." ) );
|
||||
return;
|
||||
}
|
||||
mUiFileContent = content;
|
||||
}
|
||||
}
|
||||
|
||||
void QgsVectorLayerSaveStyleDialog::showDbHelp()
|
||||
{
|
||||
QgsHelp::openHelp( QStringLiteral( "introduction/general_tools.html#save-and-share-layer-properties" ) );
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
/***************************************************************************
|
||||
qgsvectorlayerloadsavestyledialog.h
|
||||
qgsvectorlayersavestyledialog.h
|
||||
--------------------------------------
|
||||
Date : September 2018
|
||||
Copyright : (C) 2018 by Denis Rouzaud
|
||||
@ -13,43 +13,50 @@
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef QGSVECTORLAYERLOADSAVESTYLEDIALOG_H
|
||||
#define QGSVECTORLAYERLOADSAVESTYLEDIALOG_H
|
||||
#ifndef QGSVECTORLAYERSAVESTYLEDIALOG_H
|
||||
#define QGSVECTORLAYERSAVESTYLEDIALOG_H
|
||||
|
||||
#include <QDialog>
|
||||
#include "ui_qgsvectorlayerloadsavestyledialog.h"
|
||||
#include "ui_qgsvectorlayersavestyledialog.h"
|
||||
#include "qgsvectorlayerproperties.h"
|
||||
|
||||
class QgsVectorLayer;
|
||||
|
||||
|
||||
class QgsVectorLayerLoadSaveStyleDialog : public QDialog, private Ui::QgsVectorLayerLoadSaveStyleDialog
|
||||
class QgsVectorLayerSaveStyleDialog : public QDialog, private Ui::QgsVectorLayerSaveStyleDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
enum Mode
|
||||
|
||||
struct SaveToDbSettings
|
||||
{
|
||||
Save,
|
||||
Load
|
||||
public:
|
||||
QString uiFileContent;
|
||||
QString name;
|
||||
QString description;
|
||||
bool isDefault;
|
||||
};
|
||||
|
||||
enum StyleType
|
||||
{
|
||||
GenericFile,
|
||||
QML,
|
||||
SLD,
|
||||
DB,
|
||||
};
|
||||
explicit QgsVectorLayerSaveStyleDialog( QgsVectorLayer *layer, QWidget *parent = nullptr );
|
||||
~QgsVectorLayerSaveStyleDialog();
|
||||
|
||||
explicit QgsVectorLayerLoadSaveStyleDialog( QgsVectorLayer *layer, Mode mode, QWidget *parent = nullptr );
|
||||
~QgsVectorLayerLoadSaveStyleDialog() = default;
|
||||
SaveToDbSettings saveToDbSettings() const;
|
||||
QString outputFilePath() const;
|
||||
QgsMapLayer::StyleCategories styleCategories() const;
|
||||
|
||||
QgsVectorLayerProperties::StyleType currentStyleType() const;
|
||||
|
||||
public slots:
|
||||
void accept();
|
||||
|
||||
private slots:
|
||||
void showDbHelp();
|
||||
void readUiFileContent( const QString &filePath );
|
||||
|
||||
private:
|
||||
QgsVectorLayer *mLayer;
|
||||
Mode mMode;
|
||||
QString mUiFileContent;
|
||||
};
|
||||
|
||||
#endif // QGSVECTORLAYERLOADSAVESTYLE_H
|
||||
#endif // QGSVECTORLAYERSAVESTYLE_H
|
@ -1190,7 +1190,7 @@ QString QgsMapLayer::loadNamedMetadata( const QString &uri, bool &resultFlag )
|
||||
return loadNamedProperty( uri, QgsMapLayer::Metadata, resultFlag );
|
||||
}
|
||||
|
||||
QString QgsMapLayer::saveNamedProperty( const QString &uri, QgsMapLayer::PropertyType type, bool &resultFlag )
|
||||
QString QgsMapLayer::saveNamedProperty( const QString &uri, QgsMapLayer::PropertyType type, bool &resultFlag, StyleCategories categories )
|
||||
{
|
||||
// check if the uri is a file or ends with .qml/.qmd,
|
||||
// which indicates that it should become one
|
||||
@ -1230,7 +1230,7 @@ QString QgsMapLayer::saveNamedProperty( const QString &uri, QgsMapLayer::Propert
|
||||
|
||||
case Style:
|
||||
QgsReadWriteContext context;
|
||||
exportNamedStyle( myDocument, myErrorMessage, context );
|
||||
exportNamedStyle( myDocument, myErrorMessage, context, categories );
|
||||
break;
|
||||
}
|
||||
|
||||
@ -1421,9 +1421,9 @@ QString QgsMapLayer::saveNamedProperty( const QString &uri, QgsMapLayer::Propert
|
||||
return myErrorMessage;
|
||||
}
|
||||
|
||||
QString QgsMapLayer::saveNamedStyle( const QString &uri, bool &resultFlag )
|
||||
QString QgsMapLayer::saveNamedStyle( const QString &uri, bool &resultFlag, StyleCategories categories )
|
||||
{
|
||||
return saveNamedProperty( uri, QgsMapLayer::Style, resultFlag );
|
||||
return saveNamedProperty( uri, QgsMapLayer::Style, resultFlag, categories );
|
||||
}
|
||||
|
||||
void QgsMapLayer::exportSldStyle( QDomDocument &doc, QString &errorMsg ) const
|
||||
|
@ -840,7 +840,7 @@ class CORE_EXPORT QgsMapLayer : public QObject
|
||||
* \returns a QString with any status messages
|
||||
* \see saveDefaultStyle()
|
||||
*/
|
||||
virtual QString saveNamedStyle( const QString &uri, bool &resultFlag SIP_OUT );
|
||||
virtual QString saveNamedStyle( const QString &uri, bool &resultFlag SIP_OUT, StyleCategories categories = AllStyleCategories );
|
||||
|
||||
/**
|
||||
* Saves the properties of this layer to an SLD format file.
|
||||
@ -1436,7 +1436,8 @@ class CORE_EXPORT QgsMapLayer : public QObject
|
||||
private:
|
||||
|
||||
virtual QString baseURI( PropertyType type ) const;
|
||||
QString saveNamedProperty( const QString &uri, QgsMapLayer::PropertyType type, bool &resultFlag );
|
||||
QString saveNamedProperty( const QString &uri, QgsMapLayer::PropertyType type,
|
||||
bool &resultFlag, QgsMapLayer::StyleCategories categories = AllStyleCategories );
|
||||
QString loadNamedProperty( const QString &uri, QgsMapLayer::PropertyType type, bool &resultFlag );
|
||||
bool loadNamedPropertyFromDatabase( const QString &db, const QString &uri, QString &xml, QgsMapLayer::PropertyType type );
|
||||
|
||||
|
@ -1,155 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>QgsSaveToDBDialog</class>
|
||||
<widget class="QDialog" name="QgsSaveToDBDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>355</width>
|
||||
<height>246</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Save Style</string>
|
||||
</property>
|
||||
<property name="modal">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="descriptionLabel">
|
||||
<property name="text">
|
||||
<string>Description</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QPlainTextEdit" name="mDescriptionEdit"/>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="mUILabel">
|
||||
<property name="text">
|
||||
<string>UI</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>mNameEdit</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="nameLabel">
|
||||
<property name="text">
|
||||
<string>Style Name</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>mNameEdit</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="mNameEdit"/>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<widget class="QCheckBox" name="mUseAsDefault">
|
||||
<property name="text">
|
||||
<string>Use as default style for this layer</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QLabel" name="mFileNameLabel">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="mFilePickButton">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Open...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="2" column="0" rowspan="2" colspan="2">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Optionally pick an input form for attribute editing (QT Designer UI format), it will be stored in the database</string>
|
||||
</property>
|
||||
<property name="textFormat">
|
||||
<enum>Qt::PlainText</enum>
|
||||
</property>
|
||||
<property name="scaledContents">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0" colspan="2">
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Help|QDialogButtonBox::Ok</set>
|
||||
</property>
|
||||
<property name="centerButtons">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<layoutdefault spacing="6" margin="11"/>
|
||||
<tabstops>
|
||||
<tabstop>mNameEdit</tabstop>
|
||||
<tabstop>mDescriptionEdit</tabstop>
|
||||
<tabstop>mFilePickButton</tabstop>
|
||||
<tabstop>mUseAsDefault</tabstop>
|
||||
<tabstop>buttonBox</tabstop>
|
||||
</tabstops>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>accepted()</signal>
|
||||
<receiver>QgsSaveToDBDialog</receiver>
|
||||
<slot>accept()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>254</x>
|
||||
<y>206</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>263</x>
|
||||
<y>68</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>rejected()</signal>
|
||||
<receiver>QgsSaveToDBDialog</receiver>
|
||||
<slot>reject()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>254</x>
|
||||
<y>206</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>6</x>
|
||||
<y>77</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
@ -1,17 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>QgsVectorLayerLoadSaveStyleDialog</class>
|
||||
<widget class="QDialog" name="QgsVectorLayerLoadSaveStyleDialog">
|
||||
<class>QgsVectorLayerSaveStyleDialog</class>
|
||||
<widget class="QDialog" name="QgsVectorLayerSaveStyleDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>733</width>
|
||||
<height>775</height>
|
||||
<width>491</width>
|
||||
<height>527</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Dialog</string>
|
||||
<string>Save layer style</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="4" column="0" colspan="2">
|
||||
@ -29,6 +29,72 @@
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item row="5" column="1">
|
||||
<widget class="QLabel" name="mUILabel">
|
||||
<property name="text">
|
||||
<string>UI</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>mDbStyleNameEdit</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="1">
|
||||
<widget class="QPushButton" name="mHelpButton">
|
||||
<property name="text">
|
||||
<string>Help</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="3">
|
||||
<widget class="QCheckBox" name="mDbStyleUseAsDefault">
|
||||
<property name="text">
|
||||
<string>Use as default style for this layer</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1" colspan="3">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Optionally pick an input form for attribute editing (QT Designer UI format), it will be stored in the database</string>
|
||||
</property>
|
||||
<property name="textFormat">
|
||||
<enum>Qt::PlainText</enum>
|
||||
</property>
|
||||
<property name="scaledContents">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QLabel" name="descriptionLabel">
|
||||
<property name="text">
|
||||
<string>Description</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="3">
|
||||
<widget class="QPlainTextEdit" name="mDbStyleDescriptionEdit"/>
|
||||
</item>
|
||||
<item row="5" column="3">
|
||||
<widget class="QgsFileWidget" name="mDbStyleUIFileWidget" native="true"/>
|
||||
</item>
|
||||
<item row="1" column="3">
|
||||
<widget class="QLineEdit" name="mDbStyleNameEdit"/>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLabel" name="nameLabel">
|
||||
<property name="text">
|
||||
<string>Style Name</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>mDbStyleNameEdit</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
@ -38,7 +104,7 @@
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="mModeLabel">
|
||||
<property name="text">
|
||||
<string>TextLabel</string>
|
||||
<string>Save style</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@ -111,7 +177,7 @@
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>accepted()</signal>
|
||||
<receiver>QgsVectorLayerLoadSaveStyleDialog</receiver>
|
||||
<receiver>QgsVectorLayerSaveStyleDialog</receiver>
|
||||
<slot>accept()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
@ -127,7 +193,7 @@
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>rejected()</signal>
|
||||
<receiver>QgsVectorLayerLoadSaveStyleDialog</receiver>
|
||||
<receiver>QgsVectorLayerSaveStyleDialog</receiver>
|
||||
<slot>reject()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
Loading…
x
Reference in New Issue
Block a user