]> git.sur5r.net Git - bacula/bacula/blob - bacula/src/qt-console/restore/restoretree.h
a2e833c70887781b45a453254d877597799bf41c
[bacula/bacula] / bacula / src / qt-console / restore / restoretree.h
1 #ifndef _RESTORETREE_H_
2 #define _RESTORETREE_H_
3
4 /*
5    Bacula® - The Network Backup Solution
6
7    Copyright (C) 2007-2007 Free Software Foundation Europe e.V.
8
9    The main author of Bacula is Kern Sibbald, with contributions from
10    many others, a complete list can be found in the file AUTHORS.
11    This program is Free Software; you can redistribute it and/or
12    modify it under the terms of version two of the GNU General Public
13    License as published by the Free Software Foundation and included
14    in the file LICENSE.
15
16    This program is distributed in the hope that it will be useful, but
17    WITHOUT ANY WARRANTY; without even the implied warranty of
18    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19    General Public License for more details.
20
21    You should have received a copy of the GNU General Public License
22    along with this program; if not, write to the Free Software
23    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
24    02110-1301, USA.
25
26    Bacula® is a registered trademark of John Walker.
27    The licensor of Bacula is the Free Software Foundation Europe
28    (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
29    Switzerland, email:ftf@fsfeurope.org.
30 */
31 /*
32  *   Version $Id: restore.h 4945 2007-05-31 01:24:28Z bartleyd2 $
33  *
34  *  Kern Sibbald, February 2007
35  */
36
37 #include <QtGui>
38 #include "pages.h"
39 #include "ui_restoretree.h"
40
41
42 /*  
43  * A restore tree to view files in the catalog
44  */
45 class restoreTree : public Pages, public Ui::restoreTreeForm
46 {
47    Q_OBJECT 
48
49 public:
50    restoreTree();
51    ~restoreTree();
52    virtual void currentStackItem();
53    enum folderCheckState
54    {
55       FolderUnchecked = 0,
56       FolderGreenChecked = 1,
57       FolderWhiteChecked = 2,
58       FolderBothChecked = 3
59    };
60
61 private slots:
62    void refreshButtonPushed();
63    void restoreButtonPushed();
64    void jobComboChanged(int);
65    void directoryCurrentItemChanged(QTreeWidgetItem *, QTreeWidgetItem *);
66    void fileCurrentItemChanged(QTableWidgetItem *,QTableWidgetItem *);
67    void directoryItemExpanded(QTreeWidgetItem *);
68    void setCheckofChildren(QTreeWidgetItem *item, Qt::CheckState);
69    void directoryItemChanged(QTreeWidgetItem *, int);
70    void fileTableItemChanged(QTableWidgetItem *);
71    void versionTableItemChanged(QTableWidgetItem *);
72
73 private:
74    void populateDirectoryTree();
75    void populateJobTable();
76    void parseDirectory(QString &dir_in);
77    bool addDirectory(QString &, QString &);
78    void setupPage();
79    void writeSettings();
80    void readSettings();
81    void fileExceptionInsert(QString &, QString &, Qt::CheckState);
82    void fileExceptionRemove(QString &, QString &);
83    void directoryTreeDisconnectedSet(QTreeWidgetItem *, Qt::CheckState);
84    void fileTableDisconnectedSet(QTableWidgetItem *, Qt::CheckState, bool color);
85    void versionTableDisconnectedSet(QTableWidgetItem *, Qt::CheckState);
86    void updateFileTableChecks();
87    void updateVersionTableChecks();
88    void directoryIconStateInsert(QString &, Qt::CheckState);
89    void directoryIconStateRemove();
90    void directorySetIcon(int operation, int change, QString &, QTreeWidgetItem* item);
91    void fullPathtoSubPaths(QStringList &, QString &);
92    int mostRecentVersionfromFullPath(QString &);
93    void setJobsCheckedList();
94    int queryFileIndex(QString &fullPath, int jobID);
95
96    bool m_populated;
97    QRegExp m_winRegExpDrive;
98    QRegExp m_winRegExpPath;
99    QRegExp m_slashregex;
100    bool m_slashTrap;
101    QHash<QString, QTreeWidgetItem *> m_dirPaths;
102    QString m_condition;
103    QString m_jobQuery;
104    QString m_jobQueryPart;
105    QString m_prevJobCombo;
106    QString m_prevClientCombo;
107    QString m_prevFileSetCombo;
108    QString m_JobsCheckedList;
109    int m_debugCnt;
110    bool m_debugTrap;
111    QList<Qt::CheckState> m_fileCheckStateList;
112    QList<Qt::CheckState> m_versionCheckStateList;
113    QHash<QString, Qt::CheckState> m_fileExceptionHash;
114    QMultiHash<QString, QString> m_fileExceptionMulti;
115    QHash<QString, int> m_versionExceptionHash;
116    QHash<QString, int> m_directoryIconStateHash;
117 };
118
119 #endif /* _RESTORETREE_H_ */