Skip to content

Commit

Permalink
Improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
r57zone committed Nov 17, 2020
1 parent 3f05b8b commit 8cccf75
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 4 deletions.
2 changes: 2 additions & 0 deletions Source/Languages/English.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ ID_ACTIVE=Active
ID_NAME=Name
ID_LEFT_FOLDER=Left folder
ID_RIGHT_FOLDER=Right folder
ID_REM_SELECTION=Remove selection
ID_CHOOSE_ALL=Choose all
ID_RUN=Run
ID_CREATE=Create
ID_OPEN=Open
Expand Down
2 changes: 2 additions & 0 deletions Source/Languages/Russian.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ ID_ACTIVE=
ID_NAME=Имя
ID_LEFT_FOLDER=Левая папка
ID_RIGHT_FOLDER=Правая папка
ID_REM_SELECTION=Снять выделение
ID_CHOOSE_ALL=Выбрать все
ID_RUN=Запустить
ID_CREATE=Создать
ID_OPEN=Открыть
Expand Down
13 changes: 13 additions & 0 deletions Source/Unit1.dfm
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ object Main: TMain
ViewStyle = vsReport
OnDblClick = ListViewDblClick
OnKeyDown = ListViewKeyDown
OnMouseDown = ListViewMouseDown
end
object AddBtn: TButton
Left = 238
Expand Down Expand Up @@ -158,4 +159,16 @@ object Main: TMain
Left = 96
Top = 40
end
object ListViewPM: TPopupMenu
Left = 160
Top = 40
object RemSelectionBtn: TMenuItem
Caption = #1057#1085#1103#1090#1100' '#1074#1099#1076#1077#1083#1077#1085#1080#1077
OnClick = RemSelectionBtnClick
end
object ChooseAllBtn: TMenuItem
Caption = #1042#1099#1073#1088#1072#1090#1100' '#1074#1089#1077
OnClick = ChooseAllBtnClick
end
end
end
45 changes: 41 additions & 4 deletions Source/Unit1.pas
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ComCtrls, ShlObj, Registry,
IniFiles;
IniFiles, Vcl.Menus;

type
TMain = class(TForm)
Expand All @@ -23,6 +23,9 @@ TMain = class(TForm)
OpenDialog: TOpenDialog;
CreateBtn: TButton;
SaveDialog: TSaveDialog;
ListViewPM: TPopupMenu;
RemSelectionBtn: TMenuItem;
ChooseAllBtn: TMenuItem;
procedure FormCreate(Sender: TObject);
procedure RunBtnClick(Sender: TObject);
procedure AddBtnClick(Sender: TObject);
Expand All @@ -38,6 +41,10 @@ TMain = class(TForm)
procedure OpenBtnClick(Sender: TObject);
procedure CreateBtnClick(Sender: TObject);
procedure CheckRemoteFilesToMove;
procedure ListViewMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure RemSelectionBtnClick(Sender: TObject);
procedure ChooseAllBtnClick(Sender: TObject);
private
procedure LoadBackupPaths(FileName: string);
{ Private declarations }
Expand Down Expand Up @@ -288,6 +295,17 @@ procedure TMain.CheckRemoteFilesToMove; //Если файл был переме
Actions.Text:=StringReplace(Actions.Text, 'FIXED' + #13#10, '', [rfReplaceAll]);
end;

procedure TMain.ChooseAllBtnClick(Sender: TObject);
var
i: integer;
Item: TListItem;
begin
for i:=0 to ListView.Items.Count - 1 do begin
Item:=ListView.Items.Item[i];
Item.Checked:=true;
end;
end;

procedure ActionsRun;
var
i: integer; ActionStr: string;
Expand Down Expand Up @@ -430,6 +448,8 @@ procedure TMain.FormCreate(Sender: TObject);
ListView.Columns[1].Caption:=Ini.ReadString('Main', 'ID_NAME', '');
ListView.Columns[2].Caption:=Ini.ReadString('Main', 'ID_LEFT_FOLDER', '');
ListView.Columns[3].Caption:=Ini.ReadString('Main', 'ID_RIGHT_FOLDER', '');
RemSelectionBtn.Caption:=Ini.ReadString('Main', 'ID_REM_SELECTION', '');
ChooseAllBtn.Caption:=Ini.ReadString('Main', 'ID_CHOOSE_ALL', '');
RunBtn.Caption:=Ini.ReadString('Main', 'ID_RUN', '');
CreateBtn.Caption:=Ini.ReadString('Main', 'ID_CREATE', '');
OpenBtn.Caption:=Ini.ReadString('Main', 'ID_OPEN', '');
Expand Down Expand Up @@ -521,7 +541,6 @@ procedure TMain.RunBtnClick(Sender: TObject);
var
i: integer;
Item: TListItem;

BackupStatusTitle: string;
begin
StopRequest:=false;
Expand Down Expand Up @@ -803,6 +822,17 @@ procedure TMain.RemBtnClick(Sender: TObject);
end;
end;

procedure TMain.RemSelectionBtnClick(Sender: TObject);
var
i: integer;
Item: TListItem;
begin
for i:=0 to ListView.Items.Count - 1 do begin
Item:=ListView.Items.Item[i];
Item.Checked:=false;
end;
end;

procedure TMain.ListViewDblClick(Sender: TObject);
var
Item: TListItem;
Expand All @@ -822,6 +852,13 @@ procedure TMain.ListViewKeyDown(Sender: TObject; var Key: Word;
end;
end;

procedure TMain.ListViewMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
if Button = mbRight then
ListViewPM.Popup(Mouse.CursorPos.X, Mouse.CursorPos.Y);
end;

procedure TMain.ExcludeBtnClick(Sender: TObject);
begin
ExcludeFoldersForm.ShowModal;
Expand All @@ -836,8 +873,8 @@ procedure TMain.StopBtnClick(Sender: TObject);

procedure TMain.AboutBtnClick(Sender: TObject);
begin
Application.MessageBox(PChar(Caption + ' 0.7.1' + #13#10 +
ID_LAST_UPDATE + ' 30.10.2020' + #13#10 +
Application.MessageBox(PChar(Caption + ' 0.7.2' + #13#10 +
ID_LAST_UPDATE + ' 17.11.2020' + #13#10 +
'https://r57zone.github.io' + #13#10 +
'[email protected]'), PChar(ID_ABOUT_TITLE), MB_ICONINFORMATION);
end;
Expand Down

0 comments on commit 8cccf75

Please sign in to comment.