diff --git a/scwx-qt/source/scwx/qt/main/main_window.cpp b/scwx-qt/source/scwx/qt/main/main_window.cpp index c72db8a0..5befa67d 100644 --- a/scwx-qt/source/scwx/qt/main/main_window.cpp +++ b/scwx-qt/source/scwx/qt/main/main_window.cpp @@ -401,28 +401,6 @@ void MainWindow::on_actionOpenNexrad_triggered() dialog->open(); } -void MainWindow::on_actionOpenPlacefile_triggered() -{ - static const std::string placefileFilter = "Placefiles (*)"; - - QFileDialog* dialog = new QFileDialog(this); - - dialog->setFileMode(QFileDialog::ExistingFile); - dialog->setNameFilter(tr(placefileFilter.c_str())); - dialog->setAttribute(Qt::WA_DeleteOnClose); - - connect(dialog, - &QFileDialog::fileSelected, - this, - [this](const QString& file) - { - logger_->info("Selected: {}", file.toStdString()); - p->placefileManager_->LoadFile(file.toStdString()); - }); - - dialog->open(); -} - void MainWindow::on_actionOpenTextEvent_triggered() { static const std::string textFilter = "Text Event Products (*.txt)"; diff --git a/scwx-qt/source/scwx/qt/main/main_window.hpp b/scwx-qt/source/scwx/qt/main/main_window.hpp index 3261355e..6ed96aba 100644 --- a/scwx-qt/source/scwx/qt/main/main_window.hpp +++ b/scwx-qt/source/scwx/qt/main/main_window.hpp @@ -33,7 +33,6 @@ signals: private slots: void on_actionOpenNexrad_triggered(); - void on_actionOpenPlacefile_triggered(); void on_actionOpenTextEvent_triggered(); void on_actionSettings_triggered(); void on_actionExit_triggered(); diff --git a/scwx-qt/source/scwx/qt/main/main_window.ui b/scwx-qt/source/scwx/qt/main/main_window.ui index 8cf8ce5b..369c8d28 100644 --- a/scwx-qt/source/scwx/qt/main/main_window.ui +++ b/scwx-qt/source/scwx/qt/main/main_window.ui @@ -51,7 +51,6 @@ &Open - @@ -416,11 +415,6 @@ &Check for Updates - - - &Placefile... - - diff --git a/scwx-qt/source/scwx/qt/manager/placefile_manager.cpp b/scwx-qt/source/scwx/qt/manager/placefile_manager.cpp index 2a2dcd16..16aefcdd 100644 --- a/scwx-qt/source/scwx/qt/manager/placefile_manager.cpp +++ b/scwx-qt/source/scwx/qt/manager/placefile_manager.cpp @@ -99,7 +99,6 @@ public: void ScheduleRefresh(); void Update(); void UpdateAsync(); - void UpdatePlacefile(const std::shared_ptr& placefile); friend void tag_invoke(boost::json::value_from_tag, boost::json::value& jv, @@ -472,55 +471,6 @@ void PlacefileManager::AddUrl(const std::string& urlString, } } -void PlacefileManager::LoadFile(const std::string& filename) -{ - const std::string placefileName = - QDir::toNativeSeparators(QString::fromStdString(filename)).toStdString(); - - logger_->debug("LoadFile: {}", placefileName); - - boost::asio::post( - p->threadPool_, - [placefileName, this]() - { - // Load file - std::shared_ptr placefile = - gr::Placefile::Load(placefileName); - - if (placefile == nullptr) - { - return; - } - - std::unique_lock lock(p->placefileRecordLock_); - - // Determine if the placefile has been loaded previously - auto it = p->placefileRecordMap_.find(placefileName); - if (it != p->placefileRecordMap_.end()) - { - // If the placefile has been loaded previously, update it - it->second->UpdatePlacefile(placefile); - - lock.unlock(); - - Q_EMIT PlacefileUpdated(placefileName); - } - else - { - // If this is a new placefile, add it - auto& record = p->placefileRecords_.emplace_back( - std::make_shared( - p.get(), placefileName, placefile, placefile->title(), true)); - p->placefileRecordMap_.insert_or_assign(placefileName, record); - - lock.unlock(); - - Q_EMIT PlacefileEnabled(placefileName, record->enabled_); - Q_EMIT PlacefileUpdated(placefileName); - } - }); -} - void PlacefileManager::RemoveUrl(const std::string& urlString) { std::unique_lock lock(p->placefileRecordLock_); @@ -715,16 +665,6 @@ void PlacefileManager::Impl::PlacefileRecord::UpdateAsync() boost::asio::post(threadPool_, [this]() { Update(); }); } -void PlacefileManager::Impl::PlacefileRecord::UpdatePlacefile( - const std::shared_ptr& placefile) -{ - // Update placefile - placefile_ = placefile; - - // Update refresh timer - ScheduleRefresh(); -} - std::shared_ptr PlacefileManager::Instance() { static std::weak_ptr placefileManagerReference_ {}; diff --git a/scwx-qt/source/scwx/qt/manager/placefile_manager.hpp b/scwx-qt/source/scwx/qt/manager/placefile_manager.hpp index 498ea9a1..0567265f 100644 --- a/scwx-qt/source/scwx/qt/manager/placefile_manager.hpp +++ b/scwx-qt/source/scwx/qt/manager/placefile_manager.hpp @@ -42,7 +42,6 @@ public: const std::string& title = {}, bool enabled = false, bool thresholded = false); - void LoadFile(const std::string& filename); void RemoveUrl(const std::string& urlString); static std::shared_ptr Instance();