]> git.sur5r.net Git - bacula/bacula/commitdiff
- wxbRestorePanel : now parsing '+' sent by the director when building tree.
authorNicolas Boichat <nicolas@boichat.ch>
Fri, 6 Aug 2004 15:14:36 +0000 (15:14 +0000)
committerNicolas Boichat <nicolas@boichat.ch>
Fri, 6 Aug 2004 15:14:36 +0000 (15:14 +0000)
 - wxbRestorePanel : implemented .backups client=xxx (2.1).

git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@1513 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/src/wx-console/CHANGELOG
bacula/src/wx-console/TODO
bacula/src/wx-console/wxbrestorepanel.cpp
bacula/src/wx-console/wxbtableparser.cpp
bacula/src/wx-console/wxbtableparser.h

index 97e4845b2ee015329b4955688f6ece7ded821e20..4b8ce8731728cbbc7d6a6ee1f8a6690f5e46e8ac 100644 (file)
@@ -1,4 +1,7 @@
 06-08-2004 :
+ - wxbRestorePanel : now parsing '+' sent by the director when building
+     tree.
+ - wxbRestorePanel : implemented .backups client=xxx (2.1)
  - wxbRestorePanel : implemented the director modification showing
      jobid when a job is started.
 
index 62c076bcf8e4f58045a4d244ec8faf9b7daf91d3..726adbf6ec614bbde50cccc52e8b0faf8e123d64 100644 (file)
@@ -1,6 +1,4 @@
 general : Show nice messages boxes when errors occurs.
-
-wxbRestorePanel : implement .backups client=xxx (2.1a)
    
 wxbRestorePanel : list jobs and list jobid=# will probably crash if there
    is nothing to show (db error or empty table)
@@ -74,8 +72,6 @@ wxbRestorePanel : The + only appears when one selects a directory,
 
 wxbRestorePanel : Add a timeout when waiting for commands results
 
-bacula-dir : Progress status when building tree.
-
 bacula-dir : correct director to handle correctly + marked status
    (In fact there is a bug in the director : If you mark a directory
    (not a file), and then unmark it, its parents keep the "+" status.)
index 779c6ad5df1a759699539a75a3ea538e818a2a30..440ed3eff8b066a308b81561c82ca1bac996d63f 100644 (file)
@@ -587,7 +587,7 @@ void wxbRestorePanel::CmdStart() {
       SetStatus(choosing);
       
       wxbTableParser* tableparser = new wxbTableParser();
-      wxbDataTokenizer* dt = new wxbDataTokenizer(true);
+      wxbDataTokenizer* dt = new wxbDataTokenizer(false);
       
       wxbMainFrame::GetInstance()->Send(wxString("restore") <<
          " client=\"" << configPanel->GetRowString("Client") <<
@@ -670,34 +670,24 @@ void wxbRestorePanel::CmdStart() {
                         if (str.ToLong(&l)) {
                            done += willdo;
                            willdo += l;
-                           var = (willdo-done)/3;
+                           var = (willdo-done)/50;
+                           gauge->SetValue(done);
+                           wxTheApp->Yield(true);
                         }
                         break;
                      }
                   }
                }
+               else if ((*dt)[lastindex] == "+") {
+                  gauge->SetValue(gauge->GetValue()+var);
+                  wxTheApp->Yield(true);
+               }
             }
             
-            if (gauge->GetValue() <= done) {
-               gauge->SetValue(done);
-               if (var < 0)
-                  var = -var;
-            }
-            else if (gauge->GetValue() >= willdo) {
-               gauge->SetValue(willdo);
-               if (var > 0)
-                  var = -var;
-            }
-            
-            gauge->SetValue(gauge->GetValue()+var);
-            
+                       
             if (dt->hasFinished()) {
                break;
             }
-            
-            /*wxbMainFrame::GetInstance()->Print(
-               wxString("[") << gauge->GetValue() << "/" << done
-                  << "-" << willdo << "]", CS_DEBUG);*/
          }
          wxTheApp->Yield(true);
          ::wxUsleep(1);
@@ -1180,12 +1170,18 @@ void wxbRestorePanel::CmdConfigCancel() {
 void wxbRestorePanel::CmdListJobs() {
    if (status == entered) {
       configPanel->ClearRowChoices("Before");
-      wxbUtils::WaitForPrompt("query\n");
-      wxbUtils::WaitForPrompt("6\n");
-      wxbTableParser* tableparser = new wxbTableParser();
-      wxbDataTokenizer* dt = wxbUtils::WaitForEnd(configPanel->GetRowString("Client") + "\n", true);
+      /*wxbUtils::WaitForPrompt("query\n");
+      wxbUtils::WaitForPrompt("6\n");*/
+      wxbTableParser* tableparser = new wxbTableParser(false);
+      wxbDataTokenizer* dt = wxbUtils::WaitForEnd(
+         wxString(".backups client=") + configPanel->GetRowString("Client") + "\n", true);
 
-      if (!tableparser->hasFinished()) {
+      while (!tableparser->hasFinished()) {
+         wxTheApp->Yield(true);
+         ::wxUsleep(100);
+      }
+         
+      if (!tableparser->GetCount() == 0) {
          for (unsigned int i = 0; i < dt->Count(); i++) {
             if ((*dt)[i].Find("No results to list.") == 0) {
                configPanel->AddRowChoice("Before", "No backup found for this client.");
@@ -1206,11 +1202,6 @@ void wxbRestorePanel::CmdListJobs() {
          }
       }
       
-      while (!tableparser->hasFinished()) {
-         wxTheApp->Yield(true);
-         ::wxUsleep(100);
-      }
-      
       delete dt;
 
       for (int i = tableparser->GetCount()-1; i > -1; i--) {
@@ -1219,12 +1210,8 @@ void wxbRestorePanel::CmdListJobs() {
          const char* chr;
          if ( ( (chr = datetime.ParseDate(str.GetData()) ) != NULL ) && ( datetime.ParseTime(++chr) != NULL ) ) {
             datetime += wxTimeSpan::Seconds(1);
-            //wxbMainFrame::GetInstance()->Print(wxString("-") << datetime.Format("%Y-%m-%d %H:%M:%S"), CS_DEBUG);
             configPanel->AddRowChoice("Before", datetime.Format("%Y-%m-%d %H:%M:%S"));
          }
-         /*else {
-         jobChoice->Append("Invalid");
-         }*/
       }
            
       delete tableparser;
index 6f60f35ea632cdf59863dc42778d9ea8c86d801c..5ce98e2764e8f852668e8098db7fe299703b6e49 100644 (file)
@@ -54,8 +54,8 @@ wxbArrayString::~wxbArrayString() {
 /*
  *   wxbTableParser constructor
  */
-wxbTableParser::wxbTableParser() : wxbTable(), wxbDataParser(true) {
-   separatorNum = 0;
+wxbTableParser::wxbTableParser(bool header) : wxbTable(), wxbDataParser(true) {
+   separatorNum = header ? 0 : 2;
    tableHeader = wxbArrayString();
 }
 
index dfce4989e41e4dfa66943a5f75e14a00dd7a0e6e..565630165ac05e5254f3f84e24cd4bc3f87159e6 100644 (file)
@@ -71,7 +71,7 @@ WX_DECLARE_OBJARRAY( wxbArrayString, wxbTable );
 class wxbTableParser: public wxbTable, public wxbDataParser
 {
    public:
-      wxbTableParser();
+      wxbTableParser(bool header = true);
       virtual ~wxbTableParser();
 
       /*