mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-21 09:58:13 +00:00
ADD: Feature [ 0000392] "Open with" custom application option
This commit is contained in:
parent
8cc50ac067
commit
ac95b59efb
6 changed files with 509 additions and 3 deletions
|
|
@ -282,7 +282,7 @@ end;"/>
|
|||
<MinVersion Minor="3" Valid="True"/>
|
||||
</Item11>
|
||||
</RequiredPackages>
|
||||
<Units Count="205">
|
||||
<Units Count="207">
|
||||
<Unit0>
|
||||
<Filename Value="doublecmd.lpr"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
|
|
@ -1474,6 +1474,19 @@ end;"/>
|
|||
<IsPartOfProject Value="True"/>
|
||||
<UnitName Value="uOrderedFileView"/>
|
||||
</Unit204>
|
||||
<Unit205>
|
||||
<Filename Value="fopenwith.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<ComponentName Value="frmOpenWith"/>
|
||||
<HasResources Value="True"/>
|
||||
<ResourceBaseClass Value="Form"/>
|
||||
<UnitName Value="fOpenWith"/>
|
||||
</Unit205>
|
||||
<Unit206>
|
||||
<Filename Value="platform\unix\ukeyfile.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<UnitName Value="uKeyFile"/>
|
||||
</Unit206>
|
||||
</Units>
|
||||
</ProjectOptions>
|
||||
<CompilerOptions>
|
||||
|
|
|
|||
217
src/fopenwith.lfm
Executable file
217
src/fopenwith.lfm
Executable file
|
|
@ -0,0 +1,217 @@
|
|||
object frmOpenWith: TfrmOpenWith
|
||||
Left = 470
|
||||
Height = 474
|
||||
Top = 167
|
||||
Width = 410
|
||||
Caption = 'Choose an application'
|
||||
ClientHeight = 474
|
||||
ClientWidth = 410
|
||||
OnClose = FormClose
|
||||
OnCreate = FormCreate
|
||||
OnDestroy = FormDestroy
|
||||
LCLVersion = '1.0.2.0'
|
||||
object lblMimeType: TLabel
|
||||
Left = 6
|
||||
Height = 16
|
||||
Top = 6
|
||||
Width = 404
|
||||
Align = alTop
|
||||
BorderSpacing.Left = 6
|
||||
BorderSpacing.Top = 6
|
||||
Caption = 'File type to be opened: %s'
|
||||
ParentColor = False
|
||||
end
|
||||
object pnlOpenWith: TPanel
|
||||
Left = 0
|
||||
Height = 37
|
||||
Top = 341
|
||||
Width = 410
|
||||
Align = alBottom
|
||||
AutoSize = True
|
||||
BevelOuter = bvNone
|
||||
ClientHeight = 37
|
||||
ClientWidth = 410
|
||||
Color = clForm
|
||||
Enabled = False
|
||||
ParentColor = False
|
||||
TabOrder = 0
|
||||
object fneCommand: TFileNameEdit
|
||||
AnchorSideLeft.Control = pnlOpenWith
|
||||
AnchorSideTop.Side = asrBottom
|
||||
AnchorSideRight.Control = btnCommands
|
||||
AnchorSideBottom.Side = asrBottom
|
||||
Left = 6
|
||||
Height = 25
|
||||
Top = 7
|
||||
Width = 354
|
||||
DialogOptions = []
|
||||
FilterIndex = 0
|
||||
HideDirectories = False
|
||||
ButtonWidth = 23
|
||||
NumGlyphs = 1
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
BorderSpacing.Left = 6
|
||||
BorderSpacing.Top = 6
|
||||
BorderSpacing.Bottom = 6
|
||||
MaxLength = 0
|
||||
TabOrder = 0
|
||||
end
|
||||
object btnCommands: TSpeedButton
|
||||
AnchorSideLeft.Side = asrBottom
|
||||
AnchorSideTop.Control = fneCommand
|
||||
AnchorSideRight.Control = pnlOpenWith
|
||||
AnchorSideRight.Side = asrBottom
|
||||
AnchorSideBottom.Control = fneCommand
|
||||
AnchorSideBottom.Side = asrBottom
|
||||
Left = 384
|
||||
Height = 25
|
||||
Top = 7
|
||||
Width = 20
|
||||
Anchors = [akTop, akRight, akBottom]
|
||||
AutoSize = True
|
||||
BorderSpacing.Left = 24
|
||||
BorderSpacing.Right = 6
|
||||
Glyph.Data = {
|
||||
36040000424D3604000000000000360000002800000010000000100000000100
|
||||
2000000000000004000064000000640000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
000000000000000000000000000000000000A46534CCA46534FFA46534FFA465
|
||||
34CC000000000000000000000000000000000000000000000000000000000000
|
||||
000000000000000000000000000000000000A46534FFE6CEB7FFE6CEB7FFA465
|
||||
34FF000000000000000000000000000000000000000000000000000000000000
|
||||
000000000000000000000000000000000000A46534FFE6CEB7FFD9AD86FFA465
|
||||
34FF000000000000000000000000000000000000000000000000000000000000
|
||||
000000000000000000000000000000000000A46534FFE6CEB7FFD9AD86FFA465
|
||||
34FF000000000000000000000000000000000000000000000000000000000000
|
||||
0000A46534CCA46534FFA46534FFA46534FFA46534FFD9AD86FFD9AD86FFA465
|
||||
34FFA46534FFA46534FFA46534FFA46534CC0000000000000000000000000000
|
||||
0000A46534FFE5CCB4FFDBB795FFDBB694FFDAB492FFDAB390FFD9AD86FFD8AA
|
||||
83FFD7A87FFFD7A67DFFE0BE9FFFA46534FF0000000000000000000000000000
|
||||
0000A46534FFE8D3C0FFE7D1BBFFE7D1BCFFE6CEB7FFE6CEB7FFE6CEB7FFE6CE
|
||||
B7FFE6CDB6FFE6CCB5FFE6CCB6FFA46534FF0000000000000000000000000000
|
||||
0000A46534CCA46534FFA46534FFA46534FFA46534FFE6CEB7FFE6CEB7FFA465
|
||||
34FFA46534FFA46534FFA46534FFA46534CC0000000000000000000000000000
|
||||
000000000000000000000000000000000000A46534FFE6CEB7FFE6CEB7FFA465
|
||||
34FF000000000000000000000000000000000000000000000000000000000000
|
||||
000000000000000000000000000000000000A46534FFE6CEB7FFE6CEB7FFA465
|
||||
34FF000000000000000000000000000000000000000000000000000000000000
|
||||
000000000000000000000000000000000000A46534FFE6CEB7FFE6CEB7FFA465
|
||||
34FF000000000000000000000000000000000000000000000000000000000000
|
||||
000000000000000000000000000000000000A46534CCA46534FFA46534FFA465
|
||||
34CC000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000
|
||||
}
|
||||
NumGlyphs = 0
|
||||
OnClick = btnCommandsClick
|
||||
PopupMenu = pmFieldCodes
|
||||
end
|
||||
end
|
||||
object ButtonPanel: TButtonPanel
|
||||
Left = 6
|
||||
Height = 40
|
||||
Top = 428
|
||||
Width = 398
|
||||
OKButton.Name = 'OKButton'
|
||||
OKButton.DefaultCaption = True
|
||||
OKButton.OnClick = OKButtonClick
|
||||
HelpButton.Name = 'HelpButton'
|
||||
HelpButton.DefaultCaption = True
|
||||
CloseButton.Name = 'CloseButton'
|
||||
CloseButton.DefaultCaption = True
|
||||
CancelButton.Name = 'CancelButton'
|
||||
CancelButton.DefaultCaption = True
|
||||
CancelButton.OnClick = CancelButtonClick
|
||||
TabOrder = 1
|
||||
ShowButtons = [pbOK, pbCancel]
|
||||
end
|
||||
object tvApplications: TTreeView
|
||||
Left = 0
|
||||
Height = 291
|
||||
Top = 28
|
||||
Width = 410
|
||||
Align = alClient
|
||||
BorderSpacing.Top = 6
|
||||
DefaultItemHeight = 18
|
||||
Images = ImageList
|
||||
ReadOnly = True
|
||||
ScrollBars = ssAutoBoth
|
||||
TabOrder = 2
|
||||
OnDeletion = tvApplicationsDeletion
|
||||
OnSelectionChanged = tvApplicationsSelectionChanged
|
||||
Options = [tvoAutoItemHeight, tvoHideSelection, tvoKeepCollapsedNodes, tvoReadOnly, tvoShowButtons, tvoShowLines, tvoShowRoot, tvoToolTips, tvoThemedDraw]
|
||||
end
|
||||
object chkUseAsDefault: TCheckBox
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 6
|
||||
Height = 22
|
||||
Top = 400
|
||||
Width = 404
|
||||
Align = alBottom
|
||||
BorderSpacing.Left = 6
|
||||
Caption = 'Set selected application as default action'
|
||||
Enabled = False
|
||||
TabOrder = 3
|
||||
end
|
||||
object chkCustomCommand: TCheckBox
|
||||
AnchorSideLeft.Control = Owner
|
||||
AnchorSideTop.Side = asrBottom
|
||||
AnchorSideRight.Control = Owner
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 6
|
||||
Height = 22
|
||||
Top = 319
|
||||
Width = 398
|
||||
Align = alBottom
|
||||
Anchors = [akLeft, akRight]
|
||||
BorderSpacing.Left = 6
|
||||
BorderSpacing.Right = 6
|
||||
Caption = 'Custom command'
|
||||
OnChange = chkCustomCommandChange
|
||||
TabOrder = 4
|
||||
end
|
||||
object chkSaveAssociation: TCheckBox
|
||||
Left = 6
|
||||
Height = 22
|
||||
Top = 378
|
||||
Width = 404
|
||||
Align = alBottom
|
||||
BorderSpacing.Left = 6
|
||||
Caption = 'Save association'
|
||||
OnChange = chkSaveAssociationChange
|
||||
TabOrder = 5
|
||||
end
|
||||
object ImageList: TImageList
|
||||
left = 208
|
||||
top = 136
|
||||
end
|
||||
object pmFieldCodes: TPopupMenu
|
||||
left = 123
|
||||
top = 135
|
||||
object miSingleFileName: TMenuItem
|
||||
Caption = 'Single file name'
|
||||
Hint = '%f'
|
||||
OnClick = miFieldCodeClick
|
||||
end
|
||||
object miListOfFiles: TMenuItem
|
||||
Caption = 'Multiple file names'
|
||||
Hint = '%F'
|
||||
OnClick = miFieldCodeClick
|
||||
end
|
||||
object miSingleURL: TMenuItem
|
||||
Caption = 'Single URI'
|
||||
Hint = '%u'
|
||||
OnClick = miFieldCodeClick
|
||||
end
|
||||
object miListOfURLs: TMenuItem
|
||||
Caption = 'Multiple URIs'
|
||||
Hint = '%U'
|
||||
OnClick = miFieldCodeClick
|
||||
end
|
||||
end
|
||||
end
|
||||
13
src/fopenwith.lrt
Executable file
13
src/fopenwith.lrt
Executable file
|
|
@ -0,0 +1,13 @@
|
|||
TFRMOPENWITH.CAPTION=Choose an application
|
||||
TFRMOPENWITH.LBLMIMETYPE.CAPTION=File type to be opened: %s
|
||||
TFRMOPENWITH.CHKUSEASDEFAULT.CAPTION=Set selected application as default action
|
||||
TFRMOPENWITH.CHKCUSTOMCOMMAND.CAPTION=Custom command
|
||||
TFRMOPENWITH.CHKSAVEASSOCIATION.CAPTION=Save association
|
||||
TFRMOPENWITH.MISINGLEFILENAME.CAPTION=Single file name
|
||||
TFRMOPENWITH.MISINGLEFILENAME.HINT=%f
|
||||
TFRMOPENWITH.MILISTOFFILES.CAPTION=Multiple file names
|
||||
TFRMOPENWITH.MILISTOFFILES.HINT=%F
|
||||
TFRMOPENWITH.MISINGLEURL.CAPTION=Single URI
|
||||
TFRMOPENWITH.MISINGLEURL.HINT=%u
|
||||
TFRMOPENWITH.MILISTOFURLS.CAPTION=Multiple URIs
|
||||
TFRMOPENWITH.MILISTOFURLS.HINT=%U
|
||||
241
src/fopenwith.pas
Executable file
241
src/fopenwith.pas
Executable file
|
|
@ -0,0 +1,241 @@
|
|||
{
|
||||
Double Commander
|
||||
-------------------------------------------------------------------------
|
||||
Open with other application dialog
|
||||
|
||||
Copyright (C) 2012 Alexander Koblov (alexx2000@mail.ru)
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
}
|
||||
|
||||
unit fOpenWith;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
|
||||
ExtCtrls, EditBtn, Buttons, ButtonPanel, ComCtrls, Menus, Types;
|
||||
|
||||
type
|
||||
|
||||
{ TfrmOpenWith }
|
||||
|
||||
TfrmOpenWith = class(TForm)
|
||||
btnCommands: TSpeedButton;
|
||||
ButtonPanel: TButtonPanel;
|
||||
chkSaveAssociation: TCheckBox;
|
||||
chkCustomCommand: TCheckBox;
|
||||
chkUseAsDefault: TCheckBox;
|
||||
fneCommand: TFileNameEdit;
|
||||
ImageList: TImageList;
|
||||
lblMimeType: TLabel;
|
||||
miListOfURLs: TMenuItem;
|
||||
miSingleURL: TMenuItem;
|
||||
miListOfFiles: TMenuItem;
|
||||
miSingleFileName: TMenuItem;
|
||||
pnlOpenWith: TPanel;
|
||||
pmFieldCodes: TPopupMenu;
|
||||
tvApplications: TTreeView;
|
||||
procedure btnCommandsClick(Sender: TObject);
|
||||
procedure CancelButtonClick(Sender: TObject);
|
||||
procedure chkCustomCommandChange(Sender: TObject);
|
||||
procedure chkSaveAssociationChange(Sender: TObject);
|
||||
procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure FormDestroy(Sender: TObject);
|
||||
procedure miFieldCodeClick(Sender: TObject);
|
||||
procedure OKButtonClick(Sender: TObject);
|
||||
procedure tvApplicationsDeletion(Sender: TObject; Node: TTreeNode);
|
||||
procedure tvApplicationsSelectionChanged(Sender: TObject);
|
||||
private
|
||||
FMimeType: UTF8String;
|
||||
FFileList: TStringList;
|
||||
procedure LoadApplicationList;
|
||||
public
|
||||
constructor Create(TheOwner: TComponent; AFileList: TStringList); reintroduce;
|
||||
end;
|
||||
|
||||
procedure ShowOpenWithDlg(const FileList: TStringList);
|
||||
|
||||
implementation
|
||||
|
||||
{$R *.lfm}
|
||||
|
||||
uses
|
||||
LCLProc, uOSUtils, uPixMapManager, uGlobs, uKeyFile, uMimeActions, uLng;
|
||||
|
||||
procedure ShowOpenWithDlg(const FileList: TStringList);
|
||||
begin
|
||||
with TfrmOpenWith.Create(Application, FileList) do
|
||||
begin
|
||||
Show;
|
||||
end;
|
||||
end;
|
||||
|
||||
{ TfrmOpenWith }
|
||||
|
||||
constructor TfrmOpenWith.Create(TheOwner: TComponent; AFileList: TStringList);
|
||||
begin
|
||||
FFileList:= AFileList;
|
||||
inherited Create(TheOwner);
|
||||
InitPropStorage(Self);
|
||||
end;
|
||||
|
||||
procedure TfrmOpenWith.FormCreate(Sender: TObject);
|
||||
begin
|
||||
ImageList.Width:= gIconsSize;
|
||||
ImageList.Height:= gIconsSize;
|
||||
FMimeType:= GetFileMimeType(FFileList[0]);
|
||||
lblMimeType.Caption:= Format(lblMimeType.Caption, [FMimeType]);
|
||||
LoadApplicationList;
|
||||
end;
|
||||
|
||||
procedure TfrmOpenWith.chkCustomCommandChange(Sender: TObject);
|
||||
begin
|
||||
pnlOpenWith.Enabled:= chkCustomCommand.Checked;
|
||||
end;
|
||||
|
||||
procedure TfrmOpenWith.chkSaveAssociationChange(Sender: TObject);
|
||||
begin
|
||||
chkUseAsDefault.Enabled:= chkSaveAssociation.Checked;
|
||||
end;
|
||||
|
||||
procedure TfrmOpenWith.FormClose(Sender: TObject; var CloseAction: TCloseAction);
|
||||
begin
|
||||
CloseAction:= caFree;
|
||||
end;
|
||||
|
||||
procedure TfrmOpenWith.btnCommandsClick(Sender: TObject);
|
||||
begin
|
||||
pmFieldCodes.PopUp();
|
||||
end;
|
||||
|
||||
procedure TfrmOpenWith.CancelButtonClick(Sender: TObject);
|
||||
begin
|
||||
Close;
|
||||
end;
|
||||
|
||||
procedure TfrmOpenWith.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
FFileList.Free;
|
||||
end;
|
||||
|
||||
procedure TfrmOpenWith.miFieldCodeClick(Sender: TObject);
|
||||
begin
|
||||
fneCommand.Text:= fneCommand.Text + #32 + TMenuItem(Sender).Hint;
|
||||
fneCommand.SelStart:= UTF8Length(fneCommand.Text);
|
||||
end;
|
||||
|
||||
procedure TfrmOpenWith.OKButtonClick(Sender: TObject);
|
||||
var
|
||||
DesktopFile: PDesktopFileEntry;
|
||||
DesktopEntry: TDesktopFileEntry;
|
||||
begin
|
||||
if chkCustomCommand.Checked then
|
||||
begin
|
||||
DesktopFile:= @DesktopEntry;
|
||||
DesktopEntry.MimeType:= FMimeType;
|
||||
DesktopEntry.ExecWithParams:= fneCommand.Text;
|
||||
end
|
||||
else if tvApplications.SelectionCount > 0 then
|
||||
begin
|
||||
DesktopFile:= PDesktopFileEntry(tvApplications.Selected.Data);
|
||||
fneCommand.Text:= DesktopFile^.DesktopFilePath;
|
||||
end;
|
||||
if Assigned(DesktopFile) then
|
||||
begin
|
||||
if chkSaveAssociation.Checked then
|
||||
begin
|
||||
if not AddDesktopEntry(FMimeType, fneCommand.Text, chkUseAsDefault.Checked) then
|
||||
begin
|
||||
MessageDlg(rsMsgErrSaveAssociation, mtError, [mbOK], 0);
|
||||
end;
|
||||
end;
|
||||
fneCommand.Text:= TranslateAppExecToCmdLine(DesktopFile, FFileList);
|
||||
ExecCmdFork(fneCommand.Text);
|
||||
end;
|
||||
Close;
|
||||
end;
|
||||
|
||||
procedure TfrmOpenWith.tvApplicationsDeletion(Sender: TObject; Node: TTreeNode);
|
||||
var
|
||||
DesktopFile: PDesktopFileEntry;
|
||||
begin
|
||||
DesktopFile:= PDesktopFileEntry(Node.Data);
|
||||
Dispose(DesktopFile);
|
||||
end;
|
||||
|
||||
procedure TfrmOpenWith.tvApplicationsSelectionChanged(Sender: TObject);
|
||||
var
|
||||
DesktopFile: PDesktopFileEntry;
|
||||
begin
|
||||
if tvApplications.SelectionCount > 0 then
|
||||
begin
|
||||
chkCustomCommand.Checked:= False;
|
||||
DesktopFile:= PDesktopFileEntry(tvApplications.Selected.Data);
|
||||
fneCommand.Text:= DesktopFile^.ExecWithParams;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmOpenWith.LoadApplicationList;
|
||||
const
|
||||
Folders: array [1..2] of UTF8String = ('/.local/share/applications',
|
||||
'/usr/share/applications');
|
||||
var
|
||||
I, J: Integer;
|
||||
Bitmap: TBitmap;
|
||||
ImageIndex: PtrInt;
|
||||
TreeNode: TTreeNode;
|
||||
Applications: TStringList;
|
||||
DesktopFile: PDesktopFileEntry;
|
||||
begin
|
||||
Folders[1]:= GetHomeDir + Folders[1];
|
||||
for I:= Low(Folders) to High(Folders) do
|
||||
begin
|
||||
Applications:= FindAllFiles(Folders[I], '*.desktop', True);
|
||||
for J:= 0 to Applications.Count - 1 do
|
||||
begin
|
||||
DesktopFile:= GetDesktopEntry(Applications[J]);
|
||||
if Assigned(DesktopFile) then
|
||||
begin
|
||||
if DesktopFile^.Hidden or (Pos('Screensaver', DesktopFile^.Categories) > 0) then
|
||||
begin
|
||||
Dispose(DesktopFile);
|
||||
Continue;
|
||||
end;
|
||||
TreeNode:= tvApplications.Items.AddChild(nil, DesktopFile^.DisplayName);
|
||||
TreeNode.Data:= DesktopFile;
|
||||
ImageIndex:= PixMapManager.GetIconByName(DesktopFile^.IconName);
|
||||
if ImageIndex >= 0 then
|
||||
begin
|
||||
Bitmap:= PixMapManager.GetBitmap(ImageIndex);
|
||||
if Assigned(Bitmap) then
|
||||
begin
|
||||
TreeNode.ImageIndex:= ImageList.Add(Bitmap, nil);
|
||||
TreeNode.SelectedIndex:= TreeNode.ImageIndex;
|
||||
TreeNode.StateIndex:= TreeNode.ImageIndex;
|
||||
Bitmap.Free;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
Applications.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
end.
|
||||
|
||||
|
|
@ -47,6 +47,7 @@ type
|
|||
procedure DriveMountSelect(Sender: TObject);
|
||||
procedure DriveUnmountSelect(Sender: TObject);
|
||||
procedure DriveEjectSelect(Sender: TObject);
|
||||
procedure OpenWithOtherSelect(Sender: TObject);
|
||||
procedure OpenWithMenuItemSelect(Sender: TObject);
|
||||
function FillOpenWithSubMenu: Boolean;
|
||||
public
|
||||
|
|
@ -64,7 +65,7 @@ uses
|
|||
{$IF DEFINED(DARWIN)}
|
||||
, MacOSAll
|
||||
{$ELSEIF DEFINED(LINUX)}
|
||||
, uMimeActions
|
||||
, uMimeActions, fOpenWith
|
||||
{$ENDIF}
|
||||
;
|
||||
|
||||
|
|
@ -231,6 +232,19 @@ begin
|
|||
EjectDrive(@FDrive);
|
||||
end;
|
||||
|
||||
procedure TShellContextMenu.OpenWithOtherSelect(Sender: TObject);
|
||||
var
|
||||
I: LongInt;
|
||||
FileNames: TStringList;
|
||||
begin
|
||||
{$IF DEFINED(LINUX)}
|
||||
FileNames := TStringList.Create;
|
||||
for I := 0 to FFiles.Count - 1 do
|
||||
FileNames.Add(FFiles[I].FullPath);
|
||||
ShowOpenWithDlg(FileNames);
|
||||
{$ENDIF}
|
||||
end;
|
||||
|
||||
procedure TShellContextMenu.OpenWithMenuItemSelect(Sender: TObject);
|
||||
var
|
||||
ExecCmd: String;
|
||||
|
|
@ -356,8 +370,14 @@ begin
|
|||
mi.OnClick := Self.OpenWithMenuItemSelect;
|
||||
miOpenWith.Add(mi);
|
||||
end;
|
||||
miOpenWith.AddSeparator;
|
||||
end;
|
||||
|
||||
mi := TMenuItem.Create(miOpenWith);
|
||||
mi.Caption := rsMnuOpenWithOther;
|
||||
mi.OnClick := Self.OpenWithOtherSelect;
|
||||
miOpenWith.Add(mi);
|
||||
|
||||
finally
|
||||
FreeAndNil(FileNames);
|
||||
if Assigned(DesktopEntries) then
|
||||
|
|
|
|||
|
|
@ -112,6 +112,7 @@ resourcestring
|
|||
rsMsgErrDateNotSupported = 'Date %s is not supported';
|
||||
rsMsgErrSaveFile = 'Cannot save file';
|
||||
rsMsgErrCanNotConnect = 'Can not connect to server: "%s"';
|
||||
rsMsgErrSaveAssociation = 'Can not save association!';
|
||||
rsMsgFileOperationsActive = 'File operations active';
|
||||
rsMsgFileOperationsActiveLong = 'Some file operations have not yet finished. Closing Double Commander may result in data loss.';
|
||||
rsMsgConfirmQuit = 'Are you sure you want to quit?';
|
||||
|
|
@ -130,7 +131,8 @@ resourcestring
|
|||
rsMnuActions = 'Actions';
|
||||
rsMnuView = 'View';
|
||||
rsMnuEdit = 'Edit';
|
||||
rsMnuOpenWith = 'Open with ...';
|
||||
rsMnuOpenWith = 'Open with';
|
||||
rsMnuOpenWithOther = 'Other...';
|
||||
rsMnuMount = 'Mount';
|
||||
rsMnuUmount = 'Unmount';
|
||||
rsMnuNoMedia = 'No media available';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue