MCPcopy Create free account
hub / github.com/Skycoder42/QtAutoUpdater / createUpdateAction

Method createUpdateAction

src/autoupdaterwidgets/updatecontroller.cpp:40–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38}
39
40QAction *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
60QWidget *UpdateController::parentWindow() const
61{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected