Changeset 11
- Timestamp:
- May 3, 2014, 12:09:24 AM (11 years ago)
- Location:
- trunk
- Files:
-
- 36 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LinuxBuilder.lpi
r6 r11 28 28 </local> 29 29 </RunParams> 30 <RequiredPackages Count=" 1">30 <RequiredPackages Count="2"> 31 31 <Item1> 32 <PackageName Value="Common"/> 33 <DefaultFilename Value="Packages/Common/Common.lpk" Prefer="True"/> 34 </Item1> 35 <Item2> 32 36 <PackageName Value="LCL"/> 33 </Item 1>37 </Item2> 34 38 </RequiredPackages> 35 39 <Units Count="7"> … … 80 84 <IsPartOfProject Value="True"/> 81 85 <ComponentName Value="FormSearch"/> 86 <HasResources Value="True"/> 82 87 <ResourceBaseClass Value="Form"/> 83 88 <UnitName Value="UFormSearch"/> -
trunk/LinuxBuilder.lpr
r6 r11 8 8 {$ENDIF}{$ENDIF} 9 9 Interfaces, // this includes the LCL widgetset 10 Forms, UFormMain, UKConfig, UFormList, UFormLog, UFormCompare, UFormSearch 10 Forms, UFormMain, UKConfig, UFormList, UFormLog, UFormCompare, UFormSearch, 11 Common 11 12 { you can add units after this }; 12 13 -
trunk/UFormMain.lfm
r6 r11 9 9 ClientWidth = 857 10 10 Menu = MainMenu1 11 OnClose = FormClose 11 12 OnCreate = FormCreate 12 13 OnDestroy = FormDestroy … … 85 86 object MainMenu1: TMainMenu 86 87 Images = ImageList1 87 left = 32088 top = 7288 left = 280 89 top = 112 89 90 object MenuItem1: TMenuItem 90 91 Caption = 'File' … … 128 129 } 129 130 end 131 object MenuItemOpenRecent: TMenuItem 132 Caption = 'Open recent' 133 OnClick = MenuItemOpenRecentClick 134 end 130 135 object MenuItem7: TMenuItem 131 136 Action = ACompare 137 end 138 object MenuItem9: TMenuItem 139 Caption = '-' 140 end 141 object MenuItem10: TMenuItem 142 Caption = 'Exit' 132 143 end 133 144 end … … 258 269 object ActionList1: TActionList 259 270 Images = ImageList1 260 left = 2 40261 top = 2 64271 left = 280 272 top = 256 262 273 object AOpenDir: TAction 263 274 Caption = 'Open directory' … … 457 468 } 458 469 end 470 object LastOpenedList1: TLastOpenedList 471 MaxCount = 10 472 OnChange = LastOpenedList1Change 473 left = 144 474 top = 160 475 end 459 476 end -
trunk/UFormMain.pas
r8 r11 7 7 uses 8 8 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, Menus, 9 ActnList, ComCtrls, StdCtrls, UKConfig; 9 ActnList, ComCtrls, StdCtrls, UKConfig, ULastOpenedList, URegistry, Registry; 10 11 const 12 RootKey = HKEY_CURRENT_USER; 13 RootPath = '\Software\LinuxBuilder'; 10 14 11 15 type … … 22 26 ActionList1: TActionList; 23 27 ImageList1: TImageList; 28 LastOpenedList1: TLastOpenedList; 24 29 MainMenu1: TMainMenu; 25 30 Memo1: TMemo; 26 31 MenuItem1: TMenuItem; 32 MenuItem10: TMenuItem; 27 33 MenuItem2: TMenuItem; 28 34 MenuItem3: TMenuItem; … … 32 38 MenuItem7: TMenuItem; 33 39 MenuItem8: TMenuItem; 40 MenuItem9: TMenuItem; 41 MenuItemOpenRecent: TMenuItem; 34 42 StatusBar1: TStatusBar; 35 43 ToolBar1: TToolBar; … … 45 53 procedure AShowLogExecute(Sender: TObject); 46 54 procedure AViemSystemExecute(Sender: TObject); 55 procedure FormClose(Sender: TObject; var CloseAction: TCloseAction); 47 56 procedure FormCreate(Sender: TObject); 48 57 procedure FormDestroy(Sender: TObject); 49 58 procedure FormShow(Sender: TObject); 59 procedure LastOpenedList1Change(Sender: TObject); 60 procedure MenuItemOpenRecentClick(Sender: TObject); 50 61 procedure TreeView1SelectionChanged(Sender: TObject); 51 62 private 52 63 procedure DoLog(Text: string); 64 procedure OpenDir(Dir: string); 53 65 public 66 AutoOpen: Boolean; 54 67 Config: TConfigMenu; 55 68 procedure Reload; … … 71 84 procedure TFormMain.FormShow(Sender: TObject); 72 85 begin 73 Config.LoadFromDir('/home/jha/Projekty/fpc/kernel_options/linux-3.0', 'x86'); 74 Reload; 86 AutoOpen := True; 87 LastOpenedList1.LoadFromRegistry(RegContext(RootKey, RootPath)); 88 if AutoOpen and (LastOpenedList1.Items.Count > 0) then 89 OpenDir(LastOpenedList1.Items[0]) 90 else Reload; 91 end; 92 93 procedure TFormMain.LastOpenedList1Change(Sender: TObject); 94 begin 95 LastOpenedList1.LoadToMenuItem(MenuItemOpenRecent, AOpenDirExecute); 96 end; 97 98 procedure TFormMain.MenuItemOpenRecentClick(Sender: TObject); 99 begin 100 75 101 end; 76 102 … … 89 115 end; 90 116 117 procedure TFormMain.OpenDir(Dir: string); 118 begin 119 Config.LoadFromDir(Dir); 120 LastOpenedList1.AddItem(Dir); 121 Reload; 122 end; 123 91 124 procedure TFormMain.Reload; 92 125 var … … 94 127 begin 95 128 TreeView1.Items.Clear; 96 TreeView1.Items.AddChild(nil, Config.TopNode.GetName); 97 Options := []; 98 if AViemSystem.Checked then Include(Options, toShowSystem); 99 Config.TopNode.LoadTreeNode(TreeView1.TopItem, Options); 100 TreeView1.TopItem.Expanded := True; 101 StatusBar1.Panels[0].Text := 'Count: ' + IntToStr(Config.TopNode.GetCount); 129 if Assigned(Config.TopNode) then begin 130 TreeView1.Items.AddChild(nil, Config.TopNode.GetName); 131 Options := []; 132 if AViemSystem.Checked then Include(Options, toShowSystem); 133 Config.TopNode.LoadTreeNode(TreeView1.TopItem, Options); 134 TreeView1.TopItem.Expanded := True; 135 StatusBar1.Panels[0].Text := 'Count: ' + IntToStr(Config.TopNode.GetCount); 136 end else begin 137 StatusBar1.Panels[0].Text := ''; 138 end; 102 139 end; 103 140 … … 117 154 OutDir: string; 118 155 begin 156 if Sender is TMenuItem then begin 157 OpenDir(TMenuItem(Sender).Caption); 158 end; 119 159 if SelectDirectory('Select Linux source directory', Config.BaseDir, OutDir) then begin 120 Config.LoadFromDir(OutDir, 'x86'); 121 Reload; 160 OpenDir(OutDir); 122 161 end; 123 162 end; … … 141 180 Config2 := TConfigMenu.Create; 142 181 Config.TopNode.SaveToList(List1); 143 Config2.LoadFromDir('/opt/elinos-D6.0/linux/linux-p4-3.0/' , 'p4');182 Config2.LoadFromDir('/opt/elinos-D6.0/linux/linux-p4-3.0/'); 144 183 Config2.TopNode.SaveToList(List2); 145 184 Config.CompareStringLists(List1, List2, Missing1, Missing2); … … 176 215 end; 177 216 217 procedure TFormMain.FormClose(Sender: TObject; var CloseAction: TCloseAction); 218 begin 219 LastOpenedList1.SaveToRegistry(RegContext(RootKey, RootPath)); 220 end; 221 178 222 procedure TFormMain.FormCreate(Sender: TObject); 179 223 begin -
trunk/UKConfig.pas
r10 r11 97 97 procedure CompareStringLists(List1, List2: TStringList; Missing1, 98 98 Missing2: TStrings); 99 procedure LoadFromDir(Dir: string ; Arch: string);99 procedure LoadFromDir(Dir: string); 100 100 property OnLog: TOnLogEvent read FOnLog write FOnLog; 101 101 constructor Create; … … 721 721 end; 722 722 723 procedure TConfigMenu.LoadFromDir(Dir: string ; Arch: string);723 procedure TConfigMenu.LoadFromDir(Dir: string); 724 724 var 725 725 Moves: TObjectMoves; 726 726 I: Integer; 727 727 begin 728 Self.Arch := Arch;728 Self.Arch := 'x86'; 729 729 BaseDir := Dir; 730 730 ParseMakeFile;
Note:
See TracChangeset
for help on using the changeset viewer.