|
@@ -28,38 +28,39 @@ type
|
|
edtDst: TKASPathEdit;
|
|
edtDst: TKASPathEdit;
|
|
grpOptions: TGroupBox;
|
|
grpOptions: TGroupBox;
|
|
lblCopySrc: TLabel;
|
|
lblCopySrc: TLabel;
|
|
|
|
+ mnuQueue2: TMenuItem;
|
|
|
|
+ mnuQueue3: TMenuItem;
|
|
|
|
+ mnuQueue4: TMenuItem;
|
|
|
|
+ mnuQueue5: TMenuItem;
|
|
|
|
+ mnuQueue1: TMenuItem;
|
|
|
|
+ mnuNewQueue: TMenuItem;
|
|
|
|
+ pmQueuePopup: TPopupMenu;
|
|
pnlButtons: TPanel;
|
|
pnlButtons: TPanel;
|
|
pnlOptions: TPanel;
|
|
pnlOptions: TPanel;
|
|
pnlSelector: TPanel;
|
|
pnlSelector: TPanel;
|
|
- btnCreateSpecialQueue: TButton;
|
|
|
|
- procedure btnAddToQueueClick(Sender: TObject);
|
|
|
|
- procedure btnCancelMouseUp(Sender: TObject; Button: TMouseButton;
|
|
|
|
- Shift: TShiftState; X, Y: Integer);
|
|
|
|
- procedure btnAddToQueueMouseUp(Sender: TObject; Button: TMouseButton;
|
|
|
|
- Shift: TShiftState; X, Y: Integer);
|
|
|
|
|
|
+ btnCreateSpecialQueue: TBitBtn;
|
|
|
|
+ procedure btnCreateSpecialQueueClick(Sender: TObject);
|
|
procedure btnOKClick(Sender: TObject);
|
|
procedure btnOKClick(Sender: TObject);
|
|
- procedure btnOKMouseUp(Sender: TObject; Button: TMouseButton;
|
|
|
|
- Shift: TShiftState; X, Y: Integer);
|
|
|
|
procedure btnOptionsClick(Sender: TObject);
|
|
procedure btnOptionsClick(Sender: TObject);
|
|
- procedure btnOptionsMouseUp(Sender: TObject; Button: TMouseButton;
|
|
|
|
- Shift: TShiftState; X, Y: Integer);
|
|
|
|
procedure btnSaveOptionsClick(Sender: TObject);
|
|
procedure btnSaveOptionsClick(Sender: TObject);
|
|
procedure btnStartModeClick(Sender: TObject);
|
|
procedure btnStartModeClick(Sender: TObject);
|
|
procedure FormCreate(Sender: TObject);
|
|
procedure FormCreate(Sender: TObject);
|
|
procedure FormDestroy(Sender: TObject);
|
|
procedure FormDestroy(Sender: TObject);
|
|
procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
|
|
procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
|
|
procedure frmCopyDlgShow(Sender: TObject);
|
|
procedure frmCopyDlgShow(Sender: TObject);
|
|
|
|
+ procedure mnuNewQueueClick(Sender: TObject);
|
|
|
|
+ procedure mnuQueueNumberClick(Sender: TObject);
|
|
procedure pnlOptionsResize(Sender: TObject);
|
|
procedure pnlOptionsResize(Sender: TObject);
|
|
|
|
|
|
private
|
|
private
|
|
FCommands: TFormCommands;
|
|
FCommands: TFormCommands;
|
|
FDialogType: TCopyMoveDlgType;
|
|
FDialogType: TCopyMoveDlgType;
|
|
- FQueueIdentifier: TOperationsManagerQueueIdentifier;
|
|
|
|
noteb: TFileViewNotebook;
|
|
noteb: TFileViewNotebook;
|
|
FFileSource: IFileSource;
|
|
FFileSource: IFileSource;
|
|
FOperationOptionsUIClass: TFileSourceOperationOptionsUIClass;
|
|
FOperationOptionsUIClass: TFileSourceOperationOptionsUIClass;
|
|
FOperationOptionsUI: TFileSourceOperationOptionsUI;
|
|
FOperationOptionsUI: TFileSourceOperationOptionsUI;
|
|
|
|
|
|
|
|
+ function GetQueueIdentifier: TOperationsManagerQueueIdentifier;
|
|
function ShowTabsSelector: integer;
|
|
function ShowTabsSelector: integer;
|
|
procedure TabsSelector(Sender: TObject);
|
|
procedure TabsSelector(Sender: TObject);
|
|
procedure TabsSelectorMouseDown(Sender: TObject; Button: TMouseButton;
|
|
procedure TabsSelectorMouseDown(Sender: TObject; Button: TMouseButton;
|
|
@@ -67,7 +68,7 @@ type
|
|
procedure ShowOptions(bShow: Boolean);
|
|
procedure ShowOptions(bShow: Boolean);
|
|
procedure UpdateSize;
|
|
procedure UpdateSize;
|
|
|
|
|
|
- property Commands: TFormCommands read FCommands{$IF FPC_FULLVERSION >= 020501} implements IFormCommands{$ENDIF};
|
|
|
|
|
|
+ property Commands: TFormCommands read FCommands implements IFormCommands;
|
|
|
|
|
|
public
|
|
public
|
|
constructor Create(TheOwner: TComponent; DialogType: TCopyMoveDlgType;
|
|
constructor Create(TheOwner: TComponent; DialogType: TCopyMoveDlgType;
|
|
@@ -76,14 +77,7 @@ type
|
|
constructor Create(TheOwner: TComponent); override;
|
|
constructor Create(TheOwner: TComponent); override;
|
|
procedure SetOperationOptions(Operation: TFileSourceOperation);
|
|
procedure SetOperationOptions(Operation: TFileSourceOperation);
|
|
|
|
|
|
- property QueueIdentifier: TOperationsManagerQueueIdentifier read FQueueIdentifier;
|
|
|
|
-
|
|
|
|
- {$IF FPC_FULLVERSION < 020501}
|
|
|
|
- // "implements" does not work in FPC < 2.5.1
|
|
|
|
- function ExecuteCommand(Command: string; const Params: array of String): TCommandFuncResult;
|
|
|
|
- function GetCommandCaption(Command: String; CaptionType: TCommandCaptionType): String;
|
|
|
|
- procedure GetCommandsList(List: TStrings);
|
|
|
|
- {$ENDIF}
|
|
|
|
|
|
+ property QueueIdentifier: TOperationsManagerQueueIdentifier read GetQueueIdentifier;
|
|
|
|
|
|
published
|
|
published
|
|
procedure cm_AddToQueue(const Params: array of String);
|
|
procedure cm_AddToQueue(const Params: array of String);
|
|
@@ -100,6 +94,9 @@ uses
|
|
const
|
|
const
|
|
HotkeysCategory = 'Copy/Move Dialog';
|
|
HotkeysCategory = 'Copy/Move Dialog';
|
|
|
|
|
|
|
|
+var
|
|
|
|
+ FQueueIdentifier: TOperationsManagerQueueIdentifier = SingleQueueId;
|
|
|
|
+
|
|
constructor TfrmCopyDlg.Create(TheOwner: TComponent; DialogType: TCopyMoveDlgType;
|
|
constructor TfrmCopyDlg.Create(TheOwner: TComponent; DialogType: TCopyMoveDlgType;
|
|
AFileSource: IFileSource;
|
|
AFileSource: IFileSource;
|
|
AOperationOptionsUIClass: TFileSourceOperationOptionsUIClass);
|
|
AOperationOptionsUIClass: TFileSourceOperationOptionsUIClass);
|
|
@@ -107,7 +104,6 @@ begin
|
|
FDialogType := DialogType;
|
|
FDialogType := DialogType;
|
|
FFileSource := AFileSource;
|
|
FFileSource := AFileSource;
|
|
FOperationOptionsUIClass := AOperationOptionsUIClass;
|
|
FOperationOptionsUIClass := AOperationOptionsUIClass;
|
|
- FQueueIdentifier := FreeOperationsQueueId;
|
|
|
|
FCommands := TFormCommands.Create(Self);
|
|
FCommands := TFormCommands.Create(Self);
|
|
inherited Create(TheOwner);
|
|
inherited Create(TheOwner);
|
|
end;
|
|
end;
|
|
@@ -129,7 +125,12 @@ var
|
|
sQueueId: String;
|
|
sQueueId: String;
|
|
begin
|
|
begin
|
|
if GetParamValue(Params, 'queueid', sQueueId) and TryStrToInt(sQueueId, Value) then
|
|
if GetParamValue(Params, 'queueid', sQueueId) and TryStrToInt(sQueueId, Value) then
|
|
- FQueueIdentifier := Value
|
|
|
|
|
|
+ begin
|
|
|
|
+ if Value < 0 then
|
|
|
|
+ mnuNewQueue.Click
|
|
|
|
+ else
|
|
|
|
+ FQueueIdentifier := Value
|
|
|
|
+ end
|
|
else
|
|
else
|
|
FQueueIdentifier := SingleQueueId;
|
|
FQueueIdentifier := SingleQueueId;
|
|
ModalResult := btnAddToQueue.ModalResult;
|
|
ModalResult := btnAddToQueue.ModalResult;
|
|
@@ -213,6 +214,11 @@ begin
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+function TfrmCopyDlg.GetQueueIdentifier: TOperationsManagerQueueIdentifier;
|
|
|
|
+begin
|
|
|
|
+ Result:= FQueueIdentifier;
|
|
|
|
+end;
|
|
|
|
+
|
|
procedure TfrmCopyDlg.frmCopyDlgShow(Sender: TObject);
|
|
procedure TfrmCopyDlg.frmCopyDlgShow(Sender: TObject);
|
|
begin
|
|
begin
|
|
case FDialogType of
|
|
case FDialogType of
|
|
@@ -234,6 +240,33 @@ begin
|
|
edtDst.SetFocus;
|
|
edtDst.SetFocus;
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+procedure TfrmCopyDlg.mnuNewQueueClick(Sender: TObject);
|
|
|
|
+var
|
|
|
|
+ NewQueueId: TOperationsManagerQueueIdentifier;
|
|
|
|
+begin
|
|
|
|
+ for NewQueueId := Succ(FreeOperationsQueueId) to MaxInt do
|
|
|
|
+ with OperationsManager do
|
|
|
|
+ begin
|
|
|
|
+ if not Assigned(QueueByIdentifier[NewQueueId]) then
|
|
|
|
+ begin
|
|
|
|
+ FQueueIdentifier := NewQueueId;
|
|
|
|
+ ModalResult := btnAddToQueue.ModalResult;
|
|
|
|
+ Break;
|
|
|
|
+ end;
|
|
|
|
+ end;
|
|
|
|
+end;
|
|
|
|
+
|
|
|
|
+procedure TfrmCopyDlg.mnuQueueNumberClick(Sender: TObject);
|
|
|
|
+var
|
|
|
|
+ NewQueueNumber: TOperationsManagerQueueIdentifier;
|
|
|
|
+begin
|
|
|
|
+ if TryStrToInt(Copy((Sender as TMenuItem).Name, 9, 1), NewQueueNumber) then
|
|
|
|
+ begin
|
|
|
|
+ FQueueIdentifier := NewQueueNumber;
|
|
|
|
+ ModalResult := btnAddToQueue.ModalResult;
|
|
|
|
+ end;
|
|
|
|
+end;
|
|
|
|
+
|
|
procedure TfrmCopyDlg.pnlOptionsResize(Sender: TObject);
|
|
procedure TfrmCopyDlg.pnlOptionsResize(Sender: TObject);
|
|
begin
|
|
begin
|
|
UpdateSize;
|
|
UpdateSize;
|
|
@@ -262,66 +295,19 @@ begin
|
|
{$ENDIF}
|
|
{$ENDIF}
|
|
end;
|
|
end;
|
|
|
|
|
|
-procedure TfrmCopyDlg.btnCancelMouseUp(Sender: TObject; Button: TMouseButton;
|
|
|
|
- Shift: TShiftState; X, Y: Integer);
|
|
|
|
-begin
|
|
|
|
-{$IF (DEFINED(LCLGTK) or DEFINED(LCLGTK2)) and (lcl_fullversion < 093100)}
|
|
|
|
- if (Button = mbLeft) and (Sender = FindLCLControl(Mouse.CursorPos)) then
|
|
|
|
- ModalResult := btnCancel.ModalResult;
|
|
|
|
-{$ENDIF}
|
|
|
|
-end;
|
|
|
|
-
|
|
|
|
-procedure TfrmCopyDlg.btnAddToQueueClick(Sender: TObject);
|
|
|
|
-begin
|
|
|
|
-{$IF NOT ((DEFINED(LCLGTK) or DEFINED(LCLGTK2)) and (lcl_fullversion < 093100))}
|
|
|
|
- FQueueIdentifier := SingleQueueId;
|
|
|
|
-{$ENDIF}
|
|
|
|
-end;
|
|
|
|
-
|
|
|
|
-procedure TfrmCopyDlg.btnAddToQueueMouseUp(Sender: TObject; Button: TMouseButton;
|
|
|
|
- Shift: TShiftState; X, Y: Integer);
|
|
|
|
|
|
+procedure TfrmCopyDlg.btnCreateSpecialQueueClick(Sender: TObject);
|
|
begin
|
|
begin
|
|
-{$IF (DEFINED(LCLGTK) or DEFINED(LCLGTK2)) and (lcl_fullversion < 093100)}
|
|
|
|
- if (Button = mbLeft) and (Sender = FindLCLControl(Mouse.CursorPos)) then
|
|
|
|
- begin
|
|
|
|
- cm_AddToQueue([]);
|
|
|
|
- end;
|
|
|
|
-{$ENDIF}
|
|
|
|
|
|
+ btnCreateSpecialQueue.PopupMenu.PopUp;
|
|
end;
|
|
end;
|
|
|
|
|
|
procedure TfrmCopyDlg.btnOKClick(Sender: TObject);
|
|
procedure TfrmCopyDlg.btnOKClick(Sender: TObject);
|
|
begin
|
|
begin
|
|
-{$IF NOT ((DEFINED(LCLGTK) or DEFINED(LCLGTK2)) and (lcl_fullversion < 093100))}
|
|
|
|
FQueueIdentifier := FreeOperationsQueueId;
|
|
FQueueIdentifier := FreeOperationsQueueId;
|
|
-{$ENDIF}
|
|
|
|
-end;
|
|
|
|
-
|
|
|
|
-procedure TfrmCopyDlg.btnOkMouseUp(Sender: TObject; Button: TMouseButton;
|
|
|
|
- Shift: TShiftState; X, Y: Integer);
|
|
|
|
-begin
|
|
|
|
-{$IF (DEFINED(LCLGTK) or DEFINED(LCLGTK2)) and (lcl_fullversion < 093100)}
|
|
|
|
- if (Button = mbLeft) and (Sender = FindLCLControl(Mouse.CursorPos)) then
|
|
|
|
- begin
|
|
|
|
- FQueueIdentifier := FreeOperationsQueueId;
|
|
|
|
- ModalResult := btnOk.ModalResult;
|
|
|
|
- end;
|
|
|
|
-{$ENDIF}
|
|
|
|
end;
|
|
end;
|
|
|
|
|
|
procedure TfrmCopyDlg.btnOptionsClick(Sender: TObject);
|
|
procedure TfrmCopyDlg.btnOptionsClick(Sender: TObject);
|
|
begin
|
|
begin
|
|
-{$IF NOT ((DEFINED(LCLGTK) or DEFINED(LCLGTK2)) and (lcl_fullversion < 093100))}
|
|
|
|
ShowOptions(not pnlOptions.Visible);
|
|
ShowOptions(not pnlOptions.Visible);
|
|
-{$ENDIF}
|
|
|
|
-end;
|
|
|
|
-
|
|
|
|
-procedure TfrmCopyDlg.btnOptionsMouseUp(Sender: TObject; Button: TMouseButton;
|
|
|
|
- Shift: TShiftState; X, Y: Integer);
|
|
|
|
-begin
|
|
|
|
-{$IF (DEFINED(LCLGTK) or DEFINED(LCLGTK2)) and (lcl_fullversion < 093100)}
|
|
|
|
- if (Button = mbLeft) and (Sender = FindLCLControl(Mouse.CursorPos)) then
|
|
|
|
- ShowOptions(not pnlOptions.Visible);
|
|
|
|
-{$ENDIF}
|
|
|
|
end;
|
|
end;
|
|
|
|
|
|
procedure TfrmCopyDlg.btnSaveOptionsClick(Sender: TObject);
|
|
procedure TfrmCopyDlg.btnSaveOptionsClick(Sender: TObject);
|
|
@@ -361,7 +347,7 @@ begin
|
|
ShowOptions(False);
|
|
ShowOptions(False);
|
|
|
|
|
|
btnOK.Caption := rsDlgOpStart;
|
|
btnOK.Caption := rsDlgOpStart;
|
|
- FQueueIdentifier := FreeOperationsQueueId;
|
|
|
|
|
|
+ btnAddToQueue.Caption:= btnAddToQueue.Caption + ' #' + IntToStr(FQueueIdentifier);
|
|
|
|
|
|
HMForm := HotMan.Register(Self, HotkeysCategory);
|
|
HMForm := HotMan.Register(Self, HotkeysCategory);
|
|
Hotkey := HMForm.Hotkeys.FindByCommand('cm_AddToQueue');
|
|
Hotkey := HMForm.Hotkeys.FindByCommand('cm_AddToQueue');
|
|
@@ -390,23 +376,6 @@ begin
|
|
Self.Height := pnlOptions.Top;
|
|
Self.Height := pnlOptions.Top;
|
|
end;
|
|
end;
|
|
|
|
|
|
-{$IF FPC_FULLVERSION < 020501}
|
|
|
|
-function TfrmCopyDlg.ExecuteCommand(Command: string; const Params: array of String): TCommandFuncResult;
|
|
|
|
-begin
|
|
|
|
- Result := FCommands.ExecuteCommand(Command, Params);
|
|
|
|
-end;
|
|
|
|
-
|
|
|
|
-function TfrmCopyDlg.GetCommandCaption(Command: String; CaptionType: TCommandCaptionType): String;
|
|
|
|
-begin
|
|
|
|
- Result := FCommands.GetCommandCaption(Command, CaptionType);
|
|
|
|
-end;
|
|
|
|
-
|
|
|
|
-procedure TfrmCopyDlg.GetCommandsList(List: TStrings);
|
|
|
|
-begin
|
|
|
|
- FCommands.GetCommandsList(List);
|
|
|
|
-end;
|
|
|
|
-{$ENDIF}
|
|
|
|
-
|
|
|
|
initialization
|
|
initialization
|
|
TFormCommands.RegisterCommandsForm(TfrmCopyDlg, HotkeysCategory, @rsHotkeyCategoryCopyMoveDialog);
|
|
TFormCommands.RegisterCommandsForm(TfrmCopyDlg, HotkeysCategory, @rsHotkeyCategoryCopyMoveDialog);
|
|
|
|
|