5 Bacula(R) - The Network Backup Solution
7 Copyright (C) 2000-2016 Kern Sibbald
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.
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.
17 This notice must be preserved when any source code is
18 conveyed and/or propagated.
20 Bacula(R) is a registered trademark of Kern Sibbald.
24 * Kern Sibbald, February 2007
28 #include <sys/types.h> /* Needed for some systems */
29 #if QT_VERSION >= 0x050000
35 #include "ui_runrestore.h"
37 class bRestoreTable : public QTableWidget
41 QPoint dragStartPosition;
43 bRestoreTable(QWidget *parent)
44 : QTableWidget(parent)
47 void mousePressEvent(QMouseEvent *event);
48 void mouseMoveEvent(QMouseEvent *event);
50 void dragEnterEvent(QDragEnterEvent *event);
51 void dragMoveEvent(QDragMoveEvent *event);
52 void dropEvent(QDropEvent *event);
55 #include "ui_brestore.h"
56 #include "ui_restore.h"
57 #include "ui_prerestore.h"
66 * The pre-restore dialog selects the Job/Client to be restored
67 * It really could use considerable enhancement.
69 class prerestorePage : public Pages, public Ui::prerestoreForm
75 prerestorePage(QString &data, unsigned int);
78 void okButtonPushed();
79 void cancelButtonPushed();
80 void job_name_change(int index);
81 void recentChanged(int);
82 void jobRadioClicked(bool);
83 void jobidsRadioClicked(bool);
84 void jobIdEditFinished();
88 int jobdefsFromJob(QStringList &, QString &);
90 bool checkJobIdList();
92 unsigned int m_dataInType;
96 * The restore dialog is brought up once we are in the Bacula
97 * restore tree routines. It handles putting up a GUI tree
98 * representation of the files to be restored.
100 class restorePage : public Pages, public Ui::restoreForm
105 restorePage(int conn);
107 void fillDirectory();
109 bool cwd(const char *);
112 void okButtonPushed();
113 void cancelButtonPushed();
114 void fileDoubleClicked(QTreeWidgetItem *item, int column);
115 void directoryItemChanged(QTreeWidgetItem *, QTreeWidgetItem *);
116 void upButtonPushed();
117 void unmarkButtonPushed();
118 void markButtonPushed();
119 void addDirectory(QString &);
123 void writeSettings();
126 QHash<QString, QTreeWidgetItem *> m_dirPaths;
127 QHash<QTreeWidgetItem *,QString> m_dirTreeItems;
132 class bRestore : public Pages, public Ui::bRestoreForm
139 void PgSeltreeWidgetClicked();
142 void get_info_from_selection(QStringList &fileids, QStringList &jobids,
143 QStringList &dirids, QStringList &fileindexes);
148 void showInfoForFile(QTableWidgetItem *);
149 void applyLocation();
150 void clearVersions(QTableWidgetItem *);
151 void clearRestoreList();
157 QTableWidgetItem *m_current;
160 void displayFiles(int64_t pathid, QString path);
161 void displayFileVersion(QString pathid, QString fnid,
162 QString client, QString filename);
165 class bRunRestore : public QDialog, public Ui::bRunRestoreForm
170 QStringList m_fileids, m_jobids, m_dirids, m_findexes;
173 bRunRestore(bRestore *parent);
175 void computeVolumeList();
176 int64_t runRestore(QString tablename);
181 void computeRestore();
184 #endif /* _RESTORE_H_ */