NDEVR
API Documentation
UpdateButton.h
1
#pragma once
2
#include "DLLInfo.h"
3
#include <NDEVR/Button.h>
4
#include <NDEVR/UpdateChecker.h>
5
namespace
NDEVR
6
{
10
class
NDEVR_WIDGETS_API
UpdateButton
:
public
Button
11
{
12
public
:
15
explicit
UpdateButton
(QWidget* parent =
nullptr
);
18
bool
hasChecker
()
const
;
19
#ifndef Q_OS_WASM
22
void
setUpdateChecker
(
UpdateChecker
* checker);
25
void
setUpdateAndCloseAppCallback
(
const
std::function<
void
(std::function<
void
()>)>& close_and_update_callback);
26
protected
slots:
28
void
updateStateSlot
();
30
void
updatePercentSlot
();
31
protected
:
32
std::function<void(std::function<
void
()>)>
m_close_and_update_callback
;
33
UpdateChecker
*
m_checker
;
34
#endif
35
};
36
}
Button::Button
Button(QWidget *parent=nullptr)
Constructs a Button with an optional parent widget.
UpdateButton::updateStateSlot
void updateStateSlot()
Slot that updates the button appearance when the update status changes.
UpdateButton::UpdateButton
UpdateButton(QWidget *parent=nullptr)
Constructs an UpdateButton with an optional parent.
UpdateButton::updatePercentSlot
void updatePercentSlot()
Slot that updates the button progress display when download progress changes.
UpdateButton::m_close_and_update_callback
std::function< void(std::function< void()>)> m_close_and_update_callback
Callback to close the app and apply the update.
Definition
UpdateButton.h:32
UpdateButton::m_checker
UpdateChecker * m_checker
The UpdateChecker providing update state information.
Definition
UpdateButton.h:33
UpdateButton::setUpdateAndCloseAppCallback
void setUpdateAndCloseAppCallback(const std::function< void(std::function< void()>)> &close_and_update_callback)
Sets the callback invoked to close the application and apply an update.
UpdateButton::hasChecker
bool hasChecker() const
Returns whether an UpdateChecker has been assigned to this button.
UpdateButton::setUpdateChecker
void setUpdateChecker(UpdateChecker *checker)
Assigns an UpdateChecker to monitor for software updates.
UpdateChecker
Provides logic for checking a source, typically online, for an update to the software.
Definition
UpdateChecker.h:50
NDEVR
The primary namespace for the NDEVR SDK.
Definition
ArialTileFetcherModule.h:35
Widgets
Headers
UpdateButton.h
NDEVR.org