2018-05-15 22:14:17 +03:00
|
|
|
#include "designersettingmanager.h"
|
|
|
|
|
|
|
|
DesignerSettingManager::DesignerSettingManager(QObject *parent) : QObject(parent)
|
|
|
|
{
|
|
|
|
m_setting = new QSettings("LimeReport",QCoreApplication::applicationName());
|
|
|
|
}
|
|
|
|
|
|
|
|
DesignerSettingManager::~DesignerSettingManager()
|
|
|
|
{
|
|
|
|
delete m_setting;
|
|
|
|
}
|
|
|
|
|
|
|
|
void DesignerSettingManager::getAviableLanguages(QList<QLocale::Language>* languages)
|
|
|
|
{
|
|
|
|
languages->append(QLocale::Russian);
|
|
|
|
languages->append(QLocale::English);
|
|
|
|
languages->append(QLocale::Arabic);
|
2018-05-22 00:24:38 +03:00
|
|
|
languages->append(QLocale::French);
|
|
|
|
languages->append(QLocale::Chinese);
|
2018-05-15 22:14:17 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
QLocale::Language DesignerSettingManager::getCurrentDefaultLanguage()
|
|
|
|
{
|
|
|
|
m_setting->beginGroup("ReportDesigner");
|
|
|
|
QVariant v = m_setting->value("DesignerLanguage");
|
|
|
|
m_setting->endGroup();
|
|
|
|
if (v.isValid()){
|
|
|
|
return static_cast<QLocale::Language>(v.toInt()) ;
|
|
|
|
} else {
|
|
|
|
return QLocale::system().language();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void DesignerSettingManager::currentDefaulLanguageChanged(QLocale::Language language)
|
|
|
|
{
|
|
|
|
m_setting->beginGroup("ReportDesigner");
|
|
|
|
m_setting->setValue("DesignerLanguage", (int)language);
|
|
|
|
m_setting->endGroup();
|
|
|
|
}
|