mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-02-18 08:54:15 +01:00
GCS/core+map: Minor cleanup of uav gadget configuration interface.
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@402 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
parent
cd04e7c201
commit
7927a22fe0
@ -47,7 +47,7 @@ public:
|
|||||||
void setLocked(bool locked) { m_locked = locked; }
|
void setLocked(bool locked) { m_locked = locked; }
|
||||||
|
|
||||||
virtual QByteArray saveState() const = 0;
|
virtual QByteArray saveState() const = 0;
|
||||||
virtual IUAVGadgetConfiguration *clone(QString name) = 0;
|
virtual IUAVGadgetConfiguration *clone() = 0;
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
|
||||||
|
@ -198,7 +198,9 @@ void UAVGadgetInstanceManager::cloneConfiguration(IUAVGadgetConfiguration *conf
|
|||||||
{
|
{
|
||||||
QString name = suggestName(configToClone->classId(), configToClone->name());
|
QString name = suggestName(configToClone->classId(), configToClone->name());
|
||||||
|
|
||||||
IUAVGadgetConfiguration *config = configToClone->clone(name);
|
IUAVGadgetConfiguration *config = configToClone->clone();
|
||||||
|
config->setName(name);
|
||||||
|
config->setProvisionalName(name);
|
||||||
IUAVGadgetFactory *f = factory(config->classId());
|
IUAVGadgetFactory *f = factory(config->classId());
|
||||||
IOptionsPage *p = f->createOptionsPage(config);
|
IOptionsPage *p = f->createOptionsPage(config);
|
||||||
IOptionsPage *page = new UAVGadgetOptionsPageDecorator(p, config);
|
IOptionsPage *page = new UAVGadgetOptionsPageDecorator(p, config);
|
||||||
|
@ -47,11 +47,9 @@ MapGadgetConfiguration::MapGadgetConfiguration(QString classId, const QByteArray
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
IUAVGadgetConfiguration *MapGadgetConfiguration::clone(QString name)
|
IUAVGadgetConfiguration *MapGadgetConfiguration::clone()
|
||||||
{
|
{
|
||||||
MapGadgetConfiguration *m = new MapGadgetConfiguration(this->classId());
|
MapGadgetConfiguration *m = new MapGadgetConfiguration(this->classId());
|
||||||
m->setName(name);
|
|
||||||
m->setProvisionalName(name);
|
|
||||||
m->m_defaultZoom = m_defaultZoom;
|
m->m_defaultZoom = m_defaultZoom;
|
||||||
m->m_defaultLatitude = m_defaultLatitude;
|
m->m_defaultLatitude = m_defaultLatitude;
|
||||||
m->m_defaultLongitude = m_defaultLongitude;
|
m->m_defaultLongitude = m_defaultLongitude;
|
||||||
|
@ -44,7 +44,7 @@ public:
|
|||||||
double longitude() { return m_defaultLongitude; }
|
double longitude() { return m_defaultLongitude; }
|
||||||
void setLongitude(double lon) { m_defaultLongitude = lon; }
|
void setLongitude(double lon) { m_defaultLongitude = lon; }
|
||||||
QByteArray saveState() const;
|
QByteArray saveState() const;
|
||||||
IUAVGadgetConfiguration *clone(QString name);
|
IUAVGadgetConfiguration *clone();
|
||||||
signals:
|
signals:
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user