From e88baf8334b8ff7ce92e555cbaffee949672d4b8 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Wed, 9 Jan 2013 16:39:31 -0600 Subject: Automatically deactivate disconnected display devices Notify user on display add/remove/change Add advanced display configuration option to krandr menu Add option to autohide kicker panels on inactive Xinerama screens and enable by default Update hwmanager treeview on device change --- kcontrol/hwmanager/hwmanager.cpp | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'kcontrol/hwmanager/hwmanager.cpp') diff --git a/kcontrol/hwmanager/hwmanager.cpp b/kcontrol/hwmanager/hwmanager.cpp index 36dc89b3e..936a8ab38 100644 --- a/kcontrol/hwmanager/hwmanager.cpp +++ b/kcontrol/hwmanager/hwmanager.cpp @@ -90,7 +90,7 @@ TDEHWManager::TDEHWManager(TQWidget *parent, const char *name, const TQStringLis connect(hwdevices, TQT_SIGNAL(hardwareAdded(TDEGenericDevice*)), this, TQT_SLOT(populateTreeView())); connect(hwdevices, TQT_SIGNAL(hardwareRemoved(TDEGenericDevice*)), this, TQT_SLOT(populateTreeView())); -// connect(hwdevices, TQT_SIGNAL(hardwareUpdated(TDEGenericDevice*)), this, TQT_SLOT(populateTreeView())); + connect(hwdevices, TQT_SIGNAL(hardwareUpdated(TDEGenericDevice*)), this, TQT_SLOT(deviceChanged(TDEGenericDevice*))); load(); @@ -188,6 +188,24 @@ void TDEHWManager::populateTreeViewLeaf(DeviceIconItem *parent, bool show_by_con } } +void TDEHWManager::deviceChanged(TDEGenericDevice* device) { + TQListViewItemIterator it(base->deviceTree); + while (it.current()) { + DeviceIconItem* item = dynamic_cast(it.current()); + if (item) { + TDEGenericDevice* candidate = item->device(); + if (candidate) { + if (candidate->systemPath() == device->systemPath()) { + if (item->text(0) != device->friendlyName()) { + item->setText(0, device->friendlyName()); + } + } + } + } + ++it; + } +} + TQString TDEHWManager::quickHelp() const { return i18n("

TDE Hardware Device Manager

This module allows you to configure hardware devices on your system"); -- cgit v1.2.1