Added settings class to QML Inspector

For starters, we only remember whether the initial warning about dangers
of Live Preview was shown.
This commit is contained in:
Lasse Holmstedt
2010-08-09 10:07:03 +02:00
parent 740aadb7cd
commit d572efedbd
8 changed files with 109 additions and 17 deletions

View File

@@ -0,0 +1,46 @@
#include "qmljsinspectorsettings.h"
#include "qmljsinspectorconstants.h"
#include <QtCore/QSettings>
namespace QmlJSInspector {
namespace Internal {
InspectorSettings::InspectorSettings(QObject *parent)
: QObject(parent),
m_showLivePreviewWarning(true)
{
}
InspectorSettings::~InspectorSettings()
{
}
void InspectorSettings::restoreSettings(QSettings *settings)
{
settings->beginGroup(QLatin1String(QmlJSInspector::Constants::S_QML_INSPECTOR));
m_showLivePreviewWarning = settings->value(QLatin1String(QmlJSInspector::Constants::S_LIVE_PREVIEW_WARNING_KEY), true).toBool();
settings->endGroup();
}
void InspectorSettings::saveSettings(QSettings *settings) const
{
settings->beginGroup(QLatin1String(QmlJSInspector::Constants::S_QML_INSPECTOR));
settings->setValue(QLatin1String(QmlJSInspector::Constants::S_LIVE_PREVIEW_WARNING_KEY), m_showLivePreviewWarning);
settings->endGroup();
}
bool InspectorSettings::showLivePreviewWarning() const
{
return m_showLivePreviewWarning;
}
void InspectorSettings::setShowLivePreviewWarning(bool value)
{
m_showLivePreviewWarning = value;
}
} // namespace Internal
} // namespace QmlJSInspector