├── code ├── upgrades │ ├── commandoo-x86_64.AppImage.ver.txt │ ├── commandoo-x86_64_4.AppImage │ ├── commandoo-x86_64_4.AppImage.sig │ ├── commandoo-x86_64_4.AppImage.zsync │ └── commandoo-x86_64_4.AppImage.readme.txt ├── DB.sqlite ├── commandoo.ico ├── commandoo.res ├── searches │ ├── DB_KEY:_Encryption │ ├── DB_KEY:_System_Info │ ├── DB:_CmdLines_NotTerminalOnly │ ├── DB:_Require_ROOT │ ├── DB:_Serious_Threatlevels │ ├── DB:_Unassigned_Threatlevels │ ├── .CurrKWSearch{6719E184-7C35-4D81-B5BF-16D4BF36ECC8} │ ├── .CurrKWSearch{88732DB1-398D-4281-B36F-9A17810FFC32} │ ├── .CurrSearch{6719E184-7C35-4D81-B5BF-16D4BF36ECC8} │ ├── .CurrSearch{88732DB1-398D-4281-B36F-9A17810FFC32} │ ├── DB:_Gimp_Example │ ├── DB_KEY:_SysAdmin │ ├── DB:_Serious_Threatlevels_2 │ └── DB:_Commands_for_copy.move.rename.delete_files ├── hintframe.lfm ├── DBMisc.data ├── hintframe.pp ├── ufrmfind.lfm ├── ufrm_search_operator.lfm ├── ufrmnolanguage.lfm ├── ufrm_search_enum.lfm ├── ufrm_search_bool.lfm ├── ufrm_search_text.lfm ├── ufrm_search_integer.lfm ├── ufrm_search_double.lfm ├── ufrmnolanguage.pp ├── ufrm_search_string.lfm ├── ufrmprofilesmerge.lfm ├── ufrmfindtext.lfm ├── commandoo.lpr ├── usingleinput.lfm ├── unitfrmcommandsinput.lfm ├── ufrmlistmanagerconsolidate.lfm ├── ufrmaddlanguage.lfm ├── ufrmmsgdlg.lfm ├── ufrm_search_operator.pp ├── unitglobform.pp ├── ufrmsuperuserfile.lfm ├── ufrmfind.pp ├── ufrm_search_list.lfm ├── unitfrmcommandsvar.lfm ├── unitfrmcommandsinput.pp ├── ufrmmanageprofile.lfm ├── unitglob.pp ├── ufrm_search_enum.pp ├── ufrm_search_bool.pp ├── ufrm_search_double.pp ├── ufrm_search_integer.pp ├── ufrmlistmanagerconsolidate.pp ├── ufrmsearch.lfm ├── ufrm_search_text.pp ├── ufrmprofilesmerge.pp ├── ufrmcmdlineedit.lfm ├── ufrm_search_string.pp ├── ufrmlistmanager.lfm ├── strconst_prog.pp ├── ufrmsuperuserfile.pp ├── ufrm_search_list.pp └── ufrmaddlanguage.pp ├── commandoo_2_0_1.png ├── commandooChildProc.png ├── commandooEditMode.png ├── commandooFavorites.png ├── commandooInProgHelp.png ├── commandooSearchSimple.png ├── commandooSearchAdvanced.png └── .gitignore /code/upgrades/commandoo-x86_64.AppImage.ver.txt: -------------------------------------------------------------------------------- 1 | 4 2 | -------------------------------------------------------------------------------- /code/upgrades/commandoo-x86_64_4.AppImage: -------------------------------------------------------------------------------- 1 | AppImage executable 2 | -------------------------------------------------------------------------------- /code/upgrades/commandoo-x86_64_4.AppImage.sig: -------------------------------------------------------------------------------- 1 | generate with gpg2/gpg 2 | -------------------------------------------------------------------------------- /code/DB.sqlite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/probonopd/commandoo/master/code/DB.sqlite -------------------------------------------------------------------------------- /code/upgrades/commandoo-x86_64_4.AppImage.zsync: -------------------------------------------------------------------------------- 1 | generate zsync file if applicable 2 | -------------------------------------------------------------------------------- /code/commandoo.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/probonopd/commandoo/master/code/commandoo.ico -------------------------------------------------------------------------------- /code/commandoo.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/probonopd/commandoo/master/code/commandoo.res -------------------------------------------------------------------------------- /commandoo_2_0_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/probonopd/commandoo/master/commandoo_2_0_1.png -------------------------------------------------------------------------------- /commandooChildProc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/probonopd/commandoo/master/commandooChildProc.png -------------------------------------------------------------------------------- /commandooEditMode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/probonopd/commandoo/master/commandooEditMode.png -------------------------------------------------------------------------------- /commandooFavorites.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/probonopd/commandoo/master/commandooFavorites.png -------------------------------------------------------------------------------- /commandooInProgHelp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/probonopd/commandoo/master/commandooInProgHelp.png -------------------------------------------------------------------------------- /commandooSearchSimple.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/probonopd/commandoo/master/commandooSearchSimple.png -------------------------------------------------------------------------------- /commandooSearchAdvanced.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/probonopd/commandoo/master/commandooSearchAdvanced.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | commandoo.xcf 2 | lib 3 | code/lib 4 | code/*.ini 5 | code/*.bak 6 | code/*.dbg 7 | code/commandoo 8 | code/commandoo64* 9 | code/commandoo.settings 10 | code/*.data 11 | code/*.sqlite 12 | code/searchesXXX/.* 13 | download/* 14 | code/DBBak/* 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /code/searches/DB_KEY:_Encryption: -------------------------------------------------------------------------------- 1 | [WARNING] 2 | README1================================== 3 | README2= 4 | README3=This is an automatically generated and maintained Data file. 5 | README4= --- Edit this file by hand AT YOUR OWN RISK! --- 6 | README5= 7 | README6================================== 8 | 9 | [Search] 10 | DBInfo=DB (text) 11 | Name=DB_KEY:_Encryption 12 | UserTag=1 13 | 14 | [0Search] 15 | IsUsed=1 16 | UserTag=0 17 | SICount=1 18 | 19 | [0SI0] 20 | FieldType=List 21 | SOT=None 22 | UserTag=0 23 | UID=379104383 24 | CaseSensitive=0 25 | Condition=M= 26 | SearchValue=Encryption 27 | OrigField=Keywords : Keywords 28 | 29 | [1Search] 30 | IsUsed=0 31 | UserTag=0 32 | SICount=0 33 | -------------------------------------------------------------------------------- /code/searches/DB_KEY:_System_Info: -------------------------------------------------------------------------------- 1 | [WARNING] 2 | README1================================== 3 | README2= 4 | README3=This is an automatically generated and maintained Data file. 5 | README4= --- Edit this file by hand AT YOUR OWN RISK! --- 6 | README5= 7 | README6================================== 8 | 9 | [Search] 10 | DBInfo=DB (text) 11 | Name=DB_KEY:_System_Info 12 | UserTag=1 13 | 14 | [0Search] 15 | IsUsed=1 16 | UserTag=0 17 | SICount=1 18 | 19 | [0SI0] 20 | FieldType=List 21 | SOT=None 22 | UserTag=0 23 | UID=379104383 24 | CaseSensitive=0 25 | Condition=M= 26 | SearchValue=Information 27 | OrigField=Keywords : Keywords 28 | 29 | [1Search] 30 | IsUsed=0 31 | UserTag=0 32 | SICount=0 33 | -------------------------------------------------------------------------------- /code/searches/DB:_CmdLines_NotTerminalOnly: -------------------------------------------------------------------------------- 1 | [WARNING] 2 | README1================================== 3 | README2= 4 | README3=This is an automatically generated and maintained Data file. 5 | README4= --- Edit this file by hand AT YOUR OWN RISK! --- 6 | README5= 7 | README6================================== 8 | 9 | [Search] 10 | DBInfo=DB (text) 11 | Name=DB:_CmdLines_NotTerminalOnly 12 | UserTag=0 13 | 14 | [0Search] 15 | IsUsed=1 16 | UserTag=0 17 | SICount=0 18 | 19 | [1Search] 20 | IsUsed=1 21 | UserTag=0 22 | SICount=1 23 | 24 | [1SI0] 25 | FieldType=Bool 26 | SOT=None 27 | UserTag=0 28 | UID=35133422 29 | CaseSensitive=0 30 | Condition== 31 | SearchValue=f 32 | OrigField=Term. Only : TerminalOnly 33 | -------------------------------------------------------------------------------- /code/hintframe.lfm: -------------------------------------------------------------------------------- 1 | object FrameHint: TFrameHint 2 | Left = 0 3 | Height = 41 4 | Top = 0 5 | Width = 427 6 | Anchors = [akTop, akRight] 7 | ClientHeight = 41 8 | ClientWidth = 427 9 | Color = clRed 10 | DesignTimePPI = 128 11 | Font.Height = -14 12 | ParentColor = False 13 | ParentFont = False 14 | TabOrder = 0 15 | DesignLeft = 225 16 | DesignTop = 404 17 | object cbHints: TCheckBox 18 | Left = 196 19 | Height = 22 20 | Hint = 'Help HInts now Showing' 21 | Top = 4 22 | Width = 215 23 | Anchors = [akTop, akRight] 24 | Caption = '&H Show hints on mouseover' 25 | OnChange = cbHintsChange 26 | OnKeyDown = cbHintsKeyDown 27 | TabOrder = 0 28 | end 29 | end 30 | -------------------------------------------------------------------------------- /code/searches/DB:_Require_ROOT: -------------------------------------------------------------------------------- 1 | [WARNING] 2 | README1================================== 3 | README2= 4 | README3=This is an automatically generated and maintained Data file. 5 | README4= --- Edit this file by hand AT YOUR OWN RISK! --- 6 | README5= 7 | README6================================== 8 | 9 | [Search] 10 | DBInfo=DB (text) 11 | Name=DB:_Require_ROOT 12 | UserTag=0 13 | 14 | [0Search] 15 | IsUsed=1 16 | UserTag=0 17 | SICount=1 18 | 19 | [0SI0] 20 | FieldType=Bool 21 | SOT=None 22 | UserTag=0 23 | UID=829800545 24 | CaseSensitive=0 25 | Condition== 26 | SearchValue=t 27 | OrigField=As SuperUser : SuperUserMode 28 | 29 | [1Search] 30 | IsUsed=1 31 | UserTag=0 32 | SICount=1 33 | 34 | [1SI0] 35 | FieldType=Bool 36 | SOT=None 37 | UserTag=0 38 | UID=829800545 39 | CaseSensitive=0 40 | Condition== 41 | SearchValue=t 42 | OrigField=As SuperUser : SuperUserMode 43 | -------------------------------------------------------------------------------- /code/searches/DB:_Serious_Threatlevels: -------------------------------------------------------------------------------- 1 | [WARNING] 2 | README1================================== 3 | README2= 4 | README3=This is an automatically generated and maintained Data file. 5 | README4= --- Edit this file by hand AT YOUR OWN RISK! --- 6 | README5= 7 | README6================================== 8 | 9 | [Search] 10 | DBInfo=DB (text) 11 | Name=DB:_Serious_Threatlevels 12 | UserTag=0 13 | 14 | [0Search] 15 | IsUsed=1 16 | UserTag=0 17 | SICount=1 18 | 19 | [0SI0] 20 | FieldType=Enum 21 | SOT=None 22 | UserTag=0 23 | UID=559326324 24 | CaseSensitive=0 25 | Condition=GTE 26 | SearchValue=3 27 | OrigField=ThreatLevel : ThreatLevel 28 | 29 | [1Search] 30 | IsUsed=1 31 | UserTag=0 32 | SICount=1 33 | 34 | [1SI0] 35 | FieldType=Enum 36 | SOT=None 37 | UserTag=0 38 | UID=559326324 39 | CaseSensitive=0 40 | Condition=GTE 41 | SearchValue=2 42 | OrigField=ThreatLevel : ThreatLevel 43 | -------------------------------------------------------------------------------- /code/searches/DB:_Unassigned_Threatlevels: -------------------------------------------------------------------------------- 1 | [WARNING] 2 | README1================================== 3 | README2= 4 | README3=This is an automatically generated and maintained Data file. 5 | README4= --- Edit this file by hand AT YOUR OWN RISK! --- 6 | README5= 7 | README6================================== 8 | 9 | [Search] 10 | DBInfo=DB (text) 11 | Name=DB:_Unassigned_Threatlevels 12 | UserTag=0 13 | 14 | [0Search] 15 | IsUsed=1 16 | UserTag=0 17 | SICount=1 18 | 19 | [0SI0] 20 | FieldType=Enum 21 | SOT=None 22 | UserTag=0 23 | UID=559326324 24 | CaseSensitive=0 25 | Condition== 26 | SearchValue=0 27 | OrigField=ThreatLevel : ThreatLevel 28 | 29 | [1Search] 30 | IsUsed=1 31 | UserTag=0 32 | SICount=1 33 | 34 | [1SI0] 35 | FieldType=Enum 36 | SOT=None 37 | UserTag=0 38 | UID=559326324 39 | CaseSensitive=0 40 | Condition== 41 | SearchValue=0 42 | OrigField=ThreatLevel : ThreatLevel 43 | -------------------------------------------------------------------------------- /code/DBMisc.data: -------------------------------------------------------------------------------- 1 | [WARNING] 2 | README1================================== 3 | README2= 4 | README3=This is an automatically generated and maintained Data file. 5 | README4= --- Edit this file by hand AT YOUR OWN RISK! --- 6 | README5= 7 | README6================================== 8 | 9 | [_DB_VersionCount] 10 | LastVersionUpgrade=7 11 | TextDataType=Misc 12 | 13 | [-LoadMe_Misc_List_Keywords-] 14 | 0=Administration 15 | 1=Archive 16 | 2=Compression 17 | 3=Encryption 18 | 4=Files 19 | 5=File system 20 | 6=Graphics 21 | 7=Hardware 22 | 8=Helper 23 | 9=Information 24 | 10=Install 25 | 11=Internet 26 | 12=KDE 27 | 13=Linux Trix 28 | 14=Memory 29 | 15=Navigation 30 | 16=Networking 31 | 17=Package 32 | 18=Search 33 | 19=Shell 34 | 20=Software 35 | 21=Source Code 36 | 22=System 37 | 23=Text 38 | 24=Tool 39 | 25=Utility 40 | 41 | [_DB_ProfileGUID] 42 | GUID={88732DB1-398D-4281-B36F-9A17810FFC32} 43 | -------------------------------------------------------------------------------- /code/searches/.CurrKWSearch{6719E184-7C35-4D81-B5BF-16D4BF36ECC8}: -------------------------------------------------------------------------------- 1 | [WARNING] 2 | README1================================== 3 | README2= 4 | README3=This is an automatically generated and maintained Data file. 5 | README4= --- Edit this file by hand AT YOUR OWN RISK! --- 6 | README5= 7 | README6================================== 8 | 9 | [Search] 10 | DBInfo=DB (sql) 11 | Name=NewSearch 12 | UserTag=1 13 | 14 | [0Search] 15 | IsUsed=1 16 | UserTag=0 17 | SICount=3 18 | 19 | [0SI0] 20 | FieldType=List 21 | SOT=None 22 | UserTag=0 23 | UID=379104383 24 | CaseSensitive=0 25 | Condition=M= 26 | SearchValue=System 27 | OrigField=Keywords : Keywords 28 | 29 | [0SI1] 30 | FieldType=UD 31 | SOT=Or 32 | UserTag=0 33 | 34 | [0SI2] 35 | FieldType=List 36 | SOT=None 37 | UserTag=0 38 | UID=379104383 39 | CaseSensitive=0 40 | Condition=M= 41 | SearchValue=Encryption 42 | OrigField=Keywords : Keywords 43 | 44 | [1Search] 45 | IsUsed=0 46 | UserTag=0 47 | SICount=0 48 | -------------------------------------------------------------------------------- /code/searches/.CurrKWSearch{88732DB1-398D-4281-B36F-9A17810FFC32}: -------------------------------------------------------------------------------- 1 | [WARNING] 2 | README1================================== 3 | README2= 4 | README3=This is an automatically generated and maintained Data file. 5 | README4= --- Edit this file by hand AT YOUR OWN RISK! --- 6 | README5= 7 | README6================================== 8 | 9 | [Search] 10 | DBInfo=DB (text) 11 | Name=NewSearch 12 | UserTag=1 13 | 14 | [0Search] 15 | IsUsed=1 16 | UserTag=0 17 | SICount=3 18 | 19 | [0SI0] 20 | FieldType=List 21 | SOT=None 22 | UserTag=0 23 | UID=379104383 24 | CaseSensitive=0 25 | Condition=M= 26 | SearchValue=System 27 | OrigField=Keywords : Keywords 28 | 29 | [0SI1] 30 | FieldType=UD 31 | SOT=Or 32 | UserTag=0 33 | 34 | [0SI2] 35 | FieldType=List 36 | SOT=None 37 | UserTag=0 38 | UID=379104383 39 | CaseSensitive=0 40 | Condition=M= 41 | SearchValue=Administration 42 | OrigField=Keywords : Keywords 43 | 44 | [1Search] 45 | IsUsed=0 46 | UserTag=0 47 | SICount=0 48 | -------------------------------------------------------------------------------- /code/upgrades/commandoo-x86_64_4.AppImage.readme.txt: -------------------------------------------------------------------------------- 1 | This file generated from button on main form in DEV mode. 2 | 3 | Fill in this file with fixes/features. 4 | The .ver.txt file is ready, the other files have stubs for the naming convention. 5 | Replace stubs and deploy the files to website. 6 | 7 | If the update is a NEW VERSION (ie. changes DB Schema) PUT A WARNING!!!... 8 | ...that the update is NOT compatible with what they have and if they want to go 9 | back to the old version they MUST have a backup of their config folder and 10 | that must be put back in place!!! 11 | 12 | Depending on user wishes: I check, or the User, checks: 13 | https://timepirate.org/downloads/commandoo-x86_64.AppImage.ver.txt 14 | 15 | The number in that file serves as basis for the other support files: 16 | commandoo-x86_64_4.AppImage.readme.txt (this file) 17 | commandoo-x86_64_4.AppImage 18 | commandoo-x86_64_4.AppImage.sig 19 | commandoo-x86_64_4.AppImage.zsync (if applicable) 20 | -------------------------------------------------------------------------------- /code/hintframe.pp: -------------------------------------------------------------------------------- 1 | unit HintFrame; 2 | 3 | {$mode objfpc}{$H+} 4 | 5 | interface 6 | 7 | uses 8 | Classes, SysUtils, LazFileUtils 9 | , lcltype {THis is needed for key up keyboard constants} 10 | , Forms, Controls, StdCtrls; 11 | 12 | type 13 | 14 | { TFrameHint } 15 | 16 | TFrameHint = class (TFrame) 17 | cbHints : TCheckBox; 18 | procedure cbHintsChange(Sender : TObject); 19 | procedure cbHintsKeyDown( Sender : TObject; var Key : Word; Shift : TShiftState ); 20 | private 21 | { private declarations } 22 | public 23 | { public declarations } 24 | end ; 25 | 26 | implementation 27 | 28 | {$R *.lfm} 29 | 30 | { TFrameHint } 31 | 32 | procedure TFrameHint.cbHintsChange(Sender : TObject); 33 | begin 34 | ShowHint := cbHints.Checked; 35 | GetParentForm( self ).ShowHint := ShowHint; 36 | end; 37 | 38 | procedure TFrameHint.cbHintsKeyDown( Sender : TObject; var Key : Word; Shift : TShiftState ); 39 | begin 40 | if key = vk_return then 41 | key := vk_unknown; 42 | end; 43 | 44 | end . 45 | 46 | -------------------------------------------------------------------------------- /code/searches/.CurrSearch{6719E184-7C35-4D81-B5BF-16D4BF36ECC8}: -------------------------------------------------------------------------------- 1 | [WARNING] 2 | README1================================== 3 | README2= 4 | README3=This is an automatically generated and maintained Data file. 5 | README4= --- Edit this file by hand AT YOUR OWN RISK! --- 6 | README5= 7 | README6================================== 8 | 9 | [Search] 10 | DBInfo=DB (sql) 11 | Name=NewSearch 12 | UserTag=0 13 | 14 | [0Search] 15 | IsUsed=1 16 | UserTag=0 17 | SICount=3 18 | 19 | [0SI0] 20 | FieldType=StrKey 21 | SOT=None 22 | UserTag=0 23 | UID=238227321 24 | CaseSensitive=0 25 | Condition=* 26 | SearchValue=zip 27 | OrigField=Command Name : CommandName 28 | 29 | [0SI1] 30 | FieldType=UD 31 | SOT=Or 32 | UserTag=0 33 | 34 | [0SI2] 35 | FieldType=StrKey 36 | SOT=None 37 | UserTag=0 38 | UID=238227321 39 | CaseSensitive=0 40 | Condition=* 41 | SearchValue=id 42 | OrigField=Command Name : CommandName 43 | 44 | [1Search] 45 | IsUsed=1 46 | UserTag=0 47 | SICount=1 48 | 49 | [1SI0] 50 | FieldType=Str 51 | SOT=None 52 | UserTag=0 53 | UID=101507315 54 | CaseSensitive=0 55 | Condition=* 56 | SearchValue=grep 57 | OrigField=CmdLine : Entry 58 | -------------------------------------------------------------------------------- /code/searches/.CurrSearch{88732DB1-398D-4281-B36F-9A17810FFC32}: -------------------------------------------------------------------------------- 1 | [WARNING] 2 | README1================================== 3 | README2= 4 | README3=This is an automatically generated and maintained Data file. 5 | README4= --- Edit this file by hand AT YOUR OWN RISK! --- 6 | README5= 7 | README6================================== 8 | 9 | [Search] 10 | DBInfo=DB (text) 11 | Name=NewSearch 12 | UserTag=0 13 | 14 | [0Search] 15 | IsUsed=1 16 | UserTag=0 17 | SICount=3 18 | 19 | [0SI0] 20 | FieldType=StrKey 21 | SOT=None 22 | UserTag=0 23 | UID=238227321 24 | CaseSensitive=0 25 | Condition=* 26 | SearchValue=zip 27 | OrigField=Command Name : CommandName 28 | 29 | [0SI1] 30 | FieldType=UD 31 | SOT=Or 32 | UserTag=0 33 | 34 | [0SI2] 35 | FieldType=StrKey 36 | SOT=None 37 | UserTag=0 38 | UID=238227321 39 | CaseSensitive=0 40 | Condition=* 41 | SearchValue=id 42 | OrigField=Command Name : CommandName 43 | 44 | [1Search] 45 | IsUsed=1 46 | UserTag=0 47 | SICount=1 48 | 49 | [1SI0] 50 | FieldType=Str 51 | SOT=None 52 | UserTag=0 53 | UID=101507315 54 | CaseSensitive=0 55 | Condition=* 56 | SearchValue=grep 57 | OrigField=CmdLine : Entry 58 | -------------------------------------------------------------------------------- /code/searches/DB:_Gimp_Example: -------------------------------------------------------------------------------- 1 | [WARNING] 2 | README1================================== 3 | README2= 4 | README3=This is an automatically generated and maintained Data file. 5 | README4= --- Edit this file by hand AT YOUR OWN RISK! --- 6 | README5= 7 | README6================================== 8 | 9 | [Search] 10 | DBInfo=DB (text) 11 | Name=DB:_Gimp_Example 12 | UserTag=0 13 | 14 | [0Search] 15 | IsUsed=1 16 | UserTag=0 17 | SICount=0 18 | 19 | [1Search] 20 | IsUsed=1 21 | UserTag=0 22 | SICount=7 23 | 24 | [1SI0] 25 | FieldType=UD 26 | SOT=( 27 | UserTag=0 28 | 29 | [1SI1] 30 | FieldType=Bool 31 | SOT=None 32 | UserTag=0 33 | UID=403489349 34 | CaseSensitive=0 35 | Condition== 36 | SearchValue=t 37 | OrigField=Child Proc : DetachProcess 38 | 39 | [1SI2] 40 | FieldType=UD 41 | SOT=And 42 | UserTag=0 43 | 44 | [1SI3] 45 | FieldType=Bool 46 | SOT=None 47 | UserTag=0 48 | UID=54495245 49 | CaseSensitive=0 50 | Condition== 51 | SearchValue=t 52 | OrigField=Is Favorite : IsFavorite 53 | 54 | [1SI4] 55 | FieldType=UD 56 | SOT=) 57 | UserTag=0 58 | 59 | [1SI5] 60 | FieldType=UD 61 | SOT=And 62 | UserTag=0 63 | 64 | [1SI6] 65 | FieldType=Str 66 | SOT=None 67 | UserTag=0 68 | UID=101507315 69 | CaseSensitive=0 70 | Condition=* 71 | SearchValue=gimp 72 | OrigField=CmdLine : Entry 73 | -------------------------------------------------------------------------------- /code/searches/DB_KEY:_SysAdmin: -------------------------------------------------------------------------------- 1 | [WARNING] 2 | README1================================== 3 | README2= 4 | README3=This is an automatically generated and maintained Data file. 5 | README4= --- Edit this file by hand AT YOUR OWN RISK! --- 6 | README5= 7 | README6================================== 8 | 9 | [Search] 10 | DBInfo=DB (text) 11 | Name=DB_KEY:_SysAdmin 12 | UserTag=1 13 | 14 | [0Search] 15 | IsUsed=1 16 | UserTag=0 17 | SICount=7 18 | 19 | [0SI0] 20 | FieldType=List 21 | SOT=None 22 | UserTag=0 23 | UID=379104383 24 | CaseSensitive=0 25 | Condition=M= 26 | SearchValue=Administration 27 | OrigField=Keywords : Keywords 28 | 29 | [0SI1] 30 | FieldType=UD 31 | SOT=Or 32 | UserTag=0 33 | 34 | [0SI2] 35 | FieldType=List 36 | SOT=None 37 | UserTag=0 38 | UID=379104383 39 | CaseSensitive=0 40 | Condition=M= 41 | SearchValue=File system 42 | OrigField=Keywords : Keywords 43 | 44 | [0SI3] 45 | FieldType=UD 46 | SOT=Or 47 | UserTag=0 48 | 49 | [0SI4] 50 | FieldType=List 51 | SOT=None 52 | UserTag=0 53 | UID=379104383 54 | CaseSensitive=0 55 | Condition=M= 56 | SearchValue=Hardware 57 | OrigField=Keywords : Keywords 58 | 59 | [0SI5] 60 | FieldType=UD 61 | SOT=Or 62 | UserTag=0 63 | 64 | [0SI6] 65 | FieldType=List 66 | SOT=None 67 | UserTag=0 68 | UID=379104383 69 | CaseSensitive=0 70 | Condition=M= 71 | SearchValue=System 72 | OrigField=Keywords : Keywords 73 | 74 | [1Search] 75 | IsUsed=0 76 | UserTag=0 77 | SICount=0 78 | -------------------------------------------------------------------------------- /code/ufrmfind.lfm: -------------------------------------------------------------------------------- 1 | object frmFind: TfrmFind 2 | Left = 1978 3 | Height = 250 4 | Top = 866 5 | Width = 300 6 | ActiveControl = edtFind 7 | BorderStyle = bsNone 8 | Caption = 'frmFind' 9 | ClientHeight = 250 10 | ClientWidth = 300 11 | Color = clBlack 12 | Constraints.MaxHeight = 250 13 | Constraints.MaxWidth = 300 14 | Constraints.MinHeight = 250 15 | Constraints.MinWidth = 300 16 | DesignTimePPI = 128 17 | Font.Color = clCream 18 | Font.Height = -18 19 | KeyPreview = True 20 | OnCreate = FormCreate 21 | OnDeactivate = FormDeactivate 22 | OnKeyDown = FormKeyDown 23 | LCLVersion = '2.0.6.0' 24 | object edtFind: TEdit 25 | Left = 1 26 | Height = 45 27 | Top = 0 28 | Width = 298 29 | Anchors = [akTop, akLeft, akRight] 30 | AutoSize = False 31 | AutoSelect = False 32 | Font.Color = clCream 33 | Font.Height = -18 34 | OnChange = edtFindChange 35 | OnKeyDown = edtFindKeyDown 36 | ParentColor = True 37 | ParentFont = False 38 | TabOrder = 0 39 | TextHint = 'Sanity check...' 40 | end 41 | object lbFindResult: TListBox 42 | Left = 1 43 | Height = 208 44 | Top = 43 45 | Width = 298 46 | Anchors = [akTop, akLeft, akRight] 47 | Font.Color = clCream 48 | Font.Height = -18 49 | ItemHeight = 0 50 | OnDblClick = lbFindResultDblClick 51 | OnKeyDown = lbFindResultKeyDown 52 | ParentColor = True 53 | ParentFont = False 54 | ScrollWidth = 296 55 | TabOrder = 1 56 | TopIndex = -1 57 | end 58 | end 59 | -------------------------------------------------------------------------------- /code/ufrm_search_operator.lfm: -------------------------------------------------------------------------------- 1 | object frm_Search_Operator: Tfrm_Search_Operator 2 | Left = 2155 3 | Height = 507 4 | Top = 646 5 | Width = 487 6 | BorderIcons = [] 7 | BorderStyle = bsNone 8 | Caption = 'frm_Search_Operator' 9 | ClientHeight = 507 10 | ClientWidth = 487 11 | Constraints.MaxHeight = 507 12 | Constraints.MaxWidth = 487 13 | Constraints.MinHeight = 507 14 | Constraints.MinWidth = 487 15 | DesignTimePPI = 128 16 | Font.Height = -16 17 | KeyPreview = True 18 | OnCreate = FormCreate 19 | OnKeyDown = FormKeyDown 20 | LCLVersion = '2.0.6.0' 21 | object rgSeOpOperator: TRadioGroup 22 | Left = 104 23 | Height = 144 24 | Hint = 'Select the kind of operator you want for the'#10'currently selected item.'#10#10'' 25 | Top = 75 26 | Width = 263 27 | Anchors = [akTop, akLeft, akRight] 28 | AutoFill = False 29 | Caption = 'Operator Kind' 30 | ChildSizing.LeftRightSpacing = 6 31 | ChildSizing.ShrinkHorizontal = crsScaleChilds 32 | ChildSizing.ShrinkVertical = crsScaleChilds 33 | ChildSizing.Layout = cclLeftToRightThenTopToBottom 34 | ChildSizing.ControlsPerLine = 1 35 | ClientHeight = 120 36 | ClientWidth = 261 37 | Font.Height = -16 38 | Items.Strings = ( 39 | 'OR' 40 | 'AND' 41 | 'XOR' 42 | ) 43 | OnSelectionChanged = rgSeOpOperatorSelectionChanged 44 | ParentFont = False 45 | TabOrder = 0 46 | end 47 | object lblSeOpType: TLabel 48 | Left = 12 49 | Height = 31 50 | Top = 7 51 | Width = 468 52 | Alignment = taRightJustify 53 | Anchors = [akTop, akLeft, akRight] 54 | AutoSize = False 55 | Caption = 'Operator' 56 | Font.Height = -21 57 | Font.Style = [fsBold] 58 | ParentColor = False 59 | ParentFont = False 60 | end 61 | end 62 | -------------------------------------------------------------------------------- /code/ufrmnolanguage.lfm: -------------------------------------------------------------------------------- 1 | object frmNoLanguage: TfrmNoLanguage 2 | Left = 2325 3 | Height = 290 4 | Top = 523 5 | Width = 650 6 | ActiveControl = cbLanguage 7 | Caption = 'Language / Sprache / Idioma / Langue' 8 | ClientHeight = 290 9 | ClientWidth = 650 10 | Constraints.MinHeight = 290 11 | Constraints.MinWidth = 650 12 | DesignTimePPI = 128 13 | Font.Height = -16 14 | OnCloseQuery = FormCloseQuery 15 | OnCreate = FormCreate 16 | Position = poScreenCenter 17 | LCLVersion = '2.0.6.0' 18 | object cbLanguage: TComboBox 19 | Left = 26 20 | Height = 37 21 | Top = 53 22 | Width = 603 23 | Anchors = [akTop, akLeft, akRight] 24 | AutoSelect = False 25 | AutoSize = False 26 | Font.Height = -16 27 | ItemHeight = 0 28 | ParentFont = False 29 | TabOrder = 0 30 | end 31 | object lblProgDesc: TLabel 32 | Left = 26 33 | Height = 36 34 | Top = 11 35 | Width = 603 36 | Alignment = taCenter 37 | Anchors = [akTop, akLeft, akRight] 38 | AutoSize = False 39 | Caption = 'NT' 40 | Font.Height = -16 41 | ParentColor = False 42 | ParentFont = False 43 | end 44 | object Label2: TLabel 45 | Left = 27 46 | Height = 93 47 | Top = 189 48 | Width = 586 49 | Anchors = [akTop, akLeft, akRight, akBottom] 50 | AutoSize = False 51 | Caption = 'If you like this program, and you want to contribute, and you are bi-lingual consider writing a translation for it. It''s actually pretty easy-ish .. .email me (in "about" section) and I''ll tell you how.' 52 | Font.Height = -16 53 | ParentColor = False 54 | ParentFont = False 55 | WordWrap = True 56 | end 57 | object btnOK: TBitBtn 58 | Left = 480 59 | Height = 75 60 | Top = 103 61 | Width = 149 62 | Anchors = [akTop, akRight] 63 | Default = True 64 | DefaultCaption = True 65 | Font.Height = -16 66 | Kind = bkOK 67 | ModalResult = 1 68 | OnClick = btnOKClick 69 | ParentFont = False 70 | TabOrder = 1 71 | end 72 | end 73 | -------------------------------------------------------------------------------- /code/ufrm_search_enum.lfm: -------------------------------------------------------------------------------- 1 | object frm_Search_Enum: Tfrm_Search_Enum 2 | Left = 2148 3 | Height = 507 4 | Top = 583 5 | Width = 487 6 | BorderIcons = [] 7 | BorderStyle = bsNone 8 | Caption = 'frm_Search_Enum' 9 | ClientHeight = 507 10 | ClientWidth = 487 11 | Constraints.MaxHeight = 507 12 | Constraints.MaxWidth = 487 13 | Constraints.MinHeight = 507 14 | Constraints.MinWidth = 487 15 | DesignTimePPI = 128 16 | Font.Height = -16 17 | KeyPreview = True 18 | OnCreate = FormCreate 19 | OnHide = FormHide 20 | OnKeyDown = FormKeyDown 21 | LCLVersion = '2.0.6.0' 22 | object rgSeList: TRadioGroup 23 | Left = 12 24 | Height = 243 25 | Top = 43 26 | Width = 463 27 | Anchors = [akTop, akLeft, akRight] 28 | AutoFill = False 29 | Caption = 'NT' 30 | ChildSizing.LeftRightSpacing = 6 31 | ChildSizing.ShrinkHorizontal = crsScaleChilds 32 | ChildSizing.ShrinkVertical = crsScaleChilds 33 | ChildSizing.Layout = cclLeftToRightThenTopToBottom 34 | ChildSizing.ControlsPerLine = 1 35 | Font.Height = -16 36 | OnSelectionChanged = rgSeListSelectionChanged 37 | ParentFont = False 38 | TabOrder = 0 39 | end 40 | object lblSeType: TLabel 41 | Left = 12 42 | Height = 31 43 | Top = 7 44 | Width = 468 45 | Alignment = taRightJustify 46 | Anchors = [akTop, akLeft, akRight] 47 | AutoSize = False 48 | Caption = 'Enum' 49 | Font.Height = -21 50 | Font.Style = [fsBold] 51 | ParentColor = False 52 | ParentFont = False 53 | end 54 | object rgEnum: TRadioGroup 55 | Left = 11 56 | Height = 188 57 | Top = 301 58 | Width = 464 59 | Anchors = [akTop, akLeft, akRight] 60 | AutoFill = False 61 | Caption = 'NT' 62 | ChildSizing.LeftRightSpacing = 6 63 | ChildSizing.ShrinkHorizontal = crsScaleChilds 64 | ChildSizing.ShrinkVertical = crsScaleChilds 65 | ChildSizing.Layout = cclLeftToRightThenTopToBottom 66 | ChildSizing.ControlsPerLine = 1 67 | Font.Height = -16 68 | OnSelectionChanged = rgEnumSelectionChanged 69 | ParentFont = False 70 | TabOrder = 1 71 | end 72 | end 73 | -------------------------------------------------------------------------------- /code/ufrm_search_bool.lfm: -------------------------------------------------------------------------------- 1 | object frm_Search_Bool: Tfrm_Search_Bool 2 | Left = 2037 3 | Height = 507 4 | Top = 652 5 | Width = 487 6 | BorderIcons = [] 7 | BorderStyle = bsNone 8 | Caption = 'frm_Search_Bool' 9 | ClientHeight = 507 10 | ClientWidth = 487 11 | Constraints.MaxHeight = 507 12 | Constraints.MaxWidth = 487 13 | Constraints.MinHeight = 507 14 | Constraints.MinWidth = 487 15 | DesignTimePPI = 128 16 | Font.Height = -16 17 | KeyPreview = True 18 | OnCreate = FormCreate 19 | OnHide = FormHide 20 | OnKeyDown = FormKeyDown 21 | LCLVersion = '2.0.6.0' 22 | object rgSeList: TRadioGroup 23 | Left = 52 24 | Height = 133 25 | Top = 43 26 | Width = 368 27 | Anchors = [akTop, akLeft, akRight] 28 | AutoFill = False 29 | Caption = 'NT' 30 | ChildSizing.LeftRightSpacing = 6 31 | ChildSizing.ShrinkHorizontal = crsScaleChilds 32 | ChildSizing.ShrinkVertical = crsScaleChilds 33 | ChildSizing.Layout = cclLeftToRightThenTopToBottom 34 | ChildSizing.ControlsPerLine = 1 35 | Font.Height = -16 36 | OnSelectionChanged = rgSeListSelectionChanged 37 | ParentFont = False 38 | TabOrder = 0 39 | end 40 | object lblSeType: TLabel 41 | Left = 12 42 | Height = 31 43 | Top = 7 44 | Width = 468 45 | Alignment = taRightJustify 46 | Anchors = [akTop, akLeft, akRight] 47 | AutoSize = False 48 | Caption = 'Boolean' 49 | Font.Height = -21 50 | Font.Style = [fsBold] 51 | ParentColor = False 52 | ParentFont = False 53 | end 54 | object rgBool: TRadioGroup 55 | Left = 51 56 | Height = 107 57 | Top = 208 58 | Width = 367 59 | Anchors = [akTop, akLeft, akRight] 60 | AutoFill = False 61 | Caption = 'NT' 62 | ChildSizing.LeftRightSpacing = 6 63 | ChildSizing.ShrinkHorizontal = crsScaleChilds 64 | ChildSizing.ShrinkVertical = crsScaleChilds 65 | ChildSizing.Layout = cclLeftToRightThenTopToBottom 66 | ChildSizing.ControlsPerLine = 1 67 | ClientHeight = 83 68 | ClientWidth = 365 69 | Font.Height = -16 70 | Items.Strings = ( 71 | 'True' 72 | 'False' 73 | ) 74 | OnSelectionChanged = rgBoolSelectionChanged 75 | ParentFont = False 76 | TabOrder = 1 77 | end 78 | end 79 | -------------------------------------------------------------------------------- /code/ufrm_search_text.lfm: -------------------------------------------------------------------------------- 1 | object frm_Search_Text: Tfrm_Search_Text 2 | Left = 2130 3 | Height = 507 4 | Top = 518 5 | Width = 487 6 | BorderIcons = [] 7 | BorderStyle = bsNone 8 | Caption = 'frm_Search_Text' 9 | ClientHeight = 507 10 | ClientWidth = 487 11 | Constraints.MaxHeight = 507 12 | Constraints.MaxWidth = 487 13 | Constraints.MinHeight = 507 14 | Constraints.MinWidth = 487 15 | DesignTimePPI = 128 16 | Font.Height = -16 17 | KeyPreview = True 18 | OnCreate = FormCreate 19 | OnHide = FormHide 20 | OnKeyDown = FormKeyDown 21 | LCLVersion = '2.0.6.0' 22 | object rgSeList: TRadioGroup 23 | Left = 11 24 | Height = 237 25 | Top = 43 26 | Width = 465 27 | Anchors = [akTop, akLeft, akRight] 28 | AutoFill = False 29 | Caption = 'NT' 30 | ChildSizing.LeftRightSpacing = 6 31 | ChildSizing.ShrinkHorizontal = crsScaleChilds 32 | ChildSizing.ShrinkVertical = crsScaleChilds 33 | ChildSizing.Layout = cclLeftToRightThenTopToBottom 34 | ChildSizing.ControlsPerLine = 1 35 | Font.Height = -16 36 | OnSelectionChanged = rgSeListSelectionChanged 37 | ParentFont = False 38 | TabOrder = 0 39 | end 40 | object lblSeType: TLabel 41 | Left = 12 42 | Height = 31 43 | Top = 7 44 | Width = 468 45 | Alignment = taRightJustify 46 | Anchors = [akTop, akLeft, akRight] 47 | AutoSize = False 48 | Caption = 'Text' 49 | Font.Height = -21 50 | Font.Style = [fsBold] 51 | ParentColor = False 52 | ParentFont = False 53 | end 54 | object cbMatchCase: TCheckBox 55 | Left = 350 56 | Height = 25 57 | Top = 420 58 | Width = 112 59 | Anchors = [akTop, akRight] 60 | Caption = 'Match Case' 61 | Font.Height = -16 62 | OnChange = cbMatchCaseChange 63 | ParentFont = False 64 | TabOrder = 2 65 | end 66 | object lblFreeText: TLabel 67 | Left = 17 68 | Height = 21 69 | Top = 397 70 | Width = 94 71 | Caption = 'DNT S_text...' 72 | Font.Height = -16 73 | ParentColor = False 74 | ParentFont = False 75 | end 76 | object memSearchValue: TMemo 77 | Left = 12 78 | Height = 109 79 | Top = 284 80 | Width = 463 81 | Font.Height = -16 82 | OnChange = memSearchValueChange 83 | ParentFont = False 84 | ScrollBars = ssAutoBoth 85 | TabOrder = 1 86 | end 87 | end 88 | -------------------------------------------------------------------------------- /code/ufrm_search_integer.lfm: -------------------------------------------------------------------------------- 1 | object frm_Search_Integer: Tfrm_Search_Integer 2 | Left = 2094 3 | Height = 507 4 | Top = 652 5 | Width = 420 6 | BorderIcons = [] 7 | BorderStyle = bsNone 8 | Caption = 'frm_Search_Integer' 9 | ClientHeight = 507 10 | ClientWidth = 420 11 | Constraints.MaxHeight = 507 12 | Constraints.MaxWidth = 420 13 | Constraints.MinHeight = 507 14 | Constraints.MinWidth = 420 15 | DesignTimePPI = 128 16 | Font.Height = -16 17 | KeyPreview = True 18 | OnCreate = FormCreate 19 | OnHide = FormHide 20 | OnKeyDown = FormKeyDown 21 | LCLVersion = '2.0.6.0' 22 | object rgSeList: TRadioGroup 23 | Left = 12 24 | Height = 278 25 | Top = 43 26 | Width = 399 27 | Anchors = [akTop, akLeft, akRight] 28 | AutoFill = False 29 | Caption = 'NT' 30 | ChildSizing.LeftRightSpacing = 6 31 | ChildSizing.ShrinkHorizontal = crsScaleChilds 32 | ChildSizing.ShrinkVertical = crsScaleChilds 33 | ChildSizing.Layout = cclLeftToRightThenTopToBottom 34 | ChildSizing.ControlsPerLine = 1 35 | Font.Height = -16 36 | OnSelectionChanged = rgSeListSelectionChanged 37 | ParentFont = False 38 | TabOrder = 0 39 | end 40 | object lblSeType: TLabel 41 | Left = 12 42 | Height = 31 43 | Top = 7 44 | Width = 401 45 | Alignment = taRightJustify 46 | Anchors = [akTop, akLeft, akRight] 47 | AutoSize = False 48 | Caption = 'Int' 49 | Font.Height = -21 50 | Font.Style = [fsBold] 51 | ParentColor = False 52 | ParentFont = False 53 | end 54 | object spnIntValue: TSpinEdit 55 | Left = 127 56 | Height = 37 57 | Top = 363 58 | Width = 248 59 | Anchors = [akTop, akRight] 60 | AutoSelect = False 61 | AutoSize = False 62 | Font.Height = -16 63 | MaxValue = 0 64 | OnChange = spnIntValueChange 65 | ParentFont = False 66 | TabOrder = 1 67 | Visible = False 68 | end 69 | object lblFreeTextInt: TLabel 70 | Left = 200 71 | Height = 21 72 | Top = 405 73 | Width = 12 74 | Caption = '...' 75 | Font.Height = -16 76 | ParentColor = False 77 | ParentFont = False 78 | end 79 | object lblValueInt: TLabel 80 | Left = 200 81 | Height = 21 82 | Top = 333 83 | Width = 21 84 | Caption = 'NT' 85 | Font.Height = -16 86 | ParentColor = False 87 | ParentFont = False 88 | end 89 | end 90 | -------------------------------------------------------------------------------- /code/ufrm_search_double.lfm: -------------------------------------------------------------------------------- 1 | object frm_Search_double: Tfrm_Search_double 2 | Left = 2014 3 | Height = 507 4 | Top = 631 5 | Width = 487 6 | BorderIcons = [] 7 | BorderStyle = bsNone 8 | Caption = 'frm_Search_double' 9 | ClientHeight = 507 10 | ClientWidth = 487 11 | Constraints.MaxHeight = 507 12 | Constraints.MaxWidth = 487 13 | Constraints.MinHeight = 507 14 | Constraints.MinWidth = 487 15 | DesignTimePPI = 128 16 | Font.Height = -16 17 | KeyPreview = True 18 | OnCreate = FormCreate 19 | OnHide = FormHide 20 | OnKeyDown = FormKeyDown 21 | LCLVersion = '2.0.6.0' 22 | object rgSeList: TRadioGroup 23 | Left = 12 24 | Height = 244 25 | Top = 43 26 | Width = 466 27 | Anchors = [akTop, akLeft, akRight] 28 | AutoFill = False 29 | Caption = 'NT' 30 | ChildSizing.LeftRightSpacing = 6 31 | ChildSizing.ShrinkHorizontal = crsScaleChilds 32 | ChildSizing.ShrinkVertical = crsScaleChilds 33 | ChildSizing.Layout = cclLeftToRightThenTopToBottom 34 | ChildSizing.ControlsPerLine = 1 35 | Font.Height = -16 36 | OnSelectionChanged = rgSeListSelectionChanged 37 | ParentFont = False 38 | TabOrder = 0 39 | end 40 | object lblSeType: TLabel 41 | Left = 12 42 | Height = 31 43 | Top = 7 44 | Width = 468 45 | Alignment = taRightJustify 46 | Anchors = [akTop, akLeft, akRight] 47 | AutoSize = False 48 | Caption = 'Real' 49 | Font.Height = -21 50 | Font.Style = [fsBold] 51 | ParentColor = False 52 | ParentFont = False 53 | end 54 | object lblFreeTextReal: TLabel 55 | Left = 72 56 | Height = 21 57 | Top = 360 58 | Width = 12 59 | Caption = '...' 60 | Font.Height = -16 61 | ParentColor = False 62 | ParentFont = False 63 | end 64 | object lblValueInt: TLabel 65 | Left = 72 66 | Height = 21 67 | Top = 292 68 | Width = 21 69 | Caption = 'NT' 70 | Font.Height = -16 71 | ParentColor = False 72 | ParentFont = False 73 | end 74 | object spnRealValue: TFloatSpinEdit 75 | Left = 65 76 | Height = 37 77 | Top = 320 78 | Width = 247 79 | Anchors = [akTop, akRight] 80 | AutoSelect = False 81 | AutoSize = False 82 | Font.Height = -16 83 | MaxValue = 0 84 | MinValue = 0 85 | ParentFont = False 86 | TabOrder = 1 87 | Value = 0 88 | Visible = False 89 | end 90 | end 91 | -------------------------------------------------------------------------------- /code/ufrmnolanguage.pp: -------------------------------------------------------------------------------- 1 | unit ufrmnolanguage; 2 | 3 | {$mode objfpc}{$H+} 4 | { 5 | Commandoo Program: Helper application for Linux commands / CLI 6 | Copyright (C) 2017 Julius Heinrich Ludwig Schön / Ronald Michael Spicer 7 | created by Julius Schön / R. Spicer 8 | Foto.TimePirate.org / TimePirate.org / PaganToday.TimePirate.org 9 | Julius@TimePirate.org 10 | 11 | This program is free software: you can redistribute it and/or modify 12 | it under the terms of the GNU General Public License as published by 13 | the Free Software Foundation, version 3 of the License. 14 | 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU General Public License for more details. 19 | 20 | You should have received a copy of the GNU General Public License 21 | along with this program. If not, see . 22 | 23 | } 24 | 25 | interface 26 | 27 | uses 28 | Classes, SysUtils, LazFileUtils, 29 | Forms, Controls, Graphics, Dialogs, StdCtrls, 30 | Buttons 31 | , unitglobform 32 | ; 33 | 34 | type 35 | 36 | { TfrmNoLanguage } 37 | 38 | TfrmNoLanguage = class (TForm) 39 | btnOK : TBitBtn; 40 | cbLanguage : TComboBox; 41 | lblProgDesc : TLabel; 42 | Label2 : TLabel; 43 | procedure btnOKClick(Sender : TObject); 44 | procedure FormCloseQuery(Sender : TObject; var CanClose : boolean); 45 | procedure FormCreate(Sender : TObject); 46 | private 47 | { private declarations } 48 | fCanClose : boolean; 49 | public 50 | { public declarations } 51 | end; 52 | 53 | var 54 | frmNoLanguage : TfrmNoLanguage; 55 | 56 | implementation 57 | 58 | {$R *.lfm} 59 | 60 | { TfrmNoLanguage } 61 | 62 | uses strconst_prog; 63 | 64 | procedure TfrmNoLanguage.btnOKClick(Sender : TObject); 65 | begin 66 | fCanClose := true; 67 | end; 68 | 69 | procedure TfrmNoLanguage.FormCloseQuery(Sender : TObject; var CanClose : boolean); 70 | begin 71 | CanClose := fCanClose; 72 | end; 73 | 74 | procedure TfrmNoLanguage.FormCreate(Sender : TObject); 75 | begin 76 | font.size := cDefaultFontSize; 77 | FormAutoAdjustLayout( self ); 78 | ApplyChangeFont( Self ); 79 | fCanClose := false; 80 | lblProgDesc.Caption := ccapProgram; 81 | end; 82 | 83 | end. 84 | 85 | -------------------------------------------------------------------------------- /code/ufrm_search_string.lfm: -------------------------------------------------------------------------------- 1 | object frm_Search_String: Tfrm_Search_String 2 | Left = 2111 3 | Height = 507 4 | Top = 640 5 | Width = 487 6 | BorderIcons = [] 7 | BorderStyle = bsNone 8 | Caption = 'frm_Search_String' 9 | ClientHeight = 507 10 | ClientWidth = 487 11 | Constraints.MaxHeight = 507 12 | Constraints.MaxWidth = 487 13 | Constraints.MinHeight = 507 14 | Constraints.MinWidth = 487 15 | DesignTimePPI = 128 16 | Font.Height = -16 17 | KeyPreview = True 18 | OnCreate = FormCreate 19 | OnHide = FormHide 20 | OnKeyDown = FormKeyDown 21 | LCLVersion = '2.0.6.0' 22 | object rgSeList: TRadioGroup 23 | Left = 12 24 | Height = 289 25 | Top = 43 26 | Width = 466 27 | Anchors = [akTop, akLeft, akRight] 28 | AutoFill = False 29 | Caption = 'NT' 30 | ChildSizing.LeftRightSpacing = 6 31 | ChildSizing.ShrinkHorizontal = crsScaleChilds 32 | ChildSizing.ShrinkVertical = crsScaleChilds 33 | ChildSizing.Layout = cclLeftToRightThenTopToBottom 34 | ChildSizing.ControlsPerLine = 1 35 | Font.Height = -16 36 | OnSelectionChanged = rgSeListSelectionChanged 37 | ParentFont = False 38 | TabOrder = 0 39 | end 40 | object lblSeType: TLabel 41 | Left = 12 42 | Height = 31 43 | Top = 7 44 | Width = 468 45 | Alignment = taRightJustify 46 | Anchors = [akTop, akLeft, akRight] 47 | AutoSize = False 48 | Caption = 'String' 49 | Font.Height = -21 50 | Font.Style = [fsBold] 51 | ParentColor = False 52 | ParentFont = False 53 | end 54 | object cbMatchCase: TCheckBox 55 | Left = 350 56 | Height = 25 57 | Top = 438 58 | Width = 112 59 | Anchors = [akTop, akRight] 60 | Caption = 'Match Case' 61 | Font.Height = -16 62 | OnChange = cbMatchCaseChange 63 | ParentFont = False 64 | TabOrder = 2 65 | end 66 | object lblFreeText: TLabel 67 | Left = 17 68 | Height = 21 69 | Top = 420 70 | Width = 12 71 | Caption = '...' 72 | Font.Height = -16 73 | ParentColor = False 74 | ParentFont = False 75 | end 76 | object memSearchValue: TMemo 77 | Left = 12 78 | Height = 72 79 | Hint = 'The text being searched for.'#10#10'' 80 | Top = 344 81 | Width = 463 82 | Font.Height = -16 83 | OnChange = memSearchValueChange 84 | ParentFont = False 85 | ScrollBars = ssAutoBoth 86 | TabOrder = 1 87 | WantReturns = False 88 | end 89 | end 90 | -------------------------------------------------------------------------------- /code/searches/DB:_Serious_Threatlevels_2: -------------------------------------------------------------------------------- 1 | [WARNING] 2 | README1================================== 3 | README2= 4 | README3=This is an automatically generated and maintained Data file. 5 | README4= --- Edit this file by hand AT YOUR OWN RISK! --- 6 | README5= 7 | README6================================== 8 | 9 | [Search] 10 | DBInfo=DB (text) 11 | Name=DB:_Serious_Threatlevels_2 12 | UserTag=0 13 | 14 | [0Search] 15 | IsUsed=1 16 | UserTag=0 17 | SICount=7 18 | 19 | [0SI0] 20 | FieldType=UD 21 | SOT=( 22 | UserTag=0 23 | 24 | [0SI1] 25 | FieldType=Bool 26 | SOT=None 27 | UserTag=0 28 | UID=35133422 29 | CaseSensitive=0 30 | Condition== 31 | SearchValue=t 32 | OrigField=Term. Only : TerminalOnly 33 | 34 | [0SI2] 35 | FieldType=UD 36 | SOT=Or 37 | UserTag=0 38 | 39 | [0SI3] 40 | FieldType=Enum 41 | SOT=None 42 | UserTag=0 43 | UID=559326324 44 | CaseSensitive=0 45 | Condition=GTE 46 | SearchValue=3 47 | OrigField=ThreatLevel : ThreatLevel 48 | 49 | [0SI4] 50 | FieldType=UD 51 | SOT=) 52 | UserTag=0 53 | 54 | [0SI5] 55 | FieldType=UD 56 | SOT=And 57 | UserTag=0 58 | 59 | [0SI6] 60 | FieldType=Bool 61 | SOT=None 62 | UserTag=0 63 | UID=829800545 64 | CaseSensitive=0 65 | Condition== 66 | SearchValue=t 67 | OrigField=As SuperUser : SuperUserMode 68 | 69 | [1Search] 70 | IsUsed=1 71 | UserTag=0 72 | SICount=9 73 | 74 | [1SI0] 75 | FieldType=UD 76 | SOT=( 77 | UserTag=0 78 | 79 | [1SI1] 80 | FieldType=Bool 81 | SOT=None 82 | UserTag=0 83 | UID=35133422 84 | CaseSensitive=0 85 | Condition== 86 | SearchValue=t 87 | OrigField=Term. Only : TerminalOnly 88 | 89 | [1SI2] 90 | FieldType=UD 91 | SOT=Or 92 | UserTag=0 93 | 94 | [1SI3] 95 | FieldType=Enum 96 | SOT=None 97 | UserTag=0 98 | UID=559326324 99 | CaseSensitive=0 100 | Condition== 101 | SearchValue=0 102 | OrigField=ThreatLevel : ThreatLevel 103 | 104 | [1SI4] 105 | FieldType=UD 106 | SOT=Or 107 | UserTag=0 108 | 109 | [1SI5] 110 | FieldType=Bool 111 | SOT=None 112 | UserTag=0 113 | UID=247906182 114 | CaseSensitive=0 115 | Condition== 116 | SearchValue=t 117 | OrigField=Alert on use : TerminalAlert 118 | 119 | [1SI6] 120 | FieldType=UD 121 | SOT=) 122 | UserTag=0 123 | 124 | [1SI7] 125 | FieldType=UD 126 | SOT=And 127 | UserTag=0 128 | 129 | [1SI8] 130 | FieldType=Bool 131 | SOT=None 132 | UserTag=0 133 | UID=829800545 134 | CaseSensitive=0 135 | Condition== 136 | SearchValue=t 137 | OrigField=As SuperUser : SuperUserMode 138 | -------------------------------------------------------------------------------- /code/ufrmprofilesmerge.lfm: -------------------------------------------------------------------------------- 1 | object frmProfilesMerge: TfrmProfilesMerge 2 | Left = 2327 3 | Height = 453 4 | Top = 493 5 | Width = 480 6 | ActiveControl = lbMergeList 7 | Caption = 'Select Profile to Merge TO' 8 | ClientHeight = 453 9 | ClientWidth = 480 10 | Constraints.MinHeight = 453 11 | Constraints.MinWidth = 480 12 | DesignTimePPI = 128 13 | Font.Height = -16 14 | KeyPreview = True 15 | OnActivate = FormActivate 16 | OnClose = FormClose 17 | OnCloseQuery = FormCloseQuery 18 | OnCreate = FormCreate 19 | OnShow = FormShow 20 | Position = poOwnerFormCenter 21 | LCLVersion = '2.0.6.0' 22 | object bntOK: TBitBtn 23 | Left = 349 24 | Height = 40 25 | Top = 53 26 | Width = 107 27 | Anchors = [akTop, akRight] 28 | Caption = '&OK' 29 | Default = True 30 | Font.Height = -16 31 | GlyphShowMode = gsmNever 32 | OnClick = bntOKClick 33 | ParentFont = False 34 | TabOrder = 1 35 | end 36 | object btnCancel: TBitBtn 37 | Left = 357 38 | Height = 40 39 | Top = 113 40 | Width = 89 41 | Anchors = [akTop, akRight] 42 | Cancel = True 43 | Caption = 'Cancel' 44 | Font.Height = -16 45 | GlyphShowMode = gsmNever 46 | OnClick = btnCancelClick 47 | ParentFont = False 48 | TabOrder = 2 49 | end 50 | object lbMergeList: TListBox 51 | Left = 17 52 | Height = 331 53 | Hint = 'List of Program managed and custom '#10'Database Profiles. '#10#10'The first two ("DB") are managed by the '#10'Program and are always displayed, you'#10'can not delete or edit them. They are'#10'Profiles for the pre-collected database in'#10'text and sql format.'#10#10'You may add custom profiles at any time'#10'and those will be listed here.'#10#10'Profiles can have the same name as long'#10'as they use a different DB type.'#10#10'' 54 | Top = 21 55 | Width = 312 56 | Anchors = [akTop, akLeft, akRight, akBottom] 57 | ExtendedSelect = False 58 | Font.Height = -16 59 | ItemHeight = 0 60 | OnDblClick = lbMergeListDblClick 61 | ParentFont = False 62 | ScrollWidth = 310 63 | TabOrder = 0 64 | TopIndex = -1 65 | end 66 | object lblspInfo: TLabel 67 | Left = 17 68 | Height = 79 69 | Top = 365 70 | Width = 428 71 | Anchors = [akLeft, akRight, akBottom] 72 | AutoSize = False 73 | Caption = 'Current DB and selected "From" DB are excluded from this list.' 74 | Font.Height = -16 75 | ParentColor = False 76 | ParentFont = False 77 | WordWrap = True 78 | end 79 | end 80 | -------------------------------------------------------------------------------- /code/ufrmfindtext.lfm: -------------------------------------------------------------------------------- 1 | object frmFindText: TfrmFindText 2 | Left = 2022 3 | Height = 350 4 | Top = 640 5 | Width = 467 6 | ActiveControl = edtFindText 7 | BorderStyle = bsNone 8 | Caption = 'Find Text' 9 | ClientHeight = 350 10 | ClientWidth = 467 11 | Constraints.MaxHeight = 350 12 | Constraints.MaxWidth = 467 13 | Constraints.MinHeight = 350 14 | Constraints.MinWidth = 467 15 | DesignTimePPI = 128 16 | Font.Height = -16 17 | FormStyle = fsStayOnTop 18 | KeyPreview = True 19 | OnCreate = FormCreate 20 | OnDeactivate = FormDeactivate 21 | OnKeyDown = FormKeyDown 22 | OnShow = FormShow 23 | LCLVersion = '2.0.6.0' 24 | object edtFindText: TEdit 25 | Left = 1 26 | Height = 48 27 | Top = 0 28 | Width = 465 29 | Anchors = [akTop, akLeft, akRight] 30 | AutoSize = False 31 | AutoSelect = False 32 | Color = 3810335 33 | Font.Color = clCream 34 | Font.Height = -18 35 | OnKeyDown = edtFindTextKeyDown 36 | ParentFont = False 37 | TabOrder = 0 38 | TextHint = 'Sanity?' 39 | end 40 | object lbOldFinds: TListBox 41 | Left = 1 42 | Height = 212 43 | Top = 45 44 | Width = 465 45 | Anchors = [akTop, akLeft, akRight] 46 | Color = 3810335 47 | Font.Color = clCream 48 | Font.Height = -18 49 | ItemHeight = 0 50 | OnDblClick = lbOldFindsDblClick 51 | OnKeyDown = lbOldFindsKeyDown 52 | ParentFont = False 53 | ScrollWidth = 463 54 | TabOrder = 1 55 | TopIndex = -1 56 | end 57 | object lblFindNextText: TLabel 58 | Left = 5 59 | Height = 24 60 | Top = 320 61 | Width = 65 62 | Caption = 'fntDNT' 63 | Font.Height = -18 64 | Font.Style = [fsBold] 65 | ParentColor = False 66 | ParentFont = False 67 | end 68 | object rgTopCursor: TRadioGroup 69 | Left = 0 70 | Height = 59 71 | Top = 257 72 | Width = 462 73 | Anchors = [akTop, akLeft, akRight] 74 | AutoFill = False 75 | ChildSizing.LeftRightSpacing = 6 76 | ChildSizing.ShrinkHorizontal = crsScaleChilds 77 | ChildSizing.ShrinkVertical = crsScaleChilds 78 | ChildSizing.Layout = cclTopToBottomThenLeftToRight 79 | ChildSizing.ControlsPerLine = 2 80 | ClientHeight = 57 81 | ClientWidth = 460 82 | ColumnLayout = clVerticalThenHorizontal 83 | Font.Height = -16 84 | ItemIndex = 0 85 | Items.Strings = ( 86 | '&DNT' 87 | 'cDNT' 88 | ) 89 | OnSelectionChanged = rgTopCursorSelectionChanged 90 | ParentFont = False 91 | TabOrder = 2 92 | end 93 | end 94 | -------------------------------------------------------------------------------- /code/commandoo.lpr: -------------------------------------------------------------------------------- 1 | program commandoo; 2 | 3 | {$mode objfpc}{$H+} 4 | //{ $DEFINE debug} // do this here or you can define a -dDEBUG in Project Options/Other/Custom Options, i.e. in a build mode so you can set up a Debug with leakview and a Default build mode without it 5 | 6 | uses 7 | {$IFDEF UNIX}{$IFDEF UseCThreads} 8 | cthreads, 9 | {$ENDIF}{$ENDIF} 10 | Interfaces, // this includes the LCL widgetset 11 | Forms, ufrmMain, ufrmMsgdlg, unitsharedobj, juusgen, memdslaz, sdflaz, strconst_prog, strconst_en, JiniFiles, 12 | ufrmAbout, ufrmnolanguage, unitLanguages, ufrmaddlanguage, HintFrame, unitcommands, uSingleInput, 13 | lazcontrols, ufrmProfiles, unitGlobForm, ufrmListManagerConsolidate, ufrmcmdlineedit, linuxtrix, 14 | unitfrmcommandsinput, unitfrmCommandsVar, unitfields, ufrmfindtext, unitDBUtils, ufrmListManager, ufrmManageProfile, 15 | unitDBStructure, unitSearch, ufrmSearch, ufrmBoolExpr, ufrm_search_operator, ufrm_search_double, ufrmSuperUserFile, 16 | ufrm_search_list, ufrm_search_text, ufrm_search_string, ufrm_search_bool, ufrm_search_enum, ufrm_search_integer, 17 | {$IFDEF heapdebug} 18 | SysUtils, 19 | {$ENDIF} 20 | ufrmFind, unitDBConstants, ufrmprofilesmerge, unitglob, ufrmOptions, ufrmSimpleSearch; 21 | 22 | {$R *.res} 23 | 24 | begin 25 | {$IFDEF heapdebug} 26 | // Assuming your build mode sets -dDEBUG in Project Options/Other when defining -gh 27 | // This avoids interference when running a production/default build without -gh 28 | 29 | // Set up -gh output for the Leakview package: 30 | if FileExists('/home/juus/Downloads/heap.trc') then 31 | DeleteFile('/home/juus/Downloads/heap.trc'); 32 | SetHeapTraceOutput('/home/juus/Downloads/heap.trc'); 33 | {$ENDIF} 34 | 35 | if Application.HasOption( 'h', 'help' ) 36 | or Application.HasOption( 'v', 'version' ) 37 | or Application.HasOption( 'V', '' ) then 38 | begin 39 | writeln( LineEnding 40 | + 'commandoo: GUI commmand line tester/manager application' 41 | + LineEnding 42 | + 'Version: ' + cHandwrittenVersion + cVersionDate 43 | + LineEnding 44 | + 'commandoo takes no parameters, help included in application.' 45 | + LineEnding + LineEnding 46 | + ' -h, --help : this message' 47 | + LineEnding 48 | + ' -v, -V, --version : this message' 49 | + LineEnding + LineEnding 50 | ); 51 | exit; 52 | end; 53 | 54 | RequireDerivedFormResource := True; 55 | Application.Scaled := True; 56 | Application.Initialize; 57 | Application.CreateForm( TfrmMain, frmMain ); 58 | Application.Run; 59 | end. 60 | 61 | -------------------------------------------------------------------------------- /code/usingleinput.lfm: -------------------------------------------------------------------------------- 1 | object frmSingleInput: TfrmSingleInput 2 | Left = 1973 3 | Height = 187 4 | Top = 607 5 | Width = 913 6 | Caption = 'Input' 7 | ClientHeight = 187 8 | ClientWidth = 913 9 | Constraints.MaxHeight = 187 10 | Constraints.MinHeight = 187 11 | Constraints.MinWidth = 913 12 | DesignTimePPI = 128 13 | Font.Height = -16 14 | KeyPreview = True 15 | OnActivate = FormActivate 16 | OnClose = FormClose 17 | OnCloseQuery = FormCloseQuery 18 | OnCreate = FormCreate 19 | OnShow = FormShow 20 | Position = poMainFormCenter 21 | LCLVersion = '2.0.6.0' 22 | object deDir: TDirectoryEdit 23 | Left = 32 24 | Height = 37 25 | Top = 44 26 | Width = 849 27 | ShowHidden = False 28 | ButtonWidth = 31 29 | NumGlyphs = 1 30 | Anchors = [akTop, akLeft, akRight] 31 | AutoSize = False 32 | AutoSelect = False 33 | Font.Height = -16 34 | MaxLength = 0 35 | ParentFont = False 36 | TabOrder = 0 37 | Visible = False 38 | OnKeyDown = edtInputKeyDown 39 | end 40 | object feFile: TFileNameEdit 41 | Left = 32 42 | Height = 37 43 | Top = 7 44 | Width = 849 45 | FilterIndex = 0 46 | HideDirectories = False 47 | ButtonWidth = 31 48 | NumGlyphs = 1 49 | Anchors = [akTop, akLeft, akRight] 50 | AutoSelect = False 51 | AutoSize = False 52 | Font.Height = -16 53 | MaxLength = 0 54 | ParentFont = False 55 | TabOrder = 1 56 | Visible = False 57 | OnKeyDown = edtInputKeyDown 58 | end 59 | object edtInput: TEdit 60 | Left = 32 61 | Height = 37 62 | Top = 83 63 | Width = 849 64 | Anchors = [akTop, akLeft, akRight] 65 | AutoSize = False 66 | AutoSelect = False 67 | Font.Height = -16 68 | OnKeyDown = edtInputKeyDown 69 | ParentFont = False 70 | TabOrder = 2 71 | Visible = False 72 | end 73 | object btnOk: TBitBtn 74 | Left = 773 75 | Height = 53 76 | Top = 125 77 | Width = 108 78 | Anchors = [akTop, akRight] 79 | Caption = '&OK' 80 | Font.Height = -16 81 | GlyphShowMode = gsmNever 82 | OnClick = btnOkClick 83 | ParentFont = False 84 | TabOrder = 4 85 | end 86 | object btnCancel: TBitBtn 87 | Left = 609 88 | Height = 44 89 | Top = 129 90 | Width = 151 91 | Anchors = [akTop, akRight] 92 | Cancel = True 93 | Caption = 'Cancel' 94 | Font.Height = -16 95 | GlyphShowMode = gsmNever 96 | OnClick = btnCancelClick 97 | ParentFont = False 98 | TabOrder = 3 99 | end 100 | object lblHint: TLabel 101 | Left = 610 102 | Height = 21 103 | Top = 85 104 | Width = 259 105 | Alignment = taRightJustify 106 | Anchors = [akTop, akRight] 107 | Caption = '↑↑ Type and / or Browse ↑' 108 | Font.Height = -16 109 | ParentColor = False 110 | ParentFont = False 111 | Visible = False 112 | end 113 | end 114 | -------------------------------------------------------------------------------- /code/unitfrmcommandsinput.lfm: -------------------------------------------------------------------------------- 1 | object frmCommandsInput: TfrmCommandsInput 2 | Left = 1964 3 | Height = 260 4 | Top = 618 5 | Width = 600 6 | ActiveControl = memInput 7 | Caption = 'Input for Process' 8 | ClientHeight = 260 9 | ClientWidth = 600 10 | Constraints.MinHeight = 260 11 | Constraints.MinWidth = 600 12 | DesignTimePPI = 128 13 | Font.Height = -16 14 | KeyPreview = True 15 | OnActivate = FormActivate 16 | OnClose = FormClose 17 | OnCreate = FormCreate 18 | OnShow = FormShow 19 | Position = poOwnerFormCenter 20 | LCLVersion = '2.0.6.0' 21 | inline FrameHint1: TFrameHint 22 | Left = 263 23 | Height = 28 24 | Top = -1 25 | Width = 333 26 | ClientHeight = 28 27 | ClientWidth = 333 28 | ParentColor = True 29 | TabOrder = 4 30 | DesignLeft = 300 31 | DesignTop = 539 32 | inherited cbHints: TCheckBox 33 | Left = 96 34 | Height = 24 35 | Top = 3 36 | Width = 223 37 | end 38 | end 39 | object btnCancel: TBitBtn 40 | Left = 463 41 | Height = 60 42 | Top = 153 43 | Width = 127 44 | Anchors = [akTop, akRight] 45 | Cancel = True 46 | Caption = 'Cancel' 47 | Font.Height = -16 48 | GlyphShowMode = gsmNever 49 | Kind = bkCancel 50 | OnClick = btnCancelClick 51 | ParentFont = False 52 | TabOrder = 3 53 | end 54 | object memInput: TMemo 55 | Left = 13 56 | Height = 161 57 | Hint = 'This is the INPUT window which means'#10'the Command Line you are running has'#10'the "Wants Input" checked.'#10#10'Whatever text you paste here will be fed into'#10'the process immediately before it is allowed '#10'to run.'#10#10'Very useful in some cases for some Commands,'#10'if the command accepts AND reacts to stdin '#10'(standard input).'#10#10'Try it with grep command for example.'#10#10'' 58 | Top = 61 59 | Width = 438 60 | Anchors = [akTop, akLeft, akRight, akBottom] 61 | Font.Height = -16 62 | ParentFont = False 63 | ScrollBars = ssAutoBoth 64 | TabOrder = 0 65 | WantTabs = True 66 | WordWrap = False 67 | end 68 | object lblProcessInputMsg: TLabel 69 | Left = 14 70 | Height = 21 71 | Top = 32 72 | Width = 303 73 | Caption = 'Process wants input, type or paste here:' 74 | Font.Height = -16 75 | ParentColor = False 76 | ParentFont = False 77 | end 78 | object cbWordwrap: TCheckBox 79 | Left = 15 80 | Height = 25 81 | Hint = 'Checked and the output above uses '#10'wordwrap. Not, and not.'#10#10'' 82 | Top = 227 83 | Width = 120 84 | Anchors = [akLeft, akBottom] 85 | Caption = '&Z Wordwrap' 86 | Font.Height = -16 87 | OnChange = cbWordwrapChange 88 | ParentFont = False 89 | TabOrder = 1 90 | end 91 | object btnDone: TBitBtn 92 | Left = 463 93 | Height = 47 94 | Top = 70 95 | Width = 127 96 | Anchors = [akTop, akRight] 97 | Caption = 'NT' 98 | Font.Height = -16 99 | OnClick = btnDoneClick 100 | ParentFont = False 101 | TabOrder = 2 102 | end 103 | end 104 | -------------------------------------------------------------------------------- /code/ufrmlistmanagerconsolidate.lfm: -------------------------------------------------------------------------------- 1 | object frmListManagerConsolidate: TfrmListManagerConsolidate 2 | Left = 2000 3 | Height = 220 4 | Top = 654 5 | Width = 620 6 | ActiveControl = cbChoose 7 | Caption = 'Consolidate %s' 8 | ClientHeight = 220 9 | ClientWidth = 620 10 | Constraints.MaxHeight = 220 11 | Constraints.MinHeight = 220 12 | Constraints.MinWidth = 620 13 | DesignTimePPI = 128 14 | Font.Height = -16 15 | KeyPreview = True 16 | OnActivate = FormActivate 17 | OnClose = FormClose 18 | OnCloseQuery = FormCloseQuery 19 | OnCreate = FormCreate 20 | OnShow = FormShow 21 | Position = poOwnerFormCenter 22 | LCLVersion = '2.0.6.0' 23 | inline FrameHint1: TFrameHint 24 | Left = 310 25 | Height = 31 26 | Top = -2 27 | Width = 306 28 | ClientHeight = 31 29 | ClientWidth = 306 30 | ParentColor = True 31 | TabOrder = 3 32 | DesignLeft = 300 33 | DesignTop = 539 34 | inherited cbHints: TCheckBox 35 | Left = 64 36 | Height = 24 37 | Top = 5 38 | Width = 223 39 | end 40 | end 41 | object bntOK: TBitBtn 42 | Left = 483 43 | Height = 51 44 | Top = 115 45 | Width = 126 46 | Anchors = [akTop, akRight] 47 | Default = True 48 | DefaultCaption = True 49 | Font.Height = -16 50 | Kind = bkOK 51 | OnClick = bntOKClick 52 | ParentFont = False 53 | TabOrder = 1 54 | end 55 | object btnCancel: TBitBtn 56 | Left = 486 57 | Height = 31 58 | Top = 178 59 | Width = 106 60 | Anchors = [akTop, akRight] 61 | Cancel = True 62 | DefaultCaption = True 63 | Font.Height = -16 64 | GlyphShowMode = gsmNever 65 | Kind = bkCancel 66 | OnClick = btnCancelClick 67 | ParentFont = False 68 | TabOrder = 2 69 | end 70 | object lblInfo: TLabel 71 | Left = 33 72 | Height = 21 73 | Top = 23 74 | Width = 49 75 | Caption = 'lblInfo' 76 | Font.Height = -16 77 | ParentColor = False 78 | ParentFont = False 79 | end 80 | object lblItem: TLabel 81 | Left = 53 82 | Height = 21 83 | Hint = 'This is the List Item you want to consolidate'#10'(combine into) another List Item.'#10#10'You choose the List Item to consolidate too'#10'below from the combobox.'#10#10'When you press OK the old Item disappears'#10'and all instances of it are changed to the newly'#10'chosen Item.'#10#10'' 84 | Top = 60 85 | Width = 53 86 | Caption = 'lblItem' 87 | Font.Height = -16 88 | ParentColor = False 89 | ParentFont = False 90 | end 91 | object Label3: TLabel 92 | Left = 33 93 | Height = 21 94 | Top = 131 95 | Width = 155 96 | Caption = 'with (choose below):' 97 | Font.Height = -16 98 | ParentColor = False 99 | ParentFont = False 100 | end 101 | object cbChoose: TComboBox 102 | Left = 53 103 | Height = 37 104 | Hint = 'This is the List Item you want to consolidate'#10'TO.'#10#10'The List Item shown above will beconsolidated'#10'to this List Item.'#10#10'When you press OK the old Item disappears'#10'and all instances of it are changed to the newly'#10'chosen Item.'#10#10'' 105 | Top = 173 106 | Width = 376 107 | Anchors = [akTop, akLeft, akRight] 108 | AutoSelect = False 109 | AutoSize = False 110 | Font.Height = -16 111 | ItemHeight = 0 112 | ParentFont = False 113 | Style = csDropDownList 114 | TabOrder = 0 115 | end 116 | end 117 | -------------------------------------------------------------------------------- /code/searches/DB:_Commands_for_copy.move.rename.delete_files: -------------------------------------------------------------------------------- 1 | [WARNING] 2 | README1================================== 3 | README2= 4 | README3=This is an automatically generated and maintained Data file. 5 | README4= --- Edit this file by hand AT YOUR OWN RISK! --- 6 | README5= 7 | README6================================== 8 | 9 | [Search] 10 | DBInfo=DB (text) 11 | Name=DB:_Commands_for_copy.move.rename.delete_files 12 | UserTag=0 13 | 14 | [0Search] 15 | IsUsed=1 16 | UserTag=0 17 | SICount=13 18 | 19 | [0SI0] 20 | FieldType=UD 21 | SOT=( 22 | UserTag=0 23 | 24 | [0SI1] 25 | FieldType=Text 26 | SOT=None 27 | UserTag=0 28 | UID=686766142 29 | CaseSensitive=0 30 | Condition=* 31 | SearchValue=copy 32 | OrigField=Notes : Notes 33 | 34 | [0SI2] 35 | FieldType=UD 36 | SOT=Or 37 | UserTag=0 38 | 39 | [0SI3] 40 | FieldType=Text 41 | SOT=None 42 | UserTag=0 43 | UID=686766142 44 | CaseSensitive=0 45 | Condition=* 46 | SearchValue=rename 47 | OrigField=Notes : Notes 48 | 49 | [0SI4] 50 | FieldType=UD 51 | SOT=Or 52 | UserTag=0 53 | 54 | [0SI5] 55 | FieldType=Text 56 | SOT=None 57 | UserTag=0 58 | UID=686766142 59 | CaseSensitive=0 60 | Condition=* 61 | SearchValue=move 62 | OrigField=Notes : Notes 63 | 64 | [0SI6] 65 | FieldType=UD 66 | SOT=Or 67 | UserTag=0 68 | 69 | [0SI7] 70 | FieldType=Text 71 | SOT=None 72 | UserTag=0 73 | UID=686766142 74 | CaseSensitive=0 75 | Condition=* 76 | SearchValue=delete 77 | OrigField=Notes : Notes 78 | 79 | [0SI8] 80 | FieldType=UD 81 | SOT=Or 82 | UserTag=0 83 | 84 | [0SI9] 85 | FieldType=Text 86 | SOT=None 87 | UserTag=0 88 | UID=686766142 89 | CaseSensitive=0 90 | Condition=* 91 | SearchValue=remove 92 | OrigField=Notes : Notes 93 | 94 | [0SI10] 95 | FieldType=UD 96 | SOT=) 97 | UserTag=0 98 | 99 | [0SI11] 100 | FieldType=UD 101 | SOT=And 102 | UserTag=0 103 | 104 | [0SI12] 105 | FieldType=Text 106 | SOT=None 107 | UserTag=0 108 | UID=686766142 109 | CaseSensitive=0 110 | Condition=* 111 | SearchValue=file 112 | OrigField=Notes : Notes 113 | 114 | [1Search] 115 | IsUsed=1 116 | UserTag=0 117 | SICount=13 118 | 119 | [1SI0] 120 | FieldType=UD 121 | SOT=( 122 | UserTag=0 123 | 124 | [1SI1] 125 | FieldType=Text 126 | SOT=None 127 | UserTag=0 128 | UID=686766142 129 | CaseSensitive=0 130 | Condition=* 131 | SearchValue=copy 132 | OrigField=Notes : Notes 133 | 134 | [1SI2] 135 | FieldType=UD 136 | SOT=Or 137 | UserTag=0 138 | 139 | [1SI3] 140 | FieldType=Text 141 | SOT=None 142 | UserTag=0 143 | UID=686766142 144 | CaseSensitive=0 145 | Condition=* 146 | SearchValue=rename 147 | OrigField=Notes : Notes 148 | 149 | [1SI4] 150 | FieldType=UD 151 | SOT=Or 152 | UserTag=0 153 | 154 | [1SI5] 155 | FieldType=Text 156 | SOT=None 157 | UserTag=0 158 | UID=686766142 159 | CaseSensitive=0 160 | Condition=* 161 | SearchValue=move 162 | OrigField=Notes : Notes 163 | 164 | [1SI6] 165 | FieldType=UD 166 | SOT=Or 167 | UserTag=0 168 | 169 | [1SI7] 170 | FieldType=Text 171 | SOT=None 172 | UserTag=0 173 | UID=686766142 174 | CaseSensitive=0 175 | Condition=* 176 | SearchValue=delete 177 | OrigField=Notes : Notes 178 | 179 | [1SI8] 180 | FieldType=UD 181 | SOT=Or 182 | UserTag=0 183 | 184 | [1SI9] 185 | FieldType=Text 186 | SOT=None 187 | UserTag=0 188 | UID=686766142 189 | CaseSensitive=0 190 | Condition=* 191 | SearchValue=remove 192 | OrigField=Notes : Notes 193 | 194 | [1SI10] 195 | FieldType=UD 196 | SOT=) 197 | UserTag=0 198 | 199 | [1SI11] 200 | FieldType=UD 201 | SOT=And 202 | UserTag=0 203 | 204 | [1SI12] 205 | FieldType=Text 206 | SOT=None 207 | UserTag=0 208 | UID=686766142 209 | CaseSensitive=0 210 | Condition=* 211 | SearchValue=file 212 | OrigField=Notes : Notes 213 | -------------------------------------------------------------------------------- /code/ufrmaddlanguage.lfm: -------------------------------------------------------------------------------- 1 | object frmAddLanguage: TfrmAddLanguage 2 | Left = 2062 3 | Height = 240 4 | Top = 481 5 | Width = 670 6 | Caption = 'Add Language File ( .po file)' 7 | ClientHeight = 240 8 | ClientWidth = 670 9 | Constraints.MaxHeight = 240 10 | Constraints.MinHeight = 240 11 | Constraints.MinWidth = 670 12 | DesignTimePPI = 128 13 | Font.Height = -16 14 | OnActivate = FormActivate 15 | OnClose = FormClose 16 | OnCloseQuery = FormCloseQuery 17 | OnCreate = FormCreate 18 | OnShow = FormShow 19 | Position = poOwnerFormCenter 20 | LCLVersion = '2.0.6.0' 21 | object Label1: TLabel 22 | Left = 35 23 | Height = 21 24 | Top = 27 25 | Width = 92 26 | Caption = '&A File Name' 27 | FocusControl = edtFileName 28 | ParentColor = False 29 | end 30 | object btnCancel: TBitBtn 31 | Left = 487 32 | Height = 37 33 | Top = 104 34 | Width = 86 35 | Anchors = [akTop, akRight] 36 | Cancel = True 37 | DefaultCaption = True 38 | GlyphShowMode = gsmNever 39 | Kind = bkCancel 40 | OnClick = btnCancelClick 41 | TabOrder = 2 42 | end 43 | object btnOk: TBitBtn 44 | Left = 595 45 | Height = 37 46 | Top = 104 47 | Width = 59 48 | Anchors = [akTop, akRight] 49 | Caption = '&OK' 50 | Default = True 51 | OnClick = btnOkClick 52 | TabOrder = 3 53 | end 54 | object edtFileName: TFileNameEdit 55 | Left = 35 56 | Height = 37 57 | Hint = 'Select the .po language file you want'#10'to install. It can be anywhere on the system'#10'and it will be copied to the language'#10'folder'#10#10'' 58 | Top = 54 59 | Width = 624 60 | Filter = 'po_file|*.po' 61 | FilterIndex = 0 62 | HideDirectories = False 63 | ButtonWidth = 31 64 | NumGlyphs = 1 65 | FocusOnButtonClick = True 66 | Anchors = [akTop, akLeft, akRight] 67 | AutoSelect = False 68 | AutoSize = False 69 | MaxLength = 0 70 | TabOrder = 0 71 | OnButtonClick = edtFileNameButtonClick 72 | OnExit = edtFileNameExit 73 | end 74 | object Panel1: TPanel 75 | Left = 19 76 | Height = 119 77 | Top = 108 78 | Width = 431 79 | ClientHeight = 119 80 | ClientWidth = 431 81 | ParentColor = False 82 | TabOrder = 1 83 | object edtLang: TEdit 84 | Left = 29 85 | Height = 37 86 | Hint = 'This will be used for the Languages '#10'dropdown entry. Type whatever you'#10'would like to show up there.'#10#10'' 87 | Top = 74 88 | Width = 373 89 | AutoSize = False 90 | TabOrder = 0 91 | TextHint = 'New-Neu-Neuvo-Neuf-Nuovo-Nou' 92 | end 93 | object lblLangAbbrev: TLabel 94 | Left = 29 95 | Height = 21 96 | Hint = 'This label will show the associated '#10'language symbol.'#10#10'' 97 | Top = 8 98 | Width = 12 99 | Caption = '...' 100 | ParentColor = False 101 | end 102 | object lblLangAbbrev1: TLabel 103 | Left = 29 104 | Height = 21 105 | Top = 48 106 | Width = 250 107 | Caption = '&B Language dropdown box entry' 108 | FocusControl = edtLang 109 | ParentColor = False 110 | end 111 | end 112 | inline FrameHint1: TFrameHint 113 | Left = 341 114 | Height = 26 115 | Top = 4 116 | Width = 318 117 | ClientHeight = 26 118 | ClientWidth = 318 119 | ParentColor = True 120 | ParentFont = True 121 | TabOrder = 4 122 | DesignLeft = 300 123 | DesignTop = 539 124 | inherited cbHints: TCheckBox 125 | Left = 88 126 | Top = 1 127 | Font.Height = -14 128 | ParentFont = False 129 | end 130 | end 131 | end 132 | -------------------------------------------------------------------------------- /code/ufrmmsgdlg.lfm: -------------------------------------------------------------------------------- 1 | object frmMsgDlg: TfrmMsgDlg 2 | Left = 2116 3 | Height = 400 4 | Top = 441 5 | Width = 875 6 | ActiveControl = memMsg 7 | Caption = 'frmMsgDlg' 8 | ClientHeight = 400 9 | ClientWidth = 875 10 | Constraints.MinHeight = 400 11 | Constraints.MinWidth = 875 12 | DesignTimePPI = 128 13 | Font.Height = -16 14 | KeyPreview = True 15 | OnClose = FormClose 16 | OnCloseQuery = FormCloseQuery 17 | OnCreate = FormCreate 18 | OnKeyDown = FormKeyDown 19 | OnShow = FormShow 20 | Position = poOwnerFormCenter 21 | LCLVersion = '2.0.6.0' 22 | object lblType: TLabel 23 | Left = 35 24 | Height = 28 25 | Top = 12 26 | Width = 70 27 | Caption = 'not set' 28 | Font.Height = -21 29 | Font.Style = [fsBold, fsItalic] 30 | ParentColor = False 31 | ParentFont = False 32 | end 33 | object memMsg: TMemo 34 | Left = 33 35 | Height = 270 36 | Top = 55 37 | Width = 827 38 | Anchors = [akTop, akLeft, akRight, akBottom] 39 | Font.Height = -18 40 | ParentFont = False 41 | ScrollBars = ssAutoVertical 42 | TabOrder = 0 43 | end 44 | object btnOk: TBitBtn 45 | Left = 726 46 | Height = 61 47 | Top = 331 48 | Width = 134 49 | Anchors = [akRight, akBottom] 50 | Cancel = True 51 | Default = True 52 | DefaultCaption = True 53 | Font.Height = -16 54 | Kind = bkOK 55 | ModalResult = 1 56 | ParentFont = False 57 | TabOrder = 5 58 | end 59 | object btnNo: TBitBtn 60 | Left = 575 61 | Height = 61 62 | Top = 331 63 | Width = 134 64 | Anchors = [akRight, akBottom] 65 | Caption = '&X No' 66 | Enabled = False 67 | Font.Height = -16 68 | Kind = bkNo 69 | OnClick = btnNoClick 70 | ParentFont = False 71 | TabOrder = 6 72 | Visible = False 73 | end 74 | object btnYes: TBitBtn 75 | Left = 736 76 | Height = 43 77 | Top = 341 78 | Width = 117 79 | Anchors = [akRight, akBottom] 80 | Caption = '&A Yes' 81 | Enabled = False 82 | Font.Height = -16 83 | Kind = bkYes 84 | OnClick = btnYesClick 85 | ParentFont = False 86 | TabOrder = 7 87 | Visible = False 88 | end 89 | object btnClip: TBitBtn 90 | Left = 478 91 | Height = 40 92 | Top = 4 93 | Width = 206 94 | Anchors = [akTop, akRight] 95 | Caption = '&K Copy to Clipboard' 96 | Font.Height = -16 97 | OnClick = btnClipClick 98 | ParentFont = False 99 | TabOrder = 2 100 | end 101 | object pnlNoShow: TPanel 102 | Left = 35 103 | Height = 57 104 | Top = 333 105 | Width = 448 106 | Anchors = [akLeft, akBottom] 107 | ClientHeight = 57 108 | ClientWidth = 448 109 | Color = 13259833 110 | Font.Color = clCream 111 | Font.Height = -16 112 | ParentColor = False 113 | ParentFont = False 114 | TabOrder = 4 115 | Visible = False 116 | object pnlGTK: TPanel 117 | Left = 11 118 | Height = 40 119 | Top = 8 120 | Width = 428 121 | ClientHeight = 40 122 | ClientWidth = 428 123 | Color = clForm 124 | Font.Height = -16 125 | ParentColor = False 126 | ParentFont = False 127 | TabOrder = 0 128 | object cbDoNotShow: TCheckBox 129 | Left = 11 130 | Height = 25 131 | Top = 8 132 | Width = 299 133 | Anchors = [akLeft, akBottom] 134 | Caption = '&Z Do not show this message again ' 135 | Color = clDefault 136 | Font.Height = -16 137 | ParentColor = False 138 | ParentFont = False 139 | TabOrder = 0 140 | end 141 | end 142 | end 143 | object btnSaveToFile: TBitBtn 144 | Left = 702 145 | Height = 40 146 | Top = 4 147 | Width = 158 148 | Anchors = [akTop, akRight] 149 | Caption = '&S Save to file' 150 | OnClick = btnSaveToFileClick 151 | TabOrder = 3 152 | end 153 | object btnFind: TBitBtn 154 | Left = 348 155 | Height = 40 156 | Top = 4 157 | Width = 112 158 | Anchors = [akTop, akRight] 159 | Caption = '&F Find' 160 | Enabled = False 161 | Font.Height = -16 162 | OnClick = btnFindClick 163 | ParentFont = False 164 | TabOrder = 1 165 | end 166 | object Timer1: TTimer 167 | Enabled = False 168 | Interval = 700 169 | OnTimer = Timer1Timer 170 | left = 256 171 | top = 19 172 | end 173 | end 174 | -------------------------------------------------------------------------------- /code/ufrm_search_operator.pp: -------------------------------------------------------------------------------- 1 | unit ufrm_search_operator; 2 | 3 | { 4 | Commandoo Program: Helper application for Linux commands / CLI 5 | Copyright (C) 2017 Julius Heinrich Ludwig Schön / Ronald Michael Spicer 6 | created by Julius Schön / R. Spicer 7 | Foto.TimePirate.org / TimePirate.org / PaganToday.TimePirate.org 8 | Julius@TimePirate.org 9 | 10 | This program is free software: you can redistribute it and/or modify 11 | it under the terms of the GNU General Public License as published by 12 | the Free Software Foundation, version 3 of the License. 13 | 14 | This program is distributed in the hope that it will be useful, 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | GNU General Public License for more details. 18 | 19 | You should have received a copy of the GNU General Public License 20 | along with this program. If not, see . 21 | 22 | } 23 | 24 | {$mode objfpc}{$H+} 25 | 26 | interface 27 | 28 | uses 29 | Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls, StdCtrls 30 | , lcltype {THis is needed for key up keyboard constants} 31 | , unitSearch 32 | , ufrmBoolExpr 33 | ; 34 | 35 | type 36 | 37 | { Tfrm_Search_Operator } 38 | 39 | Tfrm_Search_Operator = class( TForm) 40 | lblSeOpType : TLabel; 41 | rgSeOpOperator : TRadioGroup; 42 | procedure FormCreate( Sender : TObject ); 43 | procedure FormKeyDown( Sender : TObject; var Key : Word; Shift : TShiftState ); 44 | procedure rgSeOpOperatorSelectionChanged( Sender : TObject ); 45 | private 46 | { private declarations } 47 | fSeOpSI : TSearchItem; 48 | fBE : TfrmBoolExpr; 49 | fIsLoading : boolean; 50 | 51 | procedure RegisterBoolExpr( BE : TfrmBoolExpr ); 52 | procedure SetSeOpSI( AValue : TSearchItem ); 53 | public 54 | { public declarations } 55 | procedure Link_SI_BoolExpr( anSI : TSearchItem; BE : TfrmBoolExpr ); 56 | property SeOpSI : TSearchItem read fSeOpSI write SetSeOpSI; 57 | 58 | end; 59 | 60 | var 61 | frm_Search_Operator : Tfrm_Search_Operator; 62 | 63 | implementation 64 | 65 | uses ufrmSearch 66 | , unitDBConstants 67 | , unitGlob 68 | , unitglobform 69 | ; 70 | 71 | {$R *.lfm} 72 | 73 | { Tfrm_Search_Operator } 74 | 75 | procedure Tfrm_Search_Operator.rgSeOpOperatorSelectionChanged( Sender : TObject ); 76 | begin 77 | if not assigned( fBE ) or fIsLoading then 78 | exit; 79 | case rgSeOpOperator.ItemIndex of 80 | 0 : SeOpSI.SearchOperatorType := sotOR; 81 | 1 : SeOpSI.SearchOperatorType := sotAND; 82 | 2 : SeOpSI.SearchOperatorType := sotXOR; 83 | end; 84 | TfrmSearch( Parent ).UpdateCaption( fBE ); 85 | end; 86 | 87 | procedure Tfrm_Search_Operator.FormKeyDown( Sender : TObject; var Key : Word; Shift : TShiftState ); 88 | begin 89 | //pressing return in memo sent the key to parent form which clicked the OK button. ugh. 90 | if key = vk_return then 91 | Key := VK_UNKNOWN; 92 | end; 93 | 94 | procedure Tfrm_Search_Operator.FormCreate( Sender : TObject ); 95 | begin 96 | font.size := cDefaultFontSize; 97 | FormAutoAdjustLayout( self ); 98 | ApplyChangeFont( Self ); 99 | end; 100 | 101 | procedure Tfrm_Search_Operator.RegisterBoolExpr( BE : TfrmBoolExpr ); 102 | begin 103 | fBE := BE; 104 | end; 105 | 106 | procedure Tfrm_Search_Operator.SetSeOpSI( AValue : TSearchItem ); 107 | var 108 | LabelType : TSearchOperatorType; 109 | begin 110 | LabelType := AValue.SearchOperatorType; 111 | case LabelType of 112 | sotAND, sotOR, sotXOR : ; 113 | else raise EErrorDevelopment.Create( 'Tfrm_Search_Operator.SetSeOpSI: Invalid Operator Type.' ); 114 | end; 115 | //no, don't do if fSeOpSI = AValue then Exit; 116 | 117 | fIsLoading := true; 118 | fSeOpSI := AValue; 119 | case LabelType of 120 | sotOR : rgSeOpOperator.ItemIndex := 0; 121 | sotAND : rgSeOpOperator.ItemIndex := 1; 122 | sotXOR : rgSeOpOperator.ItemIndex := 2; 123 | end; 124 | 125 | fIsLoading := false; 126 | 127 | if not self.Showing then 128 | Show; 129 | 130 | end; 131 | 132 | procedure Tfrm_Search_Operator.Link_SI_BoolExpr( anSI : TSearchItem; BE : TfrmBoolExpr ); 133 | begin 134 | RegisterBoolExpr( BE ); 135 | SeOpSI := anSI;//BoolExpr must be nil because setting this fires the click event 136 | end; 137 | 138 | end. 139 | 140 | -------------------------------------------------------------------------------- /code/unitglobform.pp: -------------------------------------------------------------------------------- 1 | unit unitGlobForm; 2 | 3 | {$mode objfpc}{$H+} 4 | { 5 | Commandoo Program: Helper application for Linux commands / CLI 6 | Copyright (C) 2017 Julius Heinrich Ludwig Schön / Ronald Michael Spicer 7 | created by Julius Schön / R. Spicer 8 | Foto.TimePirate.org / TimePirate.org / PaganToday.TimePirate.org 9 | Julius@TimePirate.org 10 | 11 | This program is free software: you can redistribute it and/or modify 12 | it under the terms of the GNU General Public License as published by 13 | the Free Software Foundation, version 3 of the License. 14 | 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU General Public License for more details. 19 | 20 | You should have received a copy of the GNU General Public License 21 | along with this program. If not, see . 22 | 23 | } 24 | 25 | interface 26 | 27 | uses 28 | Classes, SysUtils, Dialogs, StdCtrls, Forms, Controls, graphics, ActnList, Menus, Buttons; 29 | 30 | type 31 | 32 | //{ TListBoxHelper2 } //Helper class example if I ever need or want it 33 | // 34 | //TListBoxHelper = class helper for TListbox 35 | // procedure DoClick; 36 | //end; 37 | 38 | TSettingsDirective = (sdSave, sdLoad ); 39 | 40 | function StandardOutputHeader( const Cmd : string ) : string; 41 | procedure FormAutoAdjustLayout( AForm : TForm ); 42 | procedure ApplyChangeFont( AForm : TForm; AlwaysChange : boolean = false ); 43 | procedure SetCapMenuButton( M : TMenuItem; B : TBitBtn; const Cap, Extra : string ); 44 | procedure TryFocus( aControl : TWinControl ); 45 | 46 | 47 | resourcestring 48 | cmsgcleExecuting = 'running: '; 49 | cmsggfCommandNotFound = 'Command "%s" not found, it must be in an edited state and can not be found until it is saved.'; 50 | 51 | var 52 | globFontsLarge : boolean = false; 53 | 54 | const 55 | cDefaultFontSize = 9; 56 | 57 | implementation 58 | 59 | uses unitGlob; 60 | 61 | procedure TryFocus( aControl : TWinControl ); 62 | begin 63 | if aControl.Canfocus then 64 | aControl.Setfocus; 65 | end; 66 | 67 | procedure SetCapMenuButton( M : TMenuItem; B : TBitBtn; const Cap, Extra : string ); 68 | const 69 | HotK = '%s '; 70 | begin 71 | M.Caption := Cap; 72 | if Extra <> '' then 73 | B.Caption := format( HotK, [ Extra ] ) + M.Caption 74 | else B.Caption := M.Caption; 75 | end; 76 | 77 | procedure FormAutoAdjustLayout( AForm : TForm ); 78 | begin 79 | {$IFNDEF Release} 80 | if not assigned( aForm ) then 81 | raise EErrorDevelopment.Create( 'FormAutoAdjustLayout: incoming object is nil' ); 82 | {$ENDIF} 83 | aForm.AutoAdjustLayout( lapAutoAdjustForDPI, aForm.DesignTimePPI, Screen.PixelsPerInch, aForm.Width, ScaleX( aForm.Width, aForm.DesignTimePPI ) ); 84 | end; 85 | 86 | procedure ApplyChangeFont( AForm : TForm; AlwaysChange : boolean = false ); 87 | var 88 | i , NewSize : Integer; 89 | 90 | procedure SetAControl( aControl : TControl ); 91 | var 92 | j : integer; 93 | begin 94 | 95 | aControl.Font.Size := aControl.Font.Size + NewSize; 96 | 97 | if aControl is TWinControl then 98 | with TWinControl( aControl ) do 99 | begin 100 | for j := 0 to ControlCount - 1 do 101 | SetAControl( Controls[ j ] ); 102 | end; 103 | 104 | end; 105 | 106 | begin 107 | 108 | {$IFNDEF Release} 109 | if not assigned( aForm ) then 110 | raise EErrorDevelopment.Create( 'ApplyChangeFont: incoming object is nil' ); 111 | {$ENDIF} 112 | 113 | //form creates don't need to change if false, but Options setting and result always need it 114 | if not globFontsLarge and not AlwaysChange then 115 | exit; 116 | 117 | if aForm.Font.Size = cDefaultFontSize then 118 | NewSize := 1 119 | else NewSize := -1; 120 | 121 | aForm.Font.Size := aForm.Font.Size + NewSize; 122 | 123 | for i := 0 to aForm.Controlcount - 1 do 124 | SetAControl( aForm.Controls[ i ] ); 125 | 126 | end; 127 | 128 | function StandardOutputHeader( const Cmd : string ) : string; 129 | begin 130 | result := 131 | trim( cmsgcleExecuting + Cmd ) 132 | + LineEnding 133 | + '______________________'; 134 | end; 135 | 136 | 137 | //{ TListBoxHelper2 } 138 | // 139 | //procedure TListBoxHelper.DoClick; 140 | //begin 141 | // Self.Click; 142 | //end; 143 | 144 | end. 145 | 146 | -------------------------------------------------------------------------------- /code/ufrmsuperuserfile.lfm: -------------------------------------------------------------------------------- 1 | object frmSuperUserFile: TfrmSuperUserFile 2 | Left = 2279 3 | Height = 400 4 | Top = 461 5 | Width = 585 6 | Caption = 'SuperUser Authentication' 7 | ClientHeight = 400 8 | ClientWidth = 585 9 | Constraints.MaxHeight = 400 10 | Constraints.MinHeight = 400 11 | Constraints.MinWidth = 585 12 | DesignTimePPI = 128 13 | Font.Height = -16 14 | KeyPreview = True 15 | OnActivate = FormActivate 16 | OnClose = FormClose 17 | OnCloseQuery = FormCloseQuery 18 | OnCreate = FormCreate 19 | OnShow = FormShow 20 | Position = poOwnerFormCenter 21 | LCLVersion = '2.0.6.0' 22 | inline FrameHint1: TFrameHint 23 | Left = 254 24 | Height = 33 25 | Top = -2 26 | Width = 325 27 | ClientHeight = 33 28 | ClientWidth = 325 29 | ParentColor = True 30 | TabOrder = 7 31 | DesignLeft = 300 32 | DesignTop = 539 33 | inherited cbHints: TCheckBox 34 | Left = 89 35 | Height = 24 36 | Width = 223 37 | end 38 | end 39 | object bntOK: TBitBtn 40 | Left = 447 41 | Height = 51 42 | Top = 128 43 | Width = 100 44 | Anchors = [akTop, akRight] 45 | Caption = '&OK' 46 | Font.Height = -16 47 | GlyphShowMode = gsmNever 48 | OnClick = bntOKClick 49 | ParentFont = False 50 | TabOrder = 5 51 | end 52 | object btnCancel: TBitBtn 53 | Left = 436 54 | Height = 47 55 | Top = 185 56 | Width = 120 57 | Anchors = [akTop, akRight] 58 | Cancel = True 59 | Caption = 'Cancel' 60 | Font.Height = -16 61 | GlyphShowMode = gsmNever 62 | OnClick = btnCancelClick 63 | ParentFont = False 64 | TabOrder = 6 65 | end 66 | object edtCustom: TEdit 67 | Left = 48 68 | Height = 36 69 | Hint = 'Type the template as you need.'#10#10'It requires at least one, and only one, "%s" '#10'in it. '#10#10'Wherever the %s is is where the Command'#10'Line will be placed.'#10#10'' 70 | Top = 345 71 | Width = 302 72 | Anchors = [akTop, akLeft, akRight] 73 | AutoSize = False 74 | AutoSelect = False 75 | Font.Height = -16 76 | OnKeyDown = edtCustomKeyDown 77 | ParentFont = False 78 | TabOrder = 2 79 | TextHint = 'Type custom template here...' 80 | end 81 | object lblCurr: TLabel 82 | Left = 21 83 | Height = 24 84 | Top = 43 85 | Width = 161 86 | Caption = 'Current Template: ' 87 | Font.Height = -18 88 | ParentColor = False 89 | ParentFont = False 90 | end 91 | object lblCurrFile: TLabel 92 | Left = 192 93 | Height = 24 94 | Hint = 'This is the template you want to use.'#10#10'Test it with the button above.'#10#10'' 95 | Top = 43 96 | Width = 15 97 | Caption = '...' 98 | Font.Height = -18 99 | ParentColor = False 100 | ParentFont = False 101 | end 102 | object btnTest: TBitBtn 103 | Left = 21 104 | Height = 29 105 | Hint = 'Show how the template will look when '#10'pasted into a terminal.'#10#10'' 106 | Top = 13 107 | Width = 141 108 | Caption = '&T Test' 109 | Font.Height = -16 110 | OnClick = btnTestClick 111 | ParentFont = False 112 | TabOrder = 4 113 | end 114 | object btnCustom: TBitBtn 115 | Left = 16 116 | Height = 35 117 | Hint = 'Use the custom template you specify in'#10'the edit below...'#10#10'' 118 | Top = 310 119 | Width = 281 120 | Anchors = [akTop, akLeft, akRight] 121 | Caption = '&B Use Custom Template' 122 | Font.Height = -16 123 | OnClick = btnCustomClick 124 | ParentFont = False 125 | TabOrder = 3 126 | end 127 | object btnTemplate: TBitBtn 128 | Left = 16 129 | Height = 33 130 | Hint = 'Apply the template from the checked radio'#10'button below.'#10#10'' 131 | Top = 99 132 | Width = 281 133 | Anchors = [akTop, akLeft, akRight] 134 | Caption = '&A Use Common Template' 135 | Font.Height = -16 136 | OnClick = btnTemplateClick 137 | ParentFont = False 138 | TabOrder = 1 139 | end 140 | object rgTemplates: TRadioGroup 141 | Left = 48 142 | Height = 140 143 | Hint = 'List of the most common ROOT templates,'#10'select the one you want.'#10#10'' 144 | Top = 137 145 | Width = 302 146 | Anchors = [akTop, akLeft, akRight] 147 | AutoFill = True 148 | Caption = ' Common Templates ' 149 | ChildSizing.LeftRightSpacing = 6 150 | ChildSizing.EnlargeHorizontal = crsHomogenousChildResize 151 | ChildSizing.EnlargeVertical = crsHomogenousChildResize 152 | ChildSizing.ShrinkHorizontal = crsScaleChilds 153 | ChildSizing.ShrinkVertical = crsScaleChilds 154 | ChildSizing.Layout = cclLeftToRightThenTopToBottom 155 | ChildSizing.ControlsPerLine = 1 156 | OnClick = rgTemplatesClick 157 | TabOrder = 0 158 | end 159 | end 160 | -------------------------------------------------------------------------------- /code/ufrmfind.pp: -------------------------------------------------------------------------------- 1 | unit ufrmFind; 2 | 3 | {$mode objfpc}{$H+} 4 | { 5 | Commandoo Program: Helper application for Linux commands / CLI 6 | Copyright (C) 2017 Julius Heinrich Ludwig Schön / Ronald Michael Spicer 7 | created by Julius Schön / R. Spicer 8 | Foto.TimePirate.org / TimePirate.org / PaganToday.TimePirate.org 9 | Julius@TimePirate.org 10 | 11 | This program is free software: you can redistribute it and/or modify 12 | it under the terms of the GNU General Public License as published by 13 | the Free Software Foundation, version 3 of the License. 14 | 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU General Public License for more details. 19 | 20 | You should have received a copy of the GNU General Public License 21 | along with this program. If not, see . 22 | 23 | } 24 | 25 | interface 26 | 27 | uses 28 | Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls, StrUtils, LCLType; 29 | 30 | type 31 | 32 | { TfrmFind } 33 | 34 | TfrmFind = class( TForm) 35 | edtFind : TEdit; 36 | lbFindResult : TListBox; 37 | procedure edtFindChange( Sender : TObject ); 38 | procedure edtFindKeyDown( Sender : TObject; var Key : Word; Shift : TShiftState ); 39 | procedure FormCreate( Sender : TObject ); 40 | procedure FormDeactivate( Sender : TObject ); 41 | procedure FormKeyDown( Sender : TObject; var Key : Word; Shift : TShiftState ); 42 | procedure lbFindResultDblClick( Sender : TObject ); 43 | procedure lbFindResultKeyDown( Sender : TObject; var Key : Word; Shift : TShiftState ); 44 | private 45 | fItemToFind : string; 46 | fLB : TListbox; 47 | function GotItemToFind : boolean; 48 | procedure SetItemToFind( const AValue : string ); 49 | procedure SetLB( AValue : TListbox ); 50 | { private declarations } 51 | public 52 | { public declarations } 53 | property LB : TListbox read fLB write SetLB; 54 | property ItemToFind : string read fItemToFind write SetItemToFind; 55 | end; 56 | 57 | var 58 | frmFind : TfrmFind; 59 | 60 | implementation 61 | 62 | uses unitglob 63 | , unitglobform 64 | ; 65 | {$R *.lfm} 66 | 67 | { TfrmFind } 68 | 69 | procedure TfrmFind.edtFindChange( Sender : TObject ); 70 | var 71 | i : Integer; 72 | begin 73 | lbFindResult.Items.Clear; 74 | lbFindResult.Items.BeginUpdate; 75 | for i := 0 to LB.Items.Count - 1 do 76 | begin 77 | if AnsiContainsText( LB.Items[ i ], edtFind.Text ) then 78 | lbFindResult.Items.Add( LB.Items[ i ] ); 79 | end; 80 | lbFindResult.Items.EndUpdate; 81 | end; 82 | 83 | procedure TfrmFind.edtFindKeyDown( Sender : TObject; var Key : Word; Shift : TShiftState ); 84 | begin 85 | if Key = vk_return then 86 | if lbFindResult.Count = 1 then 87 | begin 88 | ItemToFind := lbFindResult.Items[ 0 ]; 89 | Close; 90 | end; 91 | if ( Key = vk_down ) and ( lbFindResult.Items.Count > 0 ) then 92 | begin 93 | lbFindResult.ItemIndex := 0; 94 | lbFindResult.SetFocus; 95 | end; 96 | end; 97 | 98 | procedure TfrmFind.FormCreate( Sender : TObject ); 99 | begin 100 | font.size := cDefaultFontSize; 101 | FormAutoAdjustLayout( self ); 102 | ApplyChangeFont( Self ); 103 | fItemToFind := ''; 104 | edtFind.TextHint := ccapFindLBHint; 105 | end; 106 | 107 | procedure TfrmFind.FormDeactivate( Sender : TObject ); 108 | begin 109 | Close; 110 | end; 111 | 112 | procedure TfrmFind.FormKeyDown( Sender : TObject; var Key : Word; Shift : TShiftState ); 113 | begin 114 | if Key = vk_escape then 115 | Close; 116 | end; 117 | 118 | function TfrmFind.GotItemToFind : boolean; 119 | begin 120 | result := false; 121 | if ( lbFindResult.Items.Count = 0 ) or ( lbFindResult.ItemIndex < 0 ) then 122 | exit; 123 | ItemToFind := lbFindResult.Items[ lbFindResult.ItemIndex ]; 124 | result := true; 125 | 126 | end; 127 | 128 | procedure TfrmFind.lbFindResultDblClick( Sender : TObject ); 129 | begin 130 | if GotItemToFind then 131 | Close; 132 | end; 133 | 134 | procedure TfrmFind.lbFindResultKeyDown( Sender : TObject; var Key : Word; Shift : TShiftState ); 135 | begin 136 | if key = vk_return then 137 | if GotItemToFind then 138 | Close; 139 | if ( Key = vk_up ) and ( lbFindResult.ItemIndex <= 0 ) then 140 | begin 141 | edtFind.Setfocus; 142 | end; 143 | end; 144 | 145 | procedure TfrmFind.SetLB( AValue : TListbox ); 146 | begin 147 | if fLB = AValue then Exit; 148 | fLB := AValue; 149 | end; 150 | 151 | procedure TfrmFind.SetItemToFind( const AValue : string ); 152 | begin 153 | if fItemToFind = AValue then Exit; 154 | fItemToFind := AValue; 155 | end; 156 | 157 | end. 158 | 159 | -------------------------------------------------------------------------------- /code/ufrm_search_list.lfm: -------------------------------------------------------------------------------- 1 | object frm_Search_List: Tfrm_Search_List 2 | Left = 2101 3 | Height = 507 4 | Top = 604 5 | Width = 487 6 | BorderIcons = [] 7 | BorderStyle = bsNone 8 | Caption = 'frm_Search_List' 9 | ClientHeight = 507 10 | ClientWidth = 487 11 | Constraints.MaxHeight = 507 12 | Constraints.MaxWidth = 487 13 | Constraints.MinHeight = 507 14 | Constraints.MinWidth = 487 15 | DesignTimePPI = 128 16 | Font.Height = -16 17 | KeyPreview = True 18 | OnCreate = FormCreate 19 | OnHide = FormHide 20 | OnKeyDown = FormKeyDown 21 | LCLVersion = '2.0.6.0' 22 | object lblFreeText: TLabel 23 | Left = 17 24 | Height = 21 25 | Top = 327 26 | Width = 12 27 | Caption = '...' 28 | Font.Height = -16 29 | ParentColor = False 30 | ParentFont = False 31 | end 32 | object rgSeList: TRadioGroup 33 | Left = 12 34 | Height = 216 35 | Hint = 'Select the "match" type you want for the '#10'List Search.'#10#10'It is "match", not "equal", because it will try'#10'to find out whether the exact List Item is in'#10'(or not in) the Command''s assigned List '#10'Items.'#10#10'The selections you make here determine'#10'the enabling of the fields below. "match" '#10'means it must be in the List, so you are'#10'limited to only items which currently exist '#10'in the Master List.'#10#10'Otherwise you can specify search text.'#10#10'Be aware that if select "match" and you '#10'previously typed in something under '#10'another condition it will be replaced with'#10'the first item in the current Master List.'#10#10'Also be aware, this search can later '#10'become invalid if you delete that item'#10'from the Master List. You will be told when'#10'this has happened.'#10#10'' 36 | Top = 43 37 | Width = 466 38 | Anchors = [akTop, akLeft, akRight] 39 | AutoFill = False 40 | Caption = 'NT' 41 | ChildSizing.LeftRightSpacing = 6 42 | ChildSizing.ShrinkHorizontal = crsScaleChilds 43 | ChildSizing.ShrinkVertical = crsScaleChilds 44 | ChildSizing.Layout = cclLeftToRightThenTopToBottom 45 | ChildSizing.ControlsPerLine = 1 46 | Font.Height = -17 47 | OnSelectionChanged = rgSeListSelectionChanged 48 | ParentFont = False 49 | TabOrder = 0 50 | end 51 | object lblSeType: TLabel 52 | Left = 12 53 | Height = 31 54 | Top = 7 55 | Width = 468 56 | Alignment = taRightJustify 57 | Anchors = [akTop, akLeft, akRight] 58 | AutoSize = False 59 | Caption = 'List' 60 | Font.Height = -21 61 | Font.Style = [fsBold] 62 | ParentColor = False 63 | ParentFont = False 64 | end 65 | object lblListChoice: TLabel 66 | Left = 154 67 | Height = 21 68 | Top = 369 69 | Width = 84 70 | Anchors = [akTop, akRight] 71 | Caption = 'Select One:' 72 | Font.Height = -16 73 | ParentColor = False 74 | ParentFont = False 75 | Visible = False 76 | end 77 | object cbMatchCase: TCheckBox 78 | Left = 350 79 | Height = 25 80 | Top = 342 81 | Width = 112 82 | Anchors = [akTop, akRight] 83 | Caption = 'Match Case' 84 | Font.Height = -16 85 | OnChange = cbMatchCaseChange 86 | ParentFont = False 87 | TabOrder = 2 88 | end 89 | object lbList: TListBox 90 | Left = 240 91 | Height = 136 92 | Hint = 'The current Master List of the field you are '#10'editing.'#10#10'If you edit the Master List this will be reflected'#10'the next time you create or edit a Search.'#10#10'Items in old saved Searches may become'#10'invalid if you remove or change the entry in '#10'the Master List.'#10#10'' 93 | Top = 369 94 | Width = 235 95 | Font.Height = -16 96 | Items.Strings = ( 97 | 'sanitycheck' 98 | ) 99 | ItemHeight = 27 100 | OnClick = lbListClick 101 | ParentColor = True 102 | ParentFont = False 103 | PopupMenu = popList 104 | ScrollWidth = 233 105 | TabOrder = 3 106 | end 107 | object memSearchValue: TMemo 108 | Left = 12 109 | Height = 65 110 | Hint = 'The text being searched for.'#10#10'This is disabled when you select "match" '#10'Match Type above. In those cases you must'#10'select from the Master List.'#10#10'' 111 | Top = 259 112 | Width = 463 113 | Font.Height = -16 114 | OnChange = memSearchValueChange 115 | ParentFont = False 116 | ScrollBars = ssAutoBoth 117 | TabOrder = 1 118 | WantReturns = False 119 | end 120 | object lblKeywords: TLabel 121 | Left = 152 122 | Height = 21 123 | Top = 444 124 | Width = 83 125 | Anchors = [akTop, akRight] 126 | Caption = 'Current %s' 127 | Font.Height = -16 128 | ParentColor = False 129 | ParentFont = False 130 | end 131 | object popList: TPopupMenu 132 | left = 75 133 | top = 17 134 | object mniCopy: TMenuItem 135 | Caption = 'Copy Item' 136 | OnClick = mniCopyClick 137 | end 138 | end 139 | end 140 | -------------------------------------------------------------------------------- /code/unitfrmcommandsvar.lfm: -------------------------------------------------------------------------------- 1 | object frmCommandsVar: TfrmCommandsVar 2 | Left = 2097 3 | Height = 420 4 | Top = 481 5 | Width = 620 6 | ActiveControl = edtInput 7 | Caption = 'Input Variables' 8 | ClientHeight = 420 9 | ClientWidth = 620 10 | Constraints.MinHeight = 420 11 | Constraints.MinWidth = 620 12 | DesignTimePPI = 128 13 | Font.Height = -16 14 | KeyPreview = True 15 | OnActivate = FormActivate 16 | OnClose = FormClose 17 | OnCreate = FormCreate 18 | OnKeyDown = FormKeyDown 19 | OnShow = FormShow 20 | Position = poOwnerFormCenter 21 | LCLVersion = '2.0.6.0' 22 | inline FrameHint1: TFrameHint 23 | Left = 263 24 | Height = 29 25 | Top = -1 26 | Width = 352 27 | ClientHeight = 29 28 | ClientWidth = 352 29 | ParentColor = True 30 | TabOrder = 8 31 | DesignLeft = 300 32 | DesignTop = 539 33 | inherited cbHints: TCheckBox 34 | Left = 111 35 | Height = 24 36 | Width = 223 37 | end 38 | end 39 | object btnCancel: TBitBtn 40 | Left = 503 41 | Height = 39 42 | Top = 252 43 | Width = 105 44 | Anchors = [akTop, akRight] 45 | Caption = '&C Cancel' 46 | Font.Height = -16 47 | GlyphShowMode = gsmNever 48 | OnClick = btnCancelClick 49 | ParentFont = False 50 | TabOrder = 7 51 | end 52 | object edtCmdLine: TEdit 53 | Left = 13 54 | Height = 26 55 | Hint = 'The Command Line that will be run with'#10'variables to be filled in.'#10#10'' 56 | Top = 39 57 | Width = 587 58 | Anchors = [akTop, akLeft, akRight] 59 | BorderStyle = bsNone 60 | Color = clForm 61 | Font.Height = -16 62 | ParentFont = False 63 | TabStop = False 64 | TabOrder = 5 65 | end 66 | object memInfo: TMemo 67 | Left = 13 68 | Height = 249 69 | Hint = 'This displays a hint for you so you know '#10'what you should be typingt: text, an integer,'#10'a decmal, or a filename.'#10#10'' 70 | Top = 164 71 | Width = 482 72 | Anchors = [akTop, akLeft, akRight, akBottom] 73 | Font.Height = -16 74 | ParentFont = False 75 | ScrollBars = ssAutoVertical 76 | TabOrder = 4 77 | end 78 | object edtInput: TEdit 79 | Left = 13 80 | Height = 39 81 | Hint = 'What is typed here replaces the highlighted'#10'variable above.'#10#10'You can use after typing to move '#10'to the next variable (if there is one). You can '#10'also use after the last variable'#10'to apply the variables and continue with'#10'the running of the command line.'#10#10'If the variable is for a filename two buttons'#10'will appear allowing you to choose either in'#10'file mode or folder mode. '#10#10'You can use these buttons or type in the '#10'file name in that case.'#10#10'' 82 | Top = 74 83 | Width = 457 84 | Anchors = [akTop, akLeft, akRight] 85 | AutoSize = False 86 | AutoSelect = False 87 | Font.Height = -16 88 | OnKeyDown = edtInputKeyDown 89 | ParentFont = False 90 | TabOrder = 0 91 | end 92 | object btnDone: TBitBtn 93 | Left = 503 94 | Height = 55 95 | Top = 182 96 | Width = 105 97 | Anchors = [akTop, akRight] 98 | Caption = 'NT' 99 | Enabled = False 100 | Font.Height = -16 101 | OnClick = btnDoneClick 102 | ParentFont = False 103 | TabOrder = 6 104 | end 105 | object btnApply: TBitBtn 106 | Left = 477 107 | Height = 36 108 | Hint = 'This applies any text you have typed to the'#10'current variable.'#10#10'It is far easier to simply press after'#10'typing everything in. '#10#10'Once all variables have been applied a final'#10' or clicking this button will'#10'proceed with the running of the '#10'command line.'#10#10'' 109 | Top = 75 110 | Width = 131 111 | Anchors = [akTop, akRight] 112 | Caption = '&A Apply' 113 | Font.Height = -16 114 | OnClick = btnApplyClick 115 | ParentFont = False 116 | TabOrder = 3 117 | end 118 | object btnFolderName: TBitBtn 119 | Left = 294 120 | Height = 33 121 | Top = 115 122 | Width = 176 123 | Anchors = [akTop, akRight] 124 | Caption = '&F Folder Name' 125 | Enabled = False 126 | Font.Height = -16 127 | OnClick = btnFolderNameClick 128 | ParentFont = False 129 | TabOrder = 2 130 | end 131 | object btnFileName: TBitBtn 132 | Left = 13 133 | Height = 33 134 | Top = 115 135 | Width = 176 136 | Caption = '&N File Name' 137 | Enabled = False 138 | Font.Height = -16 139 | OnClick = btnFileNameClick 140 | ParentFont = False 141 | TabOrder = 1 142 | end 143 | object Label1: TLabel 144 | Left = 17 145 | Height = 21 146 | Top = 13 147 | Width = 165 148 | Caption = 'Results show here: ↓' 149 | ParentColor = False 150 | end 151 | object Timer1: TTimer 152 | Interval = 500 153 | OnTimer = Timer1Timer 154 | left = 215 155 | top = 11 156 | end 157 | end 158 | -------------------------------------------------------------------------------- /code/unitfrmcommandsinput.pp: -------------------------------------------------------------------------------- 1 | unit unitfrmcommandsinput; 2 | 3 | {$mode objfpc}{$H+} 4 | { 5 | Commandoo Program: Helper application for Linux commands / CLI 6 | Copyright (C) 2017 Julius Heinrich Ludwig Schön / Ronald Michael Spicer 7 | created by Julius Schön / R. Spicer 8 | Foto.TimePirate.org / TimePirate.org / PaganToday.TimePirate.org 9 | Julius@TimePirate.org 10 | 11 | This program is free software: you can redistribute it and/or modify 12 | it under the terms of the GNU General Public License as published by 13 | the Free Software Foundation, version 3 of the License. 14 | 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU General Public License for more details. 19 | 20 | You should have received a copy of the GNU General Public License 21 | along with this program. If not, see . 22 | 23 | } 24 | 25 | interface 26 | 27 | uses 28 | Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, HintFrame 29 | , lcltype {THis is needed for key up keyboard constants} 30 | , unitsharedobj, Buttons 31 | , StdCtrls, ExtCtrls 32 | , unitGlobForm 33 | ; 34 | 35 | type 36 | 37 | { TfrmCommandsInput } 38 | 39 | TfrmCommandsInput = class(TForm) 40 | btnCancel : TBitBtn; 41 | btnDone : TBitBtn; 42 | cbWordwrap : TCheckBox; 43 | FrameHint1 : TFrameHint; 44 | lblProcessInputMsg : TLabel; 45 | memInput : TMemo; 46 | procedure btnCancelClick(Sender : TObject); 47 | procedure btnDoneClick( Sender : TObject ); 48 | procedure cbWordwrapChange( Sender : TObject ); 49 | procedure FormActivate(Sender : TObject); 50 | procedure FormClose(Sender : TObject; var CloseAction : TCloseAction); 51 | procedure FormCreate(Sender : TObject); 52 | procedure FormShow(Sender : TObject); 53 | private 54 | { private declarations } 55 | //FCanClose : boolean; 56 | FHasShown : boolean; 57 | FIsInitialized : boolean; 58 | procedure HandleFormSettings( const TheType : TSettingsDirective ); 59 | public 60 | { public declarations } 61 | end; 62 | 63 | var 64 | frmCommandsInput : TfrmCommandsInput; 65 | 66 | resourcestring 67 | ccapufciInputEmpty = 'Input empty'; 68 | cmsgufciInputEmpty = 'There is no input. Is that what you want?'; 69 | 70 | 71 | implementation 72 | 73 | 74 | {$R *.lfm} 75 | 76 | uses ufrmMsgDlg 77 | , unitGlob 78 | ; 79 | 80 | { TfrmCommandsInput } 81 | 82 | procedure TfrmCommandsInput.FormShow(Sender : TObject); 83 | begin 84 | 85 | if not FHasShown then 86 | begin 87 | HandleFormSettings( sdLoad ); 88 | FHasShown := true; 89 | FrameHint1.cbHints.Caption := ccbHintsEnglishOverride; 90 | end; 91 | 92 | end; 93 | 94 | procedure TfrmCommandsInput.HandleFormSettings( const TheType : TSettingsDirective ); 95 | var 96 | i : Integer; 97 | theValue : string; 98 | begin 99 | theValue := ''; 100 | i := -1; 101 | case TheType of 102 | sdSave : 103 | begin 104 | FormSettings.AddSetting( inttoStr( Height ) ); 105 | FormSettings.AddSetting( inttoStr( Width ) ); 106 | 107 | FormSettings.SaveFormSettings( Self.Name ); 108 | end; 109 | sdLoad : 110 | While FormSettings.ReadFormSettings( Self.Name, i, theValue ) do 111 | case i of 112 | 0 : Height := strtoint( theValue ); 113 | 1 : Width := strtoint( theValue ); 114 | end; 115 | end; 116 | 117 | end; 118 | 119 | procedure TfrmCommandsInput.FormClose(Sender : TObject; var CloseAction : TCloseAction); 120 | begin 121 | HandleFormSettings( sdSave ); 122 | end; 123 | 124 | procedure TfrmCommandsInput.btnCancelClick(Sender : TObject); 125 | begin 126 | //FCanClose := true; 127 | Modalresult := mrCancel; 128 | end; 129 | 130 | procedure TfrmCommandsInput.btnDoneClick( Sender : TObject ); 131 | begin 132 | //FCanClose := true; 133 | memInput.Text := trim( memInput.Text ); 134 | if memInput.Text = '' then 135 | if MsgDlgMessage( ccapufciInputEmpty, cmsgufciInputEmpty ) then 136 | if MsgDlg( mdpConfirmation, true, self ) = mrNo then 137 | exit; 138 | 139 | Modalresult := mrOK; 140 | end; 141 | 142 | procedure TfrmCommandsInput.cbWordwrapChange( Sender : TObject ); 143 | begin 144 | memInput.WordWrap := cbWordWrap.Checked; 145 | end; 146 | 147 | 148 | procedure TfrmCommandsInput.FormActivate(Sender : TObject); 149 | begin 150 | if not FIsInitialized then 151 | begin 152 | FIsInitialized := true; 153 | end; 154 | 155 | end; 156 | 157 | procedure TfrmCommandsInput.FormCreate(Sender : TObject); 158 | begin 159 | font.size := cDefaultFontSize; 160 | FormAutoAdjustLayout( self ); 161 | ApplyChangeFont( Self ); 162 | FHasShown := false; 163 | FIsInitialized := false; 164 | btnDone.Caption := cbtn_Done; 165 | end; 166 | 167 | end. 168 | { 169 | procedure TfrmCommandsInput.FormCloseQuery(Sender : TObject; var CanClose : boolean); 170 | begin 171 | CanClose := FCanClose; 172 | 173 | if not FCanClose then 174 | begin 175 | if MsgDlgMessage( 'Closing the Form', 'You need to say whether all is OK or whether to cancel.', 'uniquedelvalue1' ) then 176 | MsgDlg( mdpInformation, false, self ); 177 | end; 178 | end; 179 | } 180 | -------------------------------------------------------------------------------- /code/ufrmmanageprofile.lfm: -------------------------------------------------------------------------------- 1 | object frmManageProfile: TfrmManageProfile 2 | Left = 1951 3 | Height = 420 4 | Top = 597 5 | Width = 420 6 | ActiveControl = edtProfileName 7 | Caption = 'Add Profile' 8 | ClientHeight = 420 9 | ClientWidth = 420 10 | Constraints.MaxHeight = 420 11 | Constraints.MinHeight = 420 12 | Constraints.MinWidth = 420 13 | DesignTimePPI = 128 14 | Font.Height = -16 15 | KeyPreview = True 16 | OnActivate = FormActivate 17 | OnClose = FormClose 18 | OnCloseQuery = FormCloseQuery 19 | OnCreate = FormCreate 20 | OnShow = FormShow 21 | Position = poOwnerFormCenter 22 | LCLVersion = '2.0.6.0' 23 | inline FrameHint1: TFrameHint 24 | Left = 107 25 | Height = 32 26 | Top = -1 27 | Width = 309 28 | ClientHeight = 32 29 | ClientWidth = 309 30 | ParentColor = True 31 | TabOrder = 8 32 | DesignLeft = 300 33 | DesignTop = 539 34 | inherited cbHints: TCheckBox 35 | Left = 79 36 | Height = 24 37 | Top = 5 38 | Width = 223 39 | end 40 | end 41 | object rgType: TRadioGroup 42 | Left = 16 43 | Height = 88 44 | Hint = 'Choose whether the Database will be '#10'text based or sqlite sql DB based.'#10#10'Once assigned a DB type that Profile '#10'can not be changed from that type.'#10#10'However, you may use the same Profile '#10'Name as long as it''s DB type is different.'#10#10'Under those circumstances this radio box'#10'will automatically collapse to that type and'#10'check it.'#10#10'' 45 | Top = 303 46 | Width = 235 47 | Anchors = [akTop, akLeft, akRight] 48 | AutoFill = False 49 | Caption = 'DB Type' 50 | ChildSizing.LeftRightSpacing = 6 51 | ChildSizing.ShrinkHorizontal = crsScaleChilds 52 | ChildSizing.ShrinkVertical = crsScaleChilds 53 | ChildSizing.Layout = cclLeftToRightThenTopToBottom 54 | ChildSizing.ControlsPerLine = 1 55 | ClientHeight = 64 56 | ClientWidth = 233 57 | Font.Height = -16 58 | Items.Strings = ( 59 | '&S sqlite DB' 60 | '&T Text File Based' 61 | ) 62 | ParentFont = False 63 | ParentColor = False 64 | TabOrder = 7 65 | TabStop = True 66 | end 67 | object Label1: TLabel 68 | Left = 23 69 | Height = 23 70 | Top = 169 71 | Width = 374 72 | Anchors = [akTop, akLeft, akRight] 73 | AutoSize = False 74 | Caption = 'Path:' 75 | Font.Height = -16 76 | ParentColor = False 77 | ParentFont = False 78 | end 79 | object lblName: TLabel 80 | Left = 23 81 | Height = 23 82 | Top = 47 83 | Width = 374 84 | Anchors = [akTop, akLeft, akRight] 85 | AutoSize = False 86 | Caption = 'Name: ' 87 | Font.Height = -16 88 | ParentColor = False 89 | ParentFont = False 90 | end 91 | object btnCancel: TBitBtn 92 | Left = 291 93 | Height = 37 94 | Top = 368 95 | Width = 100 96 | Anchors = [akTop, akRight] 97 | Cancel = True 98 | Caption = 'Cancel' 99 | Font.Height = -16 100 | GlyphShowMode = gsmNever 101 | OnClick = btnCancelClick 102 | ParentFont = False 103 | TabOrder = 6 104 | end 105 | object bntOK: TBitBtn 106 | Left = 281 107 | Height = 46 108 | Top = 305 109 | Width = 121 110 | Anchors = [akTop, akRight] 111 | Caption = '&OK' 112 | Default = True 113 | Font.Height = -16 114 | OnClick = bntOKClick 115 | ParentFont = False 116 | TabOrder = 5 117 | end 118 | object edtProfileName: TEdit 119 | Left = 38 120 | Height = 31 121 | Top = 73 122 | Width = 359 123 | Anchors = [akTop, akLeft, akRight] 124 | AutoSize = False 125 | AutoSelect = False 126 | BorderStyle = bsNone 127 | Font.Height = -16 128 | OnDblClick = btnChangeNameClick 129 | ParentColor = True 130 | ParentFont = False 131 | ReadOnly = True 132 | TabOrder = 0 133 | end 134 | object edtProfilePath: TEdit 135 | Left = 38 136 | Height = 31 137 | Top = 199 138 | Width = 359 139 | Anchors = [akTop, akLeft, akRight] 140 | AutoSize = False 141 | AutoSelect = False 142 | BorderStyle = bsNone 143 | Font.Height = -16 144 | OnDblClick = btnChangePathClick 145 | ParentColor = True 146 | ParentFont = False 147 | ReadOnly = True 148 | TabOrder = 2 149 | end 150 | object btnChangeName: TBitBtn 151 | Left = 38 152 | Height = 33 153 | Hint = 'Yes. Change the name.'#10#10'' 154 | Top = 105 155 | Width = 359 156 | Anchors = [akTop, akLeft, akRight] 157 | Caption = '&N Change Name' 158 | Font.Height = -16 159 | OnClick = btnChangeNameClick 160 | ParentFont = False 161 | TabOrder = 1 162 | Visible = False 163 | end 164 | object btnDefaultPath: TBitBtn 165 | Left = 253 166 | Height = 33 167 | Hint = 'This resets the Path to "Default".'#10#10'Default is the program''s default data location.'#10#10'This is usually the folder where the commandoo'#10'program is run from.'#10#10'' 168 | Top = 232 169 | Width = 144 170 | Anchors = [akTop, akRight] 171 | Caption = '&R default' 172 | Font.Height = -16 173 | OnClick = btnDefaultPathClick 174 | ParentFont = False 175 | TabOrder = 4 176 | end 177 | object btnChangePath: TBitBtn 178 | Left = 37 179 | Height = 33 180 | Hint = 'Yes. Change the Path (Folder).'#10#10'' 181 | Top = 232 182 | Width = 180 183 | Anchors = [akTop, akLeft, akRight] 184 | Caption = '&P Change Path' 185 | Font.Height = -16 186 | OnClick = btnChangePathClick 187 | ParentFont = False 188 | TabOrder = 3 189 | end 190 | end 191 | -------------------------------------------------------------------------------- /code/unitglob.pp: -------------------------------------------------------------------------------- 1 | unit unitglob; 2 | 3 | {$mode objfpc}{$H+} 4 | { 5 | Commandoo Program: Helper application for Linux commands / CLI 6 | Copyright (C) 2017 Julius Heinrich Ludwig Schön / Ronald Michael Spicer 7 | created by Julius Schön / R. Spicer 8 | Foto.TimePirate.org / TimePirate.org / PaganToday.TimePirate.org 9 | Julius@TimePirate.org 10 | 11 | This program is free software: you can redistribute it and/or modify 12 | it under the terms of the GNU General Public License as published by 13 | the Free Software Foundation, version 3 of the License. 14 | 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU General Public License for more details. 19 | 20 | You should have received a copy of the GNU General Public License 21 | along with this program. If not, see . 22 | 23 | } 24 | 25 | interface 26 | 27 | uses 28 | Classes, SysUtils; 29 | 30 | const 31 | cEErrorDO_NOT_RAISE = 0; 32 | 33 | cEErrorCmdObj = 1; 34 | cEErrorCOField = 2; 35 | cEErrorListObj = 3; 36 | cEErrorDevelopment = 4; 37 | cEErrorBadHandEdit = 5; 38 | cEErrorDatabaseProblem = 6; 39 | cEErrorSystem = 7; 40 | cEErrorSettings = 8; 41 | cEErrorDisallowed = 9; 42 | 43 | cNameItem_Command = 'Command'; 44 | cNameItem_CommandLine = 'Command Line'; 45 | cNameItem_CommandPlur = 'Commands'; 46 | cNameItem_CommandLinePlur = 'Command Lines'; 47 | cCLInfo = '--%s: %s'; 48 | 49 | //button captions, yes, BUT should NOT be translated. 50 | cbtn_SearchNOT = '± NOT'; 51 | ccbHintsEnglishOverride = '&H Show hints on mouse-over'; 52 | cCommandInPathStr = '$PATH'; 53 | //cLinuxBuiltInStr = '$BUILTIN'; 54 | cmsgcleBadPath = '$BAD_PATH'; 55 | Dots = '...'; 56 | cDoubleS = '%s %s'; 57 | ccapGenericUnderlinedOK = '&OK'; 58 | ccapGenericOK = 'OK'; 59 | 60 | resourcestring 61 | cmsgNoCommandSelected = 'No item is selected.'; 62 | //ccapGenericEdit = 'Edit %s'; 63 | //ccapGenericAdd = 'Add %s'; 64 | //ccapGenericDelete = 'Delete %s'; 65 | //ccapGenericImport = 'Import %s'; 66 | cmsgGenericDelete = 'Are you sure you want to delete the selected items?'; 67 | ccapGenericChoose = 'Choose %s'; 68 | ccapGenericFile = 'File'; 69 | ccapGenericFolder = 'Folder'; 70 | ccapGenericProfile = 'Profile'; 71 | 72 | ccapGenericImport = 'Import'; 73 | ccapGenericSelect = 'Select'; 74 | ccapGenericAdd = 'Add'; 75 | ccapGenericNew = 'New'; 76 | ccapGenericEdit = 'Edit'; 77 | ccapGenericCopy = 'Copy'; 78 | ccapGenericDelete = 'Delete'; 79 | ccapGenericClose = 'Close'; 80 | ccapGenericCancel = 'Cancel'; 81 | 82 | 83 | //Re-Used button captions to keep the translating less miserable 84 | //I've decided to use numbers/letters for shortcuts as they are language independant 85 | cObjlblRun = '&R Run'; 86 | cObjlblGo = '&G Go'; 87 | cObjlblRunTest = '&R Test'; 88 | cbtn_Copy = 'Copy'; 89 | cbtn_Done = '&O Done'; 90 | crg_MatchType = 'Match Type'; 91 | crg_Value = 'Value'; 92 | ccapFindLBHint = 'Begin typing...'; 93 | ccapFindTextHint = 'Type, then press ...'; 94 | 95 | type 96 | //raise EErrorDatabaseProblem.Create( 'EXCEPTION STRESS TEST' ); 97 | EErrorSELF_RAISE = class(Exception); 98 | EErrorUnknown = class(Exception); 99 | EErrorCmdObj = class(Exception); 100 | EErrorCOField = class(Exception); 101 | EErrorListObj = class(Exception); 102 | EErrorDevelopment = class( Exception );//"should" be caught in development 103 | EErrorBadHandEdit = class( Exception );//things where hand editing cause problems and/or development 104 | EErrorDatabaseProblem = class( Exception );//file structure, sql statements 105 | EErrorSystem = class( Exception );//problems with calls to system 106 | EErrorSettings = class( Exception );//problems user settings 107 | EErrorDisallowed = class( Exception );//things that are not allowed 108 | 109 | procedure EErrorRaise( e : exception; const cEError : integer; const Msg : string ); 110 | 111 | 112 | 113 | var 114 | globFatalException : boolean = false; 115 | 116 | implementation 117 | 118 | procedure EErrorRaise( e : exception; const cEError : integer; const Msg : string ); 119 | begin 120 | if (e is EAccessViolation ) then 121 | GlobFatalException := true; 122 | case cEError of 123 | cEErrorCmdObj : 124 | raise EErrorCmdObj.Create( Msg + e.message ); 125 | cEErrorCOField : 126 | raise EErrorCOField.Create( Msg + e.message ); 127 | cEErrorListObj : 128 | raise EErrorListObj.Create( Msg + e.message ); 129 | cEErrorDevelopment : 130 | raise EErrorDevelopment.Create( Msg + e.message ); 131 | cEErrorBadHandEdit : 132 | raise EErrorBadHandEdit.Create( Msg + e.message ); 133 | cEErrorDatabaseProblem : 134 | raise EErrorDatabaseProblem.Create( Msg + e.message ); 135 | cEErrorSystem : 136 | raise EErrorSystem.Create( Msg + e.message ); 137 | cEErrorSettings : 138 | raise EErrorSettings.Create( Msg + e.message ); 139 | cEErrorDisallowed : 140 | raise EErrorDisallowed.Create( Msg + e.message ); 141 | cEErrorDO_NOT_RAISE : 142 | begin 143 | if GlobFatalException then 144 | raise EErrorSELF_RAISE.Create( Msg + e.message ); 145 | end; 146 | else 147 | raise EErrorUnknown.Create( Msg + e.message ); 148 | end; 149 | end; 150 | 151 | end. 152 | 153 | -------------------------------------------------------------------------------- /code/ufrm_search_enum.pp: -------------------------------------------------------------------------------- 1 | unit ufrm_search_enum; 2 | 3 | { 4 | Commandoo Program: Helper application for Linux commands / CLI 5 | Copyright (C) 2017 Julius Heinrich Ludwig Schön / Ronald Michael Spicer 6 | created by Julius Schön / R. Spicer 7 | Foto.TimePirate.org / TimePirate.org / PaganToday.TimePirate.org 8 | Julius@TimePirate.org 9 | 10 | This program is free software: you can redistribute it and/or modify 11 | it under the terms of the GNU General Public License as published by 12 | the Free Software Foundation, version 3 of the License. 13 | 14 | This program is distributed in the hope that it will be useful, 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | GNU General Public License for more details. 18 | 19 | You should have received a copy of the GNU General Public License 20 | along with this program. If not, see . 21 | 22 | } 23 | 24 | {$mode objfpc}{$H+} 25 | 26 | interface 27 | 28 | uses 29 | Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls, StdCtrls 30 | , lcltype {THis is needed for key up keyboard constants} 31 | , unitSearch 32 | , ufrmBoolExpr, Menus 33 | ; 34 | 35 | type 36 | 37 | { Tfrm_Search_Enum } 38 | 39 | Tfrm_Search_Enum = class( TForm) 40 | lblSeType : TLabel; 41 | rgSeList : TRadioGroup; 42 | rgEnum : TRadioGroup; 43 | procedure FormCreate( Sender : TObject ); 44 | procedure FormHide( Sender : TObject ); 45 | procedure FormKeyDown( Sender : TObject; var Key : Word; Shift : TShiftState ); 46 | procedure rgEnumSelectionChanged( Sender : TObject ); 47 | procedure rgSeListSelectionChanged( Sender : TObject ); 48 | private 49 | { private declarations } 50 | fSe_SI : TSearchItem; 51 | fBE : TfrmBoolExpr; 52 | fIsLoading : boolean; 53 | 54 | procedure RegisterBoolExpr( BE : TfrmBoolExpr ); 55 | procedure SetSe_SI( AValue : TSearchItem ); 56 | procedure UpdateSearchValue; 57 | public 58 | { public declarations } 59 | procedure Link_SI_BoolExpr( anSI : TSearchItem; BE : TfrmBoolExpr ); 60 | property Se_SI : TSearchItem read fSe_SI write SetSe_SI; 61 | 62 | end; 63 | 64 | var 65 | frm_Search_Enum : Tfrm_Search_Enum; 66 | 67 | implementation 68 | 69 | uses ufrmSearch 70 | , ufrmMsgDlg 71 | , unitDBStructure 72 | , unitDBConstants 73 | , unitGlob 74 | , unitglobform 75 | ; 76 | 77 | {$R *.lfm} 78 | 79 | { Tfrm_Search_Enum } 80 | 81 | procedure Tfrm_Search_Enum.rgSeListSelectionChanged( Sender : TObject ); 82 | begin 83 | 84 | if not assigned( fBE ) or fIsLoading or ( rgSeList.Itemindex < 0 ) then 85 | exit; 86 | 87 | Se_SI.Condition := ReturnSearchCondition( rgSeList.ItemIndex, cConditionsAllowed_Number ); 88 | 89 | TfrmSearch( Parent ).UpdateCaption( fBE ); 90 | 91 | end; 92 | 93 | procedure Tfrm_Search_Enum.FormCreate( Sender : TObject ); 94 | begin 95 | 96 | font.size := cDefaultFontSize; 97 | FormAutoAdjustLayout( self ); 98 | ApplyChangeFont( Self ); 99 | fIsLoading := false; 100 | rgSeList.Caption := crg_MatchType; 101 | rgEnum.Caption := crg_Value; 102 | 103 | GetAllowedSearchConditions( rgSeList.Items, cConditionsAllowed_Number ); 104 | 105 | end; 106 | 107 | procedure Tfrm_Search_Enum.FormHide( Sender : TObject ); 108 | begin 109 | rgSeList.ItemIndex := -1; 110 | end; 111 | 112 | procedure Tfrm_Search_Enum.FormKeyDown( Sender : TObject; var Key : Word; Shift : TShiftState ); 113 | begin 114 | //pressing return in memo sent the key to parent form which clicked the OK button. ugh. 115 | if key = vk_return then 116 | Key := VK_UNKNOWN; 117 | end; 118 | 119 | procedure Tfrm_Search_Enum.UpdateSearchValue; 120 | begin 121 | //callers of this maybe need to check fIsLoading, but not always 122 | 123 | Se_SI.SearchValue := inttostr( rgEnum.ItemIndex ); 124 | 125 | TfrmSearch( Parent ).UpdateCaption( fBE ); 126 | end; 127 | 128 | procedure Tfrm_Search_Enum.rgEnumSelectionChanged( Sender : TObject ); 129 | begin 130 | if fIsLoading then 131 | exit; 132 | 133 | UpdateSearchValue; 134 | 135 | end; 136 | 137 | 138 | procedure Tfrm_Search_Enum.RegisterBoolExpr( BE : TfrmBoolExpr ); 139 | begin 140 | fBE := BE; 141 | end; 142 | 143 | procedure Tfrm_Search_Enum.SetSe_SI( AValue : TSearchItem ); 144 | var 145 | LabelType : TSearchOperatorType; 146 | begin 147 | 148 | if AValue.SIT <> sitInteger then 149 | raise EErrorDevelopment.Create( 'Tfrm_Search_Enum.SetSe_SI: Integer Type expected.' ); 150 | 151 | LabelType := AValue.SearchOperatorType; 152 | if LabelType <> sotNone then 153 | raise EErrorDevelopment.Create( 'Tfrm_Search_Enum.SetSe_SI: Invalid Operator Type.' ); 154 | 155 | fIsLoading := true; 156 | 157 | //No, don't do ==> if fSe_SI = AValue then Exit; 158 | 159 | fSe_SI := AValue; 160 | 161 | lblSEType.caption := format( cusSearchCaption_Enum, [ fSe_SI.siDisplayCaption ] ); 162 | 163 | rgSeList.ItemIndex := ReturnSearchConditionIdx( fSe_SI.Condition, cConditionsAllowed_Number ); 164 | 165 | rgEnum.ItemIndex := StrToInt( SE_SI.SearchValue ); 166 | 167 | fIsLoading := false; 168 | 169 | if not self.Showing then 170 | Show; 171 | 172 | end; 173 | 174 | procedure Tfrm_Search_Enum.Link_SI_BoolExpr( anSI : TSearchItem; BE : TfrmBoolExpr ); 175 | begin 176 | RegisterBoolExpr( BE ); 177 | Se_SI := anSI; 178 | if anSI.InValidMsg <> '' then 179 | begin 180 | if assigned( gSearchInfo ) then 181 | begin 182 | gSearchInfo.Text := gSearchInfo.Text + anSI.InValidMsg + LineEnding + LineEnding; 183 | end 184 | else 185 | begin 186 | MsgDlgMessage( ccapusSearchDetailProblem, anSI.InValidMsg ); 187 | MsgDlgInfo( TForm( Parent ) ); 188 | end; 189 | anSI.ClearInvalidMessage; 190 | end; 191 | end; 192 | 193 | end. 194 | 195 | -------------------------------------------------------------------------------- /code/ufrm_search_bool.pp: -------------------------------------------------------------------------------- 1 | unit ufrm_search_bool; 2 | 3 | { 4 | Commandoo Program: Helper application for Linux commands / CLI 5 | Copyright (C) 2017 Julius Heinrich Ludwig Schön / Ronald Michael Spicer 6 | created by Julius Schön / R. Spicer 7 | Foto.TimePirate.org / TimePirate.org / PaganToday.TimePirate.org 8 | Julius@TimePirate.org 9 | 10 | This program is free software: you can redistribute it and/or modify 11 | it under the terms of the GNU General Public License as published by 12 | the Free Software Foundation, version 3 of the License. 13 | 14 | This program is distributed in the hope that it will be useful, 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | GNU General Public License for more details. 18 | 19 | You should have received a copy of the GNU General Public License 20 | along with this program. If not, see . 21 | 22 | } 23 | 24 | {$mode objfpc}{$H+} 25 | 26 | interface 27 | 28 | uses 29 | Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls, StdCtrls 30 | , lcltype {THis is needed for key up keyboard constants} 31 | , unitSearch 32 | , ufrmBoolExpr, Menus 33 | ; 34 | 35 | type 36 | 37 | { Tfrm_Search_Bool } 38 | 39 | Tfrm_Search_Bool = class( TForm) 40 | lblSeType : TLabel; 41 | rgSeList : TRadioGroup; 42 | rgBool : TRadioGroup; 43 | procedure FormCreate( Sender : TObject ); 44 | procedure FormHide( Sender : TObject ); 45 | procedure FormKeyDown( Sender : TObject; var Key : Word; Shift : TShiftState ); 46 | procedure rgBoolSelectionChanged( Sender : TObject ); 47 | procedure rgSeListSelectionChanged( Sender : TObject ); 48 | private 49 | { private declarations } 50 | fSe_SI : TSearchItem; 51 | fBE : TfrmBoolExpr; 52 | fIsLoading : boolean; 53 | 54 | procedure RegisterBoolExpr( BE : TfrmBoolExpr ); 55 | procedure SetSe_SI( AValue : TSearchItem ); 56 | procedure UpdateSearchValue; 57 | public 58 | { public declarations } 59 | procedure Link_SI_BoolExpr( anSI : TSearchItem; BE : TfrmBoolExpr ); 60 | property Se_SI : TSearchItem read fSe_SI write SetSe_SI; 61 | 62 | end; 63 | 64 | var 65 | frm_Search_Bool : Tfrm_Search_Bool; 66 | 67 | implementation 68 | 69 | uses ufrmSearch 70 | , ufrmMsgDlg 71 | , unitDBStructure 72 | , unitDBConstants 73 | , unitGlob 74 | , unitglobform 75 | ; 76 | 77 | {$R *.lfm} 78 | 79 | { Tfrm_Search_Bool } 80 | 81 | procedure Tfrm_Search_Bool.rgSeListSelectionChanged( Sender : TObject ); 82 | begin 83 | 84 | if not assigned( fBE ) or fIsLoading or ( rgSeList.Itemindex < 0 ) then 85 | exit; 86 | 87 | Se_SI.Condition := ReturnSearchCondition( rgSeList.ItemIndex, cConditionsAllowed_Boolean ); 88 | 89 | TfrmSearch( Parent ).UpdateCaption( fBE ); 90 | 91 | end; 92 | 93 | procedure Tfrm_Search_Bool.FormCreate( Sender : TObject ); 94 | begin 95 | 96 | font.size := cDefaultFontSize; 97 | FormAutoAdjustLayout( self ); 98 | ApplyChangeFont( Self ); 99 | fIsLoading := false; 100 | rgSeList.Caption := crg_MatchType; 101 | rgBool.Caption := crg_Value; 102 | rgBool.Items.Text := cdbsDisplay_True + LineEnding + cdbsDisplay_False; 103 | GetAllowedSearchConditions( rgSeList.Items, cConditionsAllowed_Boolean ); 104 | 105 | end; 106 | 107 | procedure Tfrm_Search_Bool.FormHide( Sender : TObject ); 108 | begin 109 | rgSeList.ItemIndex := -1; 110 | end; 111 | 112 | procedure Tfrm_Search_Bool.FormKeyDown( Sender : TObject; var Key : Word; Shift : TShiftState ); 113 | begin 114 | //pressing return in memo sent the key to parent form which clicked the OK button. ugh. 115 | if key = vk_return then 116 | Key := VK_UNKNOWN; 117 | end; 118 | 119 | procedure Tfrm_Search_Bool.UpdateSearchValue; 120 | begin 121 | //callers of this maybe need to check fIsLoading, but not always 122 | case rgBool.ItemIndex of 123 | 0 : Se_SI.SearchValue := dbsTrueStr; 124 | 1 : Se_SI.SearchValue := dbsFalseStr; 125 | end; 126 | TfrmSearch( Parent ).UpdateCaption( fBE ); 127 | end; 128 | 129 | procedure Tfrm_Search_Bool.rgBoolSelectionChanged( Sender : TObject ); 130 | begin 131 | if fIsLoading then 132 | exit; 133 | UpdateSearchValue; 134 | end; 135 | 136 | procedure Tfrm_Search_Bool.RegisterBoolExpr( BE : TfrmBoolExpr ); 137 | begin 138 | fBE := BE; 139 | end; 140 | 141 | procedure Tfrm_Search_Bool.SetSe_SI( AValue : TSearchItem ); 142 | var 143 | LabelType : TSearchOperatorType; 144 | begin 145 | 146 | if AValue.SIT <> sitBoolean then 147 | raise EErrorDevelopment.Create( 'Tfrm_Search_List.SetSe_SI: String Type expected.' ); 148 | 149 | LabelType := AValue.SearchOperatorType; 150 | if LabelType <> sotNone then 151 | raise EErrorDevelopment.Create( 'Tfrm_Search_List.SetSe_SI: Invalid Operator Type.' ); 152 | 153 | fIsLoading := true; 154 | 155 | //No, don't do ==> if fSe_SI = AValue then Exit; 156 | 157 | fSe_SI := AValue; 158 | 159 | lblSEType.caption := format( cusSearchCaption_Bool, [ fSe_SI.siDisplayCaption ] ); 160 | 161 | rgSeList.ItemIndex := ReturnSearchConditionIdx( fSe_SI.Condition, cConditionsAllowed_Boolean ); 162 | 163 | case fSE_SI.SearchValue of 164 | dbsTrueStr : rgBool.ItemIndex := 0; 165 | else rgBool.ItemIndex := 1; 166 | end; 167 | 168 | fIsLoading := false; 169 | 170 | if not self.Showing then 171 | Show; 172 | 173 | end; 174 | 175 | procedure Tfrm_Search_Bool.Link_SI_BoolExpr( anSI : TSearchItem; BE : TfrmBoolExpr ); 176 | begin 177 | RegisterBoolExpr( BE ); 178 | Se_SI := anSI; 179 | if anSI.InValidMsg <> '' then 180 | begin 181 | if assigned( gSearchInfo ) then 182 | begin 183 | gSearchInfo.Text := gSearchInfo.Text + anSI.InValidMsg + LineEnding + LineEnding; 184 | end 185 | else 186 | begin 187 | MsgDlgMessage( ccapusSearchDetailProblem, anSI.InValidMsg ); 188 | MsgDlgInfo( TForm( Parent ) ); 189 | end; 190 | anSI.ClearInvalidMessage; 191 | end; 192 | end; 193 | 194 | end. 195 | 196 | -------------------------------------------------------------------------------- /code/ufrm_search_double.pp: -------------------------------------------------------------------------------- 1 | unit ufrm_search_double; 2 | 3 | { 4 | Commandoo Program: Helper application for Linux commands / CLI 5 | Copyright (C) 2017 Julius Heinrich Ludwig Schön / Ronald Michael Spicer 6 | created by Julius Schön / R. Spicer 7 | Foto.TimePirate.org / TimePirate.org / PaganToday.TimePirate.org 8 | Julius@TimePirate.org 9 | 10 | This program is free software: you can redistribute it and/or modify 11 | it under the terms of the GNU General Public License as published by 12 | the Free Software Foundation, version 3 of the License. 13 | 14 | This program is distributed in the hope that it will be useful, 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | GNU General Public License for more details. 18 | 19 | You should have received a copy of the GNU General Public License 20 | along with this program. If not, see . 21 | 22 | } 23 | 24 | {$mode objfpc}{$H+} 25 | 26 | interface 27 | 28 | uses 29 | Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls, StdCtrls 30 | , lcltype {THis is needed for key up keyboard constants} 31 | , unitSearch 32 | , ufrmBoolExpr, Menus, Spin 33 | ; 34 | 35 | type 36 | 37 | { Tfrm_Search_double } 38 | 39 | Tfrm_Search_double = class( TForm) 40 | spnRealValue : TFloatSpinEdit; 41 | lblFreeTextReal : TLabel; 42 | lblValueInt : TLabel; 43 | lblSeType : TLabel; 44 | rgSeList : TRadioGroup; 45 | procedure FormCreate( Sender : TObject ); 46 | procedure FormHide( Sender : TObject ); 47 | procedure FormKeyDown( Sender : TObject; var Key : Word; Shift : TShiftState ); 48 | procedure rgSeListSelectionChanged( Sender : TObject ); 49 | procedure spnIntValueChange( Sender : TObject ); 50 | private 51 | { private declarations } 52 | fSe_SI : TSearchItem; 53 | fBE : TfrmBoolExpr; 54 | fIsLoading : boolean; 55 | 56 | procedure EnableControls( Idx : integer ); 57 | procedure RegisterBoolExpr( BE : TfrmBoolExpr ); 58 | procedure SetSe_SI( AValue : TSearchItem ); 59 | procedure UpdateSearchValue; 60 | public 61 | { public declarations } 62 | procedure Link_SI_BoolExpr( anSI : TSearchItem; BE : TfrmBoolExpr ); 63 | property Se_SI : TSearchItem read fSe_SI write SetSe_SI; 64 | 65 | end; 66 | 67 | var 68 | frm_Search_double : Tfrm_Search_double; 69 | 70 | implementation 71 | 72 | uses ufrmSearch 73 | , ufrmMsgDlg 74 | , unitDBStructure 75 | , unitDBConstants 76 | , unitGlob 77 | , unitglobform 78 | ; 79 | 80 | {$R *.lfm} 81 | 82 | { Tfrm_Search_double } 83 | 84 | procedure Tfrm_Search_double.rgSeListSelectionChanged( Sender : TObject ); 85 | begin 86 | 87 | EnableControls( rgSeList.ItemIndex ); 88 | 89 | if not assigned( fBE ) or fIsLoading or ( rgSeList.Itemindex < 0 ) then 90 | exit; 91 | 92 | Se_SI.Condition := ReturnSearchCondition( rgSeList.ItemIndex, cConditionsAllowed_Number ); 93 | 94 | TfrmSearch( Parent ).UpdateCaption( fBE ); 95 | 96 | end; 97 | 98 | 99 | procedure Tfrm_Search_double.FormCreate( Sender : TObject ); 100 | begin 101 | 102 | font.size := cDefaultFontSize; 103 | FormAutoAdjustLayout( self ); 104 | ApplyChangeFont( Self ); 105 | fIsLoading := false; 106 | rgSeList.Caption := crg_MatchType; 107 | lblValueInt.Caption := crg_Value; 108 | 109 | GetAllowedSearchConditions( rgSeList.Items, cConditionsAllowed_Number ); 110 | 111 | end; 112 | 113 | procedure Tfrm_Search_double.FormHide( Sender : TObject ); 114 | begin 115 | rgSeList.ItemIndex := -1; 116 | end; 117 | 118 | procedure Tfrm_Search_double.FormKeyDown( Sender : TObject; var Key : Word; Shift : TShiftState ); 119 | begin 120 | //pressing return in memo sent the key to parent form which clicked the OK button. ugh. 121 | if key = vk_return then 122 | Key := VK_UNKNOWN; 123 | end; 124 | 125 | procedure Tfrm_Search_double.UpdateSearchValue; 126 | begin 127 | //callers of this maybe need to check fIsLoading, but not always 128 | Se_SI.SearchValue := Floattostr( spnRealValue.Value ); 129 | TfrmSearch( Parent ).UpdateCaption( fBE ); 130 | end; 131 | 132 | procedure Tfrm_Search_double.spnIntValueChange( Sender : TObject ); 133 | begin 134 | if fIsLoading then 135 | exit; 136 | UpdateSearchValue; 137 | end; 138 | 139 | procedure Tfrm_Search_double.EnableControls( Idx : integer ); 140 | begin 141 | 142 | if Idx < 0 then 143 | exit; 144 | 145 | lblFreeTextReal.Caption := rgSeList.Items[ Idx ]; 146 | 147 | end; 148 | 149 | procedure Tfrm_Search_double.RegisterBoolExpr( BE : TfrmBoolExpr ); 150 | begin 151 | fBE := BE; 152 | end; 153 | 154 | procedure Tfrm_Search_double.SetSe_SI( AValue : TSearchItem ); 155 | var 156 | LabelType : TSearchOperatorType; 157 | begin 158 | 159 | if AValue.SIT <> sitDouble then 160 | raise EErrorDevelopment.Create( 'Tfrm_Search_Double.SetSe_SI: Float/Real Type expected.' ); 161 | 162 | LabelType := AValue.SearchOperatorType; 163 | if LabelType <> sotNone then 164 | raise EErrorDevelopment.Create( 'Tfrm_Search_Double.SetSe_SI: Invalid Operator Type.' ); 165 | 166 | fIsLoading := true; 167 | 168 | //No, don't do ==> if fSe_SI = AValue then Exit; 169 | 170 | fSe_SI := AValue; 171 | 172 | lblSEType.caption := format( cusSearchCaption_Double, [ fSe_SI.siDisplayCaption ] ); 173 | 174 | rgSeList.ItemIndex := ReturnSearchConditionIdx( fSe_SI.Condition, cConditionsAllowed_Number ); 175 | 176 | spnRealValue.Value := StrToFloat( SE_SI.SearchValue ); 177 | 178 | fIsLoading := false; 179 | 180 | if not self.Showing then 181 | Show; 182 | 183 | end; 184 | 185 | procedure Tfrm_Search_double.Link_SI_BoolExpr( anSI : TSearchItem; BE : TfrmBoolExpr ); 186 | begin 187 | RegisterBoolExpr( BE ); 188 | Se_SI := anSI; 189 | if anSI.InValidMsg <> '' then 190 | begin 191 | if assigned( gSearchInfo ) then 192 | begin 193 | gSearchInfo.Text := gSearchInfo.Text + anSI.InValidMsg + LineEnding + LineEnding; 194 | end 195 | else 196 | begin 197 | MsgDlgMessage( ccapusSearchDetailProblem, anSI.InValidMsg ); 198 | MsgDlgInfo( TForm( Parent ) ); 199 | end; 200 | anSI.ClearInvalidMessage; 201 | end; 202 | end; 203 | 204 | end. 205 | 206 | -------------------------------------------------------------------------------- /code/ufrm_search_integer.pp: -------------------------------------------------------------------------------- 1 | unit ufrm_search_integer; 2 | 3 | { 4 | Commandoo Program: Helper application for Linux commands / CLI 5 | Copyright (C) 2017 Julius Heinrich Ludwig Schön / Ronald Michael Spicer 6 | created by Julius Schön / R. Spicer 7 | Foto.TimePirate.org / TimePirate.org / PaganToday.TimePirate.org 8 | Julius@TimePirate.org 9 | 10 | This program is free software: you can redistribute it and/or modify 11 | it under the terms of the GNU General Public License as published by 12 | the Free Software Foundation, version 3 of the License. 13 | 14 | This program is distributed in the hope that it will be useful, 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | GNU General Public License for more details. 18 | 19 | You should have received a copy of the GNU General Public License 20 | along with this program. If not, see . 21 | 22 | } 23 | 24 | {$mode objfpc}{$H+} 25 | 26 | interface 27 | 28 | uses 29 | Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls, StdCtrls 30 | , lcltype {THis is needed for key up keyboard constants} 31 | , unitSearch 32 | , ufrmBoolExpr, Menus, Spin 33 | ; 34 | 35 | type 36 | 37 | { Tfrm_Search_Integer } 38 | 39 | Tfrm_Search_Integer = class( TForm) 40 | lblFreeTextInt : TLabel; 41 | lblValueInt : TLabel; 42 | lblSeType : TLabel; 43 | rgSeList : TRadioGroup; 44 | spnIntValue : TSpinEdit; 45 | procedure FormCreate( Sender : TObject ); 46 | procedure FormHide( Sender : TObject ); 47 | procedure FormKeyDown( Sender : TObject; var Key : Word; Shift : TShiftState ); 48 | procedure rgSeListSelectionChanged( Sender : TObject ); 49 | procedure spnIntValueChange( Sender : TObject ); 50 | private 51 | fSe_SI : TSearchItem; 52 | fBE : TfrmBoolExpr; 53 | fIsLoading : boolean; 54 | 55 | procedure EnableControls( Idx : integer ); 56 | procedure RegisterBoolExpr( BE : TfrmBoolExpr ); 57 | procedure SetSe_SI( AValue : TSearchItem ); 58 | procedure UpdateSearchValue; 59 | { private declarations } 60 | public 61 | { public declarations } 62 | procedure Link_SI_BoolExpr( anSI : TSearchItem; BE : TfrmBoolExpr ); 63 | 64 | property Se_SI : TSearchItem read fSe_SI write SetSe_SI; 65 | 66 | end; 67 | 68 | var 69 | frm_Search_Integer : Tfrm_Search_Integer; 70 | 71 | implementation 72 | 73 | uses ufrmSearch 74 | , ufrmMsgDlg 75 | , unitDBStructure 76 | , unitDBConstants 77 | , unitGlob 78 | , unitglobform 79 | ; 80 | 81 | {$R *.lfm} 82 | 83 | { Tfrm_Search_Integer } 84 | 85 | procedure Tfrm_Search_Integer.rgSeListSelectionChanged( Sender : TObject ); 86 | begin 87 | 88 | EnableControls( rgSeList.ItemIndex ); 89 | 90 | if not assigned( fBE ) or fIsLoading or ( rgSeList.Itemindex < 0 ) then 91 | exit; 92 | 93 | Se_SI.Condition := ReturnSearchCondition( rgSeList.ItemIndex, cConditionsAllowed_Number ); 94 | 95 | TfrmSearch( Parent ).UpdateCaption( fBE ); 96 | 97 | end; 98 | 99 | 100 | procedure Tfrm_Search_Integer.FormCreate( Sender : TObject ); 101 | begin 102 | 103 | font.size := cDefaultFontSize; 104 | FormAutoAdjustLayout( self ); 105 | ApplyChangeFont( Self ); 106 | fIsLoading := false; 107 | rgSeList.Caption := crg_MatchType; 108 | lblValueInt.Caption := crg_Value; 109 | 110 | GetAllowedSearchConditions( rgSeList.Items, cConditionsAllowed_Number ); 111 | 112 | end; 113 | 114 | procedure Tfrm_Search_Integer.FormHide( Sender : TObject ); 115 | begin 116 | rgSeList.ItemIndex := -1; 117 | end; 118 | 119 | procedure Tfrm_Search_Integer.FormKeyDown( Sender : TObject; var Key : Word; Shift : TShiftState ); 120 | begin 121 | //pressing return in memo sent the key to parent form which clicked the OK button. ugh. 122 | if key = vk_return then 123 | Key := VK_UNKNOWN; 124 | end; 125 | 126 | procedure Tfrm_Search_Integer.UpdateSearchValue; 127 | begin 128 | //callers of this maybe need to check fIsLoading, but not always 129 | Se_SI.SearchValue := inttostr( spnIntValue.Value ); 130 | TfrmSearch( Parent ).UpdateCaption( fBE ); 131 | end; 132 | 133 | procedure Tfrm_Search_Integer.spnIntValueChange( Sender : TObject ); 134 | begin 135 | if fIsLoading then 136 | exit; 137 | UpdateSearchValue; 138 | end; 139 | 140 | procedure Tfrm_Search_Integer.EnableControls( Idx : integer ); 141 | begin 142 | 143 | if Idx < 0 then 144 | exit; 145 | 146 | lblFreeTextInt.Caption := rgSeList.Items[ Idx ]; 147 | 148 | end; 149 | 150 | procedure Tfrm_Search_Integer.RegisterBoolExpr( BE : TfrmBoolExpr ); 151 | begin 152 | fBE := BE; 153 | end; 154 | 155 | procedure Tfrm_Search_Integer.SetSe_SI( AValue : TSearchItem ); 156 | var 157 | LabelType : TSearchOperatorType; 158 | begin 159 | 160 | if AValue.SIT <> sitInteger then 161 | raise EErrorDevelopment.Create( 'Tfrm_Search_Integer.SetSe_SI: Integer Type expected.' ); 162 | 163 | LabelType := AValue.SearchOperatorType; 164 | if LabelType <> sotNone then 165 | raise EErrorDevelopment.Create( 'Tfrm_Search_Integer.SetSe_SI: Invalid Operator Type.' ); 166 | 167 | fIsLoading := true; 168 | 169 | //No, don't do ==> if fSe_SI = AValue then Exit; 170 | 171 | fSe_SI := AValue; 172 | 173 | lblSEType.caption := format( cusSearchCaption_Integer, [ fSe_SI.siDisplayCaption ] ); 174 | 175 | rgSeList.ItemIndex := ReturnSearchConditionIdx( fSe_SI.Condition, cConditionsAllowed_Number ); 176 | 177 | spnIntValue.Value := StrToInt( SE_SI.SearchValue ); 178 | 179 | fIsLoading := false; 180 | 181 | if not self.Showing then 182 | Show; 183 | 184 | end; 185 | 186 | procedure Tfrm_Search_Integer.Link_SI_BoolExpr( anSI : TSearchItem; BE : TfrmBoolExpr ); 187 | begin 188 | RegisterBoolExpr( BE ); 189 | Se_SI := anSI; 190 | if anSI.InValidMsg <> '' then 191 | begin 192 | if assigned( gSearchInfo ) then 193 | begin 194 | gSearchInfo.Text := gSearchInfo.Text + anSI.InValidMsg + LineEnding + LineEnding; 195 | end 196 | else 197 | begin 198 | MsgDlgMessage( ccapusSearchDetailProblem, anSI.InValidMsg ); 199 | MsgDlgInfo( TForm( Parent ) ); 200 | end; 201 | anSI.ClearInvalidMessage; 202 | end; 203 | end; 204 | 205 | end. 206 | 207 | -------------------------------------------------------------------------------- /code/ufrmlistmanagerconsolidate.pp: -------------------------------------------------------------------------------- 1 | unit ufrmListManagerConsolidate; 2 | 3 | {$mode objfpc}{$H+} 4 | { 5 | Commandoo Program: Helper application for Linux commands / CLI 6 | Copyright (C) 2017 Julius Heinrich Ludwig Schön / Ronald Michael Spicer 7 | created by Julius Schön / R. Spicer 8 | Foto.TimePirate.org / TimePirate.org / PaganToday.TimePirate.org 9 | Julius@TimePirate.org 10 | 11 | This program is free software: you can redistribute it and/or modify 12 | it under the terms of the GNU General Public License as published by 13 | the Free Software Foundation, version 3 of the License. 14 | 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU General Public License for more details. 19 | 20 | You should have received a copy of the GNU General Public License 21 | along with this program. If not, see . 22 | 23 | } 24 | 25 | interface 26 | 27 | uses 28 | Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, HintFrame 29 | , lcltype {THis is needed for key up keyboard constants} 30 | , unitsharedobj, Buttons 31 | , unitGlobForm, StdCtrls 32 | ; 33 | 34 | type 35 | 36 | { TfrmListManagerConsolidate } 37 | 38 | TfrmListManagerConsolidate = class(TForm) 39 | btnCancel : TBitBtn; 40 | bntOK : TBitBtn; 41 | cbChoose : TComboBox; 42 | FrameHint1 : TFrameHint; 43 | lblInfo : TLabel; 44 | lblItem : TLabel; 45 | Label3 : TLabel; 46 | procedure bntOKClick(Sender : TObject); 47 | procedure btnCancelClick(Sender : TObject); 48 | procedure FormActivate(Sender : TObject); 49 | procedure FormClose(Sender : TObject; var CloseAction : TCloseAction); 50 | procedure FormCloseQuery(Sender : TObject; var CanClose : boolean); 51 | procedure FormCreate(Sender : TObject); 52 | procedure FormShow(Sender : TObject); 53 | private 54 | { private declarations } 55 | FCanClose : boolean; 56 | fDisplayWord : string; 57 | FHasShown : boolean; 58 | FIsInitialized : boolean; 59 | procedure HandleFormSettings( const TheType : TSettingsDirective ); 60 | procedure SetDisplayWord( const AValue : string ); 61 | public 62 | { public declarations } 63 | property DisplayWord : string read fDisplayWord write SetDisplayWord; 64 | end; 65 | 66 | var 67 | frmListManagerConsolidate : TfrmListManagerConsolidate; 68 | 69 | implementation 70 | 71 | {$R *.lfm} 72 | 73 | uses ufrmMsgDlg, unitglob; 74 | 75 | resourcestring 76 | cmsglmcNoSelection = 'You have not chosen a %s to consolidate to.'; 77 | cmsgLMC = 78 | 'When you press OK the old Item disappears ' 79 | + LineEnding 80 | + 'and all instances of it are changed to the newly ' 81 | + LineEnding 82 | + 'chosen Item. ' 83 | ; 84 | 85 | 86 | cmsgLMCLabel = 87 | 'This is the List Item you want to consolidate ' 88 | + LineEnding 89 | + '(combine into) another List Item. ' 90 | + LineEnding + LineEnding 91 | + 'You choose the List Item to consolidate to ' 92 | + LineEnding 93 | + 'from the combobox below. ' 94 | + LineEnding + LineEnding 95 | + '%s ' 96 | + LineEnding + LineEnding 97 | + ' ' 98 | ; 99 | 100 | cmsgLMCComboBox = 101 | 'This is the List Item you want to consolidate ' 102 | + LineEnding 103 | + 'TO. ' 104 | + LineEnding + LineEnding 105 | + 'The List Item shown above will be consolidated ' 106 | + LineEnding 107 | + 'to this List Item. ' 108 | + LineEnding + LineEnding 109 | + '%s ' 110 | + LineEnding + LineEnding 111 | + ' ' 112 | ; 113 | 114 | 115 | { TfrmListManagerConsolidate } 116 | 117 | procedure TfrmListManagerConsolidate.FormShow(Sender : TObject); 118 | begin 119 | 120 | if FHasShown then 121 | exit; 122 | FHasShown := true; 123 | FCanClose := false; 124 | HandleFormSettings( sdLoad ); 125 | FrameHint1.cbHints.Caption := ccbHintsEnglishOverride; 126 | lblItem.Hint := format( cmsgLMCLabel, [ cmsgLMC ] ); 127 | cbChoose.Hint := format( cmsgLMCComboBox, [ cmsgLMC ] ); 128 | 129 | end; 130 | 131 | procedure TfrmListManagerConsolidate.HandleFormSettings( const TheType : TSettingsDirective ); 132 | var 133 | i : Integer; 134 | theValue : string; 135 | begin 136 | theValue := ''; 137 | i := -1; 138 | case TheType of 139 | sdSave : 140 | begin 141 | FormSettings.AddSetting( inttoStr( Height ) ); 142 | FormSettings.AddSetting( inttoStr( Width ) ); 143 | 144 | FormSettings.SaveFormSettings( Self.Name ); 145 | end; 146 | sdLoad : 147 | While FormSettings.ReadFormSettings( Self.Name, i, theValue ) do 148 | case i of 149 | 0 : Height := strtoint( theValue ); 150 | 1 : Width := strtoint( theValue ); 151 | end; 152 | end; 153 | 154 | end; 155 | 156 | procedure TfrmListManagerConsolidate.SetDisplayWord( const AValue : string ); 157 | begin 158 | if fDisplayWord = AValue then Exit; 159 | fDisplayWord := AValue; 160 | end; 161 | 162 | procedure TfrmListManagerConsolidate.FormClose(Sender : TObject; var CloseAction : TCloseAction); 163 | begin 164 | HandleFormSettings( sdSave ); 165 | end; 166 | 167 | procedure TfrmListManagerConsolidate.bntOKClick(Sender : TObject); 168 | begin 169 | 170 | if cbChoose.Text = '' then 171 | begin 172 | MsgDlgMessage( cmsgNoCommandSelected, format( cmsglmcNoSelection, [ DisplayWord ] ) ); 173 | MsgDlgAttention( self ); 174 | exit; 175 | end; 176 | FCanClose := true; 177 | Modalresult := mrOK; 178 | end; 179 | 180 | procedure TfrmListManagerConsolidate.btnCancelClick(Sender : TObject); 181 | begin 182 | FCanClose := true; 183 | Modalresult := mrCancel; 184 | end; 185 | 186 | procedure TfrmListManagerConsolidate.FormActivate(Sender : TObject); 187 | begin 188 | if not FIsInitialized then 189 | begin 190 | FCanClose := false; 191 | FIsInitialized := true; 192 | end; 193 | 194 | end; 195 | 196 | procedure TfrmListManagerConsolidate.FormCloseQuery(Sender : TObject; var CanClose : boolean); 197 | begin 198 | CanClose := FCanClose; 199 | end; 200 | 201 | procedure TfrmListManagerConsolidate.FormCreate(Sender : TObject); 202 | begin 203 | font.size := cDefaultFontSize; 204 | FormAutoAdjustLayout( self ); 205 | ApplyChangeFont( Self ); 206 | FHasShown := false; 207 | FIsInitialized := true; 208 | end; 209 | 210 | end. 211 | 212 | -------------------------------------------------------------------------------- /code/ufrmsearch.lfm: -------------------------------------------------------------------------------- 1 | object frmSearch: TfrmSearch 2 | Left = 1966 3 | Height = 740 4 | Top = 385 5 | Width = 1250 6 | ActiveControl = edtSearchFileName 7 | Caption = 'Search KeyWords' 8 | ClientHeight = 740 9 | ClientWidth = 1250 10 | Constraints.MaxHeight = 740 11 | Constraints.MaxWidth = 1250 12 | Constraints.MinHeight = 740 13 | Constraints.MinWidth = 1250 14 | DesignTimePPI = 128 15 | Font.Height = -16 16 | KeyPreview = True 17 | OnActivate = FormActivate 18 | OnClose = FormClose 19 | OnCloseQuery = FormCloseQuery 20 | OnCreate = FormCreate 21 | OnDestroy = FormDestroy 22 | OnKeyDown = FormKeyDown 23 | OnShow = FormShow 24 | Position = poOwnerFormCenter 25 | LCLVersion = '2.0.6.0' 26 | object Bevel1: TBevel 27 | Left = 0 28 | Height = 5 29 | Top = 681 30 | Width = 1263 31 | end 32 | object btnOK: TBitBtn 33 | Left = 948 34 | Height = 43 35 | Top = 33 36 | Width = 113 37 | Anchors = [akTop, akRight] 38 | Caption = 'DNT' 39 | Default = True 40 | Font.Height = -16 41 | Kind = bkOK 42 | OnClick = btnOKClick 43 | ParentFont = False 44 | TabOrder = 4 45 | end 46 | object btnCancel: TBitBtn 47 | Left = 1111 48 | Height = 37 49 | Top = 37 50 | Width = 103 51 | Anchors = [akTop, akRight] 52 | Caption = '&X Cancel' 53 | Font.Height = -16 54 | GlyphShowMode = gsmNever 55 | Kind = bkCancel 56 | OnClick = btnCancelClick 57 | ParentFont = False 58 | TabOrder = 5 59 | end 60 | object edtSearchFileName: TEdit 61 | Left = 139 62 | Height = 34 63 | Hint = 'The "name" of a Search helps you identify it'#10'and will be used as the filename if you save'#10'it.'#10#10'If you use more than one Database Profile'#10'it is a good idea perhaps to give meaningful'#10'names so that you know what it is for and for'#10'which database. This will help when loading'#10'saved Searches.'#10#10'' 64 | Top = 72 65 | Width = 513 66 | AutoSize = False 67 | AutoSelect = False 68 | Font.Height = -16 69 | ParentFont = False 70 | TabOrder = 1 71 | end 72 | object lblDesignProf: TLabel 73 | Left = 29 74 | Height = 21 75 | Hint = 'This shows the database profile where the'#10'Search is / was designed.'#10#10'Different Database Profiles can use, for'#10'example, different Key Words. So while a '#10'Search may be valid for one DB Profile it'#10'may not be valid in another.'#10#10'This helps you determine that and you will'#10'also be notified in these cases.'#10#10'If a Search is not valid in this database it'#10'can not be run but it can be edited.'#10#10'' 76 | Top = 38 77 | Width = 59 78 | Caption = 'DNT A...' 79 | Font.Height = -16 80 | ParentColor = False 81 | ParentFont = False 82 | end 83 | object lblSearchFileName: TLabel 84 | Left = 52 85 | Height = 21 86 | Top = 79 87 | Width = 65 88 | Anchors = [akTop, akRight] 89 | Caption = '&N Name' 90 | FocusControl = edtSearchFileName 91 | Font.Height = -16 92 | ParentColor = False 93 | ParentFont = False 94 | end 95 | object lblProgramerTip_SearchForm: TLabel 96 | Left = 741 97 | Height = 22 98 | Top = 156 99 | Width = 215 100 | Caption = 'DNT --ufrm_search_ form--' 101 | Font.Height = -17 102 | ParentColor = False 103 | ParentFont = False 104 | Visible = False 105 | end 106 | object lblProgramerTip_Cmd: TLabel 107 | Left = 8 108 | Height = 21 109 | Top = 112 110 | Width = 163 111 | Caption = 'DNT --ufrmBoolExpr--' 112 | Font.Height = -16 113 | ParentColor = False 114 | ParentFont = False 115 | Visible = False 116 | end 117 | object cbField: TComboBox 118 | Left = 825 119 | Height = 38 120 | Hint = 'Select the field for this search expression.'#10#10'Sometimes this is disabled for technical '#10'reasons. For example, List searches may'#10'prevent it from being changed.'#10#10'' 121 | Top = 113 122 | Width = 296 123 | AutoSelect = False 124 | AutoSize = False 125 | DropDownCount = 20 126 | Font.Height = -16 127 | ItemHeight = 0 128 | OnSelect = cbFieldSelect 129 | ParentFont = False 130 | Style = csDropDownList 131 | TabOrder = 2 132 | Visible = False 133 | end 134 | object lblProgramerTip2: TLabel 135 | Left = 741 136 | Height = 22 137 | Top = 657 138 | Width = 197 139 | Caption = 'DNT --LOW_BOUNDARY--' 140 | Font.Height = -17 141 | ParentColor = False 142 | ParentFont = False 143 | Visible = False 144 | end 145 | object lblFieldCaption: TLabel 146 | Left = 747 147 | Height = 21 148 | Top = 120 149 | Width = 55 150 | Anchors = [akTop, akRight] 151 | Caption = '&F Field:' 152 | FocusControl = cbField 153 | Font.Height = -16 154 | ParentColor = False 155 | ParentFont = False 156 | Visible = False 157 | end 158 | inline FrameHint1: TFrameHint 159 | Left = 822 160 | Height = 29 161 | Top = 1 162 | Width = 569 163 | ClientHeight = 29 164 | ClientWidth = 569 165 | ParentColor = True 166 | TabOrder = 6 167 | DesignLeft = 300 168 | DesignTop = 539 169 | inherited cbHints: TCheckBox 170 | Left = 187 171 | Height = 24 172 | Top = 3 173 | Width = 223 174 | end 175 | end 176 | object lblWhichBoolExpr: TLabel 177 | Left = 828 178 | Height = 21 179 | Hint = 'This shows the Database Profile you are '#10'currently in.'#10#10'' 180 | Top = 85 181 | Width = 59 182 | Caption = 'DNT B...' 183 | Font.Height = -16 184 | ParentColor = False 185 | ParentFont = False 186 | Visible = False 187 | end 188 | object edtCurrProf: TEdit 189 | Left = 29 190 | Height = 26 191 | Top = 8 192 | Width = 433 193 | Anchors = [akTop, akLeft, akRight] 194 | AutoSize = False 195 | AutoSelect = False 196 | BorderStyle = bsNone 197 | Font.Height = -16 198 | ParentColor = True 199 | ParentFont = False 200 | ReadOnly = True 201 | TabStop = False 202 | TabOrder = 0 203 | end 204 | object shpDiv: TShape 205 | Left = 4 206 | Height = 8 207 | Top = 384 208 | Width = 732 209 | Brush.Color = clBlue 210 | Brush.Style = bsDiagCross 211 | end 212 | object btnUseSimpleSearch: TBitBtn 213 | Left = 469 214 | Height = 40 215 | Hint = 'Open a simple search instead which '#10'looks for specified text in all Command'#10'and Command Line text fields '#10'(choosable).'#10#10'' 216 | Top = 690 217 | Width = 433 218 | Caption = '&S Use Simple Search instead' 219 | Font.Height = -17 220 | Font.Style = [fsBold] 221 | OnClick = btnUseSimpleSearchClick 222 | ParentFont = False 223 | TabOrder = 3 224 | end 225 | end 226 | -------------------------------------------------------------------------------- /code/ufrm_search_text.pp: -------------------------------------------------------------------------------- 1 | unit ufrm_search_text; 2 | 3 | { 4 | Commandoo Program: Helper application for Linux commands / CLI 5 | Copyright (C) 2017 Julius Heinrich Ludwig Schön / Ronald Michael Spicer 6 | created by Julius Schön / R. Spicer 7 | Foto.TimePirate.org / TimePirate.org / PaganToday.TimePirate.org 8 | Julius@TimePirate.org 9 | 10 | This program is free software: you can redistribute it and/or modify 11 | it under the terms of the GNU General Public License as published by 12 | the Free Software Foundation, version 3 of the License. 13 | 14 | This program is distributed in the hope that it will be useful, 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | GNU General Public License for more details. 18 | 19 | You should have received a copy of the GNU General Public License 20 | along with this program. If not, see . 21 | 22 | } 23 | 24 | {$mode objfpc}{$H+} 25 | 26 | interface 27 | 28 | uses 29 | Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls, StdCtrls 30 | , lcltype {THis is needed for key up keyboard constants} 31 | , unitSearch 32 | , ufrmBoolExpr, Menus 33 | ; 34 | 35 | type 36 | 37 | { Tfrm_Search_Text } 38 | 39 | Tfrm_Search_Text = class( TForm) 40 | cbMatchCase : TCheckBox; 41 | lblFreeText : TLabel; 42 | lblSeType : TLabel; 43 | memSearchValue : TMemo; 44 | rgSeList : TRadioGroup; 45 | procedure cbMatchCaseChange( Sender : TObject ); 46 | procedure FormCreate( Sender : TObject ); 47 | procedure FormHide( Sender : TObject ); 48 | procedure FormKeyDown( Sender : TObject; var Key : Word; Shift : TShiftState ); 49 | procedure memSearchValueChange( Sender : TObject ); 50 | procedure rgSeListSelectionChanged( Sender : TObject ); 51 | private 52 | { private declarations } 53 | fSe_SI : TSearchItem; 54 | fBE : TfrmBoolExpr; 55 | fIsLoading : boolean; 56 | 57 | //enabling vars 58 | fIsEmptyIdx : integer; 59 | fIsRegX : integer; 60 | 61 | procedure EnableControls( Idx : integer ); 62 | procedure RegisterBoolExpr( BE : TfrmBoolExpr ); 63 | procedure SetSe_SI( AValue : TSearchItem ); 64 | procedure UpdateSearchValue; 65 | public 66 | { public declarations } 67 | procedure Link_SI_BoolExpr( anSI : TSearchItem; BE : TfrmBoolExpr ); 68 | property Se_SI : TSearchItem read fSe_SI write SetSe_SI; 69 | 70 | end; 71 | 72 | var 73 | frm_Search_Text : Tfrm_Search_Text; 74 | 75 | implementation 76 | 77 | uses ufrmSearch 78 | , ufrmMsgDlg 79 | , unitDBConstants 80 | , unitGlob 81 | , unitglobform 82 | ; 83 | 84 | {$R *.lfm} 85 | 86 | { Tfrm_Search_Text } 87 | 88 | procedure Tfrm_Search_Text.rgSeListSelectionChanged( Sender : TObject ); 89 | begin 90 | 91 | EnableControls( rgSeList.ItemIndex ); 92 | 93 | if not assigned( fBE ) or fIsLoading or ( rgSeList.Itemindex < 0 ) then 94 | exit; 95 | 96 | Se_SI.Condition := ReturnSearchCondition( rgSeList.ItemIndex, cConditionsAllowed_Text ); 97 | 98 | TfrmSearch( Parent ).UpdateCaption( fBE ); 99 | 100 | end; 101 | 102 | procedure Tfrm_Search_Text.FormCreate( Sender : TObject ); 103 | begin 104 | 105 | font.size := cDefaultFontSize; 106 | FormAutoAdjustLayout( self ); 107 | ApplyChangeFont( Self ); 108 | fIsLoading := false; 109 | 110 | GetAllowedSearchConditions( rgSeList.Items, cConditionsAllowed_Text ); 111 | 112 | //grab indexes that are needed for enabling / disabling 113 | fIsEmptyIdx := ReturnSearchConditionIdx( coIsEmpty, cConditionsAllowed_Text ); 114 | fIsRegX := ReturnSearchConditionIdx( coRegEx, cConditionsAllowed_Text ); 115 | rgSeList.Caption := crg_MatchType; 116 | 117 | end; 118 | 119 | procedure Tfrm_Search_Text.FormHide( Sender : TObject ); 120 | begin 121 | rgSeList.ItemIndex := -1; 122 | end; 123 | 124 | procedure Tfrm_Search_Text.FormKeyDown( Sender : TObject; var Key : Word; Shift : TShiftState ); 125 | begin 126 | //pressing return in memo sent the key to parent form which clicked the OK button. ugh. 127 | if key = vk_return then 128 | Key := VK_UNKNOWN; 129 | end; 130 | 131 | procedure Tfrm_Search_Text.cbMatchCaseChange( Sender : TObject ); 132 | begin 133 | if fIsLoading then 134 | exit; 135 | Se_SI.CaseSensitive := cbMatchCase.Checked; 136 | TfrmSearch( Parent ).UpdateCaption( fBE ); 137 | end; 138 | 139 | procedure Tfrm_Search_Text.UpdateSearchValue; 140 | begin 141 | //callers of this maybe need to check fIsLoading, but not always 142 | Se_SI.SearchValue := memSearchValue.Text; 143 | TfrmSearch( Parent ).UpdateCaption( fBE ); 144 | end; 145 | 146 | procedure Tfrm_Search_Text.memSearchValueChange( Sender : TObject ); 147 | begin 148 | if fIsLoading then 149 | exit; 150 | UpdateSearchValue; 151 | end; 152 | 153 | procedure Tfrm_Search_Text.EnableControls( Idx : integer ); 154 | begin 155 | 156 | if Idx < 0 then 157 | exit; 158 | 159 | cbMatchCase.Enabled := not ( Idx in [ fIsEmptyIdx, fIsRegX ] ); 160 | 161 | memSearchValue.Enabled := ( Idx <> fIsEmptyIdx ); 162 | 163 | lblFreeText.Caption := rgSeList.Items[ Idx ]; 164 | 165 | end; 166 | 167 | procedure Tfrm_Search_Text.RegisterBoolExpr( BE : TfrmBoolExpr ); 168 | begin 169 | fBE := BE; 170 | end; 171 | 172 | procedure Tfrm_Search_Text.SetSe_SI( AValue : TSearchItem ); 173 | var 174 | LabelType : TSearchOperatorType; 175 | begin 176 | 177 | if AValue.SIT <> sitString then 178 | raise EErrorDevelopment.Create( 'Tfrm_Search_Text.SetSe_SI: String Type expected.' ); 179 | 180 | LabelType := AValue.SearchOperatorType; 181 | if LabelType <> sotNone then 182 | raise EErrorDevelopment.Create( 'Tfrm_Search_Text.SetSe_SI: Invalid Operator Type.' ); 183 | 184 | fIsLoading := true; 185 | 186 | //No, don't do ==> if fSe_SI = AValue then Exit; 187 | 188 | fSe_SI := AValue; 189 | 190 | lblSEType.caption := format( cusSearchCaption_Text, [ fSe_SI.siDisplayCaption ] ); 191 | 192 | cbMatchCase.Checked := fSe_SI.CaseSensitive; 193 | 194 | memSearchValue.Text := fSe_SI.SearchValue; 195 | 196 | rgSeList.ItemIndex := ReturnSearchConditionIdx( fSe_SI.Condition, cConditionsAllowed_Text ); 197 | 198 | fIsLoading := false; 199 | 200 | if not self.Showing then 201 | Show; 202 | 203 | end; 204 | 205 | procedure Tfrm_Search_Text.Link_SI_BoolExpr( anSI : TSearchItem; BE : TfrmBoolExpr ); 206 | begin 207 | RegisterBoolExpr( BE ); 208 | Se_SI := anSI; 209 | if anSI.InValidMsg <> '' then 210 | begin 211 | if assigned( gSearchInfo ) then 212 | begin 213 | gSearchInfo.Text := gSearchInfo.Text + anSI.InValidMsg + LineEnding + LineEnding; 214 | end 215 | else 216 | begin 217 | MsgDlgMessage( ccapusSearchDetailProblem, anSI.InValidMsg ); 218 | MsgDlgInfo( TForm( Parent ) ); 219 | end; 220 | anSI.ClearInvalidMessage; 221 | end; 222 | end; 223 | 224 | end. 225 | 226 | -------------------------------------------------------------------------------- /code/ufrmprofilesmerge.pp: -------------------------------------------------------------------------------- 1 | unit ufrmprofilesmerge; 2 | 3 | {$mode objfpc}{$H+} 4 | { 5 | Commandoo Program: Helper application for Linux commands / CLI 6 | Copyright (C) 2017 Julius Heinrich Ludwig Schön / Ronald Michael Spicer 7 | created by Julius Schön / R. Spicer 8 | Foto.TimePirate.org / TimePirate.org / PaganToday.TimePirate.org 9 | Julius@TimePirate.org 10 | 11 | This program is free software: you can redistribute it and/or modify 12 | it under the terms of the GNU General Public License as published by 13 | the Free Software Foundation, version 3 of the License. 14 | 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU General Public License for more details. 19 | 20 | You should have received a copy of the GNU General Public License 21 | along with this program. If not, see . 22 | 23 | } 24 | 25 | interface 26 | 27 | uses 28 | Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs//, HintFrame 29 | , lcltype {THis is needed for key up keyboard constants} 30 | , unitsharedobj, Buttons 31 | , unitGlobForm, StdCtrls 32 | , ufrmProfiles 33 | ; 34 | 35 | type 36 | 37 | { TfrmProfilesMerge } 38 | 39 | TfrmProfilesMerge = class(TForm) 40 | btnCancel : TBitBtn; 41 | bntOK : TBitBtn; 42 | lblspInfo : TLabel; 43 | lbMergeList : TListBox; 44 | procedure bntOKClick(Sender : TObject); 45 | procedure btnCancelClick(Sender : TObject); 46 | procedure FormActivate(Sender : TObject); 47 | procedure FormClose(Sender : TObject; var CloseAction : TCloseAction); 48 | procedure FormCloseQuery(Sender : TObject; var CanClose : boolean); 49 | procedure FormCreate(Sender : TObject); 50 | procedure FormShow(Sender : TObject); 51 | procedure lbMergeListDblClick( Sender : TObject ); 52 | private 53 | { private declarations } 54 | FCanClose : boolean; 55 | FHasShown : boolean; 56 | FIsInitialized : boolean; 57 | fResultProfile : TObject; 58 | fSelectedDest : string; 59 | fSelectedIsSQL : boolean; 60 | procedure HandleFormSettings( const TheType : TSettingsDirective ); 61 | procedure SetResultProfile( AValue : TObject ); 62 | procedure SetSelectedDest( AValue : string ); 63 | procedure SetSelectedIsSQL( AValue : boolean ); 64 | public 65 | { public declarations } 66 | property ResultProfile : TObject read fResultProfile write SetResultProfile; 67 | property SelectedDest : string read fSelectedDest write SetSelectedDest; 68 | property SelectedIsSQL : boolean read fSelectedIsSQL write SetSelectedIsSQL; 69 | end; 70 | 71 | var 72 | frmProfilesMerge : TfrmProfilesMerge; 73 | 74 | implementation 75 | 76 | {$R *.lfm} 77 | 78 | uses ufrmMsgDlg 79 | , unitDBUtils 80 | //, strconst_en 81 | , unitglob 82 | ; 83 | 84 | 85 | 86 | { TfrmProfilesMerge } 87 | 88 | procedure TfrmProfilesMerge.FormShow(Sender : TObject); 89 | begin 90 | if not FHasShown then 91 | begin 92 | FCanClose := false; 93 | HandleFormSettings( sdLoad ); 94 | FHasShown := true; 95 | end; 96 | end; 97 | 98 | procedure TfrmProfilesMerge.lbMergeListDblClick( Sender : TObject ); 99 | begin 100 | if ( lbMergeList.Items.Count = 0 ) or ( lbMergeList.ItemIndex < 0 ) then 101 | Exit; 102 | bntOK.Click; 103 | end; 104 | 105 | procedure TfrmProfilesMerge.HandleFormSettings( const TheType : TSettingsDirective ); 106 | var 107 | i : Integer; 108 | theValue : string; 109 | begin 110 | theValue := ''; 111 | i := -1; 112 | case TheType of 113 | sdSave : 114 | begin 115 | FormSettings.AddSetting( inttoStr( Height ) ); 116 | FormSettings.AddSetting( inttoStr( Width ) ); 117 | 118 | FormSettings.SaveFormSettings( Self.Name ); 119 | end; 120 | sdLoad : 121 | While FormSettings.ReadFormSettings( Self.Name, i, theValue ) do 122 | case i of 123 | 0 : Height := strtoint( theValue ); 124 | 1 : Width := strtoint( theValue ); 125 | end; 126 | end; 127 | 128 | end; 129 | 130 | procedure TfrmProfilesMerge.SetResultProfile( AValue : TObject ); 131 | begin 132 | if fResultProfile = AValue then Exit; 133 | fResultProfile := AValue; 134 | end; 135 | 136 | procedure TfrmProfilesMerge.SetSelectedDest( AValue : string ); 137 | begin 138 | if fSelectedDest = AValue then Exit; 139 | fSelectedDest := AValue; 140 | end; 141 | 142 | procedure TfrmProfilesMerge.SetSelectedIsSQL( AValue : boolean ); 143 | begin 144 | if fSelectedIsSQL = AValue then Exit; 145 | fSelectedIsSQL := AValue; 146 | end; 147 | 148 | procedure TfrmProfilesMerge.FormClose(Sender : TObject; var CloseAction : TCloseAction); 149 | var 150 | i : Integer; 151 | begin 152 | HandleFormSettings( sdSave ); 153 | for i := 0 to lbMergeList.Items.Count - 1 do 154 | lbMergeList.Items.Objects[ i ] := nil; 155 | end; 156 | 157 | procedure TfrmProfilesMerge.bntOKClick(Sender : TObject); 158 | var 159 | Exists : Boolean; 160 | DefPath : String; 161 | aPO : TProfileObj; 162 | begin 163 | 164 | if lbMergeList.ItemIndex < 0 then 165 | begin 166 | showmessage( cmsgNoCommandSelected ); 167 | exit; 168 | end; 169 | 170 | aPO := TProfileObj( lbMergeList.Items.Objects[ lbMergeList.ItemIndex ] ); 171 | 172 | DefPath := TfrmProfiles( Owner ).ProgDefaultPath; 173 | 174 | if aPO.IsDB then 175 | Exists := FileExists( GenerateDBFilePath( aPO.GetExpandedPath( DefPath ), 176 | aPO.Name, 177 | cSqlDBExtension 178 | ) 179 | ) 180 | else Exists := IniDBFilesExist( aPO.GetExpandedPath( DefPath ), aPO.Name ); 181 | 182 | if not Exists then 183 | begin 184 | SelectedDest := lbMergeList.Items[ lbMergeList.ItemIndex ]; 185 | SelectedIsSQL := aPO.IsDB; 186 | end else ResultProfile := aPO; 187 | 188 | FCanClose := true; 189 | Modalresult := mrOK; 190 | 191 | end; 192 | 193 | procedure TfrmProfilesMerge.btnCancelClick(Sender : TObject); 194 | begin 195 | FCanClose := true; 196 | Modalresult := mrCancel; 197 | end; 198 | 199 | procedure TfrmProfilesMerge.FormActivate(Sender : TObject); 200 | begin 201 | if not FIsInitialized then 202 | begin 203 | FIsInitialized := true; 204 | end; 205 | end; 206 | 207 | procedure TfrmProfilesMerge.FormCloseQuery(Sender : TObject; var CanClose : boolean); 208 | begin 209 | CanClose := FCanClose; 210 | end; 211 | 212 | procedure TfrmProfilesMerge.FormCreate(Sender : TObject); 213 | begin 214 | font.size := cDefaultFontSize; 215 | FormAutoAdjustLayout( self ); 216 | ApplyChangeFont( Self ); 217 | FHasShown := false; 218 | FIsInitialized := false; 219 | fResultProfile := nil; 220 | fSelectedDest := ''; 221 | fSelectedIsSQL := false; 222 | end; 223 | 224 | end. 225 | 226 | -------------------------------------------------------------------------------- /code/ufrmcmdlineedit.lfm: -------------------------------------------------------------------------------- 1 | object frmCmdLineEdit: TfrmCmdLineEdit 2 | Left = 2330 3 | Height = 600 4 | Top = 466 5 | Width = 700 6 | ActiveControl = memCmdLine 7 | Caption = 'Edit Command Line' 8 | ClientHeight = 600 9 | ClientWidth = 700 10 | Constraints.MinHeight = 600 11 | Constraints.MinWidth = 700 12 | DesignTimePPI = 128 13 | Font.Height = -16 14 | KeyPreview = True 15 | OnActivate = FormActivate 16 | OnClose = FormClose 17 | OnCreate = FormCreate 18 | OnKeyDown = FormKeyDown 19 | OnShow = FormShow 20 | Position = poOwnerFormCenter 21 | LCLVersion = '2.0.6.0' 22 | inline FrameHint1: TFrameHint 23 | Left = 342 24 | Height = 30 25 | Top = -2 26 | Width = 352 27 | ClientHeight = 30 28 | ClientWidth = 352 29 | ParentColor = True 30 | TabOrder = 14 31 | DesignLeft = 300 32 | DesignTop = 539 33 | inherited cbHints: TCheckBox 34 | Left = 114 35 | Height = 24 36 | Width = 223 37 | end 38 | end 39 | object bntOK: TBitBtn 40 | Left = 415 41 | Height = 56 42 | Top = 168 43 | Width = 119 44 | Anchors = [akTop, akRight] 45 | Default = True 46 | DefaultCaption = True 47 | Font.Height = -16 48 | Kind = bkOK 49 | OnClick = bntOKClick 50 | ParentFont = False 51 | TabOrder = 12 52 | end 53 | object btnCancel: TBitBtn 54 | Left = 551 55 | Height = 40 56 | Top = 176 57 | Width = 119 58 | Anchors = [akTop, akRight] 59 | Cancel = True 60 | DefaultCaption = True 61 | Font.Height = -16 62 | GlyphShowMode = gsmNever 63 | Kind = bkCancel 64 | OnClick = btnCancelClick 65 | ParentFont = False 66 | TabOrder = 13 67 | end 68 | object memOutput: TMemo 69 | Left = 3 70 | Height = 216 71 | Hint = 'The output of the command''s default help '#10'or of the refresh and default help buttons '#10'above.'#10#10'Experimental right now, it is intended to '#10'display help for the command so you can'#10'see what flags / parameters you want to add'#10'to the Command Line.'#10#10'' 72 | Top = 349 73 | Width = 694 74 | Anchors = [akTop, akLeft, akRight, akBottom] 75 | Color = clBlack 76 | Font.Color = clCream 77 | Font.Height = -16 78 | Font.Name = 'Courier 10 Pitch' 79 | ParentFont = False 80 | ScrollBars = ssAutoVertical 81 | TabOrder = 10 82 | WordWrap = False 83 | end 84 | object edtOutputRefresh: TEdit 85 | Left = 21 86 | Height = 39 87 | Hint = 'Type in a command line you want to run'#10'while you are editing. Then press return or '#10'click the button above.'#10#10'' 88 | Top = 265 89 | Width = 663 90 | Anchors = [akTop, akLeft, akRight] 91 | AutoSize = False 92 | AutoSelect = False 93 | Font.Height = -16 94 | OnKeyDown = edtOutputRefreshKeyDown 95 | ParentFont = False 96 | TabOrder = 8 97 | TextHint = 'commands with Help flags only' 98 | end 99 | object cbWrapText: TCheckBox 100 | Left = 5 101 | Height = 25 102 | Hint = 'Checked and the output above uses '#10'wordwrap. Not, and not.'#10#10'' 103 | Top = 569 104 | Width = 172 105 | Anchors = [akLeft, akBottom] 106 | Caption = '&Z Wrap Output text' 107 | Font.Height = -16 108 | OnChange = cbWrapTextChange 109 | ParentFont = False 110 | TabOrder = 11 111 | end 112 | object lblVarHint: TLabel 113 | Left = 5 114 | Height = 21 115 | Top = 27 116 | Width = 297 117 | Caption = 'Add a variable at cursor / selection for: ' 118 | Font.Height = -16 119 | ParentColor = False 120 | ParentFont = False 121 | end 122 | object memCmdLine: TMemo 123 | Left = 4 124 | Height = 77 125 | Hint = 'The Command Line you are editing.'#10#10'You can place the cursor at a position, or'#10'select text, and then use one of the '#10'variable buttons below to use run time'#10'variables on this command line.'#10#10'' 126 | Top = 84 127 | Width = 680 128 | Anchors = [akTop, akLeft, akRight] 129 | Font.Height = -18 130 | OnKeyDown = memCmdLineKeyDown 131 | ParentFont = False 132 | ScrollBars = ssAutoVertical 133 | TabOrder = 0 134 | WantReturns = False 135 | end 136 | object btnVarString: TBitBtn 137 | Tag = 1 138 | Left = 4 139 | Height = 30 140 | Top = 51 141 | Width = 153 142 | Caption = '&S AlphaNum' 143 | Font.Height = -14 144 | OnClick = btnVarStringClick 145 | ParentFont = False 146 | TabOrder = 1 147 | end 148 | object btnVarInteger: TBitBtn 149 | Tag = 2 150 | Left = 179 151 | Height = 30 152 | Top = 51 153 | Width = 153 154 | Caption = '&I Integer' 155 | Font.Height = -14 156 | OnClick = btnVarStringClick 157 | ParentFont = False 158 | TabOrder = 2 159 | end 160 | object btnVarDecimal: TBitBtn 161 | Tag = 3 162 | Left = 354 163 | Height = 30 164 | Top = 51 165 | Width = 153 166 | Caption = '&N Decimal' 167 | Font.Height = -14 168 | OnClick = btnVarStringClick 169 | ParentFont = False 170 | TabOrder = 3 171 | end 172 | object btnVarFilename: TBitBtn 173 | Tag = 4 174 | Left = 529 175 | Height = 30 176 | Top = 51 177 | Width = 153 178 | Caption = '&F File Name' 179 | Font.Height = -14 180 | OnClick = btnVarStringClick 181 | ParentFont = False 182 | TabOrder = 4 183 | end 184 | object btnDefaultHelp: TBitBtn 185 | Left = 21 186 | Height = 33 187 | Hint = 'The help for the command is always displayed'#10'when you first open this form.'#10#10'But maybe later you do some other commands'#10'and then need to reference the command'#10'help quickly, then use this button.'#10#10'' 188 | Top = 311 189 | Width = 347 190 | Caption = '&Y Default Help' 191 | Enabled = False 192 | Font.Height = -16 193 | OnClick = btnDefaultHelpClick 194 | ParentFont = False 195 | TabOrder = 9 196 | end 197 | object btnRefresh: TBitBtn 198 | Left = 21 199 | Height = 33 200 | Hint = 'Sometimes when editing a command line'#10'you may need to reference other commands.'#10#10'You can type in a command line below and'#10'run it by pressing this button or pressing '#10'return in the edit.'#10#10'The output will be added below.'#10#10'' 201 | Top = 231 202 | Width = 347 203 | Caption = '&X Run Command Line below:' 204 | Font.Height = -16 205 | OnClick = btnRefreshClick 206 | ParentFont = False 207 | TabOrder = 7 208 | end 209 | object btnPath: TBitBtn 210 | Tag = 4 211 | Left = 8 212 | Height = 30 213 | Top = 164 214 | Width = 169 215 | Caption = '&A Insert full path' 216 | Font.Height = -14 217 | OnClick = btnPathClick 218 | ParentFont = False 219 | TabOrder = 5 220 | end 221 | object btnPkexec: TBitBtn 222 | Tag = 4 223 | Left = 208 224 | Height = 30 225 | Top = 164 226 | Width = 169 227 | Caption = '&T Toggle pkexec' 228 | Font.Height = -14 229 | OnClick = btnPkexecClick 230 | ParentFont = False 231 | TabOrder = 6 232 | end 233 | end 234 | -------------------------------------------------------------------------------- /code/ufrm_search_string.pp: -------------------------------------------------------------------------------- 1 | unit ufrm_search_string; 2 | 3 | { 4 | Commandoo Program: Helper application for Linux commands / CLI 5 | Copyright (C) 2017 Julius Heinrich Ludwig Schön / Ronald Michael Spicer 6 | created by Julius Schön / R. Spicer 7 | Foto.TimePirate.org / TimePirate.org / PaganToday.TimePirate.org 8 | Julius@TimePirate.org 9 | 10 | This program is free software: you can redistribute it and/or modify 11 | it under the terms of the GNU General Public License as published by 12 | the Free Software Foundation, version 3 of the License. 13 | 14 | This program is distributed in the hope that it will be useful, 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | GNU General Public License for more details. 18 | 19 | You should have received a copy of the GNU General Public License 20 | along with this program. If not, see . 21 | 22 | } 23 | 24 | {$mode objfpc}{$H+} 25 | 26 | interface 27 | 28 | uses 29 | Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls, StdCtrls 30 | , lcltype {THis is needed for key up keyboard constants} 31 | , unitSearch 32 | , ufrmBoolExpr, Menus 33 | ; 34 | 35 | type 36 | 37 | { Tfrm_Search_String } 38 | 39 | Tfrm_Search_String = class( TForm) 40 | cbMatchCase : TCheckBox; 41 | lblFreeText : TLabel; 42 | lblSeType : TLabel; 43 | memSearchValue : TMemo; 44 | rgSeList : TRadioGroup; 45 | procedure cbMatchCaseChange( Sender : TObject ); 46 | procedure FormCreate( Sender : TObject ); 47 | procedure FormHide( Sender : TObject ); 48 | procedure FormKeyDown( Sender : TObject; var Key : Word; Shift : TShiftState ); 49 | procedure memSearchValueChange( Sender : TObject ); 50 | procedure rgSeListSelectionChanged( Sender : TObject ); 51 | private 52 | { private declarations } 53 | fSe_SI : TSearchItem; 54 | fBE : TfrmBoolExpr; 55 | fIsLoading : boolean; 56 | 57 | //enabling vars 58 | fIsEmptyIdx : integer; 59 | fIsRegX : integer; 60 | 61 | procedure EnableControls( const Idx : integer ); 62 | procedure RegisterBoolExpr( BE : TfrmBoolExpr ); 63 | procedure SetSe_SI( AValue : TSearchItem ); 64 | procedure UpdateSearchValue; 65 | public 66 | { public declarations } 67 | procedure Link_SI_BoolExpr( anSI : TSearchItem; BE : TfrmBoolExpr ); 68 | property Se_SI : TSearchItem read fSe_SI write SetSe_SI; 69 | 70 | end; 71 | 72 | var 73 | frm_Search_String : Tfrm_Search_String; 74 | 75 | implementation 76 | 77 | uses ufrmSearch 78 | , ufrmMsgDlg 79 | , unitDBConstants 80 | , unitGlob 81 | , unitglobform 82 | ; 83 | 84 | {$R *.lfm} 85 | 86 | { Tfrm_Search_String } 87 | 88 | procedure Tfrm_Search_String.rgSeListSelectionChanged( Sender : TObject ); 89 | begin 90 | 91 | EnableControls( rgSeList.ItemIndex ); 92 | 93 | if not assigned( fBE ) or fIsLoading or ( rgSeList.Itemindex < 0 ) then 94 | exit; 95 | 96 | Se_SI.Condition := ReturnSearchCondition( rgSeList.ItemIndex, cConditionsAllowed_String ); 97 | //example for later Se_SI.Condition := ReturnSearchCondition( rgSeList.ItemIndex, cConditionsAllowed_Text ); 98 | 99 | TfrmSearch( Parent ).UpdateCaption( fBE ); 100 | 101 | end; 102 | 103 | procedure Tfrm_Search_String.FormCreate( Sender : TObject ); 104 | begin 105 | 106 | font.size := cDefaultFontSize; 107 | FormAutoAdjustLayout( self ); 108 | ApplyChangeFont( Self ); 109 | fIsLoading := false; 110 | 111 | GetAllowedSearchConditions( rgSeList.Items, cConditionsAllowed_String ); 112 | 113 | //grab indexes that are needed for enabling / disabling 114 | fIsEmptyIdx := ReturnSearchConditionIdx( coIsEmpty, cConditionsAllowed_String ); 115 | fIsRegX := ReturnSearchConditionIdx( coRegEx, cConditionsAllowed_String ); 116 | rgSeList.Caption := crg_MatchType; 117 | 118 | end; 119 | 120 | procedure Tfrm_Search_String.FormHide( Sender : TObject ); 121 | begin 122 | rgSeList.ItemIndex := -1; 123 | end; 124 | 125 | procedure Tfrm_Search_String.FormKeyDown( Sender : TObject; var Key : Word; Shift : TShiftState ); 126 | begin 127 | //pressing return in memo sent the key to parent form which clicked the OK button. ugh. 128 | if key = vk_return then 129 | Key := VK_UNKNOWN; 130 | end; 131 | 132 | procedure Tfrm_Search_String.cbMatchCaseChange( Sender : TObject ); 133 | begin 134 | if fIsLoading then 135 | exit; 136 | Se_SI.CaseSensitive := cbMatchCase.Checked; 137 | TfrmSearch( Parent ).UpdateCaption( fBE ); 138 | end; 139 | 140 | procedure Tfrm_Search_String.UpdateSearchValue; 141 | begin 142 | //callers of this maybe need to check fIsLoading, but not always 143 | Se_SI.SearchValue := memSearchValue.Text; 144 | TfrmSearch( Parent ).UpdateCaption( fBE ); 145 | end; 146 | 147 | procedure Tfrm_Search_String.memSearchValueChange( Sender : TObject ); 148 | begin 149 | if fIsLoading then 150 | exit; 151 | UpdateSearchValue; 152 | end; 153 | 154 | procedure Tfrm_Search_String.EnableControls( const Idx : integer ); 155 | begin 156 | 157 | if Idx < 0 then 158 | exit; 159 | 160 | cbMatchCase.Enabled := not ( Idx in [ fIsEmptyIdx, fIsRegX ] ); 161 | 162 | memSearchValue.Enabled := ( Idx <> fIsEmptyIdx ); 163 | 164 | lblFreeText.Caption := rgSeList.Items[ Idx ]; 165 | 166 | end; 167 | 168 | procedure Tfrm_Search_String.RegisterBoolExpr( BE : TfrmBoolExpr ); 169 | begin 170 | fBE := BE; 171 | end; 172 | 173 | procedure Tfrm_Search_String.SetSe_SI( AValue : TSearchItem ); 174 | var 175 | LabelType : TSearchOperatorType; 176 | begin 177 | 178 | if AValue.SIT <> sitString then 179 | raise EErrorDevelopment.Create( 'Tfrm_Search_String.SetSe_SI: String Type expected.' ); 180 | 181 | LabelType := AValue.SearchOperatorType; 182 | if LabelType <> sotNone then 183 | raise EErrorDevelopment.Create( 'Tfrm_Search_String.SetSe_SI: Invalid Operator Type.' ); 184 | 185 | fIsLoading := true; 186 | 187 | //No, don't do ==> if fSe_SI = AValue then Exit; 188 | 189 | fSe_SI := AValue; 190 | 191 | lblSEType.caption := format( cusSearchCaption_String, [ fSe_SI.siDisplayCaption ] ); 192 | 193 | cbMatchCase.Checked := fSe_SI.CaseSensitive; 194 | 195 | memSearchValue.Text := fSe_SI.SearchValue; 196 | 197 | rgSeList.ItemIndex := ReturnSearchConditionIdx( fSe_SI.Condition, cConditionsAllowed_String ); 198 | 199 | fIsLoading := false; 200 | 201 | if not self.Showing then 202 | Show; 203 | 204 | end; 205 | 206 | procedure Tfrm_Search_String.Link_SI_BoolExpr( anSI : TSearchItem; BE : TfrmBoolExpr ); 207 | begin 208 | RegisterBoolExpr( BE ); 209 | Se_SI := anSI; 210 | if anSI.InValidMsg <> '' then 211 | begin 212 | if assigned( gSearchInfo ) then 213 | begin 214 | gSearchInfo.Text := gSearchInfo.Text + anSI.InValidMsg + LineEnding + LineEnding; 215 | end 216 | else 217 | begin 218 | MsgDlgMessage( ccapusSearchDetailProblem, anSI.InValidMsg ); 219 | MsgDlgInfo( TForm( Parent ) ); 220 | end; 221 | anSI.ClearInvalidMessage; 222 | end; 223 | end; 224 | 225 | end. 226 | 227 | -------------------------------------------------------------------------------- /code/ufrmlistmanager.lfm: -------------------------------------------------------------------------------- 1 | object frmListManager: TfrmListManager 2 | Left = 2053 3 | Height = 640 4 | Top = 389 5 | Width = 540 6 | ActiveControl = lbList 7 | Caption = 'Key Words' 8 | ClientHeight = 640 9 | ClientWidth = 540 10 | Constraints.MinHeight = 640 11 | Constraints.MinWidth = 540 12 | DesignTimePPI = 128 13 | Font.Height = -16 14 | KeyPreview = True 15 | OnActivate = FormActivate 16 | OnClose = FormClose 17 | OnCloseQuery = FormCloseQuery 18 | OnCreate = FormCreate 19 | OnKeyDown = FormKeyDown 20 | OnShow = FormShow 21 | PopupMenu = popKeywords 22 | Position = poOwnerFormCenter 23 | LCLVersion = '2.0.6.0' 24 | inline FrameHint1: TFrameHint 25 | Left = 233 26 | Height = 30 27 | Top = 1 28 | Width = 302 29 | ClientHeight = 30 30 | ClientWidth = 302 31 | ParentColor = True 32 | TabOrder = 4 33 | DesignLeft = 300 34 | DesignTop = 539 35 | inherited cbHints: TCheckBox 36 | Left = 71 37 | Height = 24 38 | Top = 3 39 | Width = 223 40 | OnChange = cbHintsChange 41 | end 42 | end 43 | object btnOK: TBitBtn 44 | Left = 379 45 | Height = 52 46 | Hint = 'Depending on Mode:'#10#10'If displaying this list from a Command this'#10'button adds the selected Items to the '#10'Command''s List.'#10#10'If in Manage Items mode this simply closes'#10'the form, you use the Manage buttons to'#10'manipulate the list.'#10#10'' 47 | Top = 75 48 | Width = 148 49 | Action = actOK 50 | Anchors = [akTop, akRight] 51 | Default = True 52 | Font.Height = -16 53 | ParentFont = False 54 | TabOrder = 2 55 | end 56 | object btnCancel: TBitBtn 57 | Left = 395 58 | Height = 40 59 | Top = 136 60 | Width = 120 61 | Action = actCancel 62 | Anchors = [akTop, akRight] 63 | Cancel = True 64 | Font.Height = -16 65 | GlyphShowMode = gsmNever 66 | ParentFont = False 67 | TabOrder = 3 68 | end 69 | object lbList: TListBox 70 | Left = 17 71 | Height = 371 72 | Hint = 'Contents of the List you are currently'#10'editing.'#10#10'From a Command you can choose mulitple'#10'List items to add, then use OK button.'#10#10'You can manage the Master List in either '#10'Command Edit mode or Manage List Mode.'#10#10'' 73 | Top = 53 74 | Width = 354 75 | Anchors = [akTop, akLeft, akRight, akBottom] 76 | Font.Height = -16 77 | ItemHeight = 0 78 | MultiSelect = True 79 | OnDblClick = lbListDblClick 80 | OnKeyDown = lbListKeyDown 81 | ParentFont = False 82 | PopupMenu = popKeywords 83 | ScrollWidth = 352 84 | TabOrder = 0 85 | TopIndex = -1 86 | end 87 | object gbManageList: TGroupBox 88 | Left = 21 89 | Height = 207 90 | Top = 426 91 | Width = 505 92 | Anchors = [akLeft, akBottom] 93 | Caption = 'Manage Master List' 94 | ClientHeight = 183 95 | ClientWidth = 503 96 | Font.Height = -16 97 | ParentColor = False 98 | ParentFont = False 99 | TabOrder = 1 100 | object btnAdd: TBitBtn 101 | Left = 20 102 | Height = 40 103 | Top = 11 104 | Width = 164 105 | Action = actAdd 106 | Font.Height = -16 107 | ParentFont = False 108 | TabOrder = 0 109 | end 110 | object btnConsolidate: TBitBtn 111 | Left = 277 112 | Height = 40 113 | Top = 11 114 | Width = 191 115 | Action = actConsolidate 116 | Font.Height = -16 117 | ParentFont = False 118 | TabOrder = 3 119 | end 120 | object btnEdit: TBitBtn 121 | Left = 20 122 | Height = 40 123 | Top = 57 124 | Width = 164 125 | Action = actEdit 126 | Font.Height = -16 127 | ParentFont = False 128 | TabOrder = 1 129 | end 130 | object btnRevert: TBitBtn 131 | Left = 277 132 | Height = 40 133 | Top = 72 134 | Width = 191 135 | Action = actRevert 136 | Font.Height = -16 137 | ParentFont = False 138 | TabOrder = 4 139 | end 140 | object btnDelete: TBitBtn 141 | Left = 21 142 | Height = 40 143 | Top = 131 144 | Width = 164 145 | Action = actDelete 146 | Font.Height = -16 147 | ParentFont = False 148 | TabOrder = 2 149 | end 150 | object btnShowUsage: TBitBtn 151 | Left = 277 152 | Height = 40 153 | Top = 131 154 | Width = 191 155 | Action = actShowUsage 156 | Font.Height = -16 157 | ParentFont = False 158 | TabOrder = 5 159 | end 160 | end 161 | object lblInstructions: TLabel 162 | Left = 21 163 | Height = 21 164 | Top = 32 165 | Width = 247 166 | Caption = 'Add Selected items to Command' 167 | Font.Height = -16 168 | ParentColor = False 169 | ParentFont = False 170 | end 171 | object popKeywords: TPopupMenu 172 | left = 384 173 | top = 272 174 | object mniKeywordsRoot: TMenuItem 175 | Caption = 'DNT Keywords' 176 | Enabled = False 177 | RightJustify = True 178 | end 179 | object MenuItem5: TMenuItem 180 | Caption = '-' 181 | end 182 | object mniKeywordsOK: TMenuItem 183 | Action = actOK 184 | end 185 | object mniKeywordsCancel: TMenuItem 186 | Action = actCancel 187 | end 188 | object MenuItem4: TMenuItem 189 | Caption = '-' 190 | end 191 | object mniKeywordsAdd: TMenuItem 192 | Action = actAdd 193 | end 194 | object mniKeywordsEdit: TMenuItem 195 | Action = actEdit 196 | end 197 | object mniKeywordsDelete: TMenuItem 198 | Action = actDelete 199 | end 200 | object mniKeywordsConsolidate: TMenuItem 201 | Action = actConsolidate 202 | end 203 | object MenuItem1: TMenuItem 204 | Caption = '-' 205 | end 206 | object mniKeywordsRevert: TMenuItem 207 | Action = actRevert 208 | end 209 | object MenuItem2: TMenuItem 210 | Caption = '-' 211 | end 212 | object mniKeywordsShowUsage: TMenuItem 213 | Action = actShowUsage 214 | end 215 | end 216 | object ActionList1: TActionList 217 | left = 373 218 | top = 352 219 | object actOK: TAction 220 | Caption = 'DNT OK' 221 | OnExecute = actOKExecute 222 | end 223 | object actCancel: TAction 224 | Caption = 'DNT Cancel' 225 | OnExecute = actCancelExecute 226 | end 227 | object actAdd: TAction 228 | Caption = 'DNT Add' 229 | OnExecute = actAddExecute 230 | end 231 | object actEdit: TAction 232 | Caption = 'DNT Edit' 233 | OnExecute = actEditExecute 234 | end 235 | object actDelete: TAction 236 | Caption = 'DNT Delete' 237 | OnExecute = actDeleteExecute 238 | end 239 | object actConsolidate: TAction 240 | Caption = 'DNT Consolidate' 241 | OnExecute = actConsolidateExecute 242 | end 243 | object actRevert: TAction 244 | Caption = 'DNT Revert List' 245 | Enabled = False 246 | OnExecute = actRevertExecute 247 | end 248 | object actShowUsage: TAction 249 | Caption = 'DNT Show Usage' 250 | OnExecute = actShowUsageExecute 251 | end 252 | end 253 | end 254 | -------------------------------------------------------------------------------- /code/strconst_prog.pp: -------------------------------------------------------------------------------- 1 | unit strconst_prog; 2 | 3 | {$mode objfpc}{$H+} 4 | { 5 | Commandoo Program: Helper application for Linux commands / CLI 6 | Copyright (C) 2017 Julius Heinrich Ludwig Schön / Ronald Michael Spicer 7 | created by Julius Schön / R. Spicer 8 | Foto.TimePirate.org / TimePirate.org / PaganToday.TimePirate.org 9 | Julius@TimePirate.org 10 | 11 | This program is free software: you can redistribute it and/or modify 12 | it under the terms of the GNU General Public License as published by 13 | the Free Software Foundation, version 3 of the License. 14 | 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU General Public License for more details. 19 | 20 | You should have received a copy of the GNU General Public License 21 | along with this program. If not, see . 22 | 23 | } 24 | interface 25 | 26 | uses 27 | Classes, SysUtils; 28 | 29 | 30 | const 31 | cprogEscapeReplacement = '!'; 32 | cSqliteLocateCommand = 'locate -i -e libsqlite3.so'; 33 | cConfigPathFileName = 'config_path__DoNotDelete'; 34 | cConfigPathSection = 'Working_Config_Path'; 35 | cConfigPathWritingPath = 'WritingPath'; 36 | cRootMode = '<< ROOT MODE >> '; 37 | ccapProgram = 'COMMANDOO : GUI for Linux Commands / CLI'; 38 | 39 | cAttnBar = LineEnding + '==========' + LineEnding; 40 | 41 | cSaveToFileTemplate = 'commandoo_%s.txt'; 42 | 43 | cSectTabNoShows = 'NoShows'; 44 | 45 | cRootFileSudo = 'sudo %s'; 46 | cRootFileSu = 'su -c "%s"'; 47 | cRootFileSuSession = 'su --session-command "%s"'; 48 | 49 | cSectTabFormSettings = 'FormSettings'; 50 | cFormSettingsProgramLangCol = 'ProgramLang'; 51 | cFormSettingsMaxInOutPutCol = 'MaxInOutPut'; 52 | cFormSettingsOutPutDisplayMax = 'DisplayMax'; 53 | cFormSettingsMaxOutputWait = 'MaxOutputWait'; 54 | //cFormSettingsSystemColorsIdx = 'SystemColorsIdx'; 55 | cFormSettingsLastQuickRun = 'LastQuickRun'; 56 | cFormSettingsManRefreshFav = 'ManRefreshFav'; 57 | //cFormSettingsLastNoteBookTab = 'LastNoteBookTab'; 58 | cFormSettingsWarnUnspecified = 'WarnUnspecified'; 59 | cFormSettingsWarnHarmless = 'WarnHarmless'; 60 | cFormSettingsWarnCareful = 'WarnCareful'; 61 | cFormSettingsWarnCaution = 'WarnCaution'; 62 | cFormSettingsWarnDanger = 'WarnDanger'; 63 | cFormSettingsAllowMultipleOpens = 'AllowMultipleOpens'; 64 | cFormSettingsAllowPkexec = 'AllowPkexec'; 65 | cFormSettingsLargerFont = 'LargerFont'; 66 | cFormSettingsAllowSqlDB = 'AllowSqlDB'; 67 | cFormSettingsDoShowSqlMissing = 'DoShowSqlMissing'; 68 | cFormSettingsAllowTextDB = 'AllowTextDB'; 69 | cFormSettingsRootFile = 'RootFile'; 70 | cFormSettingsSavingPath = 'SavingPath'; 71 | 72 | cSectTabFormSettingsExtension = '.settings'; 73 | 74 | cSectTabSupportedLanguages = 'SupportedLanguages'; 75 | 76 | cSectTabCurrProfile = 'CurrentProfile'; 77 | cCurrProfileName = 'CPName'; 78 | cCurrProfileIsDB = 'CPIsDB'; 79 | cCurrProfilePath = 'CPPath'; 80 | 81 | cSectTabCurrSqliteLibrary = 'SQLite'; 82 | cCurrSqliteLibraryPath = 'SqlLibPath'; 83 | 84 | 85 | cDefaultDBProfileName = 'DB'; 86 | cDefaultDBProfileIsDB = false; 87 | cDefaultDBProfileIsDBStrNot = ' < file >'; 88 | cDefaultDBProfileIsDBStr = ' < sql >'; 89 | 90 | cSectTabDBProfiles = 'DBProfiles'; 91 | cLanguageFolderName = 'languages'; 92 | cSearchFolderName = 'searches'; 93 | cReferenceProgramName = 'commandoo'; 94 | 95 | cconstCommandLabel = 'Command'; 96 | cconstCommandLineLabel = 'Command Line'; 97 | cWebSiteBase = 'https://timepirate.org/'; 98 | cWebSiteCommando = 'downloads.html'; 99 | cWebSiteDownloads = 'downloads/%s'; 100 | 101 | //beginning of a blacklist for programs that do not take --help or -V, etc commands. 102 | //This is bad because when adding a CL entry the help is supposed to be shown but the program runs 103 | //instead as a child process, locking commandoo until the child is halted. 104 | //I ran accress speedcrunch, there may be more! Who knows. For now this simple thing will do 105 | //but if the list that I'm aware of grows then will need a structure of some sort. 106 | cHelpVer_BLACKLIST = '::speedcrunch::'; 107 | 108 | //=================================== IMPORTANT 109 | // changes to versions need to have code for them in 110 | //TfrmMain.CheckUpdates_PROG 111 | //TfrmMain.CheckUpdates_DB 112 | //see also c_DB_VersionUpgradeCount 113 | //=================================== 114 | //increment this number for any Program settings cleanup / change, ONLY needs to be done if there is a change 115 | //that needs to be programatically handled. 116 | //c_PROG_VersionUpgradeCount = 3; 117 | c_PROG_VersionUpgradeCount = 4; //29.06.2020 Allow Escape chars taken out 118 | //===== PROGRAM ============================== 119 | 120 | //==> NOTE: only change MAJOR VERSION when it is INCOMPATIBLE (ie. DB schema change) with previous MAJOR VERSION 121 | 122 | cHandwrittenVersion = '2.0.1';//'1.0.1';//all done. ? 123 | cSectTab_PROG_VersionCount = '_PROG_VersionCount'; 124 | cStandardProgramSequence = 'PROGRAM SEQUENCE #: %d'; 125 | cVersionDate = ' (August 2020)';//ReleaseCandidate'; 126 | {$IFDEF platAppImage} 127 | cUpgradeDir = 'upgrades'; 128 | cUpgradeFileName = 'commandoo-x86_64'; 129 | cUpgradeExtUpgradeVersion = '.ver.txt'; //No number 130 | cUpgradeExtUpgradeInfo = '.readme.txt'; 131 | cUpgradeExtAppImage = '.AppImage'; 132 | cUpgradeExtGPGSignature = '.sig'; 133 | cUpgradeExtZsync = '.zsync'; 134 | //commandoo-x86_64.4.(appimage).zsync [FUTURE have them get appimageupdate] 135 | function Upgrade_GetUpgradeVersionFileName : string; 136 | function Upgrade_GetUpgradeInfoFileName( const Sequence : string ) : string; 137 | function Upgrade_GetAppImageFileName( const Sequence : string ) : string; 138 | function Upgrade_GetGPGSignatureFileName( const Sequence : string ) : string; 139 | function Upgrade_GetZsyncFileName( const Sequence : string ) : string; 140 | {$ENDIF} 141 | 142 | 143 | 144 | implementation 145 | 146 | {$IFDEF platAppImage} 147 | function Upgrade_GetFileName : string; 148 | begin 149 | result := cUpgradeFileName; 150 | end; 151 | 152 | function Upgrade_GetUpgradeVersionFileName : string; 153 | begin 154 | result := Upgrade_GetFileName + cUpgradeExtAppImage + cUpgradeExtUpgradeVersion; 155 | end; 156 | 157 | function Upgrade_GetUpgradeInfoFileName( const Sequence : string ) : string; 158 | begin 159 | result := Upgrade_GetAppImageFileName( Sequence ) + cUpgradeExtUpgradeInfo; 160 | end; 161 | 162 | function Upgrade_GetAppImageFileName( const Sequence : string ) : string; 163 | begin 164 | result := Upgrade_GetFileName + '_' + Sequence + cUpgradeExtAppImage; 165 | end; 166 | 167 | function Upgrade_GetGPGSignatureFileName( const Sequence : string ) : string; 168 | begin 169 | result := Upgrade_GetAppImageFileName( Sequence ) + cUpgradeExtGPGSignature; 170 | //result := Upgrade_GetFileName + Sequence + cUpgradeExtAppImage + cUpgradeExtGPGSignature; 171 | end; 172 | 173 | function Upgrade_GetZsyncFileName( const Sequence : string ) : string; 174 | begin 175 | result := Upgrade_GetAppImageFileName( Sequence ) + cUpgradeExtZsync; 176 | //result := Upgrade_GetFileName + Sequence + cUpgradeExtAppImage + cUpgradeExtZsync; 177 | end; 178 | 179 | {$ENDIF} 180 | 181 | end. 182 | 183 | 184 | -------------------------------------------------------------------------------- /code/ufrmsuperuserfile.pp: -------------------------------------------------------------------------------- 1 | unit ufrmSuperUserFile; 2 | 3 | {$mode objfpc}{$H+} 4 | { 5 | Commandoo Program: Helper application for Linux commands / CLI 6 | Copyright (C) 2017 Julius Heinrich Ludwig Schön / Ronald Michael Spicer 7 | created by Julius Schön / R. Spicer 8 | Foto.TimePirate.org / TimePirate.org / PaganToday.TimePirate.org 9 | Julius@TimePirate.org 10 | 11 | This program is free software: you can redistribute it and/or modify 12 | it under the terms of the GNU General Public License as published by 13 | the Free Software Foundation, version 3 of the License. 14 | 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU General Public License for more details. 19 | 20 | You should have received a copy of the GNU General Public License 21 | along with this program. If not, see . 22 | 23 | May 2020: 24 | This form was originally designed to select and store the name of the GUI root interfaces, 25 | gksu, gksudo, kdesudo, kdesu. 26 | But this is all deprecated now where one should use either pkexec or admin:// 27 | 28 | Since they really don't want us running kdesudo and so on, I've ripped out the 29 | ability to do so. 30 | 31 | This form is now re-purposed (hence the odd-ish name) to hold the sudo string 32 | the user wants to have used when the Command line is copied and pasted: 33 | 34 | ie: kate 35 | will be pasted as: 'sudo kate' or 'su -c "kate"', etc. 36 | } 37 | 38 | interface 39 | 40 | uses 41 | Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, HintFrame 42 | , lcltype {THis is needed for key up keyboard constants} 43 | , unitsharedobj, Buttons 44 | , unitGlobForm, StdCtrls, ExtCtrls 45 | ; 46 | 47 | type 48 | 49 | { TfrmSuperUserFile } 50 | 51 | TfrmSuperUserFile = class(TForm) 52 | btnCancel : TBitBtn; 53 | bntOK : TBitBtn; 54 | btnCustom : TBitBtn; 55 | btnTemplate : TBitBtn; 56 | btnTest : TBitBtn; 57 | edtCustom : TEdit; 58 | FrameHint1 : TFrameHint; 59 | lblCurr : TLabel; 60 | lblCurrFile : TLabel; 61 | rgTemplates : TRadioGroup; 62 | procedure bntOKClick(Sender : TObject); 63 | procedure btnCancelClick(Sender : TObject); 64 | procedure btnCustomClick( Sender : TObject ); 65 | procedure btnTemplateClick( Sender : TObject ); 66 | procedure btnTestClick( Sender : TObject ); 67 | procedure edtCustomKeyDown( Sender : TObject; var Key : Word; Shift : TShiftState ); 68 | procedure FormActivate(Sender : TObject); 69 | procedure FormClose(Sender : TObject; var CloseAction : TCloseAction); 70 | procedure FormCloseQuery(Sender : TObject; var CanClose : boolean); 71 | procedure FormCreate(Sender : TObject); 72 | procedure FormShow(Sender : TObject); 73 | procedure rgTemplatesClick( Sender : TObject ); 74 | private 75 | { private declarations } 76 | FCanClose : boolean; 77 | FHasShown : boolean; 78 | FIsInitialized : boolean; 79 | 80 | procedure HandleFormSettings( const TheType : TSettingsDirective ); 81 | public 82 | { public declarations } 83 | end; 84 | 85 | var 86 | frmSuperUserFile : TfrmSuperUserFile; 87 | 88 | 89 | 90 | implementation 91 | 92 | {$R *.lfm} 93 | 94 | uses ufrmMsgDlg 95 | , strconst_en 96 | , strconst_prog 97 | , unitcommands 98 | , linuxtrix 99 | , unitglob 100 | ; 101 | 102 | 103 | { TfrmSuperUserFile } 104 | procedure TfrmSuperUserFile.FormShow(Sender : TObject); 105 | var 106 | Idx : integer; 107 | begin 108 | 109 | if not FHasShown then 110 | begin 111 | FCanClose := false; 112 | HandleFormSettings( sdLoad ); 113 | 114 | FrameHint1.cbHints.Caption := ccbHintsEnglishOverride; 115 | 116 | rgTemplates.Items.Add( '&X ' + cRootFileSudo ); 117 | rgTemplates.Items.Add( '&Y ' + cRootFileSu ); 118 | rgTemplates.Items.Add( '&Z ' + cRootFileSuSession ); 119 | 120 | Idx := -1; 121 | if pos( cRootFileSudo, lblCurrfile.Caption ) > 0 then 122 | Idx := 0 123 | else if pos( cRootFileSu, lblCurrfile.Caption ) > 0 then 124 | Idx := 1 125 | else if pos( cRootFileSuSession, lblCurrfile.Caption ) > 0 then 126 | Idx := 2; 127 | 128 | if Idx = -1 then 129 | begin 130 | Idx := 0; 131 | edtCustom.Text := lblCurrfile.Caption; 132 | end; 133 | 134 | rgTemplates.ItemIndex := Idx; 135 | if rgTemplates.CanFocus then 136 | rgTemplates.SetFocus; 137 | 138 | FHasShown := true; 139 | 140 | end; 141 | 142 | end; 143 | 144 | procedure TfrmSuperUserFile.rgTemplatesClick( Sender : TObject ); 145 | begin 146 | btnTemplate.Click; 147 | end; 148 | 149 | procedure TfrmSuperUserFile.HandleFormSettings( const TheType : TSettingsDirective ); 150 | var 151 | i : Integer; 152 | theValue : string; 153 | begin 154 | theValue := ''; 155 | i := -1; 156 | case TheType of 157 | sdSave : 158 | begin 159 | FormSettings.AddSetting( inttoStr( Height ) ); 160 | FormSettings.AddSetting( inttoStr( Width ) ); 161 | 162 | FormSettings.SaveFormSettings( Self.Name ); 163 | end; 164 | sdLoad : 165 | While FormSettings.ReadFormSettings( Self.Name, i, theValue ) do 166 | case i of 167 | 0 : Height := strtoint( theValue ); 168 | 1 : Width := strtoint( theValue ); 169 | end; 170 | end; 171 | 172 | end; 173 | 174 | procedure TfrmSuperUserFile.FormClose(Sender : TObject; var CloseAction : TCloseAction); 175 | begin 176 | HandleFormSettings( sdSave ); 177 | end; 178 | 179 | procedure TfrmSuperUserFile.bntOKClick(Sender : TObject); 180 | begin 181 | FCanClose := true; 182 | Modalresult := mrOK; 183 | end; 184 | 185 | procedure TfrmSuperUserFile.btnCancelClick(Sender : TObject); 186 | begin 187 | FCanClose := true; 188 | Modalresult := mrCancel; 189 | end; 190 | 191 | procedure TfrmSuperUserFile.btnCustomClick( Sender : TObject ); 192 | var 193 | Idx, tempIdx : integer; 194 | str, tempstr : string; 195 | begin 196 | 197 | if trim( edtCustom.Text ) = '' then 198 | begin 199 | Showmessage( cInputCantBeBlank ); 200 | exit; 201 | end; 202 | 203 | str := trim( edtCustom.Text ); 204 | str := stringreplace( str, '%S', '%s', [ rfreplaceall ] );//, rfignorecase 205 | Idx := pos( '%s', str ); 206 | 207 | tempstr := copy( str, Idx + 2, maxint ); 208 | tempIdx := pos( '%s', tempstr ); 209 | 210 | if ( Idx = 0 ) or ( tempIdx > 0 ) then 211 | begin 212 | MsgDlgMessage( ccapRootFileInfo, cmsgRootFileInfo ); 213 | MsgDlgInfo( self ); 214 | exit; 215 | end; 216 | 217 | lblCurrFile.caption := str; 218 | 219 | end; 220 | 221 | procedure TfrmSuperUserFile.btnTemplateClick( Sender : TObject ); 222 | begin 223 | lblCurrFile.Caption := copy( rgTemplates.Items[ rgTemplates.ItemIndex ], 5, Maxint ); 224 | end; 225 | 226 | procedure TfrmSuperUserFile.btnTestClick( Sender : TObject ); 227 | begin 228 | MsgDlgMessage( ccapRootFileTest, format( lblCurrFile.Caption, [ 'myCLine --help'] ) ); 229 | MsgDlgInfo( self ); 230 | end; 231 | 232 | procedure TfrmSuperUserFile.edtCustomKeyDown( Sender : TObject; var Key : Word; Shift : TShiftState ); 233 | begin 234 | if Key = vk_Return then 235 | btnCustom.Click; 236 | end; 237 | 238 | procedure TfrmSuperUserFile.FormActivate(Sender : TObject); 239 | begin 240 | if not FIsInitialized then 241 | begin 242 | FIsInitialized := true; 243 | end; 244 | 245 | end; 246 | 247 | procedure TfrmSuperUserFile.FormCloseQuery(Sender : TObject; var CanClose : boolean); 248 | begin 249 | CanClose := FCanClose; 250 | end; 251 | 252 | procedure TfrmSuperUserFile.FormCreate(Sender : TObject); 253 | begin 254 | font.size := cDefaultFontSize; 255 | FormAutoAdjustLayout( self ); 256 | ApplyChangeFont( Self ); 257 | FHasShown := false; 258 | FIsInitialized := false; 259 | end; 260 | 261 | end. 262 | 263 | -------------------------------------------------------------------------------- /code/ufrm_search_list.pp: -------------------------------------------------------------------------------- 1 | unit ufrm_search_list; 2 | 3 | { 4 | Commandoo Program: Helper application for Linux commands / CLI 5 | Copyright (C) 2017 Julius Heinrich Ludwig Schön / Ronald Michael Spicer 6 | created by Julius Schön / R. Spicer 7 | Foto.TimePirate.org / TimePirate.org / PaganToday.TimePirate.org 8 | Julius@TimePirate.org 9 | 10 | This program is free software: you can redistribute it and/or modify 11 | it under the terms of the GNU General Public License as published by 12 | the Free Software Foundation, version 3 of the License. 13 | 14 | This program is distributed in the hope that it will be useful, 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | GNU General Public License for more details. 18 | 19 | You should have received a copy of the GNU General Public License 20 | along with this program. If not, see . 21 | 22 | } 23 | 24 | {$mode objfpc}{$H+} 25 | 26 | interface 27 | 28 | uses 29 | Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls, StdCtrls 30 | , lcltype {THis is needed for key up keyboard constants} 31 | , unitSearch 32 | , ufrmBoolExpr, Menus 33 | ; 34 | 35 | type 36 | 37 | { Tfrm_Search_List } 38 | 39 | Tfrm_Search_List = class( TForm) 40 | cbMatchCase : TCheckBox; 41 | lblListChoice : TLabel; 42 | lblFreeText : TLabel; 43 | lblKeywords : TLabel; 44 | lblSeType : TLabel; 45 | lbList : TListBox; 46 | memSearchValue : TMemo; 47 | mniCopy : TMenuItem; 48 | popList : TPopupMenu; 49 | rgSeList : TRadioGroup; 50 | procedure cbMatchCaseChange( Sender : TObject ); 51 | procedure FormCreate( Sender : TObject ); 52 | procedure FormHide( Sender : TObject ); 53 | procedure FormKeyDown( Sender : TObject; var Key : Word; Shift : TShiftState ); 54 | procedure lbListClick( Sender : TObject ); 55 | procedure memSearchValueChange( Sender : TObject ); 56 | procedure mniCopyClick( Sender : TObject ); 57 | procedure rgSeListSelectionChanged( Sender : TObject ); 58 | private 59 | { private declarations } 60 | fSe_SI : TSearchItem; 61 | fBE : TfrmBoolExpr; 62 | fIsLoading : boolean; 63 | 64 | //enabling vars 65 | fMatchIdx : integer; 66 | fMatchNotIdx : integer; 67 | fIsEmptyIdx : integer; 68 | fContainsIdx : integer; 69 | fContainsNotIdx : integer; 70 | 71 | procedure EnableControls( const Idx : integer ); 72 | procedure ForceIfNecessaryToValidItem; 73 | procedure RegisterBoolExpr( BE : TfrmBoolExpr ); 74 | procedure SetSe_SI( AValue : TSearchItem ); 75 | procedure UpdateSearchValue; 76 | public 77 | { public declarations } 78 | procedure Link_SI_BoolExpr( anSI : TSearchItem; BE : TfrmBoolExpr ); 79 | 80 | property Se_SI : TSearchItem read fSe_SI write SetSe_SI; 81 | 82 | end; 83 | 84 | var 85 | frm_Search_List : Tfrm_Search_List; 86 | 87 | implementation 88 | 89 | uses ufrmSearch 90 | , ufrmMsgDlg 91 | , unitDBConstants 92 | , unitGlob 93 | , unitglobform 94 | ; 95 | 96 | {$R *.lfm} 97 | 98 | { Tfrm_Search_List } 99 | 100 | procedure Tfrm_Search_List.rgSeListSelectionChanged( Sender : TObject ); 101 | begin 102 | 103 | EnableControls( rgSeList.ItemIndex ); 104 | 105 | if not assigned( fBE ) or fIsLoading or ( rgSeList.Itemindex < 0 ) then 106 | exit; 107 | 108 | Se_SI.Condition := ReturnSearchCondition( rgSeList.ItemIndex, cConditionsAllowed_List ); 109 | 110 | TfrmSearch( Parent ).UpdateCaption( fBE ); 111 | 112 | end; 113 | 114 | procedure Tfrm_Search_List.FormCreate( Sender : TObject ); 115 | begin 116 | 117 | font.size := cDefaultFontSize; 118 | FormAutoAdjustLayout( self ); 119 | ApplyChangeFont( Self ); 120 | fIsLoading := false; 121 | 122 | GetAllowedSearchConditions( rgSeList.Items, cConditionsAllowed_List ); 123 | 124 | //grab indexes that are needed for enabling / disabling 125 | fMatchIdx := ReturnSearchConditionIdx( coMatchQualified, cConditionsAllowed_List ); 126 | fMatchNotIdx := ReturnSearchConditionIdx( coMatchQualifiedNot, cConditionsAllowed_List ); 127 | fIsEmptyIdx := ReturnSearchConditionIdx( coIsEmpty, cConditionsAllowed_List ); 128 | fContainsIdx := ReturnSearchConditionIdx( coContains, cConditionsAllowed_List ); 129 | fContainsNotIdx := ReturnSearchConditionIdx( coContainsNot, cConditionsAllowed_List ); 130 | 131 | rgSeList.Caption := crg_MatchType; 132 | 133 | end; 134 | 135 | procedure Tfrm_Search_List.FormHide( Sender : TObject ); 136 | begin 137 | rgSeList.ItemIndex := -1; 138 | end; 139 | 140 | procedure Tfrm_Search_List.FormKeyDown( Sender : TObject; var Key : Word; Shift : TShiftState ); 141 | begin 142 | //pressing return in memo sent the key to parent form which clicked the OK button. ugh. 143 | if key = vk_return then 144 | Key := VK_UNKNOWN; 145 | end; 146 | 147 | procedure Tfrm_Search_List.cbMatchCaseChange( Sender : TObject ); 148 | begin 149 | if fIsLoading then 150 | exit; 151 | Se_SI.CaseSensitive := cbMatchCase.Checked; 152 | TfrmSearch( Parent ).UpdateCaption( fBE ); 153 | end; 154 | 155 | procedure Tfrm_Search_List.lbListClick( Sender : TObject ); 156 | begin 157 | mniCopyClick( lbList ); 158 | end; 159 | 160 | procedure Tfrm_Search_List.UpdateSearchValue; 161 | begin 162 | //callers of this maybe need to check fIsLoading, but not always 163 | Se_SI.SearchValue := memSearchValue.Text; 164 | TfrmSearch( Parent ).UpdateCaption( fBE ); 165 | end; 166 | 167 | procedure Tfrm_Search_List.memSearchValueChange( Sender : TObject ); 168 | begin 169 | if fIsLoading then 170 | exit; 171 | UpdateSearchValue; 172 | end; 173 | 174 | procedure Tfrm_Search_List.mniCopyClick( Sender : TObject ); 175 | begin 176 | if ( lbList.Items.Count = 0 ) or ( lbList.ItemIndex < 0 ) then 177 | exit; 178 | memSearchValue.Text := lbList.Items[ lbList.ItemIndex ]; 179 | end; 180 | 181 | 182 | procedure Tfrm_Search_List.EnableControls( const Idx : integer ); 183 | var 184 | Are_Matchers : Boolean; 185 | begin 186 | 187 | if Idx < 0 then 188 | exit; 189 | 190 | cbMatchCase.Enabled := Idx in [ FContainsIdx, FContainsNotIdx ]; 191 | 192 | Are_Matchers := Idx in [ fMatchIdx, fMatchNotIdx ]; 193 | 194 | lbList.Enabled := ( Idx <> fIsEmptyIdx ); 195 | 196 | memSearchValue.Enabled := ( Idx <> fIsEmptyIdx ) and not Are_Matchers;//lbList.Enabled; 197 | 198 | case Are_Matchers of 199 | true : 200 | begin 201 | ForceIfNecessaryToValidItem; 202 | lblListChoice.Visible := true; 203 | end; 204 | else 205 | begin 206 | lblListChoice.Visible := false; 207 | lbList.Enabled := false; 208 | end; 209 | end; 210 | lblFreeText.Caption := rgSeList.Items[ Idx ]; 211 | 212 | end; 213 | 214 | procedure Tfrm_Search_List.ForceIfNecessaryToValidItem; 215 | var 216 | Idx : Integer; 217 | begin 218 | Idx := lbList.Items.IndexOf( trim( memSearchValue.Text ) ); 219 | if Idx < 0 then 220 | begin 221 | lbList.ItemIndex := 0; //should be ok, search isn't opened if list is empty. 222 | memSearchValue.Text := lbList.Items[ 0 ]; 223 | UpdateSearchValue; 224 | end 225 | else lbList.ItemIndex := Idx; 226 | end; 227 | 228 | 229 | procedure Tfrm_Search_List.RegisterBoolExpr( BE : TfrmBoolExpr ); 230 | begin 231 | fBE := BE; 232 | end; 233 | 234 | procedure Tfrm_Search_List.SetSe_SI( AValue : TSearchItem ); 235 | var 236 | LabelType : TSearchOperatorType; 237 | begin 238 | 239 | if AValue.SIT <> sitString then 240 | raise EErrorDevelopment.Create( 'Tfrm_Search_List.SetSe_SI: String Type expected.' ); 241 | 242 | LabelType := AValue.SearchOperatorType; 243 | if LabelType <> sotNone then 244 | raise EErrorDevelopment.Create( 'Tfrm_Search_List.SetSe_SI: Invalid Operator Type.' ); 245 | 246 | fIsLoading := true; 247 | 248 | //No, don't do ==> if fSe_SI = AValue then Exit; 249 | 250 | fSe_SI := AValue; 251 | 252 | lblSEType.caption := format( cusSearchCaption_List, [ fSe_SI.siDisplayCaption ] ); 253 | 254 | cbMatchCase.Checked := fSe_SI.CaseSensitive; 255 | 256 | memSearchValue.Text := fSe_SI.SearchValue; 257 | 258 | rgSeList.ItemIndex := ReturnSearchConditionIdx( fSe_SI.Condition, cConditionsAllowed_List ); 259 | //example for later //rgSeList.ItemIndex := ReturnSearchConditionIdx( fSe_SI.Condition, cConditionsAllowed_Text ); 260 | 261 | fIsLoading := false; 262 | 263 | if not self.Showing then 264 | Show; 265 | 266 | end; 267 | 268 | procedure Tfrm_Search_List.Link_SI_BoolExpr( anSI : TSearchItem; BE : TfrmBoolExpr ); 269 | begin 270 | RegisterBoolExpr( BE ); 271 | Se_SI := anSI; 272 | if anSI.InValidMsg <> '' then 273 | begin 274 | if assigned( gSearchInfo ) then 275 | begin 276 | gSearchInfo.Text := gSearchInfo.Text + anSI.InValidMsg + LineEnding + LineEnding; 277 | end 278 | else 279 | begin 280 | MsgDlgMessage( ccapusSearchDetailProblem, anSI.InValidMsg ); 281 | MsgDlgInfo( TForm( Parent ) ); 282 | end; 283 | anSI.ClearInvalidMessage; 284 | end; 285 | end; 286 | 287 | end. 288 | 289 | -------------------------------------------------------------------------------- /code/ufrmaddlanguage.pp: -------------------------------------------------------------------------------- 1 | unit ufrmaddlanguage; 2 | 3 | {$mode objfpc}{$H+} 4 | { 5 | Commandoo Program: Helper application for Linux commands / CLI 6 | Copyright (C) 2017 Julius Heinrich Ludwig Schön / Ronald Michael Spicer 7 | created by Julius Schön / R. Spicer 8 | Foto.TimePirate.org / TimePirate.org / PaganToday.TimePirate.org 9 | Julius@TimePirate.org 10 | 11 | This program is free software: you can redistribute it and/or modify 12 | it under the terms of the GNU General Public License as published by 13 | the Free Software Foundation, version 3 of the License. 14 | 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU General Public License for more details. 19 | 20 | You should have received a copy of the GNU General Public License 21 | along with this program. If not, see . 22 | 23 | } 24 | 25 | interface 26 | 27 | uses 28 | Classes, SysUtils, LazFileUtils, FileUtil, 29 | Forms, Controls, Graphics, Dialogs, StdCtrls, 30 | Buttons, EditBtn, ExtCtrls 31 | , unitSharedObj, HintFrame 32 | , unitGlobForm 33 | ; 34 | 35 | type 36 | 37 | { TfrmAddLanguage } 38 | 39 | TfrmAddLanguage = class (TForm) 40 | btnCancel : TBitBtn; 41 | btnOk : TBitBtn; 42 | edtLang : TEdit; 43 | edtFileName : TFileNameEdit; 44 | FrameHint1 : TFrameHint; 45 | Label1 : TLabel; 46 | lblLangAbbrev : TLabel; 47 | lblLangAbbrev1 : TLabel; 48 | Panel1 : TPanel; 49 | procedure btnCancelClick(Sender : TObject); 50 | procedure btnOkClick(Sender : TObject); 51 | procedure edtFileNameButtonClick(Sender : TObject); 52 | procedure edtFileNameExit(Sender : TObject); 53 | procedure FormActivate(Sender : TObject); 54 | procedure FormClose(Sender : TObject; var CloseAction : TCloseAction); 55 | procedure FormCloseQuery(Sender : TObject; var CanClose : boolean); 56 | procedure FormCreate(Sender : TObject); 57 | procedure FormShow(Sender : TObject); 58 | private 59 | { private declarations } 60 | FCanClose : boolean; 61 | FLastFolder : string; 62 | FIsInitialized : boolean; 63 | FSaveToPath : string; 64 | procedure HandleFormSettings(TheType : TSettingsDirective); 65 | function IsGoodFileName( FiName : string ) : boolean; 66 | procedure SetSaveToPath( const AValue : string ); 67 | public 68 | { public declarations } 69 | LangSymbol : string; 70 | SymbolList : TStringlist; 71 | MenuList : TStringlist; 72 | CurrLangText : string; 73 | property SaveToPath : string read FSaveToPath write SetSaveToPath; 74 | end; 75 | 76 | var 77 | frmAddLanguage : TfrmAddLanguage; 78 | 79 | resourcestring 80 | cAddLangHasBlanks = 'All fields must be filled in...' ; 81 | cNoParenthese = '"%s" can not contain parentheses: "(" or ")", those are used by the system.'; 82 | cNoParentheseLang = 'Language Name'; 83 | 84 | 85 | implementation 86 | 87 | uses Strconst_prog, StrConst_EN, unitLanguages, unitGlob; 88 | 89 | {$R *.lfm} 90 | 91 | { TfrmAddLanguage } 92 | 93 | procedure TfrmAddLanguage.FormActivate(Sender : TObject); 94 | begin 95 | if FIsInitialized then 96 | exit; 97 | FCanClose := false; 98 | FIsInitialized := true; 99 | FrameHint1.cbHints.Caption := ccbHintsEnglishOverride; 100 | end; 101 | 102 | procedure TfrmAddLanguage.FormClose(Sender : TObject; var CloseAction : TCloseAction); 103 | begin 104 | 105 | HandleFormSettings( sdSave ); 106 | 107 | if Assigned( SymbolList ) then 108 | SymbolList.Free; 109 | if Assigned( MenuList ) then 110 | MenuList.Free; 111 | 112 | end; 113 | 114 | procedure TfrmAddLanguage.btnOkClick(Sender : TObject); 115 | var 116 | fiName : String; 117 | begin 118 | 119 | fiName := extractfilename( edtFileName.Text ); 120 | 121 | //need to hold current value because IsGoodFileName updates the field 122 | CurrLangText := trim( edtLang.Text ); 123 | if CurrLangText = '' then 124 | begin 125 | if edtLang.Canfocus then 126 | edtLang.Setfocus; 127 | exit; 128 | end; 129 | 130 | If not IsGoodFileName( fiName ) then 131 | begin 132 | Showmessage( format( cNotValidPOFile, [ fiName ] ) ); 133 | exit; 134 | end; 135 | 136 | if not FileExists( edtFileName.Text ) then 137 | begin 138 | Showmessage( format( cFileNotExist, [ edtFileName.Text ] ) ); 139 | exit; 140 | end; 141 | 142 | 143 | if ( trim( edtFileName.Text ) = '' ) 144 | //or ( LangSymbol = '' ) 145 | or ( CurrLangText = '' ) 146 | //or ( trim( edtLangEnglish.Text ) = '' ) 147 | then 148 | begin 149 | Showmessage( cAddLangHasBlanks ); 150 | exit; 151 | end; 152 | 153 | if ( pos( '(', CurrLangText ) > 0 ) or ( pos( ')', CurrLangText ) > 0 ) then 154 | begin 155 | Showmessage( format( cNoParenthese, [ cNoParentheseLang ] ) ); 156 | exit; 157 | end; 158 | 159 | if extractfilepath( edtFileName.Text ) <> fSaveToPath then 160 | if not Copyfile( edtFileName.Text, fSaveToPath + extractfilename( edtFileName.Text ) ) then 161 | Showmessage( format( cCantCopy, [ edtFileName.Text, fSaveToPath ] ) ); 162 | 163 | FCanClose := True; 164 | ModalResult := mrOK; 165 | end; 166 | 167 | function TfrmAddLanguage.IsGoodFileName( FiName : string ) : boolean; 168 | var 169 | tmpStr : String; 170 | idx : SizeInt; 171 | fiExt : String; 172 | fiLang : String; 173 | EmergencyName : string; 174 | begin 175 | 176 | Result := false; 177 | 178 | tmpStr := FiName; 179 | fiLang := '...'; 180 | LangSymbol := ''; 181 | lblLangAbbrev.Caption := fiLang; 182 | EmergencyName := ExtractFileName( changefileExt( FiName, '' ) ); 183 | 184 | idx := pos( '.', tmpStr ); 185 | if idx > 0 then 186 | begin 187 | fiName := copy( tmpStr, 1, idx -1 ); 188 | tmpStr := copy( tmpStr, idx + 1, length( tmpStr ) ); 189 | idx := pos( '.', tmpStr ); 190 | if idx > 0 then 191 | begin 192 | LangSymbol := copy( tmpStr, 1, idx - 1 ); 193 | fiLang := format( cLangSymbol, [ LangSymbol ] ); 194 | fiExt := copy( tmpStr, idx + 1, length( tmpStr ) ); 195 | if pos( '.', fiExt ) > 0 then 196 | begin 197 | LangSymbol := ''; 198 | fiLang := '...'; 199 | exit; 200 | end; 201 | end else exit; 202 | end else exit; 203 | 204 | if fiExt <> 'po' then 205 | exit; 206 | 207 | if fiName <> cReferenceProgramName then 208 | exit; 209 | 210 | lblLangAbbrev.Caption := fiLang; 211 | 212 | Idx := SymbolList.IndexOf( LangSymbol ); 213 | if Idx > -1 then 214 | edtLang.Text := MenuList[ Idx ] 215 | else edtLang.Text := EmergencyName; 216 | 217 | if edtLang.CanFocus then 218 | edtLang.SetFocus; 219 | 220 | Result := true; 221 | 222 | end; 223 | 224 | procedure TfrmAddLanguage.SetSaveToPath( const AValue : string ); 225 | begin 226 | if FSaveToPath = AValue then Exit; 227 | FSaveToPath := AValue; 228 | end; 229 | 230 | procedure TfrmAddLanguage.edtFileNameButtonClick(Sender : TObject); 231 | begin 232 | if FLastFolder <> '' then 233 | edtFileName.InitialDir := FLastFolder 234 | else edtFileName.InitialDir := fSaveToPath; 235 | end; 236 | 237 | procedure TfrmAddLanguage.edtFileNameExit(Sender : TObject); 238 | var 239 | fiName : String; 240 | begin 241 | 242 | edtFileName.Text := trim( edtFileName.Text ); 243 | if edtFileName.Text = '' then 244 | exit; 245 | fLastFolder := extractfilepath( edtFileName.Text ); 246 | 247 | fiName := extractfilename( edtFileName.Text ); 248 | 249 | If not IsGoodFileName( fiName ) then 250 | Showmessage( format( cNotValidPOFile, [ fiName ] ) ); 251 | 252 | end; 253 | 254 | 255 | procedure TfrmAddLanguage.btnCancelClick(Sender : TObject); 256 | begin 257 | FCanClose := true; 258 | ModalResult := mrCancel; 259 | end; 260 | 261 | procedure TfrmAddLanguage.FormCloseQuery(Sender : TObject; var CanClose : boolean); 262 | begin 263 | CanClose := FCanClose; 264 | end; 265 | 266 | procedure TfrmAddLanguage.FormCreate(Sender : TObject); 267 | begin 268 | font.size := cDefaultFontSize; 269 | FormAutoAdjustLayout( self ); 270 | ApplyChangeFont( Self ); 271 | FLastFolder := ''; 272 | SymbolList := TStringlist.Create; 273 | MenuList := TStringlist.Create; 274 | edtFileName.DialogTitle := caption; 275 | FIsInitialized := false; 276 | LangSymbol := ''; 277 | 278 | end; 279 | 280 | procedure TfrmAddLanguage.FormShow(Sender : TObject); 281 | begin 282 | HandleFormSettings( sdLoad ); 283 | end; 284 | 285 | 286 | procedure TfrmAddLanguage.HandleFormSettings( TheType : TSettingsDirective ); 287 | var 288 | i : Integer; 289 | theValue : string; 290 | begin 291 | theValue := ''; 292 | i := -1; 293 | 294 | case TheType of 295 | sdSave : 296 | begin 297 | FormSettings.AddSetting( inttoStr( Height ) ); 298 | FormSettings.AddSetting( inttoStr( Width ) ); 299 | FormSettings.AddSetting( FLastFolder ); 300 | 301 | FormSettings.SaveFormSettings( Self.Name ); 302 | 303 | end; 304 | sdLoad : 305 | begin 306 | 307 | While FormSettings.ReadFormSettings( Self.Name, i, theValue ) do 308 | case i of 309 | 0 : Height := strtoint( theValue ); 310 | 1 : Width := strtoint( theValue ); 311 | 2 : FLastFolder := theValue; 312 | end; 313 | 314 | end; 315 | 316 | end; 317 | 318 | end; 319 | 320 | end. 321 | 322 | --------------------------------------------------------------------------------