]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/qt-console/restore/restore.cpp
Move radio buttons to more intuitive location
[bacula/bacula] / bacula / src / qt-console / restore / restore.cpp
index 4cdb7470fe4cb589338e69de53833263ab53ab0e..67c25627323bcf22e84e9e330c00f166e2c586a2 100644 (file)
 #include "bat.h"
 #include "restore.h"
 
-restorePage::restorePage(Console *console)
+restorePage::restorePage()
 {
    QStringList titles;
 
    setupUi(this);
-   QTreeWidgetItem *parent = mainWin->getFromHash(console);
-   if (!parent) {
-      /* Make this a user configurable stdout msg *** FIXME ****/
-      printf("Error retrieving tree widget.");
-      return;
-   }
-   m_name = "Restore";
-   pgInitialize(parent);
+   m_name = "Restore Select";
+   pgInitialize();
    m_console->notify(false);          /* this should already be off */
    m_closeable = true;
 
@@ -72,8 +66,6 @@ restorePage::restorePage(Console *console)
 
    get_cwd();
 
-   //QString root("");
-   //addDirectory(root);
    fillDirectory();
    dockPage();
    setCurrent();
@@ -236,6 +228,7 @@ void restorePage::okButtonPushed()
    this->hide();
    m_console->write("done");
    m_console->notify(true);
+   setConsoleCurrent();
    closeStackPage();
    mainWin->resetFocus();
 }
@@ -245,6 +238,7 @@ void restorePage::cancelButtonPushed()
 {
    this->hide();
    m_console->write("quit");
+   m_console->displayToPrompt();
    mainWin->set_status("Canceled");
    closeStackPage();
    m_console->notify(true);
@@ -381,9 +375,8 @@ char *restorePage::get_cwd()
       m_cwd = m_console->msg();
       Dmsg2(100, "cwd=%s msg=%s\n", m_cwd.toUtf8().data(), m_console->msg());
    } else {
-      Dmsg1(000, "stat=%d\n", stat);
+      Dmsg1(000, "Something went wrong read stat=%d\n", stat);
       QMessageBox::critical(this, "Error", ".pwd command failed", QMessageBox::Ok);
-      Dmsg1(000, "stat=%d\n", stat);
    }
    m_console->discardToPrompt(); 
    return m_cwd.toUtf8().data();