1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-12-23 01:55:48 -05:00

Factor out the code that updates the widget containing the list of TLEs

This commit is contained in:
Daniele Forsi 2024-06-05 00:06:19 +02:00
parent e95cf97c42
commit 07721385f1
2 changed files with 13 additions and 6 deletions

View File

@ -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<QString> 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://");

View File

@ -31,6 +31,8 @@ public:
explicit SatelliteTrackerSettingsDialog(SatelliteTrackerSettings* settings, QWidget* parent = 0);
~SatelliteTrackerSettingsDialog();
void updateTleWidget(QList<QString> tles);
SatelliteTrackerSettings *m_settings;
private slots: