diff --git a/Crowbar/Core/- Application/AppSettings.vb b/Crowbar/Core/- Application/AppSettings.vb index 970c16e..555d9ff 100644 --- a/Crowbar/Core/- Application/AppSettings.vb +++ b/Crowbar/Core/- Application/AppSettings.vb @@ -292,6 +292,18 @@ Public Class AppSettings End Set End Property + Public Property DownloadConvertToExpectedFileOrFolderCheckBoxIsChecked() As Boolean + Get + Return Me.theDownloadConvertToExpectedFileOrFolderCheckBoxIsChecked + End Get + Set(ByVal value As Boolean) + If Me.theDownloadConvertToExpectedFileOrFolderCheckBoxIsChecked <> value Then + Me.theDownloadConvertToExpectedFileOrFolderCheckBoxIsChecked = value + NotifyPropertyChanged("DownloadConvertToExpectedFileOrFolderCheckBoxIsChecked") + End If + End Set + End Property + Public Property UnpackPackagePathFolderOrFileName() As String Get Return Me.theUnpackPackagePathFolderOrFileName @@ -1169,10 +1181,10 @@ Public Class AppSettings Public Property OptionsAutoOpenVpkFileOption() As ActionType Get - Return Me.theOptionsAutoOpenvpkFileOption + Return Me.theOptionsAutoOpenVpkFileOption End Get Set(ByVal value As ActionType) - Me.theOptionsAutoOpenvpkFileOption = value + Me.theOptionsAutoOpenVpkFileOption = value NotifyPropertyChanged("OptionsAutoOpenVpkFileOption") End Set End Property @@ -1479,6 +1491,7 @@ Public Class AppSettings Me.DownloadPrependItemTitleIsChecked = True Me.DownloadAppendItemUpdateDateTimeIsChecked = True Me.DownloadReplaceSpacesWithUnderscoresIsChecked = True + Me.DownloadConvertToExpectedFileOrFolderCheckBoxIsChecked = True End Sub Public Sub SetDefaultUnpackOutputSubfolderName() @@ -1648,6 +1661,7 @@ Public Class AppSettings Private theDownloadPrependItemTitleIsChecked As Boolean Private theDownloadAppendItemUpdateDateTimeIsChecked As Boolean Private theDownloadReplaceSpacesWithUnderscoresIsChecked As Boolean + Private theDownloadConvertToExpectedFileOrFolderCheckBoxIsChecked As Boolean ' Unpack tab @@ -1780,7 +1794,7 @@ Public Class AppSettings ' Publish tab Private thePublishGameSelectedIndex As Integer - Private thePublishSteamAppUserInfos As BindingListExAutoSort(Of SteamAppUserInfo) + Private thePublishSteamAppUserInfos As BindingListExAutoSort(Of SteamAppUserInfo) Private thePublishSearchField As PublishSearchFieldOptions Private thePublishSearchText As String 'Private thePublishDragDroppedContentPath As String diff --git a/Crowbar/Widgets/Main Tabs/DownloadUserControl.Designer.vb b/Crowbar/Widgets/Main Tabs/DownloadUserControl.Designer.vb index 7716ce4..256b694 100644 --- a/Crowbar/Widgets/Main Tabs/DownloadUserControl.Designer.vb +++ b/Crowbar/Widgets/Main Tabs/DownloadUserControl.Designer.vb @@ -21,6 +21,7 @@ Partial Class DownloadUserControl Me.GotoOutputPathButton = New System.Windows.Forms.Button() Me.BrowseForOutputPathButton = New System.Windows.Forms.Button() Me.OptionsGroupBox = New Crowbar.GroupBoxEx() + Me.ConvertToExpectedFileOrFolderCheckBox = New Crowbar.CheckBoxEx() Me.OptionsUseDefaultsButton = New System.Windows.Forms.Button() Me.ReplaceSpacesWithUnderscoresCheckBox = New Crowbar.CheckBoxEx() Me.AppendDateTimeCheckBox = New Crowbar.CheckBoxEx() @@ -35,6 +36,7 @@ Partial Class DownloadUserControl Me.DownloadedItemTextBox = New Crowbar.TextBoxEx() Me.Label1 = New System.Windows.Forms.Label() Me.DownloadedItemButton = New System.Windows.Forms.Button() + Me.ToolTip1 = New System.Windows.Forms.ToolTip(Me.components) Me.OptionsGroupBox.SuspendLayout() Me.SuspendLayout() ' @@ -132,6 +134,7 @@ Partial Class DownloadUserControl ' Me.OptionsGroupBox.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _ Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) + Me.OptionsGroupBox.Controls.Add(Me.ConvertToExpectedFileOrFolderCheckBox) Me.OptionsGroupBox.Controls.Add(Me.OptionsUseDefaultsButton) Me.OptionsGroupBox.Controls.Add(Me.ReplaceSpacesWithUnderscoresCheckBox) Me.OptionsGroupBox.Controls.Add(Me.AppendDateTimeCheckBox) @@ -148,6 +151,18 @@ Partial Class DownloadUserControl Me.OptionsGroupBox.TabStop = False Me.OptionsGroupBox.Text = "Output File Name Options" ' + 'ConvertToExpectedFileOrFolderCheckBox + ' + Me.ConvertToExpectedFileOrFolderCheckBox.AutoSize = True + Me.ConvertToExpectedFileOrFolderCheckBox.IsReadOnly = False + Me.ConvertToExpectedFileOrFolderCheckBox.Location = New System.Drawing.Point(230, 20) + Me.ConvertToExpectedFileOrFolderCheckBox.Name = "ConvertToExpectedFileOrFolderCheckBox" + Me.ConvertToExpectedFileOrFolderCheckBox.Size = New System.Drawing.Size(187, 17) + Me.ConvertToExpectedFileOrFolderCheckBox.TabIndex = 7 + Me.ConvertToExpectedFileOrFolderCheckBox.Text = "Convert to expected file or folder" + Me.ToolTip1.SetToolTip(Me.ConvertToExpectedFileOrFolderCheckBox, "Example: Garry's Mod uses compressed GMA (LZMA) instead of GMA.") + Me.ConvertToExpectedFileOrFolderCheckBox.UseVisualStyleBackColor = True + ' 'OptionsUseDefaultsButton ' Me.OptionsUseDefaultsButton.Location = New System.Drawing.Point(6, 112) @@ -348,4 +363,6 @@ Partial Class DownloadUserControl Friend WithEvents Label1 As Label Friend WithEvents DownloadedItemButton As Button Friend WithEvents ExampleOutputFileNameTextBox As TextBoxEx + Friend WithEvents ConvertToExpectedFileOrFolderCheckBox As CheckBoxEx + Friend WithEvents ToolTip1 As ToolTip End Class diff --git a/Crowbar/Widgets/Main Tabs/DownloadUserControl.resx b/Crowbar/Widgets/Main Tabs/DownloadUserControl.resx index 1af7de1..beae4c1 100644 --- a/Crowbar/Widgets/Main Tabs/DownloadUserControl.resx +++ b/Crowbar/Widgets/Main Tabs/DownloadUserControl.resx @@ -117,4 +117,7 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 17, 17 + \ No newline at end of file diff --git a/Crowbar/Widgets/Main Tabs/DownloadUserControl.vb b/Crowbar/Widgets/Main Tabs/DownloadUserControl.vb index 0b0746f..0c72cf5 100644 --- a/Crowbar/Widgets/Main Tabs/DownloadUserControl.vb +++ b/Crowbar/Widgets/Main Tabs/DownloadUserControl.vb @@ -66,15 +66,15 @@ Public Class DownloadUserControl Me.theBackgroundSteamPipe.Kill() End If - 'RemoveHandler Me.OutputPathTextBox.DataBindings("Text").Parse, AddressOf FileManager.ParsePathFileName + RemoveHandler Me.OutputPathTextBox.DataBindings("Text").Parse, AddressOf FileManager.ParsePathFileName RemoveHandler TheApp.Settings.PropertyChanged, AddressOf AppSettings_PropertyChanged - 'Me.FreeDownloadOptions() + Me.FreeDownloadOptions() - 'Me.FreeOutputPathComboBox() + Me.FreeOutputPathComboBox() - 'Me.ItemIdTextBox.DataBindings.Clear() + Me.ItemIdTextBox.DataBindings.Clear() End Sub Private Sub InitOutputPathComboBox() @@ -100,6 +100,7 @@ Public Class DownloadUserControl Me.PrependTitleCheckBox.DataBindings.Add("Checked", TheApp.Settings, "DownloadPrependItemTitleIsChecked", False, DataSourceUpdateMode.OnPropertyChanged) Me.AppendDateTimeCheckBox.DataBindings.Add("Checked", TheApp.Settings, "DownloadAppendItemUpdateDateTimeIsChecked", False, DataSourceUpdateMode.OnPropertyChanged) Me.ReplaceSpacesWithUnderscoresCheckBox.DataBindings.Add("Checked", TheApp.Settings, "DownloadReplaceSpacesWithUnderscoresIsChecked", False, DataSourceUpdateMode.OnPropertyChanged) + Me.ConvertToExpectedFileOrFolderCheckBox.DataBindings.Add("Checked", TheApp.Settings, "DownloadConvertToExpectedFileOrFolderCheckBoxIsChecked", False, DataSourceUpdateMode.OnPropertyChanged) End Sub Private Sub FreeDownloadOptions() @@ -107,6 +108,7 @@ Public Class DownloadUserControl Me.PrependTitleCheckBox.DataBindings.Clear() Me.AppendDateTimeCheckBox.DataBindings.Clear() Me.ReplaceSpacesWithUnderscoresCheckBox.DataBindings.Clear() + Me.ConvertToExpectedFileOrFolderCheckBox.DataBindings.Clear() End Sub #End Region @@ -698,7 +700,7 @@ Public Class DownloadUserControl End Sub Private Sub ProcessFileAfterDownload(ByRef pathFileName As String) - If Me.theSteamAppInfo IsNot Nothing Then + If Me.theSteamAppInfo IsNot Nothing AndAlso TheApp.Settings.DownloadConvertToExpectedFileOrFolderCheckBoxIsChecked Then Try Me.DownloadButton.Enabled = False Me.CancelDownloadButton.Enabled = True @@ -736,6 +738,14 @@ Public Class DownloadUserControl Me.LogTextBox.AppendText("Final file: """ + pathFileName + """" + vbCrLf) Me.DownloadedItemTextBox.Text = pathFileName End If + + RemoveHandler Me.theProcessAfterDownloadWorker.DoWork, AddressOf ProcessAfterDownloadWorker_DoWork + RemoveHandler Me.theProcessAfterDownloadWorker.ProgressChanged, AddressOf ProcessAfterDownloadWorker_ProgressChanged + RemoveHandler Me.theProcessAfterDownloadWorker.RunWorkerCompleted, AddressOf ProcessAfterDownloadWorker_RunWorkerCompleted + Me.theProcessAfterDownloadWorker = Nothing + + Me.DownloadButton.Enabled = True + Me.CancelDownloadButton.Enabled = False End Sub #End Region