refs #432 Doxygen, formatting, added new file types in *.pro

Minor tweaks:
* GUI infobar minimum size
* toogle lock protected
* removed unused function
* ASSERT_X
* object name
This commit is contained in:
Klaus Basan
2015-05-27 03:55:26 +02:00
parent 73164b2ffc
commit e695987fa2
24 changed files with 67 additions and 97 deletions

View File

@@ -174,6 +174,7 @@ namespace BlackCore
bool CAirspaceMonitor::updateFastPositionEnabled(const CCallsign &callsign, bool enableFastPositonUpdates, const BlackMisc::COriginator &originator) bool CAirspaceMonitor::updateFastPositionEnabled(const CCallsign &callsign, bool enableFastPositonUpdates, const BlackMisc::COriginator &originator)
{ {
//! \fixme CAirspaceMonitor: If in the long term originator is not used, remove from signature
Q_UNUSED(originator); Q_UNUSED(originator);
CPropertyIndexVariantMap vm(CSimulatedAircraft::IndexFastPositionUpdates, CVariant::fromValue(enableFastPositonUpdates)); CPropertyIndexVariantMap vm(CSimulatedAircraft::IndexFastPositionUpdates, CVariant::fromValue(enableFastPositonUpdates));
QWriteLocker l(&m_lockAircraft); QWriteLocker l(&m_lockAircraft);
@@ -183,6 +184,7 @@ namespace BlackCore
bool CAirspaceMonitor::updateAircraftRendered(const CCallsign &callsign, bool rendered, const BlackMisc::COriginator &originator) bool CAirspaceMonitor::updateAircraftRendered(const CCallsign &callsign, bool rendered, const BlackMisc::COriginator &originator)
{ {
//! \fixme CAirspaceMonitor: If in the long term originator is not used, remove from signature
Q_UNUSED(originator); Q_UNUSED(originator);
CPropertyIndexVariantMap vm(CSimulatedAircraft::IndexRendered, CVariant::fromValue(rendered)); CPropertyIndexVariantMap vm(CSimulatedAircraft::IndexRendered, CVariant::fromValue(rendered));
QWriteLocker l(&m_lockAircraft); QWriteLocker l(&m_lockAircraft);
@@ -192,6 +194,7 @@ namespace BlackCore
void CAirspaceMonitor::updateMarkAllAsNotRendered(const BlackMisc::COriginator &originator) void CAirspaceMonitor::updateMarkAllAsNotRendered(const BlackMisc::COriginator &originator)
{ {
//! \fixme CAirspaceMonitor: If in the long term originator is not used, remove from signature
Q_UNUSED(originator); Q_UNUSED(originator);
QWriteLocker l(&m_lockAircraft); QWriteLocker l(&m_lockAircraft);
m_aircraftInRange.markAllAsNotRendered(); m_aircraftInRange.markAllAsNotRendered();

View File

@@ -38,9 +38,6 @@ namespace BlackCore
} }
} }
/*
* Constructor
*/
IContextApplication::IContextApplication(CRuntimeConfig::ContextMode mode, CRuntime *runtime) : IContextApplication::IContextApplication(CRuntimeConfig::ContextMode mode, CRuntime *runtime) :
CContext(mode, runtime) CContext(mode, runtime)
{ {

View File

@@ -113,14 +113,6 @@ namespace BlackCore
return !this->m_contextApplication->isUsingImplementingObject(); return !this->m_contextApplication->isUsingImplementingObject();
} }
bool CRuntime::canPingApplicationContext() const
{
Q_ASSERT(this->m_contextApplication);
if (this->m_contextApplication->isUsingImplementingObject()) return true;
qint64 token = QDateTime::currentMSecsSinceEpoch();
return (token == this->m_contextApplication->ping(token));
}
void CRuntime::registerMetadata() void CRuntime::registerMetadata()
{ {
BlackMisc::registerMetadata(); BlackMisc::registerMetadata();

View File

@@ -148,9 +148,6 @@ namespace BlackCore
//! Remote application context, indicates distributed environment //! Remote application context, indicates distributed environment
bool hasRemoteApplicationContext() const; bool hasRemoteApplicationContext() const;
//! Is application context available?
bool canPingApplicationContext() const;
//! Register metadata //! Register metadata
static void registerMetadata(); static void registerMetadata();

View File

@@ -32,7 +32,7 @@ namespace BlackCore
CPluginStorageAware(pluginStorageProvider), CPluginStorageAware(pluginStorageProvider),
m_simulatorPluginInfo(info) m_simulatorPluginInfo(info)
{ {
this->setObjectName(info.getIdentifier()); this->setObjectName("Simulator:" + info.getIdentifier());
// provider signals // provider signals
m_remoteAircraftProviderConnections = this->m_remoteAircraftProvider->connectRemoteAircraftProviderSignals( m_remoteAircraftProviderConnections = this->m_remoteAircraftProvider->connectRemoteAircraftProviderSignals(

View File

@@ -46,7 +46,7 @@ RESOURCES +=
DESTDIR = $$BuildRoot/lib DESTDIR = $$BuildRoot/lib
DLLDESTDIR = $$BuildRoot/bin DLLDESTDIR = $$BuildRoot/bin
OTHER_FILES += ./qss/*.qss ./qss/*.css ./qss/*.ini OTHER_FILES += ./qss/*.qss ./qss/*.css ./qss/*.ini *.ico *.rc
win32:isEmpty(MINGW_IN_SHELL): COPY = xcopy /yi win32:isEmpty(MINGW_IN_SHELL): COPY = xcopy /yi
else: COPY = cp -r else: COPY = cp -r

View File

@@ -28,7 +28,6 @@ namespace BlackGui
{ {
CAudioSetupComponent::CAudioSetupComponent(QWidget *parent) : CAudioSetupComponent::CAudioSetupComponent(QWidget *parent) :
QFrame(parent), QFrame(parent),
CEnableForRuntime(nullptr, false),
ui(new Ui::CAudioSetupComponent) ui(new Ui::CAudioSetupComponent)
{ {
ui->setupUi(this); ui->setupUi(this);
@@ -45,11 +44,11 @@ namespace BlackGui
void CAudioSetupComponent::runtimeHasBeenSet() void CAudioSetupComponent::runtimeHasBeenSet()
{ {
if (!this->getIContextSettings()) qFatal("Settings missing"); Q_ASSERT_X(this->getIContextSettings(), Q_FUNC_INFO, "missing settings");
this->connect(this->getIContextSettings(), &IContextSettings::changedSettings, this, &CAudioSetupComponent::ps_changedSettings); this->connect(this->getIContextSettings(), &IContextSettings::changedSettings, this, &CAudioSetupComponent::ps_changedSettings);
// based on audio context // based on audio context
Q_ASSERT(this->getIContextAudio()); Q_ASSERT_X(this->getIContextAudio(), Q_FUNC_INFO, "missing audio");
if (this->getIContextAudio()) if (this->getIContextAudio())
{ {
this->initAudioDeviceLists(); this->initAudioDeviceLists();

View File

@@ -53,7 +53,6 @@ namespace BlackGui
void ps_onToggleFloating(bool floating); void ps_onToggleFloating(bool floating);
private: private:
// toggle area on show/hide details // toggle area on show/hide details
void toggleShowHideDetails(bool show, bool considerCurrentSize); void toggleShowHideDetails(bool show, bool considerCurrentSize);

View File

@@ -25,6 +25,7 @@ namespace BlackGui
ui->setupUi(this); ui->setupUi(this);
this->initInfoArea(); this->initInfoArea();
this->ps_setTabBarPosition(QTabWidget::North); this->ps_setTabBarPosition(QTabWidget::North);
this->ps_toggleTabBarLocked(true);
} }
CCockpitInfoAreaComponent::~CCockpitInfoAreaComponent() CCockpitInfoAreaComponent::~CCockpitInfoAreaComponent()

View File

@@ -66,7 +66,6 @@ namespace BlackGui
private: private:
BlackGui::CDockWidgetInfoArea *m_parentDockableInfoArea = nullptr; //!< my parent dockable widget BlackGui::CDockWidgetInfoArea *m_parentDockableInfoArea = nullptr; //!< my parent dockable widget
}; };
} }
} // namespace } // namespace

View File

@@ -34,12 +34,10 @@ namespace BlackGui
namespace Components namespace Components
{ {
/*! //! Component, which provides references to runtime objects
* \brief Component, which provides references to runtime objects //! \details Access to runtime allows to encapsualate many aspects of data access and makes
* \details Access to runtime allows to encapsualate many aspects of data access and makes //! the component widely independent from a central data provideer
* the component widely independent from a central data provideer //! \sa BlackCore::CRuntime
* \sa BlackCore::CRuntime
*/
class BLACKGUI_EXPORT CEnableForRuntime class BLACKGUI_EXPORT CEnableForRuntime
{ {
public: public:
@@ -119,9 +117,6 @@ namespace BlackGui
//! \copydoc CRuntime::hasRemoteApplicationContext //! \copydoc CRuntime::hasRemoteApplicationContext
bool hasRemoteApplicationContext() const { return this->m_runtime->hasRemoteApplicationContext(); } bool hasRemoteApplicationContext() const { return this->m_runtime->hasRemoteApplicationContext(); }
//! \copydoc CRuntime::canPingApplicationContext
bool canPingApplicationContext() const { return this->m_runtime->canPingApplicationContext(); }
//! Play a given notification sound //! Play a given notification sound
void playNotifcationSound(BlackSound::CNotificationSounds::Notification notification) const; void playNotifcationSound(BlackSound::CNotificationSounds::Notification notification) const;

View File

@@ -6,10 +6,16 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>415</width> <width>184</width>
<height>20</height> <height>20</height>
</rect> </rect>
</property> </property>
<property name="minimumSize">
<size>
<width>0</width>
<height>20</height>
</size>
</property>
<property name="windowTitle"> <property name="windowTitle">
<string>Info status bar</string> <string>Info status bar</string>
</property> </property>

View File

@@ -7,9 +7,9 @@
* contained in the LICENSE file. * contained in the LICENSE file.
*/ */
#include "dockwidgetinfoarea.h" #include "blackgui/dockwidgetinfoarea.h"
#include "infoarea.h" #include "blackgui/infoarea.h"
#include "components/maininfoareacomponent.h" #include "components/enablefordockwidgetinfoarea.h"
#include "blackmisc/icons.h" #include "blackmisc/icons.h"
using namespace BlackGui::Components; using namespace BlackGui::Components;
@@ -96,7 +96,7 @@ namespace BlackGui
QList<CEnableForDockWidgetInfoArea *> infoAreaDockWidgets = this->findEmbeddedDockWidgetInfoAreaComponents(); QList<CEnableForDockWidgetInfoArea *> infoAreaDockWidgets = this->findEmbeddedDockWidgetInfoAreaComponents();
foreach(CEnableForDockWidgetInfoArea * dwia, infoAreaDockWidgets) foreach(CEnableForDockWidgetInfoArea * dwia, infoAreaDockWidgets)
{ {
Q_ASSERT(dwia); Q_ASSERT_X(dwia, Q_FUNC_INFO, "Missing info area");
// KWB: potentially a risk when this object is deleted // KWB: potentially a risk when this object is deleted
// but under normal situations the child object will be deleted as well, and we have // but under normal situations the child object will be deleted as well, and we have

View File

@@ -1,11 +1,11 @@
/* Copyright (C) 2014 /* Copyright (C) 2014
* Swift Project Community / Contributors * 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 * 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, * 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 * including this file, may be copied, modified, propagated, or distributed except according to the terms
* contained in the LICENSE file. * contained in the LICENSE file.
*/ */
//! \file //! \file

View File

@@ -144,6 +144,9 @@ namespace BlackGui
//! \remarks North or South working, East / West not //! \remarks North or South working, East / West not
void ps_setTabBarPosition(QTabWidget::TabPosition position); void ps_setTabBarPosition(QTabWidget::TabPosition position);
//! Toogle lock tabbar
void ps_toggleTabBarLocked(bool locked);
private: private:
QList<CDockWidgetInfoArea *> m_dockWidgetInfoAreas ; QList<CDockWidgetInfoArea *> m_dockWidgetInfoAreas ;
QTabBar *m_tabBar = nullptr; QTabBar *m_tabBar = nullptr;
@@ -226,9 +229,6 @@ namespace BlackGui
//! Show tab bar //! Show tab bar
void ps_showTabBar(bool show); void ps_showTabBar(bool show);
//! Toogle lock tabbar
void ps_toggleTabBarLocked(bool locked);
//! Toggle tab position North - South //! Toggle tab position North - South
void ps_toggleTabBarPosition(); void ps_toggleTabBarPosition();

View File

@@ -20,9 +20,6 @@ namespace BlackGui
{ {
namespace Models namespace Models
{ {
/*
* Constructor
*/
CAirportListModel::CAirportListModel(QObject *parent) : CAirportListModel::CAirportListModel(QObject *parent) :
CListModelBase<BlackMisc::Aviation::CAirport, BlackMisc::Aviation::CAirportList>("ViewAirportList", parent) CListModelBase<BlackMisc::Aviation::CAirport, BlackMisc::Aviation::CAirportList>("ViewAirportList", parent)
{ {
@@ -45,5 +42,5 @@ namespace BlackGui
(void)QT_TRANSLATE_NOOP("ViewAirportList", "elevation"); (void)QT_TRANSLATE_NOOP("ViewAirportList", "elevation");
(void)QT_TRANSLATE_NOOP("ViewAirportList", "bearing"); (void)QT_TRANSLATE_NOOP("ViewAirportList", "bearing");
} }
} } // ns
} } // ns

View File

@@ -22,9 +22,7 @@ namespace BlackGui
namespace Models namespace Models
{ {
/*! //! Airport list model
* Airport list model
*/
class BLACKGUI_EXPORT CAirportListModel : public CListModelBase<BlackMisc::Aviation::CAirport, BlackMisc::Aviation::CAirportList> class BLACKGUI_EXPORT CAirportListModel : public CListModelBase<BlackMisc::Aviation::CAirport, BlackMisc::Aviation::CAirportList>
{ {

View File

@@ -62,10 +62,8 @@ namespace BlackGui
//! Set sort column //! Set sort column
virtual void setSortColumn(int column) { this->m_sortedColumn = column; } virtual void setSortColumn(int column) { this->m_sortedColumn = column; }
/*! //! Set column for sorting
* Set column for sorting //! \param propertyIndex index of column to be sorted
* \param propertyIndex index of column to be sorted
*/
virtual void setSortColumnByPropertyIndex(const BlackMisc::CPropertyIndex &propertyIndex); virtual void setSortColumnByPropertyIndex(const BlackMisc::CPropertyIndex &propertyIndex);
//! Get sort column property index //! Get sort column property index
@@ -100,11 +98,9 @@ namespace BlackGui
int ps_updateContainer(const BlackMisc::CVariant &variant, bool sort); int ps_updateContainer(const BlackMisc::CVariant &variant, bool sort);
protected: protected:
/*! //! Constructor
* Constructor //! \param translationContext I18N context
* \param translationContext I18N context //! \param parent
* \param parent
*/
CListModelBaseNonTemplate(const QString &translationContext, QObject *parent = nullptr) CListModelBaseNonTemplate(const QString &translationContext, QObject *parent = nullptr)
: QAbstractItemModel(parent), m_columns(translationContext), m_sortedColumn(-1), m_sortOrder(Qt::AscendingOrder) : QAbstractItemModel(parent), m_columns(translationContext), m_sortedColumn(-1), m_sortOrder(Qt::AscendingOrder)
{ {
@@ -217,11 +213,9 @@ namespace BlackGui
protected: protected:
std::unique_ptr<IModelFilter<ContainerType> > m_filter; //!< Used filter std::unique_ptr<IModelFilter<ContainerType> > m_filter; //!< Used filter
/*! //! Constructor
* Constructor //! \param translationContext I18N context
* \param translationContext I18N context //! \param parent
* \param parent
*/
CListModelBase(const QString &translationContext, QObject *parent = nullptr) CListModelBase(const QString &translationContext, QObject *parent = nullptr)
: CListModelBaseNonTemplate(translationContext, parent) : CListModelBaseNonTemplate(translationContext, parent)
{ } { }

View File

@@ -14,12 +14,8 @@ namespace BlackGui
{ {
namespace Models namespace Models
{ {
/*
* Constructor
*/
CServerListModel::CServerListModel(QObject *parent) : CServerListModel::CServerListModel(QObject *parent) :
CListModelBase("ViewServerList", parent) CListModelBase("ModelServerList", parent)
{ {
this->m_columns.addColumn(CColumn::standardString("name", CServer::IndexName)); this->m_columns.addColumn(CColumn::standardString("name", CServer::IndexName));
this->m_columns.addColumn(CColumn::standardString("description", CServer::IndexDescription)); this->m_columns.addColumn(CColumn::standardString("description", CServer::IndexDescription));
@@ -29,12 +25,12 @@ namespace BlackGui
this->m_columns.addColumn(CColumn::standardString("userid", { CServer::IndexUser, CUser::IndexId})); this->m_columns.addColumn(CColumn::standardString("userid", { CServer::IndexUser, CUser::IndexId}));
// force strings for translation in resource files // force strings for translation in resource files
(void)QT_TRANSLATE_NOOP("ViewServerList", "name"); (void)QT_TRANSLATE_NOOP("ModelServerList", "name");
(void)QT_TRANSLATE_NOOP("ViewServerList", "description"); (void)QT_TRANSLATE_NOOP("ModelServerList", "description");
(void)QT_TRANSLATE_NOOP("ViewServerList", "address"); (void)QT_TRANSLATE_NOOP("ModelServerList", "address");
(void)QT_TRANSLATE_NOOP("ViewServerList", "port"); (void)QT_TRANSLATE_NOOP("ModelServerList", "port");
(void)QT_TRANSLATE_NOOP("ViewServerList", "realname"); (void)QT_TRANSLATE_NOOP("ModelServerList", "realname");
(void)QT_TRANSLATE_NOOP("ViewServerList", "userid"); (void)QT_TRANSLATE_NOOP("ModelServerList", "userid");
} }
} // class } // class

View File

@@ -24,7 +24,6 @@ namespace BlackGui
//! Server list model //! Server list model
class BLACKGUI_EXPORT CServerListModel : public CListModelBase<BlackMisc::Network::CServer, BlackMisc::Network::CServerList> class BLACKGUI_EXPORT CServerListModel : public CListModelBase<BlackMisc::Network::CServer, BlackMisc::Network::CServerList>
{ {
public: public:
//! Constructor //! Constructor
@@ -33,6 +32,6 @@ namespace BlackGui
//! Destructor //! Destructor
virtual ~CServerListModel() {} virtual ~CServerListModel() {}
}; };
} } // ns
} } // ns
#endif // guard #endif // guard

View File

@@ -21,9 +21,6 @@ namespace BlackGui
{ {
namespace Models namespace Models
{ {
/*
* Constructor
*/
CSimulatedAircraftListModel::CSimulatedAircraftListModel(QObject *parent) : CListModelBase("ModelSimulatedAircraftList", parent) CSimulatedAircraftListModel::CSimulatedAircraftListModel(QObject *parent) : CListModelBase("ModelSimulatedAircraftList", parent)
{ {
this->setAircraftMode(InfoMode); this->setAircraftMode(InfoMode);

View File

@@ -18,9 +18,6 @@ namespace BlackGui
{ {
namespace Models namespace Models
{ {
/*
* Constructor
*/
CTextMessageListModel::CTextMessageListModel(TextMessageMode mode, QObject *parent) : CTextMessageListModel::CTextMessageListModel(TextMessageMode mode, QObject *parent) :
CListModelBase("ModelTextMessageList", parent), m_textMessageMode(NotSet) CListModelBase("ModelTextMessageList", parent), m_textMessageMode(NotSet)
{ {

View File

@@ -23,7 +23,7 @@ namespace BlackGui
{ {
namespace Models namespace Models
{ {
//! ATC list model //! Text message list model
class BLACKGUI_EXPORT CTextMessageListModel : public CListModelBase<BlackMisc::Network::CTextMessage, BlackMisc::Network::CTextMessageList> class BLACKGUI_EXPORT CTextMessageListModel : public CListModelBase<BlackMisc::Network::CTextMessage, BlackMisc::Network::CTextMessageList>
{ {
@@ -51,6 +51,6 @@ namespace BlackGui
private: private:
TextMessageMode m_textMessageMode = NotSet; TextMessageMode m_textMessageMode = NotSet;
}; };
} } // ns
} } // ns
#endif // guard #endif // guard

View File

@@ -8,6 +8,7 @@
*/ */
#include "joystick_windows.h" #include "joystick_windows.h"
#include "blackmisc/logmessage.h"
#include <QDebug> #include <QDebug>
// Qt5 defines UNICODE, hence we can expect an wchar_t strings. // Qt5 defines UNICODE, hence we can expect an wchar_t strings.
@@ -15,6 +16,7 @@
// using ascii functions of WINAPI. To fix it, introduce #ifdef UNICODE and add char // using ascii functions of WINAPI. To fix it, introduce #ifdef UNICODE and add char
// handling in the second branch. // handling in the second branch.
using namespace BlackMisc;
using namespace BlackMisc::Hardware; using namespace BlackMisc::Hardware;
namespace BlackInput namespace BlackInput
@@ -33,7 +35,7 @@ namespace BlackInput
initDirectInput(); initDirectInput();
enumJoystickDevices(); enumJoystickDevices();
if (!m_availableJoystickDevices.isEmpty()) createJoystickDevice(); if (!m_availableJoystickDevices.isEmpty()) { createJoystickDevice(); }
} }
CJoystickWindows::~CJoystickWindows() CJoystickWindows::~CJoystickWindows()
@@ -48,7 +50,7 @@ namespace BlackInput
void CJoystickWindows::triggerButton(const CJoystickButton button, bool isPressed) void CJoystickWindows::triggerButton(const CJoystickButton button, bool isPressed)
{ {
if(!isPressed) emit buttonUp(button); if (!isPressed) emit buttonUp(button);
else emit buttonDown(button); else emit buttonDown(button);
} }
@@ -70,16 +72,15 @@ namespace BlackInput
HINSTANCE instance = GetModuleHandle(nullptr); HINSTANCE instance = GetModuleHandle(nullptr);
if (instance == nullptr) if (instance == nullptr)
{ {
qWarning() << "GetModuleHandle() failed with error code" << GetLastError(); CLogMessage(this).error("GetModuleHandle() failed with error code: %1") << GetLastError();
return E_FAIL; return E_FAIL;
} }
if (FAILED(hr = m_directInput->Initialize(instance, DIRECTINPUT_VERSION))) if (FAILED(hr = m_directInput->Initialize(instance, DIRECTINPUT_VERSION)))
{ {
// TODO Print an error CLogMessage(this).error("Direct input init failed");
return hr; return hr;
} }
return hr; return hr;
} }
@@ -88,11 +89,14 @@ namespace BlackInput
HRESULT hr; HRESULT hr;
if (FAILED(hr = m_directInput->EnumDevices(DI8DEVTYPE_JOYSTICK, enumJoysticksCallback, this, DIEDFL_ATTACHEDONLY))) if (FAILED(hr = m_directInput->EnumDevices(DI8DEVTYPE_JOYSTICK, enumJoysticksCallback, this, DIEDFL_ATTACHEDONLY)))
{ {
// TODO print error message CLogMessage(this).error("Error reading joystick devices");
return hr; return hr;
} }
if (m_availableJoystickDevices.isEmpty()) qWarning() << "No joystick device found!"; if (m_availableJoystickDevices.isEmpty())
{
CLogMessage(this).info("No joystick device found");
}
return hr; return hr;
} }