]> git.sur5r.net Git - bacula/bacula/commitdiff
bat: Add checkbox to allow automatic fileset merging
authorEric Bollengier <eric@eb.homelinux.org>
Fri, 1 Oct 2010 16:22:56 +0000 (18:22 +0200)
committerEric Bollengier <eric@eb.homelinux.org>
Wed, 6 Oct 2010 09:10:56 +0000 (11:10 +0200)
bacula/src/qt-console/restore/brestore.cpp
bacula/src/qt-console/restore/brestore.ui
bacula/src/qt-console/restore/restore.h

index 6f51d053321820cd78953cac3d222d327ab69f27..abd1b7ec265a9151ad0dea843abbe177b4698808 100644 (file)
@@ -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);
index 31f83836f172aa5028e394bc4fb270d693e6ea8c..706e532ae0a629626084aed05e81773cf61244f2 100644 (file)
@@ -347,6 +347,16 @@ p, li { white-space: pre-wrap; }
        </property>
       </spacer>
      </item>
+     <item>
+      <widget class="QCheckBox" name="MergeChk">
+       <property name="text">
+        <string>Merge Jobs</string>
+       </property>
+       <property name="checked">
+        <bool>true</bool>
+       </property>
+      </widget>
+     </item>
      <item>
       <widget class="QCheckBox" name="VersionsChk">
        <property name="text">
index f5e87c8957ced67f22cce1b1f530cdb250c6d2bf..b57b998f0031b41202d82c535a451cedfb71691f 100644 (file)
@@ -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;