summaryrefslogtreecommitdiffstats
path: root/kcontrol/hwmanager/devicepropsdlg.cpp
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2015-08-25 00:26:06 -0500
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2015-08-25 00:26:06 -0500
commitae35100db0302f629251d4a8b4f976bea8afbdd3 (patch)
tree3389567302fe263befb40a64ca1bf03711a63ca1 /kcontrol/hwmanager/devicepropsdlg.cpp
parentda7215ff52c93782a7de962ca5d076e484baed43 (diff)
downloadtdebase-ae35100db0302f629251d4a8b4f976bea8afbdd3.tar.gz
tdebase-ae35100db0302f629251d4a8b4f976bea8afbdd3.zip
Add preliminary cryptographic card support to the TDE hardware device manager
Diffstat (limited to 'kcontrol/hwmanager/devicepropsdlg.cpp')
-rw-r--r--kcontrol/hwmanager/devicepropsdlg.cpp35
1 files changed, 35 insertions, 0 deletions
diff --git a/kcontrol/hwmanager/devicepropsdlg.cpp b/kcontrol/hwmanager/devicepropsdlg.cpp
index 12de8cea9..b14177ca3 100644
--- a/kcontrol/hwmanager/devicepropsdlg.cpp
+++ b/kcontrol/hwmanager/devicepropsdlg.cpp
@@ -283,6 +283,9 @@ DevicePropertiesDialog::DevicePropertiesDialog(TDEGenericDevice* device, TQWidge
if (m_device->type() != TDEGenericDeviceType::Event) {
base->tabBarWidget->removePage(base->tabEvent);
}
+ if (m_device->type() != TDEGenericDeviceType::CryptographicCard) {
+ base->tabBarWidget->removePage(base->tabCryptographicCard);
+ }
if (m_device->type() == TDEGenericDeviceType::CPU) {
connect(base->comboCPUGovernor, TQT_SIGNAL(activated(const TQString &)), this, TQT_SLOT(setCPUGovernor(const TQString &)));
@@ -753,6 +756,38 @@ void DevicePropertiesDialog::populateDeviceInformation() {
}
base->labelEventSwitchActive->setText(activeSwitches);
}
+
+ if (m_device->type() == TDEGenericDeviceType::CryptographicCard) {
+ TDECryptographicCardDevice* cdevice = static_cast<TDECryptographicCardDevice*>(m_device);
+
+ connect(cdevice, TQT_SIGNAL(cardInserted()), this, TQT_SLOT(cryptographicCardInserted()));
+ connect(cdevice, TQT_SIGNAL(cardRemoved()), this, TQT_SLOT(cryptographicCardRemoved()));
+
+ updateCryptographicCardStatusDisplay();
+ }
+ }
+}
+
+void DevicePropertiesDialog::cryptographicCardInserted() {
+ updateCryptographicCardStatusDisplay();
+}
+
+void DevicePropertiesDialog::cryptographicCardRemoved() {
+ updateCryptographicCardStatusDisplay();
+}
+
+void DevicePropertiesDialog::updateCryptographicCardStatusDisplay() {
+ TDECryptographicCardDevice* cdevice = static_cast<TDECryptographicCardDevice*>(m_device);
+
+ int status = cdevice->cardPresent();
+ if ((status < 0) ||(status > 1)) {
+ base->labelCardStatus->setText(i18n("Unknown"));
+ }
+ else if (status == 0) {
+ base->labelCardStatus->setText(i18n("Empty"));
+ }
+ else if (status == 1) {
+ base->labelCardStatus->setText(i18n("Inserted") + TQString("<br>") + i18n("ATR: %1").arg(cdevice->cardATR()));
}
}