Subversion Repositories OpenInventory

Compare Revisions

Ignore whitespace Rev 256 → Rev 257

/trunk/DBViewer/mainwindow.cpp
2429,7 → 2429,7
else return result; //ïîëó÷èëè íå êîððåêòíûé îòâåò
int m;
m++;
}
}
else {
wmiThread.terminate();
return result;
2439,15 → 2439,91
int k;
k++;
*******/
}
 
 
 
}
 
 
 
 
QList<TWmiSoundCard> MainWindow::getWmiSoundCard(QString host, QString user_name, QString password)
{
QList<TWmiSoundCard> result;
TWmiSoundCard soundCard_tmp;
bool ok;
QString ansver_string;
wmiThread.setHost(host); // çàäàåì õîñò
wmiThread.setUser(user_name);//çàäàåì èìÿ ïîëüçîâàòåëÿ
wmiThread.setPassword( password);
wmiThread.setWmiString(tr("Select Caption, Name from Win32_SoundDevice"));
wmiThread.start(QThread::NormalPriority);
ok = wmiThread.wait(10000);
 
 
 
if (ok){
QTextDocument * wmiDoc = ui->textEdit_2->document();
QTextCursor * wmiCursor;
QStringList split_new_line; //
QStringList fields_list; //â ýòîì ñïèñêå ñîõðàíèì ïîëÿ
QStringList values_list; //à â ýòîì ñïèñêå - çíà÷åíèÿ
wmiCursor = new QTextCursor(wmiDoc);
 
 
ansver_string = wmiThread.resultString();
 
 
wmiCursor->insertText(ansver_string);
split_new_line = ansver_string.split("\n", QString::SkipEmptyParts); // ðàçáèâàåíì îòâåò íà ñòðîêè
if(split_new_line.count()>2) {
QString tmp_str;
tmp_str = split_new_line.at(1);
fields_list = tmp_str.split("|");
 
for(int i=2; i< split_new_line.count(); i++)
{
soundCard_tmp.caption = "";
tmp_str = split_new_line.at(i);
values_list = tmp_str.split("|");
int index_tmp;
index_tmp = fields_list.indexOf(tr("Caption")); // íàèìåíîâàíèå çâóêîâîé êàðòû
if ((index_tmp!=-1) && (index_tmp < values_list.count())) soundCard_tmp.caption = values_list.at(index_tmp);
 
 
result << soundCard_tmp;
 
};
 
return result;
}
else return result; //ïîëó÷èëè íå êîððåêòíûé îòâåò
int m;
m++;
}
else {
wmiThread.terminate();
return result;
/*********
wmiThread.stop();
ok = wmiThread.wait(10000);
int k;
k++;
*******/
}
 
 
return result;
 
}
 
 
 
 
 
 
 
 
 
 
/trunk/DBViewer/mainwindow.h
118,7 → 118,11
 
} TWmiNetCard;
 
typedef struct wmiSoundCard {
QString caption; // íàçâàíèå âèäåîêàðòû
// QString MACAddress; // ïðîèçâîäèòåëü
 
} TWmiSoundCard;
 
namespace Ui {
class MainWindow;
192,6 → 196,7
 
QList<TWmiCDROM> getWmiCDROM(QString host, QString user_name, QString password);
QList<TWmiNetCard> getWmiNetCard(QString host, QString user_name, QString password);
QList<TWmiSoundCard> getWmiSoundCard(QString host, QString user_name, QString password);
 
 
 
/trunk/DBViewer/database.cpp
1657,7 → 1657,7
QList<TWmiHDD> hdd_list;
QList<TWmiCDROM> cdrom_list;
QList<TWmiNetCard> netcadr_list;
 
QList<TWmiSoundCard> soundcard_list;
vCard = MainWindow::getWmiVideoGard(IP_str, user_name_str, password_str);
 
if (!vCard.name.isEmpty()) {
1952,27 → 1952,54
 
}
 
}
 
soundcard_list = MainWindow::getWmiSoundCard(IP_str, user_name_str, password_str);
 
if (!soundcard_list.isEmpty()){
QTreeWidgetItem * itm_soundCard_list;
 
itm_soundCard_list = new QTreeWidgetItem(itm_tmp);
itm_soundCard_list->setText(0, tr("Çâóêîâûå êàðòû:"));
 
 
for (int i = 0; i < cdrom_list.count(); i++){
 
QTreeWidgetItem * itm_sound_card;
//QTreeWidgetItem * itm_net_card_mac;
//QTreeWidgetItem * itm_sou_card_cap;
QString tmp_str;
tmp_str = tr("Çâóêîâàÿ êàðòà: ");
tmp_str.append(soundcard_list.at(i).caption);
 
itm_sound_card = new QTreeWidgetItem(itm_soundCard_list);
itm_sound_card->setText(0, tmp_str);
 
 
 
 
ui->treeWidget_3->expandItem( itm_soundCard_list);
 
}
 
 
 
 
 
 
 
}
 
ui->treeWidget_3->expandItem(itm_tmp);
// itm_tmp->setChildIndicatorPolicy(QTreeWidget::
int i;
i++;
 
}
 
} //while
 
 
} //while
 
 
 
}