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


/// @file
12
/// @author Gus Grubba <mavlink@grubba.com>
Don Gagne's avatar
Don Gagne committed
13 14

#include "ScreenToolsController.h"
15
#include <QFontDatabase>
dogmaphobic's avatar
dogmaphobic committed
16
#include <QScreen>
17

Gus Grubba's avatar
Gus Grubba committed
18 19
#include "SettingsManager.h"

20 21 22
#if defined(__ios__)
#include <sys/utsname.h>
#endif
Don Gagne's avatar
Don Gagne committed
23 24 25

ScreenToolsController::ScreenToolsController()
{
26

Don Gagne's avatar
Don Gagne committed
27
}
28 29

QString
30
ScreenToolsController::iOSDevice() const
31 32 33 34 35 36 37 38 39
{
#if defined(__ios__)
    struct utsname systemInfo;
    uname(&systemInfo);
    return QString(systemInfo.machine);
#else
    return QString();
#endif
}
40 41 42 43 44 45

QString
ScreenToolsController::fixedFontFamily() const
{
    return QFontDatabase::systemFont(QFontDatabase::FixedFont).family();
}
Gus Grubba's avatar
Gus Grubba committed
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69

QString
ScreenToolsController::normalFontFamily() const
{
    //-- See App.SettinsGroup.json for index
    int langID = qgcApp()->toolbox()->settingsManager()->appSettings()->language()->rawValue().toInt();
    if(langID == 6 /*Korean*/) {
        return QString("fonts/NanumGothic-Regular");
    } else {
        return QString("opensans");
    }
}

QString
ScreenToolsController::boldFontFamily() const
{
    //-- See App.SettinsGroup.json for index
    int langID = qgcApp()->toolbox()->settingsManager()->appSettings()->language()->rawValue().toInt();
    if(langID == 6 /*Korean*/) {
        return QString("NanumGothic-Bold");
    } else {
        return QString("opensans-demibold");
    }
}