]> git.sur5r.net Git - bacula/bacula/commitdiff
kes wx-console crashes because of differences between Bacula and wxWidgets
authorKern Sibbald <kern@sibbald.com>
Fri, 25 Aug 2006 12:35:45 +0000 (12:35 +0000)
committerKern Sibbald <kern@sibbald.com>
Fri, 25 Aug 2006 12:35:45 +0000 (12:35 +0000)
     malloc()/free().  Tweek wx-console to use bmalloc()/bfree() for Bacula
     calls.
kes  correct improper indenting in wx-console/console_conf.c
kes  update wx-console header copyrights
kes  Fix bug #658 where wx-console mangles file/directory names containing
     commas.

git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@3368 91ce42f0-d328-0410-95d8-f526ca767f89

27 files changed:
bacula/src/bacula.h
bacula/src/lib/bsys.c
bacula/src/lib/protos.h
bacula/src/wx-console/console_conf.c
bacula/src/wx-console/console_conf.h
bacula/src/wx-console/console_thread.cpp
bacula/src/wx-console/csprint.h
bacula/src/wx-console/main.cpp
bacula/src/wx-console/wxbconfigfileeditor.cpp
bacula/src/wx-console/wxbconfigfileeditor.h
bacula/src/wx-console/wxbconfigpanel.cpp
bacula/src/wx-console/wxbconfigpanel.h
bacula/src/wx-console/wxbhistorytextctrl.cpp
bacula/src/wx-console/wxbhistorytextctrl.h
bacula/src/wx-console/wxblistctrl.cpp
bacula/src/wx-console/wxblistctrl.h
bacula/src/wx-console/wxbmainframe.cpp
bacula/src/wx-console/wxbmainframe.h
bacula/src/wx-console/wxbrestorepanel.cpp
bacula/src/wx-console/wxbrestorepanel.h
bacula/src/wx-console/wxbtableparser.cpp
bacula/src/wx-console/wxbtableparser.h
bacula/src/wx-console/wxbtreectrl.cpp
bacula/src/wx-console/wxbtreectrl.h
bacula/src/wx-console/wxbutils.cpp
bacula/src/wx-console/wxbutils.h
bacula/technotes-1.39

index 9d49a63aee03a7597498450d7d1a4a16d8e4de8e..5619c0d7f2b041731c8f8d333bb22cfca28f0d96 100644 (file)
 #include "baconfig.h"
 #include "lib/lib.h"
 
+/*
+ * For wx-console compiles, we undo some Bacula defines.
+ *  This prevents conflicts between wx-Widgets and Bacula.
+ *  In wx-console files that malloc or free() Bacula structures
+ *  config/resources and interface to the Bacula libraries,
+ *  you must use bmalloc() and bfree().
+ */
 #ifdef HAVE_WXCONSOLE
 #undef New
 #undef _
+#undef free
+#undef malloc
 #endif
 
 #if defined(HAVE_WIN32)
index aa2be79c06b8cef4009eaa0a1c130e45d6b0c6bb..a4dc7231aabdb5f9e060da4c8806bbaa395a8405 100644 (file)
@@ -176,12 +176,16 @@ int cstrlen(const char *str)
 
 
 
-#ifndef DEBUG
+#ifndef bmalloc
 void *bmalloc(size_t size)
 {
   void *buf;
 
+#ifdef SMARTALLOC
+  buf = sm_malloc(file, line, size);
+#else
   buf = malloc(size);
+#endif
   if (buf == NULL) {
      berrno be;
      Emsg1(M_ABORT, 0, _("Out of memory: ERR=%s\n"), be.strerror());
@@ -207,6 +211,18 @@ void *b_malloc(const char *file, int line, size_t size)
 }
 
 
+void bfree(void *buf)
+{
+#ifdef SMARTALLOC
+  sm_free(__FILE__, __LINE__, buf);
+#else
+  free(buf);
+#endif
+}
+
+
+
+
 void *brealloc (void *buf, size_t size)
 {
    buf = realloc(buf, size);
index dc2a2d9de2082b9fec0a1b6bbc74254ab3465aa6..d0ddd5326e87ed1c8692b5371cd15b88b0a52d79 100644 (file)
@@ -42,9 +42,10 @@ char     *bstrncat               (char *dest, POOL_MEM &src, int maxlen);
 bool      bstrcmp                (const char *s1, const char *s2);
 int       cstrlen                (const char *str);
 void     *b_malloc               (const char *file, int line, size_t size);
-#ifndef DEBUG
+#ifndef bmalloc
 void     *bmalloc                (size_t size);
 #endif
+void      bfree                  (void *buf);
 void     *brealloc               (void *buf, size_t size);
 void     *bcalloc                (size_t size1, size_t size2);
 int       bsnprintf              (char *str, int32_t size, const char *format, ...);
index 678dcf411f64aca6ca1351d908c54723bff0195a..b4b880cee43aa8247ddc839e778d163c0f164eba 100644 (file)
 /* _("...") macro returns a wxChar*, so if we need a char*, we need to convert it with:
  * wxString(_("...")).mb_str(*wxConvCurrent) */
 
-#include "bacula.h"
+#include "bacula.h" 
 #include "console_conf.h"
 
 #include <wx/intl.h>
 
+
+
 /* Define the first and last resource ID record
  * types. Note, these should be unique for each
  * daemon though not a requirement.
@@ -132,16 +134,16 @@ void dump_resource(int type, RES *reshdr, void sendit(void *sock, const char *fm
       recurse = 0;
    }
    switch (type) {
-      case R_CONSOLE:
-         printf(wxString(_("Console: name=%s rcfile=%s histfile=%s\n")).mb_str(*wxConvCurrent), reshdr->name,
-      res->res_cons.rc_file, res->res_cons.hist_file);
-    break;
-      case R_DIRECTOR:
-         printf(wxString(_("Director: name=%s address=%s DIRport=%d\n")).mb_str(*wxConvCurrent), reshdr->name,
-       res->res_dir.address, res->res_dir.DIRport);
-    break;
-      default:
-         printf(wxString(_("Unknown resource type %d\n")).mb_str(*wxConvCurrent), type);
+   case R_CONSOLE:
+      printf(wxString(_("Console: name=%s rcfile=%s histfile=%s\n")).mb_str(*wxConvCurrent), reshdr->name,
+             res->res_cons.rc_file, res->res_cons.hist_file);
+      break;
+   case R_DIRECTOR:
+      printf(wxString(_("Director: name=%s address=%s DIRport=%d\n")).mb_str(*wxConvCurrent), reshdr->name,
+             res->res_dir.address, res->res_dir.DIRport);
+      break;
+   default:
+      printf(wxString(_("Unknown resource type %d\n")).mb_str(*wxConvCurrent), type);
    }
    if (recurse && res->res_dir.hdr.next) {
       dump_resource(type, res->res_dir.hdr.next, sendit, sock);
@@ -166,60 +168,60 @@ void free_resource(RES *sres, int type)
    /* common stuff -- free the resource name */
    nres = (RES *)res->res_dir.hdr.next;
    if (res->res_dir.hdr.name) {
-      free(res->res_dir.hdr.name);
+      bfree(res->res_dir.hdr.name);
    }
    if (res->res_dir.hdr.desc) {
-      free(res->res_dir.hdr.desc);
+      bfree(res->res_dir.hdr.desc);
    }
 
    switch (type) {
    case R_CONSOLE:
       if (res->res_cons.rc_file) {
-         free(res->res_cons.rc_file);
+         bfree(res->res_cons.rc_file);
       }
       if (res->res_cons.hist_file) {
-         free(res->res_cons.hist_file);
+         bfree(res->res_cons.hist_file);
       }
       if (res->res_cons.tls_ctx) { 
          free_tls_context(res->res_cons.tls_ctx);
       }
       if (res->res_cons.tls_ca_certfile) {
-         free(res->res_cons.tls_ca_certfile);
+         bfree(res->res_cons.tls_ca_certfile);
       }
       if (res->res_cons.tls_ca_certdir) {
-         free(res->res_cons.tls_ca_certdir);
+         bfree(res->res_cons.tls_ca_certdir);
       }
       if (res->res_cons.tls_certfile) {
-         free(res->res_cons.tls_certfile);
+         bfree(res->res_cons.tls_certfile);
       }
       if (res->res_cons.tls_keyfile) {
-         free(res->res_cons.tls_keyfile);
+         bfree(res->res_cons.tls_keyfile);
       }
    case R_DIRECTOR:
       if (res->res_dir.address) {
-         free(res->res_dir.address);
+         bfree(res->res_dir.address);
       }
       if (res->res_dir.tls_ctx) { 
          free_tls_context(res->res_dir.tls_ctx);
       }
       if (res->res_dir.tls_ca_certfile) {
-         free(res->res_dir.tls_ca_certfile);
+         bfree(res->res_dir.tls_ca_certfile);
       }
       if (res->res_dir.tls_ca_certdir) {
-         free(res->res_dir.tls_ca_certdir);
+         bfree(res->res_dir.tls_ca_certdir);
       }
       if (res->res_dir.tls_certfile) {
-         free(res->res_dir.tls_certfile);
+         bfree(res->res_dir.tls_certfile);
       }
       if (res->res_dir.tls_keyfile) {
-         free(res->res_dir.tls_keyfile);
+         bfree(res->res_dir.tls_keyfile);
       }
       break;
    default:
          printf(wxString(_("Unknown resource type %d\n")).mb_str(*wxConvCurrent), type);
       }
    /* Common stuff again -- free the resource, recurse to next one */
-   free(res);
+   bfree(res);
    if (nres) {
       free_resource(nres, type);
    }
@@ -255,62 +257,62 @@ void save_resource(int type, RES_ITEM *items, int pass)
     */
    if (pass == 2) {
       switch (type) {
-    /* Resources not containing a resource */
-    case R_CONSOLE:
-    case R_DIRECTOR:
-       break;
+      /* Resources not containing a resource */
+      case R_CONSOLE:
+      case R_DIRECTOR:
+         break;
 
-    default:
-            Emsg1(M_ERROR, 0, wxString(_("Unknown resource type %d\n")).mb_str(*wxConvCurrent), type);
-       error = 1;
-       break;
+      default:
+         Emsg1(M_ERROR, 0, wxString(_("Unknown resource type %d\n")).mb_str(*wxConvCurrent), type);
+         error = 1;
+         break;
       }
       /* Note, the resoure name was already saved during pass 1,
        * so here, we can just release it.
        */
       if (res_all.res_dir.hdr.name) {
-    free(res_all.res_dir.hdr.name);
-    res_all.res_dir.hdr.name = NULL;
+         bfree(res_all.res_dir.hdr.name);
+         res_all.res_dir.hdr.name = NULL;
       }
       if (res_all.res_dir.hdr.desc) {
-    free(res_all.res_dir.hdr.desc);
-    res_all.res_dir.hdr.desc = NULL;
+         bfree(res_all.res_dir.hdr.desc);
+         res_all.res_dir.hdr.desc = NULL;
       }
       return;
    }
 
    /* The following code is only executed during pass 1 */
    switch (type) {
-      case R_CONSOLE:
-    size = sizeof(CONRES);
-    break;
-      case R_DIRECTOR:
-    size = sizeof(DIRRES);
-    break;
-      default:
-         printf(wxString(_("Unknown resource type %d\n")).mb_str(*wxConvCurrent), type);
-    error = 1;
-    size = 1;
-    break;
+   case R_CONSOLE:
+      size = sizeof(CONRES);
+      break;
+   case R_DIRECTOR:
+      size = sizeof(DIRRES);
+      break;
+   default:
+      printf(wxString(_("Unknown resource type %d\n")).mb_str(*wxConvCurrent), type);
+      error = 1;
+      size = 1;
+      break;
    }
    /* Common */
    if (!error) {
-      res = (URES *)malloc(size);
+      res = (URES *)bmalloc(size);
       memcpy(res, &res_all, size);
       if (!res_head[rindex]) {
-    res_head[rindex] = (RES *)res; /* store first entry */
+         res_head[rindex] = (RES *)res; /* store first entry */
       } else {
-    RES *next;
-    for (next=res_head[rindex]; next->next; next=next->next) {
-       if (strcmp(next->name, res->res_dir.hdr.name) == 0) {
-          Emsg2(M_ERROR_TERM, 0,
-                  wxString(_("Attempt to define second %s resource named \"%s\" is not permitted.\n")).mb_str(*wxConvCurrent),
-        resources[rindex].name, res->res_dir.hdr.name);
-       }
-    }
-    next->next = (RES *)res;
-         Dmsg2(90, "Inserting %s res: %s\n", res_to_str(type),
-          res->res_dir.hdr.name);
+         RES *next;
+         for (next=res_head[rindex]; next->next; next=next->next) {
+            if (strcmp(next->name, res->res_dir.hdr.name) == 0) {
+               Emsg2(M_ERROR_TERM, 0,
+                   wxString(_("Attempt to define second %s resource named \"%s\" is not permitted.\n")).mb_str(*wxConvCurrent),
+                   resources[rindex].name, res->res_dir.hdr.name);
+            }
+         }
+         next->next = (RES *)res;
+            Dmsg2(90, "Inserting %s res: %s\n", res_to_str(type),
+                  res->res_dir.hdr.name);
       }
    }
 }
index 5ef1fc3c7f8355fe01ef02f311ab45613a7e4a1f..ab5e8c91564b0e1edda93f0e619edf14046c791f 100644 (file)
@@ -2,7 +2,7 @@
  * Version $Id$
  */
 /*
-   Copyright (C) 2000-2005 Kern Sibbald
+   Copyright (C) 2000-2006 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License
index 3898f4c56e3e45d5a2b26973ea0b27bace90508f..97c2acc1969f0bf522e22b8d97caeaa8a2fd2810 100644 (file)
@@ -7,7 +7,7 @@
  *    Version $Id$
  */
 /*
-   Copyright (C) 2004-2005 Kern Sibbald
+   Copyright (C) 2004-2006 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License
@@ -143,7 +143,8 @@ void console_thread::SetWorkingDirectory(wxString w_dir) {
    }
 }
 
-void console_thread::InitLib() {
+void console_thread::InitLib() 
+{
    if (WSA_Init() != 0) {
       csprint(_("Error while initializing windows sockets...\n"));
       inited = false;
@@ -157,7 +158,8 @@ void console_thread::InitLib() {
    inited = true;
 }
 
-void console_thread::FreeLib() {
+void console_thread::FreeLib() 
+{
    if (inited) {
       if (WSACleanup() != 0) {
          csprint(_("Error while cleaning up windows sockets...\n"));
@@ -194,7 +196,8 @@ static void scan_err(const char *file, int line, LEX *lc, const char *msg, ...)
    errmsg << err; 
 }
 
-wxString console_thread::LoadConfig(wxString configfile) {
+wxString console_thread::LoadConfig(wxString configfile) 
+{
    if (!inited) {
       InitLib();
       if (!inited)
@@ -203,7 +206,7 @@ wxString console_thread::LoadConfig(wxString configfile) {
    
    free_config_resources();
    
-   MSGS* msgs = (MSGS *)malloc(sizeof(MSGS));
+   MSGS* msgs = (MSGS *)bmalloc(sizeof(MSGS));
    memset(msgs, 0, sizeof(MSGS));
    for (int i=1; i<=M_MAX; i++) {
 #ifndef HAVE_WIN32
index d8fd95139da8ebff1e7dc28957f0ac36fdd33aad..909c3813f1a1e2d07db457cab2aeda8641ea4d95 100644 (file)
@@ -7,22 +7,17 @@
  *    Version $Id$
  */
 /*
-   Copyright (C) 2004 Kern Sibbald and John Walker
+   Copyright (C) 2004-2006 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
-   modify it under the terms of the GNU General Public License as
-   published by the Free Software Foundation; either version 2 of
-   the License, or (at your option) any later version.
+   modify it under the terms of the GNU General Public License
+   version 2 as amended with additional clauses defined in the
+   file LICENSE in the main source directory.
 
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-   General Public License for more details.
-
-   You should have received a copy of the GNU General Public
-   License along with this program; if not, write to the Free
-   Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-   MA 02111-1307, USA.
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
+   the file LICENSE for additional details.
 
  */
 
index e07fd0331bed68f721705db0866c25178bb81ba7..e2fb8b526ab6300be9a542d971349d45a5b1dca8 100644 (file)
 #include <wx/wxprec.h>
 #include <wx/config.h>
 #include <wx/intl.h>
-
 #include "wxbmainframe.h"
-
 #include "csprint.h"
 
+
 /* Dummy functions */
 int generate_daemon_event(JCR *jcr, const char *event) { return 1; }
 int generate_job_event(JCR *jcr, const char *event) { return 1; }
index de89f16c64c8cbe31d6ecee88ed4d3d69fb256ad..61b0a16bc9eba5094a7469da7c38a2ab27606b23 100644 (file)
@@ -7,7 +7,7 @@
  *    Version $Id$
  */
 /*
-   Copyright (C) 2004-2005 Kern Sibbald
+   Copyright (C) 2004-2006 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License
  */
 
 #include "bacula.h"
-
 #include "wxbconfigfileeditor.h"
-
 #include <wx/file.h>
 #include <wx/filename.h>
 
+
 enum
 {
    Save = 1,
index 10061b16d6d48358e1728b91110d74f94a38bccf..2476fafaef02dec80ff3e14208d6785ea99a3a05 100644 (file)
@@ -7,21 +7,18 @@
  *    Version $Id$
  */
 /*
-   Copyright (C) 2004 Kern Sibbald and John Walker
+   Copyright (C) 2004-2006 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License
-   as published by the Free Software Foundation; either version 2
-   of the License, or (at your option) any later version.
+   version 2 as amended with additional clauses defined in the
+   file LICENSE in the main source directory.
 
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
+   the file LICENSE for additional details.
 
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  */
 
 #include "wx/wxprec.h"
@@ -32,8 +29,8 @@
 
 class wxbConfigFileEditor : public wxDialog {
 public:
-       wxbConfigFileEditor(wxWindow* parent, wxString filename);
-       virtual ~wxbConfigFileEditor();
+        wxbConfigFileEditor(wxWindow* parent, wxString filename);
+        virtual ~wxbConfigFileEditor();
 private:
    wxString filename;
 
index 3e35dca3e576f313090b24a310619682d433873b..b378896a689e3a7869d403e3a9ef4cbd3c194c5b 100644 (file)
@@ -7,7 +7,7 @@
  *    Version $Id$
  */
 /*
-   Copyright (C) 2004-2005 Kern Sibbald
+   Copyright (C) 2004-2006 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License
  */
 
 #include "bacula.h"
-
 #include "wxbconfigpanel.h"
-
 #include <wx/arrimpl.cpp>
 
+
 WX_DEFINE_OBJARRAY(wxbConfig);
 
 /* Create a new config parameter */
index bcbe1d39a779cf76d78966e1eca338fbf8a24d67..5b6fa24b6e4630b426516707b0245d20477997d4 100644 (file)
@@ -7,21 +7,18 @@
  *    Version $Id$
  */
 /*
-   Copyright (C) 2004 Kern Sibbald and John Walker
+   Copyright (C) 2004-2006 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License
-   as published by the Free Software Foundation; either version 2
-   of the License, or (at your option) any later version.
+   version 2 as amended with additional clauses defined in the
+   file LICENSE in the main source directory.
 
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
+   the file LICENSE for additional details.
 
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  */
 
 #ifndef WXBCONFIGPANEL_H
@@ -82,8 +79,8 @@ WX_DECLARE_OBJARRAY(wxbConfigParam, wxbConfig);
 class wxbConfigPanel : public wxPanel {
 public:
    /* Creates a new config panel, config must be allocated with new */
-       wxbConfigPanel(wxWindow* parent, wxbConfig* config, wxString title, wxWindowID ok, wxWindowID cancel, wxWindowID apply = -1);
-       ~wxbConfigPanel();
+        wxbConfigPanel(wxWindow* parent, wxbConfig* config, wxString title, wxWindowID ok, wxWindowID cancel, wxWindowID apply = -1);
+        ~wxbConfigPanel();
 
    void SetRowString(const wxChar* title, wxString value);
    wxString GetRowString(const wxChar* title);
index 88da7d80a0f85d4357d5a7acc9fa74fc8d5dcd52..e55b9c2b9be6d91096e7fea7c1fd7c922d249e43 100644 (file)
@@ -7,7 +7,7 @@
  *    Version $Id$
  */
 /*
-   Copyright (C) 2004-2005 Kern Sibbald
+   Copyright (C) 2004-2006 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License
@@ -22,7 +22,6 @@
  */
 
 #include "bacula.h"
-
 #include "wxbhistorytextctrl.h"
 
 BEGIN_EVENT_TABLE(wxbHistoryTextCtrl, wxTextCtrl)
index 7a874f9a7bd132ff5928b46110065f2c9bd09a8c..01ead6e01fae5e025bb4b3b5affccd44c38af959 100644 (file)
@@ -7,21 +7,18 @@
  *    Version $Id$
  */
 /*
-   Copyright (C) 2004 Kern Sibbald and John Walker
+   Copyright (C) 2004-2006 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License
-   as published by the Free Software Foundation; either version 2
-   of the License, or (at your option) any later version.
+   version 2 as amended with additional clauses defined in the
+   file LICENSE in the main source directory.
 
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
+   the file LICENSE for additional details.
 
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  */
 
 #ifndef WXBHISTORYTEXTCTRL
@@ -41,10 +38,10 @@ WX_DECLARE_STRING_HASH_MAP( wxString, wxbCommands );
 class wxbHistoryTextCtrl: public wxTextCtrl {
    public:
       wxbHistoryTextCtrl(wxStaticText* help, wxWindow* parent, wxWindowID id,
-        const wxString& value = wxT(""), const wxPoint& pos = wxDefaultPosition,
-        const wxSize& size = wxDefaultSize,
-        const wxValidator& validator = wxDefaultValidator,
-        const wxString& name = wxTextCtrlNameStr);
+         const wxString& value = wxT(""), const wxPoint& pos = wxDefaultPosition,
+         const wxSize& size = wxDefaultSize,
+         const wxValidator& validator = wxDefaultValidator,
+         const wxString& name = wxTextCtrlNameStr);
 
       void HistoryAdd(wxString cmd);
 
index b0beb57b526fda231d28533a1579f88639f4b0eb..ddfd79b6ba2421fdb6e44951e794932569deaee0 100644 (file)
@@ -8,7 +8,7 @@
  *    Version $Id$
  */
 /*
-   Copyright (C) 2004-2005 Kern Sibbald
+   Copyright (C) 2004-2006 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License
@@ -25,7 +25,6 @@
 #include "bacula.h"
 
 #include "wxblistctrl.h"
-
 #include "csprint.h"
 #include "wxbmainframe.h"
 
index f7f9950978f050e5f5fe9710a3a6ae7a483fd305..4146e2f6a38a75878546ff54e061327fce65ab2b 100644 (file)
@@ -8,21 +8,18 @@
  *    Version $Id$
  */
 /*
-   Copyright (C) 2004 Kern Sibbald and John Walker
+   Copyright (C) 2004-2006 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License
-   as published by the Free Software Foundation; either version 2
-   of the License, or (at your option) any later version.
+   version 2 as amended with additional clauses defined in the
+   file LICENSE in the main source directory.
 
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
+   the file LICENSE for additional details.
 
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  */
 
 #ifndef WXBLISTCTRL_H
@@ -54,9 +51,9 @@ typedef void (wxEvtHandler::*wxListMarkedEventFunction)(wxbListMarkedEvent&);
 
 #define EVT_LIST_MARKED_EVENT(id, fn) \
     DECLARE_EVENT_TABLE_ENTRY( \
-       wxbLIST_MARKED_EVENT, id, wxID_ANY, \
-       (wxObjectEventFunction)(wxEventFunction)(wxListMarkedEventFunction)&fn, \
-       (wxObject *) NULL \
+        wxbLIST_MARKED_EVENT, id, wxID_ANY, \
+        (wxObjectEventFunction)(wxEventFunction)(wxListMarkedEventFunction)&fn, \
+        (wxObject *) NULL \
     ),
 
 /* Customized list, which transmit double clicks on images */
index 61a25cde12610547b9b44cdf2bf36d3572b991b3..e33f8a42e5779c97cf01f415f866d94d9cba5220 100644 (file)
@@ -7,7 +7,7 @@
  *    Version $Id$
  */
 /*
-   Copyright (C) 2004-2005 Kern Sibbald
+   Copyright (C) 2004-2006 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License
index f3d8fbfb484af9c7e41f59eb7f33d7e2c469bdd3..90b4a0756ff96aad94886d8e8a8a4dabdb23410b 100644 (file)
@@ -7,21 +7,18 @@
  *    Version $Id$
  */
 /*
-   Copyright (C) 2004 Kern Sibbald and John Walker
+   Copyright (C) 2004-2006 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License
-   as published by the Free Software Foundation; either version 2
-   of the License, or (at your option) any later version.
+   version 2 as amended with additional clauses defined in the
+   file LICENSE in the main source directory.
 
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
+   the file LICENSE for additional details.
 
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  */
 
 #ifndef WXBMAINFRAME_H
@@ -62,13 +59,13 @@ class wxbPrintObject: public wxObject {
       wxString str;
       int status;
       wxbPrintObject(wxString str, int status): wxObject() {
-        this->str = str;
-        this->status = status;
+         this->str = str;
+         this->status = status;
       }
 
       wxbPrintObject(const wxbPrintObject& pe) {
-        this->str = pe.str;
-        this->status = pe.status;
+         this->str = pe.str;
+         this->status = pe.status;
       }
 };
 
index 97d37dc156e6fce53dcb8024b1320cf8ef4c910f..cbbf55894bc18c26f7ce3beadea6cfac9635d3f5 100644 (file)
@@ -7,7 +7,7 @@
  *    Version $Id$
  */
 /*
-   Copyright (C) 2004-2005 Kern Sibbald
+   Copyright (C) 2004-2006 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License
@@ -50,22 +50,15 @@ Select parameter to modify (1-11):
        */
 
 #include "bacula.h"
-
 #include "wxbrestorepanel.h"
-
 #include "wxbmainframe.h"
-
 #include "csprint.h"
-
 #include <wx/choice.h>
 #include <wx/datetime.h>
-
 #include <wx/timer.h>
-
 #include "unmarked.xpm"
 #include "marked.xpm"
 #include "partmarked.xpm"
-
 #include <wx/listimpl.cpp>
 
 /* A macro named Yield is defined under MinGW */
@@ -196,7 +189,8 @@ END_EVENT_TABLE()
 /*
  *  wxbRestorePanel constructor
  */
-wxbRestorePanel::wxbRestorePanel(wxWindow* parent): wxbPanel(parent) {
+wxbRestorePanel::wxbRestorePanel(wxWindow* parent): wxbPanel(parent) 
+{
    //pendingEvents = new wxbEventList(); //EVTQUEUE
    //processing = false; //EVTQUEUE
    SetWorking(false);
@@ -374,7 +368,8 @@ wxbRestorePanel::wxbRestorePanel(wxWindow* parent): wxbPanel(parent) {
 /*
  *  wxbRestorePanel destructor
  */
-wxbRestorePanel::~wxbRestorePanel() {
+wxbRestorePanel::~wxbRestorePanel() 
+{
    delete imagelist;
 }
 
@@ -382,17 +377,18 @@ wxbRestorePanel::~wxbRestorePanel() {
    wxbPanel overloadings
   ----------------------------------------------------------------------------*/
 
-wxString wxbRestorePanel::GetTitle() {
+wxString wxbRestorePanel::GetTitle() 
+{
    return _("Restore");
 }
 
-void wxbRestorePanel::EnablePanel(bool enable) {
+void wxbRestorePanel::EnablePanel(bool enable) 
+{
    if (enable) {
       if (status == disabled) {
          SetStatus(activable);
       }
-   }
-   else {
+   } else {
       SetStatus(disabled);
    }
 }
@@ -402,7 +398,8 @@ void wxbRestorePanel::EnablePanel(bool enable) {
   ----------------------------------------------------------------------------*/
 
 /* The main button has been clicked */
-void wxbRestorePanel::CmdStart() {
+void wxbRestorePanel::CmdStart() 
+{
    unsigned int i;
    if (status == activable) {
       wxbMainFrame::GetInstance()->SetStatusText(_("Getting parameters list."));
@@ -1399,7 +1396,8 @@ void wxbRestorePanel::CmdMark(wxTreeItemId treeitem, long* listitems, int listsi
   ----------------------------------------------------------------------------*/
 
 /* Run a dir command, and waits until result is fully received. */
-void wxbRestorePanel::UpdateTreeItem(wxTreeItemId item, bool updatelist, bool recurse) {
+void wxbRestorePanel::UpdateTreeItem(wxTreeItemId item, bool updatelist, bool recurse)
+{
 //   this->updatelist = updatelist;
    wxbDataTokenizer* dt;
 
@@ -1491,7 +1489,8 @@ void wxbRestorePanel::UpdateTreeItem(wxTreeItemId item, bool updatelist, bool re
 }
 
 /* Parse .dir command results, returns true if the result has been stored in entry, false otherwise. */
-int wxbRestorePanel::ParseList(wxString line, wxbDirEntry* entry) {
+int wxbRestorePanel::ParseList(wxString line, wxbDirEntry* entry) 
+{
    /* See ls_output in dird/ua_tree.c */
    //-rw-r-----,1,root,root,41575,2005-10-18 18:21:36, ,/usr/var/bacula/working/bacula.sql
 
@@ -1536,7 +1535,7 @@ int wxbRestorePanel::ParseList(wxString line, wxbDirEntry* entry) {
    
    if (!tkz.HasMoreTokens())
       return false;
-   entry->fullname = tkz.GetNextToken();
+   entry->fullname = tkz.GetString();
    
    /* Get only the filename (cut path by finding the last '/') */
    if (entry->fullname.GetChar(entry->fullname.Length()-1) == '/') {
@@ -1552,7 +1551,8 @@ int wxbRestorePanel::ParseList(wxString line, wxbDirEntry* entry) {
 }
 
 /* Sets a list item state, and update its parents and children if it is a directory */
-void wxbRestorePanel::SetListItemState(long listitem, int newstate) {
+void wxbRestorePanel::SetListItemState(long listitem, int newstate) 
+{
    wxbTreeItemData* itemdata = (wxbTreeItemData*)list->GetItemData(listitem);
    
    wxTreeItemId treeitem;
index 007a7b25a1dad58854acf33eafd8edca09d1576c..57dc2cd827468495b0f3a5c352e076ed9962dcbb 100644 (file)
@@ -7,7 +7,7 @@
  *    Version $Id$
  */
 /*
-   Copyright (C) 2004-2005 Kern Sibbald
+   Copyright (C) 2004-2006 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License
index 3857fdfcc256c7781ffe9e21ee68ba07aa5b2dcb..622b17032050eea48ffa4a8c20aab2e3ebe6cd42 100644 (file)
@@ -14,7 +14,7 @@
  *    Version $Id$
  */
 /*
-   Copyright (C) 2004-2005 Kern Sibbald
+   Copyright (C) 2004-2006 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License
index 1e2b8cb208479c1a9ea4c01bfd7c820ca57186dc..8726d0415bc65971b2c5bac91866991af6426ba7 100644 (file)
  *    Version $Id$
  */
 /*
-   Copyright (C) 2004 Kern Sibbald and John Walker
+   Copyright (C) 2000-2006 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License
-   as published by the Free Software Foundation; either version 2
-   of the License, or (at your option) any later version.
+   version 2 as amended with additional clauses defined in the
+   file LICENSE in the main source directory.
 
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
+   the file LICENSE for additional details.
 
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  */
 
 #ifndef WXBTABLEPARSER_H
index e6b4fc113ce16337e8e0d5a1ce755f9342ba6664..b972e9e1ae750eb7c3ff70c7e1096cc46d603140 100644 (file)
@@ -8,7 +8,7 @@
  *    Version $Id$
  */
 /*
-   Copyright (C) 2004-2005 Kern Sibbald
+   Copyright (C) 2004-2006 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License
index c1b3ebd6ec6330f354deaaf9103c14758004c896..f3dcfcee13f30c2bcfe58309e122d56b78d4d63b 100644 (file)
@@ -8,21 +8,18 @@
  *    Version $Id$
  */
 /*
-   Copyright (C) 2004 Kern Sibbald and John Walker
+   Copyright (C) 2004-2006 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License
-   as published by the Free Software Foundation; either version 2
-   of the License, or (at your option) any later version.
+   version 2 as amended with additional clauses defined in the
+   file LICENSE in the main source directory.
 
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
+   the file LICENSE for additional details.
 
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  */
 
 #ifndef WXBTREECTRL_H
@@ -57,9 +54,9 @@ typedef void (wxEvtHandler::*wxTreeMarkedEventFunction)(wxbTreeMarkedEvent&);
 
 #define EVT_TREE_MARKED_EVENT(id, fn) \
     DECLARE_EVENT_TABLE_ENTRY( \
-       wxbTREE_MARKED_EVENT, id, wxID_ANY, \
-       (wxObjectEventFunction)(wxEventFunction)(wxTreeMarkedEventFunction)&fn, \
-       (wxObject *) NULL \
+        wxbTREE_MARKED_EVENT, id, wxID_ANY, \
+        (wxObjectEventFunction)(wxEventFunction)(wxTreeMarkedEventFunction)&fn, \
+        (wxObject *) NULL \
     ),
 
 /* Customized tree, which transmit double clicks on images */
index 7af8e1a8bf3369cc508c15d964a70b12a42dd066..dbcd3b61cda91387a1fee9159a1b2922619db8ab 100644 (file)
@@ -7,7 +7,7 @@
  *    Version $Id$
  */
 /*
-   Copyright (C) 2004-2005 Kern Sibbald
+   Copyright (C) 2004-2006 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License
index f7cb4ed60919b66542f5dd5201de64e687565b00..b7819a39c812650227263d65732ec14ad322f59f 100644 (file)
@@ -8,21 +8,18 @@
  *   Version $Id$
  */
 /*
-   Copyright (C) 2004 Kern Sibbald and John Walker
+   Copyright (C) 2004-2006 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License
-   as published by the Free Software Foundation; either version 2
-   of the License, or (at your option) any later version.
+   version 2 as amended with additional clauses defined in the
+   file LICENSE in the main source directory.
 
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
+   the file LICENSE for additional details.
 
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  */
 
 #ifndef WXBUTILS_H
index 60433e77e042d2212cd792212ff646e4f63fbf0f..ab1c6345f7a83d94a3da627689f5e3138bb9d8c0 100644 (file)
@@ -1,6 +1,14 @@
               Technical notes on version 1.39  
 
 General:
+25Aug06
+kes  wx-console crashes because of differences between Bacula and wxWidgets
+     malloc()/free().  Tweek wx-console to use bmalloc()/bfree() for Bacula
+     calls.     
+kes  correct improper indenting in wx-console/console_conf.c
+kes  update wx-console header copyrights
+kes  Fix bug #658 where wx-console mangles file/directory names containing
+     commas.
 24Aug06
 kes  Add Media.Enabled flag to client backups for dotcmds.c
 kes  Enforce Media.Enabled=1 for a current restore to work.