mirror of https://github.com/vitalif/openscad
24 lines
630 B
C++
24 lines
630 B
C++
#include "AutoUpdater.h"
|
|
#include <QAction>
|
|
#include <QMenuBar>
|
|
|
|
AutoUpdater *AutoUpdater::updater_instance = NULL;
|
|
|
|
void AutoUpdater::init()
|
|
{
|
|
#ifdef OPENSCAD_UPDATER
|
|
if (!this->updateAction) {
|
|
QMenuBar *mb = new QMenuBar();
|
|
this->updateMenu = mb->addMenu("special");
|
|
this->updateAction = new QAction("Check for Update..", this);
|
|
// Add to application menu
|
|
this->updateAction->setMenuRole(QAction::ApplicationSpecificRole);
|
|
this->updateAction->setEnabled(true);
|
|
this->connect(this->updateAction, SIGNAL(triggered()), this, SLOT(checkForUpdates()));
|
|
|
|
this->updateMenu->addAction(this->updateAction);
|
|
|
|
}
|
|
#endif
|
|
}
|