]> git.sur5r.net Git - bacula/bacula/commitdiff
- wxbRestorePanel : implemented restore before=<Date> parameter.
authorNicolas Boichat <nicolas@boichat.ch>
Wed, 28 Jul 2004 21:54:43 +0000 (21:54 +0000)
committerNicolas Boichat <nicolas@boichat.ch>
Wed, 28 Jul 2004 21:54:43 +0000 (21:54 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@1497 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/src/wx-console/CHANGELOG
bacula/src/wx-console/TODO
bacula/src/wx-console/console_thread.cpp
bacula/src/wx-console/wxbrestorepanel.cpp

index 159340d771fe90d2edc030b7fdd0329cbef67544..d71ad8f898b54a298a48945e45381af75fd8c11a 100644 (file)
@@ -1,3 +1,6 @@
+28-07-2004 :
+ - wxbRestorePanel : implemented restore before=<Date> parameter.
+
 17-07-2004 :
  - wxbRestorePanel & wxbHistoryTextCtrl : Fixed unsigned comparisons.
  - wxbRestorePanel : Fixed problem when the newly created job is not
index 4804a7b95cd592cc51c33a5c706f30213dff5699..6271e032e865911eb7e0d6cb0e4f64529472e85b 100644 (file)
@@ -1,5 +1,11 @@
 general : Show nice messages boxes when errors occurs.
 
+wxbRestorePanel : Be sure of which job we just have run (not suppositions
+   as I'm doing now): implement the director modification.
+   
+wxbRestorePanel : list jobs and list jobid=# will probably crash if there
+   is nothing to show (db error or empty table)
+   
 GTK2 : The console control is not scrolled correctly (wxGTK bug)
 
 Win32 : Crash when quitting while trying to connect
@@ -73,9 +79,6 @@ wxbRestorePanel : The + only appears when one selects a directory,
 
 wxbRestorePanel : Add a timeout when waiting for commands results
 
-wxbRestorePanel : Be sure of which job we just have run (not suppositions
-   as I'm doing now) : needs director modification.
-
 bacula-dir : Progress status when building tree.
 
 bacula-dir : correct director to handle correctly + marked status
index 1e2efc0e4ddd52ef67fa207b0742a395874ed00b..146221e57f6852b3855ea0defdb9e5c5f77e391d 100644 (file)
@@ -96,7 +96,6 @@ wxString console_thread::LoadConfig(wxString configfile) {
    init_msg(NULL, msgs);
    init_console_msg(".");
 
-   /* TODO (#4#): Allow the user to choose his config file. */
    if (!parse_config(configfile.c_str(), 0)) {
       configloaded = false;
       wxFile file("./wx-console.conmsg");
index 255ba23f6b31c5929fc2af7a64488726c6123a18..2d4e9ed35779447e89154cdc001bdc6e22805300 100644 (file)
@@ -586,12 +586,17 @@ void wxbRestorePanel::CmdStart() {
       
       SetStatus(choosing);
       
-      wxbUtils::WaitForPrompt(wxString("restore") <<
+      wxbTableParser* tableparser = new wxbTableParser();
+      wxbDataTokenizer* dt = new wxbDataTokenizer(true);
+      
+      wxbMainFrame::GetInstance()->Send(wxString("restore") <<
          " client=\"" << configPanel->GetRowString("Client") <<
          "\" fileset=\"" << configPanel->GetRowString("Fileset") <<
          "\" pool=\"" << configPanel->GetRowString("Pool") <<
-         "\" storage=\"" << configPanel->GetRowString("Storage") << "\"\n");
-      wxbUtils::WaitForPrompt("6\n");
+         "\" storage=\"" << configPanel->GetRowString("Storage") <<
+         "\" before=\"" << configPanel->GetRowString("Before") <<
+         "\" select\n");
+      //wxbUtils::WaitForPrompt("6\n");
       //WaitForEnd();
       /*wxbPromptParser *pp = wxbUtils::WaitForPrompt(wxString() << configPanel->GetRowString("Before") << "\n", true);
       int client = pp->getChoices()->Index(configPanel->GetRowString("Client"));
@@ -601,10 +606,7 @@ void wxbRestorePanel::CmdStart() {
       }
       delete pp;*/
       
-      wxbTableParser* tableparser = new wxbTableParser();
-      wxbDataTokenizer* dt = new wxbDataTokenizer(true);
-      
-      wxbMainFrame::GetInstance()->Send(wxString() << configPanel->GetRowString("Before") << "\n");
+      //wxbMainFrame::GetInstance()->Send(wxString() << configPanel->GetRowString("Before") << "\n");
    
       while (!tableparser->hasFinished() && !dt->hasFinished()) {
          wxTheApp->Yield(true);
@@ -651,14 +653,16 @@ void wxbRestorePanel::CmdStart() {
       
       int var = 0;
       
-      while (!dt->hasFinished()) {
+      int i1, i2;
+      
+      while (true) {
          newdate = wxDateTime::Now();
          if (newdate.Subtract(base).GetMilliseconds() > 10 ) {
             base = newdate;
             for (; lastindex < dt->GetCount(); lastindex++) {
-               if (((*dt)[lastindex].Find("Building directory tree for JobId ") == 0) && 
-                     ((i = (*dt)[lastindex].Find(" ...")) > 0)) {
-                  str = (*dt)[lastindex].Mid(34, i-34);
+               if (((i1 = (*dt)[lastindex].Find("Building directory tree for JobId ")) >= 0) && 
+                     ((i2 = (*dt)[lastindex].Find(" ...")) > 0)) {
+                  str = (*dt)[lastindex].Mid(i1+34, i2-(i1+34));
                   for (i = 0; i < tableparser->GetCount(); i++) {
                      if (str == (*tableparser)[i][0]) {
                         str = (*tableparser)[i][2];
@@ -687,6 +691,10 @@ void wxbRestorePanel::CmdStart() {
             
             gauge->SetValue(gauge->GetValue()+var);
             
+            if (dt->hasFinished()) {
+               break;
+            }
+            
             /*wxbMainFrame::GetInstance()->Print(
                wxString("[") << gauge->GetValue() << "/" << done
                   << "-" << willdo << "]", CS_DEBUG);*/