mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-21 09:58:13 +00:00
ADD: Use terminal without command line
This commit is contained in:
parent
e2f61890f3
commit
d84ab015fb
3 changed files with 29 additions and 21 deletions
|
|
@ -630,6 +630,7 @@ type
|
|||
procedure OnUniqueInstanceMessage(Sender: TObject; Params: TCommandLineParams);
|
||||
procedure tbPasteClick(Sender: TObject);
|
||||
procedure AllProgressOnUpdateTimer(Sender: TObject);
|
||||
procedure OnCmdBoxInput(ACmdBox: TCmdBox; AInput: String);
|
||||
{$IFDEF LCLQT}
|
||||
private
|
||||
QEventHook: QObject_hookH;
|
||||
|
|
@ -4561,6 +4562,12 @@ begin
|
|||
end; // if Destination<>tclNone then
|
||||
end;
|
||||
|
||||
procedure TfrmMain.OnCmdBoxInput(ACmdBox: TCmdBox; AInput: String);
|
||||
begin
|
||||
Cons.Terminal.Write_pty(AInput + LineEnding);
|
||||
ACmdBox.StartRead(clWhite, clBlack, ACmdBox.Hint, clWhite, clBlack);
|
||||
end;
|
||||
|
||||
procedure TfrmMain.ToggleConsole;
|
||||
begin
|
||||
if gTermWindow then
|
||||
|
|
@ -4572,7 +4579,23 @@ begin
|
|||
cmdConsole.Align:= alClient;
|
||||
cmdConsole.AutoFollow:= True;
|
||||
cmdConsole.LineCount:= 256;
|
||||
cmdConsole.ShowHint:= False;
|
||||
cmdConsole.CaretType:= cartSubBar;
|
||||
cmdConsole.OnInput:= @OnCmdBoxInput;
|
||||
ShowScrollBar(cmdConsole.Handle, SB_Horz, False);
|
||||
FontOptionsToFont(gFonts[dcfConsole], cmdConsole.Font);
|
||||
cmdConsole.Hint:= Format(fmtCommandPath, [GetComputerNetName]);
|
||||
end;
|
||||
if gCmdLine then
|
||||
begin
|
||||
cmdConsole.Tag := 0;
|
||||
cmdConsole.StopRead;
|
||||
end
|
||||
else if cmdConsole.Tag = 0 then
|
||||
begin
|
||||
cmdConsole.Tag := MaxInt;
|
||||
cmdConsole.Writeln(EmptyStr);
|
||||
cmdConsole.StartRead(clWhite, clBlack, cmdConsole.Hint, clWhite, clBlack);
|
||||
end;
|
||||
if not Assigned(Cons) then
|
||||
begin
|
||||
|
|
@ -4602,10 +4625,12 @@ begin
|
|||
if nbConsole.Height < (nbConsole.Height + pnlNotebooks.Height - 1) then
|
||||
begin
|
||||
nbConsole.Height := nbConsole.Height + pnlNotebooks.Height;
|
||||
if (not gCmdLine) and cmdConsole.CanFocus then cmdConsole.SetFocus;
|
||||
end
|
||||
else
|
||||
begin
|
||||
nbConsole.Height := 0;
|
||||
if (not gCmdLine) and ActiveFrame.CanFocus then ActiveFrame.SetFocus;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
|
@ -4862,7 +4887,8 @@ begin
|
|||
FontOptionsToFont(gFonts[dcfLog], seLogWindow.Font);
|
||||
|
||||
// Command line
|
||||
pnlCommand.Visible := gCmdLine;
|
||||
pnlCmdLine.Visible := gCmdLine;
|
||||
pnlCommand.Visible := gCmdLine or gTermWindow;
|
||||
|
||||
// Align command line and terminal window
|
||||
pnlCommand.Top := -Height;
|
||||
|
|
@ -5453,7 +5479,7 @@ end;
|
|||
|
||||
function TfrmMain.IsCommandLineVisible: Boolean;
|
||||
begin
|
||||
Result := (edtCommand.Visible and pnlCommand.Visible);
|
||||
Result := (edtCommand.Visible and pnlCommand.Visible and pnlCmdLine.Visible);
|
||||
end;
|
||||
|
||||
function TfrmMain.FindMatchingDrive(Address, Path: String): Integer;
|
||||
|
|
|
|||
|
|
@ -204,7 +204,6 @@ inherited frmOptionsLayout: TfrmOptionsLayout
|
|||
Width = 124
|
||||
BorderSpacing.Top = 2
|
||||
Caption = 'Show te&rminal window'
|
||||
OnChange = cbTermWindowChange
|
||||
TabOrder = 18
|
||||
end
|
||||
object cbFreespaceInd: TCheckBox
|
||||
|
|
|
|||
|
|
@ -60,7 +60,6 @@ type
|
|||
procedure cbShowDiskPanelChange(Sender: TObject);
|
||||
procedure cbShowDriveFreeSpaceChange(Sender: TObject);
|
||||
procedure cbShowMainToolBarChange(Sender: TObject);
|
||||
procedure cbTermWindowChange(Sender: TObject);
|
||||
protected
|
||||
procedure Load; override;
|
||||
function Save: TOptionsEditorSaveFlags; override;
|
||||
|
|
@ -95,21 +94,6 @@ begin
|
|||
cbFlatToolBar.Enabled := cbShowMainToolBar.Checked;
|
||||
end;
|
||||
|
||||
procedure TfrmOptionsLayout.cbTermWindowChange(Sender: TObject);
|
||||
begin
|
||||
if cbTermWindow.Checked then
|
||||
begin
|
||||
cbShowCmdLine.Tag:= Integer(cbShowCmdLine.Checked);
|
||||
cbShowCmdLine.Checked:= True;
|
||||
cbShowCmdLine.Enabled:= False;
|
||||
end
|
||||
else
|
||||
begin
|
||||
cbShowCmdLine.Checked:= Boolean(cbShowCmdLine.Tag);
|
||||
cbShowCmdLine.Enabled:= True;
|
||||
end;
|
||||
end;
|
||||
|
||||
class function TfrmOptionsLayout.GetIconIndex: Integer;
|
||||
begin
|
||||
Result := 7;
|
||||
|
|
@ -133,8 +117,7 @@ begin
|
|||
cbShowCurDir.Checked := gCurDir;
|
||||
cbShowTabHeader.Checked := gTabHeader;
|
||||
cbShowStatusBar.Checked := gStatusBar;
|
||||
cbShowCmdLine.Checked := gCmdLine or gTermWindow;
|
||||
cbShowCmdLine.Enabled:= not gTermWindow;
|
||||
cbShowCmdLine.Checked := gCmdLine;
|
||||
cbShowKeysPanel.Checked := gKeyButtons;
|
||||
cbFlatInterface.Checked := gInterfaceFlat;
|
||||
cbLogWindow.Checked := gLogWindow;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue