refs #288, formatting, minor tweaks, utility methods, tabstops

This commit is contained in:
Klaus Basan
2014-11-15 01:18:35 +01:00
committed by Roland Winklmeier
parent 86167e14c5
commit 5ff28cb3a1
8 changed files with 45 additions and 11 deletions

View File

@@ -119,6 +119,7 @@ namespace BlackCore
signals: signals:
//! Settings have been changed //! Settings have been changed
//! \sa IContextSettings::SettingsType
void changedSettings(uint type); void changedSettings(uint type);
public slots: public slots:

View File

@@ -230,7 +230,7 @@ namespace BlackCore
{ {
QMap<QString, QString> clientPartsMap = clientPartsToMap(currentLine, clientSectionAttributes); QMap<QString, QString> clientPartsMap = clientPartsToMap(currentLine, clientSectionAttributes);
CCallsign callsign = CCallsign(clientPartsMap["callsign"]); CCallsign callsign = CCallsign(clientPartsMap["callsign"]);
if (callsign.isEmpty()) continue; if (callsign.isEmpty()) break;
BlackMisc::Network::CUser user(clientPartsMap["cid"], clientPartsMap["realname"], callsign); BlackMisc::Network::CUser user(clientPartsMap["cid"], clientPartsMap["realname"], callsign);
const QString clientType = clientPartsMap["clienttype"].toLower(); const QString clientType = clientPartsMap["clienttype"].toLower();
if (clientType.isEmpty()) break; // sometimes type is empty if (clientType.isEmpty()) break; // sometimes type is empty
@@ -300,7 +300,7 @@ namespace BlackCore
if (currentLine.contains("UPDATE")) if (currentLine.contains("UPDATE"))
{ {
QStringList updateParts = currentLine.replace(" ", "").split('='); QStringList updateParts = currentLine.replace(" ", "").split('=');
if (updateParts.length() < 2) continue; if (updateParts.length() < 2) break;
QString dts = updateParts.at(1).trimmed(); QString dts = updateParts.at(1).trimmed();
updateTimestampFromFile = QDateTime::fromString(dts, "yyyyMMddHHmmss"); updateTimestampFromFile = QDateTime::fromString(dts, "yyyyMMddHHmmss");
updateTimestampFromFile.setOffsetFromUtc(0); updateTimestampFromFile.setOffsetFromUtc(0);
@@ -313,9 +313,10 @@ namespace BlackCore
{ {
// ident:hostname_or_IP:location:name:clients_connection_allowed: // ident:hostname_or_IP:location:name:clients_connection_allowed:
QStringList fsdServerParts = currentLine.split(':'); QStringList fsdServerParts = currentLine.split(':');
if (fsdServerParts.size() < 4) continue; if (fsdServerParts.size() < 5) break;
if (!fsdServerParts.at(3).trimmed().contains('1')) continue; // allowed? if (!fsdServerParts.at(4).trimmed().contains('1')) break; // allowed?
BlackMisc::Network::CServer fsdServer(fsdServerParts.at(0), fsdServerParts.at(2), fsdServerParts.at(1), 6809, CUser("id", "real name", "email", "password")); QString description(fsdServerParts.at(2)); // part(3) could be added
BlackMisc::Network::CServer fsdServer(fsdServerParts.at(0), description, fsdServerParts.at(1), 6809, CUser("id", "real name", "email", "password"));
fsdServers.push_back(fsdServer); fsdServers.push_back(fsdServer);
} }
break; break;
@@ -323,8 +324,8 @@ namespace BlackCore
{ {
// hostname_or_IP:location:name:clients_connection_allowed:type_of_voice_server: // hostname_or_IP:location:name:clients_connection_allowed:type_of_voice_server:
QStringList voiceServerParts = currentLine.split(':'); QStringList voiceServerParts = currentLine.split(':');
if (voiceServerParts.size() < 3) continue; if (voiceServerParts.size() < 3) break;
if (!voiceServerParts.at(3).trimmed().contains('1')) continue; // allowed? if (!voiceServerParts.at(3).trimmed().contains('1')) break; // allowed?
BlackMisc::Network::CServer voiceServer(voiceServerParts.at(1), voiceServerParts.at(2), voiceServerParts.at(0), -1, CUser()); BlackMisc::Network::CServer voiceServer(voiceServerParts.at(1), voiceServerParts.at(2), voiceServerParts.at(0), -1, CUser());
voiceServers.push_back(voiceServer); voiceServers.push_back(voiceServer);
} }

View File

@@ -27,7 +27,8 @@ namespace BlackGui
* Constructor * Constructor
*/ */
CInfoWindowComponent::CInfoWindowComponent(QWidget *parent) : CInfoWindowComponent::CInfoWindowComponent(QWidget *parent) :
QWizardPage(parent), ui(new Ui::InfoWindow) QWizardPage(parent),
ui(new Ui::InfoWindow)
{ {
ui->setupUi(this); ui->setupUi(this);
this->hide(); this->hide();

View File

@@ -49,7 +49,6 @@ namespace BlackGui
//! Append status message to list //! Append status message to list
void appendStatusMessageToList(const BlackMisc::CStatusMessage &statusMessage); void appendStatusMessageToList(const BlackMisc::CStatusMessage &statusMessage);
private: private:
QScopedPointer<Ui::CLogComponent> ui; QScopedPointer<Ui::CLogComponent> ui;
}; };

View File

@@ -427,6 +427,26 @@
</item> </item>
</layout> </layout>
</widget> </widget>
<tabstops>
<tabstop>le_CommandLineInput</tabstop>
<tabstop>pb_Connect</tabstop>
<tabstop>pb_MainAircrafts</tabstop>
<tabstop>pb_MainAtc</tabstop>
<tabstop>pb_MainUsers</tabstop>
<tabstop>pb_MainTextMessages</tabstop>
<tabstop>pb_MainSimulator</tabstop>
<tabstop>pb_MainFlightplan</tabstop>
<tabstop>pb_MainWeather</tabstop>
<tabstop>pb_MainMappings</tabstop>
<tabstop>pb_MainLog</tabstop>
<tabstop>pb_MainSettings</tabstop>
<tabstop>pb_MainCockpit</tabstop>
<tabstop>pb_CockpitIdent</tabstop>
<tabstop>pb_Opacity100</tabstop>
<tabstop>pb_Opacity050</tabstop>
<tabstop>pb_SoundMute</tabstop>
<tabstop>pb_SoundMaxVolume</tabstop>
</tabstops>
<resources/> <resources/>
<connections/> <connections/>
</ui> </ui>

View File

@@ -94,10 +94,10 @@ namespace BlackGui
//! Select next right tab //! Select next right tab
void selectRightTab(); void selectRightTab();
//! Display status message //! Display status message in all info areas (according their state)
void displayStatusMessage(const BlackMisc::CStatusMessage &statusMessage); void displayStatusMessage(const BlackMisc::CStatusMessage &statusMessage);
//! Display status messages //! Display status messages in all info areas (according their state)
void displayStatusMessages(const BlackMisc::CStatusMessageList &statusMessages); void displayStatusMessages(const BlackMisc::CStatusMessageList &statusMessages);
protected: protected:

View File

@@ -1,3 +1,12 @@
/* Copyright (C) 2013
* 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
* 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 "setnetwork.h" #include "setnetwork.h"
#include "blackcore/dbus_server.h" #include "blackcore/dbus_server.h"
#include "blackmisc/blackmiscfreefunctions.h" #include "blackmisc/blackmiscfreefunctions.h"

View File

@@ -81,6 +81,9 @@ namespace BlackMisc
//! Message may already have been handled directly //! Message may already have been handled directly
bool isRedundant() const { return this->m_redundant; } bool isRedundant() const { return this->m_redundant; }
//! Info or debug, no warning or error
bool isSeverityInfoOrLess() const { return this->m_severity == SeverityInfo || this->m_severity == SeverityDebug; }
//! Mark the message as having been handled by the given object //! Mark the message as having been handled by the given object
void markAsHandledBy(const QObject *object) const; void markAsHandledBy(const QObject *object) const;