10#include <QElapsedTimer>
59 QTextEdit *rxTextEdit =
nullptr;
64 QMap<QString, QMap<QString, CallDetail>> *callActivityBandCache =
66 QMap<QString, QString>
const *rxTextBandCache =
nullptr;
68 std::function<void(QString
const &)> showStatusMessage;
69 std::function<void()> displayActivity;
70 std::function<void()> clearRxFrameBlockNumbers;
97 QObject *parent =
nullptr);
159 bool fallbackToCurrentBand =
false);
196 QString activityPath()
const;
198 QString activityConfigId()
const;
204 void seedActivityForBand(QString
const &band);
205 QString htmlBelowLegacyCopy(QTextDocument *doc)
const;
206 void purgeLegacyActivityIni();
215 QString lastStoreError()
const {
216 return m_activityDB ? m_activityDB->error() : QString{};
218 void startActivityBatchIfPending();
219 void saveRxTextForBand(QString
const &band);
220 void switchActivityBucket(QString
const &band);
224 std::unique_ptr<ActivityDB> m_activityDB;
225 QElapsedTimer m_activityDBRetryTimer;
226 QString m_activityBand;
227 bool m_activityBandLoaded =
false;
228 QSet<QString> m_activitySeeded;
231 bool m_rxTextLegacyShown =
false;
232 QString m_rxTextLegacyBand;
233 int m_rxTextLegacyBlocks = 0;
235 int m_activityBatchDepth = 0;
236 bool m_activityBatchBeginFailed =
false;
237 QSet<QString> m_rxTextDirtyBands;
240 bool m_activityStoreDisabled =
false;
242 bool m_activityShuttingDown =
false;
245 bool m_activityBandConfirmed =
false;
247 QSet<QString> m_activityBandConfirmedBands;
248 QElapsedTimer m_activityStartupTimer;
249 QElapsedTimer m_seedRetryTimer;
250 QTimer m_rxTextSaveTimer;
251 QTimer m_rxTextSaveMaxTimer;
253 mutable QString m_activityConfigId;
255 int m_rxTextLastSavedRevision = -1;
256 QString m_rxTextLastSavedBand;
Declares the SQLite store behind activity.db3 (issue #267).
Defines the Call Activity record shared by the UI and storage.
Persistent per-band activity storage (activity.db3).
Definition ActivityDB.h:50
void clearCallActivity()
Drop the current bucket's stored Call Activity rows.
Definition ActivityStorageController.cpp:1103
void flushOnClose()
Final flush: sweep every confirmed bucket's pending writes.
Definition ActivityStorageController.cpp:1178
bool importLegacyActivityIfNeeded()
Import the legacy .ini activity once per configuration.
Definition ActivityStorageController.cpp:846
ActivityStorageController(Context context, QObject *parent=nullptr)
Construct the controller over an already-built window.
Definition ActivityStorageController.cpp:66
void bandUnchanged(QString const &band)
The rig reported the band the panes already hold.
Definition ActivityStorageController.cpp:162
void setupRxTextAutosave()
Connect the debounced RX-text write-back timers.
Definition ActivityStorageController.cpp:88
QString currentBucket() const
The bucket the on-screen panes belong to ("" = out-of-plan).
Definition ActivityStorageController.h:130
bool isBucketLoaded() const
Whether a bucket has been restored into the panes yet.
Definition ActivityStorageController.h:132
void beginBatch()
Open a write batch; nested batches share one transaction.
Definition ActivityStorageController.cpp:361
void bucketRestored(QString const &band, bool paneReloaded)
Record that the window has restored a bucket's panes.
Definition ActivityStorageController.cpp:249
void endBatch()
Close a write batch, committing at the outermost level.
Definition ActivityStorageController.cpp:385
void beginStartupGrace()
Start the grace period allowed for the rig to report a band.
Definition ActivityStorageController.cpp:112
void adjustCallActivityOffsets(int hzDelta)
Shift every stored offset for the current bucket.
Definition ActivityStorageController.cpp:542
void showLegacyRxTextIfDegraded()
Show the legacy .ini RX text when the store is unavailable.
Definition ActivityStorageController.cpp:128
void persistCallActivity(CallDetail const &d, bool fallbackToCurrentBand=false)
Upsert one station into the store.
Definition ActivityStorageController.cpp:492
void clearRxActivity()
Drop the current bucket's stored RX text.
Definition ActivityStorageController.cpp:1056
void removeStoredCall(QString const &call)
Drop one station from the current bucket.
Definition ActivityStorageController.cpp:1135
void clearAllActivity()
Drop every stored row, across all buckets and both panes.
Definition ActivityStorageController.cpp:1013
void bandChanged(QString const &band)
The rig reported a different band; park and switch buckets.
Definition ActivityStorageController.cpp:179
Definition Configuration.h:59
One persisted Call Activity row - the full CallDetail field set, so a band round-trip within a sessio...
Definition ActivityDB.h:57
The window state and operations this controller needs.
Definition ActivityStorageController.h:53
QMap< QString, int > const * inboxCounts
Unread-message counts; unread senders are exempt from aging.
Definition ActivityStorageController.h:63
std::function< void(QString const &)> restoreActivity
UI_Constructor::restoreActivity - show a bucket's panes.
Definition ActivityStorageController.h:82
QMap< QString, CallDetail > * callActivity
The live Call Activity table; a seed merges stored rows into it.
Definition ActivityStorageController.h:61
std::function< void()> clearBandCaches
Empty every RAM band cache (the "Clear All Activity" action).
Definition ActivityStorageController.h:84
std::function< void(QString const &)> cacheActivity
UI_Constructor::cacheActivity - park the panes under a bucket.
Definition ActivityStorageController.h:78
std::function< void(QString const &)> dropBandCache
Forget every per-band cache the window holds for one bucket.
Definition ActivityStorageController.h:80
std::function< void()> clearCallActivityPane
UI_Constructor::clearCallActivity.
Definition ActivityStorageController.h:76
Radio::Frequency defaultDial
The dial the ini falls back to when it has never recorded one.
Definition ActivityStorageController.h:58
QSettings * settings
The current configuration's settings (legacy import, config id).
Definition ActivityStorageController.h:56
std::function< void()> clearActivityPanes
UI_Constructor::clearActivity - every pane and session queue.
Definition ActivityStorageController.h:72
std::function< void()> clearRxPane
UI_Constructor::clearRXActivity.
Definition ActivityStorageController.h:74
One station in the Call Activity table.
Definition CallDetail.h:20