mirror of https://gitlab.com/basile.b/dexed.git
miniexplorer, improved actions, shell open handle folders from tree & fav list
This commit is contained in:
parent
c95a1c5a13
commit
b0229c846d
|
@ -35,6 +35,7 @@ inherited CEMiniExplorerWidget: TCEMiniExplorerWidget
|
|||
SmallImages = imgList
|
||||
TabOrder = 0
|
||||
ViewStyle = vsReport
|
||||
OnEnter = lstFavEnter
|
||||
end
|
||||
object Splitter1: TSplitter[1]
|
||||
Cursor = crVSplit
|
||||
|
@ -66,6 +67,7 @@ inherited CEMiniExplorerWidget: TCEMiniExplorerWidget
|
|||
ReadOnly = True
|
||||
ScrollBars = ssAutoBoth
|
||||
TabOrder = 0
|
||||
OnEnter = TreeEnter
|
||||
Options = [tvoAutoItemHeight, tvoHideSelection, tvoKeepCollapsedNodes, tvoReadOnly, tvoShowButtons, tvoShowLines, tvoShowRoot, tvoToolTips, tvoThemedDraw]
|
||||
TreeLinePenStyle = psClear
|
||||
end
|
||||
|
@ -96,6 +98,7 @@ inherited CEMiniExplorerWidget: TCEMiniExplorerWidget
|
|||
TabOrder = 2
|
||||
ViewStyle = vsReport
|
||||
OnDblClick = lstFilesDblClick
|
||||
OnEnter = lstFilesEnter
|
||||
end
|
||||
object Panel1: TPanel
|
||||
Left = 0
|
||||
|
@ -108,7 +111,6 @@ inherited CEMiniExplorerWidget: TCEMiniExplorerWidget
|
|||
ClientHeight = 28
|
||||
ClientWidth = 335
|
||||
TabOrder = 3
|
||||
OnClick = Panel1Click
|
||||
object btnAddFav: TBitBtn
|
||||
Left = 0
|
||||
Height = 28
|
||||
|
@ -136,7 +138,7 @@ inherited CEMiniExplorerWidget: TCEMiniExplorerWidget
|
|||
object btnShellOpen: TBitBtn
|
||||
Left = 56
|
||||
Height = 28
|
||||
Hint = 'open the selected file with the shell'
|
||||
Hint = 'open the selected file or folder with the shell'
|
||||
Top = 0
|
||||
Width = 28
|
||||
Align = alLeft
|
||||
|
|
|
@ -31,6 +31,8 @@ type
|
|||
procedure assignTo(aValue: TPersistent); override;
|
||||
end;
|
||||
|
||||
{ TCEMiniExplorerWidget }
|
||||
|
||||
TCEMiniExplorerWidget = class(TCEWidget)
|
||||
btnAddFav: TBitBtn;
|
||||
btnEdit: TBitBtn;
|
||||
|
@ -49,11 +51,14 @@ type
|
|||
procedure btnShellOpenClick(Sender: TObject);
|
||||
procedure btnAddFavClick(Sender: TObject);
|
||||
procedure btnRemFavClick(Sender: TObject);
|
||||
procedure lstFavEnter(Sender: TObject);
|
||||
procedure lstFilesDblClick(Sender: TObject);
|
||||
procedure Panel1Click(Sender: TObject);
|
||||
procedure lstFilesEnter(Sender: TObject);
|
||||
procedure TreeEnter(Sender: TObject);
|
||||
private
|
||||
fFavorites: TStringList;
|
||||
fLastFold: string;
|
||||
fLastListOrTree: TControl;
|
||||
procedure lstFavDblClick(Sender: TObject);
|
||||
procedure updateFavorites;
|
||||
procedure treeSetRoots;
|
||||
|
@ -246,6 +251,11 @@ begin
|
|||
lstFiles.Clear;
|
||||
end;
|
||||
|
||||
procedure TCEMiniExplorerWidget.lstFavEnter(Sender: TObject);
|
||||
begin
|
||||
fLastListOrTree := lstFav;
|
||||
end;
|
||||
|
||||
procedure TCEMiniExplorerWidget.btnAddFavClick(Sender: TObject);
|
||||
begin
|
||||
if Tree.Selected = nil then exit;
|
||||
|
@ -318,22 +328,40 @@ begin
|
|||
shellOpenSelected;
|
||||
end;
|
||||
|
||||
procedure TCEMiniExplorerWidget.Panel1Click(Sender: TObject);
|
||||
procedure TCEMiniExplorerWidget.lstFilesEnter(Sender: TObject);
|
||||
begin
|
||||
fLastListOrTree := Tree;
|
||||
end;
|
||||
|
||||
procedure TCEMiniExplorerWidget.TreeEnter(Sender: TObject);
|
||||
begin
|
||||
fLastListOrTree := Tree;
|
||||
end;
|
||||
|
||||
procedure TCEMiniExplorerWidget.shellOpenSelected;
|
||||
var
|
||||
fname: string;
|
||||
fname: string = '';
|
||||
begin
|
||||
if lstFiles.Selected = nil then exit;
|
||||
if lstFiles.Selected.Data = nil then exit;
|
||||
fname := PString(lstFiles.Selected.Data)^;
|
||||
if not fileExists(fname) then exit;
|
||||
if not shellOpen(fname) then getMessageDisplay.message(
|
||||
(format('the shell failed to open "%s"', [shortenPath(fname, 25)])),
|
||||
nil, amcMisc, amkErr);
|
||||
if fLastListOrTree = lstFiles then
|
||||
begin
|
||||
if lstFiles.Selected = nil then exit;
|
||||
if lstFiles.Selected.Data = nil then exit;
|
||||
fname := PString(lstFiles.Selected.Data)^;
|
||||
end else if fLastListOrTree = Tree then
|
||||
begin
|
||||
if tree.Selected = nil then exit;
|
||||
if tree.Selected.Data = nil then exit;
|
||||
fname := PString(tree.Selected.Data)^;
|
||||
end
|
||||
else if fLastListOrTree = lstFav then
|
||||
begin
|
||||
if lstFav.Selected = nil then exit;
|
||||
if lstFav.Selected.Data = nil then exit;
|
||||
fname := PString(lstFav.Selected.Data)^;
|
||||
end;
|
||||
if fileExists(fname) then if not shellOpen(fname) then
|
||||
getMessageDisplay.message((format('the shell failed to open "%s"',
|
||||
[shortenPath(fname, 25)])), nil, amcMisc, amkErr);
|
||||
end;
|
||||
|
||||
procedure TCEMiniExplorerWidget.lstFilterChange(sender: TObject);
|
||||
|
|
Loading…
Reference in New Issue