mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-04 16:56:53 +08:00
refs #485, removal of CEnableForRuntime
This commit is contained in:
committed by
Mathew Sutcliffe
parent
158efe819a
commit
3829aaeae8
@@ -1,5 +1,15 @@
|
||||
/* Copyright (C) 2015
|
||||
* swift project Community / Contributors
|
||||
*
|
||||
* This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level
|
||||
* directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project,
|
||||
* including this file, may be copied, modified, propagated, or distributed except according to the terms
|
||||
* contained in the LICENSE file.
|
||||
*/
|
||||
|
||||
#include "simconnectsettingscomponent.h"
|
||||
#include "ui_simconnectsettingscomponent.h"
|
||||
#include "blackgui/guiapplication.h"
|
||||
#include "blackcore/contextapplication.h"
|
||||
#include "blackcore/contextsimulator.h"
|
||||
#include "blackmisc/network/networkutils.h"
|
||||
@@ -20,7 +30,6 @@ namespace BlackSimPlugin
|
||||
{
|
||||
namespace Fsx
|
||||
{
|
||||
|
||||
CSimConnectSettingsComponent::CSimConnectSettingsComponent(QWidget *parent) :
|
||||
QFrame(parent),
|
||||
ui(new Ui::CSimConnectSettingsComponent)
|
||||
@@ -36,7 +45,7 @@ namespace BlackSimPlugin
|
||||
|
||||
CSimConnectSettingsComponent::~CSimConnectSettingsComponent()
|
||||
{
|
||||
|
||||
// void
|
||||
}
|
||||
|
||||
void CSimConnectSettingsComponent::openSimConnectCfgFile()
|
||||
@@ -49,7 +58,7 @@ namespace BlackSimPlugin
|
||||
void CSimConnectSettingsComponent::deleteSimConnectCfgFile()
|
||||
{
|
||||
QString fileName = CSimConnectUtilities::getLocalSimConnectCfgFilename();
|
||||
bool result = getIContextApplication()->removeFile(fileName);
|
||||
bool result = sGui->getIContextApplication()->removeFile(fileName);
|
||||
if (result)
|
||||
{
|
||||
QMessageBox::information(qApp->activeWindow(), tr("File deleted"),
|
||||
@@ -62,7 +71,7 @@ namespace BlackSimPlugin
|
||||
void CSimConnectSettingsComponent::checkSimConnectCfgFile()
|
||||
{
|
||||
QString fileName = CSimConnectUtilities::getLocalSimConnectCfgFilename();
|
||||
if (getIContextApplication()->existsFile(fileName))
|
||||
if (sGui->getIContextApplication()->existsFile(fileName))
|
||||
{
|
||||
ui->le_SettingsFsxExistsSimconncetCfg->setText(fileName);
|
||||
}
|
||||
@@ -134,9 +143,9 @@ namespace BlackSimPlugin
|
||||
int p = port.toInt();
|
||||
QString fileName;
|
||||
|
||||
if (getIContextSimulator())
|
||||
if (sGui->getIContextSimulator())
|
||||
{
|
||||
fileName = getIContextSimulator()->getSimulatorSetup().getStringValue(CFsxSimulatorSetup::KeyLocalSimConnectCfgFilename());
|
||||
fileName = sGui->getIContextSimulator()->getSimulatorSetup().getStringValue(CFsxSimulatorSetup::KeyLocalSimConnectCfgFilename());
|
||||
}
|
||||
|
||||
if (fileName.isEmpty())
|
||||
@@ -151,7 +160,7 @@ namespace BlackSimPlugin
|
||||
return;
|
||||
}
|
||||
|
||||
if (getIContextApplication()->writeToFile(fileName, CSimConnectUtilities::simConnectCfg(address, p)))
|
||||
if (sGui->getIContextApplication()->writeToFile(fileName, CSimConnectUtilities::simConnectCfg(address, p)))
|
||||
{
|
||||
QMessageBox::information(qApp->activeWindow(), tr("File saved"),
|
||||
tr("File %1 saved.").arg(fileName));
|
||||
@@ -163,6 +172,5 @@ namespace BlackSimPlugin
|
||||
tr("Failed writing %1!").arg(fileName));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
} // ns
|
||||
} // ns
|
||||
|
||||
@@ -14,11 +14,8 @@
|
||||
|
||||
#include <QFrame>
|
||||
#include <QScopedPointer>
|
||||
#include "blackgui/components/enableforruntime.h"
|
||||
|
||||
namespace Ui {
|
||||
class CSimConnectSettingsComponent;
|
||||
}
|
||||
namespace Ui { class CSimConnectSettingsComponent; }
|
||||
|
||||
namespace BlackSimPlugin
|
||||
{
|
||||
@@ -27,7 +24,7 @@ namespace BlackSimPlugin
|
||||
/**
|
||||
* A component that gathers all SimConnect-related settings.
|
||||
*/
|
||||
class CSimConnectSettingsComponent : public QFrame, public BlackGui::Components::CEnableForRuntime
|
||||
class CSimConnectSettingsComponent : public QFrame
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@@ -56,10 +53,8 @@ namespace BlackSimPlugin
|
||||
|
||||
private:
|
||||
QScopedPointer<Ui::CSimConnectSettingsComponent> ui;
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
} // ns
|
||||
} // ns
|
||||
|
||||
#endif // guard
|
||||
|
||||
Reference in New Issue
Block a user