View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0000680 | Double Commander | File operations | public | 2013-06-20 19:40 | 2019-06-08 15:26 |
| Reporter | gatika | Assigned To | Alexx2000 | ||
| Priority | normal | Severity | feature | Reproducibility | always |
| Status | closed | Resolution | fixed | ||
| Projection | none | ETA | none | ||
| Target Version | 0.6.0 | Fixed in Version | 0.6.0 | ||
| Summary | 0000680: Button bar functions does not expand file/directory parameters into archives | ||||
| Description | If I define a new button on the button bar, then I can enter a parameter like %Dl and %Dr which gets replaced by the actual selected directories. I use this feature to call an external compare program 'Beyond Compare'. If the selected directory is inside a zip or 7z archive, then the replaced path should be complete. E.g: I'm inside a zip in the dir 'subdir', then I would expect the replacement to be '/home/archive.zip/subdir'. The external comparer can handle such paths. I'm used to this behaviour from total commander. It is one of the few features which I miss on double commander. I'm willing to change the code myself, but I have not found any suitable place to patch. The class architecture does not well support this. Can you give me some hints where to start? | ||||
| Tags | No tags attached. | ||||
| Attached Files | doublecommand-zippath.diff (4,918 bytes)
Index: ushellexecute.pas
===================================================================
--- ushellexecute.pas (Revision 5666)
+++ ushellexecute.pas (Arbeitskopie)
@@ -27,7 +27,7 @@
interface
uses
- Classes, SysUtils, uFile, uFileView;
+ Classes, SysUtils, uFile, uFileView, uFileSource;
type
TPrepareParameterOption = (ppoNormalizePathDelims, ppoReplaceTilde);
@@ -94,7 +94,9 @@
%f - only filename
%d - only path, without trailing delimiter
%p - path+filename
+ %a - full archive + path + filename
%D - current path in active or chosen panel
+ %A - current archive
Choosing panel (if not given, active panel is used):
%X[l|r|s|t] - where X is function (l - left, r - right, s - source, t - target)
@@ -136,7 +138,7 @@
rightPanel: TFileView;
activePanel: TFileView): String;
type
- TFunctType = (ftNone, ftName, ftDir, ftPath, ftSingleDir);
+ TFunctType = (ftNone, ftName, ftDir, ftPath, ftSingleDir, ftSource, ftSourcePath);
TStatePos = (spNone, spPercent, spFunction, spPrefix, spPostfix,
spGotPrefix, spSide, spIndex, spComplete);
@@ -146,6 +148,7 @@
funct: TFunctType;
files: TFiles;
dir: String;
+ filesource: IFilesource;
sFileIndex: String;
prefix, postfix: String; // a string to add before/after each output
// (for functions giving output of multiple strings)
@@ -159,6 +162,8 @@
inactiveFiles: TFiles;
activeDir: String;
inactiveDir: String;
+ activeFileSource : IFileSource;
+ inactiveFileSource : IFileSource;
state: Tstate;
sOutput: String = '';
parseStartIndex: Integer;
@@ -174,6 +179,10 @@
Result := aFile.FullPath;
ftSingleDir:
Result := ExcludeTrailingPathDelimiter(state.dir);
+ ftSource:
+ Result := state.filesource.GetCurrentAddress;
+ ftSourcePath:
+ Result := state.filesource.GetCurrentAddress + aFile.FullPath;
else
Exit('');
end;
@@ -203,6 +212,7 @@
pos := spNone;
files := activeFiles;
dir := activeDir;
+ filesource := activeFilesource;
sFileIndex := '';
funct := ftNone;
functStartIndex := 0;
@@ -242,9 +252,9 @@
end
else
begin
- if state.funct in [ftName, ftPath, ftDir] then
+ if state.funct in [ftName, ftPath, ftDir, ftSourcePath] then
sOutput := sOutput + BuildAllNames
- else if state.funct in [ftSingleDir] then // only single current dir
+ else if state.funct in [ftSingleDir, ftSource] then // only single current dir
sOutput := sOutput + BuildName(nil);
end;
@@ -280,15 +290,19 @@
begin
activeFiles := leftFiles;
activeDir := leftPanel.CurrentPath;
+ activeFilesource := leftPanel.FileSource;
inactiveFiles := rightFiles;
inactiveDir := rightPanel.CurrentPath;
+ inactiveFilesource := rightPanel.FileSource;
end
else
begin
activeFiles := rightFiles;
activeDir := rightPanel.CurrentPath;
+ activeFilesource := rightPanel.FileSource;
inactiveFiles := leftFiles;
inactiveDir := leftPanel.CurrentPath;
+ inactiveFilesource := leftPanel.FileSource;
end;
index := 1;
@@ -328,6 +342,16 @@
state.funct := ftPath;
state.pos := spFunction;
end;
+ 'A':
+ begin
+ state.funct := ftSource;
+ state.pos := spFunction;
+ end;
+ 'a':
+ begin
+ state.funct := ftSourcePath;
+ state.pos := spFunction;
+ end;
else
ResetState(state);
end;
@@ -338,6 +362,7 @@
begin
state.files := leftFiles;
state.dir := leftpanel.CurrentPath;
+ state.filesource := leftPanel.FileSource;
state.pos := spSide;
end;
@@ -345,6 +370,7 @@
begin
state.files := rightFiles;
state.dir := rightPanel.CurrentPath;
+ state.filesource := rightPanel.FileSource;
state.pos := spSide;
end;
@@ -352,6 +378,7 @@
begin
state.files := activeFiles;
state.dir := activeDir;
+ state.filesource := activeFilesource;
state.pos := spSide;
end;
@@ -359,6 +386,7 @@
begin
state.files := inactiveFiles;
state.dir := inactiveDir;
+ state.filesource := inactiveFilesource;
state.pos := spSide;
end;
| ||||
| Fixed in Revision | 5677 | ||||
| Operating system | Windows | ||||
| Widgetset | Win32 | ||||
| Architecture | 64-bit | ||||
|
|
I have found a solution myself. See attached patch file doublecommand-zippath.diff I have added new control characters %a and %A for replacing the actual archive name in the command. I'm not sure about the character a, but it is okay for an abreviation of archive. The patch works well for my purposes. Could someone please integrate it into trunk? |
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2013-06-20 19:40 | gatika | New Issue | |
| 2014-11-20 22:17 | gatika | File Added: doublecommand-zippath.diff | |
| 2014-11-20 22:20 | gatika | Note Added: 0001330 | |
| 2014-11-23 23:10 | Alexx2000 | Assigned To | => Alexx2000 |
| 2014-11-23 23:10 | Alexx2000 | Status | new => assigned |
| 2014-11-23 23:10 | Alexx2000 | Target Version | => 0.6.0 |
| 2014-11-23 23:18 | Alexx2000 | Fixed in Revision | => 5677 |
| 2014-11-23 23:18 | Alexx2000 | Status | assigned => resolved |
| 2014-11-23 23:18 | Alexx2000 | Fixed in Version | => 0.6.0 |
| 2014-11-23 23:18 | Alexx2000 | Resolution | open => fixed |
| 2015-01-22 14:28 | Alexx2000 | Relationship added | related to 0000329 |
| 2019-06-08 15:26 | Alexx2000 | Status | resolved => closed |