31-04-2004 :
+ - wxbRestorePanel : Corrected a problem when you double-clicked an
+ a folder in the list, the list was then refreshed two times
+ (instead of one) in the new directory
+ - wxbRestorePanel : Improved configuration panels' look
+ - wxbRestorePanel : Added titles to configuration panels
- wxbMainFrame : If the connection drops unexpectedly, it should say
it lost the connection to the Director and then wait for you to
either manually exit or (when it becomes possible) reconnect.
FEATURES
--------
-wxbRestorePanel : Reconsider start button's labels.
-
-wxbRestorePanel : Add titles to configuration panels
-
wxbRestorePanel : When cancelling, check for commands results
general : Show nice messages boxes when errors occurs.
wxbMainFrame : set focus to type control when clicking on console
-global : create a general class which keeps clients, jobs, filesets, pools... list.
+global : create a general class which keeps clients, jobs,
+ filesets, pools... list, and with functions like WaitForEnd.
wxbConfigPanel : Create a dialog for selecting dates and paths.
wxbRestorePanel : Add a button to force to refresh the whole tree
-wxbRestorePanel : Put titles above the Client drop down
- box and the Backup date drop down box. It isn't immediately
- obvious that the dates correspond to the backup dates.
-
wxbRestorePanel : There needs to be some way of marking/unmarking a range of
files selected with shift-click or multiple files selected
with ctl-click. The GTX console uses a button to mark/unmark
(not a file), and then unmark it, its parents keep the "+" status.)
general : make a good documentation with snapshots
-
-BUGS
-----
-
-wxRestorePanel : When you double-click an a folder in the list,
- the list is then refreshed two times (instead of one)
- in the new directory
}
void wxbConfigParam::AddControl(wxWindow* parent, wxSizer* sizer) {
- sizer->Add(new wxStaticText(parent, -1, title + ": ", wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT), 1, wxEXPAND | wxALIGN_CENTER_HORIZONTAL);
+ sizer->Add(new wxStaticText(parent, -1, title + ": ", wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT), 0, wxEXPAND | wxALIGN_CENTER_HORIZONTAL);
switch (type) {
case text:
statictext = new wxStaticText(parent, -1, value, wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT);
sizer->Add(textctrl, 1, wxEXPAND | wxADJUST_MINSIZE);
break;
case choice:
- choicectrl = new wxChoice(parent, id, wxDefaultPosition, wxDefaultSize, nvalues, values);
+ choicectrl = new wxChoice(parent, id, wxDefaultPosition, wxSize(150, 20), nvalues, values);
sizer->Add(choicectrl, 1, wxEXPAND);
break;
}
}
/* Creates a new config panel, config must be allocated with new */
-wxbConfigPanel::wxbConfigPanel(wxWindow* parent, wxbConfig* config,
+wxbConfigPanel::wxbConfigPanel(wxWindow* parent, wxbConfig* config, wxString title,
wxWindowID ok, wxWindowID cancel, wxWindowID apply): wxPanel(parent) {
this->config = config;
wxBoxSizer* mainSizer = new wxBoxSizer(wxVERTICAL);
+
+ mainSizer->Add(
+ new wxStaticText(this, -1, title, wxDefaultPosition, wxDefaultSize, wxALIGN_CENTER),
+ 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5);
+
wxFlexGridSizer* cfgSizer = new wxFlexGridSizer(config->GetCount()+1, 2, 8, 5);
unsigned int i;
for (i = 0; i < config->GetCount(); i++) {
class wxbConfigPanel : public wxPanel {
public:
/* Creates a new config panel, config must be allocated with new */
- wxbConfigPanel(wxWindow* parent, wxbConfig* config, wxWindowID ok, wxWindowID cancel, wxWindowID apply = -1);
+ wxbConfigPanel(wxWindow* parent, wxbConfig* config, wxString title, wxWindowID ok, wxWindowID cancel, wxWindowID apply = -1);
~wxbConfigPanel();
void SetRowString(const char* title, wxString value);
if (ct != NULL) { // && (!ct->IsRunning())
ct->Delete();
}
+ frame = NULL;
}
/*
ct->Delete();
ct = NULL;
}
+ frame = NULL;
Close(TRUE);
}
int answer = wxMessageBox("Connection to the director lost. Quit program?", "Connection lost",
wxYES_NO | wxICON_EXCLAMATION, this);
if (answer == wxYES) {
+ frame = NULL;
Close(true);
}
return;
wxbThreadEvent evt(Thread);
evt.SetEventPrintObject(po);
-
- wxbMainFrame::GetInstance()->AddPendingEvent(evt);
+
+ if (wxbMainFrame::GetInstance()) {
+ wxbMainFrame::GetInstance()->AddPendingEvent(evt);
+ }
}
//wxString csBuffer; /* Temporary buffer for receiving data from console thread */
config->Add(new wxbConfigParam("Storage", ConfigStorage, choice, 0, elist));
config->Add(new wxbConfigParam("Before", ConfigWhen, choice, 0, elist));
- configPanel = new wxbConfigPanel(this, config, RestoreStart, RestoreCancel, -1);
+ configPanel = new wxbConfigPanel(this, config, "Please configure parameters concerning files to restore :", RestoreStart, RestoreCancel, -1);
configPanel->Show(true);
configPanel->Enable(false);
config->Add(new wxbConfigParam("When", ConfigWhen, modifiableText, ""));
config->Add(new wxbConfigParam("Priority", ConfigPriority, modifiableText, ""));
- restorePanel = new wxbConfigPanel(this, config, ConfigOk, ConfigCancel, ConfigApply);
+ restorePanel = new wxbConfigPanel(this, config, "Please configure parameters concerning files restoration :", ConfigOk, ConfigCancel, ConfigApply);
restorePanel->Show(false);
WaitForEnd("unmark *\n");
wxTreeItemId root = tree->AddRoot(configPanel->GetRowString("Client"), -1, -1, new wxbTreeItemData("/", configPanel->GetRowString("Client"), 0));
+ currentTreeItem = root;
tree->Refresh();
UpdateTreeItem(root, true);
wxbMainFrame::GetInstance()->SetStatusText("Right click on a file or on a directory, or double-click on its mark to add it to the restore list.");
cancelled = 1;
if (status == restoring) {
- int n = 0;
if (jobid != "") {
wxbMainFrame::GetInstance()->Send(wxString("cancel job=") << jobid << "\n");
}
/* Run a dir command, and waits until result is fully received. */
void wxbRestorePanel::UpdateTreeItem(wxTreeItemId item, bool updatelist) {
// this->updatelist = updatelist;
- currentTreeItem = item;
-
wxbDataTokenizer* dt;
dt = WaitForEnd(wxString("cd \"") <<
- static_cast<wxbTreeItemData*>(tree->GetItemData(currentTreeItem))
+ static_cast<wxbTreeItemData*>(tree->GetItemData(item))
->GetPath() << "\"\n", false);
/* TODO: check command result */
wxString itemStr;
long cookie;
- treeid = tree->GetFirstChild(currentTreeItem, cookie);
+ treeid = tree->GetFirstChild(item, cookie);
bool updated = false;
updated = true;
break;
}
- treeid = tree->GetNextChild(currentTreeItem, cookie);
+ treeid = tree->GetNextChild(item, cookie);
}
if (!updated) {
int img = wxbTreeItemData::GetMarkedStatus(file[6]);
- treeid = tree->AppendItem(currentTreeItem, file[8], img, img, new wxbTreeItemData(file[7], file[8], file[6]));
+ treeid = tree->AppendItem(item, file[8], img, img, new wxbTreeItemData(file[7], file[8], file[6]));
}
}
if (working) {
return;
}
+ if (currentTreeItem == event.GetItem()) {
+ return;
+ }
SetCursor(*wxHOURGLASS_CURSOR);
markWhenListingDone = false;
working = true;
+ currentTreeItem = event.GetItem();
CmdList(event.GetItem());
if (markWhenListingDone) {
CmdMark(event.GetItem(), -1);
SetCursor(*wxSTANDARD_CURSOR);
tree->Expand(currentTreeItem);
tree->SelectItem(currentChild);
- tree->Refresh();
+ //tree->Refresh();
return;
}
currentChild = tree->GetNextChild(currentTreeItem, cookie);