mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2024-11-29 07:24:13 +01:00
GCS/coreplugin: Move creation of uavgadget modes to extensionsInitialized() + add index to IUAVGadget
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@336 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
parent
c4dc8ca9c1
commit
5b4fced510
@ -62,27 +62,29 @@ bool CorePlugin::initialize(const QStringList &arguments, QString *errorMessage)
|
||||
Q_UNUSED(arguments)
|
||||
const bool success = m_mainWindow->init(errorMessage);
|
||||
if (success) {
|
||||
UAVGadgetMode *uavGadgetMode;
|
||||
UAVGadgetManager *m_uavGadgetManager = new UAVGadgetManager(CoreImpl::instance(), m_mainWindow);
|
||||
m_uavGadgetManager->hide();
|
||||
uavGadgetMode = new UAVGadgetMode(m_uavGadgetManager, QString("Mode 1"),
|
||||
QIcon(":/core/images/openpilot_logo_64.png"), 80, QString("Mode1"));
|
||||
m_uavGadgetManager->setUAVGadgetMode(uavGadgetMode);
|
||||
m_uavGadgetModes.append(uavGadgetMode);
|
||||
addObject(uavGadgetMode);
|
||||
m_uavGadgetManager = new UAVGadgetManager(CoreImpl::instance(), m_mainWindow);
|
||||
m_uavGadgetManager->hide();
|
||||
uavGadgetMode = new UAVGadgetMode(m_uavGadgetManager, QString("Mode 2"),
|
||||
QIcon(":/core/images/plus.png"), 60, QString("Mode2"));
|
||||
m_uavGadgetManager->setUAVGadgetMode(uavGadgetMode);
|
||||
m_uavGadgetModes.append(uavGadgetMode);
|
||||
addObject(uavGadgetMode);
|
||||
// nothing right now
|
||||
}
|
||||
return success;
|
||||
}
|
||||
|
||||
void CorePlugin::extensionsInitialized()
|
||||
{
|
||||
UAVGadgetMode *uavGadgetMode;
|
||||
UAVGadgetManager *m_uavGadgetManager = new UAVGadgetManager(CoreImpl::instance(), m_mainWindow);
|
||||
m_uavGadgetManager->hide();
|
||||
uavGadgetMode = new UAVGadgetMode(m_uavGadgetManager, QString("Mode 1"),
|
||||
QIcon(":/core/images/openpilot_logo_64.png"), 90, QString("Mode1"));
|
||||
m_uavGadgetManager->setUAVGadgetMode(uavGadgetMode);
|
||||
m_uavGadgetModes.append(uavGadgetMode);
|
||||
addObject(uavGadgetMode);
|
||||
m_uavGadgetManager = new UAVGadgetManager(CoreImpl::instance(), m_mainWindow);
|
||||
m_uavGadgetManager->hide();
|
||||
uavGadgetMode = new UAVGadgetMode(m_uavGadgetManager, QString("Mode 2"),
|
||||
QIcon(":/core/images/plus.png"), 60, QString("Mode2"));
|
||||
m_uavGadgetManager->setUAVGadgetMode(uavGadgetMode);
|
||||
m_uavGadgetModes.append(uavGadgetMode);
|
||||
addObject(uavGadgetMode);
|
||||
|
||||
m_mainWindow->extensionsInitialized();
|
||||
}
|
||||
|
||||
|
@ -53,6 +53,10 @@ public:
|
||||
// virtual void loadConfiguration(QString ) = 0;
|
||||
// virtual QStringList getConfigurationNames() = 0;
|
||||
virtual QWidget *toolBar() = 0;
|
||||
virtual void setIndex(int index) { m_index = index; }
|
||||
virtual int index() { return m_index; }
|
||||
private:
|
||||
int m_index;
|
||||
};
|
||||
|
||||
} // namespace Core
|
||||
|
Loading…
Reference in New Issue
Block a user