@@ -51,6 +51,8 @@ QgsStyleV2ExportImportDialog::QgsStyleV2ExportImportDialog( QgsStyleV2* style, Q
51
51
QStandardItemModel* model = new QStandardItemModel ( listItems );
52
52
53
53
listItems->setModel ( model );
54
+ connect ( listItems->selectionModel (), SIGNAL ( selectionChanged ( const QItemSelection&, const QItemSelection& ) ),
55
+ this , SLOT ( selectionChanged ( const QItemSelection&, const QItemSelection& ) ) );
54
56
55
57
mTempStyle = new QgsStyleV2 ();
56
58
// TODO validate
@@ -63,7 +65,7 @@ QgsStyleV2ExportImportDialog::QgsStyleV2ExportImportDialog( QgsStyleV2* style, Q
63
65
64
66
if ( mDialogMode == Import )
65
67
{
66
- setWindowTitle ( tr ( " Import style (s)" ) );
68
+ setWindowTitle ( tr ( " Import symbol (s)" ) );
67
69
// populate the import types
68
70
importTypeCombo->addItem ( tr ( " file specified below" ), QVariant ( " file" ) );
69
71
// importTypeCombo->addItem( "official QGIS repo online", QVariant( "official" ) );
@@ -85,7 +87,7 @@ QgsStyleV2ExportImportDialog::QgsStyleV2ExportImportDialog( QgsStyleV2* style, Q
85
87
}
86
88
else
87
89
{
88
- setWindowTitle ( tr ( " Export style (s)" ) );
90
+ setWindowTitle ( tr ( " Export symbol (s)" ) );
89
91
// hide import specific controls when exporting
90
92
btnBrowse->setHidden ( true );
91
93
fromLabel->setHidden ( true );
@@ -109,6 +111,7 @@ QgsStyleV2ExportImportDialog::QgsStyleV2ExportImportDialog( QgsStyleV2* style, Q
109
111
// use Ok button for starting import and export operations
110
112
disconnect ( buttonBox, SIGNAL ( accepted () ), this , SLOT ( accept () ) );
111
113
connect ( buttonBox, SIGNAL ( accepted () ), this , SLOT ( doExportImport () ) );
114
+ buttonBox->button ( QDialogButtonBox::Ok )->setEnabled ( false );
112
115
}
113
116
114
117
void QgsStyleV2ExportImportDialog::doExportImport ()
@@ -594,3 +597,11 @@ void QgsStyleV2ExportImportDialog::downloadCanceled()
594
597
mTempFile ->remove ();
595
598
mFileName = " " ;
596
599
}
600
+
601
+ void QgsStyleV2ExportImportDialog::selectionChanged ( const QItemSelection & selected, const QItemSelection & deselected )
602
+ {
603
+ Q_UNUSED ( selected );
604
+ Q_UNUSED ( deselected );
605
+ bool nothingSelected = listItems->selectionModel ()->selectedIndexes ().empty ();
606
+ buttonBox->button ( QDialogButtonBox::Ok )->setDisabled ( nothingSelected );
607
+ }
0 commit comments