mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-19 12:15:29 +08:00
Doxygen, style
This commit is contained in:
@@ -141,7 +141,7 @@ namespace BlackGui
|
|||||||
|
|
||||||
CDbMappingComponent::~CDbMappingComponent()
|
CDbMappingComponent::~CDbMappingComponent()
|
||||||
{
|
{
|
||||||
gracefulShutdown();
|
this->gracefulShutdown();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CDbMappingComponent::initVPilotLoading()
|
void CDbMappingComponent::initVPilotLoading()
|
||||||
@@ -197,22 +197,10 @@ namespace BlackGui
|
|||||||
const QObject *sender = QObject::sender();
|
const QObject *sender = QObject::sender();
|
||||||
|
|
||||||
// check if we have an explicit sender
|
// check if we have an explicit sender
|
||||||
if (sender == ui->tvp_AircraftModelsForVPilot)
|
if (sender == ui->tvp_AircraftModelsForVPilot) { return ui->tvp_AircraftModelsForVPilot->at(index); }
|
||||||
{
|
if (sender == ui->comp_OwnAircraftModels->view()) { return ui->comp_OwnAircraftModels->view()->at(index); }
|
||||||
return ui->tvp_AircraftModelsForVPilot->at(index);
|
if (sender == ui->comp_StashAircraft || sender == ui->comp_StashAircraft->view()) { return ui->comp_StashAircraft->view()->at(index); }
|
||||||
}
|
if (sender == ui->comp_OwnModelSet->view()) { return ui->comp_OwnModelSet->view()->at(index); }
|
||||||
else if (sender == ui->comp_OwnAircraftModels->view())
|
|
||||||
{
|
|
||||||
return ui->comp_OwnAircraftModels->view()->at(index);
|
|
||||||
}
|
|
||||||
else if (sender == ui->comp_StashAircraft || sender == ui->comp_StashAircraft->view())
|
|
||||||
{
|
|
||||||
return ui->comp_StashAircraft->view()->at(index);
|
|
||||||
}
|
|
||||||
else if (sender == ui->comp_OwnModelSet->view())
|
|
||||||
{
|
|
||||||
return ui->comp_OwnModelSet->view()->at(index);
|
|
||||||
}
|
|
||||||
|
|
||||||
// no sender, use current tab
|
// no sender, use current tab
|
||||||
const CAircraftModelView *v = this->currentModelView();
|
const CAircraftModelView *v = this->currentModelView();
|
||||||
@@ -245,9 +233,10 @@ namespace BlackGui
|
|||||||
const TabIndex tab = currentTabIndex();
|
const TabIndex tab = currentTabIndex();
|
||||||
switch (tab)
|
switch (tab)
|
||||||
{
|
{
|
||||||
case TabOwnModels: return ui->comp_OwnAircraftModels->view();
|
case TabOwnModels: return ui->comp_OwnAircraftModels->view();
|
||||||
case TabVPilot: return ui->tvp_AircraftModelsForVPilot;
|
case TabVPilot: return ui->tvp_AircraftModelsForVPilot;
|
||||||
case TabStash: return ui->comp_StashAircraft->view();
|
case TabWorkbench: return ui->comp_ModelWorkbench->view();
|
||||||
|
case TabStash: return ui->comp_StashAircraft->view();
|
||||||
case TabOwnModelSet: return ui->comp_OwnModelSet->view();
|
case TabOwnModelSet: return ui->comp_OwnModelSet->view();
|
||||||
default: return nullptr;
|
default: return nullptr;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,8 +24,6 @@
|
|||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QScopedPointer>
|
#include <QScopedPointer>
|
||||||
|
|
||||||
class QWidget;
|
|
||||||
|
|
||||||
namespace Ui { class CDbModelComponent; }
|
namespace Ui { class CDbModelComponent; }
|
||||||
namespace BlackGui
|
namespace BlackGui
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -7,8 +7,6 @@
|
|||||||
* contained in the LICENSE file.
|
* contained in the LICENSE file.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "blackcore/webdataservices.h"
|
|
||||||
#include "blackcore/db/databaseutils.h"
|
|
||||||
#include "blackgui/components/dbownmodelscomponent.h"
|
#include "blackgui/components/dbownmodelscomponent.h"
|
||||||
#include "blackgui/components/simulatorselector.h"
|
#include "blackgui/components/simulatorselector.h"
|
||||||
#include "blackgui/guiapplication.h"
|
#include "blackgui/guiapplication.h"
|
||||||
@@ -16,6 +14,8 @@
|
|||||||
#include "blackgui/menus/menuaction.h"
|
#include "blackgui/menus/menuaction.h"
|
||||||
#include "blackgui/models/aircraftmodellistmodel.h"
|
#include "blackgui/models/aircraftmodellistmodel.h"
|
||||||
#include "blackgui/views/aircraftmodelview.h"
|
#include "blackgui/views/aircraftmodelview.h"
|
||||||
|
#include "blackcore/webdataservices.h"
|
||||||
|
#include "blackcore/db/databaseutils.h"
|
||||||
#include "blackmisc/icons.h"
|
#include "blackmisc/icons.h"
|
||||||
#include "blackmisc/logmessage.h"
|
#include "blackmisc/logmessage.h"
|
||||||
#include "blackmisc/statusmessage.h"
|
#include "blackmisc/statusmessage.h"
|
||||||
|
|||||||
@@ -15,7 +15,6 @@
|
|||||||
#include "blackgui/menus/menudelegate.h"
|
#include "blackgui/menus/menudelegate.h"
|
||||||
#include "blackgui/overlaymessagesframe.h"
|
#include "blackgui/overlaymessagesframe.h"
|
||||||
#include "blackmisc/datacache.h"
|
#include "blackmisc/datacache.h"
|
||||||
#include "blackmisc/simulation/aircraftmodel.h"
|
|
||||||
#include "blackmisc/simulation/aircraftmodellist.h"
|
#include "blackmisc/simulation/aircraftmodellist.h"
|
||||||
#include "blackmisc/simulation/aircraftmodelloader.h"
|
#include "blackmisc/simulation/aircraftmodelloader.h"
|
||||||
#include "blackmisc/simulation/aircraftmodelinterfaces.h"
|
#include "blackmisc/simulation/aircraftmodelinterfaces.h"
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ namespace BlackGui
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
//! Constructor
|
||||||
explicit CInstallFsxTerrainProbeComponent(QWidget *parent = nullptr);
|
explicit CInstallFsxTerrainProbeComponent(QWidget *parent = nullptr);
|
||||||
|
|
||||||
//! Destructors
|
//! Destructors
|
||||||
|
|||||||
@@ -38,11 +38,11 @@ namespace BlackGui
|
|||||||
this->setCurrentIndex(0);
|
this->setCurrentIndex(0);
|
||||||
this->tabBar()->setExpanding(false);
|
this->tabBar()->setExpanding(false);
|
||||||
this->tabBar()->setUsesScrollButtons(true);
|
this->tabBar()->setUsesScrollButtons(true);
|
||||||
connect(ui->tvp_AllUsers, &CUserView::modelDataChangedDigest, this, &CUserComponent::ps_onCountChanged);
|
connect(ui->tvp_AllUsers, &CUserView::modelDataChangedDigest, this, &CUserComponent::onCountChanged);
|
||||||
connect(ui->tvp_Clients, &CClientView::modelDataChangedDigest, this, &CUserComponent::ps_onCountChanged);
|
connect(ui->tvp_Clients, &CClientView::modelDataChangedDigest, this, &CUserComponent::onCountChanged);
|
||||||
connect(sGui->getIContextNetwork(), &IContextNetwork::connectionStatusChanged, this, &CUserComponent::ps_connectionStatusChanged);
|
connect(sGui->getIContextNetwork(), &IContextNetwork::connectionStatusChanged, this, &CUserComponent::onConnectionStatusChanged);
|
||||||
connect(&m_updateTimer, &QTimer::timeout, this, &CUserComponent::update);
|
connect(&m_updateTimer, &QTimer::timeout, this, &CUserComponent::update);
|
||||||
this->ps_settingsChanged();
|
this->onSettingsChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
CUserComponent::~CUserComponent()
|
CUserComponent::~CUserComponent()
|
||||||
@@ -81,7 +81,7 @@ namespace BlackGui
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CUserComponent::ps_onCountChanged(int count, bool withFilter)
|
void CUserComponent::onCountChanged(int count, bool withFilter)
|
||||||
{
|
{
|
||||||
Q_UNUSED(count);
|
Q_UNUSED(count);
|
||||||
Q_UNUSED(withFilter);
|
Q_UNUSED(withFilter);
|
||||||
@@ -95,26 +95,26 @@ namespace BlackGui
|
|||||||
this->tabBar()->setTabText(ic, c);
|
this->tabBar()->setTabText(ic, c);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CUserComponent::ps_connectionStatusChanged(INetwork::ConnectionStatus from, INetwork::ConnectionStatus to)
|
void CUserComponent::onConnectionStatusChanged(INetwork::ConnectionStatus from, INetwork::ConnectionStatus to)
|
||||||
{
|
{
|
||||||
Q_UNUSED(from);
|
Q_UNUSED(from);
|
||||||
if (INetwork::isDisconnectedStatus(to))
|
if (INetwork::isDisconnectedStatus(to))
|
||||||
{
|
{
|
||||||
ui->tvp_AllUsers->clear();
|
ui->tvp_AllUsers->clear();
|
||||||
ui->tvp_Clients->clear();
|
ui->tvp_Clients->clear();
|
||||||
this->m_updateTimer.stop();
|
m_updateTimer.stop();
|
||||||
}
|
}
|
||||||
else if (INetwork::isConnectedStatus(to))
|
else if (INetwork::isConnectedStatus(to))
|
||||||
{
|
{
|
||||||
this->m_updateTimer.start();
|
m_updateTimer.start();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CUserComponent::ps_settingsChanged()
|
void CUserComponent::onSettingsChanged()
|
||||||
{
|
{
|
||||||
const CViewUpdateSettings settings = this->m_settings.get();
|
const CViewUpdateSettings settings = m_settings.get();
|
||||||
const int ms = settings.getAtcUpdateTime().toMs();
|
const int ms = settings.getAtcUpdateTime().toMs();
|
||||||
this->m_updateTimer.setInterval(ms);
|
m_updateTimer.setInterval(ms);
|
||||||
}
|
}
|
||||||
} // namespace
|
} // namespace
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|||||||
@@ -23,8 +23,6 @@
|
|||||||
#include <QtGlobal>
|
#include <QtGlobal>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
|
|
||||||
class QWidget;
|
|
||||||
|
|
||||||
namespace Ui { class CUserComponent; }
|
namespace Ui { class CUserComponent; }
|
||||||
namespace BlackGui
|
namespace BlackGui
|
||||||
{
|
{
|
||||||
@@ -42,7 +40,7 @@ namespace BlackGui
|
|||||||
explicit CUserComponent(QWidget *parent = nullptr);
|
explicit CUserComponent(QWidget *parent = nullptr);
|
||||||
|
|
||||||
//! Destructor
|
//! Destructor
|
||||||
~CUserComponent();
|
virtual ~CUserComponent();
|
||||||
|
|
||||||
//! Number of clients
|
//! Number of clients
|
||||||
int countClients() const;
|
int countClients() const;
|
||||||
@@ -54,20 +52,19 @@ namespace BlackGui
|
|||||||
//! Update users
|
//! Update users
|
||||||
void update();
|
void update();
|
||||||
|
|
||||||
private slots:
|
private:
|
||||||
//! Number of elements changed
|
//! Number of elements changed
|
||||||
void ps_onCountChanged(int count, bool withFilter);
|
void onCountChanged(int count, bool withFilter);
|
||||||
|
|
||||||
//! Connection status
|
//! Connection status
|
||||||
void ps_connectionStatusChanged(BlackCore::INetwork::ConnectionStatus from, BlackCore::INetwork::ConnectionStatus to);
|
void onConnectionStatusChanged(BlackCore::INetwork::ConnectionStatus from, BlackCore::INetwork::ConnectionStatus to);
|
||||||
|
|
||||||
//! Settings have been changed
|
//! Settings have been changed
|
||||||
void ps_settingsChanged();
|
void onSettingsChanged();
|
||||||
|
|
||||||
private:
|
|
||||||
QScopedPointer<Ui::CUserComponent> ui;
|
QScopedPointer<Ui::CUserComponent> ui;
|
||||||
QTimer m_updateTimer;
|
QTimer m_updateTimer;
|
||||||
BlackMisc::CSettingReadOnly<BlackGui::Settings::TViewUpdateSettings> m_settings { this, &CUserComponent::ps_settingsChanged };
|
BlackMisc::CSettingReadOnly<BlackGui::Settings::TViewUpdateSettings> m_settings { this, &CUserComponent::onSettingsChanged };
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -392,7 +392,7 @@ namespace BlackGui
|
|||||||
if (!m_menus.testFlag(MenuCanStashModels)) { return; }
|
if (!m_menus.testFlag(MenuCanStashModels)) { return; }
|
||||||
if (!this->hasSelection()) { return; }
|
if (!this->hasSelection()) { return; }
|
||||||
const CAircraftModelList models(this->selectedObjects());
|
const CAircraftModelList models(this->selectedObjects());
|
||||||
emit requestStash(models);
|
emit this->requestStash(models);
|
||||||
if (m_stashingClearsSelection)
|
if (m_stashingClearsSelection)
|
||||||
{
|
{
|
||||||
this->clearSelection();
|
this->clearSelection();
|
||||||
|
|||||||
@@ -38,17 +38,17 @@ namespace BlackMisc
|
|||||||
static const QString &persistentStore();
|
static const QString &persistentStore();
|
||||||
|
|
||||||
//! Save settings to disk.
|
//! Save settings to disk.
|
||||||
BlackMisc::CStatusMessage saveToStore(const QString &keyPrefix = {});
|
CStatusMessage saveToStore(const QString &keyPrefix = {});
|
||||||
|
|
||||||
//! Save settings to disk.
|
//! Save settings to disk.
|
||||||
BlackMisc::CStatusMessage saveToStore(const QStringList &keys);
|
CStatusMessage saveToStore(const QStringList &keys);
|
||||||
|
|
||||||
//! Connects signal CValueCache::valuesSaveRequested to a private slot that saves the values.
|
//! Connects signal CValueCache::valuesSaveRequested to a private slot that saves the values.
|
||||||
//! In a dbus distributed scenario, only call this method in the core process.
|
//! In a dbus distributed scenario, only call this method in the core process.
|
||||||
void enableLocalSave();
|
void enableLocalSave();
|
||||||
|
|
||||||
//! Load settings from disk.
|
//! Load settings from disk.
|
||||||
BlackMisc::CStatusMessage loadFromStore();
|
CStatusMessage loadFromStore();
|
||||||
|
|
||||||
//! Return the filename where the value with the given key may be stored.
|
//! Return the filename where the value with the given key may be stored.
|
||||||
static QString filenameForKey(const QString &key);
|
static QString filenameForKey(const QString &key);
|
||||||
|
|||||||
Reference in New Issue
Block a user