From d014a2de7614f51b8617ea0444ef83b7389e74fd Mon Sep 17 00:00:00 2001 From: Nicolas Boichat Date: Mon, 19 Apr 2004 22:18:14 +0000 Subject: [PATCH] - Locked configure items until first configuration is received - Removed estimate, which slows the restore process git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@1254 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/src/wx-console/CHANGELOG | 11 ++++-- bacula/src/wx-console/TODO | 9 +++-- bacula/src/wx-console/wxbrestorepanel.cpp | 43 +++++++++++++++++++---- bacula/src/wx-console/wxbrestorepanel.h | 5 ++- 4 files changed, 55 insertions(+), 13 deletions(-) diff --git a/bacula/src/wx-console/CHANGELOG b/bacula/src/wx-console/CHANGELOG index ba42871465..1a27b36095 100644 --- a/bacula/src/wx-console/CHANGELOG +++ b/bacula/src/wx-console/CHANGELOG @@ -1,5 +1,12 @@ +19-04-2004 : + - wxbRestorePanel : Locked configure items until first + configuration is received + - wxbRestorePanel : Removed estimate, which slows the restore + process + 18-04-2004 : - - wxbRestorePanel : wxTreeCtrl::GetParent changed in GetItemParent (thanks to Luca Berra) + - wxbRestorePanel : wxTreeCtrl::GetParent changed in + GetItemParent (thanks to Luca Berra) - wxbRestorePanel : The user can now change a part of restore configuration @@ -7,7 +14,7 @@ - wxbRestorePanel modified to use wxbDataParsers - created wxbDataTokenizer, which fetches commands results - modified the way data is passed to panel (no Prints anymore, - but wxbDataParsers) + but wxbDataParsers) - win32 : Makefile.in corrected to use ressource file - win32 : wx-console is now compatible with MinGW. - wxbPanel/wxbMainFrame : Added a locking function (for example, diff --git a/bacula/src/wx-console/TODO b/bacula/src/wx-console/TODO index 002a301193..de8770be71 100644 --- a/bacula/src/wx-console/TODO +++ b/bacula/src/wx-console/TODO @@ -11,9 +11,7 @@ wxbRestorePanel : Check more carefully which job we just have run. wxbRestorePanel : Check if commands run successfully (cd, mark, mods...). -wxbRestorePanel : Lock configure items until first configuration is received - -wxbRestorePanel : Remove estimate, which slows the restore process +wxbRestorePanel : Allow configure to change client and fileset GTK : Improve look @@ -22,6 +20,9 @@ general : Don't concatenate lines in csprint, but in wxbDataTokenizer general : use dot commands +general : Create a more complicated director config file, to check what + choices I should give to the user (pools, filesets, ...(?)). + wxbTableParser : Replace wxHashMap by wxArray console_thread : Allow the user to choose his config file. @@ -29,6 +30,8 @@ console_thread : Allow the user to choose his config file. wxblistctrl/wxbtreectrl : Find why events are not forwarded correctly to parent' parent, and correct bad actual implementation. (remove wxbTreeListPanel) + +general : make a good documentation with snapshots BUGS ---- diff --git a/bacula/src/wx-console/wxbrestorepanel.cpp b/bacula/src/wx-console/wxbrestorepanel.cpp index fcefcacdd6..f041974e3d 100644 --- a/bacula/src/wx-console/wxbrestorepanel.cpp +++ b/bacula/src/wx-console/wxbrestorepanel.cpp @@ -429,25 +429,30 @@ void wxbRestorePanel::CmdStart() { } else if (status == choosing) { SetStatus(configuring); - wxbMainFrame::GetInstance()->SetStatusText("Restoring, please wait..."); - + + wxbMainFrame::GetInstance()->SetStatusText("Please configure your restore..."); + + EnableConfig(false); + totfilemessages = 0; wxbDataTokenizer* dt; - dt = WaitForEnd("estimate\n", true); + /*dt = WaitForEnd("estimate\n", true); int j, k; - for (unsigned int i = 0; i < dt->GetCount(); i++) { + for (unsigned int i = 0; i < dt->GetCount(); i++) {*/ /* 15847 total files; 1 marked to be restored; 1,034 bytes. */ - if ((j = (*dt)[i].Find(" marked to be restored;")) > -1) { +/* if ((j = (*dt)[i].Find(" marked to be restored;")) > -1) { k = (*dt)[i].Find("; "); (*dt)[i].Mid(k+2, j).ToLong(&totfilemessages); break; } } - delete dt; + delete dt;*/ + + int j; dt = WaitForEnd("done\n", true); @@ -466,6 +471,8 @@ void wxbRestorePanel::CmdStart() { UpdateConfig(dt); delete dt; + + EnableConfig(true); if (totfilemessages == 0) { wxbMainFrame::GetInstance()->Print("Restore failed : no file selected.\n", CS_DEBUG); @@ -475,6 +482,13 @@ void wxbRestorePanel::CmdStart() { } } else if (status == configuring) { + EnableConfig(false); + cfgOk->Enable(false); + cfgApply->Enable(false); + cfgCancel->Enable(false); + + wxbMainFrame::GetInstance()->SetStatusText("Restoring, please wait..."); + wxbDataTokenizer* dt; SetStatus(restoring); @@ -576,6 +590,8 @@ void wxbRestorePanel::CmdStart() { void wxbRestorePanel::CmdConfigApply() { if (cfgUpdated == 0) return; + EnableConfig(false); + wxbDataTokenizer* dt = NULL; while (cfgUpdated > 0) { wxString def; //String to send if can't use our data @@ -625,7 +641,9 @@ void wxbRestorePanel::CmdConfigApply() { } } UpdateConfig(dt); /* TODO: Check result */ - + + EnableConfig(true); + delete dt; } @@ -1240,6 +1258,17 @@ void wxbRestorePanel::SetStatus(status_enum newstatus) { status = newstatus; } +/*---------------------------------------------------------------------------- + UI related + ----------------------------------------------------------------------------*/ + +void wxbRestorePanel::EnableConfig(bool enable) { + cfgWhere->Enable(enable); + cfgReplace->Enable(enable); + cfgWhen->Enable(enable); + cfgPriority->Enable(enable); +} + /*---------------------------------------------------------------------------- Event handling ----------------------------------------------------------------------------*/ diff --git a/bacula/src/wx-console/wxbrestorepanel.h b/bacula/src/wx-console/wxbrestorepanel.h index 64f97cd960..7ebe34cd3c 100644 --- a/bacula/src/wx-console/wxbrestorepanel.h +++ b/bacula/src/wx-console/wxbrestorepanel.h @@ -108,7 +108,7 @@ class wxbRestorePanel : public wxbPanel /* Update config */ bool UpdateConfig(wxbDataTokenizer* dt); - + /* Status related */ enum status_enum { @@ -131,6 +131,9 @@ class wxbRestorePanel : public wxbPanel bool working; // A command is running, discard GUI events wxTreeItemId currentTreeItem; // Currently selected tree item + /* Enable or disable config controls status */ + void EnableConfig(bool enable); + /* Event handling */ void OnStart(wxEvent& WXUNUSED(event)); void OnTreeChanging(wxTreeEvent& event); -- 2.39.5