]> granicus.if.org Git - handbrake/commitdiff
WinGui: Allow the log window to be opened from the Scan Status Overlay.
authorsr55 <sr55.hb@outlook.com>
Sun, 8 Jan 2017 17:51:05 +0000 (17:51 +0000)
committersr55 <sr55.hb@outlook.com>
Sun, 8 Jan 2017 17:52:08 +0000 (17:52 +0000)
win/CS/HandBrakeWPF/Controls/StatusPanel.xaml
win/CS/HandBrakeWPF/Controls/StatusPanel.xaml.cs
win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
win/CS/HandBrakeWPF/Views/MainView.xaml

index bd7bbbbade86404def09e6e69e2739c62ae97885..97a358a717cc32e37e0bb54011ba66ec20240092 100644 (file)
                                                    TextWrapping="WrapWithOverflow"\r
                            />\r
                     </StackPanel>\r
-             \r
-                    <Button Content="{Binding ActionText, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}" Margin="0,10,0,0"\r
-                            x:Name="StatusActionButton" Click="StatusActionButton_OnClick" Padding="8,2" HorizontalAlignment="Right"\r
-                            Visibility="{Binding IsActionButtonVisible, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}, Converter={StaticResource boolTovisibility}}" />\r
+\r
+                    <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">\r
+\r
+                        <Button Content="{Binding SecondaryActionText, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}" Margin="0,10,5,0"\r
+                                x:Name="SecondaryActionCtl" Click="PerformSecondaryAction" Padding="8,2" Visibility="{Binding IsActionButton2Visibile, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}, Converter={StaticResource boolTovisibility}}" />\r
+\r
+                        <Button Content="{Binding ActionText, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}" Margin="0,10,0,0"\r
+                                x:Name="StatusActionButton" Click="StatusActionButton_OnClick" Padding="8,2"\r
+                                Visibility="{Binding IsActionButtonVisible, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}, Converter={StaticResource boolTovisibility}}" />\r
+\r
+                    </StackPanel>\r
 \r
                 </StackPanel>\r
             </StackPanel>\r
index 90afe8e3379a7a0e7ee732c32391afbf9b8d2edf..64e27951720efb0b84d5f4264017bbbe4ef9fff5 100644 (file)
@@ -27,36 +27,27 @@ namespace HandBrakeWPF.Controls
             this.Message = "Message";\r
         }\r
 \r
-        /// <summary>\r
-        /// Dependancy Property for the IsLoading Property\r
-        /// </summary>\r
         public static readonly DependencyProperty IsLoadingProperty =\r
           DependencyProperty.Register("IsLoading", typeof(bool), typeof(StatusPanel), new UIPropertyMetadata(false));\r
 \r
-        /// <summary>\r
-        /// Dependancy Property for the Message Property\r
-        /// </summary>\r
         public static readonly DependencyProperty MessageProperty =\r
             DependencyProperty.Register("Message", typeof(string), typeof(StatusPanel), new UIPropertyMetadata("Loading..."));\r
 \r
-        /// <summary>\r
-        /// Dependancy Property for the submessage propery\r
-        /// </summary>\r
         public static readonly DependencyProperty SubMessageProperty =\r
             DependencyProperty.Register("SubMessage", typeof(string), typeof(StatusPanel), new FrameworkPropertyMetadata("Please Wait", FrameworkPropertyMetadataOptions.AffectsRender));\r
 \r
-        /// <summary>\r
-        /// Dependancy Property for the submessage propery\r
-        /// </summary>\r
         public static readonly DependencyProperty ActionProperty =\r
             DependencyProperty.Register("CancelAction", typeof(Action), typeof(StatusPanel), new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.None, OnCancelActionSet));\r
 \r
-        /// <summary>\r
-        /// Dependancy Property for the submessage propery\r
-        /// </summary>\r
+        public static readonly DependencyProperty SecondaryActionProperty =\r
+            DependencyProperty.Register("SecondaryAction", typeof(Action), typeof(StatusPanel), new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.None, OnSecondaryActionSet));\r
+\r
         public static readonly DependencyProperty ActionTextProperty =\r
             DependencyProperty.Register("ActionText", typeof(string), typeof(StatusPanel), new UIPropertyMetadata("Cancel"));\r
 \r
+        public static readonly DependencyProperty SecondaryActionTextProperty =\r
+            DependencyProperty.Register("SecondaryActionText", typeof(string), typeof(StatusPanel), new UIPropertyMetadata("Open Log Window"));\r
+\r
         /// <summary>\r
         /// Gets or sets a value indicating whether IsLoading.\r
         /// </summary>\r
@@ -90,7 +81,25 @@ namespace HandBrakeWPF.Controls
         public Action CancelAction\r
         {\r
             get { return (Action)GetValue(ActionProperty); }\r
-            set { SetValue(SubMessageProperty, value); }\r
+            set { SetValue(ActionProperty, value); }\r
+        }\r
+\r
+        /// <summary>\r
+        /// Gets or sets the cancel action.\r
+        /// </summary>\r
+        public Action SecondaryAction\r
+        {\r
+            get { return (Action)GetValue(SecondaryActionProperty); }\r
+            set { SetValue(SecondaryActionProperty, value); }\r
+        }\r
+\r
+        /// <summary>\r
+        /// Gets or sets SecondaryActionText.\r
+        /// </summary>\r
+        public string SecondaryActionText\r
+        {\r
+            get { return (string)GetValue(SecondaryActionTextProperty); }\r
+            set { SetValue(SecondaryActionTextProperty, value); }\r
         }\r
 \r
         /// <summary>\r
@@ -106,6 +115,19 @@ namespace HandBrakeWPF.Controls
         {\r
         }\r
 \r
+        /// <summary>\r
+        /// The on Secondary Action Set.\r
+        /// </summary>\r
+        /// <param name="d">\r
+        /// The d.\r
+        /// </param>\r
+        /// <param name="e">\r
+        /// The e.\r
+        /// </param>\r
+        private static void OnSecondaryActionSet(DependencyObject d, DependencyPropertyChangedEventArgs e)\r
+        {\r
+        }\r
+\r
         /// <summary>\r
         /// Gets or sets the action text.\r
         /// </summary>\r
@@ -126,6 +148,17 @@ namespace HandBrakeWPF.Controls
             }\r
         }\r
 \r
+        /// <summary>\r
+        /// \r
+        /// </summary>\r
+        public bool IsActionButton2Visibile\r
+        {\r
+            get\r
+            {\r
+                return true; //SecondaryAction != null;\r
+            }\r
+        }\r
+\r
         /// <summary>\r
         /// The status action button_ on click.\r
         /// </summary>\r
@@ -142,5 +175,13 @@ namespace HandBrakeWPF.Controls
                 this.CancelAction();\r
             }\r
         }\r
+\r
+        private void PerformSecondaryAction(object sender, RoutedEventArgs e)\r
+        {\r
+            if (this.SecondaryAction != null)\r
+            {\r
+                this.SecondaryAction();\r
+            }\r
+        }\r
     }\r
 }\r
index 39db1a5608b839d31e77216cc1c1316ea6be1b9b..4dab47e0df51f4caf1378da298ff077d2cdbeb78 100644 (file)
@@ -1087,6 +1087,17 @@ namespace HandBrakeWPF.ViewModels
             }\r
         }\r
 \r
+        /// <summary>\r
+        /// Action for the status window.\r
+        /// </summary>\r
+        public Action OpenLogWindowAction\r
+        {\r
+            get\r
+            {\r
+                return this.OpenLogWindow;\r
+            }\r
+        }\r
+\r
         /// <summary>\r
         /// Gets or sets a value indicating whether show alert window.\r
         /// </summary>\r
index e0e1156fd361c2275d5f42a6b39680ea2c6382ba..7d7556c8528c3b0273faab1d15dd6731ec5578c2 100644 (file)
                               Message="Please wait ..."\r
                               SubMessage="{Binding StatusLabel}"\r
                               ActionText="Cancel"\r
+                              SecondaryActionText="Open Log Window"\r
+                              SecondaryAction="{Binding OpenLogWindowAction}"\r
                               CancelAction="{Binding CancelAction}"\r
                               />\r
 \r