File tree Expand file tree Collapse file tree 4 files changed +40
-1
lines changed
src/imports/autoupdaterquick Expand file tree Collapse file tree 4 files changed +40
-1
lines changed Original file line number Diff line number Diff line change @@ -988,6 +988,7 @@ EXCLUDE_SYMBOLS = QtAutoUpdaterCoreDeclarativeModule \
988988 QNodeCreatedChangeBase \
989989 QPaintEngineEx \
990990 QTechniqueFilter \
991+ Action \
991992 DelayButton \
992993 Dialog \
993994 QtObject
Original file line number Diff line number Diff line change 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+ }
Original file line number Diff line number Diff 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
3536RESOURCES += \
3637 autoupdaterquick.qrc
Original file line number Diff line number Diff line change @@ -21,3 +21,4 @@ UpdateResultDialog 3.0 UpdateResultDialog.qml
2121UpdateInfoComponent 3.0 UpdateInfoComponent.qml
2222UpdateInstallerComponent 3.0 UpdateInstallerComponent.qml
2323UpdateButton 3.0 UpdateButton.qml
24+ UpdateAction 3.0 UpdateAction.qml
You can’t perform that action at this time.
0 commit comments