Formatting

This commit is contained in:
Klaus Basan
2014-11-05 16:36:43 +01:00
committed by Roland Winklmeier
parent 016537f257
commit 9a920367b2
14 changed files with 69 additions and 27 deletions

View File

@@ -1,7 +1,11 @@
/* Copyright (C) 2013 VATSIM Community / contributors /* Copyright (C) 2013
* This Source Code Form is subject to the terms of the Mozilla Public * swift Project Community / Contributors
* License, v. 2.0. If a copy of the MPL was not distributed with this *
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * 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 "context_audio.h" #include "context_audio.h"
#include "context_audio_impl.h" #include "context_audio_impl.h"

View File

@@ -1,7 +1,11 @@
/* Copyright (C) 2013 VATSIM Community / authors /* Copyright (C) 2013
* This Source Code Form is subject to the terms of the Mozilla Public * swift Project Community / Contributors
* License, v. 2.0. If a copy of the MPL was not distributed with this *
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * 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 "context_audio_proxy.h" #include "context_audio_proxy.h"
#include <QDBusConnection> #include <QDBusConnection>
@@ -227,6 +231,9 @@ namespace BlackCore
return this->m_dBusInterface->callDBusRet<bool>(QLatin1Literal("isMuted")); return this->m_dBusInterface->callDBusRet<bool>(QLatin1Literal("isMuted"));
} }
/*
* Loopback
*/
void CContextAudioProxy::enableAudioLoopback(bool enable) void CContextAudioProxy::enableAudioLoopback(bool enable)
{ {
return this->m_dBusInterface->callDBus(QLatin1Literal("enableAudioLoopback"), enable); return this->m_dBusInterface->callDBus(QLatin1Literal("enableAudioLoopback"), enable);

View File

@@ -1,7 +1,11 @@
/* Copyright (C) 2013 VATSIM Community / authors /* Copyright (C) 2014
* This Source Code Form is subject to the terms of the Mozilla Public * swift project community / contributors
* License, v. 2.0. If a copy of the MPL was not distributed with this *
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * 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 "context_ownaircraft_impl.h" #include "context_ownaircraft_impl.h"
#include "context_network.h" #include "context_network.h"

View File

@@ -7,6 +7,8 @@
* contained in the LICENSE file. * contained in the LICENSE file.
*/ */
//! \file
#ifndef BLACKCORE_VOICE_CHANNEL_H #ifndef BLACKCORE_VOICE_CHANNEL_H
#define BLACKCORE_VOICE_CHANNEL_H #define BLACKCORE_VOICE_CHANNEL_H

View File

@@ -85,7 +85,7 @@ namespace BlackGui
void CAircraftComponent::runtimeHasBeenSet() void CAircraftComponent::runtimeHasBeenSet()
{ {
connect(this->getParentInfoArea(), &CInfoArea::tabBarCurrentChanged, this, &CAircraftComponent::ps_infoAreaTabBarChanged); connect(this->getParentInfoArea(), &CInfoArea::changedInfoAreaTabBarIndex, this, &CAircraftComponent::ps_infoAreaTabBarChanged);
} }
void CAircraftComponent::ps_infoAreaTabBarChanged(int index) void CAircraftComponent::ps_infoAreaTabBarChanged(int index)

View File

@@ -90,7 +90,7 @@ namespace BlackGui
this->connect(this->getIContextNetwork(), &IContextNetwork::changedAtcStationOnlineConnectionStatus, this, &CAtcStationComponent::changedAtcStationOnlineConnectionStatus); this->connect(this->getIContextNetwork(), &IContextNetwork::changedAtcStationOnlineConnectionStatus, this, &CAtcStationComponent::changedAtcStationOnlineConnectionStatus);
this->connect(this->getIContextNetwork(), &IContextNetwork::connectionStatusChanged, this, &CAtcStationComponent::ps_connectionStatusChanged); this->connect(this->getIContextNetwork(), &IContextNetwork::connectionStatusChanged, this, &CAtcStationComponent::ps_connectionStatusChanged);
} }
connect(this->getParentInfoArea(), &CInfoArea::tabBarCurrentChanged, this, &CAtcStationComponent::ps_infoAreaTabBarChanged); connect(this->getParentInfoArea(), &CInfoArea::changedInfoAreaTabBarIndex, this, &CAtcStationComponent::ps_infoAreaTabBarChanged);
} }
void CAtcStationComponent::update() void CAtcStationComponent::update()

View File

@@ -108,9 +108,13 @@ namespace BlackGui
CFlightPlan::FlightRules rule = CFlightPlan::IFR; CFlightPlan::FlightRules rule = CFlightPlan::IFR;
if (this->ui->rb_TypeIfr->isChecked()) if (this->ui->rb_TypeIfr->isChecked())
{
rule = CFlightPlan::IFR; rule = CFlightPlan::IFR;
}
else if (this->ui->rb_TypeVfr->isChecked()) else if (this->ui->rb_TypeVfr->isChecked())
{
rule = CFlightPlan::VFR; rule = CFlightPlan::VFR;
}
flightPlan.setFlightRule(rule); flightPlan.setFlightRule(rule);
v = ui->le_Callsign->text().trimmed(); v = ui->le_Callsign->text().trimmed();
@@ -129,7 +133,9 @@ namespace BlackGui
messages.push_back(CLogMessage().validationWarning("Flight plan route length exceeded (%1 chars max.)") << CFlightPlan::MaxRouteLength); messages.push_back(CLogMessage().validationWarning("Flight plan route length exceeded (%1 chars max.)") << CFlightPlan::MaxRouteLength);
} }
else else
{
flightPlan.setRoute(v); flightPlan.setRoute(v);
}
v = ui->pte_Remarks->toPlainText().trimmed(); v = ui->pte_Remarks->toPlainText().trimmed();
if (v.isEmpty()) if (v.isEmpty())
@@ -141,7 +147,9 @@ namespace BlackGui
messages.push_back(CLogMessage().validationWarning("Flight plan remarks length exceeded (%1 chars max.)") << CFlightPlan::MaxRemarksLength); messages.push_back(CLogMessage().validationWarning("Flight plan remarks length exceeded (%1 chars max.)") << CFlightPlan::MaxRemarksLength);
} }
else else
{
flightPlan.setRemarks(v); flightPlan.setRemarks(v);
}
v = ui->le_EstimatedTimeEnroute->text(); v = ui->le_EstimatedTimeEnroute->text();
if (v.isEmpty() || v == defaultTime()) if (v.isEmpty() || v == defaultTime())
@@ -149,7 +157,9 @@ namespace BlackGui
messages.push_back(CLogMessage().validationWarning("Missing %1") << this->ui->lbl_EstimatedTimeEnroute->text()); messages.push_back(CLogMessage().validationWarning("Missing %1") << this->ui->lbl_EstimatedTimeEnroute->text());
} }
else else
{
flightPlan.setEnrouteTime(v); flightPlan.setEnrouteTime(v);
}
v = ui->le_FuelOnBoard->text(); v = ui->le_FuelOnBoard->text();
if (v.isEmpty() || v == defaultTime()) if (v.isEmpty() || v == defaultTime())
@@ -157,7 +167,9 @@ namespace BlackGui
messages.push_back(CLogMessage().validationWarning("Missing %1") << this->ui->lbl_FuelOnBorad->text()); messages.push_back(CLogMessage().validationWarning("Missing %1") << this->ui->lbl_FuelOnBorad->text());
} }
else else
{
flightPlan.setFuelTime(v); flightPlan.setFuelTime(v);
}
v = ui->le_TakeOffTimePlanned->text(); v = ui->le_TakeOffTimePlanned->text();
if (v.isEmpty() || v == defaultTime()) if (v.isEmpty() || v == defaultTime())
@@ -165,7 +177,9 @@ namespace BlackGui
messages.push_back(CLogMessage().validationWarning("Missing %1") << this->ui->lbl_TakeOffTimePlanned->text()); messages.push_back(CLogMessage().validationWarning("Missing %1") << this->ui->lbl_TakeOffTimePlanned->text());
} }
else else
{
flightPlan.setTakeoffTimePlanned(v); flightPlan.setTakeoffTimePlanned(v);
}
static const QRegExp withUnit("\\D+"); static const QRegExp withUnit("\\D+");
v = ui->le_CrusingAltitude->text().trimmed(); v = ui->le_CrusingAltitude->text().trimmed();
@@ -181,7 +195,9 @@ namespace BlackGui
messages.push_back(CLogMessage().validationWarning("Wrong %1") << this->ui->lbl_CrusingAltitude->text()); messages.push_back(CLogMessage().validationWarning("Wrong %1") << this->ui->lbl_CrusingAltitude->text());
} }
else else
{
flightPlan.setCruiseAltitude(cruisingAltitude); flightPlan.setCruiseAltitude(cruisingAltitude);
}
v = this->ui->le_AlternateAirport->text(); v = this->ui->le_AlternateAirport->text();
if (v.isEmpty() || v.endsWith(defaultIcao(), Qt::CaseInsensitive)) if (v.isEmpty() || v.endsWith(defaultIcao(), Qt::CaseInsensitive))
@@ -190,7 +206,9 @@ namespace BlackGui
flightPlan.setAlternateAirportIcao(defaultIcao()); flightPlan.setAlternateAirportIcao(defaultIcao());
} }
else else
{
flightPlan.setAlternateAirportIcao(v); flightPlan.setAlternateAirportIcao(v);
}
v = this->ui->le_DestinationAirport->text(); v = this->ui->le_DestinationAirport->text();
if (v.isEmpty() || v.endsWith(defaultIcao(), Qt::CaseInsensitive)) if (v.isEmpty() || v.endsWith(defaultIcao(), Qt::CaseInsensitive))
@@ -199,7 +217,9 @@ namespace BlackGui
flightPlan.setDestinationAirportIcao(defaultIcao()); flightPlan.setDestinationAirportIcao(defaultIcao());
} }
else else
{
flightPlan.setDestinationAirportIcao(v); flightPlan.setDestinationAirportIcao(v);
}
v = this->ui->le_CruiseTrueAirspeed->text(); v = this->ui->le_CruiseTrueAirspeed->text();
BlackMisc::PhysicalQuantities::CSpeed cruiseTAS; BlackMisc::PhysicalQuantities::CSpeed cruiseTAS;
@@ -210,7 +230,9 @@ namespace BlackGui
flightPlan.setDestinationAirportIcao(defaultIcao()); flightPlan.setDestinationAirportIcao(defaultIcao());
} }
else else
{
flightPlan.setCruiseTrueAirspeed(cruiseTAS); flightPlan.setCruiseTrueAirspeed(cruiseTAS);
}
v = this->ui->le_OriginAirport->text(); v = this->ui->le_OriginAirport->text();
if (v.isEmpty() || v.endsWith(defaultIcao(), Qt::CaseInsensitive)) if (v.isEmpty() || v.endsWith(defaultIcao(), Qt::CaseInsensitive))
@@ -219,7 +241,9 @@ namespace BlackGui
flightPlan.setOriginAirportIcao(defaultIcao()); flightPlan.setOriginAirportIcao(defaultIcao());
} }
else else
{
flightPlan.setOriginAirportIcao(v); flightPlan.setOriginAirportIcao(v);
}
return messages; return messages;
} }

View File

@@ -33,7 +33,7 @@ namespace BlackGui
//! Constructor //! Constructor
explicit CInfoBarStatusComponent(QWidget *parent = nullptr); explicit CInfoBarStatusComponent(QWidget *parent = nullptr);
//!Constructor //!Destructor
~CInfoBarStatusComponent(); ~CInfoBarStatusComponent();
//! Init the LEDs //! Init the LEDs

View File

@@ -118,8 +118,9 @@ namespace BlackGui
} }
} }
void CDockWidget::initalFloating() void CDockWidget::initialFloating()
{ {
// for the first time resize // for the first time resize
if (!this->m_preferredSizeWhenFloating.isNull()) if (!this->m_preferredSizeWhenFloating.isNull())
{ {

View File

@@ -113,7 +113,7 @@ namespace BlackGui
//! Widget is initialized by being a floating window for a shot period. //! Widget is initialized by being a floating window for a shot period.
//! \details Place where - when overidden - post initializations can take place. //! \details Place where - when overidden - post initializations can take place.
//! The GUI is already initialized, so all widget data are available. //! The GUI is already initialized, so all widget data are available.
virtual void initalFloating(); virtual void initialFloating();
protected slots: protected slots:
//! Style sheet has changed //! Style sheet has changed

View File

@@ -90,9 +90,9 @@ namespace BlackGui
} }
} }
void CDockWidgetInfoArea::initalFloating() void CDockWidgetInfoArea::initialFloating()
{ {
CDockWidget::initalFloating(); // initial floating to init position & size CDockWidget::initialFloating(); // initial floating to init position & size
QList<CEnableForDockWidgetInfoArea *> infoAreaDockWidgets = this->findEmbeddedDockWidgetInfoAreaComponents(); QList<CEnableForDockWidgetInfoArea *> infoAreaDockWidgets = this->findEmbeddedDockWidgetInfoAreaComponents();
foreach(CEnableForDockWidgetInfoArea * dwia, infoAreaDockWidgets) foreach(CEnableForDockWidgetInfoArea * dwia, infoAreaDockWidgets)
{ {

View File

@@ -48,7 +48,7 @@ namespace BlackGui
virtual void addToContextMenu(QMenu *contextMenu) const override; virtual void addToContextMenu(QMenu *contextMenu) const override;
//! \copydoc CDockWidget::initalFloating //! \copydoc CDockWidget::initalFloating
virtual void initalFloating() override; virtual void initialFloating() override;
private: private:
//! Find all embedded dock widget components. These are components marked as CDockWidgetInfoAreaComponent //! Find all embedded dock widget components. These are components marked as CDockWidgetInfoAreaComponent

View File

@@ -483,13 +483,13 @@ const QString &BlackMisc::localHostName()
*/ */
const QString &BlackMisc::localHostNameEnvVariable() const QString &BlackMisc::localHostNameEnvVariable()
{ {
static const QString hostName = static const QString hostName = QProcessEnvironment::systemEnvironment().value("COMPUTERNAME", QProcessEnvironment::systemEnvironment().value("HOSTNAME"));
QProcessEnvironment::systemEnvironment().value("COMPUTERNAME",
QProcessEnvironment::systemEnvironment().value("HOSTNAME"));
return hostName; return hostName;
} }
/*
* Window mixer
*/
bool BlackMisc::Audio::startWindowsMixer() bool BlackMisc::Audio::startWindowsMixer()
{ {
QStringList parameterlist; QStringList parameterlist;

View File

@@ -27,7 +27,7 @@ namespace BlackMisc
CIcon() = default; CIcon() = default;
//! Constructor. //! Constructor.
CIcon( CIcons::IconIndex index, const QString &descriptiveText) : CIcon(CIcons::IconIndex index, const QString &descriptiveText) :
m_index(static_cast<int>(index)), m_descriptiveText(descriptiveText) {} m_index(static_cast<int>(index)), m_descriptiveText(descriptiveText) {}
//! Get descriptive text //! Get descriptive text
@@ -40,7 +40,7 @@ namespace BlackMisc
QPixmap toPixmap() const; QPixmap toPixmap() const;
//! Icon set? //! Icon set?
bool isSet() const { return this->m_index != static_cast<int>(CIcons::NotSet);} bool isSet() const { return (this->m_index != static_cast<int>(CIcons::NotSet));}
//! Rotate by n degrees //! Rotate by n degrees
void setRotation(int degrees) { this->m_rotateDegrees = degrees; } void setRotation(int degrees) { this->m_rotateDegrees = degrees; }
@@ -52,7 +52,7 @@ namespace BlackMisc
void setDescriptiveText(const QString &text) { this->m_descriptiveText = text; } void setDescriptiveText(const QString &text) { this->m_descriptiveText = text; }
//! Implicit conversion //! Implicit conversion
operator QPixmap () const { return this->toPixmap(); } operator QPixmap() const { return this->toPixmap(); }
protected: protected:
//! \copydoc CValueObject::convertToQString //! \copydoc CValueObject::convertToQString