diff --git a/Changelog.md b/Changelog.md index 70895c6..4f9d67d 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,3 +1,13 @@ +# 3.0.0.7 + +- Added + - Ability to run a script after the user download if complete + - Hotkey ```F2``` for additional options in the user creation form +- Fixed + - (Issue #32) In some cases, Date and Time are still not added for Stories and Tagged Photos + - (Issue #33) Instagram Stories downloading error + - LPSG downloader does not download all content + # 3.0.0.6 - Added diff --git a/ProgramScreenshots/CreateUser.png b/ProgramScreenshots/CreateUser.png deleted file mode 100644 index 637177a..0000000 Binary files a/ProgramScreenshots/CreateUser.png and /dev/null differ diff --git a/ProgramScreenshots/CreateUserChannel.png b/ProgramScreenshots/CreateUserChannel.png deleted file mode 100644 index 7d255eb..0000000 Binary files a/ProgramScreenshots/CreateUserChannel.png and /dev/null differ diff --git a/ProgramScreenshots/CreateUserClear.png b/ProgramScreenshots/CreateUserClear.png index 7a8b2da..c1de596 100644 Binary files a/ProgramScreenshots/CreateUserClear.png and b/ProgramScreenshots/CreateUserClear.png differ diff --git a/ProgramScreenshots/MainContext.png b/ProgramScreenshots/MainContext.png index 9253865..48b1ceb 100644 Binary files a/ProgramScreenshots/MainContext.png and b/ProgramScreenshots/MainContext.png differ diff --git a/ProgramScreenshots/MainContext2.png b/ProgramScreenshots/MainContext2.png deleted file mode 100644 index f382bcb..0000000 Binary files a/ProgramScreenshots/MainContext2.png and /dev/null differ diff --git a/ProgramScreenshots/SettingsBasis.png b/ProgramScreenshots/SettingsBasis.png index 4c62877..2d811af 100644 Binary files a/ProgramScreenshots/SettingsBasis.png and b/ProgramScreenshots/SettingsBasis.png differ diff --git a/SCrawler.Plugin.LPSG/Declarations.vb b/SCrawler.Plugin.LPSG/Declarations.vb index 98cf79b..814f03b 100644 --- a/SCrawler.Plugin.LPSG/Declarations.vb +++ b/SCrawler.Plugin.LPSG/Declarations.vb @@ -9,10 +9,15 @@ Imports PersonalUtilities.Functions.RegularExpressions Friend Module Declarations Friend ReadOnly Property PhotoRegEx As RParams = RParams.DM("(https://www.lpsg.com/attachments)(.+?)(?="")", 0, RegexReturn.List) + Friend ReadOnly Property PhotoRegExExt As New RParams("img.data.src=""(/proxy[^""]+?)""", Nothing, 1, RegexReturn.List) With { + .Converter = Function(Input) $"https://www.lpsg.com/{SymbolsConverter.HTML.Decode(Input)}"} Friend ReadOnly Property NextPageRegex As RParams = RParams.DMS(" - - + + diff --git a/SCrawler.Plugin.LPSG/UserData.vb b/SCrawler.Plugin.LPSG/UserData.vb index 48cfa7b..c839d90 100644 --- a/SCrawler.Plugin.LPSG/UserData.vb +++ b/SCrawler.Plugin.LPSG/UserData.vb @@ -9,6 +9,7 @@ Imports PersonalUtilities.Functions.RegularExpressions Imports UStates = SCrawler.Plugin.PluginUserMedia.States Imports UTypes = SCrawler.Plugin.PluginUserMedia.Types +Imports Converters = PersonalUtilities.Functions.SymbolsConverter.Converters Public Class UserData : Implements IPluginContentProvider #Region "XML names" Private Const Name_LatestPage As String = "LatestPage" @@ -60,13 +61,13 @@ Public Class UserData : Implements IPluginContentProvider #End Region Private Property LatestPage As String = String.Empty Private Property Responser As Response = Nothing + Private Enum Mode : Internal : External : End Enum Public Sub GetMedia() Implements IPluginContentProvider.GetMedia Try If Not Responser Is Nothing Then Responser.Dispose() Responser = New Response With Responser : .Copy(Settings.Responser) : .Error = EDP.ThrowException : End With - Dim l As List(Of String) = Nothing Dim NextPage$ Dim r$ Dim _LPage As Func(Of String) = Function() If(LatestPage.IsEmptyString, String.Empty, $"page-{LatestPage}") @@ -78,35 +79,60 @@ Public Class UserData : Implements IPluginContentProvider Thrower.ThrowAny() If Not r.IsEmptyString Then NextPage = RegexReplace(r, NextPageRegex) - l.ListAddList(RegexReplace(r, PhotoRegEx), LAP.NotContainsOnly) + UpdateMediaList(RegexReplace(r, PhotoRegEx), Mode.Internal) + UpdateMediaList(RegexReplace(r, PhotoRegExExt), Mode.External) If NextPage = LatestPage Or NextPage.IsEmptyString Then Exit Do Else LatestPage = NextPage Else Exit Do End If Loop - If l.ListExists Then - Dim f As SFile - For Each u$ In l - If Not IsEmptyString(RegexReplace(u, FileExistsRegEx)) Then - f = CStr(RegexReplace(u, FileRegEx)) - f.Path = DataPath.CSFilePSN - f.Separator = "\" - TempMediaList.Add(New PluginUserMedia With {.ContentType = UTypes.Picture, .URL = u, .File = f}) - End If - Next - If TempMediaList.ListExists And ExistingContentList.ListExists Then _ - TempMediaList.RemoveAll(Function(m) ExistingContentList.Exists(Function(mm) mm.URL = m.URL)) - End If + If TempMediaList.ListExists And ExistingContentList.ListExists Then _ + TempMediaList.RemoveAll(Function(m) ExistingContentList.Exists(Function(mm) mm.URL = m.URL)) Catch oex As OperationCanceledException Catch dex As ObjectDisposedException Catch ex As Exception - LogProvider.Add(ex, "[LPSG.UserData.GetMedia]") + If Responser.StatusCode = Net.HttpStatusCode.ServiceUnavailable Then + LogProvider.Add("LPSG not available") + Else + LogProvider.Add(ex, "[LPSG.UserData.GetMedia]") + End If End Try End Sub + Private Sub UpdateMediaList(ByVal l As List(Of String), ByVal m As Mode) + If l.ListExists Then + Dim f As SFile + Dim u$ + Dim exists As Boolean + Dim r As RParams + Dim ude As New ErrorsDescriber(EDP.ReturnValue) + For Each url$ In l + If Not url.IsEmptyString Then u = SymbolsConverter.Decode(url, {Converters.HTML, Converters.ASCII}, ude) Else u = String.Empty + If Not u.IsEmptyString Then + exists = Not IsEmptyString(RegexReplace(u, FileExistsRegEx)) + If m = Mode.Internal Then + r = FileRegEx + Else + r = FileRegExExt + If Not exists Then + r = FileRegExExt2 + exists = Not IsEmptyString(RegexReplace(u, FileRegExExt2)) + End If + End If + If exists Then + f = CStr(RegexReplace(u, r)) + f.Path = DataPath.CSFilePSN + f.Separator = "\" + If f.Extension.IsEmptyString Then f.Extension = "jpg" + TempMediaList.ListAddValue(New PluginUserMedia With {.ContentType = UTypes.Picture, .URL = url, .File = f}, TempListAddParams) + End If + End If + Next + End If + End Sub Public Sub Download() Implements IPluginContentProvider.Download Try - With Responser : .UseWebClient = True : .UseWebClientCookies = True : End With + With Responser : .UseWebClient = True : .UseWebClientCookies = True : .ResetError() : End With If TempMediaList.ListExists Then Dim m As PluginUserMedia Dim eweb As ErrorsDescriber = EDP.ThrowException @@ -122,8 +148,12 @@ Public Class UserData : Implements IPluginContentProvider Else m.DownloadState = UStates.Skipped End If - Catch ex As Exception - m.DownloadState = UStates.Skipped + Catch wex As Exception + If Responser.Client.StatusCode = Net.HttpStatusCode.ServiceUnavailable Then + LogProvider.Add("LPSG not available") + Else + m.DownloadState = UStates.Skipped + End If End Try RaiseEvent ProgressChanged(1) TempMediaList(i) = m diff --git a/SCrawler/API/Base/UserDataBase.vb b/SCrawler/API/Base/UserDataBase.vb index 215d76b..517cdc3 100644 --- a/SCrawler/API/Base/UserDataBase.vb +++ b/SCrawler/API/Base/UserDataBase.vb @@ -10,6 +10,7 @@ Imports PersonalUtilities.Functions.XML Imports PersonalUtilities.Functions.RegularExpressions Imports PersonalUtilities.Forms.Toolbars Imports PersonalUtilities.Tools.WEB +Imports PersonalUtilities.Tools Imports System.IO Imports System.Net Imports System.Threading @@ -115,6 +116,9 @@ Namespace API.Base Private Const Name_PicturesCount As String = "PicturesCount" Private Const Name_LastUpdated As String = "LastUpdated" + Private Const Name_ScriptUse As String = "ScriptUse" + Private Const Name_ScriptFile As String = "ScriptFile" + Private Const Name_DataMerging As String = "DataMerging" #Region "Downloaded data" Private Const Name_MediaType As String = "Type" @@ -405,6 +409,10 @@ BlockNullPicture: End Get End Property #End Region +#Region "Script" + Friend Overridable Property ScriptUse As Boolean = False Implements IUserData.ScriptUse + Friend Overridable Property ScriptFile As SFile Implements IUserData.ScriptFile +#End Region #End Region #Region "Plugins Support" Protected Event ProgressChanged As IPluginContentProvider.ProgressChangedEventHandler Implements IPluginContentProvider.ProgressChanged @@ -576,6 +584,17 @@ BlockNullPicture: DownloadedVideos(True) = x.Value(Name_VideoCount).FromXML(Of Integer)(0) DownloadedPictures(True) = x.Value(Name_PicturesCount).FromXML(Of Integer)(0) LastUpdated = AConvert(Of Date)(x.Value(Name_LastUpdated), ADateTime.Formats.BaseDateTime, Nothing) + ScriptUse = x.Value(Name_ScriptUse).FromXML(Of Boolean)(False) + Dim s$ = x.Value(Name_ScriptFile) + If Not s.IsEmptyString Then + If SFile.IsDirectory(s) Then + ScriptFile = s + Else + ScriptFile = New SFile(s) With {.Path = MyFile.Path} + End If + Else + ScriptFile = Nothing + End If DataMerging = x.Value(Name_DataMerging).FromXML(Of Boolean)(False) ChangeCollectionName(x.Value(Name_CollectionName), False) Labels.ListAddList(x.Value(Name_LabelsName).StringToList(Of String, List(Of String))("|", EDP.ReturnValue), LAP.NotContainsOnly, LAP.ClearBeforeAdd) @@ -615,6 +634,16 @@ BlockNullPicture: x.Add(Name_VideoCount, DownloadedVideos(True)) x.Add(Name_PicturesCount, DownloadedPictures(True)) x.Add(Name_LastUpdated, AConvert(Of String)(LastUpdated, ADateTime.Formats.BaseDateTime, String.Empty)) + x.Add(Name_ScriptUse, ScriptUse.BoolToInteger) + If Not ScriptFile.IsEmptyString Then + If ScriptFile.Path = MyFile.Path Then + x.Add(Name_ScriptFile, ScriptFile.File) + Else + x.Add(Name_ScriptFile, ScriptFile) + End If + Else + x.Add(Name_ScriptFile, String.Empty) + End If x.Add(Name_CollectionName, CollectionName) x.Add(Name_LabelsName, Labels.ListToString(, "|", EDP.ReturnValue)) x.Add(Name_DataMerging, DataMerging.BoolToInteger) @@ -760,6 +789,7 @@ BlockNullPicture: If DownloadedTotal(False) > 0 Or EnvirChanged.Invoke Then If __SaveData Then LastUpdated = Now + RunScript() DownloadedPictures(True) = SFile.GetFiles(User.File.CutPath, "*.jpg|*.jpeg|*.png|*.gif|*.webm",, EDP.ReturnValue).Count DownloadedVideos(True) = SFile.GetFiles(User.File.CutPath, "*.mp4|*.mkv|*.mov", SearchOption.AllDirectories, EDP.ReturnValue).Count If Labels.Contains(LabelsKeeper.NoParsedUser) Then Labels.Remove(LabelsKeeper.NoParsedUser) @@ -919,16 +949,10 @@ BlockNullPicture: Dim ff As SFile = Nothing Try If Not f.IsEmptyString AndAlso f.Exists Then - Dim d As Date? = m.Post.Date If Settings.FileReplaceNameByDate Then - Dim dd$ = AConvert(Of String)(If(d, Now), FileDateAppenderProvider, String.Empty) ff = f - ff.Name = dd + ff.Name = String.Format(FileDateAppenderPattern, f.Name, CStr(AConvert(Of String)(If(m.Post.Date, Now), FileDateAppenderProvider, String.Empty))) ff = SFile.Indexed_IndexFile(ff,, New NumberedFile(ff)) - ElseIf d.HasValue AndAlso (Settings.FileAddDateToFileName Or Settings.FileAddTimeToFileName) AndAlso - (Not FileDateAppenderProvider Is Nothing And Not FileDateAppenderPattern.IsEmptyString) Then - ff = f - ff.Name = String.Format(FileDateAppenderPattern, f.Name, CStr(AConvert(Of String)(d.Value, FileDateAppenderProvider, String.Empty))) End If If Not ff.Name.IsEmptyString Then My.Computer.FileSystem.RenameFile(f, ff.File) : Return ff End If @@ -938,6 +962,27 @@ BlockNullPicture: Return f End Try End Function + Private Sub RunScript() + Try + If ScriptUse Then + Dim ScriptPattern$ + If Not ScriptFile.IsEmptyString Then + ScriptPattern = ScriptFile + Else + ScriptPattern = Settings.ScriptFile.Value + End If + If Not ScriptPattern.IsEmptyString Then + ScriptPattern &= " {0}" + Using b As New BatchExecutor With {.RedirectStandardError = True} + b.Execute({String.Format(ScriptPattern, MyFile.CutPath(1).ToString)}, EDP.SendInLog + EDP.ThrowException) + If b.HasError Or Not b.ErrorOutput.IsEmptyString Then Throw New Exception(b.ErrorOutput, b.ErrorException) + End Using + End If + End If + Catch ex As Exception + LogError(ex, "script execution error") + End Try + End Sub #End Region #Region "Delete, Move, Merge" Friend Overridable Function Delete() As Integer Implements IUserData.Delete @@ -990,6 +1035,11 @@ BlockNullPicture: End If f.CutPath.Exists(SFO.Path) Directory.Move(UserBefore.File.CutPath(, EDP.ThrowException).Path, f.Path) + If Not ScriptFile.IsEmptyString AndAlso ScriptFile.Path = UserBefore.File.Path Then + Dim ff As SFile = ScriptFile + f.Path = MyFile.Path + ScriptFile = ff + End If Settings.UsersList.Remove(UserBefore) Settings.UpdateUsersList(User) UpdateUserInformation() @@ -1043,6 +1093,11 @@ BlockNullPicture: New ErrorsDescriber(False, False, False, New List(Of SFile))).Count = 0 Then UserBefore.File.CutPath.Delete(SFO.Path, Settings.DeleteMode, EDP.SendInLog) End If + If Not ScriptFile.IsEmptyString AndAlso ScriptFile.Path = UserBefore.File.Path Then + Dim f As SFile = ScriptFile + f.Path = MyFile.Path + ScriptFile = f + End If UpdateUserInformation() End If Catch ioex As InvalidOperationException When ioex.HelpLink = 1 @@ -1207,6 +1262,8 @@ BlockNullPicture: ReadOnly Property Key As String Property DownloadImages As Boolean Property DownloadVideos As Boolean + Property ScriptUse As Boolean + Property ScriptFile As SFile Function GetLVI(ByVal Destination As ListView) As ListViewItem Function GetLVIGroup(ByVal Destination As ListView) As ListViewGroup Sub LoadUserInformation() diff --git a/SCrawler/API/Instagram/UserData.vb b/SCrawler/API/Instagram/UserData.vb index 9561b45..cca72cd 100644 --- a/SCrawler/API/Instagram/UserData.vb +++ b/SCrawler/API/Instagram/UserData.vb @@ -193,6 +193,7 @@ Namespace API.Instagram Case Sections.Stories If Not StoriesRequested Then StoriesList = GetStoriesList() + StoriesRequested = True MySiteSettings.TooManyRequests(False) RequestsCount += 1 ThrowAny(Token) diff --git a/SCrawler/API/UserDataBind.vb b/SCrawler/API/UserDataBind.vb index 3f753f7..a0b2a7e 100644 --- a/SCrawler/API/UserDataBind.vb +++ b/SCrawler/API/UserDataBind.vb @@ -207,6 +207,18 @@ Namespace API Return Count > 0 AndAlso Collections.Exists(Function(c) c.FitToAddParams) End Get End Property + Friend Overrides Property ScriptUse As Boolean + Get + Return Count > 0 AndAlso Collections.Exists(Function(c) c.ScriptUse) + End Get + Set(ByVal u As Boolean) + If Count > 0 Then Collections.ForEach(Sub(ByVal c As IUserData) + Dim b As Boolean = c.ScriptUse = u + c.ScriptUse = u + If Not b Then c.UpdateUserInformation() + End Sub) + End Set + End Property #Region "Context buttons" Friend ReadOnly Property ContextDown As ToolStripMenuItem() Get @@ -336,6 +348,7 @@ Namespace API .Favorite = Favorite .ReadyForDownload = ReadyForDownload ConsolidateLabels() + ConsolidateScripts() .UpdateUserInformation() End If ImageHandler(_Item, False) @@ -381,6 +394,9 @@ Namespace API Collections.ForEach(Sub(c) c.Labels.ListAddList(l, lp)) End If End Sub + Private Sub ConsolidateScripts() + If Count > 1 AndAlso ScriptUse Then Collections.ForEach(Sub(c) c.ScriptUse = True) + End Sub Friend Sub AddRange(ByVal _Items As IEnumerable(Of IUserData)) If Not _Items Is Nothing AndAlso _Items.Count > 0 Then For i% = 0 To _Items.Count - 1 : Add(_Items(i)) : Next diff --git a/SCrawler/Content/Pictures/ScriptPic32.png b/SCrawler/Content/Pictures/ScriptPic32.png new file mode 100644 index 0000000..bd94f7d Binary files /dev/null and b/SCrawler/Content/Pictures/ScriptPic32.png differ diff --git a/SCrawler/Download/VideosDownloaderForm.vb b/SCrawler/Download/VideosDownloaderForm.vb index 5a8f2e0..21fa905 100644 --- a/SCrawler/Download/VideosDownloaderForm.vb +++ b/SCrawler/Download/VideosDownloaderForm.vb @@ -129,7 +129,7 @@ Namespace DownloadObjects With Settings.LatestSavingPath If Not .Value.IsEmptyString Then If .Value.Exists(SFO.Path, False) Then - .Value.Open(SFO.Path, EDP.ShowMainMsg) + GlobalOpenPath(.Value, EDP.ShowMainMsg) Else MsgBoxE($"Path [{ .Value}] does not exists!", MsgBoxStyle.Exclamation) End If diff --git a/SCrawler/Editors/GlobalSettingsForm.Designer.vb b/SCrawler/Editors/GlobalSettingsForm.Designer.vb index 53c69f5..030eca3 100644 --- a/SCrawler/Editors/GlobalSettingsForm.Designer.vb +++ b/SCrawler/Editors/GlobalSettingsForm.Designer.vb @@ -28,6 +28,8 @@ Dim TP_FILE_PATTERNS As System.Windows.Forms.TableLayoutPanel Dim LBL_DATE_POS As System.Windows.Forms.Label Dim ActionButton7 As PersonalUtilities.Forms.Controls.Base.ActionButton = New PersonalUtilities.Forms.Controls.Base.ActionButton() + Dim ActionButton8 As PersonalUtilities.Forms.Controls.Base.ActionButton = New PersonalUtilities.Forms.Controls.Base.ActionButton() + Dim ActionButton9 As PersonalUtilities.Forms.Controls.Base.ActionButton = New PersonalUtilities.Forms.Controls.Base.ActionButton() Dim TT_MAIN As System.Windows.Forms.ToolTip Dim TP_CHANNELS_IMGS As System.Windows.Forms.TableLayoutPanel Dim TAB_BASIS As System.Windows.Forms.TabPage @@ -56,6 +58,7 @@ Me.CH_FAST_LOAD = New System.Windows.Forms.CheckBox() Me.TXT_FOLDER_CMD = New PersonalUtilities.Forms.Controls.TextBoxExtended() Me.CH_RECYCLE_DEL = New System.Windows.Forms.CheckBox() + Me.TXT_SCRIPT = New PersonalUtilities.Forms.Controls.TextBoxExtended() Me.CH_COPY_CHANNEL_USER_IMAGE = New System.Windows.Forms.CheckBox() Me.CH_DEF_TEMP = New System.Windows.Forms.CheckBox() Me.CH_DOWN_IMAGES = New System.Windows.Forms.CheckBox() @@ -93,6 +96,7 @@ TP_FILE_NAME.SuspendLayout() TP_FILE_PATTERNS.SuspendLayout() CType(Me.TXT_FOLDER_CMD, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.TXT_SCRIPT, System.ComponentModel.ISupportInitialize).BeginInit() TP_CHANNELS_IMGS.SuspendLayout() CType(Me.TXT_CHANNELS_ROWS, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.TXT_CHANNELS_COLUMNS, System.ComponentModel.ISupportInitialize).BeginInit() @@ -127,10 +131,11 @@ TP_BASIS.Controls.Add(Me.CH_FAST_LOAD, 0, 12) TP_BASIS.Controls.Add(Me.TXT_FOLDER_CMD, 0, 13) TP_BASIS.Controls.Add(Me.CH_RECYCLE_DEL, 0, 14) + TP_BASIS.Controls.Add(Me.TXT_SCRIPT, 0, 15) TP_BASIS.Dock = System.Windows.Forms.DockStyle.Fill TP_BASIS.Location = New System.Drawing.Point(3, 3) TP_BASIS.Name = "TP_BASIS" - TP_BASIS.RowCount = 16 + TP_BASIS.RowCount = 17 TP_BASIS.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 28.0!)) TP_BASIS.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 28.0!)) TP_BASIS.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 28.0!)) @@ -146,8 +151,9 @@ TP_BASIS.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25.0!)) TP_BASIS.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 28.0!)) TP_BASIS.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25.0!)) + TP_BASIS.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 28.0!)) TP_BASIS.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100.0!)) - TP_BASIS.Size = New System.Drawing.Size(570, 447) + TP_BASIS.Size = New System.Drawing.Size(570, 450) TP_BASIS.TabIndex = 0 ' 'TXT_GLOBAL_PATH @@ -510,6 +516,30 @@ Me.CH_RECYCLE_DEL.Text = "Delete data to recycle bin" Me.CH_RECYCLE_DEL.UseVisualStyleBackColor = True ' + 'TXT_SCRIPT + ' + ActionButton8.BackgroundImage = CType(resources.GetObject("ActionButton8.BackgroundImage"), System.Drawing.Image) + ActionButton8.Index = 0 + ActionButton8.Name = "BTT_OPEN" + ActionButton9.BackgroundImage = CType(resources.GetObject("ActionButton9.BackgroundImage"), System.Drawing.Image) + ActionButton9.Index = 1 + ActionButton9.Name = "BTT_CLEAR" + Me.TXT_SCRIPT.Buttons.Add(ActionButton8) + Me.TXT_SCRIPT.Buttons.Add(ActionButton9) + Me.TXT_SCRIPT.CaptionMode = PersonalUtilities.Forms.Controls.Base.ICaptionControl.Modes.CheckBox + Me.TXT_SCRIPT.CaptionText = "Script" + Me.TXT_SCRIPT.CaptionToolTipEnabled = True + Me.TXT_SCRIPT.CaptionToolTipText = "Default script. If the checkbox is checked, newly created users will be created u" & + "sing the script option." + Me.TXT_SCRIPT.ChangeControlsEnableOnCheckedChange = False + Me.TXT_SCRIPT.Dock = System.Windows.Forms.DockStyle.Fill + Me.TXT_SCRIPT.Location = New System.Drawing.Point(4, 425) + Me.TXT_SCRIPT.Name = "TXT_SCRIPT" + Me.TXT_SCRIPT.PlaceholderEnabled = True + Me.TXT_SCRIPT.PlaceholderText = "Enter script path here..." + Me.TXT_SCRIPT.Size = New System.Drawing.Size(562, 22) + Me.TXT_SCRIPT.TabIndex = 15 + ' 'CH_COPY_CHANNEL_USER_IMAGE ' Me.CH_COPY_CHANNEL_USER_IMAGE.AutoSize = True @@ -659,7 +689,7 @@ TAB_BASIS.Location = New System.Drawing.Point(4, 22) TAB_BASIS.Name = "TAB_BASIS" TAB_BASIS.Padding = New System.Windows.Forms.Padding(3) - TAB_BASIS.Size = New System.Drawing.Size(576, 453) + TAB_BASIS.Size = New System.Drawing.Size(576, 456) TAB_BASIS.TabIndex = 0 TAB_BASIS.Text = "Basis" ' @@ -669,7 +699,7 @@ TAB_DEFAULTS.Location = New System.Drawing.Point(4, 22) TAB_DEFAULTS.Name = "TAB_DEFAULTS" TAB_DEFAULTS.Padding = New System.Windows.Forms.Padding(3) - TAB_DEFAULTS.Size = New System.Drawing.Size(576, 453) + TAB_DEFAULTS.Size = New System.Drawing.Size(576, 481) TAB_DEFAULTS.TabIndex = 1 TAB_DEFAULTS.Text = "Defaults" ' @@ -693,7 +723,7 @@ TP_DEFS.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25.0!)) TP_DEFS.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25.0!)) TP_DEFS.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100.0!)) - TP_DEFS.Size = New System.Drawing.Size(570, 447) + TP_DEFS.Size = New System.Drawing.Size(570, 475) TP_DEFS.TabIndex = 0 ' 'TAB_DEFS_CHANNELS @@ -702,7 +732,7 @@ TAB_DEFS_CHANNELS.Location = New System.Drawing.Point(4, 22) TAB_DEFS_CHANNELS.Name = "TAB_DEFS_CHANNELS" TAB_DEFS_CHANNELS.Padding = New System.Windows.Forms.Padding(3) - TAB_DEFS_CHANNELS.Size = New System.Drawing.Size(576, 453) + TAB_DEFS_CHANNELS.Size = New System.Drawing.Size(576, 481) TAB_DEFS_CHANNELS.TabIndex = 4 TAB_DEFS_CHANNELS.Text = "Channels" ' @@ -726,7 +756,7 @@ TP_CHANNELS.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25.0!)) TP_CHANNELS.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25.0!)) TP_CHANNELS.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100.0!)) - TP_CHANNELS.Size = New System.Drawing.Size(570, 447) + TP_CHANNELS.Size = New System.Drawing.Size(570, 475) TP_CHANNELS.TabIndex = 0 ' 'TXT_CHANNEL_USER_POST_LIMIT @@ -758,7 +788,7 @@ Me.TAB_MAIN.Location = New System.Drawing.Point(0, 0) Me.TAB_MAIN.Name = "TAB_MAIN" Me.TAB_MAIN.SelectedIndex = 0 - Me.TAB_MAIN.Size = New System.Drawing.Size(584, 479) + Me.TAB_MAIN.Size = New System.Drawing.Size(584, 482) Me.TAB_MAIN.TabIndex = 1 ' 'CONTAINER_MAIN @@ -767,13 +797,13 @@ 'CONTAINER_MAIN.ContentPanel ' Me.CONTAINER_MAIN.ContentPanel.Controls.Add(Me.TAB_MAIN) - Me.CONTAINER_MAIN.ContentPanel.Size = New System.Drawing.Size(584, 479) + Me.CONTAINER_MAIN.ContentPanel.Size = New System.Drawing.Size(584, 482) Me.CONTAINER_MAIN.Dock = System.Windows.Forms.DockStyle.Fill Me.CONTAINER_MAIN.LeftToolStripPanelVisible = False Me.CONTAINER_MAIN.Location = New System.Drawing.Point(0, 0) Me.CONTAINER_MAIN.Name = "CONTAINER_MAIN" Me.CONTAINER_MAIN.RightToolStripPanelVisible = False - Me.CONTAINER_MAIN.Size = New System.Drawing.Size(584, 479) + Me.CONTAINER_MAIN.Size = New System.Drawing.Size(584, 507) Me.CONTAINER_MAIN.TabIndex = 0 Me.CONTAINER_MAIN.TopToolStripPanelVisible = False ' @@ -781,15 +811,15 @@ ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(584, 479) + Me.ClientSize = New System.Drawing.Size(584, 507) Me.Controls.Add(Me.CONTAINER_MAIN) Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) Me.KeyPreview = True Me.MaximizeBox = False - Me.MaximumSize = New System.Drawing.Size(600, 518) + Me.MaximumSize = New System.Drawing.Size(600, 546) Me.MinimizeBox = False - Me.MinimumSize = New System.Drawing.Size(600, 518) + Me.MinimumSize = New System.Drawing.Size(600, 546) Me.Name = "GlobalSettingsForm" Me.ShowInTaskbar = False Me.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide @@ -809,6 +839,7 @@ TP_FILE_PATTERNS.ResumeLayout(False) TP_FILE_PATTERNS.PerformLayout() CType(Me.TXT_FOLDER_CMD, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.TXT_SCRIPT, System.ComponentModel.ISupportInitialize).EndInit() TP_CHANNELS_IMGS.ResumeLayout(False) CType(Me.TXT_CHANNELS_ROWS, System.ComponentModel.ISupportInitialize).EndInit() CType(Me.TXT_CHANNELS_COLUMNS, System.ComponentModel.ISupportInitialize).EndInit() @@ -862,5 +893,6 @@ Private WithEvents CH_FAST_LOAD As CheckBox Private WithEvents TXT_FOLDER_CMD As PersonalUtilities.Forms.Controls.TextBoxExtended Private WithEvents CH_RECYCLE_DEL As CheckBox + Private WithEvents TXT_SCRIPT As PersonalUtilities.Forms.Controls.TextBoxExtended End Class End Namespace \ No newline at end of file diff --git a/SCrawler/Editors/GlobalSettingsForm.resx b/SCrawler/Editors/GlobalSettingsForm.resx index 16e5e4e..3a5689c 100644 --- a/SCrawler/Editors/GlobalSettingsForm.resx +++ b/SCrawler/Editors/GlobalSettingsForm.resx @@ -212,6 +212,25 @@ xAAADsQBlSsOGwAAAIZJREFUOE+1j10KwCAMgz2b755xl/IsvnaL2K20UfbDAmEako+ZROSTafjE12Go tbbB43rK5xSAQq1VYFtmeQBoqZTSreVZvgTknM8yyyjA/qodsDF9gspD2Bj6B+DH+NqzhQQAG+POMnSX AFuc5QFgn6ClHh5iOQVAKNixyucB8NY0vG9JOzzyhrdq5IRgAAAAAElFTkSuQmCC + + + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO + wwAADsMBx2+oZAAAAR5JREFUOE+VkjFqwzAUhn2D9iShRyi+QhYbGujg3ZATZPKYdC6FQhPwlAMkg3dP + WQwhyWIyJIUW5NqyPb7oCVtIlhVTwYf8nv7/t2zJagel9KmqKsIACYL9RjI8UHz5zshougZr/AEvbxEP + aZCDBY3VslixaJvX3wzkkDiOwbZtDRGA5vdNAg+TL27qgmt5XkBG/gTdAG7Gt+3PP9oOaEGFCVEC6rp+ + 5g9MfM/c5e4OsEZMZkQEtGL5H2DdZ5JRArDwPA+iKII0TfkC9vroC9j5vq8JTWw3WzWgLMtZGIaa0MR8 + vlAD8PYlSaIJTTiOowY0p0Bc19XEJo6HE59FAPuMzyAINKGJ1XLFZxHALtMrnkBXOIQIIIQ8YvF/KrgB + cMaRN0UdBBkAAAAASUVORK5CYII= + + + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO + xAAADsQBlSsOGwAAAIZJREFUOE+1j10KwCAMgz2b755xl/IsvnaL2K20UfbDAmEako+ZROSTafjE12Go + tbbB43rK5xSAQq1VYFtmeQBoqZTSreVZvgTknM8yyyjA/qodsDF9gspD2Bj6B+DH+NqzhQQAG+POMnSX + AFuc5QFgn6ClHh5iOQVAKNixyucB8NY0vG9JOzzyhrdq5IRgAAAAAElFTkSuQmCC diff --git a/SCrawler/Editors/GlobalSettingsForm.vb b/SCrawler/Editors/GlobalSettingsForm.vb index 05ec89e..50cbe97 100644 --- a/SCrawler/Editors/GlobalSettingsForm.vb +++ b/SCrawler/Editors/GlobalSettingsForm.vb @@ -36,6 +36,8 @@ Namespace Editors TXT_FOLDER_CMD.Text = .OpenFolderInOtherProgram TXT_FOLDER_CMD.Checked = .OpenFolderInOtherProgram.Attribute CH_RECYCLE_DEL.Checked = .DeleteToRecycleBin + TXT_SCRIPT.Checked = .ScriptFile.Attribute + TXT_SCRIPT.Text = .ScriptFile.Value 'Defaults CH_SEPARATE_VIDEO_FOLDER.Checked = .SeparateVideoFolder.Value CH_DEF_TEMP.Checked = .DefaultTemporary @@ -123,6 +125,8 @@ Namespace Editors .OpenFolderInOtherProgram.Value = TXT_FOLDER_CMD.Text .OpenFolderInOtherProgram.Attribute.Value = TXT_FOLDER_CMD.Checked .DeleteToRecycleBin.Value = CH_RECYCLE_DEL.Checked + .ScriptFile.Value = TXT_SCRIPT.Text + .ScriptFile.Attribute.Value = TXT_SCRIPT.Checked 'Defaults .SeparateVideoFolder.Value = CH_SEPARATE_VIDEO_FOLDER.Checked .DefaultTemporary.Value = CH_DEF_TEMP.Checked @@ -195,6 +199,12 @@ Namespace Editors CH_FILE_TIME.Enabled = b ChangePositionControlsEnabling() End Sub + Private Sub TXT_SCRIPT_ActionOnButtonClick(ByVal Sender As ActionButton) Handles TXT_SCRIPT.ActionOnButtonClick + If Sender.DefaultButton = ActionButton.DefaultButtons.Open Then + Dim f As SFile = SFile.SelectFiles(TXT_SCRIPT.Text, False, "Select script file",, EDP.None).FirstOrDefault + If Not f.IsEmptyString Then TXT_SCRIPT.Text = f + End If + End Sub Private Sub CH_COPY_CHANNEL_USER_IMAGE_CheckedChanged(sender As Object, e As EventArgs) Handles CH_COPY_CHANNEL_USER_IMAGE.CheckedChanged CH_COPY_CHANNEL_USER_IMAGE_ALL.Enabled = CH_COPY_CHANNEL_USER_IMAGE.Checked End Sub diff --git a/SCrawler/Editors/UserCreatorForm.Designer.vb b/SCrawler/Editors/UserCreatorForm.Designer.vb index b5c954a..234473e 100644 --- a/SCrawler/Editors/UserCreatorForm.Designer.vb +++ b/SCrawler/Editors/UserCreatorForm.Designer.vb @@ -29,6 +29,8 @@ Dim TP_DOWN_OPTIONS As System.Windows.Forms.TableLayoutPanel Dim ActionButton5 As PersonalUtilities.Forms.Controls.Base.ActionButton = New PersonalUtilities.Forms.Controls.Base.ActionButton() Dim ActionButton6 As PersonalUtilities.Forms.Controls.Base.ActionButton = New PersonalUtilities.Forms.Controls.Base.ActionButton() + Dim ActionButton7 As PersonalUtilities.Forms.Controls.Base.ActionButton = New PersonalUtilities.Forms.Controls.Base.ActionButton() + Dim ActionButton8 As PersonalUtilities.Forms.Controls.Base.ActionButton = New PersonalUtilities.Forms.Controls.Base.ActionButton() Dim TT_MAIN As System.Windows.Forms.ToolTip Me.TXT_USER = New PersonalUtilities.Forms.Controls.TextBoxExtended() Me.CH_IS_CHANNEL = New System.Windows.Forms.CheckBox() @@ -47,6 +49,7 @@ Me.CH_DOWN_IMAGES = New System.Windows.Forms.CheckBox() Me.CH_DOWN_VIDEOS = New System.Windows.Forms.CheckBox() Me.TXT_SPEC_FOLDER = New PersonalUtilities.Forms.Controls.TextBoxExtended() + Me.TXT_SCRIPT = New PersonalUtilities.Forms.Controls.TextBoxExtended() Me.CONTAINER_MAIN = New System.Windows.Forms.ToolStripContainer() TP_MAIN = New System.Windows.Forms.TableLayoutPanel() TP_SITE = New System.Windows.Forms.TableLayoutPanel() @@ -66,6 +69,7 @@ CType(Me.TXT_LABELS, System.ComponentModel.ISupportInitialize).BeginInit() TP_DOWN_OPTIONS.SuspendLayout() CType(Me.TXT_SPEC_FOLDER, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.TXT_SCRIPT, System.ComponentModel.ISupportInitialize).BeginInit() Me.CONTAINER_MAIN.ContentPanel.SuspendLayout() Me.CONTAINER_MAIN.SuspendLayout() Me.SuspendLayout() @@ -79,27 +83,29 @@ TP_MAIN.Controls.Add(TP_SITE, 0, 3) TP_MAIN.Controls.Add(TP_PARAMS, 0, 4) TP_MAIN.Controls.Add(TP_OTHER, 0, 6) - TP_MAIN.Controls.Add(Me.TXT_DESCR, 0, 9) + TP_MAIN.Controls.Add(Me.TXT_DESCR, 0, 10) TP_MAIN.Controls.Add(Me.TXT_USER_FRIENDLY, 0, 1) TP_MAIN.Controls.Add(Me.TP_ADD_BY_LIST, 0, 7) TP_MAIN.Controls.Add(Me.TXT_LABELS, 0, 8) TP_MAIN.Controls.Add(TP_DOWN_OPTIONS, 0, 5) TP_MAIN.Controls.Add(Me.TXT_SPEC_FOLDER, 0, 2) + TP_MAIN.Controls.Add(Me.TXT_SCRIPT, 0, 9) TP_MAIN.Dock = System.Windows.Forms.DockStyle.Fill TP_MAIN.Location = New System.Drawing.Point(0, 0) TP_MAIN.Name = "TP_MAIN" - TP_MAIN.RowCount = 10 + TP_MAIN.RowCount = 11 TP_MAIN.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 28.0!)) TP_MAIN.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 28.0!)) TP_MAIN.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 28.0!)) - TP_MAIN.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 16.66708!)) - TP_MAIN.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 16.66708!)) - TP_MAIN.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 16.66667!)) - TP_MAIN.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 16.66708!)) - TP_MAIN.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 16.66542!)) - TP_MAIN.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 16.66667!)) - TP_MAIN.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 150.0!)) - TP_MAIN.Size = New System.Drawing.Size(454, 431) + TP_MAIN.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 28.0!)) + TP_MAIN.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 28.0!)) + TP_MAIN.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 28.0!)) + TP_MAIN.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 28.0!)) + TP_MAIN.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 28.0!)) + TP_MAIN.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 26.0!)) + TP_MAIN.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 26.0!)) + TP_MAIN.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100.0!)) + TP_MAIN.Size = New System.Drawing.Size(454, 461) TP_MAIN.TabIndex = 0 ' 'TXT_USER @@ -119,7 +125,7 @@ TP_SITE.ColumnCount = 3 TP_SITE.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 79.0!)) TP_SITE.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100.0!)) - TP_SITE.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 88.0!)) + TP_SITE.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 92.0!)) TP_SITE.Controls.Add(Me.CH_IS_CHANNEL, 0, 0) TP_SITE.Controls.Add(Me.CMB_SITE, 1, 0) TP_SITE.Controls.Add(Me.BTT_OTHER_SETTINGS, 2, 0) @@ -129,7 +135,7 @@ TP_SITE.Name = "TP_SITE" TP_SITE.RowCount = 1 TP_SITE.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100.0!)) - TP_SITE.Size = New System.Drawing.Size(452, 31) + TP_SITE.Size = New System.Drawing.Size(452, 28) TP_SITE.TabIndex = 3 ' 'CH_IS_CHANNEL @@ -138,7 +144,7 @@ Me.CH_IS_CHANNEL.Dock = System.Windows.Forms.DockStyle.Fill Me.CH_IS_CHANNEL.Location = New System.Drawing.Point(4, 4) Me.CH_IS_CHANNEL.Name = "CH_IS_CHANNEL" - Me.CH_IS_CHANNEL.Size = New System.Drawing.Size(73, 23) + Me.CH_IS_CHANNEL.Size = New System.Drawing.Size(73, 20) Me.CH_IS_CHANNEL.TabIndex = 0 Me.CH_IS_CHANNEL.Text = "Channel" Me.CH_IS_CHANNEL.UseVisualStyleBackColor = True @@ -160,22 +166,22 @@ Me.CMB_SITE.Columns.Add(ListColumn1) Me.CMB_SITE.Columns.Add(ListColumn2) Me.CMB_SITE.Dock = System.Windows.Forms.DockStyle.Fill - Me.CMB_SITE.Location = New System.Drawing.Point(84, 2) - Me.CMB_SITE.Margin = New System.Windows.Forms.Padding(3, 1, 3, 3) + Me.CMB_SITE.Location = New System.Drawing.Point(84, 3) + Me.CMB_SITE.Margin = New System.Windows.Forms.Padding(3, 2, 3, 3) Me.CMB_SITE.Name = "CMB_SITE" - Me.CMB_SITE.Size = New System.Drawing.Size(275, 22) + Me.CMB_SITE.Size = New System.Drawing.Size(271, 22) Me.CMB_SITE.TabIndex = 1 Me.CMB_SITE.TextBoxBorderStyle = System.Windows.Forms.BorderStyle.FixedSingle ' 'BTT_OTHER_SETTINGS ' Me.BTT_OTHER_SETTINGS.Dock = System.Windows.Forms.DockStyle.Fill - Me.BTT_OTHER_SETTINGS.Location = New System.Drawing.Point(364, 2) + Me.BTT_OTHER_SETTINGS.Location = New System.Drawing.Point(360, 2) Me.BTT_OTHER_SETTINGS.Margin = New System.Windows.Forms.Padding(1) Me.BTT_OTHER_SETTINGS.Name = "BTT_OTHER_SETTINGS" - Me.BTT_OTHER_SETTINGS.Size = New System.Drawing.Size(86, 27) + Me.BTT_OTHER_SETTINGS.Size = New System.Drawing.Size(90, 24) Me.BTT_OTHER_SETTINGS.TabIndex = 2 - Me.BTT_OTHER_SETTINGS.Text = "Options" + Me.BTT_OTHER_SETTINGS.Text = "Options (F2)" TT_MAIN.SetToolTip(Me.BTT_OTHER_SETTINGS, "Other settings") Me.BTT_OTHER_SETTINGS.UseVisualStyleBackColor = True ' @@ -188,13 +194,13 @@ TP_PARAMS.Controls.Add(Me.CH_TEMP, 0, 0) TP_PARAMS.Controls.Add(Me.CH_FAV, 1, 0) TP_PARAMS.Dock = System.Windows.Forms.DockStyle.Fill - TP_PARAMS.Location = New System.Drawing.Point(1, 120) + TP_PARAMS.Location = New System.Drawing.Point(1, 117) TP_PARAMS.Margin = New System.Windows.Forms.Padding(0) TP_PARAMS.Name = "TP_PARAMS" TP_PARAMS.RowCount = 1 TP_PARAMS.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100.0!)) - TP_PARAMS.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 30.0!)) - TP_PARAMS.Size = New System.Drawing.Size(452, 31) + TP_PARAMS.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 27.0!)) + TP_PARAMS.Size = New System.Drawing.Size(452, 28) TP_PARAMS.TabIndex = 4 ' 'CH_TEMP @@ -203,7 +209,7 @@ Me.CH_TEMP.Dock = System.Windows.Forms.DockStyle.Fill Me.CH_TEMP.Location = New System.Drawing.Point(4, 4) Me.CH_TEMP.Name = "CH_TEMP" - Me.CH_TEMP.Size = New System.Drawing.Size(218, 23) + Me.CH_TEMP.Size = New System.Drawing.Size(218, 20) Me.CH_TEMP.TabIndex = 0 Me.CH_TEMP.Text = "Temporary" Me.CH_TEMP.UseVisualStyleBackColor = True @@ -214,7 +220,7 @@ Me.CH_FAV.Dock = System.Windows.Forms.DockStyle.Fill Me.CH_FAV.Location = New System.Drawing.Point(229, 4) Me.CH_FAV.Name = "CH_FAV" - Me.CH_FAV.Size = New System.Drawing.Size(219, 23) + Me.CH_FAV.Size = New System.Drawing.Size(219, 20) Me.CH_FAV.TabIndex = 1 Me.CH_FAV.Text = "Favorite" Me.CH_FAV.UseVisualStyleBackColor = True @@ -228,13 +234,13 @@ TP_OTHER.Controls.Add(Me.CH_PARSE_USER_MEDIA, 1, 0) TP_OTHER.Controls.Add(Me.CH_READY_FOR_DOWN, 0, 0) TP_OTHER.Dock = System.Windows.Forms.DockStyle.Fill - TP_OTHER.Location = New System.Drawing.Point(1, 184) + TP_OTHER.Location = New System.Drawing.Point(1, 175) TP_OTHER.Margin = New System.Windows.Forms.Padding(0) TP_OTHER.Name = "TP_OTHER" TP_OTHER.RowCount = 1 TP_OTHER.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100.0!)) - TP_OTHER.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 30.0!)) - TP_OTHER.Size = New System.Drawing.Size(452, 31) + TP_OTHER.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 27.0!)) + TP_OTHER.Size = New System.Drawing.Size(452, 28) TP_OTHER.TabIndex = 6 ' 'CH_PARSE_USER_MEDIA @@ -243,7 +249,7 @@ Me.CH_PARSE_USER_MEDIA.Dock = System.Windows.Forms.DockStyle.Fill Me.CH_PARSE_USER_MEDIA.Location = New System.Drawing.Point(229, 4) Me.CH_PARSE_USER_MEDIA.Name = "CH_PARSE_USER_MEDIA" - Me.CH_PARSE_USER_MEDIA.Size = New System.Drawing.Size(219, 23) + Me.CH_PARSE_USER_MEDIA.Size = New System.Drawing.Size(219, 20) Me.CH_PARSE_USER_MEDIA.TabIndex = 0 Me.CH_PARSE_USER_MEDIA.Text = "Get user media only" TT_MAIN.SetToolTip(Me.CH_PARSE_USER_MEDIA, "For twitter only!" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & "If checked then user media only will be downloaded." & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & "Otherwise" & @@ -256,7 +262,7 @@ Me.CH_READY_FOR_DOWN.Dock = System.Windows.Forms.DockStyle.Fill Me.CH_READY_FOR_DOWN.Location = New System.Drawing.Point(4, 4) Me.CH_READY_FOR_DOWN.Name = "CH_READY_FOR_DOWN" - Me.CH_READY_FOR_DOWN.Size = New System.Drawing.Size(218, 23) + Me.CH_READY_FOR_DOWN.Size = New System.Drawing.Size(218, 20) Me.CH_READY_FOR_DOWN.TabIndex = 1 Me.CH_READY_FOR_DOWN.Text = "Ready for download" TT_MAIN.SetToolTip(Me.CH_READY_FOR_DOWN, "Can be downloaded by [Download All]") @@ -275,11 +281,11 @@ Me.TXT_DESCR.Dock = System.Windows.Forms.DockStyle.Fill Me.TXT_DESCR.GroupBoxed = True Me.TXT_DESCR.GroupBoxText = "Description" - Me.TXT_DESCR.Location = New System.Drawing.Point(4, 282) + Me.TXT_DESCR.Location = New System.Drawing.Point(4, 290) Me.TXT_DESCR.Multiline = True Me.TXT_DESCR.Name = "TXT_DESCR" - Me.TXT_DESCR.Size = New System.Drawing.Size(446, 145) - Me.TXT_DESCR.TabIndex = 9 + Me.TXT_DESCR.Size = New System.Drawing.Size(446, 167) + Me.TXT_DESCR.TabIndex = 10 ' 'TXT_USER_FRIENDLY ' @@ -300,12 +306,12 @@ Me.TP_ADD_BY_LIST.Controls.Add(Me.CH_ADD_BY_LIST, 0, 0) Me.TP_ADD_BY_LIST.Controls.Add(Me.CH_AUTO_DETECT_SITE, 1, 0) Me.TP_ADD_BY_LIST.Dock = System.Windows.Forms.DockStyle.Fill - Me.TP_ADD_BY_LIST.Location = New System.Drawing.Point(1, 216) + Me.TP_ADD_BY_LIST.Location = New System.Drawing.Point(1, 204) Me.TP_ADD_BY_LIST.Margin = New System.Windows.Forms.Padding(0) Me.TP_ADD_BY_LIST.Name = "TP_ADD_BY_LIST" Me.TP_ADD_BY_LIST.RowCount = 1 Me.TP_ADD_BY_LIST.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100.0!)) - Me.TP_ADD_BY_LIST.Size = New System.Drawing.Size(452, 30) + Me.TP_ADD_BY_LIST.Size = New System.Drawing.Size(452, 28) Me.TP_ADD_BY_LIST.TabIndex = 7 ' 'CH_ADD_BY_LIST @@ -314,7 +320,7 @@ Me.CH_ADD_BY_LIST.Dock = System.Windows.Forms.DockStyle.Fill Me.CH_ADD_BY_LIST.Location = New System.Drawing.Point(4, 4) Me.CH_ADD_BY_LIST.Name = "CH_ADD_BY_LIST" - Me.CH_ADD_BY_LIST.Size = New System.Drawing.Size(218, 22) + Me.CH_ADD_BY_LIST.Size = New System.Drawing.Size(218, 20) Me.CH_ADD_BY_LIST.TabIndex = 0 Me.CH_ADD_BY_LIST.Text = "Add by list" Me.CH_ADD_BY_LIST.UseVisualStyleBackColor = True @@ -325,7 +331,7 @@ Me.CH_AUTO_DETECT_SITE.Dock = System.Windows.Forms.DockStyle.Fill Me.CH_AUTO_DETECT_SITE.Location = New System.Drawing.Point(229, 4) Me.CH_AUTO_DETECT_SITE.Name = "CH_AUTO_DETECT_SITE" - Me.CH_AUTO_DETECT_SITE.Size = New System.Drawing.Size(219, 22) + Me.CH_AUTO_DETECT_SITE.Size = New System.Drawing.Size(219, 20) Me.CH_AUTO_DETECT_SITE.TabIndex = 1 Me.CH_AUTO_DETECT_SITE.Text = "Auto detect site" Me.CH_AUTO_DETECT_SITE.UseVisualStyleBackColor = True @@ -343,7 +349,8 @@ Me.TXT_LABELS.CaptionText = "Labels" Me.TXT_LABELS.CaptionWidth = 50.0R Me.TXT_LABELS.Dock = System.Windows.Forms.DockStyle.Fill - Me.TXT_LABELS.Location = New System.Drawing.Point(4, 250) + Me.TXT_LABELS.Location = New System.Drawing.Point(4, 235) + Me.TXT_LABELS.Margin = New System.Windows.Forms.Padding(3, 2, 3, 3) Me.TXT_LABELS.Name = "TXT_LABELS" Me.TXT_LABELS.Size = New System.Drawing.Size(446, 22) Me.TXT_LABELS.TabIndex = 8 @@ -358,13 +365,13 @@ TP_DOWN_OPTIONS.Controls.Add(Me.CH_DOWN_IMAGES, 0, 0) TP_DOWN_OPTIONS.Controls.Add(Me.CH_DOWN_VIDEOS, 1, 0) TP_DOWN_OPTIONS.Dock = System.Windows.Forms.DockStyle.Fill - TP_DOWN_OPTIONS.Location = New System.Drawing.Point(1, 152) + TP_DOWN_OPTIONS.Location = New System.Drawing.Point(1, 146) TP_DOWN_OPTIONS.Margin = New System.Windows.Forms.Padding(0) TP_DOWN_OPTIONS.Name = "TP_DOWN_OPTIONS" TP_DOWN_OPTIONS.RowCount = 1 TP_DOWN_OPTIONS.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100.0!)) - TP_DOWN_OPTIONS.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 30.0!)) - TP_DOWN_OPTIONS.Size = New System.Drawing.Size(452, 31) + TP_DOWN_OPTIONS.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 27.0!)) + TP_DOWN_OPTIONS.Size = New System.Drawing.Size(452, 28) TP_DOWN_OPTIONS.TabIndex = 5 ' 'CH_DOWN_IMAGES @@ -373,7 +380,7 @@ Me.CH_DOWN_IMAGES.Dock = System.Windows.Forms.DockStyle.Fill Me.CH_DOWN_IMAGES.Location = New System.Drawing.Point(4, 4) Me.CH_DOWN_IMAGES.Name = "CH_DOWN_IMAGES" - Me.CH_DOWN_IMAGES.Size = New System.Drawing.Size(218, 23) + Me.CH_DOWN_IMAGES.Size = New System.Drawing.Size(218, 20) Me.CH_DOWN_IMAGES.TabIndex = 0 Me.CH_DOWN_IMAGES.Text = "Download Images" Me.CH_DOWN_IMAGES.UseVisualStyleBackColor = True @@ -384,7 +391,7 @@ Me.CH_DOWN_VIDEOS.Dock = System.Windows.Forms.DockStyle.Fill Me.CH_DOWN_VIDEOS.Location = New System.Drawing.Point(229, 4) Me.CH_DOWN_VIDEOS.Name = "CH_DOWN_VIDEOS" - Me.CH_DOWN_VIDEOS.Size = New System.Drawing.Size(219, 23) + Me.CH_DOWN_VIDEOS.Size = New System.Drawing.Size(219, 20) Me.CH_DOWN_VIDEOS.TabIndex = 1 Me.CH_DOWN_VIDEOS.Text = "Download videos" Me.CH_DOWN_VIDEOS.UseVisualStyleBackColor = True @@ -408,19 +415,45 @@ Me.TXT_SPEC_FOLDER.Size = New System.Drawing.Size(446, 22) Me.TXT_SPEC_FOLDER.TabIndex = 2 ' + 'TXT_SCRIPT + ' + ActionButton7.BackgroundImage = CType(resources.GetObject("ActionButton7.BackgroundImage"), System.Drawing.Image) + ActionButton7.Enabled = False + ActionButton7.Index = 0 + ActionButton7.Name = "BTT_OPEN" + ActionButton8.BackgroundImage = CType(resources.GetObject("ActionButton8.BackgroundImage"), System.Drawing.Image) + ActionButton8.Enabled = False + ActionButton8.Index = 1 + ActionButton8.Name = "BTT_CLEAR" + Me.TXT_SCRIPT.Buttons.Add(ActionButton7) + Me.TXT_SCRIPT.Buttons.Add(ActionButton8) + Me.TXT_SCRIPT.CaptionMode = PersonalUtilities.Forms.Controls.Base.ICaptionControl.Modes.CheckBox + Me.TXT_SCRIPT.CaptionText = "Script" + Me.TXT_SCRIPT.CaptionToolTipEnabled = True + Me.TXT_SCRIPT.CaptionToolTipText = "Execute script after downloading this user" + Me.TXT_SCRIPT.CaptionWidth = 65.0R + Me.TXT_SCRIPT.Dock = System.Windows.Forms.DockStyle.Fill + Me.TXT_SCRIPT.Location = New System.Drawing.Point(4, 262) + Me.TXT_SCRIPT.Margin = New System.Windows.Forms.Padding(3, 2, 3, 3) + Me.TXT_SCRIPT.Name = "TXT_SCRIPT" + Me.TXT_SCRIPT.PlaceholderEnabled = True + Me.TXT_SCRIPT.PlaceholderText = "Leave blank to use the default script..." + Me.TXT_SCRIPT.Size = New System.Drawing.Size(446, 22) + Me.TXT_SCRIPT.TabIndex = 9 + ' 'CONTAINER_MAIN ' ' 'CONTAINER_MAIN.ContentPanel ' Me.CONTAINER_MAIN.ContentPanel.Controls.Add(TP_MAIN) - Me.CONTAINER_MAIN.ContentPanel.Size = New System.Drawing.Size(454, 431) + Me.CONTAINER_MAIN.ContentPanel.Size = New System.Drawing.Size(454, 461) Me.CONTAINER_MAIN.Dock = System.Windows.Forms.DockStyle.Fill Me.CONTAINER_MAIN.LeftToolStripPanelVisible = False Me.CONTAINER_MAIN.Location = New System.Drawing.Point(0, 0) Me.CONTAINER_MAIN.Name = "CONTAINER_MAIN" Me.CONTAINER_MAIN.RightToolStripPanelVisible = False - Me.CONTAINER_MAIN.Size = New System.Drawing.Size(454, 431) + Me.CONTAINER_MAIN.Size = New System.Drawing.Size(454, 461) Me.CONTAINER_MAIN.TabIndex = 0 Me.CONTAINER_MAIN.TopToolStripPanelVisible = False ' @@ -428,15 +461,15 @@ ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(454, 431) + Me.ClientSize = New System.Drawing.Size(454, 461) Me.Controls.Add(Me.CONTAINER_MAIN) Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) Me.KeyPreview = True Me.MaximizeBox = False - Me.MaximumSize = New System.Drawing.Size(470, 470) + Me.MaximumSize = New System.Drawing.Size(470, 500) Me.MinimizeBox = False - Me.MinimumSize = New System.Drawing.Size(470, 470) + Me.MinimumSize = New System.Drawing.Size(470, 500) Me.Name = "UserCreatorForm" Me.ShowInTaskbar = False Me.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide @@ -458,6 +491,7 @@ TP_DOWN_OPTIONS.ResumeLayout(False) TP_DOWN_OPTIONS.PerformLayout() CType(Me.TXT_SPEC_FOLDER, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.TXT_SCRIPT, System.ComponentModel.ISupportInitialize).EndInit() Me.CONTAINER_MAIN.ContentPanel.ResumeLayout(False) Me.CONTAINER_MAIN.ResumeLayout(False) Me.CONTAINER_MAIN.PerformLayout() @@ -483,5 +517,6 @@ Private WithEvents TXT_SPEC_FOLDER As PersonalUtilities.Forms.Controls.TextBoxExtended Private WithEvents CMB_SITE As PersonalUtilities.Forms.Controls.ComboBoxExtended Private WithEvents BTT_OTHER_SETTINGS As Button + Private WithEvents TXT_SCRIPT As PersonalUtilities.Forms.Controls.TextBoxExtended End Class End Namespace \ No newline at end of file diff --git a/SCrawler/Editors/UserCreatorForm.resx b/SCrawler/Editors/UserCreatorForm.resx index 0fda744..66a09fe 100644 --- a/SCrawler/Editors/UserCreatorForm.resx +++ b/SCrawler/Editors/UserCreatorForm.resx @@ -273,6 +273,25 @@ xAAADsQBlSsOGwAAAIZJREFUOE+1j10KwCAMgz2b755xl/IsvnaL2K20UfbDAmEako+ZROSTafjE12Go tbbB43rK5xSAQq1VYFtmeQBoqZTSreVZvgTknM8yyyjA/qodsDF9gspD2Bj6B+DH+NqzhQQAG+POMnSX AFuc5QFgn6ClHh5iOQVAKNixyucB8NY0vG9JOzzyhrdq5IRgAAAAAElFTkSuQmCC + + + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO + wwAADsMBx2+oZAAAAR5JREFUOE+VkjFqwzAUhn2D9iShRyi+QhYbGujg3ZATZPKYdC6FQhPwlAMkg3dP + WQwhyWIyJIUW5NqyPb7oCVtIlhVTwYf8nv7/t2zJagel9KmqKsIACYL9RjI8UHz5zshougZr/AEvbxEP + aZCDBY3VslixaJvX3wzkkDiOwbZtDRGA5vdNAg+TL27qgmt5XkBG/gTdAG7Gt+3PP9oOaEGFCVEC6rp+ + 5g9MfM/c5e4OsEZMZkQEtGL5H2DdZ5JRArDwPA+iKII0TfkC9vroC9j5vq8JTWw3WzWgLMtZGIaa0MR8 + vlAD8PYlSaIJTTiOowY0p0Bc19XEJo6HE59FAPuMzyAINKGJ1XLFZxHALtMrnkBXOIQIIIQ8YvF/KrgB + cMaRN0UdBBkAAAAASUVORK5CYII= + + + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO + xAAADsQBlSsOGwAAAIZJREFUOE+1j10KwCAMgz2b755xl/IsvnaL2K20UfbDAmEako+ZROSTafjE12Go + tbbB43rK5xSAQq1VYFtmeQBoqZTSreVZvgTknM8yyyjA/qodsDF9gspD2Bj6B+DH+NqzhQQAG+POMnSX + AFuc5QFgn6ClHh5iOQVAKNixyucB8NY0vG9JOzzyhrdq5IRgAAAAAElFTkSuQmCC diff --git a/SCrawler/Editors/UserCreatorForm.vb b/SCrawler/Editors/UserCreatorForm.vb index 9363df1..2cdd07b 100644 --- a/SCrawler/Editors/UserCreatorForm.vb +++ b/SCrawler/Editors/UserCreatorForm.vb @@ -15,6 +15,7 @@ Imports PersonalUtilities.Functions.RegularExpressions Imports SCrawler.API.Base Imports SCrawler.Plugin Imports SCrawler.Plugin.Hosts +Imports ADB = PersonalUtilities.Forms.Controls.Base.ActionButton.DefaultButtons Namespace Editors Friend Class UserCreatorForm : Implements IOkCancelToolbar Private ReadOnly MyDef As DefaultFormProps(Of FieldsChecker) @@ -65,6 +66,16 @@ Namespace Editors Return TXT_USER_FRIENDLY.Text End Get End Property + Friend ReadOnly Property ScriptUse As Boolean + Get + Return TXT_SCRIPT.Checked + End Get + End Property + Friend ReadOnly Property ScriptFile As SFile + Get + Return TXT_SCRIPT.Text + End Get + End Property Friend Property MyExchangeOptions As Object = Nothing Private ReadOnly _SpecPathPattern As RParams = RParams.DM("\w:\\.*", 0, EDP.ReturnValue) Private ReadOnly Property SpecialPath(ByVal s As SettingsHost) As SFile @@ -111,6 +122,7 @@ Namespace Editors CH_TEMP.Checked = Settings.DefaultTemporary CH_DOWN_IMAGES.Checked = Settings.DefaultDownloadImages CH_DOWN_VIDEOS.Checked = Settings.DefaultDownloadVideos + TXT_SCRIPT.Checked = Settings.ScriptFile.Attribute SetParamsBySite() Else TP_ADD_BY_LIST.Enabled = False @@ -135,6 +147,8 @@ Namespace Editors CH_READY_FOR_DOWN.Checked = .ReadyForDownload CH_DOWN_IMAGES.Checked = .DownloadImages CH_DOWN_VIDEOS.Checked = .DownloadVideos + TXT_SCRIPT.Checked = .ScriptUse + TXT_SCRIPT.Text = .ScriptFile TXT_DESCR.Text = .Description UserLabels.ListAddList(.Labels) If UserLabels.ListExists Then TXT_LABELS.Text = UserLabels.ListToString @@ -158,7 +172,13 @@ Namespace Editors End Try End Sub Private Sub UserCreatorForm_KeyDown(sender As Object, e As KeyEventArgs) Handles Me.KeyDown - If e.KeyCode = Keys.F4 Then ChangeLabels() : e.Handled = True + Dim b As Boolean = True + Select Case e.KeyCode + Case Keys.F4 : ChangeLabels() + Case Keys.F2 : If BTT_OTHER_SETTINGS.Enabled Then BTT_OTHER_SETTINGS.PerformClick() + Case Else : b = False + End Select + If b Then e.Handled = True End Sub Private Sub UserCreatorForm_Closing(sender As Object, e As CancelEventArgs) Handles Me.Closing If Not BeforeCloseChecker(MyDef.ChangesDetected) Then @@ -188,6 +208,14 @@ Namespace Editors .UpdateUserFile() End With User = tmpUser + Dim ScriptText$ = TXT_SCRIPT.Text + If Not ScriptText.IsEmptyString Then + Dim f As SFile = ScriptText + If Not SFile.IsDirectory(ScriptText) And Not UserInstance Is Nothing Then + With DirectCast(UserInstance, UserDataBase) : f.Path = .MyFile.Path : End With + End If + TXT_SCRIPT.Text = f + End If If Not UserInstance Is Nothing Then With DirectCast(UserInstance, UserDataBase) .User = User @@ -208,12 +236,14 @@ Namespace Editors .Labels.ListAddList(UserLabels, LAP.NotContainsOnly, LAP.ClearBeforeAdd) End If .ParseUserMediaOnly = CH_PARSE_USER_MEDIA.Checked + .ScriptUse = TXT_SCRIPT.Checked + .ScriptFile = TXT_SCRIPT.Text .UpdateUserInformation() End With End If GoTo CloseForm Else - MsgBoxE("User site does not selected", MsgBoxStyle.Exclamation) + MsgBoxE("User site not selected", MsgBoxStyle.Exclamation) End If End If Else @@ -397,6 +427,7 @@ CloseForm: .ReadyForDownload = CH_READY_FOR_DOWN.Checked .DownloadImages = CH_DOWN_IMAGES.Checked .DownloadVideos = CH_DOWN_VIDEOS.Checked + .ScriptUse = TXT_SCRIPT.Checked .Labels.ListAddList(UserLabels) .ParseUserMediaOnly = CH_PARSE_USER_MEDIA.Checked If Not CH_AUTO_DETECT_SITE.Checked Then _ @@ -439,8 +470,8 @@ CloseForm: End Function Private Sub TXT_LABELS_ActionOnButtonClick(ByVal Sender As ActionButton) Handles TXT_LABELS.ActionOnButtonClick Select Case Sender.DefaultButton - Case ActionButton.DefaultButtons.Open : ChangeLabels() - Case ActionButton.DefaultButtons.Clear : UserLabels.Clear() + Case ADB.Open : ChangeLabels() + Case ADB.Clear : UserLabels.Clear() End Select End Sub Private Sub ChangeLabels() @@ -456,5 +487,11 @@ CloseForm: End If End Using End Sub + Private Sub TXT_SCRIPT_ActionOnButtonClick(ByVal Sender As ActionButton) Handles TXT_SCRIPT.ActionOnButtonClick + If Sender.DefaultButton = ADB.Open Then + Dim f As SFile = SFile.SelectFiles(TXT_SCRIPT.Text, False, "Select script file").FirstOrDefault + If Not f.IsEmptyString Then TXT_SCRIPT.Text = f + End If + End Sub End Class End Namespace \ No newline at end of file diff --git a/SCrawler/MainFrame.Designer.vb b/SCrawler/MainFrame.Designer.vb index 183b34f..69561d5 100644 --- a/SCrawler/MainFrame.Designer.vb +++ b/SCrawler/MainFrame.Designer.vb @@ -86,6 +86,7 @@ Partial Public Class MainFrame : Inherits System.Windows.Forms.Form Me.BTT_CONTEXT_TEMP = New System.Windows.Forms.ToolStripMenuItem() Me.BTT_CONTEXT_READY = New System.Windows.Forms.ToolStripMenuItem() Me.BTT_CONTEXT_GROUPS = New System.Windows.Forms.ToolStripMenuItem() + Me.BTT_CONTEXT_SCRIPT = New System.Windows.Forms.ToolStripMenuItem() Me.BTT_CONTEXT_ADD_TO_COL = New System.Windows.Forms.ToolStripMenuItem() Me.BTT_CONTEXT_COL_MERGE = New System.Windows.Forms.ToolStripMenuItem() Me.BTT_CONTEXT_CHANGE_FOLDER = New System.Windows.Forms.ToolStripMenuItem() @@ -562,9 +563,9 @@ Partial Public Class MainFrame : Inherits System.Windows.Forms.Form ' 'USER_CONTEXT ' - Me.USER_CONTEXT.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.BTT_CONTEXT_DOWN, Me.BTT_CONTEXT_DOWN_LIMITED, Me.BTT_CONTEXT_DOWN_DATE_LIMIT, Me.BTT_CONTEXT_EDIT, Me.BTT_CONTEXT_DELETE, CONTEXT_SEP_1, Me.BTT_CONTEXT_FAV, Me.BTT_CONTEXT_TEMP, Me.BTT_CONTEXT_READY, Me.BTT_CONTEXT_GROUPS, Me.BTT_CONTEXT_ADD_TO_COL, Me.BTT_CONTEXT_COL_MERGE, Me.BTT_CONTEXT_CHANGE_FOLDER, CONTEXT_SEP_2, Me.BTT_CHANGE_IMAGE, CONTEXT_SEP_3, Me.BTT_CONTEXT_OPEN_PATH, CONTEXT_SEP_4, Me.BTT_CONTEXT_OPEN_SITE, CONTEXT_SEP_5, Me.BTT_CONTEXT_INFO}) + Me.USER_CONTEXT.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.BTT_CONTEXT_DOWN, Me.BTT_CONTEXT_DOWN_LIMITED, Me.BTT_CONTEXT_DOWN_DATE_LIMIT, Me.BTT_CONTEXT_EDIT, Me.BTT_CONTEXT_DELETE, CONTEXT_SEP_1, Me.BTT_CONTEXT_FAV, Me.BTT_CONTEXT_TEMP, Me.BTT_CONTEXT_READY, Me.BTT_CONTEXT_GROUPS, Me.BTT_CONTEXT_SCRIPT, Me.BTT_CONTEXT_ADD_TO_COL, Me.BTT_CONTEXT_COL_MERGE, Me.BTT_CONTEXT_CHANGE_FOLDER, CONTEXT_SEP_2, Me.BTT_CHANGE_IMAGE, CONTEXT_SEP_3, Me.BTT_CONTEXT_OPEN_PATH, CONTEXT_SEP_4, Me.BTT_CONTEXT_OPEN_SITE, CONTEXT_SEP_5, Me.BTT_CONTEXT_INFO}) Me.USER_CONTEXT.Name = "USER_CONTEXT" - Me.USER_CONTEXT.Size = New System.Drawing.Size(222, 386) + Me.USER_CONTEXT.Size = New System.Drawing.Size(222, 430) ' 'BTT_CONTEXT_DOWN ' @@ -629,6 +630,13 @@ Partial Public Class MainFrame : Inherits System.Windows.Forms.Form Me.BTT_CONTEXT_GROUPS.Size = New System.Drawing.Size(221, 22) Me.BTT_CONTEXT_GROUPS.Text = "Change labels" ' + 'BTT_CONTEXT_SCRIPT + ' + Me.BTT_CONTEXT_SCRIPT.Image = Global.SCrawler.My.Resources.Resources.ScriptPic32 + Me.BTT_CONTEXT_SCRIPT.Name = "BTT_CONTEXT_SCRIPT" + Me.BTT_CONTEXT_SCRIPT.Size = New System.Drawing.Size(221, 22) + Me.BTT_CONTEXT_SCRIPT.Text = "Change script usage" + ' 'BTT_CONTEXT_ADD_TO_COL ' Me.BTT_CONTEXT_ADD_TO_COL.Image = Global.SCrawler.My.Resources.Resources.DBPic_32 @@ -796,4 +804,5 @@ Partial Public Class MainFrame : Inherits System.Windows.Forms.Form Private WithEvents BTT_DOWN_SITE As ToolStripMenuItem Private WithEvents BTT_DOWN_ALL_FULL As ToolStripMenuItem Private WithEvents BTT_DOWN_SITE_FULL As ToolStripMenuItem + Private WithEvents BTT_CONTEXT_SCRIPT As ToolStripMenuItem End Class \ No newline at end of file diff --git a/SCrawler/MainFrame.vb b/SCrawler/MainFrame.vb index 740648d..98c580d 100644 --- a/SCrawler/MainFrame.vb +++ b/SCrawler/MainFrame.vb @@ -249,6 +249,8 @@ CloseResume: .DownloadVideos = f.DownloadVideos .FriendlyName = f.UserFriendly .Description = f.UserDescr + .ScriptUse = f.ScriptUse + .ScriptFile = f.ScriptFile If Not f.MyExchangeOptions Is Nothing Then DirectCast(.Self, UserDataBase).ExchangeOptionsSet(f.MyExchangeOptions) .Self.Labels.ListAddList(f.UserLabels, LAP.ClearBeforeAdd, LAP.NotContainsOnly) .UpdateUserInformation() @@ -617,6 +619,31 @@ CloseResume: ErrorsDescriber.Execute(EDP.ShowAllMsg, ex, "[ChangeUserGroups]") End Try End Sub + Private Sub BTT_CONTEXT_SCRIPT_Click(sender As Object, e As EventArgs) Handles BTT_CONTEXT_SCRIPT.Click + Try + Dim users As List(Of IUserData) = GetSelectedUserArray() + If users.ListExists Then + Dim ans% = MsgBoxE({"You want to change the script usage for selected users." & vbCr & + "Which script usage mode do you want to set?", + "Change script usage"}, vbExclamation,,, {"Use", "Do not use", "Cancel"}) + If ans < 2 Then + Dim s As Boolean = IIf(ans = 0, True, False) + users.ForEach(Sub(ByVal u As IUserData) + Dim b As Boolean = u.ScriptUse = s + u.ScriptUse = s + If Not b Then u.UpdateUserInformation() + End Sub) + MsgBoxE($"Script mode was set to [{IIf(s, "Use", "Do not use")}] for all selected users") + Else + MsgBoxE("Operation canceled") + End If + Else + MsgBoxE("Users not selected", vbExclamation) + End If + Catch ex As Exception + ErrorsDescriber.Execute(EDP.LogMessageValue, ex, "Change script usage") + End Try + End Sub Private Function AskForMassReplace(ByVal users As List(Of IUserData), ByVal param As String) As Boolean Dim u$ = users.ListIfNothing.Take(20).Select(Function(uu) uu.Name).ListToString(, vbCr) If Not u.IsEmptyString And users.ListExists(21) Then u &= vbCr & "..." diff --git a/SCrawler/My Project/AssemblyInfo.vb b/SCrawler/My Project/AssemblyInfo.vb index 1cc927e..fc7db2b 100644 --- a/SCrawler/My Project/AssemblyInfo.vb +++ b/SCrawler/My Project/AssemblyInfo.vb @@ -32,6 +32,6 @@ Imports System.Runtime.InteropServices ' by using the '*' as shown below: ' - - + + diff --git a/SCrawler/My Project/Resources.Designer.vb b/SCrawler/My Project/Resources.Designer.vb index 7df0ec4..54bcdab 100644 --- a/SCrawler/My Project/Resources.Designer.vb +++ b/SCrawler/My Project/Resources.Designer.vb @@ -250,6 +250,16 @@ Namespace My.Resources End Get End Property + ''' + ''' Looks up a localized resource of type System.Drawing.Bitmap. + ''' + Friend ReadOnly Property ScriptPic32() As System.Drawing.Bitmap + Get + Dim obj As Object = ResourceManager.GetObject("ScriptPic32", resourceCulture) + Return CType(obj,System.Drawing.Bitmap) + End Get + End Property + ''' ''' Looks up a localized resource of type System.Drawing.Bitmap. ''' diff --git a/SCrawler/My Project/Resources.resx b/SCrawler/My Project/Resources.resx index 027e42f..2c52e69 100644 --- a/SCrawler/My Project/Resources.resx +++ b/SCrawler/My Project/Resources.resx @@ -118,29 +118,29 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + ..\Content\Pictures\DBPic_32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\Content\Pictures\StarPic_24.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\Content\Pictures\PrevPIC2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Content\Pictures\StartPic_01_Green_16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Content\Pictures\TwitterPic400.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Content\Pictures\PencilPic_01_16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Content\Pictures\PicturePic_32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\Content\Pictures\NextPIC2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Content\Pictures\BookmarkBlack_16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - ..\Content\Pictures\Folder_32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Content\Pictures\TwitterPic400.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Content\Pictures\PencilPic_01_16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\Content\Pictures\PlusPIC.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -148,6 +148,9 @@ ..\Content\Icons\TwitterIcon.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Content\Pictures\SettingsPic_16.bmp;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\Content\Pictures\Delete.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -166,8 +169,8 @@ ..\Content\Pictures\Refresh.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Content\Pictures\PicturePic_32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Content\Pictures\HeartPic_32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\Content\Icons\RedditIcon.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -181,13 +184,13 @@ ..\Content\Pictures\RedditPic512.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Content\Pictures\DBPic_32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Content\Pictures\BookmarkBlack_16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Content\Pictures\SettingsPic_16.bmp;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Content\Pictures\StartPic_01_Green_16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Content\Pictures\HeartPic_32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Content\Pictures\ScriptPic32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a \ No newline at end of file diff --git a/SCrawler/SCrawler.vbproj b/SCrawler/SCrawler.vbproj index 55f6ec4..5ef3ef6 100644 --- a/SCrawler/SCrawler.vbproj +++ b/SCrawler/SCrawler.vbproj @@ -379,6 +379,7 @@ + PreserveNewest diff --git a/SCrawler/SettingsCLS.vb b/SCrawler/SettingsCLS.vb index 6751b2f..3807610 100644 --- a/SCrawler/SettingsCLS.vb +++ b/SCrawler/SettingsCLS.vb @@ -97,6 +97,7 @@ Friend Class SettingsCLS : Implements IDisposable FromChannelDownloadTopUse = New XMLValue(Of Boolean)("FromChannelDownloadTopUse", False, MyXML, n) FromChannelCopyImageToUser = New XMLValue(Of Boolean)("FromChannelCopyImageToUser", True, MyXML, n) UpdateUserDescriptionEveryTime = New XMLValue(Of Boolean)("UpdateUserDescriptionEveryTime", True, MyXML, n) + ScriptFile = New XMLValueAttribute(Of SFile, Boolean)("ScriptFile", "Use",,, MyXML, n) n = {"Users", "FileName"} MaxUsersJobsCount = New XMLValue(Of Integer)("MaxJobsCount", DefaultMaxDownloadingTasks, MyXML, n) @@ -359,6 +360,7 @@ Friend Class SettingsCLS : Implements IDisposable End Property Friend ReadOnly Property MaxUsersJobsCount As XMLValue(Of Integer) Friend ReadOnly Property ImgurClientID As XMLValue(Of String) + Friend ReadOnly Property ScriptFile As XMLValueAttribute(Of SFile, Boolean) #Region "Defaults" Friend ReadOnly Property DefaultTemporary As XMLValue(Of Boolean) Friend ReadOnly Property DefaultDownloadImages As XMLValue(Of Boolean)