2024.2.9.0

Add a 'Feed' button to notifications
SCrawler.StandaloneDownloader: url array form doesn't show scrollbars
This commit is contained in:
Andy
2024-02-09 10:00:04 +03:00
parent 74a0404670
commit c3f0831768
6 changed files with 23 additions and 6 deletions

View File

@@ -278,7 +278,7 @@ Namespace API.YouTube.Base
Public ReadOnly Property DefaultVideoIncludeNullSize As XMLValue(Of Boolean)
<Browsable(False), XMLV("DefaultVideoFPS", {"DefaultsVideo"}, -1)>
Private ReadOnly Property DefaultVideoFPS_XML As XMLValue(Of Double)
<Browsable(True), GridVisible, Category("Defaults Video"), DisplayName("Defaults Video FPS"),
<Browsable(True), GridVisible, Category("Defaults Video"), DisplayName("Default video FPS"),
Description("Set default video FPS (only to reduce video FPS). Default: -1 (disabled)."),
TypeConverter(GetType(FieldsTypeConverter)), GridFormatProvider(GetType(FpsFormatProvider))>
Public Property DefaultVideoFPS As Double

View File

@@ -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"

View File

@@ -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"

View File

@@ -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
'

View File

@@ -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

View File

@@ -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()