Skip to content

Commit

Permalink
Improvement: progress bar checking file movement
Browse files Browse the repository at this point in the history
  • Loading branch information
r57zone committed Jan 30, 2021
1 parent bbdf72b commit 9d05f69
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Source/Languages/English.ini
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ ID_RENAME_FILE=File is being renamed:
ID_REMOVE_FILE=File is being deleted:
ID_CREATE_FOLDER=Folder is being created:
ID_REMOVE_FOLDER=Folder is being deleted:
ID_CHECK_MOVE_FILES=Checking files for movement
ID_CHECK_MOVE_FILES=Checking files for movement...

ID_COMPLETED=Completed
ID_COMPLETED_ERROR=Completed with errors
Expand Down
2 changes: 1 addition & 1 deletion Source/Languages/Russian.ini
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ ID_RENAME_FILE=
ID_REMOVE_FILE=Идёт удаление файла:
ID_CREATE_FOLDER=Идёт создание папки:
ID_REMOVE_FOLDER=Идёт удаление папки:
ID_CHECK_MOVE_FILES=Проверка файлов на перемещение
ID_CHECK_MOVE_FILES=Проверка файлов на перемещение...

ID_COMPLETED=Завершено
ID_COMPLETED_ERROR=Завершено с ошибками
Expand Down
12 changes: 9 additions & 3 deletions Source/Unit1.pas
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,9 @@ procedure TMain.CheckRemoteFilesToMove; //Если файл был переме
if Actions.Count = 0 then Exit;
StatusText(ID_CHECK_MOVE_FILES);

for i:=0 to Actions.Count - 1 do
ProgressBar.Max:=Actions.Count;

for i:=0 to Actions.Count - 1 do begin
if Copy(Actions.Strings[i], 1, 7) = 'DELETE ' then begin
ActionStr:=Actions.Strings[i];
Delete(ActionStr, 1, 7);
Expand Down Expand Up @@ -330,9 +332,13 @@ procedure TMain.CheckRemoteFilesToMove; //Если файл был переме

end;
end;
ProgressBar.Position:=i + 1; //Отображаем прогресс
end;

//Убираем исправленные действия
Actions.Text:=StringReplace(Actions.Text, 'FIXED' + #13#10, '', [rfReplaceAll]);

ProgressBar.Position:=0;
end;

procedure TMain.ChooseAllBtnClick(Sender: TObject);
Expand Down Expand Up @@ -939,8 +945,8 @@ procedure TMain.StopBtnClick(Sender: TObject);

procedure TMain.AboutBtnClick(Sender: TObject);
begin
Application.MessageBox(PChar(Caption + ' 0.8.2' + #13#10 +
ID_LAST_UPDATE + ' 28.01.2021' + #13#10 +
Application.MessageBox(PChar(Caption + ' 0.8.3' + #13#10 +
ID_LAST_UPDATE + ' 30.01.2021' + #13#10 +
'https://r57zone.github.io' + #13#10 +
'r57zone@gmail.com'), PChar(ID_ABOUT_TITLE), MB_ICONINFORMATION);
end;
Expand Down

0 comments on commit 9d05f69

Please sign in to comment.