|
1 | 1 | /*! |
2 | 2 | @class QtAutoUpdater::UpdateButton |
3 | 3 |
|
4 | | -The UpdateButton is a ready-made "button" to check for updates. It is connected to this |
5 | | -controller and thus will automatically start checking for updates. Since the button itself |
6 | | -shows a progress, no progress dialog is needed here. For images check the @ref qtautoupdater_image_page "Image Page". |
| 4 | +The UpdateButton is a ready-made "button" to check for updates. It is connected to an updater and |
| 5 | +thus will automatically start checking for updates. It will also display a progress and optionally |
| 6 | +allow canceling and installation of updates. |
7 | 7 |
|
8 | | -The button will represent the controllers state and automatically enable/disable itself to |
| 8 | +The button will represent the updaters state and automatically enable/disable itself to |
9 | 9 | avoid start beeing called twice. In addition to that, the whole button widget will be disabled |
10 | | -if the controller gets deleted while the button is still existings. (Even if it wasn't, |
11 | | -it will not crash if the button is clicked). |
| 10 | +if the updater gets deleted while the button is still existant. |
12 | 11 |
|
13 | | -@sa QtAutoUpdater::UpdateController, UpdateController::createUpdateAction, @ref qtautoupdater_image_page "Image Page" |
| 12 | +@sa QtAutoUpdater::Updater, UpdateController::createUpdateAction, |
| 13 | +@ref qtautoupdater_image_page "Image Page" |
14 | 14 | */ |
15 | 15 |
|
16 | 16 | /*! |
17 | | -@property QtAutoUpdater::UpdateButton::animationFile |
| 17 | +@property QtAutoUpdater::UpdateButton::updater |
18 | 18 |
|
19 | | -@default{`:/QtAutoUpdater/icons/updateRunning.gif`} |
| 19 | +@default{`nullptr`} |
20 | 20 |
|
21 | | -The default file will show a simple idle animation. If this does not fit into your ui, |
22 | | -you can use this property to specify a different animation source. |
| 21 | +The button can only be used if the updater was set, either directly or via the constructor. The |
| 22 | +button attaches to the updater and reacts on changes in it's state to react accordingly. |
23 | 23 |
|
24 | 24 | @accessors{ |
25 | | - @readAc{animationFile()} |
26 | | - @writeAc{setAnimationFile()} |
27 | | - @writeAc{setAnimationDevice()} |
28 | | - @resetAc{resetAnimationFile()} |
| 25 | + @readAc{updater()} |
| 26 | + @writeAc{setUpdater()} |
| 27 | + @notifyAc{updaterChanged()} |
29 | 28 | } |
30 | 29 |
|
31 | | -@sa @ref qtautoupdater_image_page "Image Page" |
| 30 | +@sa UpdateButton::mode |
32 | 31 | */ |
33 | 32 |
|
34 | 33 | /*! |
35 | | -@property QtAutoUpdater::UpdateButton::showResult |
| 34 | +@property QtAutoUpdater::UpdateButton::mode |
36 | 35 |
|
37 | | -@default{`true`} |
| 36 | +@default{`UpdateButton::ModeFlag::AllowAndShowAll`} |
38 | 37 |
|
39 | | -If set to `true`, after an update check, a short info text will be shown next to the button. |
40 | | -It will tell the user whether updates are available or not. In addition to that, if updates |
41 | | -are available, the button will be disabled.<br> |
42 | | -If set to `false`, the button will not show any information after the update and return to the |
43 | | -state it had before checking for updates - just a simple button.<br> |
44 | | -In both cases, while the updater is running, the information will be shown as always. |
| 38 | +The mode is used to control the buttons behaviour. See UpdateButton::ModeFlag for details about what |
| 39 | +each mode does. By default, all features are enabled. |
45 | 40 |
|
46 | 41 | @accessors{ |
47 | | - @readAc{isShowingResult()} |
48 | | - @writeAc{setShowResult()} |
| 42 | + @readAc{mode()} |
| 43 | + @writeAc{setMode()} |
| 44 | + @notifyAc{modeChanged()} |
49 | 45 | } |
50 | 46 |
|
51 | | -@sa @ref qtautoupdater_image_page "Image Page", UpdateButton::animationFile |
| 47 | +@sa UpdateButton::ModeFlag |
52 | 48 | */ |
53 | 49 |
|
54 | 50 | /*! |
55 | | -@property QtAutoUpdater::UpdateButton::displayLevel |
| 51 | +@property QtAutoUpdater::UpdateButton::animationFile |
56 | 52 |
|
57 | | -@default{`UpdateController::ExtendedInfoLevel`} |
| 53 | +@default{`:/QtAutoUpdater/icons/updateRunning.gif`} |
58 | 54 |
|
59 | | -This will simply be used as parameter for UpdateController::start when the button is clicked. |
| 55 | +The default file will show a simple idle animation. If this does not fit the style of your ui, you |
| 56 | +can use this property to specify a different animation source. |
60 | 57 |
|
61 | 58 | @accessors{ |
62 | | - @readAc{displayLevel()} |
63 | | - @writeAc{setDisplayLevel()} |
| 59 | + @readAc{animationFile()} |
| 60 | + @writeAc{setAnimationFile()} |
| 61 | + @writeAc{setAnimationDevice()} |
| 62 | + @resetAc{resetAnimationFile()} |
| 63 | + @notifyAc{animationFileChanged()} |
64 | 64 | } |
65 | 65 |
|
66 | | -@sa UpdateController::start, UpdateController::DisplayLevel |
| 66 | +@sa @ref qtautoupdater_image_page "Image Page" |
67 | 67 | */ |
68 | 68 |
|
69 | 69 | /*! |
70 | | -@property QtAutoUpdater::UpdateButton::controller |
71 | | - |
72 | | -@default{`nullptr`} |
| 70 | +@property QtAutoUpdater::UpdateButton::installMode |
73 | 71 |
|
74 | | -The button can only be used correctly if a controller is set. If no controller is set, |
75 | | -the button will be disabled. Changing the controller will reset the buttons state. If the |
76 | | -controller gets destroyed, the button will reset and disabled itself automatically. |
| 72 | +@default{`Updater::InstallModeFlag::Parallel`} |
77 | 73 |
|
78 | | -@note You can manually enable the button, even without a set controller. In this case, all that |
79 | | -happens is nothing: The button will be there, but just nothing happens if it is clicked. |
| 74 | +The install mode to be passed to Updater::runUpdater, if the ModeFlag::AllowInstall flag is set and |
| 75 | +the user launches an installation via the button. |
80 | 76 |
|
81 | 77 | @accessors{ |
82 | | - @readAc{controller()} |
83 | | - @writeAc{setController()} |
84 | | - @notifyAc{controllerChanged()} |
| 78 | + @readAc{installMode()} |
| 79 | + @writeAc{setInstallMode()} |
| 80 | + @notifyAc{installModeChanged()} |
85 | 81 | } |
86 | 82 |
|
87 | | -@sa QtAutoUpdater::UpdateController, UpdateButton::resetState |
| 83 | +@sa Updater::runUpdater, Updater::InstallModeFlag, UpdateButton::installScope |
88 | 84 | */ |
89 | 85 |
|
90 | 86 | /*! |
91 | | -@fn QtAutoUpdater::UpdateButton::UpdateButton |
92 | | - |
93 | | -@param parent The parent widget of the button |
94 | | -@param controller The UpdateController to be used by the button |
95 | | - |
96 | | -If `controller` is `nullptr`, the button will be disabled until you set a controller manually. |
| 87 | +@property QtAutoUpdater::UpdateButton::installScope |
97 | 88 |
|
98 | | -@sa UpdateButton::controller |
99 | | -*/ |
100 | | - |
101 | | -/*! |
102 | | -@fn QtAutoUpdater::UpdateButton::resetState |
| 89 | +@default{`Updater::InstallScope::PreferInternal`} |
103 | 90 |
|
104 | | -The button will look like it looks after it's creation. Any progress or message will be reset. |
105 | | -However, if the UpdateButton itself is disabled because of a missing controller, this will not be |
106 | | -reset. Neither will the animation file nor the display level be reset. |
| 91 | +The install scope to be passed to Updater::runUpdater, if the ModeFlag::AllowInstall flag is set and |
| 92 | +the user launches an installation via the button. |
107 | 93 |
|
108 | | -@note Calling this slot while the updater is running will still reset the button, but after the updater |
109 | | -has finished, the button will show the result (if enabled). |
| 94 | +@accessors{ |
| 95 | + @readAc{installScope()} |
| 96 | + @writeAc{setInstallScope()} |
| 97 | + @notifyAc{installScopeChanged()} |
| 98 | +} |
110 | 99 |
|
111 | | -@sa UpdateButton::showResult, UpdateButton::animationFile, UpdateController::running |
| 100 | +@sa Updater::runUpdater, Updater::InstallScope, UpdateButton::installMode |
112 | 101 | */ |
113 | | - |
0 commit comments