Fixes to add_custom_layer_dialog suggested on GitHub

This commit is contained in:
AdenKoperczak 2025-03-28 11:28:11 -04:00
parent f5ab6f3ef7
commit 7d2635608d
4 changed files with 77 additions and 99 deletions

View file

@ -17,15 +17,12 @@ class CustomLayerDialogImpl;
class CustomLayerDialog : public QDialog
{
Q_OBJECT
Q_DISABLE_COPY_MOVE(CustomLayerDialog)
public:
explicit CustomLayerDialog(const QMapLibre::Settings& settings,
QWidget* parent = nullptr);
~CustomLayerDialog() override;
CustomLayerDialog(const CustomLayerDialog&) = delete;
CustomLayerDialog(CustomLayerDialog&&) = delete;
CustomLayerDialog& operator=(const CustomLayerDialog&) = delete;
CustomLayerDialog& operator=(CustomLayerDialog&&) = delete;
std::string selected_layer();

View file

@ -108,8 +108,8 @@ static const std::unordered_map<std::string, ColorTableConversions>
class SettingsDialogImpl
{
public:
explicit SettingsDialogImpl(SettingsDialog* self,
QMapLibre::Settings mapSettings) :
explicit SettingsDialogImpl(SettingsDialog* self,
QMapLibre::Settings& mapSettings) :
self_ {self},
radarSiteDialog_ {new RadarSiteDialog(self)},
alertAudioRadarSiteDialog_ {new RadarSiteDialog(self)},
@ -117,7 +117,7 @@ public:
countyDialog_ {new CountyDialog(self)},
wfoDialog_ {new WFODialog(self)},
fontDialog_ {new QFontDialog(self)},
mapSettings_ {std::move(mapSettings)},
mapSettings_ {mapSettings},
fontCategoryModel_ {new QStandardItemModel(self)},
settings_ {std::initializer_list<settings::SettingsInterfaceBase*> {
&defaultRadarSite_,
@ -223,7 +223,7 @@ public:
WFODialog* wfoDialog_;
QFontDialog* fontDialog_;
QMapLibre::Settings mapSettings_;
QMapLibre::Settings& mapSettings_;
QStandardItemModel* fontCategoryModel_;
@ -298,8 +298,8 @@ public:
std::vector<settings::SettingsInterfaceBase*> settings_;
};
SettingsDialog::SettingsDialog(const QMapLibre::Settings& mapSettings,
QWidget* parent) :
SettingsDialog::SettingsDialog(QMapLibre::Settings& mapSettings,
QWidget* parent) :
QDialog(parent),
p {std::make_unique<SettingsDialogImpl>(this, mapSettings)},
ui(new Ui::SettingsDialog)

View file

@ -25,8 +25,8 @@ private:
Q_DISABLE_COPY(SettingsDialog)
public:
explicit SettingsDialog(const QMapLibre::Settings& mapSettings,
QWidget* parent = nullptr);
explicit SettingsDialog(QMapLibre::Settings& mapSettings,
QWidget* parent = nullptr);
~SettingsDialog();
private: