Skip to content

Commit

Permalink
Add "View manga info" menu on download list
Browse files Browse the repository at this point in the history
Can only be accessed if your download info contain link.
Refer to this commit
88ae29e
  • Loading branch information
riderkick committed May 10, 2015
1 parent c448e2f commit 10db54d
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
5 changes: 5 additions & 0 deletions mangadownloader/forms/frmMain.lfm
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
16 changes: 16 additions & 0 deletions mangadownloader/forms/frmMain.pas
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ TMainForm = class(TForm)
medURLSelectAll: TMenuItem;
MenuItem17: TMenuItem;
medURLUndo: TMenuItem;
miDLViewMangaInfo: TMenuItem;
MenuItem9: TMenuItem;
miDeleteTask: TMenuItem;
miDeleteTaskData: TMenuItem;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit 10db54d

Please sign in to comment.