32 #include <QStringList>
39 #include <QKeySequence>
44 SetupWizardPlugin::SetupWizardPlugin()
45 : wizardRunning(false)
49 SetupWizardPlugin::~SetupWizardPlugin()
53 bool SetupWizardPlugin::initialize(
const QStringList &args, QString *errMsg)
64 cmd->
action()->setText(tr(
"Vehicle Setup Wizard"));
68 ac->
menu()->addSeparator();
72 connect(cmd->
action(), &QAction::triggered,
this, &SetupWizardPlugin::showSetupWizard);
76 void SetupWizardPlugin::extensionsInitialized()
78 auto pm = ExtensionSystem::PluginManager::instance();
82 std::bind(&SetupWizardPlugin::showSetupWizard,
this,
true));
85 void SetupWizardPlugin::shutdown()
89 void SetupWizardPlugin::showSetupWizard(
bool autoLaunched)
99 for (
const auto uploader : uploaders) {
100 if (uploader->active())
107 qWarning() <<
"Could not get UAVObjectUtilManager";
112 qInfo() <<
"Ignoring board";
119 wizardRunning =
true;
122 connect(m_wiz, &QDialog::finished,
this, &SetupWizardPlugin::wizardTerminated);
123 m_wiz->setAttribute(Qt::WA_DeleteOnClose,
true);
124 m_wiz->setWindowFlags(m_wiz->windowFlags() | Qt::WindowStaysOnTopHint);
128 void SetupWizardPlugin::wizardTerminated()
130 wizardRunning =
false;
131 disconnect(
this, SLOT(wizardTerminated()));
134 void SetupWizardPlugin::ignoreBoard(QByteArray uuid)
136 ignoredBoards << uuid;
The SetupWizard class is the main interface to the setup wizard. It provides selects the sequence of ...
static ModeManager * instance()
virtual QAction * action() const =0
virtual Command * registerAction(QAction *action, const QString &id, const QList< int > &context)=0
Makes an action known to the system under the specified string id.
const char *const M_TOOLS
virtual ActionContainer * actionContainer(const QString &id) const =0
Returns the IActionContainter object that is know to the system under the given string id...
Core plugin system that manages the plugins, their life cycle and their registered objects...
virtual ActionManager * actionManager() const =0
Returns the application's action manager.
void addAction(Command *command, int priority, QMenu *menu=nullptr)
void boardIgnored(QByteArray uuid)
virtual QMenu * menu() const =0
const char *const MODE_WELCOME
void activateModeByWorkspaceName(const QString &id)
static ICore * instance()
virtual void appendGroup(const QString &group)=0
virtual void addAction(Core::Command *action, const QString &group=QString())=0
The action manager is responsible for registration of menus and menu items and keyboard shortcuts...
QByteArray getBoardCPUSerial()
The class Command represents an action like a menu item, tool button, or shortcut. You don't create Command objects directly, instead use {ActionManager::registerAction()} to register an action and retrieve a Command. The Command object represents the user visible action and its properties. If multiple actions are registered with the same ID (but different contexts) the returned Command is the shared one between these actions.