ViewVC Help
View File | Revision Log | View Changeset | Root Listing
root/Oni2/oup/current/Tools/Template.pas
(Generate patch)

Comparing:
oup/rewrite/Tools/Template.pas (file contents), Revision 101 by alloc, Tue Feb 20 20:43:29 2007 UTC vs.
oup/current/Tools/Template.pas (file contents), Revision 113 by alloc, Sun Feb 25 17:20:22 2007 UTC

# Line 40 | Line 40 | type
40      Label3: TLabel;
41      combo_connection: TComboBox;
42      Bevel1: TBevel;
43 +    popup_linkshere: TMenuItem;
44 +    popup_separator2: TMenuItem;
45      procedure RecreateExtList;
46      procedure UpdateConList;
47      procedure LoadFileNames;
# Line 61 | Line 63 | type
63      procedure btn_sortClick(Sender: TObject);
64      procedure FormActivate(Sender: TObject);
65      procedure combo_connectionChange(Sender: TObject);
66 +    procedure popup_linkshereClick(Sender: TObject);
67    private
68      FSortBy: TSortType;
69      FOnNewFileSelected: TNewFileSelectedEvent;
# Line 93 | Line 96 | procedure AddToolListEntry(context, name
96  
97   implementation
98   {$R *.dfm}
99 < uses Main, ConnectionManager, Exporters, Functions;
99 > uses Main, ConnectionManager, Exporters, Functions, WhatLinksHere;
100  
101  
102   procedure TForm_ToolTemplate.UpdateConList;
# Line 116 | Line 119 | begin
119          datatype := 'OUP-DB: '
120        else
121          datatype := 'Unknown: ';
122 <      boxstring := datatype + fn + ' (Level: ' + IntToStr(level) + ')';
122 >      boxstring := datatype + fn + ' (Level: ' + IntToStr(level) + ') [' + IntToStr(ConManager.ConnectionByIndex[i].ConnectionID) + ']';
123        combo_connection.Items.Add(boxstring);
124        if ConManager.ConnectionByIndex[i].ConnectionID = FConnectionID then
125          combo_connection.ItemIndex := combo_connection.Items.Count - 1;
# Line 149 | Line 152 | begin
152    begin
153      combo_extension.Items.Add('_All files_ (' +
154        IntToStr(ConManager.Connection[FConnectionID].GetFileCount) + ')');
155 +    exts := nil;
156      exts := ConManager.Connection[FConnectionID].GetExtensionsList(EF_ExtCount);
157      for i := 0 to exts.Count - 1 do
158        if Length(FAllowedExts) > 0 then
# Line 173 | Line 177 | var
177    no_zero_bytes: Boolean;
178    pattern: String;
179    files: TStrings;
176  i: Integer;
180   begin
181    if FConnectionID > -1 then
182    begin
# Line 188 | Line 191 | begin
191        else
192          Extension := '';
193  
194 +    files := nil;
195      files := ConManager.Connection[FConnectionID].GetFilesList(extension, pattern, no_zero_bytes, FSortBy);
196  
197      filelist.Visible := False;
# Line 257 | Line 261 | begin
261    end;
262   end;
263  
264 + procedure TForm_ToolTemplate.popup_linkshereClick(Sender: TObject);
265 + begin
266 +  Form_WhatLinksHere.ConID := FConnectionID;
267 +  Form_WhatLinksHere.FileID := FSelectedFile.ID;
268 +  Form_WhatLinksHere.SenderForm := Self;
269 +  Form_WhatLinksHere.Show;
270 + end;
271 +
272   procedure TForm_ToolTemplate.popup_opentool(Sender: TObject);
273   var
274    sender_name, context: String;
# Line 271 | Line 283 | end;
283   procedure TForm_ToolTemplate.combo_connectionChange(Sender: TObject);
284   var
285    name: String;
274  nstart, nend: Integer;
275  i: Integer;
286   begin
287    if combo_connection.ItemIndex >= 0 then
288 <    FConnectionID := combo_connection.ItemIndex
288 >  begin
289 >    name := combo_connection.Items.Strings[combo_connection.ItemIndex];
290 >    FConnectionID := StrToInt(MidStr(name, Pos('[', name) + 1, Pos(']', name) - Pos('[', name)  - 1));
291 >  end
292    else
293      FConnectionID := -1;
294    RecreateExtList;
# Line 331 | Line 344 | begin
344        if Pos(ext, ToolList[i].exts) = 0 then
345          filepopup.Items.Items[i].Enabled := False;
346    end;
347 +  filepopup.Items.Find('What links here?').Enabled :=
348 +      ConManager.Connection[FConnectionID].Backend = DB_ADB;
349   end;
350  
351   procedure TForm_ToolTemplate.check_zerobyteClick(Sender: TObject);
# Line 382 | Line 397 | var
397   begin
398    pt.X := x;
399    pt.Y := y;
400 < //  filelist.ItemIndex := filelist.ItemAtPos(pt, true);
401 < //  Self.listClick(Self);
400 >  if Shift = [ssRight] then
401 >  begin
402 >    filelist.ItemIndex := filelist.ItemAtPos(pt, true);
403 >    Self.listClick(Self);
404 >  end;
405   end;
406  
407  

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)