]> git.sur5r.net Git - bacula/bacula/blob - bacula/src/qt-console/restore/restoretree.h
ae39d3c340c6ec9f0d1fb391f332b805195ef348
[bacula/bacula] / bacula / src / qt-console / restore / restoretree.h
1 #ifndef _RESTORETREE_H_
2 #define _RESTORETREE_H_
3
4 /*
5    Bacula(R) - The Network Backup Solution
6
7    Copyright (C) 2000-2015 Kern Sibbald
8    Copyright (C) 2007-2014 Free Software Foundation Europe e.V.
9
10    The original author of Bacula is Kern Sibbald, with contributions
11    from many others, a complete list can be found in the file AUTHORS.
12
13    You may use this file and others of this release according to the
14    license defined in the LICENSE file, which includes the Affero General
15    Public License, v3.0 ("AGPLv3") and some additional permissions and
16    terms pursuant to its AGPLv3 Section 7.
17
18    This notice must be preserved when any source code is 
19    conveyed and/or propagated.
20
21    Bacula(R) is a registered trademark of Kern Sibbald.
22 */
23 /*
24  *  Kern Sibbald, February 2007
25  */
26
27 #include <QtGui>
28 #include "pages.h"
29 #include "ui_restoretree.h"
30
31
32 /*  
33  * A restore tree to view files in the catalog
34  */
35 class restoreTree : public Pages, public Ui::restoreTreeForm
36 {
37    Q_OBJECT 
38
39 public:
40    restoreTree();
41    ~restoreTree();
42    virtual void PgSeltreeWidgetClicked();
43    virtual void currentStackItem();
44    enum folderCheckState
45    {
46       FolderUnchecked = 0,
47       FolderGreenChecked = 1,
48       FolderWhiteChecked = 2,
49       FolderBothChecked = 3
50    };
51
52 private slots:
53    void refreshButtonPushed();
54    void restoreButtonPushed();
55    void jobComboChanged(int);
56    void directoryCurrentItemChanged(QTreeWidgetItem *, QTreeWidgetItem *);
57    void fileCurrentItemChanged(QTableWidgetItem *,QTableWidgetItem *);
58    void directoryItemExpanded(QTreeWidgetItem *);
59    void setCheckofChildren(QTreeWidgetItem *item, Qt::CheckState);
60    void directoryItemChanged(QTreeWidgetItem *, int);
61    void fileTableItemChanged(QTableWidgetItem *);
62    void versionTableItemChanged(QTableWidgetItem *);
63    void updateRefresh();
64    void jobTableCellClicked(int, int);
65
66 private:
67    void populateDirectoryTree();
68    void populateJobTable();
69    void parseDirectory(const QString &dir_in);
70    void setupPage();
71    void writeSettings();
72    void readSettings();
73    void fileExceptionInsert(QString &, QString &, Qt::CheckState);
74    void fileExceptionRemove(QString &, QString &);
75    void directoryTreeDisconnectedSet(QTreeWidgetItem *, Qt::CheckState);
76    void fileTableDisconnectedSet(QTableWidgetItem *, Qt::CheckState, bool color);
77    void versionTableDisconnectedSet(QTableWidgetItem *, Qt::CheckState);
78    void updateFileTableChecks();
79    void updateVersionTableChecks();
80    void directoryIconStateInsert(QString &, Qt::CheckState);
81    void directoryIconStateRemove();
82    void directorySetIcon(int operation, int change, QString &, QTreeWidgetItem* item);
83    void fullPathtoSubPaths(QStringList &, QString &);
84    int mostRecentVersionfromFullPath(QString &);
85    void setJobsCheckedList();
86    int queryFileIndex(QString &fullPath, int jobID);
87
88    QSplitter *m_splitter;
89    QString m_groupText;
90    QString m_splitText1;
91    QString m_splitText2;
92    bool m_populated;
93    bool m_dropdownChanged;
94    bool m_slashTrap;
95    QHash<QString, QTreeWidgetItem *> m_dirPaths;
96    QString m_checkedJobs, m_prevJobCombo, m_prevClientCombo, m_prevFileSetCombo;
97    int m_prevLimitSpinBox, m_prevDaysSpinBox;
98    Qt::CheckState m_prevLimitCheckState, m_prevDaysCheckState;
99    QString m_JobsCheckedList;
100    int m_debugCnt;
101    bool m_debugTrap;
102    QList<Qt::CheckState> m_fileCheckStateList;
103    QList<Qt::CheckState> m_versionCheckStateList;
104    QHash<QString, Qt::CheckState> m_fileExceptionHash;
105    QMultiHash<QString, QString> m_fileExceptionMulti;
106    QHash<QString, int> m_versionExceptionHash;
107    QHash<QString, int> m_directoryIconStateHash;
108    QHash<QString, int> m_directoryPathIdHash;
109    int m_toggleUpIndex, m_toggleDownIndex, m_nullFileNameId;
110 };
111
112 #endif /* _RESTORETREE_H_ */