/****************************************************************************
**
** Copyright (C) 2014 Jolla Ltd.
** Contact: http://jolla.com/
**
** This file is part of Qt Creator.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file.  Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** Other Usage
**
** Alternatively, this file may be used in accordance with the terms and
** conditions contained in a signed written agreement between you and Digia.
**
****************************************************************************/

#ifndef NXTSETTINGS_H
#define NXTSETTINGS_H

#include <QtCore/QObject>

namespace Nxt {
namespace Internal {

class NxtSettings : public QObject
{
    Q_OBJECT
public:
    explicit NxtSettings(QObject *parent = nullptr);
    ~NxtSettings() override;

    static NxtSettings *instance();

    static QString environmentFilter();
    static void setEnvironmentFilter(const QString &filter);
    static bool isEnvironmentFilterFromEnvironment();

    static bool isAskBeforeStartingVmEnabled();
    static void setAskBeforeStartingVmEnabled(bool enabled);
    static bool isAskBeforeClosingVmEnabled();
    static void setAskBeforeClosingVmEnabled(bool enabled);

signals:
    void environmentFilterChanged(const QString &filter);
    void askBeforeStartingVmEnabledChanged(bool enabled);
    void askBeforeClosingVmEnabledChanged(bool enabled);

private:
    void read();
    void save();

private:
    static NxtSettings *s_instance;
    QString m_environmentFilter;
    QString m_environmentFilterFromEnvironment;
    bool m_askBeforeStartingVmEnabled;
    bool m_askBeforeClosingVmEnabled;
};

} // namespace Internal
} // namespace Nxt

#endif // NXTSETTINGS_H
