summaryrefslogtreecommitdiffstats
path: root/kcontrol/hwmanager/devicepropsdlg.cpp
diff options
context:
space:
mode:
authorDarrell Anderson <[email protected]>2012-04-06 19:01:43 -0500
committerDarrell Anderson <[email protected]>2012-04-06 19:01:43 -0500
commit520b27baef7cd2e3a8b7b757564a9b78cd61e506 (patch)
treef9b5e700a65cde840fd2325d22bfa664efcfc2bb /kcontrol/hwmanager/devicepropsdlg.cpp
parent5e6882c8f936caf15cc98409ecac3817bca2cb49 (diff)
parent0d6bebc5f5bacd360dcee8f58b93ae3c99028c75 (diff)
downloadtdebase-520b27baef7cd2e3a8b7b757564a9b78cd61e506.tar.gz
tdebase-520b27baef7cd2e3a8b7b757564a9b78cd61e506.zip
Merge branch 'master' of http://scm.trinitydesktop.org/scm/git/tdebase
Diffstat (limited to 'kcontrol/hwmanager/devicepropsdlg.cpp')
-rw-r--r--kcontrol/hwmanager/devicepropsdlg.cpp111
1 files changed, 111 insertions, 0 deletions
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 <[email protected]>
+
+ 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 <config.h>
+
+#include <tqvalidator.h>
+#include <tqpushbutton.h>
+#include <tqlineedit.h>
+#include <tqlabel.h>
+#include <tqtabwidget.h>
+#include <tqlayout.h>
+#undef Unsorted // Required for --enable-final (tqdir.h)
+#include <tqfiledialog.h>
+
+#include <kbuttonbox.h>
+#include <klocale.h>
+#include <kapplication.h>
+#include <klineedit.h>
+#include <kstdguiitem.h>
+
+#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("<none>"):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("<n/a>"):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"