mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-20 12:35:43 +08:00
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:
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
7
src/blackmisc/settingsblackmiscclasses.h
Normal file
7
src/blackmisc/settingsblackmiscclasses.h
Normal file
@@ -0,0 +1,7 @@
|
||||
#ifndef BLACKMISC_SETTINGSBLACKMISCCLASSES_H
|
||||
#define BLACKMISC_SETTINGSBLACKMISCCLASSES_H
|
||||
|
||||
#include "blackmisc/setaudio.h"
|
||||
#include "blackmisc/setnetwork.h"
|
||||
|
||||
#endif // guard
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user