~ubuntu-branches/ubuntu/utopic/kde-workspace/utopic-proposed

« back to all changes in this revision

Viewing changes to kinfocenter/Modules/pci/kcm_pci.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Michał Zając
  • Date: 2011-07-09 08:31:15 UTC
  • Revision ID: james.westby@ubuntu.com-20110709083115-ohyxn6z93mily9fc
Tags: upstream-4.6.90
Import upstream version 4.6.90

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 *  Copyright (C) 2008 Nicolas Ternisien <nicolas.ternisien@gmail.com>
 
3
 *
 
4
 *  This program is free software; you can redistribute it and/or modify
 
5
 *  it under the terms of the GNU General Public License as published by
 
6
 *  the Free Software Foundation; either version 2 of the License, or
 
7
 *  (at your option) any later version.
 
8
 *
 
9
 *  This program is distributed in the hope that it will be useful,
 
10
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
12
 *  GNU General Public License for more details.
 
13
 *
 
14
 *  You should have received a copy of the GNU General Public License
 
15
 *  along with this program; if not, write to the Free Software
 
16
 *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 
17
 */
 
18
 
 
19
#include "kcm_pci.h"
 
20
 
 
21
#include <QStringList>
 
22
 
 
23
#include <KPluginFactory>
 
24
#include <KPluginLoader>
 
25
 
 
26
#include <kaboutdata.h>
 
27
#include <kdialog.h>
 
28
#include <kdebug.h>
 
29
 
 
30
#include <QLayout>
 
31
#include <QPainter>
 
32
 
 
33
#include <QPixmap>
 
34
#include <QLabel>
 
35
#include <QVBoxLayout>
 
36
#include <QHBoxLayout>
 
37
#include <QTreeWidget>
 
38
 
 
39
#include <klocale.h>
 
40
#include <kglobal.h>
 
41
#include <kseparator.h>
 
42
 
 
43
K_PLUGIN_FACTORY(KCMPciFactory,
 
44
                registerPlugin<KCMPci>();
 
45
)
 
46
K_EXPORT_PLUGIN(KCMPciFactory("kcm_pci"))
 
47
 
 
48
KCMPci::KCMPci(QWidget *parent, const QVariantList &) :
 
49
        KCModule(KCMPciFactory::componentData(), parent) {
 
50
 
 
51
        KAboutData *about = new KAboutData(I18N_NOOP("kcm_pci"), 0,
 
52
                        ki18n("KDE PCI Information Control Module"),
 
53
                        0, KLocalizedString(), KAboutData::License_GPL,
 
54
                        ki18n(  "(c) 2008 Nicolas Ternisien"
 
55
                                        "(c) 1998 - 2002 Helge Deller"));
 
56
 
 
57
        about->addAuthor(ki18n("Nicolas Ternisien"), KLocalizedString(), "nicolas.ternisien@gmail.com");
 
58
        about->addAuthor(ki18n("Helge Deller"), KLocalizedString(), "deller@gmx.de");
 
59
        setAboutData(about);
 
60
 
 
61
        KGlobal::locale()->insertCatalog("kcm_infobase");
 
62
        
 
63
        QHBoxLayout* layout = new QHBoxLayout(this);
 
64
        layout->setSpacing(0);
 
65
        layout->setMargin(0);
 
66
        
 
67
        tree = new QTreeWidget(this);
 
68
        layout->addWidget(tree);
 
69
        tree->setSelectionMode(QAbstractItemView::ExtendedSelection);
 
70
        tree->setAllColumnsShowFocus(true);
 
71
        tree->setRootIsDecorated(false);
 
72
        tree->setWhatsThis(i18n("This list displays PCI information.") );
 
73
 
 
74
 
 
75
}
 
76
 
 
77
KCMPci::~KCMPci() {
 
78
 
 
79
}
 
80
 
 
81
void KCMPci::load() {
 
82
        kDebug() << "Loading PCI information..." << endl;
 
83
        GetInfo_PCI(tree);
 
84
 
 
85
        //Resize the column width to the maximum needed
 
86
        tree->expandAll();
 
87
        tree->resizeColumnToContents( 0 );
 
88
        tree->collapseAll();
 
89
}
 
90
 
 
91
QString KCMPci::quickHelp() const {
 
92
        return i18n("This display shows information about your computer's PCI slots and the related connected devices.");
 
93
}
 
94
 
 
95
#include "kcm_pci.moc"