5
* Copyright (C) 2009 David Hubner <hubnerd@ntlworld.com>
7
* This program is free software; you can redistribute it and/or modify
8
* it under the terms of the GNU General Public License as published by
9
* the Free Software Foundation; either version 2 of the License, or
10
* (at your option) any later version.
12
* This program is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
* GNU General Public License for more details.
17
* You should have received a copy of the GNU General Public License
18
* along with this program; if not, write to the Free Software
19
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
26
K_PLUGIN_FACTORY(devInfoModuleFactory, registerPlugin<DevInfoPlugin>();)
27
K_EXPORT_PLUGIN(devInfoModuleFactory("kcmdevinfo"))
29
DevInfoPlugin::DevInfoPlugin(QWidget *parent, const QVariantList &) :
30
KCModule(devInfoModuleFactory::componentData(), parent)
33
const KAboutData *about =
34
new KAboutData(I18N_NOOP("kcmdevinfo"), 0, ki18n("KDE Solid Based Device Viewer"),
35
"0.70", KLocalizedString(), KAboutData::License_GPL,
36
ki18n("(c) 2010 David Hubner"));
41
layout = new QGridLayout(this);
42
layout->setContentsMargins(0,0,0,0);
45
QSplitter *split = new QSplitter(Qt::Horizontal, this);
46
split->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
48
split->setChildrenCollapsible(false);
50
InfoPanel *info = new InfoPanel(split, this);
51
DeviceListing *devList = new DeviceListing(split, info, this);
53
split->setStretchFactor(1,1);
56
QWidget *bottom = new QWidget(this);
57
bottom->setContentsMargins(0,0,0,0);
58
bottom->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Minimum);
60
QHBoxLayout *bottomLayout = new QHBoxLayout(bottom);
61
bottomLayout->setContentsMargins(0,0,0,0);
64
boldFont.setBold(true);
66
QLabel *udiLabel = new QLabel(i18n("UDI: "));
67
udiLabel->setFont(boldFont);
68
udiLabel->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum);
70
udiStatus = new QLabel(this);
71
udiStatus->setAlignment(Qt::AlignLeft | Qt::AlignVCenter);
72
udiStatus->setTextInteractionFlags(Qt::TextSelectableByMouse);
73
udiStatus->setWhatsThis(i18nc("Udi Whats This","Shows the current device's UDI (Unique Device Identifier)"));
76
split->addWidget(devList);
77
split->addWidget(info);
78
layout->addWidget(split,0,0);
80
bottomLayout->addWidget(udiLabel);
81
bottomLayout->addWidget(udiStatus);
82
layout->addWidget(bottom,1,0,1,0);
86
updateStatus(i18n("None"));
89
DevInfoPlugin::~DevInfoPlugin()
94
void DevInfoPlugin::updateStatus(const QString message)
96
udiStatus->setText(message);