GTK : Fix 100% CPU usage when waiting for results
-wxbRestorePanel : when the director is building tree, change the cursor to a
- wait type cursor, make changes to the status in the gauge (need to parse the
- table).
-
wxbMainFrame : Add some text in front of the command window such as
"Command: " so that the user knows he can type into the
command window (or command line)
wxbRestorePanel : Reconsider start button's labels.
-console_thread : Show a nice message when config file is not found.
-
-wxbMainFrame : Automatically scroll to the bottom of console control.
+general : Show nice messages when errors occurs.
-wxbMainFrame : use more often the status text
+wxbMainFrame : use more often status text
wxbRestorePanel : Add a Cancel Restore button
(may need to implement BNET_BREAK to break current command)
general : Allow the user to quit however the state is (kill thread if necessary)
+VC++ : crashing when there's no configuration file, or server is unreachable
+
[postponed to July:]
wxbRestorePanel : Add buttons to mark/unmark directories/files.
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
\ No newline at end of file
+ in the new directory
sizer->SetSizeHints( this );
this->SetSize(size);
EnableConsole(false);
-
- nlines = 0;
}
/*
else {
consoleCtrl->SetDefaultStyle(wxTextAttr(*wxBLACK));
}
- (*consoleCtrl) << str;
+ consoleCtrl->AppendText(str);
if (status == CS_PROMPT) {
- (*consoleCtrl) << "<P>";
+ consoleCtrl->AppendText("<P>");
}
+
+ consoleCtrl->ScrollLines(3);
+
+// consoleCtrl->ShowPosition(consoleCtrl->GetLastPosition());
+
/*if (status != CS_DEBUG) {
- (*consoleCtrl) << "@";
+ consoleCtrl->AppendText("@");
}*/
//consoleCtrl->SetInsertionPointEnd();
ct->Write((const char*)str);
typeCtrl->SetValue("");
consoleCtrl->SetDefaultStyle(wxTextAttr(*wxRED));
- (*consoleCtrl) << str;
+ consoleCtrl->AppendText(str);
+ consoleCtrl->ScrollLines(3);
/* if ((consoleCtrl->GetNumberOfLines()-1) > nlines) {
nlines = consoleCtrl->GetNumberOfLines()-1;
}
working = false;
+ SetCursor(*wxSTANDARD_CURSOR);
}
/*
return;
}
delete pp;
- WaitForEnd(wxString() << client << "\n");
+
+ wxbDataTokenizer* dt = new wxbDataTokenizer(true);
+ wxbTableParser* tableparser = CreateAndWaitForParser(wxString() << client << "\n");
+ int tot = 0;
+ long l;
+ wxString str;
+
+ unsigned int i;
+ for (i = 0; i < tableparser->size(); i++) {
+ str = (*tableparser)[i][2];
+ str.Replace(",", "");
+ if (str.ToLong(&l)) {
+ tot += l;
+ }
+ }
+
+ gauge->SetValue(0);
+ gauge->SetRange(tot);
+
+ /*wxbMainFrame::GetInstance()->Print(
+ wxString("[") << tot << "]", CS_DEBUG);*/
+
+ wxDateTime base = wxDateTime::Now();
+ wxDateTime newdate;
+ int done = 0;
+ int willdo = 0;
+ unsigned int lastindex = 0;
+
+ int var = 0;
+
+ while (!dt->hasFinished()) {
+ newdate = wxDateTime::Now();
+ if ( ( (1000*(newdate.GetTicks()-base.GetTicks())) +
+ (newdate.GetMillisecond()-base.GetMillisecond()) ) > 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);
+ for (unsigned int i = 0; i < tableparser->size(); i++) {
+ if (str == (*tableparser)[i][0]) {
+ str = (*tableparser)[i][2];
+ str.Replace(",", "");
+ if (str.ToLong(&l)) {
+ done += willdo;
+ willdo += l;
+ var = (willdo-done)/3;
+ }
+ break;
+ }
+ }
+ }
+ }
+
+ 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);
+
+ /*wxbMainFrame::GetInstance()->Print(
+ wxString("[") << gauge->GetValue() << "/" << done
+ << "-" << willdo << "]", CS_DEBUG);*/
+ }
+ wxTheApp->Yield(true);
+ }
+
+ gauge->SetValue(0);
+
+ delete dt;
+
WaitForEnd("unmark *\n");
SetStatus(choosing);
wxTreeItemId root = tree->AddRoot(clientChoice->GetStringSelection(), -1, -1, new wxbTreeItemData("/", clientChoice->GetStringSelection(), 0));
tree->Enable(true);
list->Enable(true);
working = false;
+ SetCursor(*wxSTANDARD_CURSOR);
break;
case configuring:
start->Enable(false);
jobChoice->Enable(false);
tree->Enable(false);
list->Enable(false);
+ SetCursor(*wxHOURGLASS_CURSOR);
working = true;
break;
}
if (working) {
return;
}
+ SetCursor(*wxHOURGLASS_CURSOR);
working = true;
clientChoice->Enable(false);
jobChoice->Enable(false);
jobChoice->Enable(true);
jobChoice->Refresh();
working = false;
+ SetCursor(*wxSTANDARD_CURSOR);
}
void wxbRestorePanel::OnStart(wxEvent& WXUNUSED(event)) {
if (working) {
return;
}
+ SetCursor(*wxHOURGLASS_CURSOR);
working = true;
CmdStart();
working = false;
+ SetCursor(*wxSTANDARD_CURSOR);
}
void wxbRestorePanel::OnTreeChanging(wxTreeEvent& event) {
if (working) {
return;
}
-
+ SetCursor(*wxHOURGLASS_CURSOR);
working = true;
CmdList(event.GetItem());
working = false;
+ SetCursor(*wxSTANDARD_CURSOR);
}
void wxbRestorePanel::OnTreeMarked(wxbTreeMarkedEvent& event) {
//event.Skip();
return;
}
+ SetCursor(*wxHOURGLASS_CURSOR);
working = true;
CmdMark(event.GetItem(), -1);
//event.Skip();
tree->Refresh();
working = false;
+ SetCursor(*wxSTANDARD_CURSOR);
}
void wxbRestorePanel::OnListMarked(wxbListMarkedEvent& event) {
//event.Skip();
return;
}
+ SetCursor(*wxHOURGLASS_CURSOR);
working = true;
//long item = event.GetId();
long item = list->GetNextItem(-1, wxLIST_NEXT_ALL, wxLIST_STATE_FOCUSED);
event.Skip();
tree->Refresh();
working = false;
+ SetCursor(*wxSTANDARD_CURSOR);
}
void wxbRestorePanel::OnListActivated(wxListEvent& event) {
//event.Skip();
return;
}
+ SetCursor(*wxHOURGLASS_CURSOR);
working = true;
long item = list->GetNextItem(-1, wxLIST_NEXT_ALL, wxLIST_STATE_FOCUSED);
if (item > -1) {
if (name2 == name) {
//tree->UnselectAll();
working = false;
+ SetCursor(*wxSTANDARD_CURSOR);
tree->Expand(currentTreeItem);
tree->SelectItem(currentChild);
//tree->Refresh();
}
}
working = false;
+ SetCursor(*wxSTANDARD_CURSOR);
}
void wxbRestorePanel::OnConfigUpdated(wxCommandEvent& event) {
if (working) {
return;
}
+ SetCursor(*wxHOURGLASS_CURSOR);
working = true;
CmdStart();
working = false;
+ SetCursor(*wxSTANDARD_CURSOR);
}
void wxbRestorePanel::OnConfigApply(wxEvent& WXUNUSED(event)) {
if (working) {
return;
}
+ SetCursor(*wxHOURGLASS_CURSOR);
working = true;
CmdConfigApply();
if (cfgUpdated == 0) {
cfgOk->Enable(true);
}
working = false;
+ SetCursor(*wxSTANDARD_CURSOR);
}
void wxbRestorePanel::OnConfigCancel(wxEvent& WXUNUSED(event)) {
if (working) {
return;
}
+ SetCursor(*wxHOURGLASS_CURSOR);
working = true;
CmdConfigCancel();
working = false;
+ SetCursor(*wxSTANDARD_CURSOR);
}
/* TODO : correct that bad implementation of tree marked event forwarding */