From: Eric Bollengier Date: Fri, 1 Oct 2010 16:22:56 +0000 (+0200) Subject: bat: Add checkbox to allow automatic fileset merging X-Git-Tag: Release-7.0.0~1528 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=da2af5fd88c78d02df92b3c50e78819a06a63a9d;p=bacula%2Fbacula bat: Add checkbox to allow automatic fileset merging --- 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;