@@ -44,7 +44,6 @@ void QgsHandleBadLayersHandler::handleBadLayers( const QList<QDomNode> &layers )
44
44
45
45
dialog->buttonBox ->button ( QDialogButtonBox::Ignore )->setToolTip ( tr ( " Import all unavailable layers unmodified (you can fix them later)." ) );
46
46
dialog->buttonBox ->button ( QDialogButtonBox::Ignore )->setText ( tr ( " Keep unavailable layers" ) );
47
- dialog->buttonBox ->button ( QDialogButtonBox::Apply )->setToolTip ( tr ( " Apply fixes to unavailable layers (remaining unavailable layers will be removed from the project)." ) );
48
47
dialog->buttonBox ->button ( QDialogButtonBox::Discard )->setToolTip ( tr ( " Remove all unavailable layers from the project" ) );
49
48
dialog->buttonBox ->button ( QDialogButtonBox::Discard )->setText ( tr ( " Remove unavailable layers" ) );
50
49
dialog->buttonBox ->button ( QDialogButtonBox::Discard )->setIcon ( QgsApplication::getThemeIcon ( " /mActionDeleteSelected.svg" ) );
@@ -77,10 +76,13 @@ QgsHandleBadLayers::QgsHandleBadLayers( const QList<QDomNode> &layers )
77
76
mBrowseButton = new QPushButton ( tr ( " Browse" ) );
78
77
buttonBox->addButton ( mBrowseButton , QDialogButtonBox::ActionRole );
79
78
mBrowseButton ->setDisabled ( true );
79
+ mApplyButton = new QPushButton ( tr ( " Apply changes" ) );
80
+ mApplyButton ->setToolTip ( tr ( " Apply fixes to unavailable layers (remaining unavailable layers will be removed from the project)." ) );
81
+ buttonBox->addButton ( mApplyButton , QDialogButtonBox::ActionRole );
80
82
81
83
connect ( mLayerList , &QTableWidget::itemSelectionChanged, this , &QgsHandleBadLayers::selectionChanged );
82
84
connect ( mBrowseButton , &QAbstractButton::clicked, this , &QgsHandleBadLayers::browseClicked );
83
- connect ( buttonBox-> button ( QDialogButtonBox::Apply ) , &QAbstractButton::clicked, this , &QgsHandleBadLayers::apply );
85
+ connect ( mApplyButton , &QAbstractButton::clicked, this , &QgsHandleBadLayers::apply );
84
86
connect ( buttonBox->button ( QDialogButtonBox::Ignore ), &QPushButton::clicked, this , &QgsHandleBadLayers::reject );
85
87
connect ( buttonBox->button ( QDialogButtonBox::Discard ), &QPushButton::clicked, this , &QgsHandleBadLayers::accept );
86
88
@@ -352,7 +354,7 @@ void QgsHandleBadLayers::editAuthCfg()
352
354
void QgsHandleBadLayers::apply ()
353
355
{
354
356
QgsProject::instance ()->layerTreeRegistryBridge ()->setEnabled ( true );
355
-
357
+ buttonBox-> button ( QDialogButtonBox::Ignore )-> setEnabled ( false );
356
358
QList<QgsMapLayer *> toRemove;
357
359
for ( const auto &l : QgsProject::instance ()->mapLayers ( ) )
358
360
{
0 commit comments