OSDN Git Service

WinGui:
authorsr55 <sr55@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Fri, 10 Dec 2010 22:30:58 +0000 (22:30 +0000)
committersr55 <sr55@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Fri, 10 Dec 2010 22:30:58 +0000 (22:30 +0000)
- Fix queue editing. Some settings were lost after clicking "Edit" on the queue context menu.

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

win/C#/frmMain.Designer.cs
win/C#/frmMain.cs

index 122ee63..16f6979 100644 (file)
@@ -111,6 +111,7 @@ namespace Handbrake
             this.Label47 = new System.Windows.Forms.Label();\r
             this.Label3 = new System.Windows.Forms.Label();\r
             this.tab_audio = new System.Windows.Forms.TabPage();\r
+            this.AudioSettings = new Handbrake.Controls.AudioPanel();\r
             this.AudioMenuRowHeightHack = new System.Windows.Forms.ImageList(this.components);\r
             this.tab_video = new System.Windows.Forms.TabPage();\r
             this.checkMaximumFramerate = new System.Windows.Forms.CheckBox();\r
@@ -123,13 +124,17 @@ namespace Handbrake
             this.lbl_SliderValue = new System.Windows.Forms.Label();\r
             this.lbl_framerate = new System.Windows.Forms.Label();\r
             this.tab_picture = new System.Windows.Forms.TabPage();\r
+            this.PictureSettings = new Handbrake.Controls.PictureSettings();\r
             this.Check_ChapterMarkers = new System.Windows.Forms.CheckBox();\r
             this.tabs_panel = new System.Windows.Forms.TabControl();\r
             this.tab_filters = new System.Windows.Forms.TabPage();\r
+            this.Filters = new Handbrake.Controls.Filters();\r
             this.tab_subtitles = new System.Windows.Forms.TabPage();\r
+            this.Subtitles = new Handbrake.Controls.Subtitles();\r
             this.tab_chapters = new System.Windows.Forms.TabPage();\r
             this.label31 = new System.Windows.Forms.Label();\r
             this.tab_advanced = new System.Windows.Forms.TabPage();\r
+            this.x264Panel = new Handbrake.Controls.x264Panel();\r
             this.tab_query = new System.Windows.Forms.TabPage();\r
             this.btn_clear = new System.Windows.Forms.Button();\r
             this.label34 = new System.Windows.Forms.Label();\r
@@ -174,11 +179,6 @@ namespace Handbrake
             this.SourceLayoutPanel = new System.Windows.Forms.FlowLayoutPanel();\r
             this.openPreset = new System.Windows.Forms.OpenFileDialog();\r
             this.File_ChapterImport = new System.Windows.Forms.OpenFileDialog();\r
-            this.PictureSettings = new Handbrake.Controls.PictureSettings();\r
-            this.Filters = new Handbrake.Controls.Filters();\r
-            this.AudioSettings = new Handbrake.Controls.AudioPanel();\r
-            this.Subtitles = new Handbrake.Controls.Subtitles();\r
-            this.x264Panel = new Handbrake.Controls.x264Panel();\r
             notifyIconMenu = new System.Windows.Forms.ContextMenuStrip(this.components);\r
             notifyIconMenu.SuspendLayout();\r
             ((System.ComponentModel.ISupportInitialize)(this.slider_videoQuality)).BeginInit();\r
@@ -282,7 +282,7 @@ namespace Handbrake
             this.check_turbo.Enabled = false;\r
             this.check_turbo.Location = new System.Drawing.Point(146, 143);\r
             this.check_turbo.Name = "check_turbo";\r
-            this.check_turbo.Size = new System.Drawing.Size(101, 17);\r
+            this.check_turbo.Size = new System.Drawing.Size(99, 17);\r
             this.check_turbo.TabIndex = 7;\r
             this.check_turbo.Text = "Turbo first Pass";\r
             this.ToolTip.SetToolTip(this.check_turbo, "Makes the first pass of a 2 pass encode faster.");\r
@@ -938,6 +938,15 @@ namespace Handbrake
             this.tab_audio.Text = "Audio";\r
             this.tab_audio.UseVisualStyleBackColor = true;\r
             // \r
+            // AudioSettings\r
+            // \r
+            this.AudioSettings.BackColor = System.Drawing.Color.Transparent;\r
+            this.AudioSettings.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
+            this.AudioSettings.Location = new System.Drawing.Point(0, 0);\r
+            this.AudioSettings.Name = "AudioSettings";\r
+            this.AudioSettings.Size = new System.Drawing.Size(715, 310);\r
+            this.AudioSettings.TabIndex = 0;\r
+            // \r
             // AudioMenuRowHeightHack\r
             // \r
             this.AudioMenuRowHeightHack.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit;\r
@@ -977,7 +986,7 @@ namespace Handbrake
             this.checkMaximumFramerate.BackColor = System.Drawing.Color.Transparent;\r
             this.checkMaximumFramerate.Location = new System.Drawing.Point(125, 89);\r
             this.checkMaximumFramerate.Name = "checkMaximumFramerate";\r
-            this.checkMaximumFramerate.Size = new System.Drawing.Size(132, 17);\r
+            this.checkMaximumFramerate.Size = new System.Drawing.Size(131, 17);\r
             this.checkMaximumFramerate.TabIndex = 19;\r
             this.checkMaximumFramerate.Text = "Peak Framerate (VFR)";\r
             this.checkMaximumFramerate.UseVisualStyleBackColor = false;\r
@@ -988,7 +997,7 @@ namespace Handbrake
             this.radio_cq.BackColor = System.Drawing.Color.Transparent;\r
             this.radio_cq.Location = new System.Drawing.Point(365, 97);\r
             this.radio_cq.Name = "radio_cq";\r
-            this.radio_cq.Size = new System.Drawing.Size(110, 17);\r
+            this.radio_cq.Size = new System.Drawing.Size(105, 17);\r
             this.radio_cq.TabIndex = 18;\r
             this.radio_cq.Text = "Constant Quality:";\r
             this.radio_cq.UseVisualStyleBackColor = false;\r
@@ -1001,7 +1010,7 @@ namespace Handbrake
             this.radio_avgBitrate.Checked = true;\r
             this.radio_avgBitrate.Location = new System.Drawing.Point(365, 64);\r
             this.radio_avgBitrate.Name = "radio_avgBitrate";\r
-            this.radio_avgBitrate.Size = new System.Drawing.Size(116, 17);\r
+            this.radio_avgBitrate.Size = new System.Drawing.Size(112, 17);\r
             this.radio_avgBitrate.TabIndex = 17;\r
             this.radio_avgBitrate.TabStop = true;\r
             this.radio_avgBitrate.Text = "Avg Bitrate (kbps):";\r
@@ -1014,7 +1023,7 @@ namespace Handbrake
             this.radio_targetFilesize.BackColor = System.Drawing.Color.Transparent;\r
             this.radio_targetFilesize.Location = new System.Drawing.Point(365, 37);\r
             this.radio_targetFilesize.Name = "radio_targetFilesize";\r
-            this.radio_targetFilesize.Size = new System.Drawing.Size(108, 17);\r
+            this.radio_targetFilesize.Size = new System.Drawing.Size(107, 17);\r
             this.radio_targetFilesize.TabIndex = 16;\r
             this.radio_targetFilesize.Text = "Target Size (MB):";\r
             this.radio_targetFilesize.UseVisualStyleBackColor = false;\r
@@ -1037,7 +1046,7 @@ namespace Handbrake
             this.check_2PassEncode.BackColor = System.Drawing.Color.Transparent;\r
             this.check_2PassEncode.Location = new System.Drawing.Point(125, 120);\r
             this.check_2PassEncode.Name = "check_2PassEncode";\r
-            this.check_2PassEncode.Size = new System.Drawing.Size(104, 17);\r
+            this.check_2PassEncode.Size = new System.Drawing.Size(106, 17);\r
             this.check_2PassEncode.TabIndex = 6;\r
             this.check_2PassEncode.Text = "2-Pass Encoding";\r
             this.check_2PassEncode.UseVisualStyleBackColor = false;\r
@@ -1087,13 +1096,25 @@ namespace Handbrake
             this.tab_picture.Text = "Picture";\r
             this.tab_picture.UseVisualStyleBackColor = true;\r
             // \r
+            // PictureSettings\r
+            // \r
+            this.PictureSettings.BackColor = System.Drawing.Color.Transparent;\r
+            this.PictureSettings.CurrentlySelectedPreset = null;\r
+            this.PictureSettings.Enabled = false;\r
+            this.PictureSettings.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
+            this.PictureSettings.Location = new System.Drawing.Point(0, 0);\r
+            this.PictureSettings.Name = "PictureSettings";\r
+            this.PictureSettings.PresetMaximumResolution = new System.Drawing.Size(0, 0);\r
+            this.PictureSettings.Size = new System.Drawing.Size(666, 279);\r
+            this.PictureSettings.TabIndex = 0;\r
+            // \r
             // Check_ChapterMarkers\r
             // \r
             this.Check_ChapterMarkers.AutoSize = true;\r
             this.Check_ChapterMarkers.BackColor = System.Drawing.Color.Transparent;\r
             this.Check_ChapterMarkers.Location = new System.Drawing.Point(16, 32);\r
             this.Check_ChapterMarkers.Name = "Check_ChapterMarkers";\r
-            this.Check_ChapterMarkers.Size = new System.Drawing.Size(140, 17);\r
+            this.Check_ChapterMarkers.Size = new System.Drawing.Size(136, 17);\r
             this.Check_ChapterMarkers.TabIndex = 1;\r
             this.Check_ChapterMarkers.Text = "Create chapter markers";\r
             this.Check_ChapterMarkers.UseVisualStyleBackColor = false;\r
@@ -1126,6 +1147,15 @@ namespace Handbrake
             this.tab_filters.Text = "Video Filters";\r
             this.tab_filters.UseVisualStyleBackColor = true;\r
             // \r
+            // Filters\r
+            // \r
+            this.Filters.BackColor = System.Drawing.Color.Transparent;\r
+            this.Filters.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
+            this.Filters.Location = new System.Drawing.Point(0, 0);\r
+            this.Filters.Name = "Filters";\r
+            this.Filters.Size = new System.Drawing.Size(713, 310);\r
+            this.Filters.TabIndex = 0;\r
+            // \r
             // tab_subtitles\r
             // \r
             this.tab_subtitles.Controls.Add(this.Subtitles);\r
@@ -1137,6 +1167,15 @@ namespace Handbrake
             this.tab_subtitles.Text = "Subtitles";\r
             this.tab_subtitles.UseVisualStyleBackColor = true;\r
             // \r
+            // Subtitles\r
+            // \r
+            this.Subtitles.BackColor = System.Drawing.Color.Transparent;\r
+            this.Subtitles.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
+            this.Subtitles.Location = new System.Drawing.Point(0, 0);\r
+            this.Subtitles.Name = "Subtitles";\r
+            this.Subtitles.Size = new System.Drawing.Size(722, 310);\r
+            this.Subtitles.TabIndex = 0;\r
+            // \r
             // tab_chapters\r
             // \r
             this.tab_chapters.BackColor = System.Drawing.Color.Transparent;\r
@@ -1175,6 +1214,16 @@ namespace Handbrake
             this.tab_advanced.Text = "Advanced";\r
             this.tab_advanced.UseVisualStyleBackColor = true;\r
             // \r
+            // x264Panel\r
+            // \r
+            this.x264Panel.BackColor = System.Drawing.Color.Transparent;\r
+            this.x264Panel.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
+            this.x264Panel.Location = new System.Drawing.Point(0, 0);\r
+            this.x264Panel.Name = "x264Panel";\r
+            this.x264Panel.Size = new System.Drawing.Size(720, 306);\r
+            this.x264Panel.TabIndex = 0;\r
+            this.x264Panel.X264Query = "";\r
+            // \r
             // tab_query\r
             // \r
             this.tab_query.Controls.Add(this.btn_clear);\r
@@ -1666,55 +1715,6 @@ namespace Handbrake
             // \r
             this.File_ChapterImport.Filter = "CSV Files|*.csv";\r
             // \r
-            // PictureSettings\r
-            // \r
-            this.PictureSettings.BackColor = System.Drawing.Color.Transparent;\r
-            this.PictureSettings.CurrentlySelectedPreset = null;\r
-            this.PictureSettings.Enabled = false;\r
-            this.PictureSettings.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
-            this.PictureSettings.Location = new System.Drawing.Point(0, 0);\r
-            this.PictureSettings.Name = "PictureSettings";\r
-            this.PictureSettings.PresetMaximumResolution = new System.Drawing.Size(0, 0);\r
-            this.PictureSettings.Size = new System.Drawing.Size(666, 279);\r
-            this.PictureSettings.TabIndex = 0;\r
-            // \r
-            // Filters\r
-            // \r
-            this.Filters.BackColor = System.Drawing.Color.Transparent;\r
-            this.Filters.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
-            this.Filters.Location = new System.Drawing.Point(0, 0);\r
-            this.Filters.Name = "Filters";\r
-            this.Filters.Size = new System.Drawing.Size(713, 310);\r
-            this.Filters.TabIndex = 0;\r
-            // \r
-            // AudioSettings\r
-            // \r
-            this.AudioSettings.BackColor = System.Drawing.Color.Transparent;\r
-            this.AudioSettings.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
-            this.AudioSettings.Location = new System.Drawing.Point(0, 0);\r
-            this.AudioSettings.Name = "AudioSettings";\r
-            this.AudioSettings.Size = new System.Drawing.Size(715, 310);\r
-            this.AudioSettings.TabIndex = 0;\r
-            // \r
-            // Subtitles\r
-            // \r
-            this.Subtitles.BackColor = System.Drawing.Color.Transparent;\r
-            this.Subtitles.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
-            this.Subtitles.Location = new System.Drawing.Point(0, 0);\r
-            this.Subtitles.Name = "Subtitles";\r
-            this.Subtitles.Size = new System.Drawing.Size(722, 310);\r
-            this.Subtitles.TabIndex = 0;\r
-            // \r
-            // x264Panel\r
-            // \r
-            this.x264Panel.BackColor = System.Drawing.Color.Transparent;\r
-            this.x264Panel.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
-            this.x264Panel.Location = new System.Drawing.Point(0, 0);\r
-            this.x264Panel.Name = "x264Panel";\r
-            this.x264Panel.Size = new System.Drawing.Size(720, 306);\r
-            this.x264Panel.TabIndex = 0;\r
-            this.x264Panel.X264Query = "";\r
-            // \r
             // frmMain\r
             // \r
             this.AllowDrop = true;\r
index 2f14676..4d34173 100644 (file)
@@ -57,6 +57,7 @@ namespace Handbrake
         private DVD currentSource;\r
         private IScan SourceScan = new ScanService();\r
         private List<DriveInformation> drives;\r
+        private Job queueEdit;\r
 \r
         // Delegates **********************************************************\r
         private delegate void UpdateWindowHandler();\r
@@ -2208,6 +2209,34 @@ namespace Handbrake
                 }\r
                 UpdateSourceLabel();\r
 \r
+                // This is a bit of a hack to fix the queue editing.\r
+                // If afte the scan, we find a job sitting in queueEdit, then the user has rescaned the source from the queue by clicking edit.\r
+                // When this occures, we want to repopulate their old settings.\r
+                if (queueEdit != null)\r
+                {\r
+                    // Setup UI\r
+                    if (queueEdit.Query != null)\r
+                    {\r
+                        // Send the query from the file to the Query Parser class\r
+                        QueryParser presetQuery = QueryParser.Parse(queueEdit.Query);\r
+\r
+                        // Now load the preset\r
+                        PresetLoader.LoadPreset(this, presetQuery, "Load Back From Queue");\r
+\r
+                        // Set the destination path\r
+                        this.text_destination.Text = queueEdit.Destination;\r
+\r
+                        // The x264 widgets will need updated, so do this now:\r
+                        x264Panel.StandardizeOptString();\r
+                        x264Panel.SetCurrentSettingsInPanel();\r
+\r
+                        // Set the crop label\r
+                        PictureSettings.SetPresetCropWarningLabel(null);\r
+                    }\r
+\r
+                    queueEdit = null;\r
+                }\r
+\r
                 // Enable the GUI components and enable any disabled components\r
                 EnableGUI();\r
             }\r
@@ -2308,28 +2337,13 @@ namespace Handbrake
         /// </param>\r
         public void RecievingJob(Job job)\r
         {\r
-            string query = job.Query;\r
-            StartScan(job.Source, job.Title);\r
-\r
-            if (query != null)\r
-            {\r
-                // Ok, Reset all the H264 widgets before changing the preset\r
-                x264Panel.Reset2Defaults();\r
-\r
-                // Send the query from the file to the Query Parser class\r
-                QueryParser presetQuery = QueryParser.Parse(query);\r
-\r
-                // Now load the preset\r
-                PresetLoader.LoadPreset(this, presetQuery, "Load Back From Queue");\r
-\r
-                // The x264 widgets will need updated, so do this now:\r
-                x264Panel.StandardizeOptString();\r
-                x264Panel.SetCurrentSettingsInPanel();\r
+            // Reset\r
+            this.currentlySelectedPreset = null;\r
+            x264Panel.Reset2Defaults();\r
 \r
-                // Finally, let this window have a copy of the preset settings.\r
-                this.currentlySelectedPreset = null;\r
-                PictureSettings.SetPresetCropWarningLabel(null);\r
-            }\r
+            // Scan\r
+            queueEdit = job; // Nasty but will do for now. TODO\r
+            StartScan(job.Source, job.Title);\r
         }\r
 \r
         #endregion\r