Branch: r14.0.x

3453f537 2016-09-09 08:37:26 Timothy Pearson
Make device details selectable in hardware info dialog

(cherry picked from commit 6b95715d47d895ad37614a496942e1d554c0af1f)
M kcontrol/hwmanager/devicepropsdlg.cpp
M kcontrol/hwmanager/devicepropsdlgbase.ui
diff --git a/kcontrol/hwmanager/devicepropsdlg.cpp b/kcontrol/hwmanager/devicepropsdlg.cpp
index 12de8ce..aaa859c 100644
--- a/kcontrol/hwmanager/devicepropsdlg.cpp
+++ b/kcontrol/hwmanager/devicepropsdlg.cpp
@@ -32,6 +32,7 @@
 #undef Unsorted // Required for --enable-final (tqdir.h)
 #include <tqfiledialog.h>
 
+#include <kactivelabel.h>
 #include <kbuttonbox.h>
 #include <kcombobox.h>
 #include <tdelocale.h>
diff --git a/kcontrol/hwmanager/devicepropsdlgbase.ui b/kcontrol/hwmanager/devicepropsdlgbase.ui
index 74afdf5..6d31c75 100644
--- a/kcontrol/hwmanager/devicepropsdlgbase.ui
+++ b/kcontrol/hwmanager/devicepropsdlgbase.ui
@@ -50,7 +50,7 @@
 						<cstring>iconDeviceType</cstring>
 					</property>
                     		</widget>
-				<widget class="TQLabel" row="0" column="2" colspan="1">
+				<widget class="KActiveLabel" row="0" column="2" colspan="1">
 					<property name="name">
 						<cstring>labelDeviceType</cstring>
 					</property>
@@ -80,7 +80,7 @@
 						<string>Device Name:</string>
 					</property>
 				</widget>
-				<widget class="TQLabel" row="1" column="1" colspan="3">
+				<widget class="KActiveLabel" row="1" column="1" colspan="3">
 					<property name="name">
 						<cstring>labelDeviceName</cstring>
 					</property>
@@ -93,7 +93,7 @@
 						<string>Device Node:</string>
 					</property>
 				</widget>
-				<widget class="TQLabel" row="2" column="1" colspan="3">
+				<widget class="KActiveLabel" row="2" column="1" colspan="3">
 					<property name="name">
 						<cstring>labelDeviceNode</cstring>
 					</property>
@@ -106,7 +106,7 @@
 						<string>System Path:</string>
 					</property>
 				</widget>
-				<widget class="TQLabel" row="3" column="1" colspan="3">
+				<widget class="KActiveLabel" row="3" column="1" colspan="3">
 					<property name="name">
 						<cstring>labelSystemPath</cstring>
 					</property>
@@ -119,7 +119,7 @@
 						<string>Subsystem Type:</string>
 					</property>
 				</widget>
-				<widget class="TQLabel" row="4" column="1" colspan="3">
+				<widget class="KActiveLabel" row="4" column="1" colspan="3">
 					<property name="name">
 						<cstring>labelSubsytemType</cstring>
 					</property>
@@ -132,7 +132,7 @@
 						<string>Device Driver:</string>
 					</property>
 				</widget>
-				<widget class="TQLabel" row="5" column="1" colspan="3">
+				<widget class="KActiveLabel" row="5" column="1" colspan="3">
 					<property name="name">
 						<cstring>labelDeviceDriver</cstring>
 					</property>
@@ -145,7 +145,7 @@
 						<string>Device Class:</string>
 					</property>
 				</widget>
-				<widget class="TQLabel" row="6" column="1" colspan="3">
+				<widget class="KActiveLabel" row="6" column="1" colspan="3">
 					<property name="name">
 						<cstring>labelDeviceClass</cstring>
 					</property>
@@ -158,7 +158,7 @@
 						<string>Manufacturer:</string>
 					</property>
 				</widget>
-				<widget class="TQLabel" row="7" column="1" colspan="3">
+				<widget class="KActiveLabel" row="7" column="1" colspan="3">
 					<property name="name">
 						<cstring>labelVendorName</cstring>
 					</property>
@@ -171,7 +171,7 @@
 						<string>Model:</string>
 					</property>
 				</widget>
-				<widget class="TQLabel" row="8" column="1" colspan="3">
+				<widget class="KActiveLabel" row="8" column="1" colspan="3">
 					<property name="name">
 						<cstring>labelVendorModel</cstring>
 					</property>
@@ -184,7 +184,7 @@
 						<string>Serial Number:</string>
 					</property>
 				</widget>
-				<widget class="TQLabel" row="9" column="1" colspan="3">
+				<widget class="KActiveLabel" row="9" column="1" colspan="3">
 					<property name="name">
 						<cstring>labelSerialNumber</cstring>
 					</property>
@@ -197,7 +197,7 @@
 						<string>Bus ID:</string>
 					</property>
 				</widget>
-				<widget class="TQLabel" row="10" column="1" colspan="3">
+				<widget class="KActiveLabel" row="10" column="1" colspan="3">
 					<property name="name">
 						<cstring>labelBusID</cstring>
 					</property>
@@ -210,7 +210,7 @@
 						<string>Technical Details:</string>
 					</property>
 				</widget>
-				<widget class="TQLabel" row="11" column="1" colspan="3">
+				<widget class="KActiveLabel" row="11" column="1" colspan="3">
 					<property name="name">
 						<cstring>labelModalias</cstring>
 					</property>
@@ -266,7 +266,7 @@
 							    <string>Mountpoint:</string>
 						    </property>
 					    </widget>
-					    <widget class="TQLabel" row="0" column="1" colspan="1">
+					    <widget class="KActiveLabel" row="0" column="1" colspan="1">
 						    <property name="name">
 							    <cstring>labelDiskMountpoint</cstring>
 						    </property>
@@ -279,7 +279,7 @@
 							    <string>Filesystem Type:</string>
 						    </property>
 					    </widget>
-					    <widget class="TQLabel" row="1" column="1" colspan="1">
+					    <widget class="KActiveLabel" row="1" column="1" colspan="1">
 						    <property name="name">
 							    <cstring>labelDiskFileSystemType</cstring>
 						    </property>
@@ -292,7 +292,7 @@
 							    <string>Volume UUID:</string>
 						    </property>
 					    </widget>
-					    <widget class="TQLabel" row="2" column="1" colspan="1">
+					    <widget class="KActiveLabel" row="2" column="1" colspan="1">
 						    <property name="name">
 							    <cstring>labelDiskUUID</cstring>
 						    </property>
@@ -308,7 +308,7 @@
 							    <set>AlignTop|AlignLeft</set>
 						    </property>
 					    </widget>
-					    <widget class="TQLabel" row="3" column="1" colspan="1">
+					    <widget class="KActiveLabel" row="3" column="1" colspan="1">
 						    <property name="name">
 							    <cstring>labelDiskStatus</cstring>
 						    </property>
e247f8d2 2016-09-09 08:37:29 Timothy Pearson
Fix display of unknown attributes in device manager details dialog

(cherry picked from commit 3c8aaa46e757646f1971bc294a5a41a87ec25720)
M kcontrol/hwmanager/devicepropsdlg.cpp
M kcontrol/hwmanager/devicepropsdlgbase.ui
diff --git a/kcontrol/hwmanager/devicepropsdlg.cpp b/kcontrol/hwmanager/devicepropsdlg.cpp
index aaa859c..f64f358 100644
--- a/kcontrol/hwmanager/devicepropsdlg.cpp
+++ b/kcontrol/hwmanager/devicepropsdlg.cpp
@@ -341,17 +341,21 @@
 	return (TDEEventDevice::friendlySwitchList(switches).join("<br>"));
 }
 
+static TQString formatDisplayString(TQString input) {
+	return TQStyleSheet::escape(input);
+}
+
 void DevicePropertiesDialog::populateDeviceInformation() {
 	if (m_device) {
 		base->labelDeviceType->setText(m_device->friendlyDeviceType());
 		base->iconDeviceType->setPixmap(m_device->icon(TDEIcon::SizeSmall));
-		base->labelDeviceName->setText(m_device->friendlyName());
-		base->labelDeviceNode->setText((m_device->deviceNode().isNull())?i18n("<none>"):m_device->deviceNode());
-		base->labelSystemPath->setText(m_device->systemPath());
-		base->labelSubsytemType->setText(m_device->subsystem());
-		base->labelDeviceDriver->setText((m_device->deviceDriver().isNull())?i18n("<none>"):m_device->deviceDriver());
-		base->labelDeviceClass->setText((m_device->PCIClass().isNull())?i18n("<n/a>"):m_device->PCIClass());
-		base->labelModalias->setText((m_device->moduleAlias().isNull())?i18n("<none>"):m_device->moduleAlias());
+		base->labelDeviceName->setText(formatDisplayString(m_device->friendlyName()));
+		base->labelDeviceNode->setText(formatDisplayString((m_device->deviceNode().isNull())?i18n("<none>"):m_device->deviceNode()));
+		base->labelSystemPath->setText(formatDisplayString(m_device->systemPath()));
+		base->labelSubsytemType->setText(formatDisplayString(m_device->subsystem()));
+		base->labelDeviceDriver->setText(formatDisplayString((m_device->deviceDriver().isNull())?i18n("<none>"):m_device->deviceDriver()));
+		base->labelDeviceClass->setText(formatDisplayString((m_device->PCIClass().isNull())?i18n("<n/a>"):m_device->PCIClass()));
+		base->labelModalias->setText(formatDisplayString((m_device->moduleAlias().isNull())?i18n("<none>"):m_device->moduleAlias()));
 
 		// These might be redundant
 		#if 0
@@ -363,7 +367,7 @@
 		base->labelVendorModel->hide();
 		base->stocklabelVendorModel->hide();
 		#endif
-		base->labelSerialNumber->setText((m_device->serialNumber().isNull())?i18n("<unknown>"):m_device->serialNumber());
+		base->labelSerialNumber->setText(formatDisplayString((m_device->serialNumber().isNull())?i18n("<unknown>"):m_device->serialNumber()));
 
 		if (m_device->subsystem() == "pci") {
 			base->labelBusID->setText(m_device->busID());
@@ -380,15 +384,15 @@
 
 			TQString mountPoint = sdevice->mountPath();
 			if (mountPoint == "") mountPoint = i18n("<none>");
-			base->labelDiskMountpoint->setText(mountPoint);
+			base->labelDiskMountpoint->setText(formatDisplayString(mountPoint));
 
 			TQString fsName = sdevice->fileSystemName();
 			if (fsName == "") fsName = i18n("<unknown>");
-			base->labelDiskFileSystemType->setText(fsName);
+			base->labelDiskFileSystemType->setText(formatDisplayString(fsName));
 
 			TQString volUUID = sdevice->diskUUID();
 			if (volUUID == "") volUUID = i18n("<none>");
-			base->labelDiskUUID->setText(volUUID);
+			base->labelDiskUUID->setText(formatDisplayString(volUUID));
 
 			// Show status
 			TQString status_text = "<qt>";
diff --git a/kcontrol/hwmanager/devicepropsdlgbase.ui b/kcontrol/hwmanager/devicepropsdlgbase.ui
index 6d31c75..7cfe80b 100644
--- a/kcontrol/hwmanager/devicepropsdlgbase.ui
+++ b/kcontrol/hwmanager/devicepropsdlgbase.ui
@@ -50,7 +50,7 @@
 						<cstring>iconDeviceType</cstring>
 					</property>
                     		</widget>
-				<widget class="KActiveLabel" row="0" column="2" colspan="1">
+				<widget class="TQLabel" row="0" column="2" colspan="1">
 					<property name="name">
 						<cstring>labelDeviceType</cstring>
 					</property>
ac1e63f3 2016-09-09 08:37:31 Timothy Pearson
Fix prior commit

(cherry picked from commit 3252800255e59562f401ad0df2cf37cd50d0b1a4)
M kcontrol/hwmanager/devicepropsdlg.cpp
diff --git a/kcontrol/hwmanager/devicepropsdlg.cpp b/kcontrol/hwmanager/devicepropsdlg.cpp
index f64f358..3c402cc 100644
--- a/kcontrol/hwmanager/devicepropsdlg.cpp
+++ b/kcontrol/hwmanager/devicepropsdlg.cpp
@@ -370,7 +370,7 @@
 		base->labelSerialNumber->setText(formatDisplayString((m_device->serialNumber().isNull())?i18n("<unknown>"):m_device->serialNumber()));
 
 		if (m_device->subsystem() == "pci") {
-			base->labelBusID->setText(m_device->busID());
+			base->labelBusID->setText(formatDisplayString(m_device->busID()));
 			base->labelBusID->show();
 			base->stocklabelBusID->show();
 		}