mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 22:40:05 +00:00
Alert dialog initial commit
This commit is contained in:
parent
612874f830
commit
b24acb7642
10 changed files with 352 additions and 5 deletions
1
scwx-qt/res/icons/font-awesome-6/angle-left-solid.svg
Normal file
1
scwx-qt/res/icons/font-awesome-6/angle-left-solid.svg
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="angle-left" class="svg-inline--fa fa-angle-left" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 512"><path fill="currentColor" d="M192 448c-8.188 0-16.38-3.125-22.62-9.375l-160-160c-12.5-12.5-12.5-32.75 0-45.25l160-160c12.5-12.5 32.75-12.5 45.25 0s12.5 32.75 0 45.25L77.25 256l137.4 137.4c12.5 12.5 12.5 32.75 0 45.25C208.4 444.9 200.2 448 192 448z"></path></svg>
|
||||||
|
After Width: | Height: | Size: 450 B |
1
scwx-qt/res/icons/font-awesome-6/angle-right-solid.svg
Normal file
1
scwx-qt/res/icons/font-awesome-6/angle-right-solid.svg
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="angle-right" class="svg-inline--fa fa-angle-right" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 512"><path fill="currentColor" d="M64 448c-8.188 0-16.38-3.125-22.62-9.375c-12.5-12.5-12.5-32.75 0-45.25L178.8 256L41.38 118.6c-12.5-12.5-12.5-32.75 0-45.25s32.75-12.5 45.25 0l160 160c12.5 12.5 12.5 32.75 0 45.25l-160 160C80.38 444.9 72.19 448 64 448z"></path></svg>
|
||||||
|
After Width: | Height: | Size: 451 B |
1
scwx-qt/res/icons/font-awesome-6/backward-step-solid.svg
Normal file
1
scwx-qt/res/icons/font-awesome-6/backward-step-solid.svg
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="backward-step" class="svg-inline--fa fa-backward-step" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><path fill="currentColor" d="M31.1 64.03c-17.67 0-31.1 14.33-31.1 32v319.9c0 17.67 14.33 32 32 32C49.67 447.1 64 433.6 64 415.1V96.03C64 78.36 49.67 64.03 31.1 64.03zM267.5 71.41l-192 159.1C67.82 237.8 64 246.9 64 256c0 9.094 3.82 18.18 11.44 24.62l192 159.1c20.63 17.12 52.51 2.75 52.51-24.62v-319.9C319.1 68.66 288.1 54.28 267.5 71.41z"></path></svg>
|
||||||
|
After Width: | Height: | Size: 546 B |
1
scwx-qt/res/icons/font-awesome-6/forward-step-solid.svg
Normal file
1
scwx-qt/res/icons/font-awesome-6/forward-step-solid.svg
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="forward-step" class="svg-inline--fa fa-forward-step" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><path fill="currentColor" d="M287.1 447.1c17.67 0 31.1-14.33 31.1-32V96.03c0-17.67-14.33-32-32-32c-17.67 0-31.1 14.33-31.1 31.1v319.9C255.1 433.6 270.3 447.1 287.1 447.1zM52.51 440.6l192-159.1c7.625-6.436 11.43-15.53 11.43-24.62c0-9.094-3.809-18.18-11.43-24.62l-192-159.1C31.88 54.28 0 68.66 0 96.03v319.9C0 443.3 31.88 457.7 52.51 440.6z"></path></svg>
|
||||||
|
After Width: | Height: | Size: 545 B |
|
|
@ -106,19 +106,22 @@ set(HDR_TYPES source/scwx/qt/types/qt_types.hpp
|
||||||
source/scwx/qt/types/text_event_key.hpp)
|
source/scwx/qt/types/text_event_key.hpp)
|
||||||
set(SRC_TYPES source/scwx/qt/types/radar_product_record.cpp
|
set(SRC_TYPES source/scwx/qt/types/radar_product_record.cpp
|
||||||
source/scwx/qt/types/text_event_key.cpp)
|
source/scwx/qt/types/text_event_key.cpp)
|
||||||
set(HDR_UI source/scwx/qt/ui/alert_dock_widget.hpp
|
set(HDR_UI source/scwx/qt/ui/alert_dialog.hpp
|
||||||
|
source/scwx/qt/ui/alert_dock_widget.hpp
|
||||||
source/scwx/qt/ui/flow_layout.hpp
|
source/scwx/qt/ui/flow_layout.hpp
|
||||||
source/scwx/qt/ui/level2_products_widget.hpp
|
source/scwx/qt/ui/level2_products_widget.hpp
|
||||||
source/scwx/qt/ui/level2_settings_widget.hpp
|
source/scwx/qt/ui/level2_settings_widget.hpp
|
||||||
source/scwx/qt/ui/level3_products_widget.hpp
|
source/scwx/qt/ui/level3_products_widget.hpp
|
||||||
source/scwx/qt/ui/radar_site_dialog.hpp)
|
source/scwx/qt/ui/radar_site_dialog.hpp)
|
||||||
set(SRC_UI source/scwx/qt/ui/alert_dock_widget.cpp
|
set(SRC_UI source/scwx/qt/ui/alert_dialog.cpp
|
||||||
|
source/scwx/qt/ui/alert_dock_widget.cpp
|
||||||
source/scwx/qt/ui/flow_layout.cpp
|
source/scwx/qt/ui/flow_layout.cpp
|
||||||
source/scwx/qt/ui/level2_products_widget.cpp
|
source/scwx/qt/ui/level2_products_widget.cpp
|
||||||
source/scwx/qt/ui/level2_settings_widget.cpp
|
source/scwx/qt/ui/level2_settings_widget.cpp
|
||||||
source/scwx/qt/ui/level3_products_widget.cpp
|
source/scwx/qt/ui/level3_products_widget.cpp
|
||||||
source/scwx/qt/ui/radar_site_dialog.cpp)
|
source/scwx/qt/ui/radar_site_dialog.cpp)
|
||||||
set(UI_UI source/scwx/qt/ui/alert_dock_widget.ui
|
set(UI_UI source/scwx/qt/ui/alert_dialog.ui
|
||||||
|
source/scwx/qt/ui/alert_dock_widget.ui
|
||||||
source/scwx/qt/ui/radar_site_dialog.ui)
|
source/scwx/qt/ui/radar_site_dialog.ui)
|
||||||
set(HDR_UTIL source/scwx/qt/util/font.hpp
|
set(HDR_UTIL source/scwx/qt/util/font.hpp
|
||||||
source/scwx/qt/util/font_buffer.hpp
|
source/scwx/qt/util/font_buffer.hpp
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,10 @@
|
||||||
<file>res/config/radar_sites.json</file>
|
<file>res/config/radar_sites.json</file>
|
||||||
<file>res/fonts/din1451alt.ttf</file>
|
<file>res/fonts/din1451alt.ttf</file>
|
||||||
<file>res/fonts/din1451alt_g.ttf</file>
|
<file>res/fonts/din1451alt_g.ttf</file>
|
||||||
|
<file>res/icons/font-awesome-6/angle-left-solid.svg</file>
|
||||||
|
<file>res/icons/font-awesome-6/angle-right-solid.svg</file>
|
||||||
|
<file>res/icons/font-awesome-6/backward-step-solid.svg</file>
|
||||||
|
<file>res/icons/font-awesome-6/forward-step-solid.svg</file>
|
||||||
<file>res/icons/font-awesome-6/sliders-solid.svg</file>
|
<file>res/icons/font-awesome-6/sliders-solid.svg</file>
|
||||||
<file>res/icons/font-awesome-6/square-minus-regular.svg</file>
|
<file>res/icons/font-awesome-6/square-minus-regular.svg</file>
|
||||||
<file>res/icons/font-awesome-6/square-plus-regular.svg</file>
|
<file>res/icons/font-awesome-6/square-plus-regular.svg</file>
|
||||||
|
|
|
||||||
110
scwx-qt/source/scwx/qt/ui/alert_dialog.cpp
Normal file
110
scwx-qt/source/scwx/qt/ui/alert_dialog.cpp
Normal file
|
|
@ -0,0 +1,110 @@
|
||||||
|
#include "alert_dialog.hpp"
|
||||||
|
#include "ui_alert_dialog.h"
|
||||||
|
|
||||||
|
#include <scwx/qt/manager/text_event_manager.hpp>
|
||||||
|
#include <scwx/util/logger.hpp>
|
||||||
|
|
||||||
|
namespace scwx
|
||||||
|
{
|
||||||
|
namespace qt
|
||||||
|
{
|
||||||
|
namespace ui
|
||||||
|
{
|
||||||
|
|
||||||
|
static const std::string logPrefix_ = "scwx::qt::ui::alert_dialog";
|
||||||
|
static const auto logger_ = scwx::util::Logger::Create(logPrefix_);
|
||||||
|
|
||||||
|
class AlertDialogImpl
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
explicit AlertDialogImpl(AlertDialog* self) :
|
||||||
|
self_ {self}, key_ {}, coordinate_ {}, currentIndex_ {0u}
|
||||||
|
{
|
||||||
|
}
|
||||||
|
~AlertDialogImpl() = default;
|
||||||
|
|
||||||
|
void ConnectSignals();
|
||||||
|
void SelectIndex(size_t newIndex);
|
||||||
|
|
||||||
|
AlertDialog* self_;
|
||||||
|
types::TextEventKey key_;
|
||||||
|
common::Coordinate coordinate_;
|
||||||
|
size_t currentIndex_;
|
||||||
|
};
|
||||||
|
|
||||||
|
AlertDialog::AlertDialog(QWidget* parent) :
|
||||||
|
QDialog(parent),
|
||||||
|
p {std::make_unique<AlertDialogImpl>(this)},
|
||||||
|
ui(new Ui::AlertDialog)
|
||||||
|
{
|
||||||
|
ui->setupUi(this);
|
||||||
|
|
||||||
|
// Set monospace font for alert view
|
||||||
|
QFont monospaceFont("?");
|
||||||
|
monospaceFont.setStyleHint(QFont::TypeWriter);
|
||||||
|
ui->alertText->setFont(monospaceFont);
|
||||||
|
|
||||||
|
// Add Go button to button box
|
||||||
|
ui->buttonBox->addButton("&Go", QDialogButtonBox::ActionRole);
|
||||||
|
|
||||||
|
p->ConnectSignals();
|
||||||
|
}
|
||||||
|
|
||||||
|
AlertDialog::~AlertDialog()
|
||||||
|
{
|
||||||
|
delete ui;
|
||||||
|
}
|
||||||
|
|
||||||
|
void AlertDialogImpl::ConnectSignals() {}
|
||||||
|
|
||||||
|
bool AlertDialog::SelectAlert(const types::TextEventKey& key,
|
||||||
|
const common::Coordinate& coordinate)
|
||||||
|
{
|
||||||
|
p->key_ = key;
|
||||||
|
p->coordinate_ = coordinate;
|
||||||
|
|
||||||
|
setWindowTitle(QString::fromStdString(key.ToFullString()));
|
||||||
|
|
||||||
|
auto messages = manager::TextEventManager::Instance().message_list(key);
|
||||||
|
if (messages.empty())
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
p->SelectIndex(messages.size() - 1);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void AlertDialogImpl::SelectIndex(size_t newIndex)
|
||||||
|
{
|
||||||
|
size_t messageCount =
|
||||||
|
manager::TextEventManager::Instance().message_count(key_);
|
||||||
|
|
||||||
|
if (newIndex >= messageCount)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
auto messages = manager::TextEventManager::Instance().message_list(key_);
|
||||||
|
|
||||||
|
currentIndex_ = newIndex;
|
||||||
|
|
||||||
|
self_->ui->alertText->setText(
|
||||||
|
QString::fromStdString(messages[currentIndex_]->message_content()));
|
||||||
|
self_->ui->messageCountLabel->setText(
|
||||||
|
QObject::tr("%1 of %2").arg(currentIndex_ + 1).arg(messageCount));
|
||||||
|
|
||||||
|
bool firstSelected = (currentIndex_ == 0);
|
||||||
|
bool lastSelected = (currentIndex_ == messages.size() - 1);
|
||||||
|
|
||||||
|
self_->ui->firstButton->setEnabled(!firstSelected);
|
||||||
|
self_->ui->previousButton->setEnabled(!firstSelected);
|
||||||
|
|
||||||
|
self_->ui->nextButton->setEnabled(!lastSelected);
|
||||||
|
self_->ui->lastButton->setEnabled(!lastSelected);
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace ui
|
||||||
|
} // namespace qt
|
||||||
|
} // namespace scwx
|
||||||
44
scwx-qt/source/scwx/qt/ui/alert_dialog.hpp
Normal file
44
scwx-qt/source/scwx/qt/ui/alert_dialog.hpp
Normal file
|
|
@ -0,0 +1,44 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <QDialog>
|
||||||
|
|
||||||
|
#include <scwx/qt/types/text_event_key.hpp>
|
||||||
|
#include <scwx/common/geographic.hpp>
|
||||||
|
|
||||||
|
namespace Ui
|
||||||
|
{
|
||||||
|
class AlertDialog;
|
||||||
|
}
|
||||||
|
|
||||||
|
namespace scwx
|
||||||
|
{
|
||||||
|
namespace qt
|
||||||
|
{
|
||||||
|
namespace ui
|
||||||
|
{
|
||||||
|
|
||||||
|
class AlertDialogImpl;
|
||||||
|
|
||||||
|
class AlertDialog : public QDialog
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit AlertDialog(QWidget* parent = nullptr);
|
||||||
|
~AlertDialog();
|
||||||
|
|
||||||
|
bool SelectAlert(const types::TextEventKey& key,
|
||||||
|
const common::Coordinate& coordinate);
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void MoveMap(double latitude, double longitude);
|
||||||
|
|
||||||
|
private:
|
||||||
|
friend class AlertDialogImpl;
|
||||||
|
std::unique_ptr<AlertDialogImpl> p;
|
||||||
|
Ui::AlertDialog* ui;
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace ui
|
||||||
|
} // namespace qt
|
||||||
|
} // namespace scwx
|
||||||
173
scwx-qt/source/scwx/qt/ui/alert_dialog.ui
Normal file
173
scwx-qt/source/scwx/qt/ui/alert_dialog.ui
Normal file
|
|
@ -0,0 +1,173 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>AlertDialog</class>
|
||||||
|
<widget class="QDialog" name="AlertDialog">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>540</width>
|
||||||
|
<height>600</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>Dialog</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="QTextBrowser" name="alertText">
|
||||||
|
<property name="lineWrapMode">
|
||||||
|
<enum>QTextEdit::NoWrap</enum>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QFrame" name="frame">
|
||||||
|
<property name="frameShape">
|
||||||
|
<enum>QFrame::StyledPanel</enum>
|
||||||
|
</property>
|
||||||
|
<property name="frameShadow">
|
||||||
|
<enum>QFrame::Raised</enum>
|
||||||
|
</property>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
|
<property name="leftMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<widget class="QToolButton" name="firstButton">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>First</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>...</string>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="../../../../scwx-qt.qrc">
|
||||||
|
<normaloff>:/res/icons/font-awesome-6/backward-step-solid.svg</normaloff>:/res/icons/font-awesome-6/backward-step-solid.svg</iconset>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QToolButton" name="previousButton">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Previous</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>...</string>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="../../../../scwx-qt.qrc">
|
||||||
|
<normaloff>:/res/icons/font-awesome-6/angle-left-solid.svg</normaloff>:/res/icons/font-awesome-6/angle-left-solid.svg</iconset>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QToolButton" name="nextButton">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Next</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>...</string>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="../../../../scwx-qt.qrc">
|
||||||
|
<normaloff>:/res/icons/font-awesome-6/angle-right-solid.svg</normaloff>:/res/icons/font-awesome-6/angle-right-solid.svg</iconset>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QToolButton" name="lastButton">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Last</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>...</string>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="../../../../scwx-qt.qrc">
|
||||||
|
<normaloff>:/res/icons/font-awesome-6/forward-step-solid.svg</normaloff>:/res/icons/font-awesome-6/forward-step-solid.svg</iconset>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="messageCountLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string># of #</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="horizontalSpacer">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>40</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QDialogButtonBox" name="buttonBox">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="standardButtons">
|
||||||
|
<set>QDialogButtonBox::Close</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<resources>
|
||||||
|
<include location="../../../../scwx-qt.qrc"/>
|
||||||
|
</resources>
|
||||||
|
<connections>
|
||||||
|
<connection>
|
||||||
|
<sender>buttonBox</sender>
|
||||||
|
<signal>accepted()</signal>
|
||||||
|
<receiver>AlertDialog</receiver>
|
||||||
|
<slot>accept()</slot>
|
||||||
|
<hints>
|
||||||
|
<hint type="sourcelabel">
|
||||||
|
<x>248</x>
|
||||||
|
<y>254</y>
|
||||||
|
</hint>
|
||||||
|
<hint type="destinationlabel">
|
||||||
|
<x>157</x>
|
||||||
|
<y>274</y>
|
||||||
|
</hint>
|
||||||
|
</hints>
|
||||||
|
</connection>
|
||||||
|
<connection>
|
||||||
|
<sender>buttonBox</sender>
|
||||||
|
<signal>rejected()</signal>
|
||||||
|
<receiver>AlertDialog</receiver>
|
||||||
|
<slot>reject()</slot>
|
||||||
|
<hints>
|
||||||
|
<hint type="sourcelabel">
|
||||||
|
<x>316</x>
|
||||||
|
<y>260</y>
|
||||||
|
</hint>
|
||||||
|
<hint type="destinationlabel">
|
||||||
|
<x>286</x>
|
||||||
|
<y>274</y>
|
||||||
|
</hint>
|
||||||
|
</hints>
|
||||||
|
</connection>
|
||||||
|
</connections>
|
||||||
|
</ui>
|
||||||
|
|
@ -4,6 +4,7 @@
|
||||||
#include <scwx/qt/manager/text_event_manager.hpp>
|
#include <scwx/qt/manager/text_event_manager.hpp>
|
||||||
#include <scwx/qt/model/alert_model.hpp>
|
#include <scwx/qt/model/alert_model.hpp>
|
||||||
#include <scwx/qt/types/qt_types.hpp>
|
#include <scwx/qt/types/qt_types.hpp>
|
||||||
|
#include <scwx/qt/ui/alert_dialog.hpp>
|
||||||
#include <scwx/util/logger.hpp>
|
#include <scwx/util/logger.hpp>
|
||||||
|
|
||||||
#include <QSortFilterProxyModel>
|
#include <QSortFilterProxyModel>
|
||||||
|
|
@ -26,6 +27,7 @@ public:
|
||||||
self_ {self},
|
self_ {self},
|
||||||
alertModel_ {std::make_unique<model::AlertModel>()},
|
alertModel_ {std::make_unique<model::AlertModel>()},
|
||||||
proxyModel_ {std::make_unique<QSortFilterProxyModel>()},
|
proxyModel_ {std::make_unique<QSortFilterProxyModel>()},
|
||||||
|
alertDialog_ {new AlertDialog(self)},
|
||||||
mapPosition_ {},
|
mapPosition_ {},
|
||||||
mapUpdateDeferred_ {false},
|
mapUpdateDeferred_ {false},
|
||||||
selectedAlertKey_ {},
|
selectedAlertKey_ {},
|
||||||
|
|
@ -44,6 +46,8 @@ public:
|
||||||
std::unique_ptr<model::AlertModel> alertModel_;
|
std::unique_ptr<model::AlertModel> alertModel_;
|
||||||
std::unique_ptr<QSortFilterProxyModel> proxyModel_;
|
std::unique_ptr<QSortFilterProxyModel> proxyModel_;
|
||||||
|
|
||||||
|
AlertDialog* alertDialog_;
|
||||||
|
|
||||||
scwx::common::Coordinate mapPosition_;
|
scwx::common::Coordinate mapPosition_;
|
||||||
bool mapUpdateDeferred_;
|
bool mapUpdateDeferred_;
|
||||||
|
|
||||||
|
|
@ -151,9 +155,12 @@ void AlertDockWidgetImpl::ConnectSignals()
|
||||||
connect(self_->ui->alertViewButton,
|
connect(self_->ui->alertViewButton,
|
||||||
&QPushButton::clicked,
|
&QPushButton::clicked,
|
||||||
this,
|
this,
|
||||||
[]()
|
[=]()
|
||||||
{
|
{
|
||||||
// TODO: View alert
|
// View alert
|
||||||
|
alertDialog_->SelectAlert(selectedAlertKey_,
|
||||||
|
selectedAlertCentroid_);
|
||||||
|
alertDialog_->show();
|
||||||
});
|
});
|
||||||
connect(self_->ui->alertGoButton,
|
connect(self_->ui->alertGoButton,
|
||||||
&QPushButton::clicked,
|
&QPushButton::clicked,
|
||||||
|
|
@ -163,6 +170,8 @@ void AlertDockWidgetImpl::ConnectSignals()
|
||||||
emit self_->MoveMap(selectedAlertCentroid_.latitude_,
|
emit self_->MoveMap(selectedAlertCentroid_.latitude_,
|
||||||
selectedAlertCentroid_.longitude_);
|
selectedAlertCentroid_.longitude_);
|
||||||
});
|
});
|
||||||
|
connect(
|
||||||
|
alertDialog_, &AlertDialog::MoveMap, self_, &AlertDockWidget::MoveMap);
|
||||||
}
|
}
|
||||||
|
|
||||||
#include "alert_dock_widget.moc"
|
#include "alert_dock_widget.moc"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue