Changeset 8 for trunk


Ignore:
Timestamp:
May 2, 2014, 12:02:30 PM (11 years ago)
Author:
chronos
Message:
  • Modified: Make config group from menuconfig.
Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/UFormMain.pas

    r7 r8  
    146146    Config2.OptionListNames(Missing1);
    147147    Config.OptionListNames(Missing2);
     148    Missing1.Sort;
     149    Missing2.Sort;
    148150    FormCompare.Memo1.Lines.Assign(Missing1);
    149151    FormCompare.Memo2.Lines.Assign(Missing2);
  • trunk/UKConfig.pas

    r7 r8  
    3939    RangeMin: string;
    4040    RangeMax: string;
     41    MenuConfig: Boolean;
    4142    constructor Create; virtual;
    4243    destructor Destroy; override;
     
    99100  Selects := TStringList.Create;
    100101  Items := TObjectList.Create;
     102  MenuConfig := False;
    101103end;
    102104
     
    196198  NewMove: TObjectMove;
    197199  Index: Integer;
    198 begin
    199   if ID = 'KVM_INTEL' then
     200  P: TMenuNode;
     201begin
     202  if ID = 'EXT4_FS' then
    200203    Name := Name + '$';
    201204  NewParent := Parent;
    202   if Condition <> '' then begin
     205  P := Parent;
     206{  if Condition <> '' then begin
    203207    Index := Lookup.IndexOf(Condition);
    204208    if Index <> -1 then Node := TMenuNode(Lookup.Objects[Index])
    205209      else Node := nil;
    206     if Assigned(Node) and (NewParent <> Node) then begin
     210    if Assigned(Node) and (NewParent <> Node) and Node.MenuConfig then begin
    207211      NewParent := Node;
    208212    end;
    209   end;
     213  end;}
    210214  if Depends.Count > 0 then begin
    211215    Index := Lookup.IndexOf(Depends[0]);
     
    467471        NewItem.Condition := GetTopCondition;
    468472        CurrentMenu.Items.Add(NewItem);
     473        if Command = 'menuconfig' then NewItem.MenuConfig := True;
    469474      end else
    470475      if (Command = 'comment')  then begin
     
    493498        NewMenu.Parent := CurrentMenu;
    494499        NewMenu.Condition := GetTopCondition;
    495         ConditionStack.Add('');
     500        ConditionStack.AddObject('', nil);
    496501        NewItem := NewMenu;
    497502        CurrentMenu.Items.Add(NewMenu);
     
    517522        NewMenu.Parent := CurrentMenu;
    518523        NewMenu.Condition := GetTopCondition;
    519         ConditionStack.Add('');
     524        ConditionStack.AddObject('', nil);
    520525        NewItem := NewMenu;
    521526        CurrentMenu.Items.Add(NewMenu);
     
    530535      end else
    531536      if Command = 'if' then begin
    532         ConditionStack.Add(GetNextToken(Line));
     537        ConditionStack.AddObject(GetNextToken(Line), NewItem);
     538        if Assigned(NewItem) and NewItem.MenuConfig then begin
     539          CurrentMenu := NewItem;
     540        end;
    533541      end else
    534542      if Command = 'visible' then begin
    535543        //VisibleCondition := GetNextToken(Line);
    536544      end else
    537       if command = 'endif' then begin
     545      if Command = 'endif' then begin
     546        if Assigned(ConditionStack.Objects[ConditionStack.Count - 1]) then
     547          if TMenuNode(ConditionStack.Objects[ConditionStack.Count - 1]).MenuConfig then
     548            CurrentMenu := CurrentMenu.Parent;
    538549        ConditionStack.Delete(ConditionStack.Count - 1);
    539550      end else
     
    600611    Node := TopNode.FindNode(List[I]);
    601612    if Assigned(Node) then
    602       List[I] := List[I] + ' ' + Node.GetAbsoluteName;
     613      List[I] := Node.GetAbsoluteName + ' (' + List[I] + ')';
    603614  end;
    604615end;
Note: See TracChangeset for help on using the changeset viewer.