mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-01 05:26:45 +08:00
refs #485, removal of CEnableForRuntime
This commit is contained in:
committed by
Mathew Sutcliffe
parent
158efe819a
commit
3829aaeae8
@@ -9,6 +9,7 @@
|
||||
|
||||
#include "settingsnetworkcomponent.h"
|
||||
#include "ui_settingsnetworkcomponent.h"
|
||||
#include "blackgui/guiapplication.h"
|
||||
#include "blackcore/contextnetwork.h"
|
||||
|
||||
using namespace BlackCore;
|
||||
@@ -17,34 +18,26 @@ namespace BlackGui
|
||||
{
|
||||
namespace Components
|
||||
{
|
||||
|
||||
CSettingsNetworkComponent::CSettingsNetworkComponent(QWidget *parent) :
|
||||
QFrame(parent),
|
||||
ui(new Ui::CSettingsNetworkComponent)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
connect(this->ui->cb_FastPositionUpdates, &QCheckBox::released, this, &CSettingsNetworkComponent::ps_guiValuesChanged);
|
||||
bool enabled = sGui->getIContextNetwork()->isFastPositionSendingEnabled();
|
||||
this->ui->cb_FastPositionUpdates->setChecked(enabled);
|
||||
}
|
||||
|
||||
CSettingsNetworkComponent::~CSettingsNetworkComponent() { }
|
||||
|
||||
void CSettingsNetworkComponent::runtimeHasBeenSet()
|
||||
{
|
||||
Q_ASSERT(this->getIContextNetwork());
|
||||
bool enabled = this->getIContextNetwork()->isFastPositionSendingEnabled();
|
||||
this->ui->cb_FastPositionUpdates->setChecked(enabled);
|
||||
}
|
||||
|
||||
void CSettingsNetworkComponent::ps_guiValuesChanged()
|
||||
{
|
||||
Q_ASSERT(this->getIContextNetwork());
|
||||
QObject *sender = QObject::sender();
|
||||
if (sender == ui->cb_FastPositionUpdates)
|
||||
{
|
||||
bool enabled = this->ui->cb_FastPositionUpdates->isChecked();
|
||||
this->getIContextNetwork()->enableFastPositionSending(enabled);
|
||||
sGui->getIContextNetwork()->enableFastPositionSending(enabled);
|
||||
}
|
||||
}
|
||||
|
||||
} // ns
|
||||
} // ns
|
||||
|
||||
Reference in New Issue
Block a user