1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-11-29 07:24:13 +01:00

OP-1194 minor cleanups to scope gadget state persistence handling

This commit is contained in:
Philippe Renon 2014-01-30 21:54:05 +01:00
parent cdeebeebb4
commit 9e16e8f6a9
3 changed files with 27 additions and 16 deletions

View File

@ -138,7 +138,7 @@ void UAVGadgetDecorator::restoreState(QSettings *qSettings)
break;
}
}
// store gadget individual state
// restore gadget individual state
qSettings->beginGroup("state");
m_gadget->restoreState(qSettings);
qSettings->endGroup();

View File

@ -1,22 +1,30 @@
TEMPLATE = lib
TARGET = ScopeGadget
DEFINES += SCOPE_LIBRARY
include(../../openpilotgcsplugin.pri)
include (scope_dependencies.pri)
HEADERS += scopeplugin.h \
HEADERS += \
scopeplugin.h \
plotdata.h \
scope_global.h
HEADERS += scopegadgetoptionspage.h
HEADERS += scopegadgetconfiguration.h
HEADERS += scopegadget.h
HEADERS += scopegadgetwidget.h
HEADERS += scopegadgetfactory.h
SOURCES += scopeplugin.cpp \
plotdata.cpp
SOURCES += scopegadgetoptionspage.cpp
SOURCES += scopegadgetconfiguration.cpp
SOURCES += scopegadget.cpp
SOURCES += scopegadgetfactory.cpp
SOURCES += scopegadgetwidget.cpp
scope_global.h \
scopegadgetoptionspage.h \
scopegadgetconfiguration.h \
scopegadget.h \
scopegadgetwidget.h \
scopegadgetfactory.h
SOURCES += \
scopeplugin.cpp \
plotdata.cpp \
scopegadgetoptionspage.cpp \
scopegadgetconfiguration.cpp \
scopegadget.cpp \
scopegadgetfactory.cpp \
scopegadgetwidget.cpp
OTHER_FILES += ScopeGadget.pluginspec
FORMS += scopegadgetoptionspage.ui

View File

@ -520,7 +520,10 @@ void ScopeGadgetWidget::saveState(QSettings *qSettings)
int i = 1;
foreach(PlotData * plotData, m_curvesData.values()) {
qSettings->setValue(QString("plot%1").arg(i), plotData->curve->isVisible());
bool plotVisible = plotData->curve->isVisible();
if (!plotVisible) {
qSettings->setValue(QString("plot%1").arg(i), plotVisible);
}
i++;
}
// legend state