mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 23:20:05 +00:00
Add dedicated Placefile Manager dialog separate from settings
This commit is contained in:
parent
4a92f11d00
commit
f2addd29e6
11 changed files with 215 additions and 41 deletions
|
|
@ -25,6 +25,7 @@
|
|||
#include <scwx/qt/ui/level2_products_widget.hpp>
|
||||
#include <scwx/qt/ui/level2_settings_widget.hpp>
|
||||
#include <scwx/qt/ui/level3_products_widget.hpp>
|
||||
#include <scwx/qt/ui/placefile_dialog.hpp>
|
||||
#include <scwx/qt/ui/radar_site_dialog.hpp>
|
||||
#include <scwx/qt/ui/settings_dialog.hpp>
|
||||
#include <scwx/qt/ui/update_dialog.hpp>
|
||||
|
|
@ -77,6 +78,7 @@ public:
|
|||
animationDockWidget_ {nullptr},
|
||||
aboutDialog_ {nullptr},
|
||||
imGuiDebugDialog_ {nullptr},
|
||||
placefileDialog_ {nullptr},
|
||||
radarSiteDialog_ {nullptr},
|
||||
settingsDialog_ {nullptr},
|
||||
updateDialog_ {nullptr},
|
||||
|
|
@ -165,6 +167,7 @@ public:
|
|||
ui::AnimationDockWidget* animationDockWidget_;
|
||||
ui::AboutDialog* aboutDialog_;
|
||||
ui::ImGuiDebugDialog* imGuiDebugDialog_;
|
||||
ui::PlacefileDialog* placefileDialog_;
|
||||
ui::RadarSiteDialog* radarSiteDialog_;
|
||||
ui::SettingsDialog* settingsDialog_;
|
||||
ui::UpdateDialog* updateDialog_;
|
||||
|
|
@ -243,6 +246,9 @@ MainWindow::MainWindow(QWidget* parent) :
|
|||
// Radar Site Dialog
|
||||
p->radarSiteDialog_ = new ui::RadarSiteDialog(this);
|
||||
|
||||
// Placefile Manager Dialog
|
||||
p->placefileDialog_ = new ui::PlacefileDialog(this);
|
||||
|
||||
// Settings Dialog
|
||||
p->settingsDialog_ = new ui::SettingsDialog(this);
|
||||
|
||||
|
|
@ -443,6 +449,11 @@ void MainWindow::on_actionExit_triggered()
|
|||
close();
|
||||
}
|
||||
|
||||
void MainWindow::on_actionPlacefileManager_triggered()
|
||||
{
|
||||
p->placefileDialog_->show();
|
||||
}
|
||||
|
||||
void MainWindow::on_actionImGuiDebug_triggered()
|
||||
{
|
||||
p->imGuiDebugDialog_->show();
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@ private slots:
|
|||
void on_actionOpenTextEvent_triggered();
|
||||
void on_actionSettings_triggered();
|
||||
void on_actionExit_triggered();
|
||||
void on_actionPlacefileManager_triggered();
|
||||
void on_actionImGuiDebug_triggered();
|
||||
void on_actionDumpRadarProductRecords_triggered();
|
||||
void on_actionUserManual_triggered();
|
||||
|
|
|
|||
|
|
@ -87,8 +87,16 @@
|
|||
<addaction name="separator"/>
|
||||
<addaction name="actionDumpRadarProductRecords"/>
|
||||
</widget>
|
||||
<widget class="QMenu" name="menuTools">
|
||||
<property name="title">
|
||||
<string>&Tools</string>
|
||||
</property>
|
||||
<addaction name="actionPlacefileManager"/>
|
||||
<addaction name="actionLayerManager"/>
|
||||
</widget>
|
||||
<addaction name="menuFile"/>
|
||||
<addaction name="menuView"/>
|
||||
<addaction name="menuTools"/>
|
||||
<addaction name="menuDebug"/>
|
||||
<addaction name="menuHelp"/>
|
||||
</widget>
|
||||
|
|
@ -415,6 +423,24 @@
|
|||
<string>&Check for Updates</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionPlacefileManager">
|
||||
<property name="icon">
|
||||
<iconset resource="../../../../scwx-qt.qrc">
|
||||
<normaloff>:/res/icons/font-awesome-6/earth-americas-solid.svg</normaloff>:/res/icons/font-awesome-6/earth-americas-solid.svg</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Placefile Manager</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionLayerManager">
|
||||
<property name="icon">
|
||||
<iconset resource="../../../../scwx-qt.qrc">
|
||||
<normaloff>:/res/icons/font-awesome-6/layer-group-solid.svg</normaloff>:/res/icons/font-awesome-6/layer-group-solid.svg</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Layer Manager</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="../../../../scwx-qt.qrc"/>
|
||||
|
|
|
|||
45
scwx-qt/source/scwx/qt/ui/placefile_dialog.cpp
Normal file
45
scwx-qt/source/scwx/qt/ui/placefile_dialog.cpp
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
#include "placefile_dialog.hpp"
|
||||
#include "ui_placefile_dialog.h"
|
||||
|
||||
#include <scwx/qt/ui/placefile_settings_widget.hpp>
|
||||
#include <scwx/util/logger.hpp>
|
||||
|
||||
namespace scwx
|
||||
{
|
||||
namespace qt
|
||||
{
|
||||
namespace ui
|
||||
{
|
||||
|
||||
static const std::string logPrefix_ = "scwx::qt::ui::placefile_dialog";
|
||||
static const auto logger_ = scwx::util::Logger::Create(logPrefix_);
|
||||
|
||||
class PlacefileDialogImpl
|
||||
{
|
||||
public:
|
||||
explicit PlacefileDialogImpl() {}
|
||||
~PlacefileDialogImpl() = default;
|
||||
|
||||
PlacefileSettingsWidget* placefileSettingsWidget_ {nullptr};
|
||||
};
|
||||
|
||||
PlacefileDialog::PlacefileDialog(QWidget* parent) :
|
||||
QDialog(parent),
|
||||
p {std::make_unique<PlacefileDialogImpl>()},
|
||||
ui(new Ui::PlacefileDialog)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
p->placefileSettingsWidget_ = new PlacefileSettingsWidget(this);
|
||||
p->placefileSettingsWidget_->layout()->setContentsMargins(0, 0, 0, 0);
|
||||
ui->contentsFrame->layout()->addWidget(p->placefileSettingsWidget_);
|
||||
}
|
||||
|
||||
PlacefileDialog::~PlacefileDialog()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
} // namespace ui
|
||||
} // namespace qt
|
||||
} // namespace scwx
|
||||
35
scwx-qt/source/scwx/qt/ui/placefile_dialog.hpp
Normal file
35
scwx-qt/source/scwx/qt/ui/placefile_dialog.hpp
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
#pragma once
|
||||
|
||||
#include <QDialog>
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
class PlacefileDialog;
|
||||
}
|
||||
|
||||
namespace scwx
|
||||
{
|
||||
namespace qt
|
||||
{
|
||||
namespace ui
|
||||
{
|
||||
|
||||
class PlacefileDialogImpl;
|
||||
|
||||
class PlacefileDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit PlacefileDialog(QWidget* parent = nullptr);
|
||||
~PlacefileDialog();
|
||||
|
||||
private:
|
||||
friend class PlacefileDialogImpl;
|
||||
std::unique_ptr<PlacefileDialogImpl> p;
|
||||
Ui::PlacefileDialog* ui;
|
||||
};
|
||||
|
||||
} // namespace ui
|
||||
} // namespace qt
|
||||
} // namespace scwx
|
||||
88
scwx-qt/source/scwx/qt/ui/placefile_dialog.ui
Normal file
88
scwx-qt/source/scwx/qt/ui/placefile_dialog.ui
Normal file
|
|
@ -0,0 +1,88 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>PlacefileDialog</class>
|
||||
<widget class="QDialog" name="PlacefileDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>700</width>
|
||||
<height>600</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Placefile Manager</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QFrame" name="contentsFrame">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<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>
|
||||
</layout>
|
||||
</widget>
|
||||
</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>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>accepted()</signal>
|
||||
<receiver>PlacefileDialog</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>PlacefileDialog</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>
|
||||
|
|
@ -13,7 +13,6 @@
|
|||
#include <scwx/qt/types/alert_types.hpp>
|
||||
#include <scwx/qt/types/font_types.hpp>
|
||||
#include <scwx/qt/types/text_types.hpp>
|
||||
#include <scwx/qt/ui/placefile_settings_widget.hpp>
|
||||
#include <scwx/qt/ui/radar_site_dialog.hpp>
|
||||
#include <scwx/qt/util/color.hpp>
|
||||
#include <scwx/qt/util/file.hpp>
|
||||
|
|
@ -135,7 +134,6 @@ public:
|
|||
void SetupGeneralTab();
|
||||
void SetupPalettesColorTablesTab();
|
||||
void SetupPalettesAlertsTab();
|
||||
void SetupPlacefilesTab();
|
||||
void SetupTextTab();
|
||||
|
||||
void ShowColorDialog(QLineEdit* lineEdit, QFrame* frame = nullptr);
|
||||
|
|
@ -162,10 +160,9 @@ public:
|
|||
RadarSiteLabel(std::shared_ptr<config::RadarSite>& radarSite);
|
||||
static void SetBackgroundColor(const std::string& value, QFrame* frame);
|
||||
|
||||
SettingsDialog* self_;
|
||||
PlacefileSettingsWidget* placefileSettingsWidget_ {nullptr};
|
||||
RadarSiteDialog* radarSiteDialog_;
|
||||
QFontDialog* fontDialog_;
|
||||
SettingsDialog* self_;
|
||||
RadarSiteDialog* radarSiteDialog_;
|
||||
QFontDialog* fontDialog_;
|
||||
|
||||
QStandardItemModel* fontCategoryModel_;
|
||||
|
||||
|
|
@ -226,9 +223,6 @@ SettingsDialog::SettingsDialog(QWidget* parent) :
|
|||
// Text
|
||||
p->SetupTextTab();
|
||||
|
||||
// Placefiles
|
||||
p->SetupPlacefilesTab();
|
||||
|
||||
p->ConnectSignals();
|
||||
}
|
||||
|
||||
|
|
@ -735,12 +729,6 @@ void SettingsDialogImpl::SetupPalettesAlertsTab()
|
|||
}
|
||||
}
|
||||
|
||||
void SettingsDialogImpl::SetupPlacefilesTab()
|
||||
{
|
||||
placefileSettingsWidget_ = new PlacefileSettingsWidget(self_);
|
||||
self_->ui->placefiles->layout()->addWidget(placefileSettingsWidget_);
|
||||
}
|
||||
|
||||
void SettingsDialogImpl::SetupTextTab()
|
||||
{
|
||||
settings::TextSettings& textSettings = settings::TextSettings::Instance();
|
||||
|
|
|
|||
|
|
@ -82,15 +82,6 @@
|
|||
<normaloff>:/res/icons/font-awesome-6/font-solid.svg</normaloff>:/res/icons/font-awesome-6/font-solid.svg</iconset>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Placefiles</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../../../scwx-qt.qrc">
|
||||
<normaloff>:/res/icons/font-awesome-6/earth-americas-solid.svg</normaloff>:/res/icons/font-awesome-6/earth-americas-solid.svg</iconset>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
|
|
@ -350,7 +341,7 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>481</width>
|
||||
<width>512</width>
|
||||
<height>382</height>
|
||||
</rect>
|
||||
</property>
|
||||
|
|
@ -704,22 +695,6 @@
|
|||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="placefiles">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||
<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>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue