From 0d6bebc5f5bacd360dcee8f58b93ae3c99028c75 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Thu, 5 Apr 2012 22:01:03 -0500 Subject: [PATCH] Add rudimentary device manager to kcontrol --- kcontrol/CMakeLists.txt | 1 + kcontrol/hwmanager/CMakeLists.txt | 39 ++++++ kcontrol/hwmanager/deviceiconview.cpp | 108 ++++++++++++++++ kcontrol/hwmanager/deviceiconview.h | 82 ++++++++++++ kcontrol/hwmanager/devicepropsdlg.cpp | 111 ++++++++++++++++ kcontrol/hwmanager/devicepropsdlg.h | 57 +++++++++ kcontrol/hwmanager/hwmanager.cpp | 175 ++++++++++++++++++++++++++ kcontrol/hwmanager/hwmanager.desktop | 23 ++++ kcontrol/hwmanager/hwmanager.h | 71 +++++++++++ kcontrol/hwmanager/hwmanagerbase.ui | 97 ++++++++++++++ 10 files changed, 764 insertions(+) create mode 100644 kcontrol/hwmanager/CMakeLists.txt create mode 100644 kcontrol/hwmanager/deviceiconview.cpp create mode 100644 kcontrol/hwmanager/deviceiconview.h create mode 100644 kcontrol/hwmanager/devicepropsdlg.cpp create mode 100644 kcontrol/hwmanager/devicepropsdlg.h create mode 100644 kcontrol/hwmanager/hwmanager.cpp create mode 100644 kcontrol/hwmanager/hwmanager.desktop create mode 100644 kcontrol/hwmanager/hwmanager.h create mode 100644 kcontrol/hwmanager/hwmanagerbase.ui diff --git a/kcontrol/CMakeLists.txt b/kcontrol/CMakeLists.txt index b6fe70f40..92a032463 100644 --- a/kcontrol/CMakeLists.txt +++ b/kcontrol/CMakeLists.txt @@ -65,6 +65,7 @@ if( BUILD_KCONTROL ) add_subdirectory( kthememanager ) add_subdirectory( kfontinst ) add_subdirectory( access ) + add_subdirectory( hwmanager ) tde_conditional_add_subdirectory( WITH_XRANDR displayconfig ) tde_conditional_add_subdirectory( WITH_SAMBA samba ) diff --git a/kcontrol/hwmanager/CMakeLists.txt b/kcontrol/hwmanager/CMakeLists.txt new file mode 100644 index 000000000..dc1265e49 --- /dev/null +++ b/kcontrol/hwmanager/CMakeLists.txt @@ -0,0 +1,39 @@ +################################################# +# +# (C) 2012 Timothy Pearson +# kb9vqf (AT) pearsoncomputing.net +# +# Improvements and feedback are welcome +# +# This file is released under GPL >= 2 +# +################################################# + +include_directories( + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_BINARY_DIR} + ${TDE_INCLUDE_DIR} + ${TQT_INCLUDE_DIRS} +) + +link_directories( + ${TQT_LIBRARY_DIRS} +) + + +##### other data ################################ + +install( FILES hwmanager.desktop DESTINATION ${XDG_APPS_INSTALL_DIR} ) + + +##### kcm_iccconfig (module) #################### + +set_source_files_properties( hwmanager.cpp PROPERTIES COMPILE_FLAGS -DKDE_CONFDIR=\\"${TDE_CONFIG_DIR}\\" ) + +tde_add_kpart( kcm_hwmanager AUTOMOC + SOURCES + hwmanager.cpp deviceiconview.cpp devicepropsdlg.cpp hwmanagerbase.ui hwmanager.skel + LINK kio-shared + DESTINATION ${PLUGIN_INSTALL_DIR} +) diff --git a/kcontrol/hwmanager/deviceiconview.cpp b/kcontrol/hwmanager/deviceiconview.cpp new file mode 100644 index 000000000..f38f35460 --- /dev/null +++ b/kcontrol/hwmanager/deviceiconview.cpp @@ -0,0 +1,108 @@ +/* + Copyright (c) 2000 Matthias Elter + Copyright (c) 2003 Daniel Molkentin + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +*/ + +#include +#include + +#include +#include +#include +#include +#include + +#include + +#include "deviceiconview.h" +#include "deviceiconview.moc" + +DeviceIconView::DeviceIconView(TQWidget * parent, const char * name) + : KListView(parent, name) +{ + setSorting(0, true); + addColumn(TQString::null); + + // Show expand/collapse widgets on root items + setRootIsDecorated(true); + + header()->hide(); + + connect(this, TQT_SIGNAL(clicked(TQListViewItem*)), this, TQT_SLOT(slotItemSelected(TQListViewItem*))); + connect(this, TQT_SIGNAL(executed(TQListViewItem*)), this, TQT_SLOT(slotItemDoubleClicked(TQListViewItem*))); +} + +void DeviceIconView::slotItemSelected(TQListViewItem* item) +{ + TQApplication::restoreOverrideCursor(); + if (!item) { + return; + } +} + +void DeviceIconView::slotItemDoubleClicked(TQListViewItem* item) +{ + TQApplication::restoreOverrideCursor(); + if (!item) { + return; + } + + DeviceIconItem* divi = dynamic_cast(item); + if (!divi) { + return; + } + + if (divi->device()) { + DevicePropertiesDialog* propsDlg = new DevicePropertiesDialog(divi->device(), this); + propsDlg->exec(); + delete propsDlg; + } + else { + KMessageBox::sorry(this, "Detailed information is not available for this device", "Information Unavailable"); + } +} + +void DeviceIconView::keyPressEvent(TQKeyEvent *e) +{ + if (e->key() == Key_Return + || e->key() == Key_Enter + || e->key() == Key_Space) + { + if (currentItem()) { + slotItemSelected(currentItem()); + } + } + else { + KListView::keyPressEvent(e); + } +} + +TQPixmap DeviceIconView::loadIcon( const TQString &name ) +{ + TQPixmap icon = DesktopIcon( name, iconSize() ); + + if(icon.isNull()) { + icon = DesktopIcon( "misc", iconSize() ); + } + + return icon; +} + +KIcon::StdSizes DeviceIconView::iconSize() { + return KIcon::SizeSmall; +} \ No newline at end of file diff --git a/kcontrol/hwmanager/deviceiconview.h b/kcontrol/hwmanager/deviceiconview.h new file mode 100644 index 000000000..76c18e93f --- /dev/null +++ b/kcontrol/hwmanager/deviceiconview.h @@ -0,0 +1,82 @@ +/* + Copyright (c) 2012 Timothy Pearson + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +*/ + +#ifndef __deviceiconview_h__ +#define __deviceiconview_h__ + +#include +#include +#include + +#include "devicepropsdlg.h" + +class ConfigModule; +class ConfigModuleList; + +class DeviceIconItem : public KListViewItem +{ +public: + DeviceIconItem(TQListViewItem *parent, const TQString& text, const TQPixmap& pm, TDEGenericDevice *d = 0) + : KListViewItem(parent, text) + , _tag(TQString::null) + , _device(d) + { + setPixmap(0, pm); + } + DeviceIconItem(TQListView *parent, const TQString& text, const TQPixmap& pm, TDEGenericDevice *d = 0) + : KListViewItem(parent, text) + , _tag(TQString::null) + , _device(d) + { + setPixmap(0, pm); + } + + void setDevice(TDEGenericDevice* d) { _device = d; } + void setTag(const TQString& t) { _tag = t; } + + TDEGenericDevice* device() { return _device; } + TQString tag() { return _tag; } + + +private: + TQString _tag; + TDEGenericDevice *_device; +}; + +class DeviceIconView : public KListView +{ + Q_OBJECT + +public: + DeviceIconView(TQWidget * parent = 0, const char * name = 0); + KIcon::StdSizes iconSize(); + +signals: + void deviceSelected(TDEGenericDevice*); + +protected slots: + void slotItemSelected(TQListViewItem*); + void slotItemDoubleClicked(TQListViewItem*); + +protected: + void keyPressEvent(TQKeyEvent *); + TQPixmap loadIcon( const TQString &name ); +}; + +#endif diff --git a/kcontrol/hwmanager/devicepropsdlg.cpp b/kcontrol/hwmanager/devicepropsdlg.cpp new file mode 100644 index 000000000..16b01adc9 --- /dev/null +++ b/kcontrol/hwmanager/devicepropsdlg.cpp @@ -0,0 +1,111 @@ +/* This file is part of TDE + Copyright (C) 2012 Timothy Pearson + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ +#include + +#include +#include +#include +#include +#include +#include +#undef Unsorted // Required for --enable-final (tqdir.h) +#include + +#include +#include +#include +#include +#include + +#include "devicepropsdlg.h" + +DevicePropertiesDialog::DevicePropertiesDialog(TDEGenericDevice* device, TQWidget *parent) + : KDialogBase(Plain, TQString::null, Ok|Cancel, Ok, parent, 0L, true, true) +{ + m_device = device; + enableButtonOK( false ); + + if (m_device) { + TQGridLayout *mainGrid = new TQGridLayout(plainPage(), 1, 1, 0, spacingHint()); + mainGrid->setRowStretch(1, 1); + mainGrid->setRowStretch(1, 1); + + TQTabWidget *mainTabs = new TQTabWidget(plainPage()); + + TQWidget *genericPropertiesTab = new TQWidget(this); + + TQGridLayout *generalTabLayout = new TQGridLayout(genericPropertiesTab, 4, 2, 0, spacingHint() ); + + int row = 0; + TQLabel *label; + label = new TQLabel(i18n("Device Name:"), genericPropertiesTab); + generalTabLayout->addWidget(label, row, 0); + label = new TQLabel(m_device->friendlyName(), genericPropertiesTab); + generalTabLayout->addWidget(label, row, 1); + row++; + label = new TQLabel(i18n("Device Node:"), genericPropertiesTab); + generalTabLayout->addWidget(label, row, 0); + label = new TQLabel(m_device->deviceNode(), genericPropertiesTab); + generalTabLayout->addWidget(label, row, 1); + row++; + label = new TQLabel(i18n("System Path:"), genericPropertiesTab); + generalTabLayout->addWidget(label, row, 0); + label = new TQLabel(m_device->systemPath(), genericPropertiesTab); + generalTabLayout->addWidget(label, row, 1); + row++; + label = new TQLabel(i18n("Subsystem Type:"), genericPropertiesTab); + generalTabLayout->addWidget(label, row, 0); + label = new TQLabel(m_device->subsystem(), genericPropertiesTab); + generalTabLayout->addWidget(label, row, 1); + row++; + label = new TQLabel(i18n("Device Driver:"), genericPropertiesTab); + generalTabLayout->addWidget(label, row, 0); + label = new TQLabel((m_device->deviceDriver().isNull())?i18n(""):m_device->deviceDriver(), genericPropertiesTab); + generalTabLayout->addWidget(label, row, 1); + row++; + label = new TQLabel(i18n("Device Class:"), genericPropertiesTab); + generalTabLayout->addWidget(label, row, 0); + label = new TQLabel((m_device->PCIClass().isNull())?i18n(""):m_device->PCIClass(), genericPropertiesTab); + generalTabLayout->addWidget(label, row, 1); + row++; + if (m_device->subsystem() == "pci") { + TQString busid = m_device->systemPath(); + busid = busid.remove(0, busid.findRev("/")+1); + busid = busid.remove(0, busid.find(":")+1); + label = new TQLabel(i18n("Bus ID:"), genericPropertiesTab); + generalTabLayout->addWidget(label, row, 0); + label = new TQLabel(busid, genericPropertiesTab); + generalTabLayout->addWidget(label, row, 1); + row++; + } + + mainTabs->addTab(genericPropertiesTab, i18n("&General")); + + mainGrid->addWidget(mainTabs, 0, 0); + } +} + +DevicePropertiesDialog::~DevicePropertiesDialog() +{ +} + +void DevicePropertiesDialog::virtual_hook( int id, void* data ) +{ KDialogBase::virtual_hook( id, data ); } + +#include "devicepropsdlg.moc" diff --git a/kcontrol/hwmanager/devicepropsdlg.h b/kcontrol/hwmanager/devicepropsdlg.h new file mode 100644 index 000000000..30c69b1a7 --- /dev/null +++ b/kcontrol/hwmanager/devicepropsdlg.h @@ -0,0 +1,57 @@ +/* This file is part of TDE + Copyright (C) 2012 Timothy Pearson + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ +#ifndef __devicepropsdlg_h__ +#define __devicepropsdlg_h__ + +// #include + +#include + +#include + +/** + * + * Dialog to view and edit hardware device properties + * + * @version 0.1 + * @author Timothy Pearson + */ + +class TDEUI_EXPORT DevicePropertiesDialog : public KDialogBase +{ + Q_OBJECT +public: + /** + * Create a dialog that allows a user to view and edit hardware device properties + * @param parent Parent widget for the line edit dialog + */ + DevicePropertiesDialog(TDEGenericDevice* device, TQWidget *parent); + virtual ~DevicePropertiesDialog(); + +protected: + virtual void virtual_hook( int id, void* data ); + +private: + TDEGenericDevice* m_device; + + class DevicePropertiesDialogPrivate; + DevicePropertiesDialogPrivate* d; +}; + +#endif diff --git a/kcontrol/hwmanager/hwmanager.cpp b/kcontrol/hwmanager/hwmanager.cpp new file mode 100644 index 000000000..049460d17 --- /dev/null +++ b/kcontrol/hwmanager/hwmanager.cpp @@ -0,0 +1,175 @@ +/** + * hwmanager.cpp + * + * Copyright (c) 2009-2010 Timothy Pearson + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include "hwmanager.h" + +using namespace std; + +/**** DLL Interface ****/ +typedef KGenericFactory TDEHWManagerFactory; +K_EXPORT_COMPONENT_FACTORY( kcm_hwmanager, TDEHWManagerFactory("kcmhwmanager") ) + +KSimpleConfig *config; +KSimpleConfig *systemconfig; + +/**** TDEHWManager ****/ + +TDEHWManager::TDEHWManager(TQWidget *parent, const char *name, const TQStringList &) + : KCModule(TDEHWManagerFactory::instance(), parent, name) +{ + TQVBoxLayout *layout = new TQVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint()); + config = new KSimpleConfig( TQString::fromLatin1( "hwmanagerrc" )); + systemconfig = new KSimpleConfig( TQString::fromLatin1( KDE_CONFDIR "/tdehw/hwmanagerrc" )); + + KAboutData *about = + new KAboutData(I18N_NOOP("kcmhwmanager"), I18N_NOOP("TDE Hardware Device Manager"), + 0, 0, KAboutData::License_GPL, + I18N_NOOP("(c) 2012 Timothy Pearson")); + + about->addAuthor("Timothy Pearson", 0, "kb9vqf@pearsoncomputing.net"); + setAboutData( about ); + + base = new TDEHWManagerBase(this); + layout->add(base); + + setRootOnlyMsg(i18n("Hardware settings are system wide, and requires administrator access
To alter the system's hardware settings, click on the \"Administrator Mode\" button below.")); + setUseRootOnlyMsg(true); + + TDEHardwareDevices *hwdevices = KGlobal::hardwareDevices(); + + connect(base->showByConnection, TQT_SIGNAL(clicked()), TQT_SLOT(changed())); + connect(base->showByConnection, TQT_SIGNAL(clicked()), TQT_SLOT(populateTreeView())); + + 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())); + + load(); + + populateTreeView(); +} + +TDEHWManager::~TDEHWManager() +{ + delete config; + delete systemconfig; +} + +void TDEHWManager::load() +{ + load( false ); +} + +void TDEHWManager::load(bool useDefaults ) +{ + emit changed(useDefaults); +} + +void TDEHWManager::save() +{ + emit changed(false); +} + +void TDEHWManager::defaults() +{ + load( true ); +} + +void TDEHWManager::populateTreeView() +{ + bool show_by_connection = base->showByConnection->isChecked(); + + base->deviceTree->clear(); + + if (show_by_connection) { + DeviceIconItem* rootitem = new DeviceIconItem(base->deviceTree, "Linux System", DesktopIcon("misc", base->deviceTree->iconSize()), 0); + + TDEHardwareDevices *hwdevices = KGlobal::hardwareDevices(); + TDEGenericHardwareList hwlist = hwdevices->listByDeviceClass(TDEGenericDeviceType::Root); + TDEGenericDevice *hwdevice; + for ( hwdevice = hwlist.first(); hwdevice; hwdevice = hwlist.next() ) { + DeviceIconItem* item = new DeviceIconItem(rootitem, hwdevice->friendlyName(), hwdevice->icon(base->deviceTree->iconSize()), hwdevice); + populateTreeViewLeaf(item, show_by_connection); + } + } + else { + TDEHardwareDevices *hwdevices = KGlobal::hardwareDevices(); + for (int i=0;i<=TDEGenericDeviceType::Last;i++) { + if (i != TDEGenericDeviceType::Root) { + DeviceIconItem* item = new DeviceIconItem(base->deviceTree, hwdevices->getFriendlyDeviceTypeStringFromType((TDEGenericDeviceType::TDEGenericDeviceType)i), hwdevices->getDeviceTypeIconFromType((TDEGenericDeviceType::TDEGenericDeviceType)i, base->deviceTree->iconSize()), 0); + TDEGenericDevice *hwdevice; + TDEGenericHardwareList hwlist = hwdevices->listByDeviceClass((TDEGenericDeviceType::TDEGenericDeviceType)i); + for ( hwdevice = hwlist.first(); hwdevice; hwdevice = hwlist.next() ) { + new DeviceIconItem(item, hwdevice->friendlyName(), hwdevice->icon(base->deviceTree->iconSize()), hwdevice); + } + } + } + } +} + +void TDEHWManager::populateTreeViewLeaf(DeviceIconItem *parent, bool show_by_connection) { + if (show_by_connection) { + TDEHardwareDevices *hwdevices = KGlobal::hardwareDevices(); + TDEGenericHardwareList hwlist = hwdevices->listAllPhysicalDevices(); + TDEGenericDevice *hwdevice; + for ( hwdevice = hwlist.first(); hwdevice; hwdevice = hwlist.next() ) { + if (hwdevice->parentDevice() == parent->device()) { + DeviceIconItem* item = new DeviceIconItem(parent, hwdevice->friendlyName(), hwdevices->getDeviceTypeIconFromType(hwdevice->type(), base->deviceTree->iconSize()), hwdevice); + populateTreeViewLeaf(item, show_by_connection); + } + } + } +} + +TQString TDEHWManager::quickHelp() const +{ + return i18n("

TDE Hardware Device Manager

This module allows you to configure hardware devices on your system"); +} + +#include "hwmanager.moc" diff --git a/kcontrol/hwmanager/hwmanager.desktop b/kcontrol/hwmanager/hwmanager.desktop new file mode 100644 index 000000000..534a3c0c9 --- /dev/null +++ b/kcontrol/hwmanager/hwmanager.desktop @@ -0,0 +1,23 @@ +[Desktop Entry] +Exec=kcmshell kwmanager +Icon=background +Type=Application +DocPath=kcontrol/hwmanager/index.html + +X-KDE-Library=hwmanager +X-KDE-ParentApp=kcontrol +X-KDE-RootOnly=true +X-KDE-SubstituteUID=true + +Categories=Qt;KDE;X-KDE-settings-hardware; +Comment=Configure hardware devices +Comment[en_US]=Configure hardware devices +DocPath=kcontrol/hwmanager.html +GenericName= +GenericName[en_US]= +Keywords=hardware +MimeType= +Name=Hardware Device Manager +Name[en_US]=Hardware Device Manager + +NoDisplay=false \ No newline at end of file diff --git a/kcontrol/hwmanager/hwmanager.h b/kcontrol/hwmanager/hwmanager.h new file mode 100644 index 000000000..c8b7053df --- /dev/null +++ b/kcontrol/hwmanager/hwmanager.h @@ -0,0 +1,71 @@ +/** + * hwmanager.h + * + * Copyright (c) 2012 Timothy Pearson + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#ifndef _KCM_HWMANAGER_H +#define _KCM_HWMANAGER_H + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include + +#include + +#include "hwmanagerbase.h" +#include "devicepropsdlg.h" +#include "deviceiconview.h" + +class KConfig; +class KPopupMenu; +class KListViewItem; + +class TDEHWManager : public KCModule, public DCOPObject +{ + K_DCOP + Q_OBJECT + +public: + //TDEHWManager(TQWidget *parent = 0L, const char *name = 0L); + TDEHWManager(TQWidget *parent, const char *name, const TQStringList &); + virtual ~TDEHWManager(); + + TDEHWManagerBase *base; + + void load(); + void load( bool useDefaults); + void save(); + void defaults(); + + int buttons(); + TQString quickHelp() const; + +k_dcop: + +private slots: + void populateTreeView(); + void populateTreeViewLeaf(DeviceIconItem *parent, bool show_by_connection); + +private: + KConfig *config; +}; + +#endif + diff --git a/kcontrol/hwmanager/hwmanagerbase.ui b/kcontrol/hwmanager/hwmanagerbase.ui new file mode 100644 index 000000000..355799e56 --- /dev/null +++ b/kcontrol/hwmanager/hwmanagerbase.ui @@ -0,0 +1,97 @@ + +TDEHWManagerBase + + + TDEHWManagerBase + + + + 0 + 0 + 519 + 356 + + + + + unnamed + + + + TabWidget2 + + + true + + + + tab + + + Hardware Devices + + + + unnamed + + + + groupSystemSettings + + + System Settings + + + + unnamed + + + + showByConnection + + + &List devices by connection + + + + + deviceTree + + + + + + + Spacer4 + + + Vertical + + + Expanding + + + + 20 + 20 + + + + + + + + + + TDEHWManagerBase.ui.h + deviceiconview.h + + + enableSupport_toggled(bool) + + + kdialog.h + + + +