Skip to content

File tree

2 files changed

+21
-3
lines changed

2 files changed

+21
-3
lines changed
 

‎src/plugins/gps_importer/qgsgpsplugingui.cpp

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,25 @@ QgsGPSPluginGui::QgsGPSPluginGui(const BabelMap& importers,
3838

3939
connect(pbULEditDevices, SIGNAL(clicked()), this, SLOT(openDeviceEditor()));
4040
connect(pbDLEditDevices, SIGNAL(clicked()), this, SLOT(openDeviceEditor()));
41+
42+
// make sure that the OK button is enabled only when it makes sense to
43+
// click it
44+
connect(leGPXFile, SIGNAL(textChanged(const QString&)),
45+
this, SLOT(enableRelevantControls()));
46+
connect(leIMPInput, SIGNAL(textChanged(const QString&)),
47+
this, SLOT(enableRelevantControls()));
48+
connect(leIMPOutput, SIGNAL(textChanged(const QString&)),
49+
this, SLOT(enableRelevantControls()));
50+
connect(leIMPLayer, SIGNAL(textChanged(const QString&)),
51+
this, SLOT(enableRelevantControls()));
52+
connect(leDLOutput, SIGNAL(textChanged(const QString&)),
53+
this, SLOT(enableRelevantControls()));
54+
connect(leDLBasename, SIGNAL(textChanged(const QString&)),
55+
this, SLOT(enableRelevantControls()));
56+
connect(cmbULLayer, SIGNAL(textChanged(QString)),
57+
this, SLOT(enableRelevantControls()));
58+
connect(tabWidget, SIGNAL(currentChanged(int)),
59+
this, SLOT(enableRelevantControls()));
4160
}
4261
QgsGPSPluginGui::~QgsGPSPluginGui()
4362
{

‎src/plugins/gps_importer/qgsgpsplugingui.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ public slots:
4545

4646
void openDeviceEditor();
4747
void devicesUpdated();
48+
void enableRelevantControls();
4849

4950
void on_pbnGPXSelectFile_clicked();
5051

@@ -55,11 +56,9 @@ public slots:
5556

5657
void on_pbnCancel_clicked();
5758
void on_pbnOK_clicked();
58-
59+
5960
private:
6061

61-
void enableRelevantControls();
62-
6362
void populateDeviceComboBox();
6463
void populateULLayerComboBox();
6564
void populateIMPBabelFormats();

0 commit comments

Comments
 (0)
Please sign in to comment.