]> git.sur5r.net Git - bacula/bacula/commitdiff
kes Apply doc fix from bug #1062.
authorKern Sibbald <kern@sibbald.com>
Tue, 18 Mar 2008 19:45:26 +0000 (19:45 +0000)
committerKern Sibbald <kern@sibbald.com>
Tue, 18 Mar 2008 19:45:26 +0000 (19:45 +0000)
kes  Resolve crash and improper restore wx-console Win32 restore
     GUI. Fixes bug #1065.
kes  Update Win32 wxWidgets to latest version.
kes  Attempt to do correct handling of Win32 mount points. Should
     fix bug #1046.
kes  Fix Win32 FD backup/restore memory leak due to improper termination
     of BackupRead/Write. This fixes bug# 1038.

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

20 files changed:
bacula/src/baconfig.h
bacula/src/filed/restore.c
bacula/src/findlib/attribs.c
bacula/src/findlib/bfile.c
bacula/src/findlib/create_file.c
bacula/src/findlib/enable_priv.c
bacula/src/findlib/mkpath.c
bacula/src/findlib/savecwd.c
bacula/src/win32/filed/vss_generic.cpp
bacula/src/win32/installer/Makefile
bacula/src/win32/installer/build-installer.cmd
bacula/src/win32/installer/winbacula.nsi
bacula/src/win32/libwin32/main.cpp
bacula/src/win32/wx-console/wx-console.vcproj
bacula/src/wx-console/wxbconfigpanel.cpp
bacula/src/wx-console/wxbconfigpanel.h
bacula/src/wx-console/wxbrestorepanel.cpp
bacula/src/wx-console/wxbutils.cpp
bacula/src/wx-console/wxbutils.h
bacula/technotes-2.3

index e54b08ed67dc1f42be2a9730d82f921ba7ca57b5..00f0a4c928d0c1e0a26f2d1052f05a3f71b3bd6b 100644 (file)
@@ -651,6 +651,9 @@ inline bool IsPathSeparator(int ch) { return ch == '/' || ch == '\\'; }
 inline char *first_path_separator(char *path) { return strpbrk(path, "/\\"); }
 inline const char *first_path_separator(const char *path) { return strpbrk(path, "/\\"); }
 
+extern void pause_msg(const char *file, const char *func, int line, const char *msg);
+#define pause(msg) if (debug_level) pause_msg(__FILE__, __func__, __LINE__, (msg))
+
 #else
 #define PathSeparator '/'
 /* Define Winsock functions if we aren't on Windows */
@@ -661,6 +664,7 @@ inline const char *first_path_separator(const char *path) { return strpbrk(path,
 inline bool IsPathSeparator(int ch) { return ch == '/'; }
 inline char *first_path_separator(char *path) { return strchr(path, '/'); }
 inline const char *first_path_separator(const char *path) { return strchr(path, '/'); }
+#define pause(msg)
 #endif
 
 
index 0a0aa6a25e8c6103e6f871c46078398c9c6d1058..299b78f9e2a5b33902fbe92add40c289f14028d2 100644 (file)
@@ -320,10 +320,10 @@ void do_restore(JCR *jcr)
             bclose(&rctx.bfd);
          }
 
-        /* TODO: manage deleted files */
-        if (rctx.type == FT_DELETED) { /* deleted file */
-           continue;
-        }
+         /* TODO: manage deleted files */
+         if (rctx.type == FT_DELETED) { /* deleted file */
+            continue;
+         }
 
          /*
           * Unpack attributes and do sanity check them
@@ -1114,7 +1114,6 @@ int32_t extract_data(JCR *jcr, BFILE *bfd, POOLMEM *buf, int32_t buflen,
        * packet length may be re-read by unser_crypto_packet_len() */
       cipher_ctx->packet_len = 0;
    }
-
    return wsize;
 }
 
index 275d196393034efbc0fd92cd4ae98ca6d6abf0df..286944434aba4b5a092e643dca91da5f8034c8ac 100644 (file)
@@ -376,7 +376,7 @@ bool set_attributes(JCR *jcr, ATTR *attr, BFILE *ofd)
    mode_t old_mask;
    bool ok = true;
    boffset_t fsize;
-
    if (uid_set) {
       my_uid = getuid();
       my_gid = getgid();
@@ -626,8 +626,9 @@ static bool set_win32_attributes(JCR *jcr, ATTR *attr, BFILE *ofd)
    POOLMEM *win32_ofile;
 
    // if we have neither ansi nor wchar version, we leave
-   if (!(p_SetFileAttributesW || p_SetFileAttributesA))
+   if (!(p_SetFileAttributesW || p_SetFileAttributesA)) {
       return false;
+   }
 
    if (!p || !*p) {                   /* we should have attributes */
       Dmsg2(100, "Attributes missing. of=%s ofd=%d\n", attr->ofname, ofd->fid);
@@ -686,10 +687,9 @@ static bool set_win32_attributes(JCR *jcr, ATTR *attr, BFILE *ofd)
    }
 
    Dmsg1(100, "SetFileAtts %s\n", attr->ofname);
-   if (!(atts.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) 
-   {
+   if (!(atts.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) {
       if (p_SetFileAttributesW) {
-         POOLMEM* pwszBuf = get_pool_memory (PM_FNAME);   
+         POOLMEM* pwszBuf = get_pool_memory(PM_FNAME);   
          make_win32_path_UTF8_2_wchar(&pwszBuf, attr->ofname);
 
          BOOL b=p_SetFileAttributesW((LPCWSTR)pwszBuf, atts.dwFileAttributes & SET_ATTRS);
index f5c961a419831f8a17283cc5d4ae22756e1fa835..10f867439b73546e6ea6fdb603328161a8285bbd 100644 (file)
@@ -54,6 +54,18 @@ boffset_t (*plugin_blseek)(JCR *jcr, boffset_t offset, int whence) = NULL;
 #define fdatasync(fd)
 #endif
 
+#ifdef HAVE_WIN32
+void pause_msg(const char *file, const char *func, int line, const char *msg)
+{
+   char buf[1000];
+   if (msg) {
+      bsnprintf(buf, sizeof(buf), "%s:%s:%d %s", file, func, line, msg);
+   } else {
+      bsnprintf(buf, sizeof(buf), "%s:%s:%d", file, func, line);
+   }
+   MessageBox(NULL, buf, "Pause", MB_OK);
+}
+#endif
 
 /* ===============================================================
  *
@@ -140,16 +152,16 @@ void int64_LE2BE(int64_t* pBE, const int64_t v)
 {
    /* convert little endian to big endian */
    if (htonl(1) != 1L) { /* no work if on little endian machine */
-           memcpy(pBE, &v, sizeof(int64_t));
+      memcpy(pBE, &v, sizeof(int64_t));
    } else {
-           int i;
-           uint8_t rv[sizeof(int64_t)];
-           uint8_t *pv = (uint8_t *) &v;
-
-           for (i = 0; i < 8; i++) {
-              rv[i] = pv[7 - i];
-           }
-           memcpy(pBE, &rv, sizeof(int64_t));
+      int i;
+      uint8_t rv[sizeof(int64_t)];
+      uint8_t *pv = (uint8_t *) &v;
+
+      for (i = 0; i < 8; i++) {
+         rv[i] = pv[7 - i];
+      }
+      memcpy(pBE, &rv, sizeof(int64_t));
    }    
 }
 
@@ -158,16 +170,16 @@ void int32_LE2BE(int32_t* pBE, const int32_t v)
 {
    /* convert little endian to big endian */
    if (htonl(1) != 1L) { /* no work if on little endian machine */
-           memcpy(pBE, &v, sizeof(int32_t));
+      memcpy(pBE, &v, sizeof(int32_t));
    } else {
-           int i;
-           uint8_t rv[sizeof(int32_t)];
-           uint8_t *pv = (uint8_t *) &v;
-
-           for (i = 0; i < 4; i++) {
-              rv[i] = pv[3 - i];
-           }
-           memcpy(pBE, &rv, sizeof(int32_t));
+      int i;
+      uint8_t rv[sizeof(int32_t)];
+      uint8_t *pv = (uint8_t *) &v;
+
+      for (i = 0; i < 4; i++) {
+         rv[i] = pv[3 - i];
+      }
+      memcpy(pBE, &rv, sizeof(int32_t));
    }    
 }
 
@@ -553,9 +565,14 @@ int bclose(BFILE *bfd)
       goto all_done;
    }
 
+   /*
+    * We need to tell the API to release the buffer it
+    *  allocated in lpContext.  We do so by calling the
+    *  API one more time, but with the Abort bit set.
+    */
    if (bfd->use_backup_api && bfd->mode == BF_READ) {
       BYTE buf[10];
-      if (!bfd->lpContext && !p_BackupRead(bfd->fh,
+      if (bfd->lpContext && !p_BackupRead(bfd->fh,
               buf,                    /* buffer */
               (DWORD)0,               /* bytes to read */
               &bfd->rw_bytes,         /* bytes read */
@@ -567,7 +584,7 @@ int bclose(BFILE *bfd)
       }
    } else if (bfd->use_backup_api && bfd->mode == BF_WRITE) {
       BYTE buf[10];
-      if (!bfd->lpContext && !p_BackupWrite(bfd->fh,
+      if (bfd->lpContext && !p_BackupWrite(bfd->fh,
               buf,                    /* buffer */
               (DWORD)0,               /* bytes to read */
               &bfd->rw_bytes,         /* bytes written */
index 09a645c5bf20235f11ab932f5a938dc8b253863c..2028f475eb7bfd81cae0469e5eee31bf5381c0e7 100644 (file)
@@ -1,7 +1,7 @@
 /*
    Bacula® - The Network Backup Solution
 
-   Copyright (C) 2000-2007 Free Software Foundation Europe e.V.
+   Copyright (C) 2000-2008 Free Software Foundation Europe e.V.
 
    The main author of Bacula is Kern Sibbald, with contributions from
    many others, a complete list can be found in the file AUTHORS.
index fee72ae9c746a5fe3c10fa6f5a628ffa7d949bea..aac1716618ddc2fe1b84439c1bf045b13640474a 100644 (file)
@@ -1,7 +1,7 @@
 /*
    Bacula® - The Network Backup Solution
 
-   Copyright (C) 2003-2007 Free Software Foundation Europe e.V.
+   Copyright (C) 2003-2008 Free Software Foundation Europe e.V.
 
    The main author of Bacula is Kern Sibbald, with contributions from
    many others, a complete list can be found in the file AUTHORS.
index 38308ea575d78f3b101855c3f55b659a66d3b729..9dd67893c9883e735c8cc1dcb0fa6bc8bf5e716e 100644 (file)
@@ -1,7 +1,7 @@
 /*
    Bacula® - The Network Backup Solution
 
-   Copyright (C) 2007-2007 Free Software Foundation Europe e.V.
+   Copyright (C) 2007-2008 Free Software Foundation Europe e.V.
 
    The main author of Bacula is Kern Sibbald, with contributions from
    many others, a complete list can be found in the file AUTHORS.
index 6e8bab867225da5dd62d355809a5ec2559ab91fb..b0cb1e7cb90c7361cb4c4bbbc4df3edc99873c3f 100644 (file)
@@ -1,7 +1,7 @@
 /*
    Bacula® - The Network Backup Solution
 
-   Copyright (C) 2007-2007 Free Software Foundation Europe e.V.
+   Copyright (C) 2007-2008 Free Software Foundation Europe e.V.
 
    The main author of Bacula is Kern Sibbald, with contributions from
    many others, a complete list can be found in the file AUTHORS.
index 96ebcb4dde57aff1860fa2a47932b99fa85f0a3c..54eef600bd9aa7469b026ec89ddd58c545f28430 100644 (file)
@@ -363,7 +363,7 @@ BOOL VSSClientGeneric::WaitAndCheckForAsyncOperation(IVssAsync* pAsync)
       return TRUE;
 
    
-#ifdef DEBUG 
+#ifdef xDEBUG 
    // Check if the async operation succeeded...
    if(hrReturned != VSS_S_ASYNC_FINISHED) {   
       wchar_t *pwszBuffer = NULL;
index f3b904963bed96df2a8ea0464af78022450f8b40..3c0ee400d6c9e6503e8f1ac3278982d18206b60c 100644 (file)
@@ -58,8 +58,8 @@ DEPKGS_BINARIES := \
        dvd+rw-booktype.exe \
        dvd+rw-format.exe \
        dvd+rw-mediainfo.exe \
-       wxbase270_gcc_bacula.dll \
-       wxmsw270_core_gcc_bacula.dll
+       wxbase28_gcc_bacula.dll \
+       wxmsw28_core_gcc_bacula.dll
 
 NONGCC_BINARIES := \
        libmysql.dll
index b4faacddfe12a3a776e567ee204ebac6d5621ff4..385537ea39e1026f623c26e81d7e47c1e4ddd69e 100644 (file)
@@ -12,7 +12,7 @@ SET BACULA_DLLS=bacula.dll cats_mysql.dll cats_postgresql.dll cats_sqlite3.dll
 SET BACULA_EXES=bacula-dir.exe bacula-fd.exe bacula-sd.exe bconsole.exe wx-console.exe\r
 SET BACULA_TOOLS=bcopy.exe bextract.exe bls.exe bscan.exe bsleep.exe bsmtp.exe btape.exe dbcheck.exe scsilist.exe\r
 \r
-SET DEP_DLLS=libeay32.dll pthreadVCE.dll ssleay32.dll zlib1.dll zlib1.dll.manifest wxbase270_vc_bacula.dll wxmsw270_core_vc_bacula.dll libmysql.dll libpq.dll comerr32.dll libintl-2.dll libiconv-2.dll krb5_32.dll\r
+SET DEP_DLLS=libeay32.dll pthreadVCE.dll ssleay32.dll zlib1.dll zlib1.dll.manifest wxbase28_vc_bacula.dll wxmsw28_core_vc_bacula.dll libmysql.dll libpq.dll comerr32.dll libintl-2.dll libiconv-2.dll krb5_32.dll\r
 SET DEP_EXES=openssl.exe loaderinfo.exe mt.exe mtx.exe scsitape.exe sed.exe tapeinfo.exe sqlite3.exe sqlite3.exe.manifest expr64.exe snooze.exe mkisofs.exe growisofs.exe dvd-ram-control.exe dvd+rw-booktype.exe dvd+rw-format.exe dvd+rw-mediainfo.exe\r
 \r
 SET SCRIPTS=mtx-changer.cmd disk-changer.cmd dvd-handler.cmd\r
index ca5216628d2bb07d16ab2c56493e45ce4e7cfced..f360c6dc28a03c66bff4713ff10e9064c8f95605 100644 (file)
@@ -787,16 +787,16 @@ Section "Graphical Console" SecWxConsole
 \r
   Call InstallCommonFiles\r
 !if "${BUILD_TOOLS}" == "VC8"\r
-  File "${SRC_DIR}\wxbase270_vc_bacula.dll"\r
-  File "${SRC_DIR}\wxmsw270_core_vc_bacula.dll"\r
+  File "${SRC_DIR}\wxbase28_vc_bacula.dll"\r
+  File "${SRC_DIR}\wxmsw28_core_vc_bacula.dll"\r
 !endif\r
 !If "${BUILD_TOOLS}" == "VC8_DEBUG"\r
-  File "${SRC_DIR}\wxbase270_vc_bacula.dll"\r
-  File "${SRC_DIR}\wxmsw270_core_vc_bacula.dll"\r
+  File "${SRC_DIR}\wxbase28_vc_bacula.dll"\r
+  File "${SRC_DIR}\wxmsw28_core_vc_bacula.dll"\r
 !endif\r
 !if "${BUILD_TOOLS}" == "MinGW"\r
-  File "${SRC_DIR}\wxbase270_gcc_bacula.dll"\r
-  File "${SRC_DIR}\wxmsw270_core_gcc_bacula.dll"\r
+  File "${SRC_DIR}\wxbase28_gcc_bacula.dll"\r
+  File "${SRC_DIR}\wxmsw28_core_gcc_bacula.dll"\r
 !endif\r
 \r
   File "${SRC_DIR}\bwx-console.exe"\r
index f7451ac97d07597920f10487155e93bf897503f0..447500a5675176c405b587f3bf3453f4f377b4c2 100644 (file)
@@ -1,7 +1,7 @@
 /*
    Bacula® - The Network Backup Solution
 
-   Copyright (C) 2007-2007 Free Software Foundation Europe e.V.
+   Copyright (C) 2007-2008 Free Software Foundation Europe e.V.
 
    The main author of Bacula is Kern Sibbald, with contributions from
    many others, a complete list can be found in the file AUTHORS.
@@ -379,3 +379,15 @@ int BaculaAppMain()
    WSACleanup();
    _exit(0);
 }
+
+
+void pause_msg(const char *file, const char *func, int line, const char *msg)
+{
+   char buf[1000];
+   if (msg) {
+      bsnprintf(buf, sizeof(buf), "%s:%s:%d %s", file, func, line, msg);
+   } else {
+      bsnprintf(buf, sizeof(buf), "%s:%s:%d", file, func, line);
+   }
+   MessageBox(NULL, buf, "Pause", MB_OK);
+}
index ee93c79d5987a0cd95a5adcf171140ce0e04e5bc..bab6aca1689e4ea10d7a8825df1103a1dce82e4a 100644 (file)
 <?xml version="1.0" encoding="Windows-1252"?>\r
 <VisualStudioProject\r
-       ProjectType="Visual C++"\r
-       Version="8.00"\r
-       Name="wx-console"\r
-       ProjectGUID="{9BA8E10D-0D82-4B25-8543-DE34641FBC10}"\r
-       RootNamespace="wx-console"\r
-       >\r
-       <Platforms>\r
-               <Platform\r
-                       Name="Win32"\r
-               />\r
-       </Platforms>\r
-       <ToolFiles>\r
-       </ToolFiles>\r
-       <Configurations>\r
-               <Configuration\r
-                       Name="Debug|Win32"\r
-                       OutputDirectory="$(SolutionDir)$(ConfigurationName)"\r
-                       IntermediateDirectory="$(ConfigurationName)"\r
-                       ConfigurationType="1"\r
-                       CharacterSet="2"\r
-                       DeleteExtensionsOnClean="*.obj;*.ilk;*.tlb;*.tli;*.tlh;*.tmp;*.rsp;*.pgc;*.pgd;$(TargetPath)"\r
-                       >\r
-                       <Tool\r
-                               Name="VCPreBuildEventTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCCustomBuildTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCXMLDataGeneratorTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCWebServiceProxyGeneratorTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCMIDLTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCCLCompilerTool"\r
-                               Optimization="0"\r
-                               AdditionalIncludeDirectories="../compat;../../../../depkgs-msvc/include;../..;../../../../depkgs-msvc/lib/wx_dll/msw"\r
-                               PreprocessorDefinitions="WIN32;_WINDOWS;wxUSE_GUI;WXUSINGDLL;__WXMSW__;_CONSOLE;HAVE_WIN32;HAVE_WXCONSOLE;USING_DLL;_STAT_H;_STAT_DEFINED;_USE_32BIT_TIME_T;_WIN32_WINNT=0x0500;_CRT_SECURE_NO_DEPRECATE"\r
-                               MinimalRebuild="true"\r
-                               BasicRuntimeChecks="3"\r
-                               RuntimeLibrary="3"\r
-                               UsePrecompiledHeader="0"\r
-                               BrowseInformation="1"\r
-                               WarningLevel="3"\r
-                               SuppressStartupBanner="true"\r
-                               Detect64BitPortabilityProblems="false"\r
-                               DebugInformationFormat="4"\r
-                       />\r
-                       <Tool\r
-                               Name="VCManagedResourceCompilerTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCResourceCompilerTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCPreLinkEventTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCLinkerTool"\r
-                               AdditionalDependencies="wxmsw27_core.lib wxbase27.lib pthreadVCE.lib zlib.lib wsock32.lib comctl32.lib rpcrt4.lib atlsd.lib"\r
-                               LinkIncremental="2"\r
-                               AdditionalLibraryDirectories="../../../../depkgs-msvc/lib;../../../../depkgs-msvc/lib/wx_dll"\r
-                               GenerateDebugInformation="true"\r
-                               SubSystem="2"\r
-                               TargetMachine="1"\r
-                       />\r
-                       <Tool\r
-                               Name="VCALinkTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCManifestTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCXDCMakeTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCBscMakeTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCFxCopTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCAppVerifierTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCWebDeploymentTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCPostBuildEventTool"\r
-                       />\r
-               </Configuration>\r
-               <Configuration\r
-                       Name="Release|Win32"\r
-                       OutputDirectory="$(SolutionDir)$(ConfigurationName)"\r
-                       IntermediateDirectory="$(ConfigurationName)"\r
-                       ConfigurationType="1"\r
-                       CharacterSet="2"\r
-                       DeleteExtensionsOnClean="*.obj;*.ilk;*.tlb;*.tli;*.tlh;*.tmp;*.rsp;*.pgc;*.pgd;$(TargetPath)"\r
-                       WholeProgramOptimization="1"\r
-                       >\r
-                       <Tool\r
-                               Name="VCPreBuildEventTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCCustomBuildTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCXMLDataGeneratorTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCWebServiceProxyGeneratorTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCMIDLTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCCLCompilerTool"\r
-                               AdditionalIncludeDirectories="../compat;../../../../depkgs-msvc/include;../..;../../../../depkgs-msvc\lib\wx_dll\msw"\r
-                               PreprocessorDefinitions="NDEBUG;_WINDOWS;wxUSE_GUI;WXUSINGDLL;__WXMSW__;HAVE_WIN32;HAVE_WXCONSOLE;USING_DLL;_STAT_H;_STAT_DEFINED;_USE_32BIT_TIME_T;_WIN32_WINNT=0x0500;_CRT_SECURE_NO_DEPRECATE"\r
-                               RuntimeLibrary="2"\r
-                               UsePrecompiledHeader="0"\r
-                               BrowseInformation="1"\r
-                               WarningLevel="3"\r
-                               Detect64BitPortabilityProblems="false"\r
-                               DebugInformationFormat="3"\r
-                       />\r
-                       <Tool\r
-                               Name="VCManagedResourceCompilerTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCResourceCompilerTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCPreLinkEventTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCLinkerTool"\r
-                               AdditionalDependencies="wxmsw27_core.lib wxbase27.lib pthreadVCE.lib zlib.lib wsock32.lib comctl32.lib rpcrt4.lib atls.lib"\r
-                               LinkIncremental="0"\r
-                               AdditionalLibraryDirectories="&quot;../../../../depkgs-msvc/lib&quot;;&quot;../../../../depkgs-msvc/lib/wx_dll&quot;"\r
-                               IgnoreDefaultLibraryNames=""\r
-                               GenerateDebugInformation="true"\r
-                               SubSystem="2"\r
-                               OptimizeReferences="2"\r
-                               EnableCOMDATFolding="2"\r
-                               TargetMachine="1"\r
-                       />\r
-                       <Tool\r
-                               Name="VCALinkTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCManifestTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCXDCMakeTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCBscMakeTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCFxCopTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCAppVerifierTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCWebDeploymentTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCPostBuildEventTool"\r
-                       />\r
-               </Configuration>\r
-       </Configurations>\r
-       <References>\r
-       </References>\r
-       <Files>\r
-               <Filter\r
-                       Name="Header Files"\r
-                       Filter="h;hpp;hxx;hm;inl;inc;xsd"\r
-                       UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"\r
-                       >\r
-                       <File\r
-                               RelativePath="..\..\wx-console\console_conf.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\wx-console\console_thread.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\wx-console\csprint.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\w32api.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\wx-console\wx-console_private.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\wx-console\wxbconfigfileeditor.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\wx-console\wxbconfigpanel.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\wx-console\wxbhistorytextctrl.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\wx-console\wxblistctrl.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\wx-console\wxbmainframe.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\wx-console\wxbrestorepanel.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\wx-console\wxbtableparser.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\wx-console\wxbtreectrl.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\wx-console\wxbutils.h"\r
-                               >\r
-                       </File>\r
-               </Filter>\r
-               <Filter\r
-                       Name="Resource Files"\r
-                       Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"\r
-                       UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"\r
-                       >\r
-                       <File\r
-                               RelativePath=".\wx-console.manifest"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\wx-console\wx-console_private.rc"\r
-                               >\r
-                       </File>\r
-               </Filter>\r
-               <Filter\r
-                       Name="Source Files"\r
-                       Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"\r
-                       UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"\r
-                       >\r
-                       <File\r
-                               RelativePath="..\..\wx-console\authenticate.c"\r
-                               >\r
-                               <FileConfiguration\r
-                                       Name="Debug|Win32"\r
-                                       >\r
-                                       <Tool\r
-                                               Name="VCCLCompilerTool"\r
-                                               CompileAs="2"\r
-                                       />\r
-                               </FileConfiguration>\r
-                               <FileConfiguration\r
-                                       Name="Release|Win32"\r
-                                       >\r
-                                       <Tool\r
-                                               Name="VCCLCompilerTool"\r
-                                               CompileAs="2"\r
-                                       />\r
-                               </FileConfiguration>\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\wx-console\console_conf.c"\r
-                               >\r
-                               <FileConfiguration\r
-                                       Name="Debug|Win32"\r
-                                       >\r
-                                       <Tool\r
-                                               Name="VCCLCompilerTool"\r
-                                               CompileAs="2"\r
-                                       />\r
-                               </FileConfiguration>\r
-                               <FileConfiguration\r
-                                       Name="Release|Win32"\r
-                                       >\r
-                                       <Tool\r
-                                               Name="VCCLCompilerTool"\r
-                                               CompileAs="2"\r
-                                       />\r
-                               </FileConfiguration>\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\wx-console\console_thread.cpp"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\wx-console\main.cpp"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\wx-console\wxbconfigfileeditor.cpp"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\wx-console\wxbconfigpanel.cpp"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\wx-console\wxbhistorytextctrl.cpp"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\wx-console\wxblistctrl.cpp"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\wx-console\wxbmainframe.cpp"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\wx-console\wxbrestorepanel.cpp"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\wx-console\wxbtableparser.cpp"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\wx-console\wxbtreectrl.cpp"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\wx-console\wxbutils.cpp"\r
-                               >\r
-                       </File>\r
-               </Filter>\r
-       </Files>\r
-       <Globals>\r
-       </Globals>\r
+        ProjectType="Visual C++"\r
+        Version="8.00"\r
+        Name="wx-console"\r
+        ProjectGUID="{9BA8E10D-0D82-4B25-8543-DE34641FBC10}"\r
+        RootNamespace="wx-console"\r
+        >\r
+        <Platforms>\r
+                <Platform\r
+                        Name="Win32"\r
+                />\r
+        </Platforms>\r
+        <ToolFiles>\r
+        </ToolFiles>\r
+        <Configurations>\r
+                <Configuration\r
+                        Name="Debug|Win32"\r
+                        OutputDirectory="$(SolutionDir)$(ConfigurationName)"\r
+                        IntermediateDirectory="$(ConfigurationName)"\r
+                        ConfigurationType="1"\r
+                        CharacterSet="2"\r
+                        DeleteExtensionsOnClean="*.obj;*.ilk;*.tlb;*.tli;*.tlh;*.tmp;*.rsp;*.pgc;*.pgd;$(TargetPath)"\r
+                        >\r
+                        <Tool\r
+                                Name="VCPreBuildEventTool"\r
+                        />\r
+                        <Tool\r
+                                Name="VCCustomBuildTool"\r
+                        />\r
+                        <Tool\r
+                                Name="VCXMLDataGeneratorTool"\r
+                        />\r
+                        <Tool\r
+                                Name="VCWebServiceProxyGeneratorTool"\r
+                        />\r
+                        <Tool\r
+                                Name="VCMIDLTool"\r
+                        />\r
+                        <Tool\r
+                                Name="VCCLCompilerTool"\r
+                                Optimization="0"\r
+                                AdditionalIncludeDirectories="../compat;../../../../depkgs-msvc/include;../..;../../../../depkgs-msvc/lib/wx_dll/msw"\r
+                                PreprocessorDefinitions="WIN32;_WINDOWS;wxUSE_GUI;WXUSINGDLL;__WXMSW__;_CONSOLE;HAVE_WIN32;HAVE_WXCONSOLE;USING_DLL;_STAT_H;_STAT_DEFINED;_USE_32BIT_TIME_T;_WIN32_WINNT=0x0500;_CRT_SECURE_NO_DEPRECATE"\r
+                                MinimalRebuild="true"\r
+                                BasicRuntimeChecks="3"\r
+                                RuntimeLibrary="3"\r
+                                UsePrecompiledHeader="0"\r
+                                BrowseInformation="1"\r
+                                WarningLevel="3"\r
+                                SuppressStartupBanner="true"\r
+                                Detect64BitPortabilityProblems="false"\r
+                                DebugInformationFormat="4"\r
+                        />\r
+                        <Tool\r
+                                Name="VCManagedResourceCompilerTool"\r
+                        />\r
+                        <Tool\r
+                                Name="VCResourceCompilerTool"\r
+                        />\r
+                        <Tool\r
+                                Name="VCPreLinkEventTool"\r
+                        />\r
+                        <Tool\r
+                                Name="VCLinkerTool"\r
+                                AdditionalDependencies="wxmsw28_core.lib wxbase27.lib pthreadVCE.lib zlib.lib wsock32.lib comctl32.lib rpcrt4.lib atlsd.lib"\r
+                                LinkIncremental="2"\r
+                                AdditionalLibraryDirectories="../../../../depkgs-msvc/lib;../../../../depkgs-msvc/lib/wx_dll"\r
+                                GenerateDebugInformation="true"\r
+                                SubSystem="2"\r
+                                TargetMachine="1"\r
+                        />\r
+                        <Tool\r
+                                Name="VCALinkTool"\r
+                        />\r
+                        <Tool\r
+                                Name="VCManifestTool"\r
+                        />\r
+                        <Tool\r
+                                Name="VCXDCMakeTool"\r
+                        />\r
+                        <Tool\r
+                                Name="VCBscMakeTool"\r
+                        />\r
+                        <Tool\r
+                                Name="VCFxCopTool"\r
+                        />\r
+                        <Tool\r
+                                Name="VCAppVerifierTool"\r
+                        />\r
+                        <Tool\r
+                                Name="VCWebDeploymentTool"\r
+                        />\r
+                        <Tool\r
+                                Name="VCPostBuildEventTool"\r
+                        />\r
+                </Configuration>\r
+                <Configuration\r
+                        Name="Release|Win32"\r
+                        OutputDirectory="$(SolutionDir)$(ConfigurationName)"\r
+                        IntermediateDirectory="$(ConfigurationName)"\r
+                        ConfigurationType="1"\r
+                        CharacterSet="2"\r
+                        DeleteExtensionsOnClean="*.obj;*.ilk;*.tlb;*.tli;*.tlh;*.tmp;*.rsp;*.pgc;*.pgd;$(TargetPath)"\r
+                        WholeProgramOptimization="1"\r
+                        >\r
+                        <Tool\r
+                                Name="VCPreBuildEventTool"\r
+                        />\r
+                        <Tool\r
+                                Name="VCCustomBuildTool"\r
+                        />\r
+                        <Tool\r
+                                Name="VCXMLDataGeneratorTool"\r
+                        />\r
+                        <Tool\r
+                                Name="VCWebServiceProxyGeneratorTool"\r
+                        />\r
+                        <Tool\r
+                                Name="VCMIDLTool"\r
+                        />\r
+                        <Tool\r
+                                Name="VCCLCompilerTool"\r
+                                AdditionalIncludeDirectories="../compat;../../../../depkgs-msvc/include;../..;../../../../depkgs-msvc\lib\wx_dll\msw"\r
+                                PreprocessorDefinitions="NDEBUG;_WINDOWS;wxUSE_GUI;WXUSINGDLL;__WXMSW__;HAVE_WIN32;HAVE_WXCONSOLE;USING_DLL;_STAT_H;_STAT_DEFINED;_USE_32BIT_TIME_T;_WIN32_WINNT=0x0500;_CRT_SECURE_NO_DEPRECATE"\r
+                                RuntimeLibrary="2"\r
+                                UsePrecompiledHeader="0"\r
+                                BrowseInformation="1"\r
+                                WarningLevel="3"\r
+                                Detect64BitPortabilityProblems="false"\r
+                                DebugInformationFormat="3"\r
+                        />\r
+                        <Tool\r
+                                Name="VCManagedResourceCompilerTool"\r
+                        />\r
+                        <Tool\r
+                                Name="VCResourceCompilerTool"\r
+                        />\r
+                        <Tool\r
+                                Name="VCPreLinkEventTool"\r
+                        />\r
+                        <Tool\r
+                                Name="VCLinkerTool"\r
+                                AdditionalDependencies="wxmsw28_core.lib wxbase27.lib pthreadVCE.lib zlib.lib wsock32.lib comctl32.lib rpcrt4.lib atls.lib"\r
+                                LinkIncremental="0"\r
+                                AdditionalLibraryDirectories="&quot;../../../../depkgs-msvc/lib&quot;;&quot;../../../../depkgs-msvc/lib/wx_dll&quot;"\r
+                                IgnoreDefaultLibraryNames=""\r
+                                GenerateDebugInformation="true"\r
+                                SubSystem="2"\r
+                                OptimizeReferences="2"\r
+                                EnableCOMDATFolding="2"\r
+                                TargetMachine="1"\r
+                        />\r
+                        <Tool\r
+                                Name="VCALinkTool"\r
+                        />\r
+                        <Tool\r
+                                Name="VCManifestTool"\r
+                        />\r
+                        <Tool\r
+                                Name="VCXDCMakeTool"\r
+                        />\r
+                        <Tool\r
+                                Name="VCBscMakeTool"\r
+                        />\r
+                        <Tool\r
+                                Name="VCFxCopTool"\r
+                        />\r
+                        <Tool\r
+                                Name="VCAppVerifierTool"\r
+                        />\r
+                        <Tool\r
+                                Name="VCWebDeploymentTool"\r
+                        />\r
+                        <Tool\r
+                                Name="VCPostBuildEventTool"\r
+                        />\r
+                </Configuration>\r
+        </Configurations>\r
+        <References>\r
+        </References>\r
+        <Files>\r
+                <Filter\r
+                        Name="Header Files"\r
+                        Filter="h;hpp;hxx;hm;inl;inc;xsd"\r
+                        UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"\r
+                        >\r
+                        <File\r
+                                RelativePath="..\..\wx-console\console_conf.h"\r
+                                >\r
+                        </File>\r
+                        <File\r
+                                RelativePath="..\..\wx-console\console_thread.h"\r
+                                >\r
+                        </File>\r
+                        <File\r
+                                RelativePath="..\..\wx-console\csprint.h"\r
+                                >\r
+                        </File>\r
+                        <File\r
+                                RelativePath=".\w32api.h"\r
+                                >\r
+                        </File>\r
+                        <File\r
+                                RelativePath="..\..\wx-console\wx-console_private.h"\r
+                                >\r
+                        </File>\r
+                        <File\r
+                                RelativePath="..\..\wx-console\wxbconfigfileeditor.h"\r
+                                >\r
+                        </File>\r
+                        <File\r
+                                RelativePath="..\..\wx-console\wxbconfigpanel.h"\r
+                                >\r
+                        </File>\r
+                        <File\r
+                                RelativePath="..\..\wx-console\wxbhistorytextctrl.h"\r
+                                >\r
+                        </File>\r
+                        <File\r
+                                RelativePath="..\..\wx-console\wxblistctrl.h"\r
+                                >\r
+                        </File>\r
+                        <File\r
+                                RelativePath="..\..\wx-console\wxbmainframe.h"\r
+                                >\r
+                        </File>\r
+                        <File\r
+                                RelativePath="..\..\wx-console\wxbrestorepanel.h"\r
+                                >\r
+                        </File>\r
+                        <File\r
+                                RelativePath="..\..\wx-console\wxbtableparser.h"\r
+                                >\r
+                        </File>\r
+                        <File\r
+                                RelativePath="..\..\wx-console\wxbtreectrl.h"\r
+                                >\r
+                        </File>\r
+                        <File\r
+                                RelativePath="..\..\wx-console\wxbutils.h"\r
+                                >\r
+                        </File>\r
+                </Filter>\r
+                <Filter\r
+                        Name="Resource Files"\r
+                        Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"\r
+                        UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"\r
+                        >\r
+                        <File\r
+                                RelativePath=".\wx-console.manifest"\r
+                                >\r
+                        </File>\r
+                        <File\r
+                                RelativePath="..\..\wx-console\wx-console_private.rc"\r
+                                >\r
+                        </File>\r
+                </Filter>\r
+                <Filter\r
+                        Name="Source Files"\r
+                        Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"\r
+                        UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"\r
+                        >\r
+                        <File\r
+                                RelativePath="..\..\wx-console\authenticate.c"\r
+                                >\r
+                                <FileConfiguration\r
+                                        Name="Debug|Win32"\r
+                                        >\r
+                                        <Tool\r
+                                                Name="VCCLCompilerTool"\r
+                                                CompileAs="2"\r
+                                        />\r
+                                </FileConfiguration>\r
+                                <FileConfiguration\r
+                                        Name="Release|Win32"\r
+                                        >\r
+                                        <Tool\r
+                                                Name="VCCLCompilerTool"\r
+                                                CompileAs="2"\r
+                                        />\r
+                                </FileConfiguration>\r
+                        </File>\r
+                        <File\r
+                                RelativePath="..\..\wx-console\console_conf.c"\r
+                                >\r
+                                <FileConfiguration\r
+                                        Name="Debug|Win32"\r
+                                        >\r
+                                        <Tool\r
+                                                Name="VCCLCompilerTool"\r
+                                                CompileAs="2"\r
+                                        />\r
+                                </FileConfiguration>\r
+                                <FileConfiguration\r
+                                        Name="Release|Win32"\r
+                                        >\r
+                                        <Tool\r
+                                                Name="VCCLCompilerTool"\r
+                                                CompileAs="2"\r
+                                        />\r
+                                </FileConfiguration>\r
+                        </File>\r
+                        <File\r
+                                RelativePath="..\..\wx-console\console_thread.cpp"\r
+                                >\r
+                        </File>\r
+                        <File\r
+                                RelativePath="..\..\wx-console\main.cpp"\r
+                                >\r
+                        </File>\r
+                        <File\r
+                                RelativePath="..\..\wx-console\wxbconfigfileeditor.cpp"\r
+                                >\r
+                        </File>\r
+                        <File\r
+                                RelativePath="..\..\wx-console\wxbconfigpanel.cpp"\r
+                                >\r
+                        </File>\r
+                        <File\r
+                                RelativePath="..\..\wx-console\wxbhistorytextctrl.cpp"\r
+                                >\r
+                        </File>\r
+                        <File\r
+                                RelativePath="..\..\wx-console\wxblistctrl.cpp"\r
+                                >\r
+                        </File>\r
+                        <File\r
+                                RelativePath="..\..\wx-console\wxbmainframe.cpp"\r
+                                >\r
+                        </File>\r
+                        <File\r
+                                RelativePath="..\..\wx-console\wxbrestorepanel.cpp"\r
+                                >\r
+                        </File>\r
+                        <File\r
+                                RelativePath="..\..\wx-console\wxbtableparser.cpp"\r
+                                >\r
+                        </File>\r
+                        <File\r
+                                RelativePath="..\..\wx-console\wxbtreectrl.cpp"\r
+                                >\r
+                        </File>\r
+                        <File\r
+                                RelativePath="..\..\wx-console\wxbutils.cpp"\r
+                                >\r
+                        </File>\r
+                </Filter>\r
+        </Files>\r
+        <Globals>\r
+        </Globals>\r
 </VisualStudioProject>\r
index 1cfca94661d81dd16d0fc74edbeae8c034019094..d71812dc3083b9571156bf5414656613a6f53495 100644 (file)
@@ -1,15 +1,7 @@
-/*
- *
- *   Config panel, used to specify parameters (for example clients, filesets... in restore)
- *
- *    Nicolas Boichat, April 2004
- *
- *    Version $Id$
- */
 /*
    Bacula® - The Network Backup Solution
 
-   Copyright (C) 2004-2006 Free Software Foundation Europe e.V.
+   Copyright (C) 2004-2008 Free Software Foundation Europe e.V.
 
    The main author of Bacula is Kern Sibbald, with contributions from
    many others, a complete list can be found in the file AUTHORS.
    (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
    Switzerland, email:ftf@fsfeurope.org.
 */
+/*
+ *
+ *   Config panel, used to specify parameters (for example clients, filesets... in restore)
+ *
+ *    Nicolas Boichat, April 2004
+ *
+ *    Version $Id$
+ */
 
 /*  Windows debug builds set _DEBUG which is used by wxWidgets to select their
  *  debug memory allocator.  Unfortunately it conflicts with Bacula's SmartAlloc.
@@ -159,6 +159,14 @@ int wxbConfigParam::GetIndex() {
    return -1;
 }
 
+int wxbConfigParam::GetCount() {
+   if (choicectrl) {
+      return choicectrl->GetCount();
+   }
+   return -1;
+}
+   
+
 void wxbConfigParam::SetIndex(int ind) {
    if (choicectrl) {
       choicectrl->SetSelection(ind);
@@ -289,6 +297,16 @@ int wxbConfigPanel::FindRow(const wxChar* title) {
    return -1;
 }
 
+int wxbConfigPanel::GetRowCount(const wxChar* title)
+{
+   int i;
+   if ((i = FindRow(title)) > -1) {
+      return (*config)[i].GetCount();
+   }  
+
+   return -1;
+}
+
 void wxbConfigPanel::EnableApply(bool enable) {
    cfgOk->Enable(!enable);
    if (cfgApply) cfgApply->Enable(enable);
index e64ec8c06348314e749914d178be190bda9c321f..3f712caae6dac4bf69b840aa5862cf200c27b156 100644 (file)
@@ -1,15 +1,7 @@
-/*
- *
- *   Config panel, used to specify parameters (for example clients, filesets... in restore)
- *
- *    Nicolas Boichat, April 2004
- *
- *    Version $Id$
- */
 /*
    Bacula® - The Network Backup Solution
 
-   Copyright (C) 2004-2006 Free Software Foundation Europe e.V.
+   Copyright (C) 2004-2008 Free Software Foundation Europe e.V.
 
    The main author of Bacula is Kern Sibbald, with contributions from
    many others, a complete list can be found in the file AUTHORS.
    (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
    Switzerland, email:ftf@fsfeurope.org.
 */
+/*
+ *
+ *   Config panel, used to specify parameters (for example clients, filesets... in restore)
+ *
+ *    Nicolas Boichat, April 2004
+ *
+ *    Version $Id$
+ */
 
 #ifndef WXBCONFIGPANEL_H
 #define WXBCONFIGPANEL_H
@@ -68,6 +68,7 @@ class wxbConfigParam {
 
      void Clear();
      void Add(wxString value);
+     int GetCount();
 
      wxString GetTitle();
 
@@ -102,6 +103,7 @@ public:
 
    void ClearRowChoices(const wxChar* title);
    void AddRowChoice(const wxChar* title, wxString value);
+   int GetRowCount(const wxChar* title);
 
    /* If enable is true, enables apply button, and disables ok button */
    void EnableApply(bool enable = true);
index f74163bc00de3158026e88aeb1cf8630e7b509af..7504bf597e83339e7e24b3e8fee2b73bf560c1fa 100644 (file)
@@ -1,15 +1,7 @@
-/*
- *
- *   wxbPanel for restoring files
- *
- *    Nicolas Boichat, April-July 2004
- *
- *    Version $Id$
- */
 /*
    Bacula® - The Network Backup Solution
 
-   Copyright (C) 2004-2006 Free Software Foundation Europe e.V.
+   Copyright (C) 2004-2008 Free Software Foundation Europe e.V.
 
    The main author of Bacula is Kern Sibbald, with contributions from
    many others, a complete list can be found in the file AUTHORS.
    (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
    Switzerland, email:ftf@fsfeurope.org.
 */
+/*
+ *
+ *   wxbPanel for restoring files
+ *
+ *    Nicolas Boichat, April-July 2004
+ *
+ *    Version $Id$
+ */
 
 /* Note concerning "done" output (modifiable marked with +)
 Run Restore job
@@ -551,14 +551,17 @@ void wxbRestorePanel::CmdStart()
       wxbMainFrame::GetInstance()->SetStatusText(_("Please configure your restore parameters."));
    }
    else if (status == entered) {
-/*      if (clientChoice->GetStringSelection().Length() < 1) {
+#ifdef xxx
+      if (clientChoice->GetStringSelection().Length() < 1) {
          wxbMainFrame::GetInstance()->SetStatusText(_("Please select a client."));
          return;
       }
       if (jobChoice->GetStringSelection().Length() < 1) {
          wxbMainFrame::GetInstance()->SetStatusText(_("Please select a restore date."));
          return;
-      }*/
+      }
+#endif
+
       wxbMainFrame::GetInstance()->SetStatusText(_("Building restore tree..."));
       
       SetStatus(choosing);
@@ -577,17 +580,22 @@ void wxbRestorePanel::CmdStart()
          wxT("\" storage=\"") << configPanel->GetRowString(wxT("Storage")) <<
          wxT("\" before=\"") << configPanel->GetRowString(wxT("Before")) <<
          wxT("\" select\n"));
-      //wxbUtils::WaitForPrompt("6\n");
-      //WaitForEnd();
-      /*wxbPromptParser *pp = wxbUtils::WaitForPrompt(wxString() << configPanel->GetRowString(wxT("Before")) << "\n", true);
+
+#ifdef xxx
+      wxbUtils::WaitForPrompt("6\n");
+      WaitForEnd();
+
+      wxbPromptParser *pp = wxbUtils::WaitForPrompt(wxString() << configPanel->GetRowString(wxT("Before")) << "\n", true);
+
       int client = pp->getChoices()->Index(configPanel->GetRowString(wxT("Client")));
       if (client == wxNOT_FOUND) {
          wxbMainFrame::GetInstance()->SetStatusText("Failed to find the selected client.");
          return;
       }
-      delete pp;*/
+      delete pp;
       
-      //wxbMainFrame::GetInstance()->Send(wxString() << configPanel->GetRowString(wxT("Before")) << "\n");
+      wxbMainFrame::GetInstance()->Send(wxString() << configPanel->GetRowString(wxT("Before")) << "\n");
+#endif
    
       while (!tableparser->hasFinished() && !dt->hasFinished()) {
          wxTheApp->Yield(true);
@@ -623,8 +631,10 @@ void wxbRestorePanel::CmdStart()
       gauge->SetValue(0);
       gauge->SetRange(tot);
       
-      /*wxbMainFrame::GetInstance()->Print(
-               wxString("[") << tot << "]", CS_DEBUG);*/
+#ifdef xxx
+      wxbMainFrame::GetInstance()->Print(
+               wxString("[") << tot << "]", CS_DEBUG);
+#endif
       
       wxDateTime base = wxDateTime::Now();
       wxDateTime newdate;
@@ -849,8 +859,8 @@ void wxbRestorePanel::CmdStart()
       }
 
       if (scheduledtime.Subtract(currenttime).IsLongerThan(wxTimeSpan::Seconds(150))) {
-         wxbMainFrame::GetInstance()->Print(_("Restore is scheduled in more than two minutes, bwx-console will not wait for its completion.\n"), CS_DEBUG);
-         wxbMainFrame::GetInstance()->SetStatusText(_("Restore is scheduled in more than two minutes, bwx-console will not wait for its completion."));
+         wxbMainFrame::GetInstance()->Print(_("Restore is scheduled to run. bwx-console will not wait for its completion.\n"), CS_DEBUG);
+         wxbMainFrame::GetInstance()->SetStatusText(_("Restore is scheduled to run. bwx-console will not wait for its completion."));
          SetStatus(finished);
          return;
       }
@@ -1069,7 +1079,8 @@ void wxbRestorePanel::CmdCancel() {
  *  11: JobId (no)
  */
 
-void wxbRestorePanel::CmdConfigApply() {
+void wxbRestorePanel::CmdConfigApply() 
+{
    if (cfgUpdated == 0) return;
    
    wxbMainFrame::GetInstance()->SetStatusText(_("Applying restore configuration changes..."));
@@ -1096,7 +1107,7 @@ void wxbRestorePanel::CmdConfigApply() {
       }
       else if ((cfgUpdated >> ConfigReplace) & 1) {
          wxbUtils::WaitForPrompt(wxT("mod\n")); /* TODO: check results */
-         wxbUtils::WaitForPrompt(wxT("10\n"));
+         wxbUtils::WaitForPrompt(wxT("11\n"));
          dt = new wxbDataTokenizer(true);
          wxbUtils::WaitForPrompt(wxString() << (restorePanel->GetRowSelection(_("Replace"))+1) << wxT("\n"));
          def = wxT("1");
@@ -1119,49 +1130,64 @@ void wxbRestorePanel::CmdConfigApply() {
          cfgUpdated = cfgUpdated & (~(1 << ConfigPriority));
       }
       else if ((cfgUpdated >> ConfigClient) & 1) {
-         wxbUtils::WaitForPrompt(wxT("mod\n")); /* TODO: check results */
-         wxbPromptParser *pp = wxbUtils::WaitForPrompt(wxT("5\n"), true);
-         int client = pp->getChoices()->Index(restorePanel->GetRowString(_("Client")));
-         if (client == wxNOT_FOUND) {
-            wxbMainFrame::GetInstance()->SetStatusText(_("Failed to find the selected client."));
-            failed = true;
-            client = 1;
+         if (restorePanel->GetRowCount(_("Client")) > 1) {
+            wxbUtils::WaitForPrompt(wxT("mod\n")); /* TODO: check results */
+            wxbPromptParser *pp = wxbUtils::WaitForPrompt(wxT("5\n"), true);
+            int client = pp->getChoices()->Index(restorePanel->GetRowString(_("Client")));
+            if (client == wxNOT_FOUND) {
+               wxbMainFrame::GetInstance()->SetStatusText(_("Failed to find the selected client."));
+               failed = true;
+               client = 1;
+            }
+            delete pp;
+            dt = new wxbDataTokenizer(true);
+            wxbUtils::WaitForPrompt(wxString() << client << wxT("\n"));
+            def = wxT("1");
+            cfgUpdated = cfgUpdated & (~(1 << ConfigClient));
+         } else {
+            cfgUpdated = cfgUpdated & (~(1 << ConfigClient));
+            continue;
          }
-         delete pp;
-         dt = new wxbDataTokenizer(true);
-         wxbUtils::WaitForPrompt(wxString() << client << wxT("\n"));
-         def = wxT("1");
-         cfgUpdated = cfgUpdated & (~(1 << ConfigClient));
       }
       else if ((cfgUpdated >> ConfigFileset) & 1) {
-         wxbUtils::WaitForPrompt(wxT("mod\n")); /* TODO: check results */
-         wxbPromptParser *pp = wxbUtils::WaitForPrompt(wxT("4\n"), true);
-         int fileset = pp->getChoices()->Index(restorePanel->GetRowString(_("Fileset")));
-         if (fileset == wxNOT_FOUND) {
-            wxbMainFrame::GetInstance()->SetStatusText(_("Failed to find the selected fileset."));
-            failed = true;
-            fileset = 1;
+         if (restorePanel->GetRowCount(_("Fileset")) > 1) {
+            wxbUtils::WaitForPrompt(wxT("mod\n")); /* TODO: check results */
+            wxbPromptParser *pp = wxbUtils::WaitForPrompt(wxT("4\n"), true);
+            int fileset = pp->getChoices()->Index(restorePanel->GetRowString(_("Fileset")));
+            if (fileset == wxNOT_FOUND) {
+               wxbMainFrame::GetInstance()->SetStatusText(_("Failed to find the selected fileset."));
+               failed = true;
+               fileset = 1;
+            }
+            delete pp;
+            dt = new wxbDataTokenizer(true);
+            wxbUtils::WaitForPrompt(wxString() << fileset << wxT("\n"));
+            def = wxT("1");
+            cfgUpdated = cfgUpdated & (~(1 << ConfigFileset));
+         } else {
+            cfgUpdated = cfgUpdated & (~(1 << ConfigFileset));
+            continue;
          }
-         delete pp;
-         dt = new wxbDataTokenizer(true);
-         wxbUtils::WaitForPrompt(wxString() << fileset << wxT("\n"));
-         def = wxT("1");
-         cfgUpdated = cfgUpdated & (~(1 << ConfigFileset));
       }
       else if ((cfgUpdated >> ConfigStorage) & 1) {
-         wxbUtils::WaitForPrompt(wxT("mod\n")); /* TODO: check results */
-         wxbPromptParser *pp = wxbUtils::WaitForPrompt(wxT("2\n"), true);
-         int fileset = pp->getChoices()->Index(restorePanel->GetRowString(_("Storage")));
-         if (fileset == wxNOT_FOUND) {
-            wxbMainFrame::GetInstance()->SetStatusText(_("Failed to find the selected storage."));
-            failed = true;
-            fileset = 1;
+         if (restorePanel->GetRowCount(_("Storage")) > 1) {
+            wxbUtils::WaitForPrompt(wxT("mod\n")); /* TODO: check results */
+            wxbPromptParser *pp = wxbUtils::WaitForPrompt(wxT("2\n"), true);
+            int storage = pp->getChoices()->Index(restorePanel->GetRowString(_("Storage")));
+            if (storage == wxNOT_FOUND) {
+               wxbMainFrame::GetInstance()->SetStatusText(_("Failed to find the selected storage."));
+               failed = true;
+               storage = 1;
+            }
+            delete pp;
+            dt = new wxbDataTokenizer(true);
+            wxbUtils::WaitForPrompt(wxString() << storage << wxT("\n"));
+            def = wxT("1");
+            cfgUpdated = cfgUpdated & (~(1 << ConfigStorage));
+         } else {
+            cfgUpdated = cfgUpdated & (~(1 << ConfigStorage));
+            continue;
          }
-         delete pp;
-         dt = new wxbDataTokenizer(true);
-         wxbUtils::WaitForPrompt(wxString() << fileset << wxT("\n"));
-         def = wxT("1");
-         cfgUpdated = cfgUpdated & (~(1 << ConfigStorage));
       }
       else {
          cfgUpdated = 0;
@@ -1175,7 +1201,7 @@ void wxbRestorePanel::CmdConfigApply() {
          }
       }
       
-      if (i == dt->GetCount()) {
+      if (i != 0 && i == dt->GetCount()) {
          delete dt;   
          dt = wxbUtils::WaitForEnd(def + wxT("\n"), true);
          failed = true;
@@ -1184,6 +1210,7 @@ void wxbRestorePanel::CmdConfigApply() {
    UpdateSecondConfig(dt); /* TODO: Check result */
    
    EnableConfig(true);
+   restorePanel->EnableApply(false);
 
    if (!failed) {
       wxbMainFrame::GetInstance()->SetStatusText(_("Restore configuration changes were applied."));
@@ -1967,7 +1994,6 @@ void wxbRestorePanel::SetStatus(status_enum newstatus) {
       cfgUpdated = 0;
       break;
    case listing:
-      
       break;
    case choosing:
       start->Enable(true);
@@ -1996,6 +2022,7 @@ void wxbRestorePanel::SetStatus(status_enum newstatus) {
       centerSizer->Layout();
       this->Layout();
       restorePanel->EnableApply(false);
+      cancel->Enable(true);
       break;
    case restoring:
       start->SetLabel(_("Restoring..."));
@@ -2362,7 +2389,8 @@ void wxbRestorePanel::OnListRemove(wxCommandEvent& event) {
    listremove->Enable(false);
 }
 
-void wxbRestorePanel::OnListRefresh(wxCommandEvent& event) {
+void wxbRestorePanel::OnListRefresh(wxCommandEvent& event) 
+{
    if (IsWorking()) {
       return;
    }
@@ -2372,7 +2400,8 @@ void wxbRestorePanel::OnListRefresh(wxCommandEvent& event) {
    SetWorking(false);
 }
 
-void wxbRestorePanel::OnConfigUpdated(wxCommandEvent& event) {
+void wxbRestorePanel::OnConfigUpdated(wxCommandEvent& event) 
+{
    if (status == entered) {
       if (event.GetId() == ConfigJobName) {
          if (IsWorking()) {
index 6fccb368bd713d22b924d225b220f59d1b0393eb..daf9d634a6a811206e533223d569f5f3c111a813 100644 (file)
@@ -1,15 +1,7 @@
-/*
- *
- *   wxbDataParser, class that receives and analyses data
- *
- *    Nicolas Boichat, April-July 2004
- *
- *    Version $Id$
- */
 /*
    Bacula® - The Network Backup Solution
 
-   Copyright (C) 2004-2006 Free Software Foundation Europe e.V.
+   Copyright (C) 2004-2008 Free Software Foundation Europe e.V.
 
    The main author of Bacula is Kern Sibbald, with contributions from
    many others, a complete list can be found in the file AUTHORS.
    (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
    Switzerland, email:ftf@fsfeurope.org.
 */
+/*
+ *
+ *   wxbDataParser, class that receives and analyses data
+ *
+ *    Nicolas Boichat, April-July 2004
+ *
+ *    Version $Id$
+ */
 
 /*  Windows debug builds set _DEBUG which is used by wxWidgets to select their
  *  debug memory allocator.  Unfortunately it conflicts with Bacula's SmartAlloc.
 #undef _DEBUG
 
 #include "bacula.h"
-
 #include "wxbutils.h"
-
 #include "wxbmainframe.h"
-
 #include "csprint.h"
-
 #include "wxbtableparser.h"
 
 /* A macro named Yield is defined under MinGW */
@@ -335,7 +331,6 @@ bool wxbPromptParser::Analyse(wxString str, int status) {
             choices->Add(wxT("no"));
             numerical = false;
          }
-         
          return true;
       }
       else { /* ended or (dis)connected */
index c3f05bf067ce4f5849c2b1f899f73b96d4c24919..d91ff2d35a72ae3069adca8a69c9a1f9a2221747 100644 (file)
@@ -1,16 +1,7 @@
-/*
- *
- *   wxbDataParser, class that receives and analyses data
- *   wxbPanel, main frame's notebook panels
- *
- *    Nicolas Boichat, April-July 2004
- *
- *   Version $Id$
- */
 /*
    Bacula® - The Network Backup Solution
 
-   Copyright (C) 2004-2006 Free Software Foundation Europe e.V.
+   Copyright (C) 2004-2008 Free Software Foundation Europe e.V.
 
    The main author of Bacula is Kern Sibbald, with contributions from
    many others, a complete list can be found in the file AUTHORS.
    (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
    Switzerland, email:ftf@fsfeurope.org.
 */
+/*
+ *
+ *   wxbDataParser, class that receives and analyses data
+ *   wxbPanel, main frame's notebook panels
+ *
+ *    Nicolas Boichat, April-July 2004
+ *
+ *   Version $Id$
+ */
 
 #ifndef WXBUTILS_H
 #define WXBUTILS_H
index d7bf709e831c45a8a2898e78419cf6e52adb16a6..a3c0d4611a3688806eb582b5fd6f016eac2f5ee1 100644 (file)
@@ -1,6 +1,15 @@
               Technical notes on version 2.3
 
 General:
+18Mar08
+kes  Apply doc fix from bug #1062.
+kes  Resolve crash and improper restore wx-console Win32 restore
+     GUI. Fixes bug #1065.                   
+kes  Update Win32 wxWidgets to latest version.
+kes  Attempt to do correct handling of Win32 mount points. Should
+     fix bug #1046.
+kes  Fix Win32 FD backup/restore memory leak due to improper termination
+     of BackupRead/Write. This fixes bug# 1038.
 16Mar08
 ebl  Reduce memory usage for accurate backup, working only with ctime
      and mtime. (not all Lstat field)