Skip to content

Commit

Permalink
Merge pull request #2068 from dforsi/feature/map-feature
Browse files Browse the repository at this point in the history
Feature/map feature
  • Loading branch information
f4exb authored Apr 24, 2024
2 parents dac9b9a + 991ccdd commit 5e321e3
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 2 deletions.
1 change: 1 addition & 0 deletions plugins/feature/map/mapbeacondialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ MapBeaconDialog::MapBeaconDialog(MapGUI *gui, QWidget* parent) :
ui(new Ui::MapBeaconDialog)
{
ui->setupUi(this);
setAttribute(Qt::WA_QuitOnClose, false);
connect(&m_dlm, &HttpDownloadManager::downloadComplete, this, &MapBeaconDialog::downloadFinished);
}

Expand Down
3 changes: 3 additions & 0 deletions plugins/feature/map/mapgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2507,17 +2507,20 @@ void MapGUI::on_displaySettings_clicked()
void MapGUI::on_beacons_clicked()
{
m_beaconDialog.show();
m_beaconDialog.raise();
}

void MapGUI::on_ibpBeacons_clicked()
{
m_ibpBeaconDialog.show();
m_ibpBeaconDialog.raise();
}

void MapGUI::on_radiotime_clicked()
{
m_radioTimeDialog.updateTable();
m_radioTimeDialog.show();
m_radioTimeDialog.raise();
}

QString MapGUI::getDataDir()
Expand Down
17 changes: 15 additions & 2 deletions plugins/feature/map/mapibpbeacondialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ MapIBPBeaconDialog::MapIBPBeaconDialog(MapGUI *gui, QWidget* parent) :
ui(new Ui::MapIBPBeaconDialog)
{
ui->setupUi(this);
setAttribute(Qt::WA_QuitOnClose, false);
connect(&m_timer, &QTimer::timeout, this, &MapIBPBeaconDialog::updateTime);
m_timer.setInterval(1000);
m_timer.start();
ui->beacons->setRowCount(IBPBeacon::m_frequencies.size());
for (int row = 0; row < IBPBeacon::m_frequencies.size(); row++)
{
Expand All @@ -44,7 +44,6 @@ MapIBPBeaconDialog::MapIBPBeaconDialog(MapGUI *gui, QWidget* parent) :
ui->beacons->setItem(row, IBP_BEACON_COL_DISTANCE, new QTableWidgetItem(""));
}
resizeTable();
updateTable(QTime::currentTime());
}

MapIBPBeaconDialog::~MapIBPBeaconDialog()
Expand Down Expand Up @@ -126,3 +125,17 @@ void MapIBPBeaconDialog::updateTime()
updateTable(t);
}
}

void MapIBPBeaconDialog::showEvent(QShowEvent *event)
{
(void) event;
updateTable(QTime::currentTime());
updateTime();
m_timer.start();
}

void MapIBPBeaconDialog::hideEvent(QHideEvent *event)
{
(void) event;
m_timer.stop();
}
2 changes: 2 additions & 0 deletions plugins/feature/map/mapibpbeacondialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ private slots:
void accept();
void on_beacons_cellDoubleClicked(int row, int column);
void updateTime();
void showEvent(QShowEvent *event);
void hideEvent(QHideEvent *event);

private:
MapGUI *m_gui;
Expand Down
1 change: 1 addition & 0 deletions plugins/feature/map/mapradiotimedialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ MapRadioTimeDialog::MapRadioTimeDialog(MapGUI *gui, QWidget* parent) :
ui(new Ui::MapRadioTimeDialog)
{
ui->setupUi(this);
setAttribute(Qt::WA_QuitOnClose, false);
// Don't call updateTable until m_gui->getAzEl() will return valid location
}

Expand Down

0 comments on commit 5e321e3

Please sign in to comment.