Browse Source

Linux fixes

QGC4.4
Gus Grubba 6 years ago
parent
commit
23ab840c62
  1. 4
      src/Microhard/MicrohardSettings.qml
  2. 8
      src/PairingManager/PairingNFC.cc
  3. 17
      src/ui/toolbar/PairingIndicator.qml

4
src/Microhard/MicrohardSettings.qml

@ -37,7 +37,7 @@ Rectangle { @@ -37,7 +37,7 @@ Rectangle {
property real _valueWidth: ScreenTools.defaultFontPixelWidth * 20
property real _panelWidth: _root.width * _internalWidthRatio
property Fact _microhardEnabledFact: QGroundControl.settingsManager.appSettings.enableMicrohard
property bool _microhardEnabled: _microhardEnabledFact.rawValue
property bool _microhardEnabled: _microhardEnabledFact ? _microhardEnabledFact.rawValue : false
readonly property real _internalWidthRatio: 0.8
@ -80,7 +80,7 @@ Rectangle { @@ -80,7 +80,7 @@ Rectangle {
text: qsTr("Enable Microhard")
fact: _microhardEnabledFact
enabled: true
visible: _microhardEnabledFact.visible
visible: _microhardEnabledFact ? _microhardEnabledFact.visible : false
}
}
}

8
src/PairingManager/PairingNFC.cc

@ -144,7 +144,7 @@ void PairingNFC::run() @@ -144,7 +144,7 @@ void PairingNFC::run()
while(!_exitThread)
{
qCDebug(PairingNFCLog) << "Waiting for NFC connection";
qgcApp()->toolbox()->pairingManager()->setStatusMessage(tr("Waiting for NFC connection"));
qgcApp()->toolbox()->pairingManager()->setStatusMessage(PairingManager::PairingActive, tr("Waiting for NFC connection"));
// Wait until a peer is discovered
while(NxpNci_WaitForDiscoveryNotification(&RfInterface) != NFC_SUCCESS);
@ -158,14 +158,14 @@ void PairingNFC::run() @@ -158,14 +158,14 @@ void PairingNFC::run()
qCDebug(PairingNFCLog) << "Wrong discovery";
}
}
qgcApp()->toolbox()->pairingManager()->setStatusMessage("");
qgcApp()->toolbox()->pairingManager()->setStatusMessage(PairingManager::PairingIdle, "");
qCDebug(PairingNFCLog) << "NFC: Stop";
}
//-----------------------------------------------------------------------------
void PairingNFC::task_nfc_reader(NxpNci_RfIntf_t RfIntf)
{
qgcApp()->toolbox()->pairingManager()->setStatusMessage(tr("Device detected"));
qgcApp()->toolbox()->pairingManager()->setStatusMessage(PairingManager::PairingActive, tr("Device detected"));
qCDebug(PairingNFCLog) << "NFC: Device detected";
// For each discovered cards
while(!_exitThread) {
@ -202,7 +202,7 @@ void PairingNFC::task_nfc_reader(NxpNci_RfIntf_t RfIntf) @@ -202,7 +202,7 @@ void PairingNFC::task_nfc_reader(NxpNci_RfIntf_t RfIntf)
// Wait for card removal
NxpNci_ProcessReaderMode(RfIntf, PRESENCE_CHECK);
qgcApp()->toolbox()->pairingManager()->setStatusMessage(tr("Device removed"));
qgcApp()->toolbox()->pairingManager()->setStatusMessage(PairingManager::PairingActive, tr("Device removed"));
qCDebug(PairingNFCLog) << "NFC device removed";
// Restart discovery loop

17
src/ui/toolbar/PairingIndicator.qml

@ -24,8 +24,9 @@ Item { @@ -24,8 +24,9 @@ Item {
width: pairingRow.width * 1.1
anchors.top: parent.top
anchors.bottom: parent.bottom
property bool _light: qgcPal.globalTheme === QGCPalette.Light && !activeVehicle
property real _contentWidth: ScreenTools.defaultFontPixelWidth * 30
property bool _light: qgcPal.globalTheme === QGCPalette.Light && !activeVehicle
property real _contentWidth: ScreenTools.defaultFontPixelWidth * 30
property real _contentSpacing: ScreenTools.defaultFontPixelHeight * 0.5
Row {
id: pairingRow
spacing: ScreenTools.defaultFontPixelWidth
@ -91,7 +92,7 @@ Item { @@ -91,7 +92,7 @@ Item {
anchors.centerIn: parent
Column {
id: comboListCol
spacing: ScreenTools.defaultFontPixelHeight
spacing: _contentSpacing
anchors.centerIn: parent
Item { width: 1; height: 1; }
QGCLabel {
@ -103,7 +104,7 @@ Item { @@ -103,7 +104,7 @@ Item {
Item { width: 1; height: 1; }
Rectangle {
width: ScreenTools.defaultFontPixelWidth * 40
height: ScreenTools.defaultFontPixelHeight * 12
height: ScreenTools.defaultFontPixelHeight * 8
color: Qt.rgba(0,0,0,0)
border.color: qgcPal.text
border.width: 1
@ -166,7 +167,7 @@ Item { @@ -166,7 +167,7 @@ Item {
anchors.centerIn: parent
Column {
id: mhCol
spacing: ScreenTools.defaultFontPixelHeight
spacing: _contentSpacing
anchors.centerIn: parent
Item { width: 1; height: 1; }
QGCLabel {
@ -186,7 +187,7 @@ Item { @@ -186,7 +187,7 @@ Item {
Item { width: 1; height: 1; }
Rectangle {
width: ScreenTools.defaultFontPixelWidth * 40
height: ScreenTools.defaultFontPixelHeight * 12
height: ScreenTools.defaultFontPixelHeight * 8
color: Qt.rgba(0,0,0,0)
border.color: qgcPal.text
border.width: 1
@ -235,7 +236,7 @@ Item { @@ -235,7 +236,7 @@ Item {
anchors.centerIn: parent
Column {
id: nfcCol
spacing: ScreenTools.defaultFontPixelHeight
spacing: _contentSpacing
anchors.centerIn: parent
Item { width: 1; height: 1; }
QGCLabel {
@ -304,7 +305,7 @@ Item { @@ -304,7 +305,7 @@ Item {
anchors.centerIn: parent
Column {
id: connectionCol
spacing: ScreenTools.defaultFontPixelHeight
spacing: _contentSpacing * 2
anchors.centerIn: parent
Item { width: 1; height: 1; }
QGCLabel {

Loading…
Cancel
Save