Some minor tweaks and fixes

* added names to timers
* Some DBus code formatting
* missing GUI element names
This commit is contained in:
Klaus Basan
2015-04-15 01:15:55 +02:00
parent 4e33cf5ac8
commit a05fa7494f
9 changed files with 23 additions and 31 deletions

View File

@@ -69,7 +69,7 @@ namespace BlackCore
this->initDBusConnection(dbusAddress);
if (!this->m_dbusConnection.isConnected())
{
QString notConnected("DBus connection failed");
QString notConnected("DBus connection failed:");
QString e = this->m_dbusConnection.lastError().message();
if (!e.isEmpty()) notConnected.append(" ").append(e);
Q_ASSERT_X(false, "CRuntime::init", notConnected.toUtf8().constData());
@@ -311,13 +311,19 @@ namespace BlackCore
void CRuntime::initDBusConnection(const QString &address)
{
if (this->m_initDBusConnection) return;
if (this->m_initDBusConnection) { return; }
if (address.isEmpty() || address == CDBusServer::sessionDBusServer())
{
this->m_dbusConnection = QDBusConnection::sessionBus();
}
else if (address == CDBusServer::systemDBusServer())
{
this->m_dbusConnection = QDBusConnection::sessionBus();
}
else
{
this->m_dbusConnection = QDBusConnection::connectToPeer(address, "BlackBoxRuntime");
}
}
const IContextApplication *CRuntime::getIContextApplication() const

View File

@@ -67,7 +67,7 @@
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
<number>2</number>
</property>
<property name="rightMargin">
<number>0</number>
@@ -119,7 +119,7 @@
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
<number>2</number>
</property>
<property name="rightMargin">
<number>0</number>

View File

@@ -38,6 +38,7 @@ namespace BlackGui
{
ui->setupUi(this);
this->m_logoffCountdownTimer = new QTimer(this);
this->m_logoffCountdownTimer->setObjectName("CLoginComponent:m_logoffCountdownTimer");
this->ui->pb_LogoffTimeout->setMaximum(LogoffIntervalSeconds);
this->ui->pb_LogoffTimeout->setValue(LogoffIntervalSeconds);
connect(this->m_logoffCountdownTimer, &QTimer::timeout, this, &CLoginComponent::ps_logoffCountdown);

View File

@@ -309,7 +309,7 @@
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<spacer name="vs_SettingsSimulatorComponent">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
@@ -322,25 +322,7 @@
</spacer>
</item>
<item>
<widget class="BlackGui::Components::CSettingsFsxComponent" name="comp_SettingsSimulatorFsx">
<layout class="QVBoxLayout" name="vl_SettingsSimulatorSpecific">
<property name="spacing">
<number>0</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
</layout>
</widget>
<widget class="BlackGui::Components::CSettingsFsxComponent" name="comp_SettingsSimulatorFsx"/>
</item>
</layout>
</widget>

View File

@@ -30,6 +30,7 @@ namespace BlackGui
connect(m_redrawTimer, &QTimer::timeout, this, &CLevelMeter::ps_redrawTimerExpired);
m_redrawTimer->start(RedrawInterval);
m_redrawTimer->setObjectName("CLevelMeter");
}
CLevelMeter::~CLevelMeter()

View File

@@ -20,17 +20,15 @@
namespace BlackGui
{
/**
* Widget which displays a vertical audio level meter, indicating the
* RMS and peak levels of the window of audio samples most recently analyzed
* by the Engine.
*/
//! Widget which displays a vertical audio level meter, indicating the
//! RMS and peak levels of the window of audio samples most recently analyzed
//! by the Engine.
class CLevelMeter : public QWidget
{
Q_OBJECT
public:
//! Constructor
CLevelMeter(QWidget *parent = 0);
CLevelMeter(QWidget *parent = nullptr);
//! Destructor
~CLevelMeter();
@@ -76,7 +74,7 @@ namespace BlackGui
//! Time at which m_peakHoldLevel was last changed.
QTime m_peakHoldLevelChanged;
QTimer *m_redrawTimer;
QTimer *m_redrawTimer = nullptr;
QColor m_rmsColor;
QColor m_peakColor;
};

View File

@@ -50,6 +50,7 @@ namespace BlackGui
// timer
this->m_timerStatusBar = new QTimer(this);
this->m_timerStatusBar->setObjectName(this->objectName().append(":m_timerStatusBar"));
this->m_timerStatusBar->setSingleShot(true);
connect(this->m_timerStatusBar, &QTimer::timeout, this, &CManagedStatusBar::ps_clearStatusBar);

View File

@@ -16,6 +16,7 @@ namespace BlackGui
CTransponderModeSelector::CTransponderModeSelector(QWidget *parent) : QComboBox(parent)
{
QComboBox::insertItems(0, CTransponderModeSelector::modes());
this->m_resetTimer.setObjectName(this->objectName().append(":m_resetTimer"));
connect(&this->m_resetTimer, &QTimer::timeout, this, &CTransponderModeSelector::resetTransponderMode);
connect(this, &CTransponderModeSelector::currentTextChanged, this, &CTransponderModeSelector::setSelectedTransponderModeAsString);
this->m_resetTimer.setInterval(5000);

View File

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