Ignore:
Timestamp:
Jan 16, 2007, 12:35:04 AM (18 years ago)
Author:
alloc
Message:

Rev86 was first after multi-cons

File:
1 edited

Legend:

Unmodified
Added
Removed
  • oup/current/Tools/Template.pas

    r87 r92  
    4444    procedure RecreateExtList;
    4545    procedure LoadFileNames;
    46     procedure SelectFileName(filename: String);
    47     procedure SelectFileID(id: Integer);
     46    procedure SelectFileName(connection: TOniData; filename: String);
     47    procedure SelectFileID(connection: TOniData; id: Integer);
    4848    procedure check_filternameClick(Sender: TObject);
    4949    procedure check_zerobyteClick(Sender: TObject);
     
    285285  id := FConnection.ExtractFileID(filelist.Items.Strings[filelist.ItemIndex]);
    286286  context := MidStr(sender_name, Pos('_', sender_name) + 1, Length(sender_name) - Pos('_', sender_name));
    287   Form_Main.open_child(context, id);
     287  Form_Main.open_child(context, FConnection, id);
    288288end;
    289289
     
    415415
    416416
    417 procedure TForm_ToolTemplate.SelectFileID(id: Integer);
    418 var
    419   i: Integer;
    420 begin
     417procedure TForm_ToolTemplate.SelectFileID(connection: TOniData; id: Integer);
     418var
     419  i: Integer;
     420  name: String;
     421  nstart, nend: Integer;
     422begin
     423  for i := 0 to combo_connection.Items.Count - 1 do
     424  begin
     425    name := combo_connection.Items.Strings[i];
     426    nstart := Pos(' ', name) + 1;
     427    nend := Pos('(', name) - 1;
     428    name := MidStr(name, nstart, nend - nstart);
     429
     430    if ExtractFileName(connection.FileName) = name then
     431    begin
     432      combo_connection.ItemIndex := i;
     433      combo_connectionChange(Self);
     434    end;
     435  end;
     436
    421437  filelist.ItemIndex := -1;
    422438  if filelist.Items.Count > 0 then
     
    430446end;
    431447
    432 procedure TForm_ToolTemplate.SelectFileName(filename: String);
    433 var
    434   i: Integer;
    435 begin
     448procedure TForm_ToolTemplate.SelectFileName(connection: TOniData; filename: String);
     449var
     450  i: Integer;
     451  name: String;
     452  nstart, nend: Integer;
     453begin
     454  for i := 0 to combo_connection.Items.Count - 1 do
     455  begin
     456    name := combo_connection.Items.Strings[i];
     457    nstart := Pos(' ', name) + 1;
     458    nend := Pos('(', name) - 1;
     459    name := MidStr(name, nstart, nend - nstart);
     460
     461    if ExtractFileName(connection.FileName) = name then
     462    begin
     463      combo_connection.ItemIndex := i;
     464      combo_connectionChange(Self);
     465    end;
     466  end;
     467
    436468  filelist.ItemIndex := -1;
    437469  if filelist.Items.Count > 0 then
Note: See TracChangeset for help on using the changeset viewer.