From 2c752af58e69e49675570740fe34b4313a199cb2 Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Fri, 1 Oct 2010 18:22:56 +0200 Subject: [PATCH] bat: Add checkbox to allow automatic fileset merging --- bacula/src/qt-console/restore/brestore.cpp | 12 +++++++++++- bacula/src/qt-console/restore/brestore.ui | 10 ++++++++++ bacula/src/qt-console/restore/restore.h | 1 + 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/bacula/src/qt-console/restore/brestore.cpp b/bacula/src/qt-console/restore/brestore.cpp index 6f51d05332..abd1b7ec26 100644 --- a/bacula/src/qt-console/restore/brestore.cpp +++ b/bacula/src/qt-console/restore/brestore.cpp @@ -63,6 +63,7 @@ void bRestore::setClient() JobList->clear(); JobList->setEnabled(true); LocationEntry->clear(); + m_pathid = 0; if (ClientList->currentIndex() < 1) { JobList->setEnabled(false); @@ -109,6 +110,10 @@ void bRestore::setJob() m_jobids = tmp.toString(); QString cmd = ".bvfs_get_jobids jobid=" + m_jobids; + if (MergeChk->checkState() == Qt::Checked) { + cmd.append(" all"); + } + m_console->dir_cmd(cmd, results); if (results.size() < 1) { @@ -125,7 +130,7 @@ void bRestore::setJob() Pmsg1(0, "jobids=%s\n", m_jobids.toLocal8Bit().constData()); - displayFiles(0, "/"); + displayFiles(m_pathid, QString("")); Pmsg0(000, "update done\n"); } @@ -177,6 +182,9 @@ void bRestore::displayFiles(int64_t pathid, QString path) decode_stat(fieldlist.at(4).toLocal8Bit().data(), &statp, &LinkFI); item.setDateFld(4, statp.st_mtime); // date + if (fieldlist.at(5) == ".") { + m_pathid = fieldlist.at(0).toLongLong(); // keep current pathid + } } } @@ -297,6 +305,8 @@ void bRestore::setupPage() connect(FileList, SIGNAL(itemDoubleClicked(QTableWidgetItem*)), this, SLOT(showInfoForFile(QTableWidgetItem *))); connect(LocationBp, SIGNAL(pressed()), this, SLOT(applyLocation())); + connect(MergeChk, SIGNAL(clicked()), this, SLOT(setJob())); + FileList->setColumnHidden(0, true); FileRevisions->setColumnHidden(0, true); RestoreList->setColumnHidden(0, true); diff --git a/bacula/src/qt-console/restore/brestore.ui b/bacula/src/qt-console/restore/brestore.ui index 31f83836f1..706e532ae0 100644 --- a/bacula/src/qt-console/restore/brestore.ui +++ b/bacula/src/qt-console/restore/brestore.ui @@ -347,6 +347,16 @@ p, li { white-space: pre-wrap; } + + + + Merge Jobs + + + true + + + diff --git a/bacula/src/qt-console/restore/restore.h b/bacula/src/qt-console/restore/restore.h index f5e87c8957..b57b998f00 100644 --- a/bacula/src/qt-console/restore/restore.h +++ b/bacula/src/qt-console/restore/restore.h @@ -133,6 +133,7 @@ public slots: private: QString m_client; QString m_jobids; + int64_t m_pathid; QTableWidgetItem *m_current; void setupPage(); bool m_populated; -- 2.39.5