From 75ee61e20cea015448771efe816b841bb2147f34 Mon Sep 17 00:00:00 2001 From: kat Date: Tue, 6 Feb 2024 19:28:16 -0500 Subject: New Tab Redesign - Adds some fixes for Animation, an Update info support class and other small things required --- ui/updateinfo.h | 70 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 ui/updateinfo.h (limited to 'ui/updateinfo.h') diff --git a/ui/updateinfo.h b/ui/updateinfo.h new file mode 100644 index 00000000..55102870 --- /dev/null +++ b/ui/updateinfo.h @@ -0,0 +1,70 @@ +#pragma once + +#include "uitypes.h" +#include +#include +#include +#include +#include "binaryninjaapi.h" + +class BINARYNINJAUIAPI UpdateInfoFetcher : public QObject +{ + Q_OBJECT + +public: + struct Version + { + QString versionStringToGiveToMainWindow; + QVersionNumber version; + QDateTime date; + bool isCurrent = false; + Version(BNUpdateVersionNew); + }; + struct ChangelogEntryItem + { + QString author; + QString commit; + QString body; + ChangelogEntryItem(const QString& author = "", const QString& commit = "", const QString& body = "") + : author(author), commit(commit), body(body) {}; + /// In-struct cache for wrapped text + mutable QString bodyWrapCache; + }; + struct ChangelogEntry + { + QVersionNumber version; + QDateTime date; + bool isNew = false; + std::vector entryItems; + ChangelogEntry(BNChangelogEntry); + }; + struct Channel + { + QString name; + QString description; + std::vector versions; + std::vector changelog; + Channel(BNUpdateChannelFullInfo); + Channel() {}; + }; + enum FetchError + { + NoError, + ConnectionError, + DeserError + }; + +private: + std::vector m_channels; + std::mutex m_infoMutex; + std::atomic m_done = false; + +public: + UpdateInfoFetcher() {}; + bool done() { return m_done; } + void startFetch(); + const std::vector& getChannels(); + const Channel* getActiveChannel(); +signals: + void fetchCompleted(const FetchError& error); +}; \ No newline at end of file -- cgit v1.3.1