Skip to content

Commit 2eda3ce

Browse files
committed
added quick update action
1 parent f8d638a commit 2eda3ce

File tree

4 files changed

+40
-1
lines changed

4 files changed

+40
-1
lines changed

doc/Doxyfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -988,6 +988,7 @@ EXCLUDE_SYMBOLS = QtAutoUpdaterCoreDeclarativeModule \
988988
QNodeCreatedChangeBase \
989989
QPaintEngineEx \
990990
QTechniqueFilter \
991+
Action \
991992
DelayButton \
992993
Dialog \
993994
QtObject
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import QtQuick 2.13
2+
import QtQuick.Controls 2.13
3+
import de.skycoder42.QtAutoUpdater.Core 3.0
4+
5+
/*! @brief A simple action for update checks
6+
*
7+
* @extends QtQuick.Controls.Action
8+
*
9+
* The UpdateAction is a ready-made "action" to check for updates. It is connected to an updater and
10+
* thus will automatically start checking for updates. It will also automatically disable itself
11+
* while checking for updates.
12+
*
13+
* @sa QtAutoUpdater::Updater, QtAutoUpdater::Updater::checkForUpdates,
14+
* @ref qtautoupdater_image_page "Image Page"
15+
*/
16+
Action {
17+
id: updateAction
18+
19+
/*! @brief The updater to be used by the action to check for updates
20+
*
21+
* @default{`null`}
22+
*
23+
* @accessors{
24+
* @memberAc{updater}
25+
* }
26+
* @sa QtAutoUpdater::Updater
27+
*/
28+
property Updater updater: null
29+
30+
text: qsTr("Check for updates")
31+
icon.name: "system-software-update"
32+
icon.source: "qrc:/de/skycoder42/QtAutoUpdater/Quick/icons/update.svg"
33+
enabled: updater && !updater.running
34+
35+
onTriggered: updater.checkForUpdates()
36+
}

src/imports/autoupdaterquick/autoupdaterquick.pro

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ QML_FILES += \
3030
UpdateInstallerPage.qml \
3131
UpdateInstallerComponent.qml \
3232
SuccessView.qml \
33-
UpdateButton.qml
33+
UpdateButton.qml\
34+
UpdateAction.qml
3435

3536
RESOURCES += \
3637
autoupdaterquick.qrc

src/imports/autoupdaterquick/qmldir

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,4 @@ UpdateResultDialog 3.0 UpdateResultDialog.qml
2121
UpdateInfoComponent 3.0 UpdateInfoComponent.qml
2222
UpdateInstallerComponent 3.0 UpdateInstallerComponent.qml
2323
UpdateButton 3.0 UpdateButton.qml
24+
UpdateAction 3.0 UpdateAction.qml

0 commit comments

Comments
 (0)