Develop and Download Open Source Software

Browse CVS Repository

Diff of /gikonavigoeson/gikonavi/Giko.pas

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.169 by h677, Tue Dec 2 09:39:20 2003 UTC revision 1.170 by h677, Wed Dec 3 14:00:21 2003 UTC
# Line 14  uses Line 14  uses
14  {$IFEND}  {$IFEND}
15          IdHTTP, ActiveX, Clipbrd, Buttons, ToolWin, {HTTPApp,} YofUtils, IdComponent,          IdHTTP, ActiveX, Clipbrd, Buttons, ToolWin, {HTTPApp,} YofUtils, IdComponent,
16          ShellAPI, ImgList, ActnList, UrlMon, Tabs, IdGlobal, StrUtils,          ShellAPI, ImgList, ActnList, UrlMon, Tabs, IdGlobal, StrUtils,
17          CommCtrl, IniFiles,          CommCtrl, IniFiles, Dialogs,
18          GikoSystem, GikoUtil, Setting, BoardGroup, ThreadControl, ItemDownload,          GikoSystem, GikoUtil, Setting, BoardGroup, ThreadControl, ItemDownload,
19          Editor, RoundData, RoundName, KeySetting, GikoPanel, Favorite, FavoriteAdd,          Editor, RoundData, RoundName, KeySetting, GikoPanel, Favorite, FavoriteAdd,
20          FavoriteArrange, AddressHistory, Preview, HTMLDocumentEvent, Kotehan,          FavoriteArrange, AddressHistory, Preview, HTMLDocumentEvent, Kotehan,
21          HintWindow, GikoCoolBar, GikoListView, ToolBarSetting, ToolBarUtil,          HintWindow, GikoCoolBar, GikoListView, ToolBarSetting, ToolBarUtil,
22          IndividualAbon, Dialogs, Search, ExternalBoardManager, ExternalBoardPlugInMain,          IndividualAbon, Search, ExternalBoardManager, ExternalBoardPlugInMain,
23          StdActns, GikoXMLDoc;          StdActns, GikoXMLDoc;
24    
25  type  type
# Line 1237  begin Line 1237  begin
1237                          Animate.FileName := FileName;                          Animate.FileName := FileName;
1238          except          except
1239          end;          end;
 //      AnimePanel.Height := 26;  
 //      AnimePanel.Width := 39;  
 //      AnimePanel.Top := 2;  
 //      AnimePanel.Left := Width - 48;  
1240    
1241          //クッキー          //クッキー
1242          FNameCookie := '';          FNameCookie := '';
# Line 1288  begin Line 1284  begin
1284                                  BrowserMinAction.ImageIndex := TOOL_ICON_WIDTH_MIN;                                  BrowserMinAction.ImageIndex := TOOL_ICON_WIDTH_MIN;
1285                          end;                          end;
1286                  end;                  end;
 //              if GikoSys.Setting.ListWidthMax then begin  
 //                      ViewPanel.Width := 1;  
 //                      BrowserSizeAction.ImageIndex := ICON_WIDTH_MIN;  
 //              end else begin  
 //                      ViewPanel.Width := GikoSys.Setting.ListWidth;  
 //                      BrowserSizeAction.ImageIndex := ICON_WIDTH_MAX;  
 //              end;  
1287          end else begin          end else begin
1288                  case GikoSys.Setting.ListHeightState of                  case GikoSys.Setting.ListHeightState of
1289                          glsMax: begin                          glsMax: begin
# Line 1313  begin Line 1302  begin
1302                                  BrowserMinAction.ImageIndex := TOOL_ICON_HEIGHT_MIN;                                  BrowserMinAction.ImageIndex := TOOL_ICON_HEIGHT_MIN;
1303                          end;                          end;
1304                  end;                  end;
 //              if GikoSys.Setting.ListHeightState = glsMax then begin  
 //              end else begin  
 //                      ViewPanel.Height := GikoSys.Setting.ListHeight;  
 //                      BrowserSizeAction.ImageIndex := ICON_HEIGHT_MAX;  
 //              end;  
1305          end;          end;
1306    
1307          //プログレスバーの初期化          //プログレスバーの初期化
# Line 1329  begin Line 1313  begin
1313          ProgressBar.Height := StatusBar.Height - 2;          ProgressBar.Height := StatusBar.Height - 2;
1314          ProgressBar.Position := 0;          ProgressBar.Position := 0;
1315    
         //ツールバー表示  
         //formshow()に移動  
   
         //ダウンロードオブジェクト  
 //      FDownload := TDownload.Create;  
 //      FDownload.OnDownloadEnd := OnDonloadEnd;  
 //      FDownload.OnWork := Work;  
 //      FDownload.OnWorkBegin := WorkBegin;  
 //      FDownload.OnWorkEnd := WorkEnd;  
   
1316          //ダウンロードオブジェクト          //ダウンロードオブジェクト
1317          FControlThread := TThreadControl.Create(True);          FControlThread := TThreadControl.Create(True);
1318          FControlThread.MaxThreadCount := 1;          FControlThread.MaxThreadCount := 1;
# Line 1360  begin Line 1334  begin
1334          BrowserNameLabel.Caption := '';          BrowserNameLabel.Caption := '';
1335          FWorkCount := 0;          FWorkCount := 0;
1336    
 //      DetailIconAction.Execute;  
   
 //      FBrowserSizeHeight := ViewPanel.Height;  
1337          FTabHintIndex := -1;          FTabHintIndex := -1;
1338    
         //ログフォルダが存在しない場合は作成する  
 //      if not GikoSys.DirectoryExistsEx(BBS2ch.GetLogFolder) then begin  
 //              GikoSys.ForceDirectoriesEx(BBS2ch.GetLogFolder);  
 //      end;  
 //      FormResize(Sender);  
 //      MainCoolBarResize(Sender);  
 //      Application.ProcessMessages;  
   
1339          //リンクバー          //リンクバー
1340          SetLinkBar;          SetLinkBar;
1341    
# Line 1569  begin Line 1532  begin
1532          end;          end;
1533    
1534  end;  end;
 {  
 procedure TGikoForm.SetStdToolBar;  
 var  
         i: Integer;  
         FileName: string;  
         ini: TMemIniFile;  
         s: string;  
         Action: TContainedAction;  
         ToolButton: TToolButton;  
 begin  
         exit;  
         for i := StdToolBar.ButtonCount - 1 downto 0 do begin  
                 StdToolBar.RemoveControl(StdToolBar.Buttons[i]);  
                 //StdToolBar.Buttons[i].Free;  
         end;  
         FileName := GikoSys.GetConfigDir + 'ToolBar.ini';  
         ini := TMemIniFile.Create(FileName);  
         i := 0;  
         while true do begin  
                 s := ini.ReadString('StdToolBar', IntToStr(i), '');  
                 if s = '' then  
                         Break;  
                 if s = '-' then begin  
                         ToolButton := TToolButton.Create(StdToolBar);  
                         ToolButton.Style := tbsSeparator;  
                         ToolButton.Width := 8;  
                         ToolButton.Left := 10000;  
                         StdToolBar.InsertControl(ToolButton);  
                 end else begin  
                         Action := GetAction(s);  
                         if Action <> nil then begin  
                                 ToolButton := TToolButton.Create(StdToolBar);  
                                 ToolButton.Action := Action;  
                                 ToolButton.Left := 10000;  
                                 StdToolBar.InsertControl(ToolButton);  
                         end;  
                 end;  
                 Inc(i);  
         end;  
 end;  
 }  
 {function TGikoForm.GetAction(ActionName: string): TContainedAction;  
 var  
         i: Integer;  
 begin  
         for i := 0 to ActionList.ActionCount - 1 do begin  
                 if ActionList.Actions[i].Name = ActionName then begin  
                         Result := ActionList.Actions[i];  
                         Exit;  
                 end;  
         end;  
         Result := nil;  
 end;}  
   
1535  procedure TGikoForm.FormCloseQuery(Sender: TObject; var CanClose: Boolean);  procedure TGikoForm.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
1536  var  var
1537          i: Integer;          i: Integer;
# Line 1757  begin Line 1666  begin
1666          end;          end;
1667    
1668          //TreeViewクリア(BBS2ch.Freeの後にクリアするとXPスタイル時にエラー出る)          //TreeViewクリア(BBS2ch.Freeの後にクリアするとXPスタイル時にエラー出る)
1669          Sleep(10);          //Sleep(10);
1670        Application.ProcessMessages;
1671          try          try
1672                  TreeView.Items.Clear;                  TreeView.Items.Clear;
1673          except          except
# Line 1821  begin Line 1731  begin
1731  end;  end;
1732    
1733  procedure TGikoForm.FormDestroy(Sender: TObject);  procedure TGikoForm.FormDestroy(Sender: TObject);
 //var  
 //      wp: TWindowPlacement;  
1734  begin  begin
 {       //ヒストリリスト  
         FHistoryList.Free;  
   
         //最大化・ウィンドウ位置保存  
         wp.length := sizeof(wp);  
         GetWindowPlacement(Handle, @wp);  
   
         GikoSys.Setting.WindowTop := wp.rcNormalPosition.Top;  
         GikoSys.Setting.WindowLeft := wp.rcNormalPosition.Left;  
         GikoSys.Setting.WindowHeight := wp.rcNormalPosition.Bottom - wp.rcNormalPosition.Top;  
         GikoSys.Setting.WindowWidth := wp.rcNormalPosition.Right - wp.rcNormalPosition.Left;  
         GikoSys.Setting.WindowMax := WindowState = wsMaximized;  
   
         GikoSys.Setting.CabinetVisible := CabinetPanel.Visible;  
         GikoSys.Setting.CabinetWidth := CabinetPanel.Width;  
   
         GikoSys.Setting.WriteWindowSettingFile;  
         GikoSys.Setting.WriteNameMailSettingFile;  
         FDownload.Free;  
         BBS2ch.Free;}  
1735  end;  end;
1736    
1737  //フォームクローズ  //フォームクローズ
# Line 2210  var Line 2098  var
2098          Board: TBoard;          Board: TBoard;
2099          ThreadItem: TThreadItem;          ThreadItem: TThreadItem;
2100          RepStr: string;          RepStr: string;
2101        ActivListObj : TObject;
2102  begin  begin
2103          if ActiveList is TBBS then begin      ActivListObj := ActiveList;
2104                  BBS := TBBS(ActiveList);          if ActivListObj is TBBS then begin
2105                    BBS := TBBS(ActivListObj);
2106    
2107                  ListView.StateImages := nil;                  ListView.StateImages := nil;
2108    
# Line 2234  begin Line 2124  begin
2124    
2125                  Item.ImageIndex := ITEM_ICON_CATEGORY1;                  Item.ImageIndex := ITEM_ICON_CATEGORY1;
2126                  Item.Data := Category;                  Item.Data := Category;
2127          end else if ActiveList is TCategory then begin          end else if ActivListObj is TCategory then begin
2128                  Category := TCategory(ActiveList);                  Category := TCategory(ActivListObj);
2129    
2130                  ListView.StateImages := nil;                  ListView.StateImages := nil;
2131    
# Line 2273  begin Line 2163  begin
2163                  end else                  end else
2164                          Item.SubItems[1] := FormatDateTime('yyyy/mm/dd hh:mm:ss', Board.RoundDate);                          Item.SubItems[1] := FormatDateTime('yyyy/mm/dd hh:mm:ss', Board.RoundDate);
2165                  Item.Data := Board;                  Item.Data := Board;
2166          end else if ActiveList is TBoard then begin          end else if ActivListObj is TBoard then begin
2167                  Board := TBoard(ActiveList);                  Board := TBoard(ActivListObj);
2168    
2169                  if GikoSys.Setting.ListIconVisible then                  if GikoSys.Setting.ListIconVisible then
2170                          ListView.StateImages := StateIconImageList                          ListView.StateImages := StateIconImageList
# Line 2490  begin Line 2380  begin
2380                          if Pos('about:blank..', URL) = 1 then begin                          if Pos('about:blank..', URL) = 1 then begin
2381                  threadItem := GetActiveContent;                  threadItem := GetActiveContent;
2382                  URL := Copy(threadItem.URL, 1,  LastDelimiter('/',threadItem.URL));                  URL := Copy(threadItem.URL, 1,  LastDelimiter('/',threadItem.URL));
2383                  buf := Copy(Text,LastDelimiter('/',Text)+1,Length(Text)-LastDelimiter('/',Text));                  if AnsiPos('http://jbbs.shitaraba.com/', URL) <> 0 then begin
2384                        Gikosys.GetPopupResNumber(Text,PathRec.FSt,PathRec.FTo);
2385                        if ( PathRec.FSt <> 0 ) and ( PathRec.FTo <> 0 ) then
2386                            buf := IntToStr(PathRec.FSt) + '-' + IntToStr(PathRec.FTo)
2387                        else if( PathRec.FSt <> 0 ) then
2388                            buf := IntToStr(PathRec.FSt);
2389                    end else
2390                            buf := Copy(Text,LastDelimiter('/',Text)+1,Length(Text)-LastDelimiter('/',Text));
2391                  URL := URL + buf;                  URL := URL + buf;
                                 //URL := StringReplace( URL, 'about:blank..', 'http://www.2ch.net', [] );  
   
2392              end;              end;
2393              PathRec := Gikosys.Parse2chURL2(URL);              PathRec := Gikosys.Parse2chURL2(URL);
2394              if (AnsiPos('&st=', URL ) <> 0) and ( AnsiPos( '&to=',URL) <> 0 ) then begin              Gikosys.GetPopupResNumber(URL,PathRec.FSt,PathRec.FTo);
                 try  
                         PathRec.FSt := StrToInt( Copy( URL, AnsiPos('&st=', URL ) + 4, AnsiPos( '&to=',URL) - AnsiPos('&st=', URL ) - 4 ) );  
                     if AnsiPos( '&nofirst=',URL) <> 0 then begin  
                         buf := Copy( URL, AnsiPos('&to=', URL ) + 4, AnsiPos( '&nofirst=',URL) - AnsiPos('&to=', URL ) - 4);  
                     end else begin  
                         buf := Copy( URL, AnsiPos('&to=', URL ) + 4, Length( URL ) - AnsiPos('&to=', URL ) - 4 + 1 );  
                         ps := 0;  
                         pch := PChar(buf);  
                         while  ( ps < Length(buf) )and ( pch[ps] >= '0' ) and ( pch[ps] <= '9' ) do Inc(ps);  
                         buf := Copy( buf, 1, ps );  
                     end;  
                     try  
                         if buf <> '' then  
                                 PathRec.FTo := StrToInt(buf);  
                     except  
                         PathRec.FTo := 0;  
                     end;  
                 except  
                         PathRec.FSt := 0;  
                 end;  
             end else if( AnsiPos('&res=', URL ) <> 0 ) then begin  
                 PathRec.FTo := 0;  
                     buf := Copy( URL, AnsiPos('&res=', URL ) + 5, Length( URL ) - AnsiPos('&res=', URL ) - 5 + 1 );  
                 ps := 0;  
                 pch := PChar(buf);  
                 while  ( ps < Length(buf) )and ( pch[ps] >= '0' ) and ( pch[ps] <= '9' ) do Inc(ps);  
                 buf := Copy( buf, 1, ps );  
                 try  
                         if buf <> '' then  
                                 PathRec.FSt := StrToInt(buf)  
                     else  
                         PathRec.FSt := 0;  
                 except  
                         PathRec.FSt := 0;  
                 end;  
             end;  
   
2395                          GikoSys.ParseURI( URL, Protocol, Host, Path, Document, Port, Bookmark );                          GikoSys.ParseURI( URL, Protocol, Host, Path, Document, Port, Bookmark );
2396    
2397                          if PathRec.FDone or (not GikoSys.Is2chHost( Host )) then begin                          if PathRec.FDone or (not GikoSys.Is2chHost( Host )) then begin
# Line 2568  begin Line 2426  begin
2426                                  ATitle := ActiveFileName <> PathRec.FKey;                                  ATitle := ActiveFileName <> PathRec.FKey;
2427    
2428                                  threadItem := BBSsFindThreadFromURL( URL );                                  threadItem := BBSsFindThreadFromURL( URL );
2429    
2430                                  if (threadItem = nil) and GikoSys.Is2chHost( Host ) then begin                                  if (threadItem = nil) and GikoSys.Is2chHost( Host ) then begin
2431                                          board := BBSs[ 0 ].FindBBSID( PathRec.FBBS );                                          board := BBSs[ 0 ].FindBBSID( PathRec.FBBS );
2432                                          if board <> nil then                                          if board <> nil then
2433                                                  threadItem := board.Find( PathRec.FKey + '.dat' );                                                  threadItem := board.Find( PathRec.FKey + '.dat' );
2434    
2435                                  end;                                  end;
2436                    
2437                                  if threadItem <> nil then begin                                  if threadItem <> nil then begin
2438                                          //HintData := GetThreadText(PathRec.FBBS, PathRec.FKey, wkIntSt, wkIntTo, ATitle, PathRec.FFirst);                                          //HintData := GetThreadText(PathRec.FBBS, PathRec.FKey, wkIntSt, wkIntTo, ATitle, PathRec.FFirst);
2439                                          FHint.PopupType := gptThread;                                          FHint.PopupType := gptThread;
# Line 3743  begin Line 3602  begin
3602    
3603          CabinetBBSAction.Checked := False;          CabinetBBSAction.Checked := False;
3604          CabinetFavoriteAction.Checked := False;          CabinetFavoriteAction.Checked := False;
3605            
3606          if FTreeType <> gttHistory then begin          if FTreeType <> gttHistory then begin
3607                  b := CabinetSelectPopupMenu.Items.Count - 1;                  b := CabinetSelectPopupMenu.Items.Count - 1;
3608                  for i := 0 to b do begin                  for i := 0 to b do begin
# Line 4809  end; Line 4668  end;
4668  procedure TGikoForm.ListViewSelectItem(Sender: TObject; Item: TListItem;  procedure TGikoForm.ListViewSelectItem(Sender: TObject; Item: TListItem;
4669          Selected: Boolean);          Selected: Boolean);
4670  begin  begin
4671          SelectTimer.Enabled := False;          //SelectTimer.Enabled := False;
4672          if Selected then          //if Selected then
4673                  SelectTimer.Enabled := True;          //      SelectTimer.Enabled := True;
4674        SelectTimer.Enabled := Selected;
4675    
4676          {          {
4677          if ListView.Selected = nil then          if ListView.Selected = nil then
# Line 6264  begin Line 6124  begin
6124  end;  end;
6125    
6126  procedure TGikoForm.MoveToURL(URL: string);  procedure TGikoForm.MoveToURL(URL: string);
6127    
6128  var  var
6129          protocol, host, path, document, port, bookmark : string;          protocol, host, path, document, port, bookmark : string;
6130          BBSID, BBSKey: string;          BBSID, BBSKey: string;
# Line 6278  var Line 6139  var
6139          shiftDown                       : Boolean;          shiftDown                       : Boolean;
6140          ctrlDown                        : Boolean;          ctrlDown                        : Boolean;
6141  begin  begin
   
6142          //===== プラグイン          //===== プラグイン
6143          try          try
6144            //作業中//
6145                  bi := High( BoardPlugIns );                  bi := High( BoardPlugIns );
6146                  for i := Low( BoardPlugIns ) to bi do begin                  for i := Low( BoardPlugIns ) to bi do begin
6147                          if Assigned( Pointer( BoardPlugIns[ i ].Module ) ) then begin                          if Assigned( Pointer( BoardPlugIns[ i ].Module ) ) then begin
# Line 6292  begin Line 6153  begin
6153                                                  Board                           := BBSsFindBoardFromURL( boardURL );                                                  Board                           := BBSsFindBoardFromURL( boardURL );
6154                                                  if Board = nil then begin                                                  if Board = nil then begin
6155                                                          // ※作っても追加するところが無いので激しく保留                                                          // ※作っても追加するところが無いので激しく保留
6156                                                          GikoSys.OpenBrowser(URL, gbtUserApp);                                                          //GikoSys.OpenBrowser(URL, gbtUserApp);
6157                                                          Exit;                                                          //Exit;
6158                                                          {                                                          {
6159                                                          Board := GikoSys.GetUnknownBoard( tmpThread.BoardPlugIn, boardURL );                                                          Board := GikoSys.GetUnknownBoard( tmpThread.BoardPlugIn, boardURL );
6160                                                          if (FTreeType = gtt2ch) and (FActiveBBS = BBSs[ 1 ]) then                                                          if (FTreeType = gtt2ch) and (FActiveBBS = BBSs[ 1 ]) then
6161                                                                  ShowBBSTree( BBSs[ 1 ] );                                                                  ShowBBSTree( BBSs[ 1 ] );
6162                                                          }                                                          }
6163                                                  end else begin                                                  end else begin
6164                                                          if not Board.IsThreadDatRead then                                                          if not Board.IsThreadDatRead then begin
6165                                                                  GikoSys.ReadSubjectFile( Board );                                                                  GikoSys.ReadSubjectFile( Board );
6166                                        Exit;
6167                                end;
6168                                                  end;                                                  end;
6169    
6170                                                  ThreadItem := Board.Find( tmpThread.FileName );                                                  ThreadItem := Board.Find( tmpThread.FileName );
# Line 6314  begin Line 6177  begin
6177                                                          end;                                                          end;
6178                                                          InsertBrowserTab( ThreadItem );                                                          InsertBrowserTab( ThreadItem );
6179                                                          DownloadContent( ThreadItem );                                                          DownloadContent( ThreadItem );
6180                                Exit;
6181                                                  end else begin                                                  end else begin
6182                                                          tmpThread.Free;                                                          tmpThread.Free;
6183                                                          InsertBrowserTab( ThreadItem );                                                          InsertBrowserTab( ThreadItem );
6184                                                          if not ThreadItem.IsLogFile then                                                          if not ThreadItem.IsLogFile then begin
6185                                                                  DownloadContent( ThreadItem );                                                                  DownloadContent( ThreadItem );
6186                                    Exit;
6187                                end;
6188    
6189                                                  end;                                                  end;
6190    
6191                                                  Exit;                                                  //Exit;
6192                                          end;                                          end;
6193    
6194                                  atBoard:                                  atBoard:
# Line 6752  begin Line 6619  begin
6619                                  Body := CustomStringReplace(Body, '&gt;', '>');                                  Body := CustomStringReplace(Body, '&gt;', '>');
6620                                  Body := CustomStringReplace(Body, '&quot;', '"');                                  Body := CustomStringReplace(Body, '&quot;', '"');
6621                                  Body := CustomStringReplace(Body, '&amp;', '&');                                  Body := CustomStringReplace(Body, '&amp;', '&');
6622                    Body := CustomStringReplace(Body, '&nbsp;', ' ');
6623                                  FHint.Add(Header, Body);                                  FHint.Add(Header, Body);
6624  //                                                      s := StringReplace(s, '&amp', '&', [rfReplaceAll]);  //                                                      s := StringReplace(s, '&amp', '&', [rfReplaceAll]);
6625  //                                                      s := StringReplace(s, '@`', ',', [rfReplaceAll]);  //                                                      s := StringReplace(s, '@`', ',', [rfReplaceAll]);

Legend:
Removed from v.1.169  
changed lines
  Added in v.1.170

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26