A class to show a controlled update GUI to the user. More...
#include <updatecontroller.h>
Public Types | |
enum | DisplayLevel { DisplayLevel::Automatic = 0, DisplayLevel::Exit = 1, DisplayLevel::Info = 2, DisplayLevel::ExtendedInfo = 3, DisplayLevel::Progress = 4, DisplayLevel::Ask = 5 } |
Defines the different display-levels of the dialog. More... | |
Public Slots | |
void | setDisplayLevel (DisplayLevel displayLevel) |
WRITE accessor for UpdateController::displayLevel. | |
void | setDesktopFileName (QString desktopFileName) |
WRITE accessor for UpdateController::desktopFileName. | |
void | setUpdater (QtAutoUpdater::Updater *updater) |
WRITE accessor for UpdateController::updater. | |
void | setInstallScope (QtAutoUpdater::Updater::InstallScope installScope) |
WRITE accessor for UpdateController::installScope. | |
void | setDetailedUpdateInfo (bool detailedUpdateInfo) |
WRITE accessor for UpdateController::detailedUpdateInfo. | |
bool | start () |
Starts the controller. More... | |
bool | start (DisplayLevel displayLevel) |
Sets the display level and then starts the controller. More... | |
Signals | |
void | displayLevelChanged (DisplayLevel displayLevel, QPrivateSignal) |
NOTIFY accessor for UpdateController::displayLevel. | |
void | desktopFileNameChanged (const QString &desktopFileName, QPrivateSignal) |
NOTIFY accessor for UpdateController::desktopFileName. | |
void | updaterChanged (QtAutoUpdater::Updater *updater, QPrivateSignal) |
NOTIFY accessor for UpdateController::updater. | |
void | installScopeChanged (QtAutoUpdater::Updater::InstallScope installScope, QPrivateSignal) |
NOTIFY accessor for UpdateController::installScope. | |
void | detailedUpdateInfoChanged (bool detailedUpdateInfo, QPrivateSignal) |
NOTIFY accessor for UpdateController::detailedUpdateInfo. | |
Public Member Functions | |
UpdateController (QObject *parent=nullptr) | |
Default constructor without a window. Will be application modal. More... | |
UpdateController (QWidget *parentWindow) | |
Default constructor for a window. Will modal to the parent window. More... | |
UpdateController (Updater *updater, QObject *parent=nullptr) | |
Constructs a new controller with an updater but without a window. Will be application modal. More... | |
UpdateController (Updater *updater, QWidget *parentWindow) | |
Constructs a new controller with an updater and for a window. Will modal to the parent window. More... | |
QWidget * | parentWindow () const |
Returns the parent window, if one is used. More... | |
DisplayLevel | displayLevel () const |
READ accessor for UpdateController::displayLevel. | |
QString | desktopFileName () const |
READ accessor for UpdateController::desktopFileName. | |
Updater * | updater () const |
READ accessor for UpdateController::updater. | |
Updater::InstallScope | installScope () const |
READ accessor for UpdateController::installScope. | |
bool | isDetailedUpdateInfo () const |
READ accessor for UpdateController::detailedUpdateInfo. | |
Public Member Functions inherited from QObject | |
virtual const QMetaObject * | metaObject () const const |
QObject (QObject *parent) | |
virtual bool | event (QEvent *e) |
virtual bool | eventFilter (QObject *watched, QEvent *event) |
QString | objectName () const const |
void | setObjectName (const QString &name) |
bool | isWidgetType () const const |
bool | isWindowType () const const |
bool | signalsBlocked () const const |
bool | blockSignals (bool block) |
QThread * | thread () const const |
void | moveToThread (QThread *targetThread) |
int | startTimer (int interval, Qt::TimerType timerType) |
int | startTimer (std::chrono::milliseconds time, Qt::TimerType timerType) |
void | killTimer (int id) |
T | findChild (const QString &name, Qt::FindChildOptions options) const const |
QList< T > | findChildren (const QString &name, Qt::FindChildOptions options) const const |
QList< T > | findChildren (const QRegExp ®Exp, Qt::FindChildOptions options) const const |
QList< T > | findChildren (const QRegularExpression &re, Qt::FindChildOptions options) const const |
const QObjectList & | children () const const |
void | setParent (QObject *parent) |
void | installEventFilter (QObject *filterObj) |
void | removeEventFilter (QObject *obj) |
QMetaObject::Connection | connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const const |
bool | disconnect (const char *signal, const QObject *receiver, const char *method) const const |
bool | disconnect (const QObject *receiver, const char *method) const const |
void | dumpObjectTree () |
void | dumpObjectInfo () |
void | dumpObjectTree () const const |
void | dumpObjectInfo () const const |
bool | setProperty (const char *name, const QVariant &value) |
QVariant | property (const char *name) const const |
QList< QByteArray > | dynamicPropertyNames () const const |
void | destroyed (QObject *obj) |
void | objectNameChanged (const QString &objectName) |
QObject * | parent () const const |
bool | inherits (const char *className) const const |
void | deleteLater () |
Q_DISABLE_COPY (Class) | |
Q_DISABLE_MOVE (Class) | |
Q_DISABLE_COPY_MOVE (Class) | |
T | qobject_cast (QObject *object) |
T | qobject_cast (const QObject *object) |
T | qFindChild (const QObject *obj, const QString &name) |
QList< T > | qFindChildren (const QObject *obj, const QString &name) |
QList< T > | qFindChildren (const QObject *obj, const QRegExp ®Exp) |
Q_CLASSINFO (Name, Value) | |
Q_INTERFACES (...) | |
Q_PROPERTY (...) | |
Q_ENUMS (...) | |
Q_FLAGS (...) | |
Q_ENUM (...) | |
Q_FLAG (...) | |
Q_ENUM_NS (...) | |
Q_FLAG_NS (...) | |
Q_OBJECT Q_OBJECT | |
Q_GADGET Q_GADGET | |
Q_NAMESPACE Q_NAMESPACE | |
Q_SIGNALS Q_SIGNALS | |
Q_SIGNAL Q_SIGNAL | |
Q_SLOTS Q_SLOTS | |
Q_SLOT Q_SLOT | |
Q_EMIT Q_EMIT | |
Q_INVOKABLE Q_INVOKABLE | |
Q_REVISION Q_REVISION | |
Q_SET_OBJECT_NAME (Object) | |
QT_NO_NARROWING_CONVERSIONS_IN_CONNECT QT_NO_NARROWING_CONVERSIONS_IN_CONNECT | |
Static Public Member Functions | |
static QAction * | createUpdateAction (Updater *updater, QObject *parent) |
Create a QAction to start an update check from. More... | |
Static Public Member Functions inherited from QObject | |
QString | tr (const char *sourceText, const char *disambiguation, int n) |
QString | trUtf8 (const char *sourceText, const char *disambiguation, int n) |
QMetaObject::Connection | connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, Functor functor) |
QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type) |
bool | disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method) |
bool | disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method) |
bool | disconnect (const QMetaObject::Connection &connection) |
bool | disconnect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method) |
Properties | |
QtAutoUpdater::Updater | updater |
The updater beeing used by the controller. More... | |
DisplayLevel | displayLevel |
The display level, managing which parts of the GUI are shown. More... | |
QString | desktopFileName |
The path to the desktop file of the application. More... | |
QtAutoUpdater::Updater::InstallScope | installScope |
The scope to be used when launching an installation. More... | |
bool | detailedUpdateInfo |
Specifies, whether information about updates should be detailed or not. More... | |
Properties inherited from QObject | |
objectName | |
Additional Inherited Members | |
Public Attributes inherited from QObject | |
typedef | QObjectList |
Protected Member Functions inherited from QObject | |
QObject * | sender () const const |
int | senderSignalIndex () const const |
int | receivers (const char *signal) const const |
bool | isSignalConnected (const QMetaMethod &signal) const const |
virtual void | timerEvent (QTimerEvent *event) |
virtual void | childEvent (QChildEvent *event) |
virtual void | customEvent (QEvent *event) |
virtual void | connectNotify (const QMetaMethod &signal) |
virtual void | disconnectNotify (const QMetaMethod &signal) |
A class to show a controlled update GUI to the user.
The update-controller is a helpful tool if you want to show a simple GUI to the users. It offers an automated update process, controlled by the user. All thats left for you to do is starting this controller. When creating the controller, it attaches to the updater passed to it. Whenever the updater changes it's state, a GUI is automatically shown based on the displayLevel. This means you can either start the GUI by directly using the controller, or by doing it via the underlying updater.
To start updates, you can do the following:
For a full collection of all immages, please go to the Image Page
Definition at line 19 of file updatecontroller.h.
|
strong |
Defines the different display-levels of the dialog.
Definition at line 36 of file updatecontroller.h.
|
explicit |
Default constructor without a window. Will be application modal.
parent | The parent object. Will serve as parent for the controller |
The created controller will not be bound to a specific window. Instead, all it's dialogs will be top-level windows without a parent and application modal. You can change this by using a QWidget as parent via setParent().
|
explicit |
Default constructor for a window. Will modal to the parent window.
parentWindow | The parent window. Will serve as parent for the windows and the controller |
The created controller will be bound to the widget. This means all dialogs will be child windows of the widgets window. On Mac, dialogs will be shown as "Sheets" of the parent window. You can change this by using a non QWidget as parent via setParent().
|
explicit |
Constructs a new controller with an updater but without a window. Will be application modal.
updater | The updater to be used by the controller |
parent | The parent object. Will serve as parent for the controller |
The created controller will not be bound to a specific window. Instead, all it's dialogs will be top-level windows without a parent and application modal. You can change this by using a QWidget as parent via setParent().
|
explicit |
Constructs a new controller with an updater and for a window. Will modal to the parent window.
updater | The updater to be used by the controller |
parentWindow | The parent window. Will serve as parent for the windows and the controller |
The created controller will be bound to the widget. This means all dialogs will be child windows of the widgets window. On Mac, dialogs will be shown as "Sheets" of the parent window. You can change this by using a non QWidget as parent via setParent().
Create a QAction to start an update check from.
updater | The updater to create the action for |
parent | The parent object the action should belong to |
The action will automatically start the updater using Updater::checkForUpdates. In addition to that, the action will be automatically disabled if the updater is already running or deleted.
The action has a text, an icon and a tooltip. On Mac, the action will be placed in the Applications menu if added to the Menubar. To show it in other places (for example as dock-menu), unset the QAction::menuRole.
QtAutoUpdater::UpdateController::parentWindow | ( | ) | const |
Returns the parent window, if one is used.
If the controllers parent is a QWidget, this method returns it. If there is no parent, or the parent is only a QObject, nullptr is returned
|
slot |
Starts the controller.
true
, if the controller started, false
if unable tostart will fail if the updater is already running, or if the user rejects the ask dialog, in case the AskLevel was set. Otherwise, it will always succeed and run Updater::checkForUpdates. All further dialogs will then be shown automatically, according to the displayLevel.
|
slot |
Sets the display level and then starts the controller.
displayLevel | The DisplayLevel to be set as displayLevel property before starting |
true
, if the controller started, false
if unable tostart will fail if the updater is already running, or if the user rejects the ask dialog, in case the AskLevel was set. Otherwise, it will always succeed and run Updater::checkForUpdates. All further dialogs will then be shown automatically, according to the displayLevel.
|
readwrite |
The path to the desktop file of the application.
Default: <empty>
On linux, to show a progress and update counter on the taskbar, a desktop file is needed. Use this property to set the name (not path) of the desktop file, e.g. "myapp.desktop". If your application does not run on linux, or you don't care for this feature, you can ignore this property.
Accessors | |
---|---|
READ | desktopFileName() |
WRITE | setDesktopFileName() |
NOTIFY | desktopFileNameChanged() |
Definition at line 28 of file updatecontroller.h.
|
readwrite |
Specifies, whether information about updates should be detailed or not.
Default: false
The controller supports two different update info dialogs. The detailed one will show a "big" dialog with the information, in a wide format. The simple one is just a messagebox that provides the same functionality, but is much smaller and hides the details of the specific UpdateInfos. This property is used to switch between the two dialogs. If the DisplayLevel is set to not show an info dialog at all, neither of the two will be shown.
For a comparison how each of these dialogs looks on each platform, check the Image Page.
Accessors | |
---|---|
READ | isDetailedUpdateInfo() |
WRITE | setDetailedUpdateInfo() |
NOTIFY | detailedUpdateInfoChanged() |
Definition at line 32 of file updatecontroller.h.
|
readwrite |
The display level, managing which parts of the GUI are shown.
Default: UpdateController::DisplayLevel::Info
The display level controlls the kind of dialogs shown to the user. Levels are ranked from the lowest (AutomaticLevel = 0
) to the highest (AskLevel = 5
). Each Level includes all levels with a smaller value, i.e. using the AskLevel
will add the ask dialog to everything shown with ProgressLevel
, but not less.
All GUI-elements except of the ask dialog are shown automatically when changes in the used updater happen. However, for this dialog to be shown, you must use start().
Accessors | |
---|---|
READ | displayLevel() |
WRITE | setDisplayLevel() |
NOTIFY | displayLevelChanged() |
Definition at line 26 of file updatecontroller.h.
|
readwrite |
The scope to be used when launching an installation.
Default: Updater::InstallScope::PreferInternal
Specifies if the controller should prefer to launch a parallel update installation as internal or external updater. This property only sets a preference - if a backend only supports one of these two, that one will be used, ignoring this property. Only for backends that support both, this property has any effect.
Accessors | |
---|---|
READ | installScope() |
WRITE | setInstallScope() |
NOTIFY | installScopeChanged() |
Definition at line 30 of file updatecontroller.h.
|
readwrite |
The updater beeing used by the controller.
Default: nullptr
The controller can only be used if the updater was set, either directly or via the constructor. The controller attaches to the updater and reacts on changes in it's state to show a GUI. This includes the Updater::showInstaller signal to show an installation wizard, if neccessary. Which parts of the GUI are shown can be controlled via the displayLevel property.
Accessors | |
---|---|
READ | updater() |
WRITE | setUpdater() |
NOTIFY | updaterChanged() |
Definition at line 24 of file updatecontroller.h.