From 10db54df11fcfdb5fc118d2a81c5dc19a12416ba Mon Sep 17 00:00:00 2001 From: riderkick Date: Sun, 10 May 2015 13:16:12 +0800 Subject: [PATCH] Add "View manga info" menu on download list Can only be accessed if your download info contain link. Refer to this commit https://github.com/riderkick/FMD/commit/88ae29ed67b641313bba9e1faff3c246df94b59c --- mangadownloader/forms/frmMain.lfm | 5 +++++ mangadownloader/forms/frmMain.pas | 16 ++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/mangadownloader/forms/frmMain.lfm b/mangadownloader/forms/frmMain.lfm index 0368acc29..d4c01e207 100644 --- a/mangadownloader/forms/frmMain.lfm +++ b/mangadownloader/forms/frmMain.lfm @@ -3149,6 +3149,11 @@ object MainForm: TMainForm object MenuItem1: TMenuItem Caption = '-' end + object miDLViewMangaInfo: TMenuItem + Caption = 'View manga info' + ImageIndex = 0 + OnClick = miDLViewMangaInfoClick + end object miOpenFolder: TMenuItem Caption = 'Open Folder' Bitmap.Data = { diff --git a/mangadownloader/forms/frmMain.pas b/mangadownloader/forms/frmMain.pas index 383dd862a..54d7a11c1 100644 --- a/mangadownloader/forms/frmMain.pas +++ b/mangadownloader/forms/frmMain.pas @@ -80,6 +80,7 @@ TMainForm = class(TForm) medURLSelectAll: TMenuItem; MenuItem17: TMenuItem; medURLUndo: TMenuItem; + miDLViewMangaInfo: TMenuItem; MenuItem9: TMenuItem; miDeleteTask: TMenuItem; miDeleteTaskData: TMenuItem; @@ -357,6 +358,7 @@ TMainForm = class(TForm) procedure medtURLDeleteClick(Sender: TObject); procedure medURLSelectAllClick(Sender: TObject); procedure medURLUndoClick(Sender: TObject); + procedure miDLViewMangaInfoClick(Sender: TObject); procedure miChapterListHighlightClick(Sender: TObject); procedure miDeleteTaskClick(Sender: TObject); procedure miDeleteTaskDataClick(Sender: TObject); @@ -997,6 +999,16 @@ procedure TMainForm.medURLUndoClick(Sender: TObject); edURL.Undo; end; +procedure TMainForm.miDLViewMangaInfoClick(Sender: TObject); +begin + if vtDownload.Focused then + with DLManager.containers[vtDownload.FocusedNode^.Index] do begin + edURL.Text := FillMangaSiteHost(MangaSiteID, DownloadInfo.Link); + btURLClick(btURL); + pcMain.ActivePage := tsInformation; + end; +end; + procedure TMainForm.miChapterListHighlightClick(Sender: TObject); begin miChapterListHighlight.Checked := not miChapterListHighlight.Checked; @@ -2806,6 +2818,7 @@ procedure TMainForm.pmDownloadPopup(Sender: TObject); pmDownload.Items[5].Enabled := False; pmDownload.Items[10].Enabled := False; pmDownload.Items[11].Enabled := False; + miDLViewMangaInfo.Enabled := False; pmDownload.Items[5].Items[0].Enabled := False; pmDownload.Items[5].Items[1].Enabled := False; @@ -2820,6 +2833,8 @@ procedure TMainForm.pmDownloadPopup(Sender: TObject); pmDownload.Items[5].Enabled := True; pmDownload.Items[10].Enabled := True; pmDownload.Items[11].Enabled := True; + if vtDownload.Focused then + miDLViewMangaInfo.Enabled := DLManager.containers[vtDownload.FocusedNode^.Index].DownloadInfo.Link <> ''; pmDownload.Items[5].Items[0].Enabled := True; pmDownload.Items[5].Items[1].Enabled := True; @@ -2833,6 +2848,7 @@ procedure TMainForm.pmDownloadPopup(Sender: TObject); pmDownload.Items[5].Enabled := True; pmDownload.Items[10].Enabled := False; pmDownload.Items[11].Enabled := False; + miDLViewMangaInfo.Enabled := False; pmDownload.Items[5].Items[0].Enabled := True; pmDownload.Items[5].Items[1].Enabled := True;