]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/wx-console/wxbrestorepanel.h
- Fix ANSI labels to put EOF1 and EOF2 after each file mark.
[bacula/bacula] / bacula / src / wx-console / wxbrestorepanel.h
index bf991cd36d3e4e1ec8003b2772322759a020b085..56a172494b87daf807742e418ee67f71a515f337 100644 (file)
@@ -4,6 +4,7 @@
  *
  *    Nicolas Boichat, April-May 2004
  *
+ *    Version $Id$
  */
 /*
    Copyright (C) 2004 Kern Sibbald and John Walker
@@ -47,6 +48,8 @@
 #include "wxbtreectrl.h"
 #include "wxblistctrl.h"
 
+WX_DECLARE_LIST(wxEvent, wxbEventList);
+
 /*
  * wxbPanel for restoring files
  */
@@ -92,19 +95,6 @@ class wxbRestorePanel : public wxbPanel
       long totfilemessages; /* When restoring, number of files to be restored */
       wxString jobid;
 
-      /* Parse a table in tableParser */
-      wxbTableParser* CreateAndWaitForParser(wxString cmd);
-
-      /* Run a command, and waits until result is fully received,
-       * if keepresults is true, returns a valid pointer to a wxbDataTokenizer
-       * containing the data. */
-      wxbDataTokenizer* WaitForEnd(wxString cmd, bool keepresults = false, bool linebyline = true);
-
-      /* Run a command, and waits until prompt result is fully received,
-       * if keepresults is true, returns a valid pointer to a wxbPromptParser
-       * containing the data. */
-      wxbPromptParser* WaitForPrompt(wxString cmd, bool keepresults = false);
-
       /* Run a dir command, and waits until result is fully received.
        * If recurse is true, update the children too. */
       void UpdateTreeItem(wxTreeItemId item, bool updatelist, bool recurse);
@@ -117,33 +107,33 @@ class wxbRestorePanel : public wxbPanel
 
       /* Sets a tree item state, and update its children, parents and list (if necessary) */
       void SetTreeItemState(wxTreeItemId item, int newstate);
-      
+
       /* Update a tree item parents' state */
       void UpdateTreeItemState(wxTreeItemId item);
 
       /* Refresh the whole tree. */
       void RefreshTree();
-      
+
       /* Refresh file list */
       void RefreshList();
-      
+
       /* Update first config, adapting settings to the job name selected */
       void UpdateFirstConfig();
-      
+
       /* Update second config */
       bool UpdateSecondConfig(wxbDataTokenizer* dt);
-      
+
 /* Status related */
       enum status_enum
       {
-         disabled,    // The panel is not activatable
-         activable,   // The panel is activable, but not activated
-         entered,     // The panel is activated
-         choosing,    // The user is choosing files to restore
-         listing,     // Dir listing is in progress
-         configuring, // The user is configuring restore process
-         restoring,   // Bacula is restoring files
-         finished     // Retore done (state will change in activable)
+        disabled,    // The panel is not activatable
+        activable,   // The panel is activable, but not activated
+        entered,     // The panel is activated
+        choosing,    // The user is choosing files to restore
+        listing,     // Dir listing is in progress
+        configuring, // The user is configuring restore process
+        restoring,   // Bacula is restoring files
+        finished     // Retore done (state will change in activable)
       };
 
       status_enum status;
@@ -159,6 +149,8 @@ class wxbRestorePanel : public wxbPanel
 
 /* UI related */
       bool working; // A command is running, discard GUI events
+      void SetWorking(bool working);
+      bool IsWorking();
       bool markWhenListingDone;
       wxTreeItemId currentTreeItem; // Currently selected tree item
 
@@ -166,24 +158,30 @@ class wxbRestorePanel : public wxbPanel
       void EnableConfig(bool enable);
 
 /* Event handling */
-      void OnStart(wxCommandEvent& WXUNUSED(event));
-      void OnCancel(wxCommandEvent& WXUNUSED(event));
-      
+//      wxbEventList* pendingEvents; /* Stores event sent while working */ //EVTQUEUE
+//      bool processing; /* True if pendingEvents is being processed */ //EVTQUEUE
+
+//      virtual void AddPendingEvent(wxEvent& event);
+//      virtual bool ProcessEvent(wxEvent& event); //EVTQUEUE
+
+      void OnStart(wxCommandEvent& event);
+      void OnCancel(wxCommandEvent& event);
+
       void OnTreeChanging(wxTreeEvent& event);
       void OnTreeExpanding(wxTreeEvent& event);
       void OnTreeChanged(wxTreeEvent& event);
       void OnTreeMarked(wxbTreeMarkedEvent& event);
-      void OnTreeAdd(wxCommandEvent& WXUNUSED(event));
-      void OnTreeRemove(wxCommandEvent& WXUNUSED(event));
-      void OnTreeRefresh(wxCommandEvent& WXUNUSED(event));
-      
+      void OnTreeAdd(wxCommandEvent& event);
+      void OnTreeRemove(wxCommandEvent& event);
+      void OnTreeRefresh(wxCommandEvent& event);
+
       void OnListMarked(wxbListMarkedEvent& event);
       void OnListActivated(wxListEvent& event);
       void OnListChanged(wxListEvent& event);
-      void OnListAdd(wxCommandEvent& WXUNUSED(event));
-      void OnListRemove(wxCommandEvent& WXUNUSED(event));
-      void OnListRefresh(wxCommandEvent& WXUNUSED(event));
-      
+      void OnListAdd(wxCommandEvent& event);
+      void OnListRemove(wxCommandEvent& event);
+      void OnListRefresh(wxCommandEvent& event);
+
       void OnConfigUpdated(wxCommandEvent& event);
       void OnConfigOk(wxCommandEvent& WXUNUSED(event));
       void OnConfigApply(wxCommandEvent& WXUNUSED(event));
@@ -199,25 +197,24 @@ class wxbRestorePanel : public wxbPanel
 
       wxButton* start;
       wxButton* cancel;
-      
+
       wxbTreeCtrl* tree;
       wxButton* treeadd;
       wxButton* treeremove;
       wxButton* treerefresh;
-      
+
       wxbListCtrl* list;
       wxButton* listadd;
       wxButton* listremove;
       wxButton* listrefresh;
-      
+
       wxGauge* gauge;
-     
+
       long cfgUpdated; //keeps which config fields have been updated
 
       friend class wxbSplitterWindow;
 
-      DECLARE_EVENT_TABLE();    
+      DECLARE_EVENT_TABLE();
 };
 
 #endif // WXBRESTOREPANEL_H
-