mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 20:30:05 +00:00
Save radar presets to file
- Renamed from favorites
This commit is contained in:
parent
436a3e0a9f
commit
a76816b14c
5 changed files with 208 additions and 97 deletions
|
|
@ -1,6 +1,7 @@
|
|||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <unordered_set>
|
||||
|
||||
#include <QAbstractTableModel>
|
||||
|
||||
|
|
@ -28,12 +29,14 @@ public:
|
|||
Longitude = 5,
|
||||
Type = 6,
|
||||
Distance = 7,
|
||||
Favorite = 8
|
||||
Preset = 8
|
||||
};
|
||||
|
||||
explicit RadarSiteModel(QObject* parent = nullptr);
|
||||
~RadarSiteModel();
|
||||
|
||||
std::unordered_set<std::string> presets() const;
|
||||
|
||||
int rowCount(const QModelIndex& parent = QModelIndex()) const override;
|
||||
int columnCount(const QModelIndex& parent = QModelIndex()) const override;
|
||||
|
||||
|
|
@ -44,12 +47,12 @@ public:
|
|||
int role = Qt::DisplayRole) const override;
|
||||
|
||||
void HandleMapUpdate(double latitude, double longitude);
|
||||
void ToggleFavorite(int row);
|
||||
void TogglePreset(int row);
|
||||
|
||||
static std::shared_ptr<RadarSiteModel> Instance();
|
||||
|
||||
signals:
|
||||
void FavoriteToggled(const std::string& siteId, bool isFavorite);
|
||||
void PresetToggled(const std::string& siteId, bool isPreset);
|
||||
|
||||
private:
|
||||
std::unique_ptr<RadarSiteModelImpl> p;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue