diff options
| author | Christoph Berg <myon@debian.org> | 2026-10-09 14:12:35 +0200 |
|---|---|---|
| committer | Christoph Berg <myon@debian.org> | 2026-10-09 14:12:35 +0200 |
| commit | ffc62c792c9a5196cb4ce7a353287dfe20db6524 (patch) | |
| tree | 1269efa852935b183daae4bb33a58d1b4d2ffb53 /models/FrequencySuggestions.hpp | |
| parent | 059831534c7e884f0a607ed86b582fd00d821731 (diff) | |
New upstream version 3.3.0~beta1+dfsgupstream/3.3.0_beta1+dfsg
Diffstat (limited to 'models/FrequencySuggestions.hpp')
| -rw-r--r-- | models/FrequencySuggestions.hpp | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/models/FrequencySuggestions.hpp b/models/FrequencySuggestions.hpp new file mode 100644 index 00000000..74ed2eb6 --- /dev/null +++ b/models/FrequencySuggestions.hpp @@ -0,0 +1,44 @@ +#ifndef FREQUENCY_SUGGESTIONS_HPP__ +#define FREQUENCY_SUGGESTIONS_HPP__ + +#include "models/FrequencyList.hpp" + +#include <QSet> +#include <QStringList> + +class Bands; + +namespace FrequencySuggestions +{ + using Item = FrequencyList_v2_101::Item; + using Items = FrequencyList_v2_101::FrequencyItems; + + QString key (Item const&); + bool is_present (Item const&, Items const& working); + Items prepare_additions (Items const& selected, Items const& working, Bands const&); + + class NoticeState + { + public: + enum class Visibility { Hidden, Available, New }; + + NoticeState (QStringList seen_keys = {}, bool has_seen_catalog = false); + + Visibility visibility (Items const& catalog, Items const& working) const; + void selected_additions (Items const& additions); + void cancel (); + bool commit (Items const& catalog, Items const& committed_working); + bool acknowledge_present_catalog (Items const& catalog, Items const& committed_working); + void dismiss (Items const& catalog); + QStringList seen_keys () const; + + private: + void acknowledge (Items const& catalog); + + QSet<QString> seen_keys_; + bool has_seen_catalog_ {false}; + Items pending_additions_; + }; +} + +#endif |
