]> granicus.if.org Git - handbrake/commitdiff
WinGui: Misc Fixes
authorsr55 <sr55.hb@outlook.com>
Sun, 30 Sep 2012 14:08:03 +0000 (14:08 +0000)
committersr55 <sr55.hb@outlook.com>
Sun, 30 Sep 2012 14:08:03 +0000 (14:08 +0000)
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4997 b64f7644-9d1e-0410-96f1-a4d463321fa5

win/CS/HandBrake.ApplicationServices/Services/ServerService.cs
win/CS/HandBrakeWPF/ViewModels/LogViewModel.cs
win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
win/CS/HandBrakeWPF/Views/MainView.xaml
win/CS/HandBrakeWPF/Views/OptionsView.xaml

index f6b6edf44b697b2015bf111b291df7414891f362..d8966c1921d561638995f81342617e27144ef292 100644 (file)
@@ -20,6 +20,12 @@ namespace HandBrake.ApplicationServices.Services
     using HandBrake.ApplicationServices.Model;\r
     using HandBrake.ApplicationServices.Parsing;\r
     using HandBrake.ApplicationServices.Services.Interfaces;\r
+    using HandBrake.Interop;\r
+    using HandBrake.Interop.Interfaces;\r
+\r
+    using EncodeCompletedEventArgs = HandBrake.ApplicationServices.EventArgs.EncodeCompletedEventArgs;\r
+    using EncodeProgressEventArgs = HandBrake.ApplicationServices.EventArgs.EncodeProgressEventArgs;\r
+    using ScanProgressEventArgs = HandBrake.ApplicationServices.EventArgs.ScanProgressEventArgs;\r
 \r
     /// <summary>\r
     /// HandBrake WCF Service\r
@@ -152,6 +158,9 @@ namespace HandBrake.ApplicationServices.Services
         /// <summary>\r
         /// Start the service\r
         /// </summary>\r
+        /// <param name="port">\r
+        /// The port.\r
+        /// </param>\r
         public void Start(string port)\r
         {\r
             using (host = new ServiceHost(typeof(ServerService), new Uri(string.Format("net.tcp://127.0.0.1:{0}", port))))\r
@@ -163,8 +172,9 @@ namespace HandBrake.ApplicationServices.Services
                 Console.WriteLine("Service Started. Waiting for Clients...");\r
 \r
                 // Setup the services we are going to use.\r
-                scanService = new ScanService(new UserSettingService()); // TODO this needs wired up with castle\r
-                encodeService = new Encode(new UserSettingService());\r
+                IHandBrakeInstance instance = new HandBrakeInstance();\r
+                scanService = new LibScan(new UserSettingService(), instance); // TODO this needs wired up with castle\r
+                encodeService = new LibEncode(new UserSettingService(), instance);\r
 \r
                 shutdownFlag = new ManualResetEvent(false);\r
                 shutdownFlag.WaitOne();\r
index 209e3c091bae691c7c87540db2de80dfb647cf28..4c97ab412ba858132b9efbc58e6505d15c4a24fa 100644 (file)
@@ -40,12 +40,6 @@ namespace HandBrakeWPF.ViewModels
         /// Backing field for the selected mode\r
         /// </summary>\r
         private int selectedMode;\r
-\r
-        /// <summary>\r
-        /// Backing field for the log info.\r
-        /// </summary>\r
-        private string log;\r
-\r
         #endregion\r
 \r
         /// <summary>\r
@@ -62,7 +56,8 @@ namespace HandBrakeWPF.ViewModels
             this.encodeService = encodeService;\r
             this.scanService = scanService;\r
             this.Title = "Log Viewer";\r
-            this.SelectedMode = 0;\r
+\r
+            this.SelectedMode = this.encodeService.IsEncoding ? 0 : 1;\r
         }\r
 \r
         /// <summary>\r
@@ -174,8 +169,12 @@ namespace HandBrakeWPF.ViewModels
         protected override void OnDeactivate(bool close)\r
         {\r
             this.scanService.ScanStared -= ScanServiceScanStared;\r
+            this.scanService.ScanCompleted -= ScanServiceScanCompleted;\r
             this.encodeService.EncodeStarted -= EncodeServiceEncodeStarted;\r
-            this.Load();\r
+            this.encodeService.EncodeCompleted -= EncodeServiceEncodeCompleted;\r
+            this.encodeService.EncodeStatusChanged -= this.EncodeServiceEncodeStatusChanged;\r
+            this.scanService.ScanStatusChanged -= this.ScanServiceScanStatusChanged;\r
+\r
             base.OnDeactivate(close);\r
         }\r
 \r
index acc59e60ed37a6b9bd2a6355e3fcde0f2ca63e62..c2aef69edaf4c760159c4c162387137637020777 100644 (file)
@@ -1080,7 +1080,7 @@ namespace HandBrakeWPF.ViewModels
             }\r
 \r
             // Otherwise, perform Santiy Checking then add to the queue and start if everything is ok.\r
-            if (this.ScannedSource == null || this.CurrentTask == null)\r
+            if (this.SelectedTitle == null)\r
             {\r
                 this.errorService.ShowMessageBox("You must first scan a source.", "Error", MessageBoxButton.OK, MessageBoxImage.Error);\r
                 return;\r
index d4cea73db34a9c93c18d42e48af66562833bc174..0ab5e87b9101a8695cd3317c4a597993b0f978bc 100644 (file)
                             <Image Width="16" Source="Images/Queue_Small.png" />\r
                         </MenuItem.Icon>\r
                     </MenuItem>\r
-                    <MenuItem Header="Activity Window" Micro:Message.Attach="[Event Click] = [Action OpenLogWindow]">\r
+                    <MenuItem Header="Activity Log" Micro:Message.Attach="[Event Click] = [Action OpenLogWindow]">\r
                         <MenuItem.Icon>\r
                             <Image Width="16" Source="Images/Output_Small.png" />\r
                         </MenuItem.Icon>\r
                                />\r
                         <Label Margin="8,0,0,0"\r
                                VerticalAlignment="Center"\r
-                               Content="Activity Window"\r
+                               Content="Activity Log"\r
                                />\r
                     </StackPanel>\r
                 </Button>\r
index 4412c7bfb6fd222d64883ebfcbca35372d8a7d10..a2be6c1136cc6c5646e98ebedf4a92579e0b40b6 100644 (file)
@@ -14,8 +14,6 @@
             <Setter Property="VerticalAlignment" Value="Center" />\r
         </Style>\r
 \r
-\r
-\r
         <Style TargetType="TextBlock">\r
             <Setter Property="Margin" Value="0,0,5,0" />\r
         </Style>\r
                         <TextBlock Text="These options are for developer testing of features that are currently in progress!!!!" FontWeight="Bold" Margin="0,0,0,10" />\r
 \r
                         <StackPanel Orientation="Vertical" Grid.Column="1" Margin="20,0,0,0">\r
-                            <CheckBox Content="Enable Process Isolation (Run Scans and Encodes via an intermediate service)" IsChecked="{Binding EnableProcessIsolation}" />\r
-                            <CheckBox Content="Enable LibHB (uses hb.dll instead of HandBrakeCLI.exe)" Margin="0,5,0,0" IsChecked="{Binding EnableLibHb}" />\r
                             \r
+                            <CheckBox Content="Enable LibHB (uses hb.dll instead of HandBrakeCLI.exe)" Margin="0,5,0,0" IsChecked="{Binding EnableLibHb}" />\r
+                            <CheckBox Content="Enable Process Isolation (Run Scans and Encodes via an intermediate service)" Margin="20,10,0,0" IsChecked="{Binding EnableProcessIsolation}" />\r
                             <StackPanel Orientation="Horizontal" Margin="0,10,0,0" Grid.Column="1">\r
                                 <TextBlock Text="Server Port:" VerticalAlignment="Center" />\r
                                 <TextBox Width="50" MaxLength="5" Text="{Binding ServerPort}" />\r