OSDN Git Service

WinGui:
authorsr55 <sr55@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Mon, 3 Jan 2011 20:15:10 +0000 (20:15 +0000)
committersr55 <sr55@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Mon, 3 Jan 2011 20:15:10 +0000 (20:15 +0000)
- Second attempt at fixing file path problems.

git-svn-id: svn://localhost/HandBrake/trunk@3736 b64f7644-9d1e-0410-96f1-a4d463321fa5

win/C#/Functions/QueryGenerator.cs
win/C#/HandBrake.ApplicationServices/Model/Job.cs
win/C#/HandBrake.ApplicationServices/Services/Scan.cs
win/C#/HandBrakeCS.csproj
win/C#/Installer/Installer.nsi

index bb1c61f..4c65ca1 100644 (file)
@@ -94,9 +94,17 @@ namespace Handbrake.Functions
         {\r
             string query = string.Empty;\r
 \r
-            if (!string.IsNullOrEmpty(mainWindow.sourcePath) &&\r
-                mainWindow.sourcePath.Trim() != "Select \"Source\" to continue")\r
-                query = " -i " + '"' + mainWindow.sourcePath + '"';\r
+            if (!string.IsNullOrEmpty(mainWindow.sourcePath) && mainWindow.sourcePath.Trim() != "Select \"Source\" to continue")\r
+            {\r
+                if (mainWindow.sourcePath.EndsWith("\\"))\r
+                {\r
+                    query = " -i " + mainWindow.sourcePath;\r
+                }\r
+                else\r
+                {\r
+                    query = " -i " + '"' + mainWindow.sourcePath + '"';\r
+                }\r
+            }\r
 \r
             if (mainWindow.drp_dvdtitle.Text != string.Empty)\r
             {\r
index a18a611..5360691 100644 (file)
@@ -11,11 +11,6 @@ namespace HandBrake.ApplicationServices.Model
     public class Job\r
     {\r
         /// <summary>\r
-        /// the CLI Query.\r
-        /// </summary>\r
-        private string query;\r
-\r
-        /// <summary>\r
         /// Gets or sets the job ID.\r
         /// </summary>\r
         public int Id { get; set; }\r
@@ -28,17 +23,7 @@ namespace HandBrake.ApplicationServices.Model
         /// <summary>\r
         /// Gets or sets the query string.\r
         /// </summary>\r
-        public string Query\r
-        {\r
-            get\r
-            {\r
-                return this.query.Replace("\\\"", "\"").Replace("\\\\", "\\");\r
-            }\r
-            set\r
-            {\r
-                this.query = value;\r
-            }\r
-        }\r
+        public string Query { get; set; }\r
 \r
         /// <summary>\r
         /// Gets or sets a value indicating whether if this is a user or GUI generated query\r
index 2a5188a..7bc74bc 100644 (file)
@@ -110,7 +110,7 @@ namespace HandBrake.ApplicationServices.Services
                 if (logBuffer == null)\r
                 {\r
                     ResetLogReader(false);\r
-                    ReadLastScanFile();  \r
+                    ReadLastScanFile();\r
                 }\r
 \r
                 return logBuffer != null ? logBuffer.ToString() : string.Empty;\r
@@ -146,7 +146,7 @@ namespace HandBrake.ApplicationServices.Services
             catch (Exception ex)\r
             {\r
                 errorService.ShowError("Unable to kill HandBrakeCLI.exe \n" +\r
-                "You may need to manually kill HandBrakeCLI.exe using the Windows Task Manager if it does not close automatically" + \r
+                "You may need to manually kill HandBrakeCLI.exe using the Windows Task Manager if it does not close automatically" +\r
                 " within the next few minutes. ", ex.ToString());\r
             }\r
         }\r
@@ -186,12 +186,16 @@ namespace HandBrake.ApplicationServices.Services
 \r
                 // Quick fix for "F:\\" style paths. Just get rid of the \\ so the CLI doesn't fall over.\r
                 // Sould probably clean up the escaping of the strings later.\r
+                string source;\r
                 if (sourcePath.ToString().EndsWith("\\"))\r
                 {\r
-                    sourcePath = sourcePath.ToString().Replace("\\", string.Empty);\r
+                    source = sourcePath.ToString();\r
+                }\r
+                else\r
+                {\r
+                    source = "\"" + sourcePath + "\"";\r
                 }\r
 \r
-                string source = "\"" + sourcePath + "\"";\r
                 string command = String.Format(@" -i {0} -t{1} {2} -v ", source, title, extraArguments);\r
 \r
                 this.hbProc = new Process\r
@@ -237,7 +241,7 @@ namespace HandBrake.ApplicationServices.Services
                 IsScanning = false;\r
 \r
                 if (this.ScanCompleted != null)\r
-                    this.ScanCompleted(this, new EventArgs()); \r
+                    this.ScanCompleted(this, new EventArgs());\r
             }\r
             catch (Exception exc)\r
             {\r
@@ -246,7 +250,7 @@ namespace HandBrake.ApplicationServices.Services
                 errorService.ShowError("An error has occured during the scan process.", exc.ToString());\r
 \r
                 if (this.ScanCompleted != null)\r
-                    this.ScanCompleted(this, new EventArgs());   \r
+                    this.ScanCompleted(this, new EventArgs());\r
             }\r
         }\r
 \r
index 46323ad..dafd6d3 100644 (file)
   <Import Project="$(ProgramFiles)\MSBuild\Microsoft\StyleCop\v4.4\Microsoft.StyleCop.targets" />\r
   <PropertyGroup Condition=" '$(Configuration)' == 'Install' ">\r
     <PostBuildEvent>\r
-       cd ../../\r
-       copy Installer\Installer.nsi bin\Install /Y\r
-       copy handbrakepineapple.ico bin\Install /Y\r
-       xcopy doc bin\Install\doc /I /Y\r
-       cd bin\Install\r
        makensis Installer.nsi\r
        </PostBuildEvent>\r
   </PropertyGroup>\r
index 0ea0cb9..2951bca 100644 (file)
@@ -30,7 +30,7 @@ SetCompressor lzma
 !define MUI_UNICON "handbrakepineapple.ico"\r
 \r
 ; Welcome page\r
-!insertmacro MUI_PAGE_WELCOME \r
+!insertmacro MUI_PAGE_WELCOME\r
 ; License page\r
 !insertmacro MUI_PAGE_LICENSE "doc\COPYING"\r
 ; Directory page\r
@@ -91,11 +91,10 @@ Function .onInit
   done:\r
 FunctionEnd\r
 \r
-\r
 Section "Handbrake" SEC01\r
   SetOutPath "$INSTDIR"\r
   SetOverwrite ifnewer\r
-  \r
+\r
   ; Begin Check .NET version\r
   StrCpy $InstallDotNET "No"\r
   Call CheckFramework\r
@@ -120,9 +119,10 @@ Section "Handbrake" SEC01
 \r
      SetDetailsView show\r
   ${EndIf}\r
-\r
+  \r
   ; Install Files\r
   File "Handbrake.exe"\r
+  File "HandBrakeCLI.exe"\r
   CreateDirectory "$SMPROGRAMS\Handbrake"\r
   CreateShortCut "$SMPROGRAMS\Handbrake\Handbrake.lnk" "$INSTDIR\Handbrake.exe"\r
   CreateShortCut "$DESKTOP\Handbrake.lnk" "$INSTDIR\Handbrake.exe"\r
@@ -131,9 +131,7 @@ Section "Handbrake" SEC01
   File "AxInterop.QTOControlLib.dll"\r
   File "Growl.Connector.dll"\r
   File "Growl.CoreLibrary.dll"\r
-  File "HandBrakeCLI.exe"\r
   File "Handbrake.exe.config"\r
-  File "handbrakepineapple.ico"\r
   File "HandBrake.ApplicationServices.dll"\r
   File "HandBrake.Framework.dll"\r
   File "Microsoft.WindowsAPICodePack.Shell.dll"\r
@@ -146,7 +144,8 @@ Section "Handbrake" SEC01
   ;File "Castle.MicroKernel.dll"\r
   ;File "Castle.Windsor.dll"\r
   ;File "Microsoft.Practices.ServiceLocation.dll"\r
\r
+\r
+  ; Copy the standard doc set into the doc folder\r
   SetOutPath "$INSTDIR\doc"\r
   SetOverwrite ifnewer\r
   File "doc\AUTHORS"\r
@@ -170,6 +169,7 @@ Section -Post
   WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}"\r
 SectionEnd\r
 \r
+\r
 Function un.onUninstSuccess\r
   HideWindow\r
   MessageBox MB_ICONINFORMATION|MB_OK "$(^Name) was successfully removed from your computer."\r