mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-07 00:15:48 -04:00
more precise fixes (followup be81716)
This commit is contained in:
parent
91f7918e21
commit
a2a10e9713
@ -465,11 +465,11 @@ void QgsFieldsProperties::on_mMoveUpItem_clicked()
|
||||
void QgsFieldsProperties::on_mInitCodeSourceComboBox_currentIndexChanged( int codeSource )
|
||||
{
|
||||
// Show or hide ui elements as needed
|
||||
mInitFunctionContainer->setVisible( codeSource != QgsEditFormConfig::PythonInitCodeSource::CodeSourceNone );
|
||||
mPythonInitCodeGroupBox->setVisible( codeSource == QgsEditFormConfig::PythonInitCodeSource::CodeSourceDialog );
|
||||
mInitFilePathLineEdit->setVisible( codeSource == QgsEditFormConfig::PythonInitCodeSource::CodeSourceFile );
|
||||
mInitFilePathLabel->setVisible( codeSource == QgsEditFormConfig::PythonInitCodeSource::CodeSourceFile );
|
||||
pbtnSelectInitFilePath->setVisible( codeSource == QgsEditFormConfig::PythonInitCodeSource::CodeSourceFile );
|
||||
mInitFunctionContainer->setVisible( codeSource != QgsEditFormConfig::CodeSourceNone );
|
||||
mPythonInitCodeGroupBox->setVisible( codeSource == QgsEditFormConfig::CodeSourceDialog );
|
||||
mInitFilePathLineEdit->setVisible( codeSource == QgsEditFormConfig::CodeSourceFile );
|
||||
mInitFilePathLabel->setVisible( codeSource == QgsEditFormConfig::CodeSourceFile );
|
||||
pbtnSelectInitFilePath->setVisible( codeSource == QgsEditFormConfig::CodeSourceFile );
|
||||
}
|
||||
|
||||
void QgsFieldsProperties::attributeTypeDialog()
|
||||
|
@ -730,10 +730,10 @@ void QgsVectorLayerProperties::loadDefaultStyle_clicked()
|
||||
|
||||
switch ( askToUser.exec() )
|
||||
{
|
||||
case( 0 ):
|
||||
case 0:
|
||||
return;
|
||||
break;
|
||||
case( 2 ):
|
||||
case 2:
|
||||
msg = layer->loadNamedStyle( layer->styleURI(), defaultLoadedFlag );
|
||||
if ( !defaultLoadedFlag )
|
||||
{
|
||||
@ -787,10 +787,10 @@ void QgsVectorLayerProperties::saveDefaultStyle_clicked()
|
||||
|
||||
switch ( askToUser.exec() )
|
||||
{
|
||||
case( 0 ):
|
||||
case 0:
|
||||
return;
|
||||
break;
|
||||
case( 2 ):
|
||||
case 2:
|
||||
layer->saveStyleToDatabase( "", "", true, "", errorMsg );
|
||||
if ( errorMsg.isNull() )
|
||||
{
|
||||
|
@ -1801,7 +1801,7 @@ bool QgsVectorLayer::readSymbology( const QDomNode& node, QString& errorMessage
|
||||
int dotPos = initFunction.lastIndexOf( '.' );
|
||||
if ( dotPos >= 0 ) // It's a module
|
||||
{
|
||||
mEditFormConfig->setInitCodeSource( QgsEditFormConfig::PythonInitCodeSource::CodeSourceDialog );
|
||||
mEditFormConfig->setInitCodeSource( QgsEditFormConfig::CodeSourceDialog );
|
||||
mEditFormConfig->setInitFunction( initFunction.mid( dotPos + 1 ) );
|
||||
mEditFormConfig->setInitCode( QString( "from %1 import %2\n" ).arg( initFunction.left( dotPos ), initFunction.mid( dotPos + 1 ) ) );
|
||||
}
|
||||
|
@ -580,7 +580,7 @@ void QgsAttributeForm::initPython()
|
||||
// Init Python, if init function is not empty and the combo indicates
|
||||
// the source for the function code
|
||||
if ( !mLayer->editFormConfig()->initFunction().isEmpty()
|
||||
&& mLayer->editFormConfig()->initCodeSource() != QgsEditFormConfig::PythonInitCodeSource::CodeSourceNone )
|
||||
&& mLayer->editFormConfig()->initCodeSource() != QgsEditFormConfig::CodeSourceNone )
|
||||
{
|
||||
|
||||
QString initFunction = mLayer->editFormConfig()->initFunction();
|
||||
@ -589,7 +589,7 @@ void QgsAttributeForm::initPython()
|
||||
|
||||
switch ( mLayer->editFormConfig()->initCodeSource() )
|
||||
{
|
||||
case QgsEditFormConfig::PythonInitCodeSource::CodeSourceFile:
|
||||
case QgsEditFormConfig::CodeSourceFile:
|
||||
if ( ! initFilePath.isEmpty() )
|
||||
{
|
||||
QFile inputFile( initFilePath );
|
||||
@ -612,7 +612,7 @@ void QgsAttributeForm::initPython()
|
||||
}
|
||||
break;
|
||||
|
||||
case( QgsEditFormConfig::PythonInitCodeSource::CodeSourceDialog ):
|
||||
case QgsEditFormConfig::CodeSourceDialog:
|
||||
initCode = mLayer->editFormConfig()->initCode();
|
||||
if ( initCode.isEmpty() )
|
||||
{
|
||||
@ -620,8 +620,8 @@ void QgsAttributeForm::initPython()
|
||||
}
|
||||
break;
|
||||
|
||||
case( QgsEditFormConfig::PythonInitCodeSource::CodeSourceEnvironment ):
|
||||
case( QgsEditFormConfig::PythonInitCodeSource::CodeSourceNone ):
|
||||
case QgsEditFormConfig::CodeSourceEnvironment:
|
||||
case QgsEditFormConfig::CodeSourceNone:
|
||||
default:
|
||||
// Nothing to do: the function code should be already in the environment
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user