Редакция 14 | Содержимое файла | Сравнить с предыдущей | Последнее изменение | Открыть журнал | RSS
Редакция | Автор | № строки | Строка |
---|---|---|---|
6 | pingvin | 1 | #ifndef MAINWINDOWIMPL_H |
2 | #define MAINWINDOWIMPL_H |
||
3 | // |
||
4 | #include <QtGui> |
||
5 | #include <QMainWindow> |
||
6 | #include <QString> |
||
7 | #include <QtSql> |
||
125 | pingvin | 8 | #include <QSqlField> |
9 | #include <QSqlRecord> |
||
6 | pingvin | 10 | #include <QSqlTableModel> |
125 | pingvin | 11 | #include <QSqlQueryModel> |
6 | pingvin | 12 | #include <QTableView> |
13 | #include <QSqlDriverPlugin> |
||
14 | #include <QIcon> |
||
15 | #include <QVariant> |
||
16 | #include <QProcess> |
||
17 | #include <QByteArray> |
||
18 | #include "ui_mainwindow.h" |
||
19 | #include "settingform.h" |
||
20 | #include "addmemoryform.h" |
||
21 | #include "addotdelform.h" |
||
22 | #include "addsotrydnikform.h" |
||
14 | pingvin | 23 | #include "form.h" |
6 | pingvin | 24 | //#include "addssblockform.h" |
25 | #include "addsysblockform.h" |
||
26 | #include "raportform.h" |
||
125 | pingvin | 27 | #include <QAbstractItemDelegate> |
6 | pingvin | 28 | |
29 | |||
30 | #include <string.h> |
||
31 | |||
32 | |||
33 | |||
34 | // |
||
35 | |||
36 | bool myfun(void); |
||
37 | /// /// bool send(void); |
||
38 | bool send(int); |
||
39 | bool connecttoregistry(void); |
||
40 | bool initcomponentcontext(void); |
||
41 | |||
42 | class MainWindowImpl : public QMainWindow, public Ui::MainWindow |
||
43 | { |
||
44 | enum type_komplektyushie {MB, HDD, CD_DVD}; |
||
45 | typedef enum type_komplektyushie komplektyushie; |
||
46 | |||
47 | enum type_currient_task_for_dblclick {no_task, select_sys_block, select_sotrydnik_for_sys_block}; |
||
48 | typedef enum type_currient_task_for_dblclick currient_task_for_dblclick; |
||
49 | |||
50 | |||
51 | |||
52 | |||
53 | Q_OBJECT |
||
54 | public: |
||
55 | MainWindowImpl( QWidget * parent = 0, Qt::WFlags f = 0 ); |
||
56 | ~MainWindowImpl(); |
||
57 | void initTreeWidget(); |
||
58 | |||
59 | |||
60 | private slots: |
||
61 | void openBase(); |
||
62 | void openMemoryTable(); |
||
63 | void getSetting(); |
||
64 | void applySetting(); |
||
65 | void addString(); |
||
66 | void delString(); |
||
67 | void filter(); |
||
68 | void hiddenRow(); |
||
69 | void showRow(); |
||
70 | void dbUpdate();// |
||
71 | void dblClick(QTreeWidgetItem *item, int column); |
||
72 | void on_treeWidget_itemActivated(QTreeWidgetItem *item, int column); |
||
73 | void on_treeWidget_itemClicked(QTreeWidgetItem *item, int column); |
||
74 | void on_treeWidget_itemSelectionChanged (); |
||
75 | void editTreeWidget(); |
||
76 | void addNewOtdel();// |
||
77 | void addNewMemory(); |
||
78 | void addNewMemory(QString inventar_num); |
||
79 | void refreshTree(); |
||
80 | void move_to_sklad(); |
||
81 | void new_sotrydnik(); |
||
82 | void novoe_oborydovanie(); |
||
83 | void ystanovit_novie_complektyushie(); |
||
84 | void pereimenovft_otdel(); |
||
85 | void yvolit_sotrydnika(); |
||
86 | void perevesti_sotrydnika_v_drygo1_otdel(); |
||
87 | void naznachit_otvetstvennim_za_oborydovanie(); |
||
88 | void novaya_MB_na_sklad(); |
||
89 | void novaya_RAM_na_sklad(); |
||
90 | void novaya_CPU_na_sklad(); |
||
91 | void novaya_HDD_na_sklad(); |
||
92 | void novaya_CD_DVD_na_sklad(); |
||
93 | void novaya_VIDEO_na_sklad(); |
||
94 | void novaya_SoundCard_na_sklad(); |
||
95 | void novaya_LAN_na_sklad(); |
||
96 | void novaya_SYSTEM_BLOCK_na_sklad(); |
||
97 | void on_addmemoryForm_formClose(); |
||
98 | void insert_MB_to_system_block(); |
||
99 | void on_createButton_clicked(); |
||
100 | void on_exportButton_clicked(); |
||
101 | void on_wmiButton_clicked(); |
||
102 | void peredat_sys_block_pod_otveystvennost(); |
||
103 | void readStandartProcessOutput(); |
||
104 | void readStandartProcessError(); |
||
105 | |||
106 | private: |
||
107 | // |
||
108 | QString baseName; |
||
109 | QString hostName; |
||
110 | QString userName; |
||
111 | QString password; |
||
112 | QString tableName; |
||
113 | |||
114 | |||
115 | |||
116 | QString component_table; // , |
||
117 | QString component_id;// , |
||
118 | QString curr_sys_block_id; |
||
119 | bool fEnable_component_add; |
||
120 | bool fEnable_naznachit_otvetstv; |
||
121 | int id_sys_block_pod_otvetstv; |
||
122 | currient_task_for_dblclick curr_task; |
||
123 | // |
||
124 | settingForm *setFrm; |
||
125 | addmemoryForm addmemFrm; |
||
126 | addotdelForm addotdelFrm; |
||
127 | addsotrydnikForm addsotrydnikFrm; |
||
128 | raportForm raportFrm; |
||
14 | pingvin | 129 | Form wmiFrm; |
6 | pingvin | 130 | |
131 | addsysblockForm addsysblockFrm; |
||
125 | pingvin | 132 | |
133 | QSqlTableModel *model; |
||
6 | pingvin | 134 | QSqlTableModel *memory_model; |
135 | QTableView view; |
||
136 | QTableView memory_view;// return res; |
||
137 | QList<QTreeWidgetItem *> items; |
||
138 | QTreeWidgetItem *itm; |
||
139 | QTreeWidgetItem *itm1; |
||
140 | QTreeWidgetItem *itm_sklad_komplectyushie; |
||
141 | QTreeWidgetItem *itm_sklad_system_blocks; |
||
142 | QTreeWidgetItem *itm_sklad_orgtehnika; |
||
143 | QTreeWidgetItem *itm_sklad_orgtehnika_printers; |
||
144 | QTreeWidgetItem *itm_sklad_orgtehnika_mfy; |
||
145 | QTreeWidgetItem *itm_sklad_orgtehnika_scaners; |
||
146 | QTreeWidgetItem *itm_sklad_rashodniki; |
||
147 | QAction *metaDataAction; |
||
148 | QAction *addMemoryAction; |
||
149 | QAction *MB_na_skladAction; // " " |
||
150 | QAction *new_sotrydnikAction; |
||
151 | QAction *novoe_oborydovanieAction; |
||
152 | QAction *SpliterAction; |
||
153 | QAction *pereimenovat_otdelAction; |
||
154 | QAction *perevesti_sotrydnika_v_drygo1_otdelAction; |
||
155 | QAction *yvolit_sotrydnikaAction; |
||
156 | QAction *naznachit_otvetstvennim_za_oborydovanieAction; |
||
157 | QAction *peredat_sys_block_pod_otveystvennostAction; |
||
158 | QAction *ystanovit_novie_complektyushieAction; |
||
159 | QAction *sozdat_otdelAction; |
||
160 | |||
161 | QAction *novaya_MB_na_skladAction; |
||
162 | QAction *novaya_RAM_na_skladAction; |
||
163 | QAction *novaya_CPU_na_skladAction; |
||
164 | QAction *novaya_HDD_na_skladAction; |
||
165 | QAction *novaya_CD_DVD_na_skladAction; |
||
166 | QAction *novaya_VIDEO_na_skladAction; |
||
167 | QAction *novaya_SoundCard_na_skladAction; |
||
168 | QAction *novaya_LAN_na_skladAction; |
||
169 | QAction *novaya_SYSTEM_BLOCK_na_skladAction; |
||
170 | |||
171 | QAction *insert_MB_to_system_blockAction; // |
||
172 | |||
173 | // |
||
174 | void writeSettings(); |
||
175 | void readSettings(); |
||
176 | void SotrydnikiOtdela(QString id_otdela, QTreeWidgetItem * itemOtdela); // |
||
177 | void addOtdels();// treeView |
||
178 | |||
179 | |||
180 | |||
181 | QString oborydovanie(QString id_sotrydnika, QTreeWidgetItem * itemSotrydnika); |
||
182 | QString addMatheBoardInformation(QString id_otvetstvennogo_lica, QString id_systemBlock, QTreeWidgetItem * itemSysBlock); |
||
183 | QString addMemoryInformation(QString id_otvetstvennogo_lica, QString id_systemBlock, QTreeWidgetItem * itemSysBlock); |
||
184 | QString addCpuInformation(QString id_otvetstvennogo_lica, QString id_systemBlock, QTreeWidgetItem * itemSysBlock); |
||
185 | QString addHDDInformation(QString id_otvetstvennogo_lica, QString id_systemBlock, QTreeWidgetItem * itemSysBlock); |
||
186 | QString add_CD_DVD_Information(QString id_otvetstvennogo_lica, QString id_systemBlock, QTreeWidgetItem * itemSysBlock); |
||
187 | QString add_Vidio_Information(QString id_otvetstvennogo_lica, QString id_systemBlock, QTreeWidgetItem * itemSysBlock); |
||
188 | QString add_Sound_Card_Information(QString id_otvetstvennogo_lica, QString id_systemBlock, QTreeWidgetItem * itemSysBlock); |
||
189 | QString add_Lan_Card_Information(QString id_otvetstvennogo_lica, QString id_systemBlock, QTreeWidgetItem * itemSysBlock); |
||
190 | QString get_info_from_system_block(QString inventar_num); |
||
191 | void delete_all_actions(); |
||
192 | void add_actions_for_otdel(); |
||
193 | void add_actions_for_sklad(); |
||
194 | void add_actions_for_sotrydnik(); |
||
195 | void add_actions_for_system_block(); |
||
196 | void add_actions_for_kompletyushie(); |
||
197 | void add_actions_for_sklad_MB(); |
||
198 | void add_actions_for_sklad_RAM(); |
||
199 | void add_actions_for_sklad_CPU(); |
||
200 | void add_actions_for_sklad_HDD(); |
||
201 | void add_actions_for_sklad_CD_DVD(); |
||
202 | void add_actions_for_sklad_VIDEO(); |
||
203 | void add_actions_for_sklad_SoundCard(); |
||
204 | void add_actions_for_sklad_LAN(); |
||
205 | void add_actions_for_sklad_SB(); |
||
206 | void add_actions_for_insert_MB_to_system_block(); |
||
207 | void add_actions_for_sklad_system_block(); |
||
208 | |||
209 | |||
210 | int select_system_block(); // |
||
211 | |||
212 | |||
213 | |||
214 | public: |
||
215 | QIcon comp_icon; |
||
216 | QIcon printer_icon; |
||
217 | QIcon hdd_icon; |
||
218 | QIcon memory_icon; |
||
219 | QIcon matheboard_icon; |
||
220 | QIcon cpu_icon; |
||
221 | QIcon cd_dvd_icon; |
||
222 | QIcon vidio_card_icon; |
||
223 | QIcon sound_card_icon; |
||
224 | QIcon lan_card_icon; |
||
225 | QSqlDatabase *pdb; |
||
226 | QSqlDatabase db; |
||
227 | QProcess process; |
||
228 | |||
229 | }; |
||
230 | #endif |
||
231 | |||
232 | |||
233 | |||
234 |