mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-30 20:15:35 +08:00
This commit is contained in:
committed by
Mathew Sutcliffe
parent
e7c31fbe20
commit
ff5cf5ea4a
@@ -167,7 +167,6 @@ private:
|
||||
|
||||
/*!
|
||||
* \brief Selected server from textboxes
|
||||
* \return
|
||||
*/
|
||||
BlackMisc::Network::CServer selectedServerFromTextboxes() const;
|
||||
|
||||
@@ -183,13 +182,11 @@ private:
|
||||
|
||||
/*!
|
||||
* \brief Context network availability check, otherwise status message
|
||||
* \return
|
||||
*/
|
||||
bool isContextNetworkAvailableCheck();
|
||||
|
||||
/*!
|
||||
* \brief Context voice availability check, otherwise status message
|
||||
* \return
|
||||
*/
|
||||
bool isContextVoiceAvailableCheck();
|
||||
|
||||
@@ -200,7 +197,6 @@ private:
|
||||
|
||||
/*!
|
||||
* \brief Pending cockpit update operation
|
||||
* \return
|
||||
*/
|
||||
bool isCockpitUpdatePending() const;
|
||||
|
||||
@@ -226,14 +222,13 @@ private:
|
||||
/*!
|
||||
* \brief Private channel text message
|
||||
* \param textMessage
|
||||
* \param sending
|
||||
* \param sending sending or receiving
|
||||
*/
|
||||
void addPrivateChannelTextMessage(const BlackMisc::Network::CTextMessage &textMessage, bool sending = false);
|
||||
|
||||
/*!
|
||||
* Stub for sending a text message (eihter radio or private message).
|
||||
* Sets sender / receiver depending on frequency / channel situation.
|
||||
* \return
|
||||
*/
|
||||
BlackMisc::Network::CTextMessage getTextMessageStubForChannel();
|
||||
|
||||
@@ -262,7 +257,6 @@ private:
|
||||
|
||||
/*!
|
||||
* \brief Overlay info displaying status message
|
||||
* \param message
|
||||
*/
|
||||
void displayOverlayInfo(const BlackMisc::CStatusMessage &message);
|
||||
|
||||
@@ -338,22 +332,16 @@ private slots:
|
||||
*/
|
||||
bool reloadOwnAircraft();
|
||||
|
||||
/*!
|
||||
* \brief Display status message
|
||||
* \param message
|
||||
*/
|
||||
void displayStatusMessage(const BlackMisc::CStatusMessage &message);
|
||||
//! \brief Display status message
|
||||
void displayStatusMessage(const BlackMisc::CStatusMessage &statusMessage);
|
||||
|
||||
/*!
|
||||
* \brief Display status messages
|
||||
* \param messages
|
||||
*/
|
||||
//! \brief Display status messages
|
||||
void displayStatusMessages(const BlackMisc::CStatusMessageList &messages);
|
||||
|
||||
/*!
|
||||
* \brief Connection status changed
|
||||
* \param from
|
||||
* \param to
|
||||
* \param from old status, as uint so it is compliant with DBus
|
||||
* \param to new status, as uint so it is compliant with DBus
|
||||
*/
|
||||
void connectionStatusChanged(uint from, uint to);
|
||||
|
||||
@@ -484,9 +472,7 @@ private slots:
|
||||
*/
|
||||
void setAudioVoiceRooms();
|
||||
|
||||
/*!
|
||||
* \brief Audio volume handling and mute
|
||||
*/
|
||||
//! \brief Audio volume handling and mute
|
||||
void audioVolumes();
|
||||
|
||||
/*!
|
||||
@@ -495,17 +481,13 @@ private slots:
|
||||
*/
|
||||
void changeWindowOpacity(int opacity = -1);
|
||||
|
||||
/*!
|
||||
* \brief Context menu for audio
|
||||
*/
|
||||
//! \brief Context menu for audio
|
||||
void audioIconContextMenu(const QPoint &position);
|
||||
|
||||
//! \brief Context menu for message list
|
||||
void messageListContextMenu(const QPoint &position);
|
||||
|
||||
/*!
|
||||
* \brief Test SELCAL (code valid? play tone)
|
||||
*/
|
||||
//! \brief Test SELCAL (code valid? play tone)
|
||||
void testSelcal();
|
||||
|
||||
//! \brief start the MIC tests (Squelch)
|
||||
|
||||
@@ -132,7 +132,7 @@ void MainWindow::audioVolumes()
|
||||
return;
|
||||
}
|
||||
|
||||
// mute / umute
|
||||
// mute / unmute
|
||||
com1.setEnabled(!muted);
|
||||
com2.setEnabled(!muted);
|
||||
this->ui->pb_SoundMute->setText(muted ? "Unmute" : "Mute");
|
||||
|
||||
@@ -36,10 +36,10 @@ namespace BlackMiscTest
|
||||
/*
|
||||
* Receive variant
|
||||
*/
|
||||
void Testservice::receiveVariant(const QDBusVariant &variant, int localMetyType)
|
||||
void Testservice::receiveVariant(const QDBusVariant &variant, int localMetaType)
|
||||
{
|
||||
QVariant qv = variant.variant();
|
||||
QVariant qvF = BlackMisc::fixQVariantFromDbusArgument(qv, localMetyType);
|
||||
QVariant qvF = BlackMisc::fixQVariantFromDbusArgument(qv, localMetaType);
|
||||
QString s = BlackMisc::qVariantToString(qvF, true);
|
||||
qDebug() << "Pid:" << ServiceTool::getPid() << "Received variant:" << s;
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ namespace BlackMiscTest
|
||||
* \param variant
|
||||
* \param localMetyType, works only in the same binary
|
||||
*/
|
||||
void receiveVariant(const QDBusVariant &variant, int localMetyType);
|
||||
void receiveVariant(const QDBusVariant &variant, int localMetaType);
|
||||
|
||||
/*!
|
||||
* \brief Receive speed
|
||||
|
||||
@@ -173,7 +173,7 @@ namespace BlackCore
|
||||
CStatusMessageList msgs;
|
||||
if (this->m_network->isConnected())
|
||||
{
|
||||
msgs.push_back(CStatusMessage(CStatusMessage::TypeTrafficNetwork, CStatusMessage::SeverityError, "Cannot set plane info, network already connected"));
|
||||
msgs.push_back(CStatusMessage(CStatusMessage::TypeTrafficNetwork, CStatusMessage::SeverityError, "Cannot set aircraft info, network already connected"));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -138,37 +138,25 @@ namespace BlackCore
|
||||
*/
|
||||
virtual void updateOwnCockpit(const BlackMisc::Aviation::CComSystem &com1, const BlackMisc::Aviation::CComSystem &com2, const BlackMisc::Aviation::CTransponder &transponder);
|
||||
|
||||
/*!
|
||||
* \copydoc IContextNetwork::getOwnAircraft()
|
||||
*/
|
||||
//! \copydoc IContextNetwork::getOwnAircraft()
|
||||
virtual BlackMisc::Aviation::CAircraft getOwnAircraft() const;
|
||||
|
||||
/*!
|
||||
* \copydoc IContextNetwork::sendTextMessages()
|
||||
*/
|
||||
//! \copydoc IContextNetwork::sendTextMessages()
|
||||
virtual void sendTextMessages(const BlackMisc::Network::CTextMessageList &textMessages);
|
||||
|
||||
/*!
|
||||
* \copydoc IContextNetwork::getMetar()
|
||||
*/
|
||||
//! \copydoc IContextNetwork::getMetar()
|
||||
virtual BlackMisc::Aviation::CInformationMessage getMetar(const QString &airportIcaoCode);
|
||||
|
||||
/*!
|
||||
* \copydoc IContextNetwork::getSelectedVoiceRooms()
|
||||
*/
|
||||
//! \copydoc IContextNetwork::getSelectedVoiceRooms()
|
||||
virtual BlackMisc::Voice::CVoiceRoomList getSelectedVoiceRooms() const;
|
||||
|
||||
//! \copydoc IContextNetwork::getSelectedAtcStations
|
||||
virtual BlackMisc::Aviation::CAtcStationList getSelectedAtcStations() const;
|
||||
|
||||
/*!
|
||||
* \copydoc IContextNetwork::getUsers()
|
||||
*/
|
||||
//! \copydoc IContextNetwork::getUsers()
|
||||
virtual BlackMisc::Network::CUserList getUsers() const;
|
||||
|
||||
/*!
|
||||
* \copydoc IContextNetwork::getUsersForCallsigns
|
||||
*/
|
||||
//! \copydoc IContextNetwork::getUsersForCallsigns
|
||||
virtual BlackMisc::Network::CUserList getUsersForCallsigns(const BlackMisc::Aviation::CCallsignList &callsigns) const;
|
||||
|
||||
private:
|
||||
|
||||
@@ -48,8 +48,9 @@ namespace BlackCore
|
||||
|
||||
public:
|
||||
|
||||
//! ComUnit
|
||||
/*! IVoiceClient currently supports two different com units */
|
||||
/*!
|
||||
* \brief IVoice currently supports two different com units
|
||||
*/
|
||||
enum ComUnit
|
||||
{
|
||||
COM1 = 0, /*!< ComUnit 1 */
|
||||
@@ -85,7 +86,7 @@ namespace BlackCore
|
||||
|
||||
/************************************************
|
||||
* SETUP TESTS
|
||||
* *********************************************/
|
||||
***********************************************/
|
||||
|
||||
/*!
|
||||
* \brief Runs a 5 seconds test, measuring your background noise.
|
||||
@@ -183,7 +184,6 @@ namespace BlackCore
|
||||
|
||||
/*!
|
||||
* \brief Get voice room callsings
|
||||
* \param comUnit
|
||||
* \return
|
||||
*/
|
||||
virtual BlackMisc::Aviation::CCallsignList getVoiceRoomCallsigns(const ComUnit comUnit) const = 0;
|
||||
@@ -225,11 +225,20 @@ namespace BlackCore
|
||||
* \brief Audio for given unit started
|
||||
*/
|
||||
void audioStarted(const ComUnit comUnit);
|
||||
|
||||
/*!
|
||||
* \brief Audio for given unit stopped
|
||||
*/
|
||||
void audioStopped(const ComUnit comUnit);
|
||||
|
||||
/*!
|
||||
* \brief Audio started
|
||||
*/
|
||||
void globalAudioStarted();
|
||||
|
||||
/*!
|
||||
* \brief Audio stopped
|
||||
*/
|
||||
void globalAudioStopped();
|
||||
|
||||
// Test signals
|
||||
@@ -237,6 +246,7 @@ namespace BlackCore
|
||||
* \brief Squelch test completed
|
||||
*/
|
||||
void squelchTestFinished();
|
||||
|
||||
/*!
|
||||
* \brief Microphone test completed
|
||||
*/
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
namespace BlackCore
|
||||
{
|
||||
/*!
|
||||
* Vatlib implementation of the IVoiceClient interface.
|
||||
* Vatlib implementation of the IVoice interface.
|
||||
*/
|
||||
class CVoiceVatlib : public IVoice
|
||||
{
|
||||
@@ -49,20 +49,49 @@ namespace BlackCore
|
||||
// TODO: Vatlib supports multiple output devices. That basically means, you could connect
|
||||
// to different voice rooms and send their audio to different devices, e.g. ATIS to loudspeakers
|
||||
// and ATC to headspeakers. Is not important to implement that now, if ever.
|
||||
|
||||
/*!
|
||||
* \copydoc IVoice::audioDevices()
|
||||
*/
|
||||
virtual const BlackMisc::Voice::CAudioDeviceList &audioDevices() const ;
|
||||
|
||||
/*!
|
||||
* \copydoc IVoice::defaultAudioInputDevice()
|
||||
*/
|
||||
virtual const BlackMisc::Voice::CAudioDevice defaultAudioInputDevice() const;
|
||||
|
||||
/*!
|
||||
* \copydoc IVoice::defaultAudioOutputDevice()
|
||||
*/
|
||||
virtual const BlackMisc::Voice::CAudioDevice defaultAudioOutputDevice() const;
|
||||
|
||||
/************************************************
|
||||
* SETUP TESTS
|
||||
* *********************************************/
|
||||
|
||||
// Mic tests
|
||||
/*!
|
||||
* \copydoc IVoice::runSquelchTest
|
||||
*/
|
||||
virtual void runSquelchTest();
|
||||
|
||||
/*!
|
||||
* \copydoc IVoice::runMicTest
|
||||
*/
|
||||
virtual void runMicTest();
|
||||
|
||||
/*!
|
||||
* \copydoc IVoice::inputSquelch
|
||||
*/
|
||||
virtual float inputSquelch() const;
|
||||
|
||||
/*!
|
||||
* \copydoc IVoice::micTestResult()
|
||||
*/
|
||||
virtual qint32 micTestResult() const;
|
||||
|
||||
/*!
|
||||
* \copydoc IVoice::micTestResultAsString
|
||||
*/
|
||||
virtual QString micTestResultAsString() const;
|
||||
|
||||
public slots:
|
||||
@@ -145,7 +174,7 @@ namespace BlackCore
|
||||
virtual void switchAudioOutput(const ComUnit comUnit, bool enable);
|
||||
|
||||
/*!
|
||||
* \brief Muted?
|
||||
* \copydoc IVoice::isMuted
|
||||
*/
|
||||
virtual bool isMuted() const
|
||||
{
|
||||
@@ -197,7 +226,9 @@ namespace BlackCore
|
||||
void onEndFindSquelch();
|
||||
void onEndMicTest();
|
||||
|
||||
// slot to handle users
|
||||
/*!
|
||||
* \brief User (identified by callsign) joined or left voice room
|
||||
*/
|
||||
void onUserJoinedLeft(const ComUnit comUnit);
|
||||
|
||||
private:
|
||||
|
||||
@@ -150,9 +150,7 @@ namespace BlackGui
|
||||
}
|
||||
}
|
||||
|
||||
/*!
|
||||
* \copydoc QAbstractListModel::sort()
|
||||
*/
|
||||
//! \copydoc QAbstractListModel::sort()
|
||||
virtual void sort(int column, Qt::SortOrder order);
|
||||
|
||||
//! \brief Similar to ListType::push_back
|
||||
|
||||
@@ -16,15 +16,10 @@ namespace BlackGui
|
||||
|
||||
public:
|
||||
|
||||
/*!
|
||||
* \brief Constructor
|
||||
* \param parent
|
||||
*/
|
||||
//! \brief Constructor
|
||||
explicit CUserListModel(QObject *parent = nullptr);
|
||||
|
||||
/*!
|
||||
* \brief Destructor
|
||||
*/
|
||||
//! \brief Destructor
|
||||
virtual ~CUserListModel() {}
|
||||
|
||||
//! \copydoc CListModelBase::data
|
||||
|
||||
@@ -152,8 +152,8 @@ namespace BlackMisc
|
||||
c++;
|
||||
}
|
||||
|
||||
// normally 1 expected, as I should find one online station
|
||||
// for this booking
|
||||
// normally 1 expected, as I should find
|
||||
// only one online station for this booking
|
||||
return c;
|
||||
}
|
||||
|
||||
|
||||
@@ -42,11 +42,8 @@ namespace BlackMisc
|
||||
: m_callsignAsSet(callsign), m_callsign(CCallsign::unifyCallsign(callsign))
|
||||
{}
|
||||
|
||||
/*!
|
||||
* \brief Virtual method to return QVariant, used with DBUS QVariant lists
|
||||
* \return
|
||||
*/
|
||||
virtual QVariant toQVariant() const
|
||||
//! \copydoc CValueObject::toQVariant()
|
||||
virtual QVariant toQVariant() const override
|
||||
{
|
||||
return QVariant::fromValue(*this);
|
||||
}
|
||||
@@ -57,73 +54,56 @@ namespace BlackMisc
|
||||
return CCallsign::convertToIcon(*this);
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Is empty?
|
||||
* \return
|
||||
*/
|
||||
//! \brief Is empty?
|
||||
bool isEmpty() const { return this->m_callsignAsSet.isEmpty(); }
|
||||
|
||||
/*!
|
||||
* Get callsign.
|
||||
* \return
|
||||
*/
|
||||
const QString &asString() const { return this->m_callsign; }
|
||||
|
||||
/*!
|
||||
* Get callsign.
|
||||
* \return
|
||||
*/
|
||||
const QString &getStringAsSet() const { return this->m_callsignAsSet; }
|
||||
|
||||
/*!
|
||||
* \brief Get callsign pronounced
|
||||
* \return
|
||||
*/
|
||||
const QString &getCallsignPronounced() const { return this->m_callsignPronounced; }
|
||||
|
||||
/*!
|
||||
* \brief Get ICAO code, if this makes sense (EDDF_TWR -> EDDF)
|
||||
* \return
|
||||
*/
|
||||
QString getIcaoCode() const { return m_callsign.left(4).toUpper(); }
|
||||
|
||||
/*!
|
||||
* \brief Makes this callsign looking like an observer callsign (DAMBZ -> DAMBZ_OBS)
|
||||
* \return
|
||||
*/
|
||||
QString getAsObserverCallsignString() const;
|
||||
|
||||
/*!
|
||||
* \brief Equals callsign string?
|
||||
* \param callsignString
|
||||
* \return
|
||||
*/
|
||||
bool equalsString(const QString &callsignString) const;
|
||||
|
||||
/*!
|
||||
* \brief Equal operator ==
|
||||
* \param other
|
||||
* \return
|
||||
*/
|
||||
bool operator ==(const CCallsign &other) const;
|
||||
|
||||
/*!
|
||||
* \brief Unequal operator ==
|
||||
* \param other
|
||||
* \return
|
||||
* \brief Unequal operator !=
|
||||
*/
|
||||
bool operator !=(const CCallsign &other) const;
|
||||
|
||||
/*!
|
||||
* \brief Less than operator < for sorting
|
||||
* \param other
|
||||
* \return
|
||||
*/
|
||||
bool operator <(const CCallsign &other) const;
|
||||
|
||||
/*!
|
||||
* \brief Value hash
|
||||
* \return
|
||||
* \brief CValueObject::getValueHash()
|
||||
*/
|
||||
virtual uint getValueHash() const;
|
||||
|
||||
@@ -134,9 +114,7 @@ namespace BlackMisc
|
||||
|
||||
protected:
|
||||
/*!
|
||||
* \brief Rounded value as string
|
||||
* \param i18n
|
||||
* \return
|
||||
* \copydoc CValueObject::convertToQString()
|
||||
*/
|
||||
virtual QString convertToQString(bool i18n = false) const;
|
||||
|
||||
@@ -156,14 +134,12 @@ namespace BlackMisc
|
||||
virtual int compareImpl(const CValueObject &other) const;
|
||||
|
||||
/*!
|
||||
* \brief Stream to DBus <<
|
||||
* \param argument
|
||||
* \copydoc CValueObject::marshallToDbus()
|
||||
*/
|
||||
virtual void marshallToDbus(QDBusArgument &argument) const;
|
||||
|
||||
/*!
|
||||
* \brief Stream from DBus >>
|
||||
* \param argument
|
||||
* \copydoc CValueObject::unmarshallFromDbus()
|
||||
*/
|
||||
virtual void unmarshallFromDbus(const QDBusArgument &argument);
|
||||
|
||||
|
||||
@@ -30,7 +30,6 @@ namespace BlackMisc
|
||||
*/
|
||||
namespace PhysicalQuantities
|
||||
{
|
||||
|
||||
/*!
|
||||
* \brief Register all metadata for PQs
|
||||
*/
|
||||
@@ -43,7 +42,6 @@ namespace BlackMisc
|
||||
*/
|
||||
namespace Aviation
|
||||
{
|
||||
|
||||
/*!
|
||||
* \brief Register metadata for aviation
|
||||
*/
|
||||
@@ -103,14 +101,14 @@ namespace BlackMisc
|
||||
void registerMetadata();
|
||||
|
||||
/*!
|
||||
* Deals with the issue that the BlackMisc metatype does not always start with
|
||||
* the same id, e.g. with GUI enabled:
|
||||
* Deals with the issue, that the BlackMisc metatypes do not always start with
|
||||
* the same id, but dependent on enabled Qt modules. E.g. with GUI enabled:
|
||||
* type: 1024 name: QPaintBufferCacheEntry
|
||||
* type: 1025 .... some classes I cannot foresee
|
||||
* type: 1027 name: BlackMisc::CValueMap
|
||||
*
|
||||
* This is important when marshalling Variants via DBus among different
|
||||
* binaries, as the offset has to be considered
|
||||
* binaries, as an offset has to be considered
|
||||
*
|
||||
* \return
|
||||
*/
|
||||
@@ -123,8 +121,6 @@ namespace BlackMisc
|
||||
|
||||
/*!
|
||||
* \brief Compare 2 QVariants
|
||||
* \param v1
|
||||
* \param v2
|
||||
*/
|
||||
bool equalQVariants(const QVariant &v1, const QVariant &v2);
|
||||
|
||||
@@ -132,13 +128,13 @@ namespace BlackMisc
|
||||
* \brief Compare QVariants
|
||||
* \param v1
|
||||
* \param v2
|
||||
* \return
|
||||
* \return same return values as in QString::compare()
|
||||
*/
|
||||
int compareQVariants(const QVariant &v1, const QVariant &v2);
|
||||
|
||||
/*!
|
||||
* \brief QVariant to string, allows to stringify CValueObject
|
||||
* \param qv
|
||||
* \brief QVariant to QString, allows to stringify CValueObject
|
||||
* \param qv QVariant containing any CValueObject
|
||||
* \param i18n
|
||||
* \return
|
||||
*/
|
||||
@@ -156,23 +152,24 @@ namespace BlackMisc
|
||||
/*!
|
||||
* Convert a QDBusArgument back to a concrete type if required
|
||||
* This is a workaround if a QVariant is sent via DBus, QDBusArgument is
|
||||
* received and Qt is nor able to get the original QVariant back
|
||||
* \param argument
|
||||
* \param type
|
||||
* \return
|
||||
* received and Qt is not able to get the original QVariant back
|
||||
* \param argument send via DBus
|
||||
* \param type Metatype
|
||||
* \return QVariant generated from the above
|
||||
* \todo To be removed if a better solution is found
|
||||
*/
|
||||
// TODO: To be removed if a better solution is found
|
||||
QVariant complexQtTypeFromDbusArgument(const QDBusArgument &argument, int type);
|
||||
|
||||
/*!
|
||||
* \brief displayAllUserTypes
|
||||
* \brief Display all user metatypes
|
||||
* \remarks Used in order to debug code, do not remove
|
||||
*/
|
||||
void displayAllUserMetatypesTypes();
|
||||
|
||||
/*!
|
||||
* \brief Add several hash values
|
||||
* \brief Calculate a single hash value based on a list of individual hash values
|
||||
* \param values
|
||||
* \param classTypeId
|
||||
* \param classTypeId add a hash value for class name on top
|
||||
* \return
|
||||
*/
|
||||
uint calculateHash(const QList<uint> &values, const char *className);
|
||||
|
||||
@@ -44,7 +44,6 @@ namespace BlackMisc
|
||||
|
||||
/*!
|
||||
* \brief Copy constructor
|
||||
* \param otherMatrix
|
||||
*/
|
||||
CMatrix3x1(const CMatrix3x1 &other) : CMatrixBase(other) {}
|
||||
|
||||
|
||||
@@ -179,8 +179,7 @@ namespace BlackMisc
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Stream to DBus
|
||||
* \param argument
|
||||
* \copydoc CValueObject::getValueHash()
|
||||
*/
|
||||
template <class ImplVector> uint CVector3DBase<ImplVector>::getValueHash() const
|
||||
{
|
||||
|
||||
@@ -276,9 +276,6 @@ namespace BlackMisc
|
||||
|
||||
/*!
|
||||
* \brief Operator to support commutative multiplication
|
||||
* \param factor
|
||||
* \param otherVector
|
||||
* \return
|
||||
*/
|
||||
friend ImplVector operator *(double factor, const ImplVector &other)
|
||||
{
|
||||
|
||||
@@ -171,49 +171,29 @@ namespace BlackMisc
|
||||
*/
|
||||
void syncronizeData(CUser &otherUser);
|
||||
|
||||
/*!
|
||||
* \copydoc CValueObject::propertyByIndex(int)
|
||||
*/
|
||||
//! \copydoc CValueObject::propertyByIndex(int)
|
||||
QVariant propertyByIndex(int index) const;
|
||||
|
||||
/*!
|
||||
* \copydoc CValueObject::propertyByIndex(const QVariant, int)
|
||||
*/
|
||||
//! \copydoc CValueObject::propertyByIndex(const QVariant, int)
|
||||
void propertyByIndex(const QVariant &variant, int index);
|
||||
|
||||
protected:
|
||||
/*!
|
||||
* \brief Rounded value as string
|
||||
* \param i18n
|
||||
* \return
|
||||
*/
|
||||
//! \copydoc CValueObject::convertToQString
|
||||
virtual QString convertToQString(bool i18n = false) const;
|
||||
|
||||
/*!
|
||||
* \copydoc CValueObject::getMetaTypeId
|
||||
*/
|
||||
//! \copydoc CValueObject::getMetaTypeId
|
||||
virtual int getMetaTypeId() const;
|
||||
|
||||
/*!
|
||||
* \copydoc CValueObject::isA
|
||||
*/
|
||||
//! \copydoc CValueObject::isA
|
||||
virtual bool isA(int metaTypeId) const;
|
||||
|
||||
/*!
|
||||
* \copydoc CValueObject::compareImpl
|
||||
*/
|
||||
//! \copydoc CValueObject::compareImpl
|
||||
virtual int compareImpl(const CValueObject &other) const;
|
||||
|
||||
/*!
|
||||
* \brief Stream to DBus <<
|
||||
* \param argument
|
||||
*/
|
||||
//! \copydoc CValueObject::marshallToDbus
|
||||
virtual void marshallToDbus(QDBusArgument &argument) const;
|
||||
|
||||
/*!
|
||||
* \brief Stream from DBus >>
|
||||
* \param argument
|
||||
*/
|
||||
//! \copydoc CValueObject::unmarshallFromDbus
|
||||
virtual void unmarshallFromDbus(const QDBusArgument &argument);
|
||||
|
||||
private:
|
||||
|
||||
@@ -7,6 +7,9 @@ namespace BlackMisc
|
||||
{
|
||||
namespace Settings
|
||||
{
|
||||
/*!
|
||||
* \brief Helper / utility methods for settings
|
||||
*/
|
||||
class CSettingUtilities
|
||||
{
|
||||
private:
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace BlackMisc
|
||||
{
|
||||
public:
|
||||
/*!
|
||||
* \brief The StatusType enum
|
||||
* \brief Status types
|
||||
*/
|
||||
enum StatusType
|
||||
{
|
||||
@@ -28,6 +28,9 @@ namespace BlackMisc
|
||||
TypeGui
|
||||
};
|
||||
|
||||
/*!
|
||||
* \brief Status severities
|
||||
*/
|
||||
enum StatusSeverity
|
||||
{
|
||||
SeverityInfo,
|
||||
@@ -55,58 +58,35 @@ namespace BlackMisc
|
||||
QDateTime m_timestamp;
|
||||
|
||||
public:
|
||||
/*!
|
||||
* \brief StatusMessage
|
||||
*/
|
||||
CStatusMessage() :
|
||||
m_type(TypeUnknown), m_severity(SeverityInfo) {}
|
||||
//! \brief Constructor
|
||||
CStatusMessage() : m_type(TypeUnknown), m_severity(SeverityInfo) {}
|
||||
|
||||
/*!
|
||||
* \brief StatusMessage
|
||||
* \param type
|
||||
* \param severity
|
||||
* \param message
|
||||
*/
|
||||
//! \brief Constructor
|
||||
CStatusMessage(StatusType type, StatusSeverity severity, const QString &message);
|
||||
|
||||
/*!
|
||||
* \brief Status type
|
||||
* \return
|
||||
*/
|
||||
//! \brief Status type
|
||||
StatusType getType() const
|
||||
{
|
||||
return this->m_type;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Status severity
|
||||
* \return
|
||||
*/
|
||||
//! \brief Status severity
|
||||
StatusSeverity getSeverity() const
|
||||
{
|
||||
return this->m_severity;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Message
|
||||
* \return
|
||||
*/
|
||||
//! \brief Message
|
||||
QString getMessage() const
|
||||
{
|
||||
return this->m_message;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Value hash
|
||||
* \return
|
||||
*/
|
||||
//! \copydoc CValueObject::getValueHash()
|
||||
virtual uint getValueHash() const;
|
||||
|
||||
/*!
|
||||
* \brief As QVariant
|
||||
* \return
|
||||
*/
|
||||
QVariant toQVariant() const
|
||||
//! \copydoc CValueObject::toQVariant()
|
||||
virtual QVariant toQVariant() const override
|
||||
{
|
||||
return QVariant::fromValue(*this);
|
||||
}
|
||||
@@ -121,86 +101,51 @@ namespace BlackMisc
|
||||
const QString &getSeverityAsString() const;
|
||||
|
||||
//! \copydoc CValueObject::propertyByIndex(int)
|
||||
QVariant propertyByIndex(int index) const;
|
||||
virtual QVariant propertyByIndex(int index) const override;
|
||||
|
||||
//! \copydoc CValueObject::propertyByIndex(const QVariant, int)
|
||||
void propertyByIndex(const QVariant &variant, int index);
|
||||
virtual void setPropertyByIndex(const QVariant &variant, int index) override;
|
||||
|
||||
//! \copydoc CValueObject::propertyByIndexAsString
|
||||
QString propertyByIndexAsString(int index, bool i18n) const;
|
||||
virtual QString propertyByIndexAsString(int index, bool i18n) const override;
|
||||
|
||||
/*!
|
||||
* \brief Equal operator ==
|
||||
* \param other
|
||||
* @return
|
||||
*/
|
||||
//! \brief Equal operator ==
|
||||
bool operator ==(const CStatusMessage &other) const;
|
||||
|
||||
/*!
|
||||
* \brief Unequal operator ==
|
||||
* \param other
|
||||
* @return
|
||||
*/
|
||||
//! \brief Unequal operator !=
|
||||
bool operator !=(const CStatusMessage &other) const;
|
||||
|
||||
/*!
|
||||
* \brief Register metadata
|
||||
*/
|
||||
//! \brief Register metadata
|
||||
static void registerMetadata();
|
||||
|
||||
/*!
|
||||
* \brief Validation error
|
||||
* \param message
|
||||
* \return
|
||||
*/
|
||||
//! \brief Validation error
|
||||
static CStatusMessage getValidationError(const QString &message);
|
||||
|
||||
/*!
|
||||
* \brief Unspecific info message
|
||||
* \param message
|
||||
* \return
|
||||
*/
|
||||
//! \brief Unspecific info message
|
||||
static CStatusMessage getInfoMessage(const QString &message);
|
||||
|
||||
//! \representing icon
|
||||
static const QPixmap &convertToIcon(const CStatusMessage &statusMessage);
|
||||
|
||||
protected:
|
||||
/*!
|
||||
* \brief Marshall to DBus
|
||||
* \param argument
|
||||
*/
|
||||
virtual void marshallToDbus(QDBusArgument &arg) const;
|
||||
//! \copydoc CValueObject::marshallToDbus
|
||||
virtual void marshallToDbus(QDBusArgument &arg) const override;
|
||||
|
||||
/*!
|
||||
* \brief Unmarshall from DBus
|
||||
* \param argument
|
||||
*/
|
||||
virtual void unmarshallFromDbus(const QDBusArgument &arg);
|
||||
//! \copydoc CValueObject::unmarshallFromDbus
|
||||
virtual void unmarshallFromDbus(const QDBusArgument &arg) override;
|
||||
|
||||
/*!
|
||||
* \brief Convert to String
|
||||
* \param i18n
|
||||
* \return
|
||||
*/
|
||||
virtual QString convertToQString(bool i18n = false) const;
|
||||
//! \copydoc CValueObject::convertToQString
|
||||
virtual QString convertToQString(bool i18n = false) const override;
|
||||
|
||||
/*!
|
||||
* \copydoc CValueObject::getMetaTypeId
|
||||
*/
|
||||
virtual int getMetaTypeId() const;
|
||||
//! \copydoc CValueObject::getMetaTypeId
|
||||
virtual int getMetaTypeId() const override;
|
||||
|
||||
/*!
|
||||
* \copydoc CValueObject::isA
|
||||
*/
|
||||
virtual bool isA(int metaTypeId) const;
|
||||
//! \copydoc CValueObject::isA
|
||||
virtual bool isA(int metaTypeId) const override;
|
||||
|
||||
/*!
|
||||
* \copydoc CValueObject::compareImpl
|
||||
*/
|
||||
virtual int compareImpl(const CValueObject &other) const;
|
||||
//! \copydoc CValueObject::compareImpl
|
||||
virtual int compareImpl(const CValueObject &other) const override;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Q_DECLARE_METATYPE(BlackMisc::CStatusMessage)
|
||||
|
||||
@@ -20,37 +20,25 @@ namespace BlackMisc
|
||||
class CStatusMessageList : public CSequence<CStatusMessage>
|
||||
{
|
||||
public:
|
||||
/*!
|
||||
* \brief StatusMessage
|
||||
*/
|
||||
//! \brief Constructor
|
||||
CStatusMessageList() {}
|
||||
|
||||
/*!
|
||||
* \brief Find by type
|
||||
* \param type
|
||||
* \return
|
||||
*/
|
||||
//! \brief Construct from a base class object.
|
||||
CStatusMessageList(const CSequence<CStatusMessage> &other);
|
||||
|
||||
//! \brief Find by type
|
||||
CStatusMessageList findByType(CStatusMessage::StatusType type) const;
|
||||
|
||||
/*!
|
||||
* \brief Find by type
|
||||
* \param type
|
||||
* \return
|
||||
*/
|
||||
//! \brief Find by severity
|
||||
CStatusMessageList findBySeverity(CStatusMessage::StatusSeverity severity) const;
|
||||
|
||||
/*!
|
||||
* \brief As QVariant
|
||||
* \return
|
||||
*/
|
||||
//! \copydoc CValueObject::asQVariant
|
||||
virtual QVariant asQVariant() const
|
||||
{
|
||||
return QVariant::fromValue(*this);
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Register metadata of unit and quantity
|
||||
*/
|
||||
//! \brief Register metadata of unit and quantity
|
||||
static void registerMetadata();
|
||||
|
||||
};
|
||||
|
||||
@@ -121,8 +121,8 @@ namespace BlackMisc
|
||||
static void registerMetadata();
|
||||
|
||||
protected:
|
||||
QMap<int, QVariant> m_values; /*!< values */
|
||||
bool m_wildcard;
|
||||
QMap<int, QVariant> m_values; //!< values
|
||||
bool m_wildcard; //!< wildcard
|
||||
|
||||
/*!
|
||||
* \brief Meaningful string representation
|
||||
|
||||
@@ -75,34 +75,19 @@ namespace BlackMisc
|
||||
*/
|
||||
DeviceType getType() const { return m_type; }
|
||||
|
||||
/*!
|
||||
* \brief Valid audio device object?
|
||||
* \return
|
||||
*/
|
||||
//! \brief Valid audio device object?
|
||||
bool isValid() const { return m_deviceIndex >= -1 && !m_deviceName.isEmpty(); }
|
||||
|
||||
/*!
|
||||
* \brief Equal operator ==
|
||||
* \param other
|
||||
* @return
|
||||
*/
|
||||
//! \brief Equal operator ==
|
||||
bool operator ==(const CAudioDevice &other) const;
|
||||
|
||||
/*!
|
||||
* \brief Unequal operator ==
|
||||
* \param other
|
||||
* @return
|
||||
*/
|
||||
//! \brief Unequal operator !=
|
||||
bool operator !=(const CAudioDevice &other) const;
|
||||
|
||||
/*!
|
||||
* \brief Value hash
|
||||
*/
|
||||
//! \copydoc CValueObject::getValueHash
|
||||
virtual uint getValueHash() const;
|
||||
|
||||
/*!
|
||||
* \brief Register metadata
|
||||
*/
|
||||
//! \brief Register metadata
|
||||
static void registerMetadata();
|
||||
|
||||
//! \brief Device index for default device
|
||||
|
||||
Reference in New Issue
Block a user