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