Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
r57zone committed Jun 21, 2017
1 parent 7a2b86c commit c4a3786
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
6 changes: 3 additions & 3 deletions Unit1.dfm
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ object Main: TMain
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = False
Position = poDesktopCenter
Position = poScreenCenter
OnClose = FormClose
OnCreate = FormCreate
OnShow = FormShow
Expand Down Expand Up @@ -103,14 +103,14 @@ object Main: TMain
TabOrder = 2
OnChange = MemoRssListChange
end
object StatusBar1: TStatusBar
object StatusBar: TStatusBar
Left = 0
Top = 143
Width = 294
Height = 19
Panels = <>
SimplePanel = True
OnClick = StatusBar1Click
OnClick = StatusBarClick
end
object OpenFolderBtn: TButton
Left = 86
Expand Down
30 changes: 15 additions & 15 deletions Unit1.pas
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ interface
TMain = class(TForm)
RefreshBtn: TButton;
MemoRssList: TMemo;
StatusBar1: TStatusBar;
StatusBar: TStatusBar;
XPManifest1: TXPManifest;
OpenFolderBtn: TButton;
Timer1: TTimer;
Expand All @@ -22,7 +22,7 @@ TMain = class(TForm)
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure OpenFolderBtnClick(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
procedure StatusBar1Click(Sender: TObject);
procedure StatusBarClick(Sender: TObject);
procedure CheckLinksDownloaded;
procedure MemoRssListChange(Sender: TObject);
procedure FormShow(Sender: TObject);
Expand Down Expand Up @@ -302,7 +302,7 @@ procedure TMain.RefreshBtnClick(Sender: TObject);

GetRss.Text:=GetUrl(MemoRssList.Lines.Strings[i]);

StatusBar1.SimpleText:=' '+Format(CheckNewsFeedTitle,[i+1, MemoRssList.Lines.Count]);
StatusBar.SimpleText:=' '+Format(CheckNewsFeedTitle,[i+1, MemoRssList.Lines.Count]);
if Trim(GetRss.Text)='' then Continue;

//Ïåðåíîñ òåãà íà íîâóþ ñòðîêó / Move tag to new line
Expand All @@ -328,7 +328,7 @@ procedure TMain.RefreshBtnClick(Sender: TObject);

//Ïðîâåðÿåì íå äîáàâëåíà ëè îíà óæå â ñïèñîê çàãðóçêè / Check if it is added in the download list
if (Pos(MyLink,Download.Text)=0) then begin
StatusBar1.SimpleText:=' '+FoundNewPodcastTitle+' '+Copy(MemoRssList.Lines.Strings[i], 1, 20)+'...';
StatusBar.SimpleText:=' '+FoundNewPodcastTitle+' '+Copy(MemoRssList.Lines.Strings[i], 1, 20)+'...';

//Äîáàâëåíèå ññûëêè â ñïèñîê äëÿ çàãðóçêè / Add link to download list
Download.Add(Copy(GetRss.Strings[j],Pos('URL="',AnsiUpperCase(GetRss.Strings[j]))+5,Pos('.MP3',AnsiUpperCase(GetRss.Strings[j]))-Pos('URL="',AnsiUpperCase(GetRss.Strings[j]))-1));
Expand All @@ -347,7 +347,7 @@ procedure TMain.RefreshBtnClick(Sender: TObject);

for i:=Download.Count-1 downto 0 do begin
inc(DownloadIndex);
StatusBar1.SimpleText:=' '+Format(DownloadPodcastsTitle,[DownloadIndex, DownloadCount]);
StatusBar.SimpleText:=' '+Format(DownloadPodcastsTitle,[DownloadIndex, DownloadCount]);

if DownloadPodcasts then //Ðàçðåøåíèå íà çàãðóçêó / Permission to download
if DownloadFile(Download.Strings[i],PathDownload)=false then begin // ñëó÷àå îøèáêè / If error
Expand All @@ -359,8 +359,8 @@ procedure TMain.RefreshBtnClick(Sender: TObject);
end;

if Error=false then
StatusBar1.SimpleText:=' '+PodcastsDownloadedTitle else //Âñå ïîäêàñòû çàãðóæåíû // All Podcasts donwloaded
StatusBar1.SimpleText:=' '+Format(PodcastsErrorDownloadedTitle, [Download.Count, DownloadCount]); //Îøèáêà çàãðóçêè / Error downloaded
StatusBar.SimpleText:=' '+PodcastsDownloadedTitle else //Âñå ïîäêàñòû çàãðóæåíû // All Podcasts donwloaded
StatusBar.SimpleText:=' '+Format(PodcastsErrorDownloadedTitle, [Download.Count, DownloadCount]); //Îøèáêà çàãðóçêè / Error downloaded

//Ñîõðàíåíèå ññûëîê íà çàãðóæåííûå ïîäêàñòû, ÷òîáû íå çàãðóçèòü èõ ñíîâà / Save links to downloaded podcasts to not download them again
Downloaded.Add(Download.Text);
Expand All @@ -371,7 +371,7 @@ procedure TMain.RefreshBtnClick(Sender: TObject);
//Ñîõðàíåíèå ñïèñêà çàãðóæåííûõ ïîäêàñòîâ / Save list of podcasts downloaded links
Downloaded.SaveToFile(ExtractFilePath(ParamStr(0))+'Downloaded.txt');

end else StatusBar1.SimpleText:=' '+PodcastsNotFoundTitle; //Íîâûõ ïîäêàñòîâ íå íàéäåíî / Not found new podcasts
end else StatusBar.SimpleText:=' '+PodcastsNotFoundTitle; //Íîâûõ ïîäêàñòîâ íå íàéäåíî / Not found new podcasts

//Åñëè ðåäàêòèðîâàëèñü ëåíòû, òî ñîõðàíÿåì íîâûé ñïèñîê ëåíò / If edited feeds then save new list feeds
if MemoChanged then if MemoRssList.Lines.Count>0 then begin
Expand All @@ -396,7 +396,7 @@ procedure TMain.FormCreate(Sender: TObject);
var
Ini: TIniFile;
begin
RefreshBtn.ControlState:=[csFocusing];
//RefreshBtn.ControlState:=[csFocusing];
DownloadPodcasts:=true;

Ini:=TIniFile.Create(ExtractFilePath(ParamStr(0))+'Setup.ini');
Expand Down Expand Up @@ -466,7 +466,7 @@ procedure TMain.WMCopyData(var Msg: TWMCopyData);
for i:=0 to SyncList.Count-1 do
if FileExists(SyncList.Strings[i]) then DeleteFile(SyncList.Strings[i]);
FreeAndNil(SyncList);
StatusBar1.SimpleText:=' '+PodcastDownloadedToDeviceTitle;
StatusBar.SimpleText:=' '+PodcastDownloadedToDeviceTitle;
end;
//SendMessageToHandle(msg.From,'YES');
Msg.Result:=Integer(True);
Expand All @@ -482,9 +482,9 @@ procedure TMain.Timer1Timer(Sender: TObject);
end;
end;

procedure TMain.StatusBar1Click(Sender: TObject);
procedure TMain.StatusBarClick(Sender: TObject);
begin
Application.MessageBox(PChar('PodCast Easy 0.8.1 beta'+#13#10+AboutLastUpdateTitle+' 20.08.2016'+#13#10+'http://r57zone.github.io'+#13#10+'r57zone@gmail.com'),PChar(AboutCaptionTitle),0);
Application.MessageBox(PChar('PodCast Easy 0.8.1 beta'+#13#10+AboutLastUpdateTitle+' 21.06.2017'+#13#10+'https://r57zone.github.io'+#13#10+'r57zone@gmail.com'),PChar(AboutCaptionTitle),0);
end;

procedure TMain.CheckLinksDownloaded;
Expand All @@ -504,7 +504,7 @@ procedure TMain.CheckLinksDownloaded;
Links:=TStringList.Create();
Downloaded.LoadFromFile('Downloaded.txt');
Rss.LoadFromFile('Rss.txt');
StatusBar1.SimpleText:=' '+Stage1Title;
StatusBar.SimpleText:=' '+Stage1Title;
ProgressBar1.Max:=Rss.Count-1;
//Ñîçäàíèå îáùåãî ñïèñêà / Creating a common list
for i:=Rss.Count-1 downto 0 do begin
Expand All @@ -515,7 +515,7 @@ procedure TMain.CheckLinksDownloaded;
end;
ProgressBar1.Position:=0;
if Error=false then begin
StatusBar1.SimpleText:=' '+Stage2Title;
StatusBar.SimpleText:=' '+Stage2Title;
ProgressBar1.Max:=Downloaded.Count-1;
//Ñîçäàíèå íîâîãî ñïèñêà çàãðóæåííûõ ïîäêàñòîâ /Create a new list of downloaded podcasts
for j:=Downloaded.Count-1 downto 0 do begin
Expand All @@ -528,7 +528,7 @@ procedure TMain.CheckLinksDownloaded;
Links.SaveToFile('Downloaded.txt');
Showmessage(DeletedLinksTitle+' '+IntToStr(Downloaded.Count-links.Count));
end else ShowMessage(Format(ErrorDeletedLinksTitle,[rss.Strings[i]]));
StatusBar1.SimpleText:='';
StatusBar.SimpleText:='';
Downloaded.Free;
Rss.Free;
Links.Free;
Expand Down

0 comments on commit c4a3786

Please sign in to comment.