@@ -46,11 +46,13 @@ QgsManageConnectionsDialog::QgsManageConnectionsDialog( QWidget *parent, Mode mo
46
46
{
47
47
label->setText ( tr ( " Select connections to import" ) );
48
48
buttonBox->button ( QDialogButtonBox::Ok )->setText ( tr ( " Import" ) );
49
+ buttonBox->button ( QDialogButtonBox::Ok )->setEnabled ( false );
49
50
}
50
51
else
51
52
{
52
53
// label->setText( tr( "Select connections to export" ) );
53
54
buttonBox->button ( QDialogButtonBox::Ok )->setText ( tr ( " Export" ) );
55
+ buttonBox->button ( QDialogButtonBox::Ok )->setEnabled ( false );
54
56
}
55
57
56
58
if ( !populateConnections () )
@@ -61,6 +63,13 @@ QgsManageConnectionsDialog::QgsManageConnectionsDialog( QWidget *parent, Mode mo
61
63
// use Ok button for starting import and export operations
62
64
disconnect ( buttonBox, SIGNAL ( accepted () ), this , SLOT ( accept () ) );
63
65
connect ( buttonBox, SIGNAL ( accepted () ), this , SLOT ( doExportImport () ) );
66
+
67
+ connect ( listConnections, SIGNAL ( itemSelectionChanged () ), this , SLOT ( selectionChanged () ) );
68
+ }
69
+
70
+ void QgsManageConnectionsDialog::selectionChanged ()
71
+ {
72
+ buttonBox->button ( QDialogButtonBox::Ok )->setEnabled ( !listConnections->selectedItems ().isEmpty () );
64
73
}
65
74
66
75
void QgsManageConnectionsDialog::doExportImport ()
@@ -945,9 +954,11 @@ void QgsManageConnectionsDialog::loadOracleConnections( const QDomDocument &doc,
945
954
void QgsManageConnectionsDialog::selectAll ()
946
955
{
947
956
listConnections->selectAll ();
957
+ buttonBox->button ( QDialogButtonBox::Ok )->setEnabled ( !listConnections->selectedItems ().isEmpty () );
948
958
}
949
959
950
960
void QgsManageConnectionsDialog::clearSelection ()
951
961
{
952
962
listConnections->clearSelection ();
963
+ buttonBox->button ( QDialogButtonBox::Ok )->setEnabled ( false );
953
964
}
0 commit comments