|
@@ -201,8 +201,10 @@ __fastcall TCustomScpExplorerForm::TCustomScpExplorerForm(TComponent* Owner):
|
|
FLastContextPopupScreenPoint = TPoint(-1, -1);
|
|
FLastContextPopupScreenPoint = TPoint(-1, -1);
|
|
FTransferResumeList = NULL;
|
|
FTransferResumeList = NULL;
|
|
FMoveToQueue = false;
|
|
FMoveToQueue = false;
|
|
- FStandaloneEditing = false;
|
|
|
|
|
|
+ StandaloneOperation = false;
|
|
FOnFeedSynchronizeError = NULL;
|
|
FOnFeedSynchronizeError = NULL;
|
|
|
|
+ FOnSynchronizeAbort = NULL;
|
|
|
|
+ FSynchronizeTerminal = NULL;
|
|
FNeedSession = false;
|
|
FNeedSession = false;
|
|
FDoNotIdleCurrentTerminal = 0;
|
|
FDoNotIdleCurrentTerminal = 0;
|
|
FIncrementalSearching = 0;
|
|
FIncrementalSearching = 0;
|
|
@@ -821,7 +823,7 @@ bool __fastcall TCustomScpExplorerForm::IsQueueAutoPopup()
|
|
{
|
|
{
|
|
// during standalone editing, we have no way to see/control queue,
|
|
// during standalone editing, we have no way to see/control queue,
|
|
// so we have to always popup prompts automatically
|
|
// so we have to always popup prompts automatically
|
|
- return FStandaloneEditing || GUIConfiguration->QueueAutoPopup;
|
|
|
|
|
|
+ return StandaloneOperation || GUIConfiguration->QueueAutoPopup;
|
|
}
|
|
}
|
|
//---------------------------------------------------------------------------
|
|
//---------------------------------------------------------------------------
|
|
void __fastcall TCustomScpExplorerForm::RefreshQueueItems()
|
|
void __fastcall TCustomScpExplorerForm::RefreshQueueItems()
|
|
@@ -3267,7 +3269,7 @@ void __fastcall TCustomScpExplorerForm::CustomExecuteFile(TOperationSide Side,
|
|
Editor = ShowEditorForm(FileName, this, OnFileChanged,
|
|
Editor = ShowEditorForm(FileName, this, OnFileChanged,
|
|
FEditorManager->FileReload, FEditorManager->FileClosed,
|
|
FEditorManager->FileReload, FEditorManager->FileClosed,
|
|
OnSaveAll, OnAnyModified,
|
|
OnSaveAll, OnAnyModified,
|
|
- Caption, FStandaloneEditing, SessionColor, Terminal->SessionData->InternalEditorEncoding, NewFile);
|
|
|
|
|
|
+ Caption, StandaloneOperation, SessionColor, Terminal->SessionData->InternalEditorEncoding, NewFile);
|
|
}
|
|
}
|
|
catch(...)
|
|
catch(...)
|
|
{
|
|
{
|
|
@@ -3282,7 +3284,7 @@ void __fastcall TCustomScpExplorerForm::CustomExecuteFile(TOperationSide Side,
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
- DebugAssert(!FStandaloneEditing);
|
|
|
|
|
|
+ DebugAssert(!StandaloneOperation);
|
|
TForm * Editor =
|
|
TForm * Editor =
|
|
ShowEditorForm(FileName, this, NULL, NULL, LocalEditorClosed,
|
|
ShowEditorForm(FileName, this, NULL, NULL, LocalEditorClosed,
|
|
SaveAllInternalEditors, AnyInternalEditorModified,
|
|
SaveAllInternalEditors, AnyInternalEditorModified,
|
|
@@ -4729,7 +4731,10 @@ void __fastcall TCustomScpExplorerForm::UpdateStatusPanelText(TTBXStatusPanel *
|
|
void __fastcall TCustomScpExplorerForm::Idle()
|
|
void __fastcall TCustomScpExplorerForm::Idle()
|
|
{
|
|
{
|
|
|
|
|
|
- if (FShowing || FStandaloneEditing)
|
|
|
|
|
|
+ if (FShowing ||
|
|
|
|
+ // Particularly to detect closed connection and automatically reconnect it while waiting for changes
|
|
|
|
+ // while "keeping remote directory up to date"
|
|
|
|
+ StandaloneOperation)
|
|
{
|
|
{
|
|
FEditorManager->Check();
|
|
FEditorManager->Check();
|
|
|
|
|
|
@@ -4769,7 +4774,7 @@ void __fastcall TCustomScpExplorerForm::Idle()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- if (FShowing || FStandaloneEditing)
|
|
|
|
|
|
+ if (FShowing || StandaloneOperation)
|
|
{
|
|
{
|
|
if (FQueueStatusInvalidated)
|
|
if (FQueueStatusInvalidated)
|
|
{
|
|
{
|
|
@@ -5531,9 +5536,12 @@ bool __fastcall TCustomScpExplorerForm::DoSynchronizeDirectories(
|
|
int Options =
|
|
int Options =
|
|
FLAGMASK(SynchronizeAllowSelectedOnly(), soAllowSelectedOnly);
|
|
FLAGMASK(SynchronizeAllowSelectedOnly(), soAllowSelectedOnly);
|
|
DebugAssert(FOnFeedSynchronizeError == NULL);
|
|
DebugAssert(FOnFeedSynchronizeError == NULL);
|
|
|
|
+ DebugAssert(FOnSynchronizeAbort == NULL);
|
|
|
|
+ DebugAssert(FSynchronizeTerminal == NULL);
|
|
|
|
+ FSynchronizeTerminal = Terminal;
|
|
Result = DoSynchronizeDialog(Params, &CopyParam, Controller.StartStop,
|
|
Result = DoSynchronizeDialog(Params, &CopyParam, Controller.StartStop,
|
|
SaveSettings, Options, CopyParamAttrs, GetSynchronizeOptions, SynchronizeSessionLog,
|
|
SaveSettings, Options, CopyParamAttrs, GetSynchronizeOptions, SynchronizeSessionLog,
|
|
- FOnFeedSynchronizeError, SynchronizeInNewWindow, UseDefaults);
|
|
|
|
|
|
+ FOnFeedSynchronizeError, FOnSynchronizeAbort, SynchronizeInNewWindow, UseDefaults);
|
|
if (Result)
|
|
if (Result)
|
|
{
|
|
{
|
|
if (SaveSettings)
|
|
if (SaveSettings)
|
|
@@ -5561,6 +5569,9 @@ bool __fastcall TCustomScpExplorerForm::DoSynchronizeDirectories(
|
|
FSynchronizeController = NULL;
|
|
FSynchronizeController = NULL;
|
|
DebugAssert(FOnFeedSynchronizeError == NULL);
|
|
DebugAssert(FOnFeedSynchronizeError == NULL);
|
|
FOnFeedSynchronizeError = NULL;
|
|
FOnFeedSynchronizeError = NULL;
|
|
|
|
+ DebugAssert(FOnSynchronizeAbort == NULL);
|
|
|
|
+ FOnSynchronizeAbort = NULL;
|
|
|
|
+ FSynchronizeTerminal = NULL;
|
|
}
|
|
}
|
|
return Result;
|
|
return Result;
|
|
}
|
|
}
|
|
@@ -6182,7 +6193,6 @@ void __fastcall TCustomScpExplorerForm::StandaloneEdit(const UnicodeString & Fil
|
|
if (File != NULL)
|
|
if (File != NULL)
|
|
{
|
|
{
|
|
std::unique_ptr<TRemoteFile> FileOwner(File);
|
|
std::unique_ptr<TRemoteFile> FileOwner(File);
|
|
- TAutoFlag Flag(FStandaloneEditing);
|
|
|
|
|
|
|
|
ExecuteRemoteFile(FullFileName, File, efInternalEditor);
|
|
ExecuteRemoteFile(FullFileName, File, efInternalEditor);
|
|
|
|
|
|
@@ -6806,6 +6816,12 @@ void __fastcall TCustomScpExplorerForm::DetachTerminal(TObject * ATerminal)
|
|
{
|
|
{
|
|
ClipboardClear(); // implies ClipboardStop
|
|
ClipboardClear(); // implies ClipboardStop
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ if ((FOnSynchronizeAbort != NULL) &&
|
|
|
|
+ (ATerminal == FManagedSession))
|
|
|
|
+ {
|
|
|
|
+ FOnSynchronizeAbort(NULL);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
//---------------------------------------------------------------------------
|
|
//---------------------------------------------------------------------------
|
|
void __fastcall TCustomScpExplorerForm::TerminalRemoved(TObject * Sender)
|
|
void __fastcall TCustomScpExplorerForm::TerminalRemoved(TObject * Sender)
|