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

Satellite Tracker Settings: add a button to reset the list of TLEs

This commit is contained in:
Daniele Forsi 2024-06-05 00:08:20 +02:00
parent aeab5d9229
commit 7281e238d9
3 changed files with 31 additions and 2 deletions

View File

@ -18,6 +18,7 @@
#include "util/units.h" #include "util/units.h"
#include "satellitetrackersettingsdialog.h" #include "satellitetrackersettingsdialog.h"
#include <QDebug> #include <QDebug>
#include <QMessageBox>
SatelliteTrackerSettingsDialog::SatelliteTrackerSettingsDialog(SatelliteTrackerSettings *settings, SatelliteTrackerSettingsDialog::SatelliteTrackerSettingsDialog(SatelliteTrackerSettings *settings,
QWidget* parent) : QWidget* parent) :
@ -84,6 +85,16 @@ void SatelliteTrackerSettingsDialog::on_removeTle_clicked()
delete items[i]; delete items[i];
} }
void SatelliteTrackerSettingsDialog::on_defaultTles_clicked()
{
QMessageBox::StandardButton reply;
reply = QMessageBox::question(this, "Confirm ovewrite", "Replace the current TLE list with the default?", QMessageBox::Yes|QMessageBox::No, QMessageBox::No);
if (reply == QMessageBox::Yes) {
ui->tles->clear();
updateTleWidget(DEFAULT_TLES);
}
}
void SatelliteTrackerSettingsDialog::accept() void SatelliteTrackerSettingsDialog::accept()
{ {
m_settings->m_heightAboveSeaLevel = ui->height->value(); m_settings->m_heightAboveSeaLevel = ui->height->value();

View File

@ -40,6 +40,8 @@ private slots:
void on_removeTle_clicked(); void on_removeTle_clicked();
void accept(); void accept();
void on_defaultTles_clicked();
private: private:
Ui::SatelliteTrackerSettingsDialog* ui; Ui::SatelliteTrackerSettingsDialog* ui;
}; };

View File

@ -7,7 +7,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>487</width> <width>487</width>
<height>543</height> <height>603</height>
</rect> </rect>
</property> </property>
<property name="font"> <property name="font">
@ -363,6 +363,20 @@
</property> </property>
</widget> </widget>
</item> </item>
<item>
<widget class="QPushButton" name="defaultTles">
<property name="toolTip">
<string>Load preset TLE sources</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../../../sdrgui/resources/res.qrc">
<normaloff>:/star.png</normaloff>:/star.png</iconset>
</property>
</widget>
</item>
<item> <item>
<spacer name="buttonHorizontalSpacer"> <spacer name="buttonHorizontalSpacer">
<property name="orientation"> <property name="orientation">
@ -680,7 +694,9 @@
<tabstop>utc</tabstop> <tabstop>utc</tabstop>
<tabstop>drawOnMap</tabstop> <tabstop>drawOnMap</tabstop>
</tabstops> </tabstops>
<resources/> <resources>
<include location="../../../sdrgui/resources/res.qrc"/>
</resources>
<connections> <connections>
<connection> <connection>
<sender>buttonBox</sender> <sender>buttonBox</sender>