30 ScopedLock lock(lock_);
31 bool should_check = (checkers_ == 0);
40 ScopedLock lock(lock_);
47 CriticalSection lock_;
61 static constexpr int kUpdateCheckWidth = 340;
62 static constexpr int kUpdateCheckHeight = 160;
63 static constexpr int kPaddingX = 20;
64 static constexpr int kPaddingY = 20;
65 static constexpr int kButtonHeight = 30;
116 version_request_.stopThread(350);
122 void resized()
override;
128 void setVisible(
bool should_be_visible)
override;
139 void buttonClicked(Button* clicked_button)
override;
145 void mouseUp(
const MouseEvent& e)
override;
152 void finished(URL::DownloadTask* task,
bool success)
override;
160 void progress(URL::DownloadTask* task, int64 bytesDownloaded, int64 totalLength)
override { }
166 version_request_.startThread();
177 void checkContentUpdate();
183 Rectangle<int> getUpdateCheckRect();
196 void updateContent(String version);
198 std::vector<Listener*> listeners_;
200 VersionRequestThread version_request_;
201 std::unique_ptr<URL::DownloadTask> download_task_;
205 std::unique_ptr<PlainTextComponent> notify_text_;
206 std::unique_ptr<PlainTextComponent> version_text_;
207 std::unique_ptr<OpenGlToggleButton> download_button_;
208 std::unique_ptr<OpenGlToggleButton> nope_button_;
211 String content_version_;
212 bool content_update_;
A convenience class for a single quad rendered via OpenGL.
Definition open_gl_multi_quad.h:447
A SynthSection that displays an overlay with a background and optional listeners.
Definition overlay.h:180
Interface for components interested in update notifications.
Definition update_check_section.h:96
virtual void needsUpdate()=0
Called when an update is needed.
virtual ~Listener()
Definition update_check_section.h:98
A thread that requests version information from the server.
Definition update_check_section.h:73
void run() override
Thread entry point. Calls checkUpdate() on the referenced UpdateCheckSection.
Definition update_check_section.h:84
VersionRequestThread(UpdateCheckSection *ref)
Constructs a VersionRequestThread.
Definition update_check_section.h:79
A UI overlay for checking software or content updates.
Definition update_check_section.h:59
void addListener(Listener *listener)
Adds a listener to be notified when updates are available.
Definition update_check_section.h:189
~UpdateCheckSection()
Destructor. Stops the version request thread.
Definition update_check_section.h:115
void progress(URL::DownloadTask *task, int64 bytesDownloaded, int64 totalLength) override
Called periodically to report download progress.
Definition update_check_section.h:160
void startCheck()
Starts the version check by launching the VersionRequestThread.
Definition update_check_section.h:165
A singleton class that keeps track of whether an update check should be performed.
Definition update_check_section.h:14
bool incrementChecker()
Increments the number of components interested in checking for updates.
Definition update_check_section.h:29
void decrementChecker()
Decrements the count of interested update checkers.
Definition update_check_section.h:39
UpdateMemory()
Constructs the UpdateMemory object. Initializes the checker count based on user settings for update c...
Definition update_check_section.cpp:6
virtual ~UpdateMemory()
Destructor.
Definition update_check_section.cpp:12