Copyright (C) 2007-2010 Free Software Foundation Europe e.V.
- The main author of Bacula is Kern Sibbald, with contributions from
- many others, a complete list can be found in the file AUTHORS.
- This program is Free Software; you can redistribute it and/or
- modify it under the terms of version three of the GNU Affero General Public
- License as published by the Free Software Foundation and included
- in the file LICENSE.
-
- This program is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU Affero General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- 02110-1301, USA.
+ The main author of Bacula is Kern Sibbald, with contributions from many
+ others, a complete list can be found in the file AUTHORS.
+
+ You may use this file and others of this release according to the
+ license defined in the LICENSE file, which includes the Affero General
+ Public License, v3.0 ("AGPLv3") and some additional permissions and
+ terms pursuant to its AGPLv3 Section 7.
Bacula® is a registered trademark of Kern Sibbald.
- The licensor of Bacula is the Free Software Foundation Europe
- (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
- Switzerland, email:ftf@fsfeurope.org.
*/
-
+
/*
*
- * Restore Class
+ * Restore Class
*
* Kern Sibbald, February MMVII
*
- */
+ */
#include "bat.h"
#include "restoretree.h"
updateRefresh();
int taskcount = 3, ontask = 1;
if (m_dropdownChanged) taskcount += 1;
-
+
/* Set progress bars and repaint */
prBar1->setVisible(true);
prBar1->setRange(0,taskcount);
/*
* Function to set m_checkedJobs from the jobs that are checked in the table
* of jobs
- */
+ */
void restoreTree::setJobsCheckedList()
{
m_JobsCheckedList = "";
QTreeWidgetItem *item = NULL;
QTreeWidgetItem *parentItem = m_dirPaths.value(parent);
-
+
if (parentItem==0) {
// recurse to build parent...
parseDirectory(parent);
fileTable->setColumnCount(headerlist.size());
fileTable->setHorizontalHeaderLabels(headerlist);
fileTable->setRowCount(0);
-
+
m_fileCheckStateList.clear();
disconnect(fileTable, SIGNAL(itemChanged(QTableWidgetItem *)),
this, SLOT(fileTableItemChanged(QTableWidgetItem *)));
QStringList results;
if (m_console->sql_cmd(cmd, results)) {
-
+
QTableWidgetItem* tableItem;
QString field;
QStringList fieldlist;
fileTable->setRowCount(results.size());
-
+
int row = 0;
/* Iterate through the record returned from the query */
foreach (QString resultline, results) {
field = field.trimmed(); /* strip leading & trailing spaces */
tableItem = new QTableWidgetItem(field, 1);
/* Possible flags are Qt::ItemFlags flag = Qt::ItemIsSelectable | Qt::ItemIsEditablex
- * | Qt::ItemIsDragEnabled | Qt::ItemIsDropEnabled | Qt::ItemIsUserCheckable
+ * | Qt::ItemIsDragEnabled | Qt::ItemIsDropEnabled | Qt::ItemIsUserCheckable
* | Qt::ItemIsEnabled | Qt::ItemIsTristate; */
tableItem->setForeground(blackBrush);
/* Just in case a column ever gets added */
QBrush blackBrush(Qt::black);
- QStringList headerlist = (QStringList()
+ QStringList headerlist = (QStringList()
<< tr("Job Id") << tr("Type") << tr("End Time") << tr("Hash") << tr("FileId") << tr("Job Type") << tr("First Volume"));
versionTable->clear();
versionTable->setColumnCount(headerlist.size());
versionTable->setHorizontalHeaderLabels(headerlist);
versionTable->setRowCount(0);
-
+
int pathid = m_directoryPathIdHash.value(directory, -1);
if ((pathid != -1) && (fileNameId != -1)) {
- QString cmd =
+ QString cmd =
"SELECT Job.JobId AS JobId, Job.Level AS Type,"
" Job.EndTime AS EndTime, File.MD5 AS MD5,"
" File.FileId AS FileId, Job.Type AS JobType,"
" AND Filename.FilenameId=" + QString("%1").arg(fileNameId) +
" AND Job.Jobid IN (" + m_checkedJobs + ")"
" ORDER BY Job.EndTime DESC";
-
+
if (mainWin->m_sqlDebug) Pmsg1(000, "Query cmd : %s\n", cmd.toUtf8().data());
QStringList results;
if (m_console->sql_cmd(cmd, results)) {
-
+
QTableWidgetItem* tableItem;
QString field;
QStringList fieldlist;
versionTable->setRowCount(results.size());
-
+
int row = 0;
/* Iterate through the record returned from the query */
foreach (QString resultline, results) {
QBrush blackBrush(Qt::black);
if (mainWin->m_rtPopDirDebug) Pmsg0(000, "Repopulating the Job Table\n");
- QStringList headerlist = (QStringList()
+ QStringList headerlist = (QStringList()
<< tr("Job Id") << tr("End Time") << tr("Level") << tr("Type")
<< tr("Name") << tr("Purged") << tr("TU") << tr("TD"));
m_toggleUpIndex = headerlist.indexOf(tr("TU"));
QStringList results;
if (m_console->sql_cmd(jobQuery, results)) {
-
+
QTableWidgetItem* tableItem;
QString field;
QStringList fieldlist;
if (mainWin->m_sqlDebug) Pmsg1(000, "Column=%d\n", column);
if (column == 0) {
bool ok;
- int purged = fieldlist[purgedIndex].toInt(&ok, 10);
+ int purged = fieldlist[purgedIndex].toInt(&ok, 10);
if (!((ok) && (purged == 1))) {
Qt::ItemFlags flag = Qt::ItemIsUserCheckable | Qt::ItemIsEnabled | Qt::ItemIsTristate;
tableItem->setFlags(flag);
QStringList paths;
fullPathtoSubPaths(paths, keyPath);
- /* if the state of the item in m_fileExceptionHash is checked
+ /* if the state of the item in m_fileExceptionHash is checked
* each of the subpaths should be "Checked Green" */
if (state == Qt::Checked) {
if (mainWin->m_rtRestore1Debug)
Pmsg1(000, "Directory Checked=\"%s\"\n", directory.toUtf8().data());
/* With a checked directory, query for the files in the directory */
-
+
QString cmd =
"SELECT Filename.Name AS Filename, t1.JobId AS JobId, File.FileIndex AS FileIndex"
" FROM"
" AND File.FilenameId=t1.FilenameId"
" AND Job.Jobid=t1.JobId"
" ORDER BY Filename";
-
+
if (mainWin->m_sqlDebug) Pmsg1(000, "Query cmd : %s\n", cmd.toUtf8().data());
QStringList results;
if (m_console->sql_cmd(cmd, results)) {
QStringList fieldlist;
-
+
int row = 0;
/* Iterate through the record returned from the query */
foreach (QString resultline, results) {
column++;
}
fileExcpState = m_fileExceptionHash.value(fullPath, (Qt::CheckState)3);
-
+
int excpVersion = m_versionExceptionHash.value(fullPath, 0);
if (fileExcpState != Qt::Unchecked) {
QString debugtext;
" AND Filename.Name='" + fileName + "'"
" AND File.FilenameId!=" + QString("%1").arg(m_nullFileNameId) +
" GROUP BY Filename.Name";
-
+
if (mainWin->m_sqlDebug) Pmsg1(000, "Query cmd : %s\n", cmd.toUtf8().data());
QStringList results;
if (m_console->sql_cmd(cmd, results)) {