mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-03 15:45:46 +08:00
Rename xbus to xswiftbus
Summary: I wanted to rename xbus because its relation to //swift// is not immediately clear from the name. xswiftbus seems reasonable. Reviewers: #swift_pilot_client, kbasan Reviewed By: kbasan Subscribers: kbasan, jenkins Tags: #swift_pilot_client Differential Revision: https://dev.swift-project.org/D14
This commit is contained in:
@@ -26,12 +26,12 @@ namespace BlackSimPlugin
|
||||
namespace XPlane
|
||||
{
|
||||
/*!
|
||||
* Setting for XBus.
|
||||
* Setting for XSwiftBus.
|
||||
*/
|
||||
struct TXBusServer : public BlackMisc::TSettingTrait<QString>
|
||||
struct TXSwiftBusServer : public BlackMisc::TSettingTrait<QString>
|
||||
{
|
||||
//! \copydoc BlackMisc::TSettingTrait::key
|
||||
static const char *key() { return "xbus/server"; }
|
||||
static const char *key() { return "xswiftbus/server"; }
|
||||
|
||||
//! \copydoc BlackMisc::TSettingTrait::defaultValue
|
||||
static QString defaultValue() { return QStringLiteral("session"); }
|
||||
|
||||
@@ -32,9 +32,9 @@ using namespace BlackMisc;
|
||||
|
||||
namespace
|
||||
{
|
||||
QString xBusOriginDir()
|
||||
QString xSwiftBusOriginDir()
|
||||
{
|
||||
return CDirectoryUtils::applicationDirectoryPath() % QStringLiteral("/../xbus");
|
||||
return CDirectoryUtils::applicationDirectoryPath() % QStringLiteral("/../xswiftbus");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,19 +48,19 @@ namespace BlackSimPlugin
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
ui->cp_XBusServer->addItem(BlackMisc::CDBusServer::sessionBusAddress());
|
||||
ui->cp_XBusServer->addItem(BlackMisc::CDBusServer::systemBusAddress());
|
||||
ui->cp_XSwiftBusServer->addItem(BlackMisc::CDBusServer::sessionBusAddress());
|
||||
ui->cp_XSwiftBusServer->addItem(BlackMisc::CDBusServer::systemBusAddress());
|
||||
|
||||
connect(ui->bb_OkCancel, &QDialogButtonBox::accepted, this, &CSimulatorXPlaneConfigWindow::ps_storeSettings);
|
||||
connect(ui->bb_OkCancel, &QDialogButtonBox::accepted, this, &CSimulatorXPlaneConfigWindow::close);
|
||||
connect(ui->bb_OkCancel, &QDialogButtonBox::rejected, this, &CSimulatorXPlaneConfigWindow::close);
|
||||
|
||||
ui->cp_XBusServer->setCurrentText(m_xbusServerSetting.getThreadLocal());
|
||||
ui->cp_XSwiftBusServer->setCurrentText(m_xswiftbusServerSetting.getThreadLocal());
|
||||
|
||||
if (xBusAvailable())
|
||||
connect(ui->pb_InstallXBus, &QPushButton::clicked, this, &CSimulatorXPlaneConfigWindow::ps_installXBus);
|
||||
if (xSwiftBusAvailable())
|
||||
connect(ui->pb_InstallXSwiftBus, &QPushButton::clicked, this, &CSimulatorXPlaneConfigWindow::ps_installXSwiftBus);
|
||||
else
|
||||
ui->pb_InstallXBus->setEnabled(false);
|
||||
ui->pb_InstallXSwiftBus->setEnabled(false);
|
||||
}
|
||||
|
||||
CSimulatorXPlaneConfigWindow::~CSimulatorXPlaneConfigWindow()
|
||||
@@ -68,20 +68,20 @@ namespace BlackSimPlugin
|
||||
|
||||
}
|
||||
|
||||
bool CSimulatorXPlaneConfigWindow::xBusAvailable()
|
||||
bool CSimulatorXPlaneConfigWindow::xSwiftBusAvailable()
|
||||
{
|
||||
return QDir(xBusOriginDir()).exists();
|
||||
return QDir(xSwiftBusOriginDir()).exists();
|
||||
}
|
||||
|
||||
void CSimulatorXPlaneConfigWindow::ps_storeSettings()
|
||||
{
|
||||
if (ui->cp_XBusServer->currentText() != m_xbusServerSetting.getThreadLocal())
|
||||
if (ui->cp_XSwiftBusServer->currentText() != m_xswiftbusServerSetting.getThreadLocal())
|
||||
{
|
||||
m_xbusServerSetting.set(ui->cp_XBusServer->currentText());
|
||||
m_xswiftbusServerSetting.set(ui->cp_XSwiftBusServer->currentText());
|
||||
}
|
||||
}
|
||||
|
||||
void CSimulatorXPlaneConfigWindow::ps_installXBus()
|
||||
void CSimulatorXPlaneConfigWindow::ps_installXSwiftBus()
|
||||
{
|
||||
const QString xPlaneLocation = BlackMisc::Simulation::XPlane::CXPlaneUtil::xplaneRootDir();
|
||||
QString path = QFileDialog::getExistingDirectory(parentWidget(),
|
||||
@@ -99,17 +99,17 @@ namespace BlackSimPlugin
|
||||
return;
|
||||
}
|
||||
|
||||
path.append("/xbus");
|
||||
path.append("/xswiftbus");
|
||||
|
||||
// TODO Use QtConcurrent here, maybe?
|
||||
const bool result = BlackMisc::CFileUtils::copyRecursively(xBusOriginDir(), path);
|
||||
const bool result = BlackMisc::CFileUtils::copyRecursively(xSwiftBusOriginDir(), path);
|
||||
if (result)
|
||||
{
|
||||
QMessageBox::information(this, tr("XBus installed"), tr("You may now launch your X-Plane and start using XBus!"));
|
||||
QMessageBox::information(this, tr("XSwiftBus installed"), tr("You may now launch your X-Plane and start using XSwiftBus!"));
|
||||
}
|
||||
else
|
||||
{
|
||||
QMessageBox::warning(this, tr("Failed installing XBus"), tr("Failed installing the XBus plugin in your X-Plane installation directory; try installing it manually."));
|
||||
QMessageBox::warning(this, tr("Failed installing XSwiftBus"), tr("Failed installing the XSwiftBus plugin in your X-Plane installation directory; try installing it manually."));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,16 +42,16 @@ namespace BlackSimPlugin
|
||||
virtual ~CSimulatorXPlaneConfigWindow();
|
||||
|
||||
private:
|
||||
//! Checks whether xbus is present in the distributed directory.
|
||||
bool xBusAvailable();
|
||||
//! Checks whether xswiftbus is present in the distributed directory.
|
||||
bool xSwiftBusAvailable();
|
||||
|
||||
private slots:
|
||||
void ps_storeSettings();
|
||||
void ps_installXBus();
|
||||
void ps_installXSwiftBus();
|
||||
|
||||
private:
|
||||
QScopedPointer<Ui::CSimulatorXPlaneConfigWindow> ui;
|
||||
BlackMisc::CSetting<TXBusServer> m_xbusServerSetting { this };
|
||||
BlackMisc::CSetting<TXSwiftBusServer> m_xswiftbusServerSetting { this };
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,19 +15,19 @@
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="1">
|
||||
<widget class="QComboBox" name="cp_XBusServer"/>
|
||||
<widget class="QComboBox" name="cp_XSwiftBusServer"/>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="lbl_XBusServer">
|
||||
<widget class="QLabel" name="lbl_XSwiftBusServer">
|
||||
<property name="text">
|
||||
<string>XBus server:</string>
|
||||
<string>XSwiftBus server:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QPushButton" name="pb_InstallXBus">
|
||||
<widget class="QPushButton" name="pb_InstallXSwiftBus">
|
||||
<property name="text">
|
||||
<string>Install XBus in the X-Plane directory...</string>
|
||||
<string>Install XSwiftBus in the X-Plane directory...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
Reference in New Issue
Block a user