diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-04-06 20:18:06 -0500 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-04-06 20:18:06 -0500 |
commit | 18d991680d3a5155bb558e667916f76947d7e15a (patch) | |
tree | a93d34907a99af665cf4e20f8ada84588369e5d5 /kcontrol/hwmanager/devicepropsdlg.cpp | |
parent | 5f27e3ead5c7d78075ff7fdcfa7a17c1403c826b (diff) | |
download | tdebase-18d991680d3a5155bb558e667916f76947d7e15a.tar.gz tdebase-18d991680d3a5155bb558e667916f76947d7e15a.zip |
Add disk info page to device manager
Diffstat (limited to 'kcontrol/hwmanager/devicepropsdlg.cpp')
-rw-r--r-- | kcontrol/hwmanager/devicepropsdlg.cpp | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/kcontrol/hwmanager/devicepropsdlg.cpp b/kcontrol/hwmanager/devicepropsdlg.cpp index 43892ce8c..bc2e0f843 100644 --- a/kcontrol/hwmanager/devicepropsdlg.cpp +++ b/kcontrol/hwmanager/devicepropsdlg.cpp @@ -44,6 +44,11 @@ DevicePropertiesDialog::DevicePropertiesDialog(TDEGenericDevice* device, TQWidge if (m_device) { base = new DevicePropertiesDialogBase(plainPage()); + // Remove all non-applicable tabs + if (m_device->type() != TDEGenericDeviceType::Disk) { + base->tabBarWidget->removePage(base->tabDisk); + } + TQGridLayout *mainGrid = new TQGridLayout(plainPage(), 1, 1, 0, spacingHint()); mainGrid->setRowStretch(1, 1); mainGrid->setRowStretch(1, 1); @@ -64,6 +69,41 @@ DevicePropertiesDialog::DevicePropertiesDialog(TDEGenericDevice* device, TQWidge base->labelBusID->hide(); base->stocklabelBusID->hide(); } + + if (m_device->type() == TDEGenericDeviceType::Disk) { + TDEStorageDevice* sdevice = static_cast<TDEStorageDevice*>(m_device); + base->tabDisk->show(); + base->labelDiskMountpoint->setText(sdevice->mountPath()); + + // Show status + TQString status_text = "<qt>"; + if (sdevice->checkDiskStatus(TDEDiskDeviceStatus::Mountable)) { + status_text += "Mountable<br>"; + } + if (sdevice->checkDiskStatus(TDEDiskDeviceStatus::Removable)) { + status_text += "Removable<br>"; + } + if (sdevice->checkDiskStatus(TDEDiskDeviceStatus::Inserted)) { + status_text += "Inserted<br>"; + } + if (sdevice->checkDiskStatus(TDEDiskDeviceStatus::UsedByDevice)) { + status_text += "In use<br>"; + } + if (sdevice->checkDiskStatus(TDEDiskDeviceStatus::UsesDevice)) { + status_text += "Uses other device<br>"; + } + if (sdevice->checkDiskStatus(TDEDiskDeviceStatus::ContainsFilesystem)) { + status_text += "Contains a filesystem<br>"; + } + if (status_text == "<qt>") { + status_text += "<i>Unavailable</i>"; + } + status_text += "</qt>"; + base->labelDiskStatus->setText(status_text); + + // TODO + // Add mount/unmount buttons + } } } |