]> git.sur5r.net Git - bacula/bacula/commitdiff
Major wx-console bug fixes.
authorNicolas Boichat <nicolas@boichat.ch>
Thu, 24 Mar 2005 14:56:35 +0000 (14:56 +0000)
committerNicolas Boichat <nicolas@boichat.ch>
Thu, 24 Mar 2005 14:56:35 +0000 (14:56 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@1898 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/src/wx-console/CHANGELOG
bacula/src/wx-console/wxbmainframe.cpp
bacula/src/wx-console/wxbrestorepanel.cpp
bacula/src/wx-console/wxbrestorepanel.h

index 657239a799d9238836381d6f9078c4e8ef1f7699..9ffc7b3f300d907ed2010ca98c1fc0d8044f6788 100644 (file)
@@ -1,3 +1,9 @@
+24-03-2005 :
+ - wxbMainFrame : Fix a bug with GTK+-1.2 which caused wx-console to crash
+   when starting.
+ - wxbRestorePanel : Fix a major bug which caused wx-console to enter in an
+   infinite loop which allocate a lot of memory and could make the system crash.
+
 10-03-2005 :
  - wxbMainFrame : Fix bug #0000221 (Debian 292517)
 
index 5f03634826dd03801857d8d19287d9ea43297ed5..d1373d97487c859c6ded88dfd9484f2fbab2e3f8 100644 (file)
@@ -207,6 +207,8 @@ wxbMainFrame::~wxbMainFrame()
 wxbMainFrame::wxbMainFrame(const wxString& title, const wxPoint& pos, const wxSize& size, long style)
       : wxFrame(NULL, -1, title, pos, size, style)
 {
+   lockedbyconsole = false;
+   
    ct = NULL;
    
    promptparser = NULL;
@@ -313,8 +315,6 @@ wxbMainFrame::wxbMainFrame(const wxString& title, const wxPoint& pos, const wxSi
    this->SetSize(size);
    EnableConsole(false);
    
-   lockedbyconsole = false;
-   
    consoleBuffer = "";
    
    configfile = "";
index 440ed3eff8b066a308b81561c82ca1bac996d63f..ff9840a922d8ff8f2222830412a0103066c04b79 100644 (file)
@@ -408,7 +408,7 @@ wxbRestorePanel::wxbRestorePanel(wxWindow* parent): wxbPanel(parent) {
 
    SetCursor(*wxSTANDARD_CURSOR);
 
-   markWhenListingDone = false;
+   markWhenCommandDone = false;
    
    cancelled = 0;
 }
@@ -1985,7 +1985,6 @@ void wxbRestorePanel::OnCancel(wxCommandEvent& event) {
 
 void wxbRestorePanel::OnStart(wxCommandEvent& event) {
    if (IsWorking()) {
-      AddPendingEvent(event);
       return;
    }
    SetWorking(true);
@@ -1995,14 +1994,12 @@ void wxbRestorePanel::OnStart(wxCommandEvent& event) {
 
 void wxbRestorePanel::OnTreeChanging(wxTreeEvent& event) {
    if (IsWorking()) {
-      AddPendingEvent(event);
       event.Veto();
    }
 }
 
 void wxbRestorePanel::OnTreeExpanding(wxTreeEvent& event) {
    if (IsWorking()) {
-      AddPendingEvent(event);
       event.Veto();
       return;
    }
@@ -2016,7 +2013,6 @@ void wxbRestorePanel::OnTreeExpanding(wxTreeEvent& event) {
 
 void wxbRestorePanel::OnTreeChanged(wxTreeEvent& event) {
    if (IsWorking()) {
-      AddPendingEvent(event);
       return;
    }
    if (currentTreeItem == event.GetItem()) {
@@ -2025,11 +2021,11 @@ void wxbRestorePanel::OnTreeChanged(wxTreeEvent& event) {
    treeadd->Enable(false);
    treeremove->Enable(false);
    treerefresh->Enable(false);
-   markWhenListingDone = false;
+   markWhenCommandDone = false;
    SetWorking(true);
    currentTreeItem = event.GetItem();
    CmdList(event.GetItem());
-   if (markWhenListingDone) {
+   if (markWhenCommandDone) {
       CmdMark(event.GetItem(), NULL, 0);
       tree->Refresh();
    }
@@ -2043,17 +2039,19 @@ void wxbRestorePanel::OnTreeChanged(wxTreeEvent& event) {
 }
 
 void wxbRestorePanel::OnTreeMarked(wxbTreeMarkedEvent& event) {
-   csprint("Tree marked", CS_DEBUG);
    if (IsWorking()) {
       if (tree->GetSelection() == event.GetItem()) {
-         markWhenListingDone = !markWhenListingDone;
+         markWhenCommandDone = !markWhenCommandDone;
       }
-      AddPendingEvent(event);
       return;
    }
    SetWorking(true);
+   markWhenCommandDone = false;
    CmdMark(event.GetItem(), NULL, 0);
-   //event.Skip();
+   if (markWhenCommandDone) {
+      CmdMark(event.GetItem(), NULL, 0);
+      tree->Refresh();
+   }
    tree->Refresh();
    SetWorking(false);
    if (event.GetItem().IsOk()) {
@@ -2065,7 +2063,6 @@ void wxbRestorePanel::OnTreeMarked(wxbTreeMarkedEvent& event) {
 
 void wxbRestorePanel::OnTreeAdd(wxCommandEvent& event) {
    if (IsWorking()) {
-      AddPendingEvent(event);
       return;
    }
    
@@ -2081,7 +2078,6 @@ void wxbRestorePanel::OnTreeAdd(wxCommandEvent& event) {
 
 void wxbRestorePanel::OnTreeRemove(wxCommandEvent& event) {
    if (IsWorking()) {
-      AddPendingEvent(event);
       return;
    }
    
@@ -2097,7 +2093,6 @@ void wxbRestorePanel::OnTreeRemove(wxCommandEvent& event) {
 
 void wxbRestorePanel::OnTreeRefresh(wxCommandEvent& event) {
    if (IsWorking()) {
-      AddPendingEvent(event);
       return;
    }
    
@@ -2108,8 +2103,6 @@ void wxbRestorePanel::OnTreeRefresh(wxCommandEvent& event) {
 
 void wxbRestorePanel::OnListMarked(wxbListMarkedEvent& event) {
    if (IsWorking()) {
-      AddPendingEvent(event);
-      //event.Skip();
       return;
    }
    
@@ -2129,7 +2122,7 @@ void wxbRestorePanel::OnListMarked(wxbListMarkedEvent& event) {
       num++;
       item = list->GetNextItem(item, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
    }
-     
+   
    CmdMark(wxTreeItemId(), items, num);
    
    delete[] items;
@@ -2145,8 +2138,6 @@ void wxbRestorePanel::OnListMarked(wxbListMarkedEvent& event) {
 
 void wxbRestorePanel::OnListActivated(wxListEvent& event) {
    if (IsWorking()) {
-      AddPendingEvent(event);
-      //event.Skip();
       return;
    }
    SetWorking(true);
@@ -2183,7 +2174,6 @@ void wxbRestorePanel::OnListActivated(wxListEvent& event) {
 
 void wxbRestorePanel::OnListChanged(wxListEvent& event) {
    if (IsWorking()) {
-      AddPendingEvent(event);
       return;
    }
  
@@ -2220,7 +2210,6 @@ void wxbRestorePanel::OnListChanged(wxListEvent& event) {
 
 void wxbRestorePanel::OnListAdd(wxCommandEvent& event) {
    if (IsWorking()) {
-      AddPendingEvent(event);
       return;
    }
    
@@ -2250,7 +2239,6 @@ void wxbRestorePanel::OnListAdd(wxCommandEvent& event) {
 
 void wxbRestorePanel::OnListRemove(wxCommandEvent& event) {
    if (IsWorking()) {
-      AddPendingEvent(event);
       return;
    }
    
@@ -2280,7 +2268,6 @@ void wxbRestorePanel::OnListRemove(wxCommandEvent& event) {
 
 void wxbRestorePanel::OnListRefresh(wxCommandEvent& event) {
    if (IsWorking()) {
-      AddPendingEvent(event);
       return;
    }
    
index 56a172494b87daf807742e418ee67f71a515f337..0473927fbd718e60f6f29f6fcef694826494d6f9 100644 (file)
@@ -151,7 +151,7 @@ class wxbRestorePanel : public wxbPanel
       bool working; // A command is running, discard GUI events
       void SetWorking(bool working);
       bool IsWorking();
-      bool markWhenListingDone;
+      bool markWhenCommandDone; //If an item should be (un)marked after the current listing/marking is done
       wxTreeItemId currentTreeItem; // Currently selected tree item
 
       /* Enable or disable config controls status */