ADD: Feature Request [ 1938593 ] More suitable and powerful plugin configuration

This commit is contained in:
Alexander Koblov 2008-08-21 11:50:04 +00:00
commit 591f5d2e76
6 changed files with 133 additions and 167 deletions

View file

@ -1,4 +1,5 @@
18.08.2008 ADD: Feature Request [ 1870517 ] Don't show not critical error messages
21.08.2008 ADD: Feature Request [ 1938593 ] More suitable and powerful plugin configuration
18.08.2008 ADD: Feature Request [ 1870517 ] Don't show not critical error messages
09.07.2008 ADD: Feature Request [ 2014247 ] Drive context menu
06.07.2008 ADD: Feature Request [ 1996336 ] Drag&Drop support
06.07.2008 FIX: Bug [ 1947579 ] Quick search by letter and non-alpha characters

View file

@ -1,40 +1,5 @@
[Configuration]
UseIniInProgramDir=0
RenameSelOnlyName=1
Main.Left=-4
Main.Top=-4
Main.Width=800
Main.Height=534
ShowSystemFiles=0
Term=/usr/X11R6/bin/xterm -e bash -i -c %s
CaseSensitiveSort=0
LynxLike=1
DirSelect=1
HotDir=
ShortFileSizeFormat=1
UseExtEdit=0
UseExtView=0
UseExtDiff=0
SeparateExt=1
RunTerm=/usr/X11R6/bin/xterm
FontWeight=1
FontSize=10
EditorSize=14
ViewerSize=14
IconsSize=16
Col0=133
Col1=50
Col2=64
Col3=73
Col4=59
Viewer.left=50
Viewer.top=50
Viewer.width=300
Viewer.height=400
Editor.left=50
Editor.top=50
Editor.width=300
Editor.height=400
[Colors]
ForeColor=0

View file

@ -1393,10 +1393,10 @@ object frmOptions: TfrmOptions
Columns = <
item
Alignment = taCenter
MaxSize = 60
MaxSize = 80
SizePriority = 0
Title.Caption = 'Active'
Width = 40
Width = 70
end
item
Title.Caption = 'Plugin'

View file

@ -49,11 +49,11 @@ TFRMOPTIONS.LBLPARAM.CAPTION=Param:
TFRMOPTIONS.BTSETHOTKEY.CAPTION=Set HotKey
TFRMOPTIONS.BTCLEARHOTKEY.CAPTION=Clear HotKey
TFRMOPTIONS.TSWCX.CAPTION=Packer plugins (.WCX)
TFRMOPTIONS.LBLWCXDESCRIPTION.CAPTION=&Packer plugins are used to work with archives.
TFRMOPTIONS.LBLWCXDESCRIPTION.CAPTION=Packer plugins are used to work with archives.
TFRMOPTIONS.TSWFX.CAPTION=File system plugins (.WFX)
TFRMOPTIONS.LBLWFXDESCRIPTION.CAPTION=&File system plugins allow access to disks inaccessible by operating system or to external devices like Palm/PocketPC.
TFRMOPTIONS.LBLWFXDESCRIPTION.CAPTION=File system plugins allow access to disks inaccessible by operating system or to external devices like Palm/PocketPC.
TFRMOPTIONS.TSWDX.CAPTION=Content plugins (.WDX)
TFRMOPTIONS.LBLWDXDESCRIPTION.CAPTION=&Content plugins allow to display extended file details like mp3 tags or image attributes in file lists, or use them in search and multi-rename tool
TFRMOPTIONS.LBLWDXDESCRIPTION.CAPTION=Content plugins allow to display extended file details like mp3 tags or image attributes in file lists, or use them in search and multi-rename tool
TFRMOPTIONS.TSDSX.CAPTION=Search plugins (.DSX)
TFRMOPTIONS.LBLDSXDESCRIPTION.CAPTION=Search plugins allow to use in search alternative search algorithms or external tools (like "locate", etc.)
TFRMOPTIONS.TSWLX.CAPTION=Viewer plugins (.WLX)

View file

@ -455,62 +455,6 @@ begin
end;
end;
procedure TfrmOptions.btnRemovePluginClick(Sender: TObject);
begin
if stgPlugins.Row <= 0 then Exit; // no plugins
if pcPluginsTypes.ActivePage.Name = 'tsDSX' then
begin
tmpDSXPlugins.DeleteItem(stgPlugins.Row - 1);
stgPlugins.DeleteColRow(False, stgPlugins.Row);
end
else if pcPluginsTypes.ActivePage.Name = 'tsWCX' then
begin
tmpWCXPlugins.Delete(stgPlugins.Row - 1);
stgPlugins.DeleteColRow(False, stgPlugins.Row);
end
else if pcPluginsTypes.ActivePage.Name = 'tsWDX' then
begin
tmpWDXPlugins.DeleteItem(stgPlugins.Row - 1);
stgPlugins.DeleteColRow(False, stgPlugins.Row);
end
else if pcPluginsTypes.ActivePage.Name = 'tsWFX' then
begin
tmpWFXPlugins.Delete(stgPlugins.Row - 1);
stgPlugins.DeleteColRow(False, stgPlugins.Row);
end
else if pcPluginsTypes.ActivePage.Name = 'tsWLX' then
begin
tmpWLXPlugins.DeleteItem(stgPlugins.Row - 1);
stgPlugins.DeleteColRow(False, stgPlugins.Row);
end
end;
procedure TfrmOptions.btnTweakPluginClick(Sender: TObject);
var
ptPluginType: TPluginType;
iPluginIndex: Integer;
begin
iPluginIndex:= stgPlugins.Row - 1;
if pcPluginsTypes.ActivePage.Name = 'tsDSX' then
ptPluginType:= ptDSX
else if pcPluginsTypes.ActivePage.Name = 'tsWCX' then
begin
ptPluginType:= ptWCX;
// get plugin index
iPluginIndex:= tmpWCXPlugins.IndexOfName(Copy2Space(stgPlugins.Cells[2, stgPlugins.Row]));
end
else if pcPluginsTypes.ActivePage.Name = 'tsWDX' then
ptPluginType:= ptWDX
else if pcPluginsTypes.ActivePage.Name = 'tsWFX' then
ptPluginType:= ptWFX
else if pcPluginsTypes.ActivePage.Name = 'tsWLX' then
ptPluginType:= ptWLX;
if ShowTweakPluginDlg(ptPluginType, iPluginIndex) then
pcPluginsTypes.ActivePage.OnShow(pcPluginsTypes.ActivePage); // update info in plugin list
end;
procedure TfrmOptions.cbbUseInvertedSelectionChange(Sender: TObject);
begin
pbExample.Repaint;
@ -849,6 +793,8 @@ begin
gbDateTimeFormat.Width:= iWidth;
end;
{ Plugins }
procedure TfrmOptions.stgPluginsBeforeSelection(Sender: TObject; aCol,
aRow: Integer);
begin
@ -860,28 +806,6 @@ begin
btnEnablePlugin.Enabled:= (stgPlugins.Cells[0, aRow] <> '');
end;
{ DSX plugins }
procedure TfrmOptions.btnDSXAddClick(Sender: TObject);
var
I, J: Integer;
sPluginName : String;
begin
odOpenDialog.Filter := 'Search plugins (*.dsx)|*.dsx';
if odOpenDialog.Execute then
begin
sPluginName := ExtractFileName(odOpenDialog.FileName);
Delete(sPluginName,length(sPluginName)-4,4);
I:= tmpDSXPlugins.Add(sPluginName,odOpenDialog.FileName,'');
stgPlugins.RowCount:= stgPlugins.RowCount + 1;
J:= stgPlugins.RowCount-1;
stgPlugins.Cells[1, J]:= tmpDSXPlugins.GetDsxModule(I).Name;
stgPlugins.Cells[2, J]:= tmpDSXPlugins.GetDsxModule(I).Descr;
stgPlugins.Cells[3, J]:= SetCmdDirAsEnvVar(tmpDSXPlugins.GetDsxModule(I).FileName);
end;
end;
procedure TfrmOptions.btnEnablePluginClick(Sender: TObject);
var
sExt,
@ -913,6 +837,123 @@ begin
end;
end;
procedure TfrmOptions.btnRemovePluginClick(Sender: TObject);
begin
if stgPlugins.Row <= 0 then Exit; // no plugins
if pcPluginsTypes.ActivePage.Name = 'tsDSX' then
begin
tmpDSXPlugins.DeleteItem(stgPlugins.Row - 1);
stgPlugins.DeleteColRow(False, stgPlugins.Row);
end
else if pcPluginsTypes.ActivePage.Name = 'tsWCX' then
begin
tmpWCXPlugins.Delete(stgPlugins.Row - 1);
stgPlugins.DeleteColRow(False, stgPlugins.Row);
end
else if pcPluginsTypes.ActivePage.Name = 'tsWDX' then
begin
tmpWDXPlugins.DeleteItem(stgPlugins.Row - 1);
stgPlugins.DeleteColRow(False, stgPlugins.Row);
end
else if pcPluginsTypes.ActivePage.Name = 'tsWFX' then
begin
tmpWFXPlugins.Delete(stgPlugins.Row - 1);
stgPlugins.DeleteColRow(False, stgPlugins.Row);
end
else if pcPluginsTypes.ActivePage.Name = 'tsWLX' then
begin
tmpWLXPlugins.DeleteItem(stgPlugins.Row - 1);
stgPlugins.DeleteColRow(False, stgPlugins.Row);
end
end;
procedure TfrmOptions.btnTweakPluginClick(Sender: TObject);
var
ptPluginType: TPluginType;
iPluginIndex: Integer;
begin
iPluginIndex:= stgPlugins.Row - 1;
if pcPluginsTypes.ActivePage.Name = 'tsDSX' then
ptPluginType:= ptDSX
else if pcPluginsTypes.ActivePage.Name = 'tsWCX' then
begin
ptPluginType:= ptWCX;
// get plugin index
iPluginIndex:= tmpWCXPlugins.IndexOfName(Copy2Space(stgPlugins.Cells[2, stgPlugins.Row]));
end
else if pcPluginsTypes.ActivePage.Name = 'tsWDX' then
ptPluginType:= ptWDX
else if pcPluginsTypes.ActivePage.Name = 'tsWFX' then
ptPluginType:= ptWFX
else if pcPluginsTypes.ActivePage.Name = 'tsWLX' then
ptPluginType:= ptWLX;
if ShowTweakPluginDlg(ptPluginType, iPluginIndex) then
pcPluginsTypes.ActivePage.OnShow(pcPluginsTypes.ActivePage); // update info in plugin list
end;
procedure TfrmOptions.btnConfigPluginClick(Sender: TObject);
var
WCXmodule: TWCXmodule;
WFXmodule: TWFXmodule;
begin
if stgPlugins.Row <= 0 then Exit; // no plugins
if pcPluginsTypes.ActivePage.Name = 'tsWCX' then
begin
WCXmodule := TWCXmodule.Create;
DebugLn('TWCXmodule created');
if WCXmodule.LoadModule(GetCmdDirFromEnvVar(tmpWCXPlugins.FileName[stgPlugins.Row - 1])) then
begin
DebugLn('WCXModule Loaded');
WCXmodule.VFSConfigure(Handle);
DebugLn('Dialog executed');
WCXModule.UnloadModule;
DebugLn('WCX Module Unloaded');
WCXmodule.Free;
DebugLn('WCX Freed');
end;
end
else if pcPluginsTypes.ActivePage.Name = 'tsWFX' then
begin
WFXmodule := TWFXmodule.Create;
DebugLn('TWFXmodule created');
if WFXmodule.LoadModule(GetCmdDirFromEnvVar(tmpWFXPlugins.FileName[stgPlugins.Row - 1])) then
begin
DebugLn('WFXModule Loaded');
WFXmodule.VFSConfigure(Handle);
DebugLn('Dialog executed');
WFXModule.UnloadModule;
DebugLn('WFX Module Unloaded');
WFXmodule.Free;
DebugLn('WFX Freed');
end;
end;
end;
{ DSX plugins }
procedure TfrmOptions.btnDSXAddClick(Sender: TObject);
var
I, J: Integer;
sPluginName : String;
begin
odOpenDialog.Filter := 'Search plugins (*.dsx)|*.dsx';
if odOpenDialog.Execute then
begin
sPluginName := ExtractFileName(odOpenDialog.FileName);
Delete(sPluginName,length(sPluginName)-4,4);
I:= tmpDSXPlugins.Add(sPluginName,odOpenDialog.FileName,'');
stgPlugins.RowCount:= stgPlugins.RowCount + 1;
J:= stgPlugins.RowCount-1;
stgPlugins.Cells[1, J]:= tmpDSXPlugins.GetDsxModule(I).Name;
stgPlugins.Cells[2, J]:= tmpDSXPlugins.GetDsxModule(I).Descr;
stgPlugins.Cells[3, J]:= SetCmdDirAsEnvVar(tmpDSXPlugins.GetDsxModule(I).FileName);
end;
end;
procedure TfrmOptions.tsDSXShow(Sender: TObject);
var i:integer;
begin
@ -1270,10 +1311,9 @@ end;
procedure TfrmOptions.lbxCategoriesSelectionChange(Sender: TObject; User: boolean);
begin
if lbxCategories.ItemIndex=-1 then exit;
Actions.GetCommandsByCategory( lbxCategories.items.Strings[lbxCategories.ItemIndex],lbxCommands.items);
lbxCommands.Sorted:=true;
if lbxCategories.ItemIndex=-1 then exit;
Actions.GetCommandsByCategory( lbxCategories.items.Strings[lbxCategories.ItemIndex],lbxCommands.items);
lbxCommands.Sorted:= True;
end;
procedure TfrmOptions.nbNotebookPageChanged(Sender: TObject);
@ -1357,45 +1397,6 @@ begin
lbCategoriesClick(lbCategories);
end;
procedure TfrmOptions.btnConfigPluginClick(Sender: TObject);
var
WCXmodule: TWCXmodule;
WFXmodule: TWFXmodule;
begin
if stgPlugins.Row <= 0 then Exit; // no plugins
if pcPluginsTypes.ActivePage.Name = 'tsWCX' then
begin
WCXmodule := TWCXmodule.Create;
DebugLn('TWCXmodule created');
if WCXmodule.LoadModule(GetCmdDirFromEnvVar(tmpWCXPlugins.FileName[stgPlugins.Row - 1])) then
begin
DebugLn('WCXModule Loaded');
WCXmodule.VFSConfigure(Handle);
DebugLn('Dialog executed');
WCXModule.UnloadModule;
DebugLn('WCX Module Unloaded');
WCXmodule.Free;
DebugLn('WCX Freed');
end;
end
else if pcPluginsTypes.ActivePage.Name = 'tsWFX' then
begin
WFXmodule := TWFXmodule.Create;
DebugLn('TWFXmodule created');
if WFXmodule.LoadModule(GetCmdDirFromEnvVar(tmpWFXPlugins.FileName[stgPlugins.Row - 1])) then
begin
DebugLn('WFXModule Loaded');
WFXmodule.VFSConfigure(Handle);
DebugLn('Dialog executed');
WFXModule.UnloadModule;
DebugLn('WFX Module Unloaded');
WFXmodule.Free;
DebugLn('WFX Freed');
end;
end;
end;
procedure TfrmOptions.btnCategoryColorClick(Sender: TObject);
begin
if optColorDialog.Execute then
@ -1581,7 +1582,6 @@ begin
edtRunTerm.Text:=gRunTerm;
//tvTreeView.Items.Item[3].Text := lngGetString(clngDlgOptFonts);
{ Colors }
cbTextColor.Selected := gForeColor;

View file

@ -76,8 +76,8 @@ var
gDirSortFirst:Boolean=True; // want to show dir first in panels
gDirHistoryCount:Integer=30; // how many history we remember
gShowSystemFiles:Boolean=True;
gTerm:String='/usr/X11R6/bin/xterm -e bash -i -c %s';
gRunTerm:String='/usr/X11R6/bin/xterm';
gTerm: String;
gRunTerm: String;
gCaseSensitiveSort:Boolean=True;
gLynxLike:Boolean=True;
gDirSelect:Boolean=True;
@ -422,7 +422,7 @@ begin
gShowSystemFiles := gIni.ReadBool('Configuration', 'ShowSystemFiles', False);
gPOFileName := gIni.ReadString('Configuration', 'Language', '');
gTerm := gIni.ReadString('Configuration', 'Term', gTerm);
gTerm := gIni.ReadString('Configuration', 'Term', Terminal);
gCaseSensitiveSort := gIni.ReadBool('Configuration', 'CaseSensitiveSort', False);
gLynxLike := gIni.ReadBool('Configuration', 'LynxLike', True);
gDirSelect := gIni.ReadBool('Configuration', 'DirSelect', True);
@ -447,7 +447,7 @@ begin
gExtEdit := gIni.ReadString('Configuration', 'ExtEdit', '');
gExtView := gIni.ReadString('Configuration', 'ExtView', '');
gExtDiff := gIni.ReadString('Configuration', 'ExtDiff', '');
gRunTerm := gIni.ReadString('Configuration', 'RunTerm', gRunTerm);
gRunTerm := gIni.ReadString('Configuration', 'RunTerm', Terminal);
gLuaLib:=gIni.ReadString('Configuration', 'LuaLib', gLuaLib);