Rev 238 | Rev 242 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 238 | Rev 241 | ||
---|---|---|---|
Line 95... | Line 95... | ||
95 | model_is_build = true; |
95 | model_is_build = true; |
96 | connect(sql_mogel, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SLOT(on_sql_mogel_dataChanged(QModelIndex,QModelIndex))); |
96 | connect(sql_mogel, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SLOT(on_sql_mogel_dataChanged(QModelIndex,QModelIndex))); |
97 | connect(model_for_ListModelsTable, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SLOT(on_model_for_ListModelsTable_dataChanged(QModelIndex,QModelIndex))); |
97 | connect(model_for_ListModelsTable, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SLOT(on_model_for_ListModelsTable_dataChanged(QModelIndex,QModelIndex))); |
98 | connect(filter_model, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SLOT(on_filter_model_dataChanged(QModelIndex,QModelIndex))); |
98 | connect(filter_model, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SLOT(on_filter_model_dataChanged(QModelIndex,QModelIndex))); |
99 | connect(&wmiProcess, SIGNAL(readyReadStandardOutput()), this, SLOT(readStandartProcessOutput())); |
99 | connect(&wmiProcess, SIGNAL(readyReadStandardOutput()), this, SLOT(readStandartProcessOutput())); |
100 | - | ||
- | 100 | connect(&wmiProcess, SIGNAL(readyReadStandardError()), this, SLOT(readStandartProcessError())); |
|
101 | 101 | ||
102 | 102 | ||
103 | ui->pushButton_3->setEnabled(false); |
103 | ui->pushButton_3->setEnabled(false); |
104 | ui->pushButton_4->setEnabled(false); |
104 | ui->pushButton_4->setEnabled(false); |
105 | 105 | ||
Line 126... | Line 126... | ||
126 | 126 | ||
127 | doc = ui->textEdit->document(); |
127 | doc = ui->textEdit->document(); |
128 | cursor = new QTextCursor(doc); |
128 | cursor = new QTextCursor(doc); |
129 | // buildReport(true);
|
129 | // buildReport(true);
|
130 | 130 | ||
- | 131 | all_reading = false; // íåò ïðî÷èòàííûõ äàííûõ èç ïðîöåññà |
|
- | 132 | wmiThread = new WmiThread(this); |
|
131 | 133 | ||
132 | }
|
134 | }
|
133 | 135 | ||
134 | MainWindow::~MainWindow() |
136 | MainWindow::~MainWindow() |
135 | {
|
137 | {
|
Line 1794... | Line 1796... | ||
1794 | // str2 << arr;
|
1796 | // str2 << arr;
|
1795 | //i = result.size();
|
1797 | //i = result.size();
|
1796 | // str1 = result.at(0);
|
1798 | // str1 = result.at(0);
|
1797 | i++; |
1799 | i++; |
1798 | //lineEdit->insert(str1);
|
1800 | //lineEdit->insert(str1);
|
- | 1801 | all_reading = true; |
|
1799 | 1802 | ||
1800 | }
|
1803 | }
|
1801 | 1804 | ||
1802 | void MainWindow::readStandartProcessError(){ |
1805 | void MainWindow::readStandartProcessError(){ |
- | 1806 | QTextDocument * wmiDoc = ui->textEdit_2->document(); |
|
- | 1807 | QTextCursor * wmiCursor; |
|
- | 1808 | wmiCursor = new QTextCursor(wmiDoc); |
|
- | 1809 | QString str;
|
|
- | 1810 | ||
1803 | QByteArray arr;
|
1811 | QByteArray arr;
|
1804 | arr = wmiProcess.readAllStandardError(); |
1812 | arr = wmiProcess.readAllStandardError(); |
- | 1813 | str = QString(tr(arr)); |
|
- | 1814 | wmiCursor->insertText(str); |
|
- | 1815 | wmiCursor->insertText(tr("\n")); |
|
- | 1816 | ||
- | 1817 | }
|
|
- | 1818 | ||
- | 1819 | ||
- | 1820 | ||
- | 1821 | TWmiVideoCard MainWindow::getWmiVideoGard(QString host, QString user_name, QString password){ |
|
- | 1822 | TWmiVideoCard result;
|
|
- | 1823 | bool ok; |
|
- | 1824 | wmiThread->setHost(host); // çàäàåì õîñò |
|
- | 1825 | wmiThread->setUser(user_name);//çàäàåì èìÿ ïîëüçîâàòåëÿ |
|
- | 1826 | wmiThread->setPassword( password); |
|
- | 1827 | wmiThread->start(QThread::NormalPriority); |
|
- | 1828 | wmiThread->setWmiString(tr("select * from Win32_ComputerSystem")); |
|
- | 1829 | ok = wmiThread->wait(10000); |
|
- | 1830 | if (ok){ |
|
- | 1831 | int m; |
|
- | 1832 | m++; |
|
- | 1833 | }
|
|
- | 1834 | else { |
|
- | 1835 | wmiThread->stop(); |
|
- | 1836 | ok = wmiThread->wait(10000); |
|
- | 1837 | int k; |
|
- | 1838 | k++; |
|
- | 1839 | }
|
|
- | 1840 | ||
- | 1841 | /*
|
|
- | 1842 | ||
- | 1843 | QString program = tr("wmic");
|
|
- | 1844 | QStringList arguments;
|
|
- | 1845 | ||
- | 1846 | // arguments << tr(" -U Àäìèíèñòðàòîð%Patr10t //192.168.0.135 \"select * from Win32_ComputerSystem\"");
|
|
- | 1847 | // program.append(tr(" -U Àäìèíèñòðàòîð%Patr10t //192.168.0.135 \"select * from Win32_ComputerSystem\""));
|
|
- | 1848 | program.append(tr(" -U admin --password=samba //192.168.0.101 \"select * from ")); //Win32_Product\""));
|
|
- | 1849 | program.append(ui->comboBox_2->currentText());
|
|
- | 1850 | program.append(tr("\""));
|
|
- | 1851 | all_reading = false;
|
|
- | 1852 | int i;
|
|
- | 1853 | i++;
|
|
- | 1854 | wmiProcess.start(program);
|
|
- | 1855 | ||
- | 1856 | ||
- | 1857 | ||
- | 1858 | while (!all_reading){}; //æäåì, ïîêà íå ñ÷èòàåòñÿ ðåçóëüòàò çàïðîñà
|
|
- | 1859 | ||
- | 1860 | */
|
|
- | 1861 | return result; |
|
1805 | 1862 | ||
1806 | }
|
1863 | }
|