@@ -114,7 +114,14 @@ QgsOgrSourceSelect::QgsOgrSourceSelect( QWidget *parent, Qt::WindowFlags fl, Qgs
114
114
connect ( mFileWidget , &QgsFileWidget::fileChanged, this , [ = ]( const QString & path )
115
115
{
116
116
mVectorPath = path;
117
- emit enableButtons ( ! mVectorPath .isEmpty () );
117
+ if ( radioSrcFile->isChecked () || radioSrcDirectory->isChecked () )
118
+ emit enableButtons ( ! mVectorPath .isEmpty () );
119
+ } );
120
+
121
+ connect ( protocolURI, &QLineEdit::textChanged, this , [ = ]( const QString & text )
122
+ {
123
+ if ( radioSrcProtocol->isChecked () )
124
+ emit enableButtons ( !text.isEmpty () );
118
125
} );
119
126
}
120
127
@@ -378,6 +385,8 @@ void QgsOgrSourceSelect::radioSrcFile_toggled( bool checked )
378
385
mFileWidget ->setFilePath ( QString () );
379
386
380
387
mDataSourceType = QStringLiteral ( " file" );
388
+
389
+ emit enableButtons ( ! mFileWidget ->filePath ().isEmpty () );
381
390
}
382
391
}
383
392
@@ -396,6 +405,8 @@ void QgsOgrSourceSelect::radioSrcDirectory_toggled( bool checked )
396
405
mFileWidget ->setFilePath ( QString () );
397
406
398
407
mDataSourceType = QStringLiteral ( " directory" );
408
+
409
+ emit enableButtons ( ! mFileWidget ->filePath ().isEmpty () );
399
410
}
400
411
}
401
412
@@ -412,6 +423,8 @@ void QgsOgrSourceSelect::radioSrcDatabase_toggled( bool checked )
412
423
populateConnectionList ();
413
424
setConnectionListPosition ();
414
425
mDataSourceType = QStringLiteral ( " database" );
426
+
427
+ emit enableButtons ( true );
415
428
}
416
429
}
417
430
@@ -423,6 +436,8 @@ void QgsOgrSourceSelect::radioSrcProtocol_toggled( bool checked )
423
436
dbGroupBox->hide ();
424
437
protocolGroupBox->show ();
425
438
mDataSourceType = QStringLiteral ( " protocol" );
439
+
440
+ emit enableButtons ( ! protocolURI->text ().isEmpty () );
426
441
}
427
442
}
428
443
0 commit comments