mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 16:30:05 +00:00
"this" must be explicit in lambda capture
This commit is contained in:
parent
31db9a4315
commit
a3afd71f03
19 changed files with 132 additions and 129 deletions
|
|
@ -269,14 +269,14 @@ void MainWindow::on_actionOpenNexrad_triggered()
|
||||||
dialog,
|
dialog,
|
||||||
&QFileDialog::finished,
|
&QFileDialog::finished,
|
||||||
this,
|
this,
|
||||||
[=]() { update(); },
|
[this]() { update(); },
|
||||||
Qt::QueuedConnection);
|
Qt::QueuedConnection);
|
||||||
|
|
||||||
connect(
|
connect(
|
||||||
dialog,
|
dialog,
|
||||||
&QFileDialog::fileSelected,
|
&QFileDialog::fileSelected,
|
||||||
this,
|
this,
|
||||||
[=](const QString& file)
|
[=, this](const QString& file)
|
||||||
{
|
{
|
||||||
logger_->info("Selected: {}", file.toStdString());
|
logger_->info("Selected: {}", file.toStdString());
|
||||||
|
|
||||||
|
|
@ -287,7 +287,7 @@ void MainWindow::on_actionOpenNexrad_triggered()
|
||||||
request.get(),
|
request.get(),
|
||||||
&request::NexradFileRequest::RequestComplete,
|
&request::NexradFileRequest::RequestComplete,
|
||||||
this,
|
this,
|
||||||
[=](std::shared_ptr<request::NexradFileRequest> request)
|
[=, this](std::shared_ptr<request::NexradFileRequest> request)
|
||||||
{
|
{
|
||||||
std::shared_ptr<types::RadarProductRecord> record =
|
std::shared_ptr<types::RadarProductRecord> record =
|
||||||
request->radar_product_record();
|
request->radar_product_record();
|
||||||
|
|
@ -331,13 +331,13 @@ void MainWindow::on_actionOpenTextEvent_triggered()
|
||||||
dialog,
|
dialog,
|
||||||
&QFileDialog::finished,
|
&QFileDialog::finished,
|
||||||
this,
|
this,
|
||||||
[=]() { update(); },
|
[this]() { update(); },
|
||||||
Qt::QueuedConnection);
|
Qt::QueuedConnection);
|
||||||
|
|
||||||
connect(dialog,
|
connect(dialog,
|
||||||
&QFileDialog::fileSelected,
|
&QFileDialog::fileSelected,
|
||||||
this,
|
this,
|
||||||
[=](const QString& file)
|
[this](const QString& file)
|
||||||
{
|
{
|
||||||
logger_->info("Selected: {}", file.toStdString());
|
logger_->info("Selected: {}", file.toStdString());
|
||||||
p->textEventManager_->LoadFile(file.toStdString());
|
p->textEventManager_->LoadFile(file.toStdString());
|
||||||
|
|
@ -483,7 +483,7 @@ void MainWindowImpl::ConfigureMapLayout()
|
||||||
|
|
||||||
maps_.resize(mapCount);
|
maps_.resize(mapCount);
|
||||||
|
|
||||||
auto MoveSplitter = [=](int /*pos*/, int /*index*/)
|
auto MoveSplitter = [=, this](int /*pos*/, int /*index*/)
|
||||||
{
|
{
|
||||||
QSplitter* s = static_cast<QSplitter*>(sender());
|
QSplitter* s = static_cast<QSplitter*>(sender());
|
||||||
|
|
||||||
|
|
@ -575,7 +575,7 @@ void MainWindowImpl::ConnectOtherSignals()
|
||||||
connect(qApp,
|
connect(qApp,
|
||||||
&QApplication::focusChanged,
|
&QApplication::focusChanged,
|
||||||
mainWindow_,
|
mainWindow_,
|
||||||
[=](QWidget* /*old*/, QWidget* now) { HandleFocusChange(now); });
|
[this](QWidget* /*old*/, QWidget* now) { HandleFocusChange(now); });
|
||||||
connect(level2ProductsWidget_,
|
connect(level2ProductsWidget_,
|
||||||
&ui::Level2ProductsWidget::RadarProductSelected,
|
&ui::Level2ProductsWidget::RadarProductSelected,
|
||||||
mainWindow_,
|
mainWindow_,
|
||||||
|
|
@ -605,7 +605,7 @@ void MainWindowImpl::ConnectOtherSignals()
|
||||||
alertDockWidget_,
|
alertDockWidget_,
|
||||||
&ui::AlertDockWidget::MoveMap,
|
&ui::AlertDockWidget::MoveMap,
|
||||||
this,
|
this,
|
||||||
[=](double latitude, double longitude)
|
[this](double latitude, double longitude)
|
||||||
{
|
{
|
||||||
for (map::MapWidget* map : maps_)
|
for (map::MapWidget* map : maps_)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -506,7 +506,7 @@ void RadarProductManager::EnableRefresh(common::RadarProductGroup group,
|
||||||
|
|
||||||
// Only enable refresh on available products
|
// Only enable refresh on available products
|
||||||
scwx::util::async(
|
scwx::util::async(
|
||||||
[=]()
|
[=, this]()
|
||||||
{
|
{
|
||||||
providerManager->provider_->RequestAvailableProducts();
|
providerManager->provider_->RequestAvailableProducts();
|
||||||
auto availableProducts =
|
auto availableProducts =
|
||||||
|
|
@ -597,7 +597,7 @@ void RadarProductManagerImpl::RefreshData(
|
||||||
}
|
}
|
||||||
|
|
||||||
scwx::util::async(
|
scwx::util::async(
|
||||||
[=]()
|
[=, this]()
|
||||||
{
|
{
|
||||||
auto [newObjects, totalObjects] =
|
auto [newObjects, totalObjects] =
|
||||||
providerManager->provider_->Refresh();
|
providerManager->provider_->Refresh();
|
||||||
|
|
@ -647,7 +647,7 @@ void RadarProductManagerImpl::RefreshData(
|
||||||
{
|
{
|
||||||
providerManager->refreshTimer_.expires_after(interval);
|
providerManager->refreshTimer_.expires_after(interval);
|
||||||
providerManager->refreshTimer_.async_wait(
|
providerManager->refreshTimer_.async_wait(
|
||||||
[=](const boost::system::error_code& e)
|
[=, this](const boost::system::error_code& e)
|
||||||
{
|
{
|
||||||
if (e == boost::system::errc::success)
|
if (e == boost::system::errc::success)
|
||||||
{
|
{
|
||||||
|
|
@ -1151,7 +1151,7 @@ void RadarProductManager::UpdateAvailableProducts()
|
||||||
logger_->debug("UpdateAvailableProducts()");
|
logger_->debug("UpdateAvailableProducts()");
|
||||||
|
|
||||||
scwx::util::async(
|
scwx::util::async(
|
||||||
[=]()
|
[this]()
|
||||||
{
|
{
|
||||||
auto level3ProviderManager =
|
auto level3ProviderManager =
|
||||||
p->GetLevel3ProviderManager(kDefaultLevel3Product_);
|
p->GetLevel3ProviderManager(kDefaultLevel3Product_);
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ public:
|
||||||
warningsProvider_ {kDefaultWarningsProviderUrl}
|
warningsProvider_ {kDefaultWarningsProviderUrl}
|
||||||
{
|
{
|
||||||
util::async(
|
util::async(
|
||||||
[=]()
|
[this]()
|
||||||
{
|
{
|
||||||
main::Application::WaitForInitialization();
|
main::Application::WaitForInitialization();
|
||||||
logger_->debug("Start Refresh");
|
logger_->debug("Start Refresh");
|
||||||
|
|
@ -105,7 +105,7 @@ void TextEventManager::LoadFile(const std::string& filename)
|
||||||
logger_->debug("LoadFile: {}", filename);
|
logger_->debug("LoadFile: {}", filename);
|
||||||
|
|
||||||
util::async(
|
util::async(
|
||||||
[=]()
|
[=, this]()
|
||||||
{
|
{
|
||||||
awips::TextProductFile file;
|
awips::TextProductFile file;
|
||||||
|
|
||||||
|
|
@ -217,7 +217,7 @@ void TextEventManager::Impl::Refresh()
|
||||||
using namespace std::chrono;
|
using namespace std::chrono;
|
||||||
refreshTimer_.expires_after(15s);
|
refreshTimer_.expires_after(15s);
|
||||||
refreshTimer_.async_wait(
|
refreshTimer_.async_wait(
|
||||||
[=](const boost::system::error_code& e)
|
[this](const boost::system::error_code& e)
|
||||||
{
|
{
|
||||||
if (e == boost::asio::error::operation_aborted)
|
if (e == boost::asio::error::operation_aborted)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -332,7 +332,7 @@ void AlertLayerHandler::UpdateAlerts()
|
||||||
using namespace std::chrono;
|
using namespace std::chrono;
|
||||||
alertUpdateTimer_.expires_after(15s);
|
alertUpdateTimer_.expires_after(15s);
|
||||||
alertUpdateTimer_.async_wait(
|
alertUpdateTimer_.async_wait(
|
||||||
[=](const boost::system::error_code& e)
|
[this](const boost::system::error_code& e)
|
||||||
{
|
{
|
||||||
if (e == boost::asio::error::operation_aborted)
|
if (e == boost::asio::error::operation_aborted)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -110,7 +110,7 @@ void ColorTableLayer::Initialize()
|
||||||
connect(context()->radar_product_view().get(),
|
connect(context()->radar_product_view().get(),
|
||||||
&view::RadarProductView::ColorTableUpdated,
|
&view::RadarProductView::ColorTableUpdated,
|
||||||
this,
|
this,
|
||||||
[=]() { p->colorTableNeedsUpdate_ = true; });
|
[this]() { p->colorTableNeedsUpdate_ = true; });
|
||||||
}
|
}
|
||||||
|
|
||||||
void ColorTableLayer::Render(
|
void ColorTableLayer::Render(
|
||||||
|
|
|
||||||
|
|
@ -797,15 +797,15 @@ void MapWidgetImpl::RadarProductManagerConnect()
|
||||||
connect(radarProductManager_.get(),
|
connect(radarProductManager_.get(),
|
||||||
&manager::RadarProductManager::Level3ProductsChanged,
|
&manager::RadarProductManager::Level3ProductsChanged,
|
||||||
this,
|
this,
|
||||||
[&]() { emit widget_->Level3ProductsChanged(); });
|
[this]() { emit widget_->Level3ProductsChanged(); });
|
||||||
|
|
||||||
connect(
|
connect(
|
||||||
radarProductManager_.get(),
|
radarProductManager_.get(),
|
||||||
&manager::RadarProductManager::NewDataAvailable,
|
&manager::RadarProductManager::NewDataAvailable,
|
||||||
this,
|
this,
|
||||||
[&](common::RadarProductGroup group,
|
[this](common::RadarProductGroup group,
|
||||||
const std::string& product,
|
const std::string& product,
|
||||||
std::chrono::system_clock::time_point latestTime)
|
std::chrono::system_clock::time_point latestTime)
|
||||||
{
|
{
|
||||||
if (autoRefreshEnabled_ &&
|
if (autoRefreshEnabled_ &&
|
||||||
context_->radar_product_group() == group &&
|
context_->radar_product_group() == group &&
|
||||||
|
|
@ -817,23 +817,24 @@ void MapWidgetImpl::RadarProductManagerConnect()
|
||||||
std::make_shared<request::NexradFileRequest>();
|
std::make_shared<request::NexradFileRequest>();
|
||||||
|
|
||||||
// File request callback
|
// File request callback
|
||||||
connect(request.get(),
|
connect(
|
||||||
&request::NexradFileRequest::RequestComplete,
|
request.get(),
|
||||||
this,
|
&request::NexradFileRequest::RequestComplete,
|
||||||
[&](std::shared_ptr<request::NexradFileRequest> request)
|
this,
|
||||||
{
|
[this](std::shared_ptr<request::NexradFileRequest> request)
|
||||||
// Select loaded record
|
{
|
||||||
auto record = request->radar_product_record();
|
// Select loaded record
|
||||||
|
auto record = request->radar_product_record();
|
||||||
|
|
||||||
if (record != nullptr)
|
if (record != nullptr)
|
||||||
{
|
{
|
||||||
widget_->SelectRadarProduct(record);
|
widget_->SelectRadarProduct(record);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Load file
|
// Load file
|
||||||
scwx::util::async(
|
scwx::util::async(
|
||||||
[=]()
|
[=, this]()
|
||||||
{
|
{
|
||||||
if (group == common::RadarProductGroup::Level2)
|
if (group == common::RadarProductGroup::Level2)
|
||||||
{
|
{
|
||||||
|
|
@ -867,7 +868,7 @@ void MapWidgetImpl::InitializeNewRadarProductView(
|
||||||
const std::string& colorPalette)
|
const std::string& colorPalette)
|
||||||
{
|
{
|
||||||
scwx::util::async(
|
scwx::util::async(
|
||||||
[=]()
|
[=, this]()
|
||||||
{
|
{
|
||||||
auto radarProductView = context_->radar_product_view();
|
auto radarProductView = context_->radar_product_view();
|
||||||
|
|
||||||
|
|
@ -903,13 +904,13 @@ void MapWidgetImpl::RadarProductViewConnect()
|
||||||
radarProductView.get(),
|
radarProductView.get(),
|
||||||
&view::RadarProductView::ColorTableUpdated,
|
&view::RadarProductView::ColorTableUpdated,
|
||||||
this,
|
this,
|
||||||
[&]() { widget_->update(); },
|
[this]() { widget_->update(); },
|
||||||
Qt::QueuedConnection);
|
Qt::QueuedConnection);
|
||||||
connect(
|
connect(
|
||||||
radarProductView.get(),
|
radarProductView.get(),
|
||||||
&view::RadarProductView::SweepComputed,
|
&view::RadarProductView::SweepComputed,
|
||||||
this,
|
this,
|
||||||
[=]()
|
[=, this]()
|
||||||
{
|
{
|
||||||
std::shared_ptr<config::RadarSite> radarSite =
|
std::shared_ptr<config::RadarSite> radarSite =
|
||||||
radarProductManager_->radar_site();
|
radarProductManager_->radar_site();
|
||||||
|
|
|
||||||
|
|
@ -149,11 +149,11 @@ void RadarProductLayer::Initialize()
|
||||||
connect(radarProductView.get(),
|
connect(radarProductView.get(),
|
||||||
&view::RadarProductView::ColorTableUpdated,
|
&view::RadarProductView::ColorTableUpdated,
|
||||||
this,
|
this,
|
||||||
[=]() { p->colorTableNeedsUpdate_ = true; });
|
[this]() { p->colorTableNeedsUpdate_ = true; });
|
||||||
connect(radarProductView.get(),
|
connect(radarProductView.get(),
|
||||||
&view::RadarProductView::SweepComputed,
|
&view::RadarProductView::SweepComputed,
|
||||||
this,
|
this,
|
||||||
[=]() { p->sweepNeedsUpdate_ = true; });
|
[this]() { p->sweepNeedsUpdate_ = true; });
|
||||||
}
|
}
|
||||||
|
|
||||||
void RadarProductLayer::UpdateSweep()
|
void RadarProductLayer::UpdateSweep()
|
||||||
|
|
|
||||||
|
|
@ -108,7 +108,7 @@ void AlertProxyModelImpl::UpdateAlerts()
|
||||||
using namespace std::chrono;
|
using namespace std::chrono;
|
||||||
alertUpdateTimer_.expires_after(15s);
|
alertUpdateTimer_.expires_after(15s);
|
||||||
alertUpdateTimer_.async_wait(
|
alertUpdateTimer_.async_wait(
|
||||||
[=](const boost::system::error_code& e)
|
[this](const boost::system::error_code& e)
|
||||||
{
|
{
|
||||||
if (e == boost::asio::error::operation_aborted)
|
if (e == boost::asio::error::operation_aborted)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@ RadarProductModelImpl::RadarProductModelImpl(RadarProductModel* self) :
|
||||||
&manager::RadarProductManagerNotifier::Instance(),
|
&manager::RadarProductManagerNotifier::Instance(),
|
||||||
&manager::RadarProductManagerNotifier::RadarProductManagerCreated,
|
&manager::RadarProductManagerNotifier::RadarProductManagerCreated,
|
||||||
this,
|
this,
|
||||||
[=](const std::string& radarSite)
|
[this](const std::string& radarSite)
|
||||||
{
|
{
|
||||||
logger_->debug("Adding radar site: {}", radarSite);
|
logger_->debug("Adding radar site: {}", radarSite);
|
||||||
|
|
||||||
|
|
@ -67,9 +67,9 @@ RadarProductModelImpl::RadarProductModelImpl(RadarProductModel* self) :
|
||||||
manager::RadarProductManager::Instance(radarSite).get(),
|
manager::RadarProductManager::Instance(radarSite).get(),
|
||||||
&manager::RadarProductManager::NewDataAvailable,
|
&manager::RadarProductManager::NewDataAvailable,
|
||||||
this,
|
this,
|
||||||
[=](common::RadarProductGroup group,
|
[=, this](common::RadarProductGroup group,
|
||||||
const std::string& product,
|
const std::string& product,
|
||||||
std::chrono::system_clock::time_point latestTime)
|
std::chrono::system_clock::time_point latestTime)
|
||||||
{
|
{
|
||||||
const QString groupName {QString::fromStdString(
|
const QString groupName {QString::fromStdString(
|
||||||
common::GetRadarProductGroupName(group))};
|
common::GetRadarProductGroupName(group))};
|
||||||
|
|
|
||||||
|
|
@ -74,7 +74,7 @@ void AlertDialogImpl::ConnectSignals()
|
||||||
textEventManager_.get(),
|
textEventManager_.get(),
|
||||||
&manager::TextEventManager::AlertUpdated,
|
&manager::TextEventManager::AlertUpdated,
|
||||||
this,
|
this,
|
||||||
[=](const types::TextEventKey& key)
|
[this](const types::TextEventKey& key)
|
||||||
{
|
{
|
||||||
if (key == key_)
|
if (key == key_)
|
||||||
{
|
{
|
||||||
|
|
@ -85,7 +85,7 @@ void AlertDialogImpl::ConnectSignals()
|
||||||
connect(goButton_,
|
connect(goButton_,
|
||||||
&QPushButton::clicked,
|
&QPushButton::clicked,
|
||||||
this,
|
this,
|
||||||
[=]()
|
[this]()
|
||||||
{
|
{
|
||||||
emit self_->MoveMap(centroid_.latitude_, centroid_.longitude_);
|
emit self_->MoveMap(centroid_.latitude_, centroid_.longitude_);
|
||||||
self_->close();
|
self_->close();
|
||||||
|
|
|
||||||
|
|
@ -127,48 +127,48 @@ void AlertDockWidgetImpl::ConnectSignals()
|
||||||
alertModel_.get(),
|
alertModel_.get(),
|
||||||
&model::AlertModel::HandleAlert,
|
&model::AlertModel::HandleAlert,
|
||||||
Qt::QueuedConnection);
|
Qt::QueuedConnection);
|
||||||
connect(self_->ui->alertView->selectionModel(),
|
connect(
|
||||||
&QItemSelectionModel::selectionChanged,
|
self_->ui->alertView->selectionModel(),
|
||||||
this,
|
&QItemSelectionModel::selectionChanged,
|
||||||
[=](const QItemSelection& selected, const QItemSelection& deselected)
|
this,
|
||||||
{
|
[this](const QItemSelection& selected, const QItemSelection& deselected)
|
||||||
if (selected.size() == 0 && deselected.size() == 0)
|
{
|
||||||
{
|
if (selected.size() == 0 && deselected.size() == 0)
|
||||||
// Items which stay selected but change their index are not
|
{
|
||||||
// included in selected and deselected. Thus, this signal might
|
// Items which stay selected but change their index are not
|
||||||
// be emitted with both selected and deselected empty, if only
|
// included in selected and deselected. Thus, this signal might
|
||||||
// the indices of selected items change.
|
// be emitted with both selected and deselected empty, if only
|
||||||
return;
|
// the indices of selected items change.
|
||||||
}
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
bool itemSelected = selected.size() > 0;
|
bool itemSelected = selected.size() > 0;
|
||||||
bool itemHasCoordinates = false;
|
bool itemHasCoordinates = false;
|
||||||
|
|
||||||
if (itemSelected)
|
if (itemSelected)
|
||||||
{
|
{
|
||||||
QModelIndex selectedIndex =
|
QModelIndex selectedIndex =
|
||||||
proxyModel_->mapToSource(selected[0].indexes()[0]);
|
proxyModel_->mapToSource(selected[0].indexes()[0]);
|
||||||
selectedAlertKey_ = alertModel_->key(selectedIndex);
|
selectedAlertKey_ = alertModel_->key(selectedIndex);
|
||||||
selectedAlertCentroid_ =
|
selectedAlertCentroid_ = alertModel_->centroid(selectedAlertKey_);
|
||||||
alertModel_->centroid(selectedAlertKey_);
|
itemHasCoordinates =
|
||||||
itemHasCoordinates =
|
selectedAlertCentroid_ != common::Coordinate {};
|
||||||
selectedAlertCentroid_ != common::Coordinate {};
|
}
|
||||||
}
|
else
|
||||||
else
|
{
|
||||||
{
|
selectedAlertKey_ = {};
|
||||||
selectedAlertKey_ = {};
|
selectedAlertCentroid_ = {};
|
||||||
selectedAlertCentroid_ = {};
|
}
|
||||||
}
|
|
||||||
|
|
||||||
self_->ui->alertViewButton->setEnabled(itemSelected);
|
self_->ui->alertViewButton->setEnabled(itemSelected);
|
||||||
self_->ui->alertGoButton->setEnabled(itemHasCoordinates);
|
self_->ui->alertGoButton->setEnabled(itemHasCoordinates);
|
||||||
|
|
||||||
logger_->debug("Selected: {}", selectedAlertKey_.ToString());
|
logger_->debug("Selected: {}", selectedAlertKey_.ToString());
|
||||||
});
|
});
|
||||||
connect(self_->ui->alertViewButton,
|
connect(self_->ui->alertViewButton,
|
||||||
&QPushButton::clicked,
|
&QPushButton::clicked,
|
||||||
this,
|
this,
|
||||||
[=]()
|
[this]()
|
||||||
{
|
{
|
||||||
// View alert
|
// View alert
|
||||||
alertDialog_->SelectAlert(selectedAlertKey_);
|
alertDialog_->SelectAlert(selectedAlertKey_);
|
||||||
|
|
@ -177,7 +177,7 @@ void AlertDockWidgetImpl::ConnectSignals()
|
||||||
connect(self_->ui->alertGoButton,
|
connect(self_->ui->alertGoButton,
|
||||||
&QPushButton::clicked,
|
&QPushButton::clicked,
|
||||||
this,
|
this,
|
||||||
[=]()
|
[this]()
|
||||||
{
|
{
|
||||||
emit self_->MoveMap(selectedAlertCentroid_.latitude_,
|
emit self_->MoveMap(selectedAlertCentroid_.latitude_,
|
||||||
selectedAlertCentroid_.longitude_);
|
selectedAlertCentroid_.longitude_);
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ ImGuiDebugDialog::ImGuiDebugDialog(QWidget* parent) :
|
||||||
connect(
|
connect(
|
||||||
ui->contextComboBox,
|
ui->contextComboBox,
|
||||||
&QComboBox::currentIndexChanged,
|
&QComboBox::currentIndexChanged,
|
||||||
[=](int row)
|
[this](int row)
|
||||||
{
|
{
|
||||||
auto& contextModel = model::ImGuiContextModel::Instance();
|
auto& contextModel = model::ImGuiContextModel::Instance();
|
||||||
auto index = contextModel.index(row, 0);
|
auto index = contextModel.index(row, 0);
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ public:
|
||||||
QObject::connect(toolButton,
|
QObject::connect(toolButton,
|
||||||
&QToolButton::clicked,
|
&QToolButton::clicked,
|
||||||
this,
|
this,
|
||||||
[=]() { SelectProduct(product); });
|
[=, this]() { SelectProduct(product); });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
~Level2ProductsWidgetImpl() = default;
|
~Level2ProductsWidgetImpl() = default;
|
||||||
|
|
|
||||||
|
|
@ -179,7 +179,7 @@ void Level2SettingsWidget::UpdateSettings(map::MapWidget* activeMap)
|
||||||
connect(toolButton,
|
connect(toolButton,
|
||||||
&QToolButton::clicked,
|
&QToolButton::clicked,
|
||||||
this,
|
this,
|
||||||
[=]() { p->SelectElevation(elevationCut); });
|
[=, this]() { p->SelectElevation(elevationCut); });
|
||||||
}
|
}
|
||||||
|
|
||||||
p->elevationCuts_ = elevationCuts;
|
p->elevationCuts_ = elevationCuts;
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@ public:
|
||||||
QObject::connect(toolButton,
|
QObject::connect(toolButton,
|
||||||
&QToolButton::clicked,
|
&QToolButton::clicked,
|
||||||
this,
|
this,
|
||||||
[=]() { SelectProductCategory(category); });
|
[=, this]() { SelectProductCategory(category); });
|
||||||
|
|
||||||
QMenu* categoryMenu = new QMenu();
|
QMenu* categoryMenu = new QMenu();
|
||||||
toolButton->setMenu(categoryMenu);
|
toolButton->setMenu(categoryMenu);
|
||||||
|
|
@ -79,7 +79,7 @@ public:
|
||||||
action,
|
action,
|
||||||
&QAction::triggered,
|
&QAction::triggered,
|
||||||
this,
|
this,
|
||||||
[=]()
|
[=, this]()
|
||||||
{
|
{
|
||||||
std::shared_lock lock {awipsProductMutex_};
|
std::shared_lock lock {awipsProductMutex_};
|
||||||
std::string awipsProductName {awipsProductMap_.at(action)};
|
std::string awipsProductName {awipsProductMap_.at(action)};
|
||||||
|
|
|
||||||
|
|
@ -72,47 +72,47 @@ RadarSiteDialog::RadarSiteDialog(QWidget* parent) :
|
||||||
connect(ui->radarSiteView,
|
connect(ui->radarSiteView,
|
||||||
&QTreeView::doubleClicked,
|
&QTreeView::doubleClicked,
|
||||||
this,
|
this,
|
||||||
[=]() { emit accept(); });
|
[this]() { emit accept(); });
|
||||||
connect(ui->radarSiteView->selectionModel(),
|
connect(
|
||||||
&QItemSelectionModel::selectionChanged,
|
ui->radarSiteView->selectionModel(),
|
||||||
this,
|
&QItemSelectionModel::selectionChanged,
|
||||||
[=](const QItemSelection& selected, const QItemSelection& deselected)
|
this,
|
||||||
{
|
[this](const QItemSelection& selected, const QItemSelection& deselected)
|
||||||
if (selected.size() == 0 && deselected.size() == 0)
|
{
|
||||||
{
|
if (selected.size() == 0 && deselected.size() == 0)
|
||||||
// Items which stay selected but change their index are not
|
{
|
||||||
// included in selected and deselected. Thus, this signal might
|
// Items which stay selected but change their index are not
|
||||||
// be emitted with both selected and deselected empty, if only
|
// included in selected and deselected. Thus, this signal might
|
||||||
// the indices of selected items change.
|
// be emitted with both selected and deselected empty, if only
|
||||||
return;
|
// the indices of selected items change.
|
||||||
}
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
ui->buttonBox->button(QDialogButtonBox::Ok)
|
ui->buttonBox->button(QDialogButtonBox::Ok)
|
||||||
->setEnabled(selected.size() > 0);
|
->setEnabled(selected.size() > 0);
|
||||||
|
|
||||||
if (selected.size() > 0)
|
if (selected.size() > 0)
|
||||||
{
|
{
|
||||||
QModelIndex selectedIndex =
|
QModelIndex selectedIndex =
|
||||||
p->proxyModel_->mapToSource(selected[0].indexes()[0]);
|
p->proxyModel_->mapToSource(selected[0].indexes()[0]);
|
||||||
QVariant variantData = p->radarSiteModel_->data(selectedIndex);
|
QVariant variantData = p->radarSiteModel_->data(selectedIndex);
|
||||||
if (variantData.typeId() == QMetaType::QString)
|
if (variantData.typeId() == QMetaType::QString)
|
||||||
{
|
{
|
||||||
p->selectedRadarSite_ =
|
p->selectedRadarSite_ = variantData.toString().toStdString();
|
||||||
variantData.toString().toStdString();
|
}
|
||||||
}
|
else
|
||||||
else
|
{
|
||||||
{
|
logger_->warn("Unexpected selection data type");
|
||||||
logger_->warn("Unexpected selection data type");
|
p->selectedRadarSite_ = std::string {"?"};
|
||||||
p->selectedRadarSite_ = "?";
|
}
|
||||||
}
|
}
|
||||||
}
|
else
|
||||||
else
|
{
|
||||||
{
|
p->selectedRadarSite_ = std::string {"?"};
|
||||||
p->selectedRadarSite_ = "?";
|
}
|
||||||
}
|
|
||||||
|
|
||||||
logger_->debug("Selected: {}", p->selectedRadarSite_);
|
logger_->debug("Selected: {}", p->selectedRadarSite_);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
RadarSiteDialog::~RadarSiteDialog()
|
RadarSiteDialog::~RadarSiteDialog()
|
||||||
|
|
|
||||||
|
|
@ -514,11 +514,13 @@ void SettingsDialogImpl::SetupPalettesAlertsTab()
|
||||||
QObject::connect(activeButton,
|
QObject::connect(activeButton,
|
||||||
&QAbstractButton::clicked,
|
&QAbstractButton::clicked,
|
||||||
self_,
|
self_,
|
||||||
[=]() { ShowColorDialog(activeEdit, activeFrame); });
|
[=, this]()
|
||||||
|
{ ShowColorDialog(activeEdit, activeFrame); });
|
||||||
QObject::connect(inactiveButton,
|
QObject::connect(inactiveButton,
|
||||||
&QAbstractButton::clicked,
|
&QAbstractButton::clicked,
|
||||||
self_,
|
self_,
|
||||||
[=]() { ShowColorDialog(inactiveEdit, inactiveFrame); });
|
[=, this]()
|
||||||
|
{ ShowColorDialog(inactiveEdit, inactiveFrame); });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -292,7 +292,7 @@ void Level2ProductViewImpl::SetProduct(common::Level2Product product)
|
||||||
|
|
||||||
void Level2ProductView::Update()
|
void Level2ProductView::Update()
|
||||||
{
|
{
|
||||||
util::async([=]() { ComputeSweep(); });
|
util::async([this]() { ComputeSweep(); });
|
||||||
}
|
}
|
||||||
|
|
||||||
void Level2ProductView::UpdateColorTable()
|
void Level2ProductView::UpdateColorTable()
|
||||||
|
|
|
||||||
|
|
@ -163,7 +163,7 @@ void Level3ProductView::LoadColorTable(
|
||||||
|
|
||||||
void Level3ProductView::Update()
|
void Level3ProductView::Update()
|
||||||
{
|
{
|
||||||
util::async([=]() { ComputeSweep(); });
|
util::async([this]() { ComputeSweep(); });
|
||||||
}
|
}
|
||||||
|
|
||||||
void Level3ProductView::UpdateColorTable()
|
void Level3ProductView::UpdateColorTable()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue