Subversion Repositories OpenInventory

Rev

Rev 6 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

#ifndef MAINWINDOWIMPL_H
#define MAINWINDOWIMPL_H
//
#include <QtGui>
#include <QMainWindow>
#include <QString>
#include <QtSql>
#include <QSqlTableModel>
#include <QTableView>
#include <QSqlDriverPlugin>
#include <QIcon>
#include <QVariant>
#include <QProcess>
#include <QByteArray>
#include "ui_mainwindow.h"
#include "settingform.h"
#include "addmemoryform.h"
#include "addotdelform.h"
#include "addsotrydnikform.h"
#include "form.h"
//#include "addsósblockform.h"
#include "addsysblockform.h"
#include "raportform.h"



#include <string.h>



//

bool myfun(void);
/// /// bool send(void);
bool send(int);
bool connecttoregistry(void);
bool initcomponentcontext(void);

class MainWindowImpl : public QMainWindow, public Ui::MainWindow
{
enum type_komplektyushie {MB, HDD, CD_DVD};
typedef  enum type_komplektyushie komplektyushie;

enum type_currient_task_for_dblclick {no_task, select_sys_block, select_sotrydnik_for_sys_block};
typedef enum type_currient_task_for_dblclick currient_task_for_dblclick;




Q_OBJECT
public:
        MainWindowImpl( QWidget * parent = 0, Qt::WFlags f = 0 );
        ~MainWindowImpl();
        void initTreeWidget();
       

private slots:
        void openBase();
        void openMemoryTable();
        void getSetting();
        void applySetting();
        void addString();
        void delString();
        void filter();
        void hiddenRow();
        void showRow();
        void dbUpdate();//âíîñèì èçìåíåíèÿ â áàçó äàííûõ
        void dblClick(QTreeWidgetItem *item, int column);
        void on_treeWidget_itemActivated(QTreeWidgetItem *item, int column);
        void on_treeWidget_itemClicked(QTreeWidgetItem *item, int column);
        void on_treeWidget_itemSelectionChanged ();
        void editTreeWidget();
        void addNewOtdel();//ñîçäàåì íîâûé îòäåë
        void addNewMemory();
        void addNewMemory(QString inventar_num);
        void refreshTree();
        void move_to_sklad();
        void new_sotrydnik();
        void novoe_oborydovanie();
        void ystanovit_novie_complektyushie();
        void pereimenovft_otdel();
        void yvolit_sotrydnika();
        void perevesti_sotrydnika_v_drygo1_otdel();
        void naznachit_otvetstvennim_za_oborydovanie();
        void novaya_MB_na_sklad();
        void novaya_RAM_na_sklad();
        void novaya_CPU_na_sklad();
        void novaya_HDD_na_sklad();
        void novaya_CD_DVD_na_sklad();
        void novaya_VIDEO_na_sklad();
        void novaya_SoundCard_na_sklad();
        void novaya_LAN_na_sklad();
        void novaya_SYSTEM_BLOCK_na_sklad();
        void on_addmemoryForm_formClose();
        void insert_MB_to_system_block();
        void on_createButton_clicked();
        void on_exportButton_clicked();
        void on_wmiButton_clicked();
        void peredat_sys_block_pod_otveystvennost();
        void readStandartProcessOutput();
        void readStandartProcessError();
       
private:
//ïåðåìåííûå
        QString baseName;
        QString hostName;
        QString userName;
        QString password;
        QString tableName;
       
       
       
        QString component_table; // òèï êîìïîíåíòà, óñòàíàâëèâàåìíîãî â ñèñòåìíûé áëîê
        QString component_id;// èäåíòèôèêàòîð êîìïîíåíòà, óñòàíàâëèâàåìîãî â ñèñòåìíûé áëîê
        QString curr_sys_block_id;
        bool fEnable_component_add;
        bool fEnable_naznachit_otvetstv;
        int id_sys_block_pod_otvetstv;
        currient_task_for_dblclick curr_task;
//óêàçàòåëè íà îáúåêòû
        settingForm *setFrm;
        addmemoryForm addmemFrm;
        addotdelForm addotdelFrm;
        addsotrydnikForm addsotrydnikFrm;
        raportForm raportFrm;
        Form wmiFrm;

        addsysblockForm addsysblockFrm;
        QSqlTableModel *model;
        QSqlTableModel *memory_model;
        QTableView view;
        QTableView memory_view;//       return res;
        QList<QTreeWidgetItem *> items;
        QTreeWidgetItem *itm;
        QTreeWidgetItem *itm1;
        QTreeWidgetItem *itm_sklad_komplectyushie;
        QTreeWidgetItem *itm_sklad_system_blocks;
        QTreeWidgetItem *itm_sklad_orgtehnika;
        QTreeWidgetItem *itm_sklad_orgtehnika_printers;
        QTreeWidgetItem *itm_sklad_orgtehnika_mfy;
        QTreeWidgetItem *itm_sklad_orgtehnika_scaners;
        QTreeWidgetItem *itm_sklad_rashodniki;
        QAction *metaDataAction;
        QAction *addMemoryAction;
        QAction *MB_na_skladAction; // àêöèÿ "ïåðåìåñòèòü íà ñêëàä"
        QAction *new_sotrydnikAction;
        QAction *novoe_oborydovanieAction;
        QAction *SpliterAction;
        QAction *pereimenovat_otdelAction;
        QAction *perevesti_sotrydnika_v_drygo1_otdelAction;
        QAction *yvolit_sotrydnikaAction;
        QAction *naznachit_otvetstvennim_za_oborydovanieAction;
        QAction *peredat_sys_block_pod_otveystvennostAction;
        QAction *ystanovit_novie_complektyushieAction;
        QAction *sozdat_otdelAction;

        QAction *novaya_MB_na_skladAction;
        QAction *novaya_RAM_na_skladAction;
        QAction *novaya_CPU_na_skladAction;
        QAction *novaya_HDD_na_skladAction;
        QAction *novaya_CD_DVD_na_skladAction;
        QAction *novaya_VIDEO_na_skladAction;
        QAction *novaya_SoundCard_na_skladAction;
        QAction *novaya_LAN_na_skladAction;
        QAction *novaya_SYSTEM_BLOCK_na_skladAction;

        QAction *insert_MB_to_system_blockAction; //íîâûé ñèñòåìíèê íà ñêëàä
       
//ôóíêöèè
        void writeSettings();
        void readSettings();
        void SotrydnikiOtdela(QString id_otdela, QTreeWidgetItem * itemOtdela); // ôîðìèðóåì ñïèñîê ñîòðóäíèêîâ
        void addOtdels();//äîáàâëÿåì îòäåëû â treeView

       
       
        QString oborydovanie(QString id_sotrydnika, QTreeWidgetItem * itemSotrydnika);
        QString addMatheBoardInformation(QString id_otvetstvennogo_lica, QString id_systemBlock, QTreeWidgetItem * itemSysBlock);
        QString addMemoryInformation(QString id_otvetstvennogo_lica, QString id_systemBlock, QTreeWidgetItem * itemSysBlock);
        QString addCpuInformation(QString id_otvetstvennogo_lica, QString id_systemBlock, QTreeWidgetItem * itemSysBlock);
        QString addHDDInformation(QString id_otvetstvennogo_lica, QString id_systemBlock, QTreeWidgetItem * itemSysBlock);
        QString add_CD_DVD_Information(QString id_otvetstvennogo_lica, QString id_systemBlock, QTreeWidgetItem * itemSysBlock);
        QString add_Vidio_Information(QString id_otvetstvennogo_lica, QString id_systemBlock, QTreeWidgetItem * itemSysBlock);
        QString add_Sound_Card_Information(QString id_otvetstvennogo_lica, QString id_systemBlock, QTreeWidgetItem * itemSysBlock);
        QString add_Lan_Card_Information(QString id_otvetstvennogo_lica, QString id_systemBlock, QTreeWidgetItem * itemSysBlock);
        QString get_info_from_system_block(QString inventar_num);
        void delete_all_actions();
        void add_actions_for_otdel();
        void add_actions_for_sklad();
        void add_actions_for_sotrydnik();
        void add_actions_for_system_block();
        void add_actions_for_kompletyushie();
        void add_actions_for_sklad_MB();
        void add_actions_for_sklad_RAM();
        void add_actions_for_sklad_CPU();
        void add_actions_for_sklad_HDD();
        void add_actions_for_sklad_CD_DVD();
        void add_actions_for_sklad_VIDEO();
        void add_actions_for_sklad_SoundCard();
        void add_actions_for_sklad_LAN();
        void add_actions_for_sklad_SB();
        void add_actions_for_insert_MB_to_system_block();
        void add_actions_for_sklad_system_block();
       
       
        int select_system_block(); // ôóíêöèÿ âåðí¸ò èäåíòèôèêàòîð âûáðàííîãî ñèñòåìíîãî áëîêà

       
       
public:
        QIcon comp_icon;
        QIcon printer_icon;
        QIcon hdd_icon;
        QIcon memory_icon;
        QIcon matheboard_icon;
        QIcon cpu_icon;
        QIcon cd_dvd_icon;
        QIcon vidio_card_icon;
        QIcon sound_card_icon;
        QIcon lan_card_icon;
        QSqlDatabase *pdb;
        QSqlDatabase db;
        QProcess process;
       
};
#endif