Skip to content

Commit

Permalink
Disable relative path and directory storing when there is an external…
Browse files Browse the repository at this point in the history
… storage
  • Loading branch information
troopa81 committed Aug 16, 2021
1 parent bbf2429 commit b1fa333
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/gui/editorwidgets/qgsexternalresourceconfigdlg.cpp
Expand Up @@ -178,10 +178,11 @@ QVariantMap QgsExternalResourceConfigDlg::config()
cfg.insert( QStringLiteral( "DefaultRoot" ), mRootPath->text() );

// Save Storage Mode
cfg.insert( QStringLiteral( "StorageMode" ), mStorageButtonGroup->checkedId() );
cfg.insert( QStringLiteral( "StorageMode" ), mStorageModeGroupBox->isVisible() ?
mStorageButtonGroup->checkedId() : QgsFileWidget::GetFile );

// Save Relative Paths option
if ( mRelativeGroupBox->isChecked() )
if ( mRelativeGroupBox->isVisible() && mRelativeGroupBox->isChecked() )
{
cfg.insert( QStringLiteral( "RelativeStorage" ), mRelativeButtonGroup->checkedId() );
}
Expand Down Expand Up @@ -294,5 +295,12 @@ void QgsExternalResourceConfigDlg::changeStorageType( int storageType )
{
// first one in combo box is not an external storage
mExternalStorageGroupBox->setVisible( storageType );

// for now, we store only files in external storage
mStorageModeGroupBox->setVisible( !storageType );

// Absolute path are mandatory when using external storage
mRelativeGroupBox->setVisible( !storageType );

emit changed();
}

0 comments on commit b1fa333

Please sign in to comment.