diff --git a/plugins/feature/satellitetracker/satellitetrackersettingsdialog.cpp b/plugins/feature/satellitetracker/satellitetrackersettingsdialog.cpp index e751c51a9..2f5875682 100644 --- a/plugins/feature/satellitetracker/satellitetrackersettingsdialog.cpp +++ b/plugins/feature/satellitetracker/satellitetrackersettingsdialog.cpp @@ -49,12 +49,7 @@ SatelliteTrackerSettingsDialog::SatelliteTrackerSettingsDialog(SatelliteTrackerS ui->dateFormat->setText(settings->m_dateFormat); ui->utc->setChecked(settings->m_utc); ui->drawOnMap->setChecked(settings->m_drawOnMap); - for (int i = 0; i < settings->m_tles.size(); i++) - { - QListWidgetItem *item = new QListWidgetItem(settings->m_tles[i]); - item->setFlags(Qt::ItemIsSelectable|Qt::ItemIsEditable|Qt::ItemIsEnabled); - ui->tles->addItem(item); - } + updateTleWidget(settings->m_tles); ui->replayEnabled->setChecked(settings->m_replayEnabled); ui->replayDateTime->setDateTime(settings->m_replayStartDateTime); ui->sendTimeToMap->setChecked(settings->m_sendTimeToMap); @@ -65,6 +60,16 @@ SatelliteTrackerSettingsDialog::~SatelliteTrackerSettingsDialog() delete ui; } +void SatelliteTrackerSettingsDialog::updateTleWidget(QList tles) +{ + for (int i = 0; i < tles.size(); i++) + { + QListWidgetItem *item = new QListWidgetItem(tles[i]); + item->setFlags(Qt::ItemIsSelectable|Qt::ItemIsEditable|Qt::ItemIsEnabled); + ui->tles->addItem(item); + } +} + void SatelliteTrackerSettingsDialog::on_addTle_clicked() { QListWidgetItem *item = new QListWidgetItem("https://"); diff --git a/plugins/feature/satellitetracker/satellitetrackersettingsdialog.h b/plugins/feature/satellitetracker/satellitetrackersettingsdialog.h index da44ca295..d6155c151 100644 --- a/plugins/feature/satellitetracker/satellitetrackersettingsdialog.h +++ b/plugins/feature/satellitetracker/satellitetrackersettingsdialog.h @@ -31,6 +31,8 @@ public: explicit SatelliteTrackerSettingsDialog(SatelliteTrackerSettings* settings, QWidget* parent = 0); ~SatelliteTrackerSettingsDialog(); + void updateTleWidget(QList tles); + SatelliteTrackerSettings *m_settings; private slots: