2017-03-17 12:24:32 +03:00
|
|
|
import QtQuick 2.5
|
2017-03-20 18:41:08 +03:00
|
|
|
import QtQuick.Controls 1.4
|
2017-03-17 12:19:06 +03:00
|
|
|
|
2017-03-20 18:41:08 +03:00
|
|
|
Label {
|
2017-03-17 12:19:06 +03:00
|
|
|
|
|
|
|
property var device
|
|
|
|
property int nCredentials
|
|
|
|
property var settings
|
|
|
|
property bool ccidMode: !settings.slotMode
|
|
|
|
|
|
|
|
visible: device.hasDevice
|
|
|
|
text: getText()
|
|
|
|
|
|
|
|
horizontalAlignment: Text.AlignHCenter
|
|
|
|
wrapMode: Text.WordWrap
|
|
|
|
width: parent.width
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
|
|
|
|
|
function getText() {
|
|
|
|
if (settings.slotMode && !device.hasOTP) {
|
|
|
|
return qsTr("Authenticator mode is set to YubiKey slots, but the OTP connection mode is not enabled.")
|
|
|
|
} else if (ccidMode && !device.hasCCID) {
|
|
|
|
return qsTr("Authenticator mode is set to CCID, but the CCID connection mode is not enabled.")
|
2017-08-02 15:09:10 +03:00
|
|
|
} else if (credentials === null) {
|
2017-11-29 20:26:00 +03:00
|
|
|
return qsTr("Reading credentials...")
|
2017-08-02 15:09:10 +03:00
|
|
|
} else if (nCredentials === 0 && credentials !== null) {
|
2017-11-29 20:26:00 +03:00
|
|
|
return qsTr("No credentials found.")
|
2017-03-17 12:19:06 +03:00
|
|
|
} else {
|
|
|
|
return ""
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|