mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-17 10:55:32 +08:00
Refactor X-Plane Plugin Config Window to use DBus server address selector
ref T291
This commit is contained in:
committed by
Klaus Basan
parent
488ff96ce6
commit
6a7a9ff710
@@ -27,11 +27,24 @@ namespace BlackSimPlugin
|
|||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
connect(ui->bb_OkCancel, &QDialogButtonBox::accepted, this, &CSimulatorXPlaneConfigWindow::close);
|
ui->comp_SettingsXSwiftBus->set(m_xswiftbusServerSetting.getThreadLocal());
|
||||||
|
|
||||||
|
connect(ui->bb_OkCancel, &QDialogButtonBox::accepted, this, &CSimulatorXPlaneConfigWindow::settingsAccepted);
|
||||||
connect(ui->bb_OkCancel, &QDialogButtonBox::rejected, this, &CSimulatorXPlaneConfigWindow::close);
|
connect(ui->bb_OkCancel, &QDialogButtonBox::rejected, this, &CSimulatorXPlaneConfigWindow::close);
|
||||||
}
|
}
|
||||||
|
|
||||||
CSimulatorXPlaneConfigWindow::~CSimulatorXPlaneConfigWindow()
|
CSimulatorXPlaneConfigWindow::~CSimulatorXPlaneConfigWindow()
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
|
void CSimulatorXPlaneConfigWindow::settingsAccepted()
|
||||||
|
{
|
||||||
|
QString currentAddress = m_xswiftbusServerSetting.getThreadLocal();
|
||||||
|
if (currentAddress != ui->comp_SettingsXSwiftBus->getDBusAddress())
|
||||||
|
{
|
||||||
|
m_xswiftbusServerSetting.set(ui->comp_SettingsXSwiftBus->getDBusAddress());
|
||||||
|
}
|
||||||
|
close();
|
||||||
|
}
|
||||||
|
|
||||||
} // ns
|
} // ns
|
||||||
} // ns
|
} // ns
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
#define BLACKSIMPLUGIN_SIMULATOR_XPLANE_CONFIG_WINDOW_H
|
#define BLACKSIMPLUGIN_SIMULATOR_XPLANE_CONFIG_WINDOW_H
|
||||||
|
|
||||||
#include "blackgui/pluginconfigwindow.h"
|
#include "blackgui/pluginconfigwindow.h"
|
||||||
|
#include "blackmisc/simulation/settings/xswiftbussettings.h"
|
||||||
#include "simulatorxplaneconfig.h"
|
#include "simulatorxplaneconfig.h"
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QScopedPointer>
|
#include <QScopedPointer>
|
||||||
@@ -39,7 +40,10 @@ namespace BlackSimPlugin
|
|||||||
virtual ~CSimulatorXPlaneConfigWindow();
|
virtual ~CSimulatorXPlaneConfigWindow();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
void settingsAccepted();
|
||||||
|
|
||||||
QScopedPointer<Ui::CSimulatorXPlaneConfigWindow> ui;
|
QScopedPointer<Ui::CSimulatorXPlaneConfigWindow> ui;
|
||||||
|
BlackMisc::CSetting<BlackMisc::Simulation::Settings::TXSwiftBusServer> m_xswiftbusServerSetting { this };
|
||||||
};
|
};
|
||||||
} // ns
|
} // ns
|
||||||
} // ns
|
} // ns
|
||||||
|
|||||||
@@ -6,14 +6,29 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>184</width>
|
<width>273</width>
|
||||||
<height>66</height>
|
<height>191</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>X-Plane plugin settings</string>
|
<string>X-Plane plugin settings</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gl_ConfigWindow">
|
<layout class="QGridLayout" name="gl_ConfigWindow">
|
||||||
|
<property name="leftMargin">
|
||||||
|
<number>5</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>5</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>5</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>5</number>
|
||||||
|
</property>
|
||||||
|
<property name="horizontalSpacing">
|
||||||
|
<number>2</number>
|
||||||
|
</property>
|
||||||
<item row="1" column="0">
|
<item row="1" column="0">
|
||||||
<widget class="QDialogButtonBox" name="bb_OkCancel">
|
<widget class="QDialogButtonBox" name="bb_OkCancel">
|
||||||
<property name="standardButtons">
|
<property name="standardButtons">
|
||||||
@@ -25,7 +40,7 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
<widget class="BlackGui::Components::CSettingsXSwiftBusComponent" name="comp_SettingsXSwiftBus">
|
<widget class="BlackGui::Components::CDBusServerAddressSelector" name="comp_SettingsXSwiftBus">
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>0</width>
|
<width>0</width>
|
||||||
@@ -38,9 +53,9 @@
|
|||||||
</widget>
|
</widget>
|
||||||
<customwidgets>
|
<customwidgets>
|
||||||
<customwidget>
|
<customwidget>
|
||||||
<class>BlackGui::Components::CSettingsXSwiftBusComponent</class>
|
<class>BlackGui::Components::CDBusServerAddressSelector</class>
|
||||||
<extends>QFrame</extends>
|
<extends>QFrame</extends>
|
||||||
<header>blackgui/components/settingsxswiftbuscomponent.h</header>
|
<header>blackgui/components/dbusserveraddressselector.h</header>
|
||||||
<container>1</container>
|
<container>1</container>
|
||||||
</customwidget>
|
</customwidget>
|
||||||
</customwidgets>
|
</customwidgets>
|
||||||
|
|||||||
Reference in New Issue
Block a user