2
* Copyright (C) 2013 ~ 2015 National University of Defense Technology(NUDT) & Kylin Ltd.
5
* Kobe Lee xiangli@ubuntukylin.com/kobe24_lixiang@126.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; version 3.
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License
17
* along with this program. If not, see <http://www.gnu.org/licenses/>.
20
#include "driverwidget.h"
21
#include "devicemanager.h"
24
DriverWidget::DriverWidget(QWidget *parent/*, SystemDispatcher *proxy*/) :
28
this->setStyleSheet("QWidget{border: none;background-color: #ffffff;}");
29
setFixedSize(750, 403);
30
scroll_widget = new ScrollWidget(this);
31
scroll_widget->setGeometry(0, 0, 750, 403);
33
if(driver_info_map.count() != 0)
35
page = new ComputerPage(scroll_widget->zone, tr("Driver Info"));
36
page->setMap(driver_info_map,"");
38
scroll_widget->addScrollWidget(page);
45
DriverWidget::~DriverWidget()
51
if (scroll_widget != NULL) {
57
void DriverWidget::initData()
59
DeviceManager manager;
60
QStringList list = manager.getDeviceMsg();
61
for (int i=0 ; i < list.length() ; i++) {
62
QStringList splitlist = list.at(i).split(";");
63
if(splitlist.length() == 1) {
64
QStringList name = splitlist.at(0).split(":");
65
driver_info_map.insert(name.at(0).trimmed(), name.at(1));
66
// driver_info_map.insert("deviceName", name.at(0));
67
// driver_info_map.insert("deviceNameText", name.at(1));
69
else if(splitlist.length() == 2) {
70
QStringList name1 = splitlist.at(0).split(":");
71
QStringList name2 = splitlist.at(1).split(":");
72
driver_info_map.insert(name1.at(0).trimmed(), name1.at(1));
73
driver_info_map.insert(name2.at(0).trimmed(), name2.at(1));
74
// driver_info_map.insert("deviceName", name1.at(0));
75
// driver_info_map.insert("deviceNameText", name1.at(1));
76
// driver_info_map.insert("inUseName", name2.at(0));
77
// driver_info_map.insert("inUseNameText", name2.at(1));
79
else if(splitlist.length() == 3) {
80
QStringList name3 = splitlist[0].split(":");
81
QStringList name4 = splitlist[1].split(":");
82
QStringList name5 = splitlist[2].split(":");
83
driver_info_map.insert(name3.at(0).trimmed(), name3.at(1));
84
driver_info_map.insert(name4.at(0).trimmed(), name4.at(1));
85
driver_info_map.insert(name5.at(0).trimmed(), name5.at(1));
86
// driver_info_map.insert("deviceName", name3.at(0));
87
// driver_info_map.insert("deviceNameText", name3.at(1));
88
// driver_info_map.insert("inUseName", name4.at(0));
89
// driver_info_map.insert("inUseNameText", name4.at(1));
90
// driver_info_map.insert("existName", name5.at(0));
91
// driver_info_map.insert("existNameText", name5.at(1));