| 38 | } |
| 39 | |
| 40 | QAction *UpdateController::createUpdateAction(Updater *updater, QObject *parent) |
| 41 | { |
| 42 | auto updateAction = new QAction { |
| 43 | UpdateControllerPrivate::getUpdatesIcon(), |
| 44 | tr("Check for Updates"), |
| 45 | parent |
| 46 | }; |
| 47 | updateAction->setMenuRole(QAction::ApplicationSpecificRole); |
| 48 | updateAction->setToolTip(tr("Checks if new updates are available. You will be prompted before updates are installed.")); |
| 49 | |
| 50 | connect(updateAction, &QAction::triggered, |
| 51 | updater, &Updater::checkForUpdates); |
| 52 | connect(updater, &Updater::runningChanged, |
| 53 | updateAction, &QAction::setDisabled); |
| 54 | connect(updater, &Updater::destroyed, |
| 55 | updateAction, std::bind(&QAction::setDisabled, updateAction, true)); |
| 56 | |
| 57 | return updateAction; |
| 58 | } |
| 59 | |
| 60 | QWidget *UpdateController::parentWindow() const |
| 61 | { |
nothing calls this directly
no outgoing calls
no test coverage detected