mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-31 11:40:06 +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
				
			
		
							
								
								
									
										1
									
								
								scwx-qt/res/icons/font-awesome-6/layer-group-solid.svg
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								scwx-qt/res/icons/font-awesome-6/layer-group-solid.svg
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1 @@ | |||
| <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512"><!--! Font Awesome Pro 6.4.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --><path d="M264.5 5.2c14.9-6.9 32.1-6.9 47 0l218.6 101c8.5 3.9 13.9 12.4 13.9 21.8s-5.4 17.9-13.9 21.8l-218.6 101c-14.9 6.9-32.1 6.9-47 0L45.9 149.8C37.4 145.8 32 137.3 32 128s5.4-17.9 13.9-21.8L264.5 5.2zM476.9 209.6l53.2 24.6c8.5 3.9 13.9 12.4 13.9 21.8s-5.4 17.9-13.9 21.8l-218.6 101c-14.9 6.9-32.1 6.9-47 0L45.9 277.8C37.4 273.8 32 265.3 32 256s5.4-17.9 13.9-21.8l53.2-24.6 152 70.2c23.4 10.8 50.4 10.8 73.8 0l152-70.2zm-152 198.2l152-70.2 53.2 24.6c8.5 3.9 13.9 12.4 13.9 21.8s-5.4 17.9-13.9 21.8l-218.6 101c-14.9 6.9-32.1 6.9-47 0L45.9 405.8C37.4 401.8 32 393.3 32 384s5.4-17.9 13.9-21.8l53.2-24.6 152 70.2c23.4 10.8 50.4 10.8 73.8 0z"/></svg> | ||||
| After Width: | Height: | Size: 877 B | 
|  | @ -186,6 +186,7 @@ set(HDR_UI source/scwx/qt/ui/about_dialog.hpp | |||
|            source/scwx/qt/ui/level2_settings_widget.hpp | ||||
|            source/scwx/qt/ui/level3_products_widget.hpp | ||||
|            source/scwx/qt/ui/open_url_dialog.hpp | ||||
|            source/scwx/qt/ui/placefile_dialog.hpp | ||||
|            source/scwx/qt/ui/placefile_settings_widget.hpp | ||||
|            source/scwx/qt/ui/radar_site_dialog.hpp | ||||
|            source/scwx/qt/ui/settings_dialog.hpp | ||||
|  | @ -203,6 +204,7 @@ set(SRC_UI source/scwx/qt/ui/about_dialog.cpp | |||
|            source/scwx/qt/ui/level2_settings_widget.cpp | ||||
|            source/scwx/qt/ui/level3_products_widget.cpp | ||||
|            source/scwx/qt/ui/open_url_dialog.cpp | ||||
|            source/scwx/qt/ui/placefile_dialog.cpp | ||||
|            source/scwx/qt/ui/placefile_settings_widget.cpp | ||||
|            source/scwx/qt/ui/radar_site_dialog.cpp | ||||
|            source/scwx/qt/ui/settings_dialog.cpp | ||||
|  | @ -214,6 +216,7 @@ set(UI_UI  source/scwx/qt/ui/about_dialog.ui | |||
|            source/scwx/qt/ui/collapsible_group.ui | ||||
|            source/scwx/qt/ui/imgui_debug_dialog.ui | ||||
|            source/scwx/qt/ui/open_url_dialog.ui | ||||
|            source/scwx/qt/ui/placefile_dialog.ui | ||||
|            source/scwx/qt/ui/placefile_settings_widget.ui | ||||
|            source/scwx/qt/ui/radar_site_dialog.ui | ||||
|            source/scwx/qt/ui/settings_dialog.ui | ||||
|  |  | |||
|  | @ -30,6 +30,7 @@ | |||
|         <file>res/icons/font-awesome-6/forward-step-solid.svg</file> | ||||
|         <file>res/icons/font-awesome-6/gears-solid.svg</file> | ||||
|         <file>res/icons/font-awesome-6/github.svg</file> | ||||
|         <file>res/icons/font-awesome-6/layer-group-solid.svg</file> | ||||
|         <file>res/icons/font-awesome-6/palette-solid.svg</file> | ||||
|         <file>res/icons/font-awesome-6/pause-solid.svg</file> | ||||
|         <file>res/icons/font-awesome-6/play-solid.svg</file> | ||||
|  |  | |||
|  | @ -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
	
	 Dan Paulat
						Dan Paulat