refs #273, added settings for simulator

* added class
* adjusted settings context
* adjusted "global" methods as register metadata
* improved settings utility
* renamed "settingsallclasses" as settings can also be in other namespaces, settingsallclasses now in core
This commit is contained in:
Klaus Basan
2014-06-25 19:12:00 +02:00
parent abd2d6d86d
commit 42db1fe9ae
15 changed files with 360 additions and 34 deletions

View File

@@ -9,7 +9,7 @@
#include "blackmisc/pqallquantities.h"
#include "blackmisc/avallclasses.h"
#include "blackmisc/geoallclasses.h"
#include "blackmisc/settingsallclasses.h"
#include "blackmisc/settingsblackmiscclasses.h"
#include "blackmisc/indexvariantmap.h"
#include "blackmisc/networkallclasses.h"
#include "blackmisc/statusmessagelist.h"

View File

@@ -9,7 +9,7 @@
#include "mathallclasses.h"
#include "geoallclasses.h"
#include "networkallclasses.h"
#include "settingsallclasses.h"
#include "settingsblackmiscclasses.h"
#include "hwallclasses.h"
#include "indexvariantmap.h"
#include "variant.h"

View File

@@ -191,15 +191,8 @@ namespace BlackMisc
if (command == CSettingUtilities::CmdUpdate())
{
QString v = value.toString();
if (this->m_bookingServiceUrl == v)
{
msgs.push_back(CSettingUtilities::valueNotChangedMessage("booking URL"));
}
else
{
changedFlag = true;
msgs.push_back(CSettingUtilities::valueChangedMessage("booking URL"));
}
msgs.push_back(CSettingUtilities::valueChangedMessage(v != this->m_bookingServiceUrl, "booking URL"));
this->m_bookingServiceUrl = v;
return msgs;
}
}

View File

@@ -1,12 +0,0 @@
/* Copyright (C) 2013 VATSIM Community / contributors
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef BLACKMISC_SETTINGSALLCLASSES_H
#define BLACKMISC_SETTINGSALLCLASSES_H
#include "blackmisc/setnetwork.h"
#include "blackmisc/setaudio.h"
#endif // guard

View File

@@ -0,0 +1,7 @@
#ifndef BLACKMISC_SETTINGSBLACKMISCCLASSES_H
#define BLACKMISC_SETTINGSBLACKMISCCLASSES_H
#include "blackmisc/setaudio.h"
#include "blackmisc/setnetwork.h"
#endif // guard

View File

@@ -37,7 +37,7 @@ namespace BlackMisc
CStatusMessage CSettingUtilities::valueNotChangedMessage(const QString &valueName)
{
return CStatusMessage(CStatusMessage::TypeSettings, CStatusMessage::SeverityWarning,
QString("Value %1 not changed").arg(valueName));
QString("Value '%1' not changed").arg(valueName));
}
/*
@@ -46,7 +46,17 @@ namespace BlackMisc
CStatusMessage CSettingUtilities::valueChangedMessage(const QString &valueName)
{
return CStatusMessage(CStatusMessage::TypeSettings, CStatusMessage::SeverityInfo,
QString("Value %1 changed").arg(valueName));
QString("Value '%1' changed").arg(valueName));
}
/*
* Value changed
*/
CStatusMessage CSettingUtilities::valueChangedMessage(bool changed, const QString &valueName)
{
return changed ?
valueChangedMessage(valueName) :
valueNotChangedMessage(valueName);
}
/*
@@ -100,6 +110,5 @@ namespace BlackMisc
static QString file(QString(CSettingUtilities::getSettingsDirectory()).append("/settings.json"));
return file;
}
}
}