Changeset 15


Ignore:
Timestamp:
May 21, 2014, 5:33:14 PM (10 years ago)
Author:
chronos
Message:
  • Added: Architecture selection through main menu item Architecture.
  • Added: In comparison show also full ID list for both configuration.
Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/UFormCompare.lfm

    r5 r15  
    11object FormCompare: TFormCompare
    2   Left = 449
     2  Left = -29
    33  Height = 996
    4   Top = 327
     4  Top = 110
    55  Width = 1520
    66  Caption = 'Compare'
     
    1313    Top = 0
    1414    Width = 1520
    15     ActivePage = TabSheet2
     15    ActivePage = TabSheet4
    1616    Align = alClient
    17     TabIndex = 1
     17    TabIndex = 3
    1818    TabOrder = 0
    1919    object TabSheet1: TTabSheet
     
    4747      end
    4848    end
     49    object TabSheet3: TTabSheet
     50      Caption = 'List 1'
     51      ClientHeight = 956
     52      ClientWidth = 1514
     53      object Memo3: TMemo
     54        Left = 0
     55        Height = 956
     56        Top = 0
     57        Width = 1514
     58        Align = alClient
     59        ReadOnly = True
     60        ScrollBars = ssAutoBoth
     61        TabOrder = 0
     62      end
     63    end
     64    object TabSheet4: TTabSheet
     65      Caption = 'List 2'
     66      ClientHeight = 956
     67      ClientWidth = 1514
     68      object Memo4: TMemo
     69        Left = 0
     70        Height = 956
     71        Top = 0
     72        Width = 1514
     73        Align = alClient
     74        ReadOnly = True
     75        ScrollBars = ssAutoBoth
     76        TabOrder = 0
     77      end
     78    end
    4979  end
    5080end
  • trunk/UFormCompare.pas

    r5 r15  
    1616    Memo1: TMemo;
    1717    Memo2: TMemo;
     18    Memo3: TMemo;
     19    Memo4: TMemo;
    1820    PageControl1: TPageControl;
    1921    TabSheet1: TTabSheet;
    2022    TabSheet2: TTabSheet;
     23    TabSheet3: TTabSheet;
     24    TabSheet4: TTabSheet;
    2125  private
    2226    { private declarations }
  • trunk/UFormMain.lfm

    r13 r15  
    158158      object MenuItem10: TMenuItem
    159159        Action = AExit
     160      end
     161    end
     162    object MenuItemArch: TMenuItem
     163      Caption = 'Architecture'
     164      object MenuItem12: TMenuItem
     165        Caption = 'New Item14'
    160166      end
    161167    end
  • trunk/UFormMain.pas

    r14 r15  
    77uses
    88  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, Menus,
    9   ActnList, ComCtrls, StdCtrls, UKConfig, ULastOpenedList, URegistry, MyRegistry;
     9  ActnList, ComCtrls, StdCtrls, UKConfig, ULastOpenedList, URegistry, MyRegistry,
     10  UFindFile;
    1011
    1112const
     
    3334    MenuItem1: TMenuItem;
    3435    MenuItem10: TMenuItem;
     36    MenuItemArch: TMenuItem;
     37    MenuItem12: TMenuItem;
    3538    MenuItemCompareRecent: TMenuItem;
    3639    MenuItem2: TMenuItem;
     
    7275    procedure OpenDir(Dir: string);
    7376    procedure CompareDir(Dir: string);
     77    procedure ReloadArch(Dir: string);
     78    procedure MenuItemArchExecute(Sender: TObject);
    7479  public
    7580    AutoOpen: Boolean;
     
    156161    FormCompare.Memo1.Lines.Assign(Missing1);
    157162    FormCompare.Memo2.Lines.Assign(Missing2);
     163    FormCompare.Memo3.Lines.Assign(List1);
     164    FormCompare.Memo4.Lines.Assign(List2);
    158165    FormCompare.Show;
    159166  finally
     
    163170    List1.Free;
    164171    List2.Free;
     172  end;
     173end;
     174
     175procedure TFormMain.ReloadArch(Dir: string);
     176var
     177  FindFile: TFindFile;
     178  List: TStringList;
     179  I: Integer;
     180  NewMenuItem: TMenuItem;
     181  DirName: string;
     182begin
     183  try
     184    FindFile := TFindFile.Create(nil);
     185    FindFile.FileAttr := [ffaDirectory];
     186    FindFile.Path := Dir;
     187    FindFile.FileMask := '*';
     188    List := FindFile.SearchForFiles;
     189    MenuItemArch.Clear;
     190    for I := 0 to List.Count - 1 do begin
     191      DirName := ExtractFileName(List[I]);
     192      if (DirName <> '..') and (DirName <> '.') and
     193        FileExists(List[I] + DirectorySeparator + 'Kconfig') then begin
     194        NewMenuItem := TMenuItem.Create(MenuItemArch);
     195        NewMenuItem.Caption := DirName;
     196        NewMenuItem.OnClick := MenuItemArchExecute;
     197        if Config.Arch = DirName then NewMenuItem.Checked := True;
     198        MenuItemArch.Add(NewMenuItem);
     199      end;
     200    end;
     201  finally
     202    FindFile.Free;
     203  end
     204end;
     205
     206procedure TFormMain.MenuItemArchExecute(Sender: TObject);
     207begin
     208  if Sender is TMenuItem then begin
     209    Config.Arch := TMenuItem(Sender).Caption;
     210    Reload;
    165211  end;
    166212end;
     
    178224    TreeView1.TopItem.Expanded := True;
    179225    StatusBar1.Panels[0].Text := 'Count: ' + IntToStr(Config.TopNode.GetCount);
     226    ReloadArch(Config.BaseDir + DirectorySeparator + 'arch');
    180227  end else begin
    181228    StatusBar1.Panels[0].Text := '';
  • trunk/UKConfig.pas

    r14 r15  
    7272    RangeMax: string;
    7373    MenuConfig: Boolean;
     74    Optional: Boolean;
    7475    constructor Create; virtual;
    7576    destructor Destroy; override;
     
    9899    CurrentMenu: TMenuNode;
    99100    ConditionStack: TStringList;
    100     Arch: string;
     101    FArch: string;
    101102    FOnLog: TOnLogEvent;
    102103    ParseFileName: string;
     
    117118    procedure ParseMakeFile;
    118119    function GetLog: string;
     120    procedure SetArch(AValue: string);
    119121  public
    120122    TopNode: TMenuNode;
     
    129131    constructor Create;
    130132    destructor Destroy; override;
     133    property Arch: string read FArch write SetArch;
    131134  end;
    132135
     
    609612begin
    610613  Result := ' ' + ParseFileName + ':' + IntToStr(LineNumber);
     614end;
     615
     616procedure TConfigMenu.SetArch(AValue: string);
     617begin
     618  if FArch = AValue then Exit;
     619  FArch := AValue;
     620  LoadFromDir(BaseDir);
    611621end;
    612622
     
    895905        //VisibleCondition := GetNextToken(Line);
    896906      end else
     907      if Command = 'optional' then begin
     908        NewItem.Optional := True;
     909      end else
    897910      if Command = 'endif' then begin
    898911        ConditionStack.Delete(ConditionStack.Count - 1);
     
    10181031  I: Integer;
    10191032begin
    1020   Self.Arch := 'x86';
    10211033  BaseDir := Dir;
    10221034  ParseMakeFile;
     
    10381050begin
    10391051  ConditionStack := TStringList.Create;
     1052  Self.FArch := 'x86';
    10401053end;
    10411054
Note: See TracChangeset for help on using the changeset viewer.