From c3f08317684a8a95bd47d36d842ca4a4481eaee1 Mon Sep 17 00:00:00 2001 From: Andy <88590076+AAndyProgram@users.noreply.github.com> Date: Fri, 9 Feb 2024 10:00:04 +0300 Subject: [PATCH] 2024.2.9.0 Add a 'Feed' button to notifications SCrawler.StandaloneDownloader: url array form doesn't show scrollbars --- SCrawler.YouTube/Base/YouTubeSettings.vb | 2 +- SCrawler.YouTube/Controls/VideoOptionsForm.vb | 1 + SCrawler/Download/Automation/AutoDownloader.vb | 10 ++++++++-- .../STDownloader/DownloaderUrlsArrForm.Designer.vb | 1 + SCrawler/MainFrame.vb | 2 +- SCrawler/MainFrameObjects.vb | 13 +++++++++++-- 6 files changed, 23 insertions(+), 6 deletions(-) diff --git a/SCrawler.YouTube/Base/YouTubeSettings.vb b/SCrawler.YouTube/Base/YouTubeSettings.vb index 107acb7..191659e 100644 --- a/SCrawler.YouTube/Base/YouTubeSettings.vb +++ b/SCrawler.YouTube/Base/YouTubeSettings.vb @@ -278,7 +278,7 @@ Namespace API.YouTube.Base Public ReadOnly Property DefaultVideoIncludeNullSize As XMLValue(Of Boolean) Private ReadOnly Property DefaultVideoFPS_XML As XMLValue(Of Double) - Public Property DefaultVideoFPS As Double diff --git a/SCrawler.YouTube/Controls/VideoOptionsForm.vb b/SCrawler.YouTube/Controls/VideoOptionsForm.vb index 1b267ca..bbffbcd 100644 --- a/SCrawler.YouTube/Controls/VideoOptionsForm.vb +++ b/SCrawler.YouTube/Controls/VideoOptionsForm.vb @@ -175,6 +175,7 @@ Namespace API.YouTube.Controls End Sub Private Sub VideoOptionsForm_Closing(sender As Object, e As CancelEventArgs) Handles Me.Closing MyView.DisposeIfReady() + MyFieldsChecker.DisposeIfReady() End Sub #End Region #Region "Refill" diff --git a/SCrawler/Download/Automation/AutoDownloader.vb b/SCrawler/Download/Automation/AutoDownloader.vb index c639cb9..29ee151 100644 --- a/SCrawler/Download/Automation/AutoDownloader.vb +++ b/SCrawler/Download/Automation/AutoDownloader.vb @@ -39,6 +39,7 @@ Namespace DownloadObjects #Region "Notifications" Private Const KeyOpenFolder As String = "_____OPEN_FOLDER_SCRAWLER_AUTOMATION" Private Const KeyOpenSite As String = "_____OPEN_SITE_SCRAWLER_AUTOMATION" + Private Const KeyOpenFeed As String = "_____OPEN_FEED_SCRAWLER_AUTOMATION" Private Const KeyBttDismiss As String = "_____DISMISS_SCRAWLER_AUTOMATION" Private Const KeyBttPhoto As String = "_____PHOTO_SCRAWLER_AUTOMATION" Private ReadOnly UserKeys As List(Of NotifiedUser) @@ -48,6 +49,7 @@ Namespace DownloadObjects Private ReadOnly Property Key As String Private ReadOnly Property KeyFolder As String Private ReadOnly Property KeySite As String + Private ReadOnly Property KeyFeed As String Private ReadOnly Property KeyDismiss As String Private ReadOnly Property Images As Dictionary(Of String, SFile) Private ReadOnly Property AutoDownloaderSource As AutoDownloader @@ -59,6 +61,7 @@ Namespace DownloadObjects Key = _Key KeyFolder = $"{Key}{KeyOpenFolder}" KeySite = $"{Key}{KeyOpenSite}" + KeyFeed = $"{Key}{KeyOpenFeed}" KeyDismiss = $"{Key}{KeyBttDismiss}" End Sub Friend Sub New(ByVal _Key As String, ByRef _User As IUserData, ByRef Source As AutoDownloader) @@ -116,7 +119,8 @@ Namespace DownloadObjects End If Notify.Buttons = { New ToastButton(KeyFolder, "Folder"), - New ToastButton(KeySite, "Site") + New ToastButton(KeySite, "Site"), + New ToastButton(KeyFeed, "Feed") } If Not uifKey.IsEmptyString Then Notify.Buttons = {New ToastButton(uifKey, "Photo")} Notify.Buttons = {New ToastButton(KeyDismiss, "Dismiss")} @@ -149,6 +153,8 @@ Namespace DownloadObjects End If ElseIf KeySite = _Key Then User.OpenSite() + ElseIf KeyFeed = _Key Then + With MainFrameObj : ControlInvokeFast(.MF, AddressOf .MF.ShowFeed, EDP.LogMessageValue) : End With ElseIf Images.ContainsKey(_Key) Then Images(_Key).Open() End If @@ -159,7 +165,7 @@ Namespace DownloadObjects End Function Public Overrides Function Equals(ByVal Obj As Object) As Boolean With CType(Obj, NotifiedUser) - Return .Key = Key Or .Key = KeyFolder Or .Key = KeySite Or .Key = KeyDismiss Or Images.ContainsKey(.Key) + Return .Key = Key Or .Key = KeyFolder Or .Key = KeySite Or .Key = KeyFeed Or .Key = KeyDismiss Or Images.ContainsKey(.Key) End With End Function #Region "IDisposable Support" diff --git a/SCrawler/Download/STDownloader/DownloaderUrlsArrForm.Designer.vb b/SCrawler/Download/STDownloader/DownloaderUrlsArrForm.Designer.vb index 382d262..b5ada7c 100644 --- a/SCrawler/Download/STDownloader/DownloaderUrlsArrForm.Designer.vb +++ b/SCrawler/Download/STDownloader/DownloaderUrlsArrForm.Designer.vb @@ -138,6 +138,7 @@ Namespace DownloadObjects.STDownloader Me.TXT_URLS.MaxLength = 2147483647 Me.TXT_URLS.Multiline = True Me.TXT_URLS.Name = "TXT_URLS" + Me.TXT_URLS.ScrollBars = System.Windows.Forms.ScrollBars.Both Me.TXT_URLS.Size = New System.Drawing.Size(372, 180) Me.TXT_URLS.TabIndex = 0 ' diff --git a/SCrawler/MainFrame.vb b/SCrawler/MainFrame.vb index 2c601e5..e80fc41 100644 --- a/SCrawler/MainFrame.vb +++ b/SCrawler/MainFrame.vb @@ -484,7 +484,7 @@ CloseResume: MyUserMetrics.FormShow(EDP.LogMessageValue) End Sub #End Region - Private Sub ShowFeed() Handles BTT_FEED.Click, BTT_TRAY_FEED_SHOW.Click + Friend Sub ShowFeed() Handles BTT_FEED.Click, BTT_TRAY_FEED_SHOW.Click If MyFeed Is Nothing Then MyFeed = New DownloadFeedForm AddHandler Downloader.FeedFilesChanged, AddressOf MyFeed.Downloader_FilesChanged diff --git a/SCrawler/MainFrameObjects.vb b/SCrawler/MainFrameObjects.vb index dcd50ee..6a7a0c0 100644 --- a/SCrawler/MainFrameObjects.vb +++ b/SCrawler/MainFrameObjects.vb @@ -82,9 +82,14 @@ Friend Class MainFrameObjects : Implements INotificator If Settings.ProcessNotification(NotifyObj.STDownloader) Then Notification.ShowNotification(Text,, $"{NotificationInternalKey}_{NotifyObj.STDownloader}", Image) End Sub Private Const NotificationInternalKey As String = "NotificationInternalKey" + Private Const DEF_BTT_FEED As String = "DEF_BTT_FEED" + Private Const DEF_BTT_DISABLE As String = "DEF_BTT_DISABLE" Friend Sub ShowNotification(ByVal Sender As NotifyObj, ByVal Message As String) If Settings.ProcessNotification(Sender) Then - Using n As New Notification(Message) With {.Key = $"{NotificationInternalKey}_{Sender}"} : n.Show() : End Using + Dim b As List(Of IButton) = Nothing + If Sender = NotifyObj.Profiles Or Sender = NotifyObj.AutoDownloader Or Sender = NotifyObj.SavedPosts Then _ + b = New List(Of IButton) From {New ToastButton("DEF_BTT_FEED", "Feed"), New ToastButton(DEF_BTT_DISABLE, "Disable")} + Using n As New Notification(Message) With {.Key = $"{NotificationInternalKey}_{Sender}", .Buttons = b} : n.Show() : End Using End If End Sub Friend Sub ClearNotifications() Implements INotificator.Clear @@ -94,7 +99,11 @@ Friend Class MainFrameObjects : Implements INotificator If Not Key.IsEmptyString Then Dim found As Boolean = False Dim activateForm As Boolean = False - If Key.StartsWith(NotificationInternalKey) Then + If Key = DEF_BTT_FEED Then + ControlInvokeFast(MF, AddressOf MF.ShowFeed, EDP.LogMessageValue) + ElseIf Key = DEF_BTT_DISABLE Then + Exit Sub + ElseIf Key.StartsWith(NotificationInternalKey) Then Select Case Key Case $"{NotificationInternalKey}_{NotifyObj.Channels}" : MF.MyChannels.FormShowS() Case $"{NotificationInternalKey}_{NotifyObj.SavedPosts}" : MF.MySavedPosts.FormShowS()