summaryrefslogtreecommitdiffstats
path: root/kcontrol/hwmanager
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-04-06 20:18:06 -0500
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-04-06 20:18:06 -0500
commit18d991680d3a5155bb558e667916f76947d7e15a (patch)
treea93d34907a99af665cf4e20f8ada84588369e5d5 /kcontrol/hwmanager
parent5f27e3ead5c7d78075ff7fdcfa7a17c1403c826b (diff)
downloadtdebase-18d991680d3a5155bb558e667916f76947d7e15a.tar.gz
tdebase-18d991680d3a5155bb558e667916f76947d7e15a.zip
Add disk info page to device manager
Diffstat (limited to 'kcontrol/hwmanager')
-rw-r--r--kcontrol/hwmanager/devicepropsdlg.cpp40
-rw-r--r--kcontrol/hwmanager/devicepropsdlgbase.ui76
2 files changed, 114 insertions, 2 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
+ }
}
}
diff --git a/kcontrol/hwmanager/devicepropsdlgbase.ui b/kcontrol/hwmanager/devicepropsdlgbase.ui
index e55b8dd40..07daa19da 100644
--- a/kcontrol/hwmanager/devicepropsdlgbase.ui
+++ b/kcontrol/hwmanager/devicepropsdlgbase.ui
@@ -18,14 +18,14 @@
</property>
<widget class="TQTabWidget" row="0" column="0">
<property name="name">
- <cstring>TabWidget2</cstring>
+ <cstring>tabBarWidget</cstring>
</property>
<property name="enabled">
<bool>true</bool>
</property>
<widget class="TQWidget">
<property name="name">
- <cstring>tab</cstring>
+ <cstring>tabGeneral</cstring>
</property>
<attribute name="title">
<string>General</string>
@@ -192,6 +192,78 @@
</spacer>
</grid>
</widget>
+ <widget class="TQWidget">
+ <property name="name">
+ <cstring>tabDisk</cstring>
+ </property>
+ <attribute name="title">
+ <string>Disk</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="TQGroupBox" row="0" column="0">
+ <property name="name">
+ <cstring>groupProps</cstring>
+ </property>
+ <property name="title">
+ <string>Volume Information</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="TQLabel" row="0" column="0" colspan="1">
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="text">
+ <string>Mountpoint:</string>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="0" column="1" colspan="1">
+ <property name="name">
+ <cstring>labelDiskMountpoint</cstring>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="1" column="0" colspan="1">
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="text">
+ <string>Status:</string>
+ </property>
+ <property name="alignment">
+ <set>AlignTop|AlignLeft</set>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="1" column="1" colspan="1">
+ <property name="name">
+ <cstring>labelDiskStatus</cstring>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <spacer row="8" column="0">
+ <property name="name" stdset="0">
+ <cstring>Spacer4</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </grid>
+ </widget>
</widget>
</grid>
</widget>