QGCOptions.cc 1.53 KB
Newer Older
Gus Grubba's avatar
Gus Grubba committed
1 2
/****************************************************************************
 *
Gus Grubba's avatar
Gus Grubba committed
3
 * (c) 2009-2020 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
Gus Grubba's avatar
Gus Grubba committed
4 5 6 7 8 9
 *
 * QGroundControl is licensed according to the terms in the file
 * COPYING.md in the root of the source code directory.
 *
 ****************************************************************************/

10
#include "QGCOptions.h"
11

12
#include <QtQml>
Gus Grubba's avatar
Gus Grubba committed
13

14 15
/// @file
///     @brief Core Plugin Interface for QGroundControl - Application Options
Gus Grubba's avatar
Gus Grubba committed
16
///     @author Gus Grubba <gus@auterion.com>
Gus Grubba's avatar
Gus Grubba committed
17

18 19
QGCOptions::QGCOptions(QObject* parent)
    : QObject(parent)
Gus Grubba's avatar
Gus Grubba committed
20
{
21
    QQmlEngine::setObjectOwnership(this, QQmlEngine::CppOwnership);
22 23
}

24
QUrl QGCOptions::mainToolbarUrl() const
25
{
26 27 28
    return QUrl(QStringLiteral("qrc:/toolbar/MainToolBar.qml"));
}

29
QUrl QGCOptions::planToolbarUrl() const
30 31 32 33
{
    return QUrl(QStringLiteral("qrc:/qml/PlanToolBar.qml"));
}

34
QColor QGCOptions::toolbarBackgroundLight() const
35 36 37 38
{
    return QColor(255,255,255,204);
}

39
QColor QGCOptions::toolbarBackgroundDark() const
40 41
{
    return QColor(0,0,0,192);
42 43
}

44
QUrl QGCOptions::planToolbarIndicatorsUrl() const
Gus Grubba's avatar
Gus Grubba committed
45 46 47 48
{
    return QUrl(QStringLiteral("PlanToolBar.qml"));
}

49
QGCFlyViewOptions* QGCOptions::flyViewOptions(void)
50
{
51 52 53 54
    if (!_defaultFlyViewOptions) {
        _defaultFlyViewOptions = new QGCFlyViewOptions(this);
    }
    return _defaultFlyViewOptions;
55 56
}

57 58 59 60 61 62
QGCFlyViewOptions::QGCFlyViewOptions(QGCOptions* options, QObject* parent)
    : QObject   (parent)
    , _options  (options)
{
    QQmlEngine::setObjectOwnership(this, QQmlEngine::CppOwnership);
}