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