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.511 by h677, Sat Apr 2 03:08:05 2005 UTC revision 1.511.2.10 by h677, Thu May 19 14:50:11 2005 UTC
# Line 1255  implementation Line 1255  implementation
1255    
1256  uses  uses
1257          About, Option, Round, Splash, Sort, ListSelect, Imm,          About, Option, Round, Splash, Sort, ListSelect, Imm,
1258          NewBoard, MojuUtils, Clipbrd, GikoBayesian;          NewBoard, MojuUtils, Clipbrd, GikoBayesian,Y_TextConverter;
1259    
1260  const  const
1261          CAPTION_NAME: string = 'ギコナビ';          CAPTION_NAME: string = 'ギコナビ';
# Line 1523  begin Line 1523  begin
1523          // 外部板プラグインをロード(ReadBoardFile, LoadHistory より先に行うこと)          // 外部板プラグインをロード(ReadBoardFile, LoadHistory より先に行うこと)
1524          InitializeBoardPlugIns;          InitializeBoardPlugIns;
1525    
1526          //巡回データ読み込み  {       //巡回データ読み込み
1527          RoundList := TRoundList.Create;          RoundList := TRoundList.Create;
1528          RoundList.LoadRoundBoardFile;          RoundList.LoadRoundBoardFile;
1529    }
1530          // ボードファイル列挙(ReadFavorite より先に行うこと)          // ボードファイル列挙(ReadFavorite より先に行うこと)
1531          GikoSys.ListBoardFile;          GikoSys.ListBoardFile;
1532    
1533          RoundList.LoadRoundThreadFile;  {       RoundList.LoadRoundThreadFile;
1534    
1535          if RoundList.OldFileRead or ( RoundList.Count[grtItem] > 0 ) then          if RoundList.OldFileRead or ( RoundList.Count[grtItem] > 0 ) then
1536                  GikoSys.ListBoardFile;                  GikoSys.ListBoardFile;
1537    }
1538    
1539          // メニューに追加          // メニューに追加
1540          SetBBSMenu;          SetBBSMenu;
# Line 1757  begin Line 1758  begin
1758          FIsIgnoreResize := rtResizing;          FIsIgnoreResize := rtResizing;
1759    
1760    
1761            // すべてのBBSを読み込んでおく
1762            for i := Length(BBSs) - 1 downto 0 do begin
1763                    if not BBSs[i].IsBoardFileRead then
1764                            GikoSys.ReadBoardFile(BBSs[i]);
1765    
1766                    if SplashWindow <> nil then begin
1767                            SplashWindow.ProgressBar.StepBy(20);
1768                            Application.ProcessMessages;
1769                    end;
1770            end;
1771    
1772            //巡回データ読み込み
1773            RoundList := TRoundList.Create;
1774            RoundList.LoadRoundBoardFile;
1775            RoundList.LoadRoundThreadFile;
1776    
1777            //if RoundList.OldFileRead or ( RoundList.Count[grtItem] > 0 ) then
1778            //      GikoSys.ListBoardFile;
1779    
1780          //引数があったらスレを開く(未取得ならダウンロード)          //引数があったらスレを開く(未取得ならダウンロード)
1781          for i := 1 to ParamCount do     begin          for i := 1 to ParamCount do     begin
1782                  MoveToURL(ParamStr(i));                  MoveToURL(ParamStr(i));
# Line 1791  begin Line 1811  begin
1811          if GikoSys.Setting.GestureEnabled then          if GikoSys.Setting.GestureEnabled then
1812                  MouseGesture.SetHook( Handle );                  MouseGesture.SetHook( Handle );
1813    
1814      //2ch言語読み出し          //2ch言語読み出し
1815      GikoSys.Setting.SetMessages;      GikoSys.Setting.SetMessages;
1816      {      {
1817          //2ch言語読み出し          //2ch言語読み出し
# Line 2178  begin Line 2198  begin
2198          // TBBS は保持している TCategory, TBoard, TThreadItem すべてを開放する          // TBBS は保持している TCategory, TBoard, TThreadItem すべてを開放する
2199          // TBoard, TThreadItem のデストラクタはプラグインに破棄を伝えるので          // TBoard, TThreadItem のデストラクタはプラグインに破棄を伝えるので
2200          // BoardPluteIns の開放より先に行うこと          // BoardPluteIns の開放より先に行うこと
2201        for i := Length(BoardGroups) - 1 downto 0 do begin
2202            BoardGroups[i].Clear;
2203        end;
2204    
2205          try          try
2206                  for i := Length( BBSs ) - 1 downto 0 do begin                  for i := Length( BBSs ) - 1 downto 0 do begin
2207                          if BBSs[ i ] <> nil then                          if BBSs[ i ] <> nil then
# Line 2187  begin Line 2211  begin
2211          except          except
2212          end;          end;
2213    
2214    
2215          try          try
2216                  for i := Length( BoardPlugIns ) - 1 downto  0 do begin                  for i := Length( BoardPlugIns ) - 1 downto  0 do begin
2217                          if BoardPlugIns[ i ] <> nil then                          if BoardPlugIns[ i ] <> nil then
# Line 2294  begin Line 2319  begin
2319          ActiveList := nil;          ActiveList := nil;
2320    
2321          FTreeType := gttNone;          FTreeType := gttNone;
2322      GikoSys.FBoardURLList.Clear;      //GikoSys.FBoardURLList.Clear;
2323        for i := Length(BoardGroups) - 1 downto 0 do begin
2324            BoardGroups[i].Clear;
2325        end;
2326          GikoSys.ListBoardFile;          //ボードファイル読込          GikoSys.ListBoardFile;          //ボードファイル読込
2327    
2328          // BBS メニューの更新          // BBS メニューの更新
# Line 2314  begin Line 2342  begin
2342    
2343          SetLinkBar;          SetLinkBar;
2344    
2345            // すべてのBBSを読み込んでおく
2346            for i := Length(BBSs) - 1 downto 0 do begin
2347                    if not BBSs[i].IsBoardFileRead then
2348                            GikoSys.ReadBoardFile(BBSs[i]);
2349            end;
2350    
2351            //巡回リスト保存&破棄
2352            try
2353                    RoundList.SaveRoundFile;
2354            except
2355            end;
2356            try
2357                    RoundList.Clear;
2358            except
2359            end;
2360            RoundList.LoadRoundBoardFile;
2361            RoundList.LoadRoundThreadFile;
2362    
2363          //          //
2364          TabsOpenAction.Execute;          TabsOpenAction.Execute;
2365  end;  end;
# Line 2339  begin Line 2385  begin
2385                          GikoSys.ReadBoardFile( inBBS );                          GikoSys.ReadBoardFile( inBBS );
2386                  try                  try
2387                          if SplashWindow <> nil then                          if SplashWindow <> nil then
2388                                  SplashWindow.ProgressBar.Max := inBBS.Count;                                  //SplashWindow.ProgressBar.Max := inBBS.Count;
2389                                    SplashWindow.ProgressBar.Max := inBBS.Count + Length(BBSs) * 20;
2390                  except                  except
2391                  end;                  end;
2392    
# Line 2508  begin Line 2555  begin
2555                  ListView.Items.Clear;                  ListView.Items.Clear;
2556                  ListView.Items.Count := Category.Count;                  ListView.Items.Count := Category.Count;
2557    
2558                    for i := Category.Count - 1 downto 0 do begin
2559                            if( Category.Items[i].ParentCategory <> Category ) then begin
2560                                    Category.Items[i].ParentCategory        := Category;
2561                                    Category.Items[i].No                            := i + 1;
2562                            end;
2563                    end;
2564  //              UpFolderAction.Enabled := True;  //              UpFolderAction.Enabled := True;
2565  //              AllItemAction.Enabled := False;  //              AllItemAction.Enabled := False;
2566  //              LogItemAction.Enabled := False;  //              LogItemAction.Enabled := False;
# Line 2580  begin Line 2633  begin
2633                  ListView.Items.Count := 0;                  ListView.Items.Count := 0;
2634                  ListView.Items.Clear;                  ListView.Items.Clear;
2635    
2636                  case GikoForm.ViewType of                  {case GikoForm.ViewType of
2637                          gvtAll: ListView.Items.Count := Board.Count;                          gvtAll: ListView.Items.Count := Board.Count;
2638                          gvtLog: ListView.Items.Count := Board.GetLogThreadCount;                          gvtLog: ListView.Items.Count := Board.GetLogThreadCount;
2639                          gvtNew: ListView.Items.Count := Board.GetNewThreadCount;                          gvtNew: ListView.Items.Count := Board.GetNewThreadCount;
2640                          gvtUser: ListView.Items.Count := Board.GetUserThreadCount;                          gvtUser: ListView.Items.Count := Board.GetUserThreadCount;
2641                  end;                  end;
2642                    }
2643    
2644                    Board.LogThreadCount := Board.GetLogThreadCount;
2645                    Board.NewThreadCount := Board.GetNewThreadCount;
2646                    Board.UserThreadCount:= Board.GetUserThreadCount;
2647    
2648                    case GikoForm.ViewType of
2649                            gvtAll: ListView.Items.Count := Board.Count;
2650                            gvtLog: ListView.Items.Count := Board.LogThreadCount;
2651                            gvtNew: ListView.Items.Count := Board.NewThreadCount;
2652                            gvtUser: ListView.Items.Count := Board.UserThreadCount;
2653                    end;
2654    
2655                  ListNameLabel.Caption := Board.Title;                  ListNameLabel.Caption := Board.Title;
2656                  FolderImage.Picture := nil;                  FolderImage.Picture := nil;
# Line 2669  begin Line 2734  begin
2734    
2735                  if ListNumberVisibleAction.Checked then                  if ListNumberVisibleAction.Checked then
2736                          Item.Caption := IntToStr(Board.No) + ': ' + Board.Title                          Item.Caption := IntToStr(Board.No) + ': ' + Board.Title
2737                            //Item.Caption := IntToStr(Item.Index + 1) + ': ' + Board.Title
2738                  else                  else
2739                          Item.Caption := Board.Title;                          Item.Caption := Board.Title;
2740    
# Line 2717  begin Line 2783  begin
2783                  else                  else
2784                          ListView.StateImages := nil;                          ListView.StateImages := nil;
2785    
2786    
2787                    case GikoForm.ViewType of
2788                            gvtAll: BoardCnt := Board.Count;
2789                            gvtLog: BoardCnt := Board.LogThreadCount;
2790                            gvtNew: BoardCnt := Board.NewThreadCount;
2791                            gvtUser: BoardCnt := Board.UserThreadCount;
2792                            else
2793                                    BoardCnt := 0;
2794                    end;
2795                    {
2796                  case GikoForm.ViewType of                  case GikoForm.ViewType of
2797                          gvtAll: BoardCnt := Board.Count;                          gvtAll: BoardCnt := Board.Count;
2798                          gvtLog: BoardCnt := Board.GetLogThreadCount;                          gvtLog: BoardCnt := Board.GetLogThreadCount;
# Line 2725  begin Line 2801  begin
2801                          else                          else
2802                                  BoardCnt := 0;                                  BoardCnt := 0;
2803                  end;                  end;
2804                    }
2805  //              if Board = nil then Exit;  //              if Board = nil then Exit;
2806                  if (BoardCnt <= 0) or (Item = nil) or (Item.Index > BoardCnt)                  if (BoardCnt <= 0) or (Item = nil) or (Item.Index > BoardCnt)
2807                          or (ListView.Items.Count = 0) or (not (Board.Items[Item.Index] is TThreadItem)) then Exit;                          or (ListView.Items.Count = 0) or (not (Board.Items[Item.Index] is TThreadItem)) then Exit;
                 //if Item = nil then Exit;  
                 //if Item.Index > BoardCnt then Exit;  
                 //if ListView.Items.Count = 0 then Exit;  
   
 //              if not (Board.Items[Item.Index] is TThreadItem) then Exit;  
2808    
2809                    //改善すべきブロック/////////////////////////////////////////////////////
2810                  ThreadItem := nil;                  ThreadItem := nil;
2811                  case GikoForm.ViewType of                  case GikoForm.ViewType of
2812                          gvtAll: if Item.Index >= Board.Count then Exit else                          gvtAll: if Item.Index >= Board.Count then Exit else
2813                                                                  ThreadItem := TThreadItem(Board.Items[Item.Index]);                                                                  ThreadItem := TThreadItem(Board.Items[Item.Index]);
2814                          gvtLog:         ThreadItem := Board.GetLogThread(Item.Index);                          gvtLog:         ThreadItem := Board.GetLogThread(Item.Index);
2815                          gvtNew:         ThreadItem := Board.GetNewThread(Item.Index);                          gvtNew:         ThreadItem := Board.GetNewThread(Item.Index);
2816                          gvtUser:        ThreadItem := Board.GetUserThread(Item.Index);                          gvtUser:        ThreadItem := Board.GetUserThread(Item.Index);
2817                  end;                  end;
2818                    //////////////////////////////////////////////////////////////////////////
2819                    
2820                  if ThreadItem = nil then Exit;                  if ThreadItem = nil then Exit;
2821    
 //              if ListNumberVisibleAction.Checked then  
 //                      RepStr := IntToStr(ThreadItem.No) + ': ' + ThreadItem.Title  
 //              else  
                 //RepStr := ThreadItem.Title;  
2822                  RepStr := CustomStringReplace(ThreadItem.Title, '&lt;', '<' );                  RepStr := CustomStringReplace(ThreadItem.Title, '&lt;', '<' );
2823                  RepStr := CustomStringReplace(RepStr, '&gt;', '>' );                  RepStr := CustomStringReplace(RepStr, '&gt;', '>' );
2824                  RepStr := CustomStringReplace(RepStr, '&quot;', '"' );                  RepStr := CustomStringReplace(RepStr, '&quot;', '"' );
2825                  RepStr := CustomStringReplace(RepStr, '&amp;', '&' );                  RepStr := CustomStringReplace(RepStr, '&amp;', '&' );
2826                  //RepStr := StringReplace(RepStr, '@`', ',', [rfReplaceAll]);                  //RepStr := StringReplace(RepStr, '@`', ',', [rfReplaceAll]);
   
2827                  if Item.SubItems.Count <> ListView.Columns.Count then begin                  if Item.SubItems.Count <> ListView.Columns.Count then begin
2828                          Item.SubItems.Clear;                          Item.SubItems.Clear;
2829                          Item.SubItems.Capacity := GikoSys.Setting.BoardColumnOrder.Count;                          Item.SubItems.Capacity := GikoSys.Setting.BoardColumnOrder.Count;
# Line 2832  begin Line 2900  begin
2900                                  end;                                  end;
2901                                  Inc( idx );                                  Inc( idx );
2902                          end;                          end;
2903    
2904                          if ThreadItem.NewArrival then                          if ThreadItem.NewArrival then
2905                                  Item.ImageIndex := ITEM_ICON_THREADNEW1                                  Item.ImageIndex := ITEM_ICON_THREADNEW1
2906                          else                          else
# Line 2872  begin Line 2941  begin
2941                          else                          else
2942                                  Item.ImageIndex := ITEM_ICON_THREAD1;                                  Item.ImageIndex := ITEM_ICON_THREAD1;
2943                  end;                  end;
2944    
2945                  Item.Data := ThreadItem;                  Item.Data := ThreadItem;
2946    
2947          end;          end;
# Line 2998  begin Line 3068  begin
3068                          end;                          end;
3069                  end else begin                  end else begin
3070                          threadItem := GetActiveContent;                          threadItem := GetActiveContent;
3071              URL := GetRespopupURL(Text, threadItem.URL);                          URL := GetRespopupURL(Text, threadItem.URL);
3072                          PathRec := Gikosys.Parse2chURL2(URL);                          PathRec := Gikosys.Parse2chURL2(URL);
3073                          if (PathRec.FNoParam) then begin                          if (PathRec.FNoParam) then begin
3074                                  PathRec.FSt := 1;                                  PathRec.FSt := 1;
# Line 3398  begin Line 3468  begin
3468                  end else if TObject(TreeView.Items[i].Data) is TBoard then begin                  end else if TObject(TreeView.Items[i].Data) is TBoard then begin
3469                          IsBoardNode := True;                          IsBoardNode := True;
3470                          Board := TBoard(TreeView.Items[i].Data);                          Board := TBoard(TreeView.Items[i].Data);
3471    
3472                          Cnt := Board.UnRead;                          Cnt := Board.UnRead;
3473                          if Cnt <= 0 then                          if Cnt <= 0 then
3474                                  continue;                                  continue;
# Line 3526  begin Line 3597  begin
3597                  else                  else
3598                          ATitle := Item.ThreadItem.Title;                          ATitle := Item.ThreadItem.Title;
3599                  if ATitle = '' then                  if ATitle = '' then
3600              ATitle := GikoSys.Setting.GetMessage(Ord(gmUnKnown));                          ATitle := GikoSys.Setting.GetMessage(Ord(gmUnKnown));
3601    
3602                  if Item.State in [gdsComplete, gdsDiffComplete] then begin                  if Item.State in [gdsComplete, gdsDiffComplete] then begin
3603                          //正常終了                          //正常終了
3604                          if Item.DownType = gdtBoard then begin                          if Item.DownType = gdtBoard then begin
3605                                  //板                                  //板
3606                                  Item.SaveListFile;                                  Item.SaveListFile;
3607                  AddMessageList(ATitle + ' ' + GikoSys.Setting.GetMessage(Ord(gmSureItiran)), nil, gmiOK);                                  AddMessageList(ATitle + ' ' + GikoSys.Setting.GetMessage(Ord(gmSureItiran)), nil, gmiOK);
3608                  if GetActiveList = Item.Board then begin                                  if GetActiveList = Item.Board then begin
3609                                          FActiveList := nil;                                          FActiveList := nil;
3610                                          SetActiveList(Item.Board);                                          SetActiveList(Item.Board);
3611                                  end;                                  end;
# Line 3545  begin Line 3616  begin
3616                                  //スレ                                  //スレ
3617                                  Item.SaveItemFile;                                  Item.SaveItemFile;
3618                                  Item.ThreadItem.NewArrival := True;                                  Item.ThreadItem.NewArrival := True;
3619                                  if (Item.ThreadItem.IsBoardPlugInAvailable) and (Item.ThreadItem.Title = '') then begin                                  //if (Item.ThreadItem.IsBoardPlugInAvailable) and (Item.ThreadItem.Title = '') then begin
3620                                          boardPlugIn             := Item.ThreadItem.BoardPlugIn;                                  if (Item.ThreadItem.ParentBoard.IsBoardPlugInAvailable) and (Item.ThreadItem.Title = '') then begin
3621                                            //boardPlugIn           := Item.ThreadItem.BoardPlugIn;
3622                                            boardPlugIn             := Item.ThreadItem.ParentBoard.BoardPlugIn;
3623                                          Item.ThreadItem.Title := GikoSys.DivideStrLine(boardPlugIn.GetDat( DWORD( Item.ThreadItem ), 1 )).FTitle;                                          Item.ThreadItem.Title := GikoSys.DivideStrLine(boardPlugIn.GetDat( DWORD( Item.ThreadItem ), 1 )).FTitle;
3624                                          ATitle := Item.ThreadItem.Title;                                          ATitle := Item.ThreadItem.Title;
3625                                  end else if ATitle = '(名称不明)' then begin                                  end else if ATitle = '(名称不明)' then begin
# Line 3571  begin Line 3644  begin
3644                                          end;                                          end;
3645                                  end else begin                                  end else begin
3646                                          if (GetActiveContent = Item.ThreadItem) or (FActiveContent = nil) or(FActiveContent.Browser = BrowserNullTab.Browser) then                                          if (GetActiveContent = Item.ThreadItem) or (FActiveContent = nil) or(FActiveContent.Browser = BrowserNullTab.Browser) then
3647                                                  InsertBrowserTab(Item.ThreadItem);                                                                                                  InsertBrowserTab(Item.ThreadItem);
3648                                  end;                                  end;
3649    
3650                                  Application.ProcessMessages;                                                                  Application.ProcessMessages;
3651    
3652                                  if Item.State = gdsComplete then begin                                  if Item.State = gdsComplete then begin
3653                                          PlaySound('New');                                          PlaySound('New');
3654                                          AddMessageList(ATitle + ' ' + GikoSys.Setting.GetMessage(Ord(gmSureSyutoku)), nil, gmiOK);                                                                                  AddMessageList(ATitle + ' ' + GikoSys.Setting.GetMessage(Ord(gmSureSyutoku)), nil, gmiOK);
3655                                          //Add by Genyakun                                                                                  //Add by Genyakun
3656                                          DiffComp := True;                                                                                  DiffComp := True;
3657                                  end else begin                                  end else begin
3658                                          PlaySound('NewDiff');                                          PlaySound('NewDiff');
3659                                          AddMessageList(ATitle + ' ' + GikoSys.Setting.GetMessage(Ord(gmSureDiff)), nil, gmiOK);                                                                                  AddMessageList(ATitle + ' ' + GikoSys.Setting.GetMessage(Ord(gmSureDiff)), nil, gmiOK);
3660                                          //Add by Genyakun                                                                                  //Add by Genyakun
3661                                          DiffComp := True;                                                                                  DiffComp := True;
3662                                  end;                                  end;
3663    
3664                                  //巡回ありの場合&1000超は巡回削除                                  //巡回ありの場合&1000超は巡回削除
3665                                  if (Item.ThreadItem.Round) and (Item.ThreadItem.Count > 1000) then begin                                  if (Item.ThreadItem.Round) and (Item.ThreadItem.Count > 1000) then begin
3666                                          Item.ThreadItem.Round := False;                                          Item.ThreadItem.Round := False;
3667                                          Item.ThreadItem.RoundName := '';                                          //Item.ThreadItem.RoundName := '';
3668                                          AddMessageList('★1000発言を超えたので巡回を削除しました - [' + Item.ThreadItem.Title + ']', nil, gmiOK);                                          AddMessageList('★1000発言を超えたので巡回を削除しました - [' + Item.ThreadItem.Title + ']', nil, gmiOK);
3669                                  end;                                  end;
   
3670                                  TreeView.Refresh;                                  TreeView.Refresh;
3671                                    //ListViewでこのスレが含まれる板を表示しているときの更新処理
3672                                    if (ActiveList <> nil) and (ActiveList is TBoard) then begin
3673                                            TBoard(ActiveList).LogThreadCount := TBoard(ActiveList).GetLogThreadCount;
3674                                            TBoard(ActiveList).NewThreadCount := TBoard(ActiveList).GetNewThreadCount;
3675                                            TBoard(ActiveList).UserThreadCount:= TBoard(ActiveList).GetUserThreadCount;
3676                        //ListViewのアイテムの個数も更新
3677                                            case GikoForm.ViewType of
3678                                                    gvtAll: ListView.Items.Count := TBoard(ActiveList).Count;
3679                                                    gvtLog: ListView.Items.Count := TBoard(ActiveList).LogThreadCount;
3680                                                    gvtNew: ListView.Items.Count := TBoard(ActiveList).NewThreadCount;
3681                                                    gvtUser: ListView.Items.Count := TBoard(ActiveList).UserThreadCount;
3682                                            end;
3683                                    end;
3684                          end;                          end;
3685                          ListView.Refresh;                          ListView.Refresh;
3686                  end else if Item.State = gdsNotModify then begin                  end else if Item.State = gdsNotModify then begin
# Line 3604  begin Line 3689  begin
3689                                  //SetContent(Item.ThreadItem);                                  //SetContent(Item.ThreadItem);
3690                                  InsertBrowserTab(Item.ThreadItem);                                  InsertBrowserTab(Item.ThreadItem);
3691                          end;}                          end;}
3692                          AddMessageList(ATitle + ' ' + GikoSys.Setting.GetMessage(Ord(gmNotMod)), nil, gmiSAD);                                                  AddMessageList(ATitle + ' ' + GikoSys.Setting.GetMessage(Ord(gmNotMod)), nil, gmiSAD);
3693                          PlaySound('NoChange');                          PlaySound('NoChange');
3694                          Screen.Cursor := crDefault;                          Screen.Cursor := crDefault;
3695                  end else if Item.State = gdsAbort then begin                  end else if Item.State = gdsAbort then begin
3696                          //中断                          //中断
3697                          AddMessageList(ATitle + ' ' + GikoSys.Setting.GetMessage(Ord(gmAbort)), nil, gmiOK);                                                  AddMessageList(ATitle + ' ' + GikoSys.Setting.GetMessage(Ord(gmAbort)), nil, gmiOK);
3698                  end else if Item.State = gdsError then begin                  end else if Item.State = gdsError then begin
3699                          //エラー                          //エラー
3700                          s := Item.ErrText;                          s := Item.ErrText;
# Line 3835  var Line 3920  var
3920          ThreadItem: TThreadItem;          ThreadItem: TThreadItem;
3921          Thread: TBrowserRecord;          Thread: TBrowserRecord;
3922          ThreadTitle, ThreadPTitle: string;          ThreadTitle, ThreadPTitle: string;
3923          ThreadScrollTop: Integer;          //ThreadScrollTop: Integer;
3924          ThreadIsLog, ThreadUnRead, ThreadNewArraical: boolean;          ThreadIsLog, {ThreadUnRead,} ThreadNewArraical: boolean;
3925  begin  begin
3926  //      AddMessageList('SetContent', nil, gmiWhat);  //      AddMessageList('SetContent', nil, gmiWhat);
3927          Thread := inThread;          Thread := inThread;
# Line 3886  begin Line 3971  begin
3971                    
3972          ThreadTitle := Thread.Thread.Title;          ThreadTitle := Thread.Thread.Title;
3973          ThreadPTitle := Thread.Thread.ParentBoard.Title;          ThreadPTitle := Thread.Thread.ParentBoard.Title;
3974          ThreadScrollTop := Thread.Thread.ScrollTop;          //ThreadScrollTop := Thread.Thread.ScrollTop;
3975          ThreadIsLog := Thread.Thread.IsLogFile;          ThreadIsLog := Thread.Thread.IsLogFile;
3976          ThreadItem := Thread.Thread;          ThreadItem := Thread.Thread;
3977          ThreadNewArraical :=  Thread.Thread.NewArrival;          ThreadNewArraical :=  Thread.Thread.NewArrival;
3978          ThreadUnRead := Thread.Thread.UnRead;          //ThreadUnRead := Thread.Thread.UnRead;
3979          BBSID := ThreadItem.ParentBoard.BBSID;          BBSID := ThreadItem.ParentBoard.BBSID;
3980          FileName := ThreadItem.FileName;          FileName := ThreadItem.FileName;
3981    
# Line 4068  begin Line 4153  begin
4153          ViewType := AViewType;          ViewType := AViewType;
4154          if ActiveList is TBoard then begin          if ActiveList is TBoard then begin
4155                  Board := TBoard(ActiveList);                  Board := TBoard(ActiveList);
4156                    case ViewType of
4157                            //gvtAll: ListView.Items.Count := Board.Count;
4158                            gvtLog: Board.LogThreadCount := Board.GetLogThreadCount;
4159                            gvtNew: Board.NewThreadCount := Board.GetNewThreadCount;
4160                            gvtUser: Board.UserThreadCount:= Board.GetUserThreadCount;
4161                    end;
4162                    
4163                  SetActiveList(Board);                  SetActiveList(Board);
4164                    //
4165                  //SetThreadListItem(Board); //SetActiveList内で呼ばれるから2重に呼び出す必要なし                  //SetThreadListItem(Board); //SetActiveList内で呼ばれるから2重に呼び出す必要なし
4166          end;          end;
4167  end;  end;
# Line 5287  begin Line 5380  begin
5380  ////            if FTreeType = gtt2ch then  ////            if FTreeType = gtt2ch then
5381  //                      SelectTreeNode(TBoard(GetActiveList).ParentCategory, True);  //                      SelectTreeNode(TBoard(GetActiveList).ParentCategory, True);
5382  //              //SetActiveList(TBoard(GetActiveList).ParentCategory);  //              //SetActiveList(TBoard(GetActiveList).ParentCategory);
5383                  if TreeView.Selected <> nil then begin                  //if TreeView.Selected <> nil then begin
5384                          if TObject(TreeView.Selected.Parent.Data) is TCategory then                  //      if TObject(TreeView.Selected.Parent.Data) is TCategory then
5385                                  SelectTreeNode(TCategory(TreeView.Selected.Parent.Data), True);                  //              SelectTreeNode(TCategory(TreeView.Selected.Parent.Data), True);
5386                  end;                  //end;
5387                    if TBoard(GetActiveList).ParentCategory <> nil then
5388                            SelectTreeNode(TBoard(GetActiveList).ParentCategory, True);
5389          end else if GetActiveList is TCategory then begin          end else if GetActiveList is TCategory then begin
5390  //              if FTreeType = gtt2ch then  //              if FTreeType = gtt2ch then
5391                          SelectTreeNode(TCategory(GetActiveList).ParenTBBS, True);                          SelectTreeNode(TCategory(GetActiveList).ParenTBBS, True);
# Line 6855  begin Line 6950  begin
6950                  Dlg.ShowModal;                  Dlg.ShowModal;
6951                  if Dlg.ModalResult <> mrCancel then begin                  if Dlg.ModalResult <> mrCancel then begin
6952                          s := Trim(Dlg.RoundNameEdit.Text);                          s := Trim(Dlg.RoundNameEdit.Text);
6953                          RoundList.RoundNameList.Add(s);                          //RoundList.RoundNameList.Add(s);
6954                          SetSelectItemRound(True, s, TMenuItem(Sender).Parent.Name);                          SetSelectItemRound(True, s, TMenuItem(Sender).Parent.Name);
6955              ListView.Refresh;              ListView.Refresh;
6956                  end;                  end;
# Line 6872  begin Line 6967  begin
6967      end else begin      end else begin
6968          threadItem := GetActiveContent;          threadItem := GetActiveContent;
6969                  if threadItem <> nil then begin                  if threadItem <> nil then begin
6970                  threadItem.RoundName := RoundName;                          threadItem.RoundName := RoundName;
6971              threadItem.Round := RoundFlag;                          threadItem.Round := RoundFlag;
6972          end;          end;
6973      end;      end;
6974  end;  end;
# Line 7572  var Line 7667  var
7667          URL, protocol2, host2, path2, document2, port2, bookmark2 : string;          URL, protocol2, host2, path2, document2, port2, bookmark2 : string;
7668          tmp1, tmp2: string;          tmp1, tmp2: string;
7669          BBSID, BBSKey: string;          BBSID, BBSKey: string;
7670          tmpBoard, Board: TBoard;          {tmpBoard,} Board: TBoard;
7671          ThreadItem: TThreadItem;          ThreadItem: TThreadItem;
7672          i, bi                                   : Integer;          i, bi                                   : Integer;
7673          boardURL                        : string;          boardURL                        : string;
# Line 7603  begin Line 7698  begin
7698          //===== プラグイン          //===== プラグイン
7699          try          try
7700                  //作業中//                  //作業中//
7701                  bi := High( BoardPlugIns );                  //bi := High( BoardPlugIns );
7702                  for i := Low( BoardPlugIns ) to bi do begin                  bi := Length(BoardGroups) - 1;
7703                          if Assigned( Pointer( BoardPlugIns[ i ].Module ) ) then begin                  //for i := Low( BoardPlugIns ) to bi do begin
7704                                  case BoardPlugIns[ i ].AcceptURL( inURL ) of                  for i := 1 to bi do begin
7705                            //if Assigned( Pointer( BoardPlugIns[ i ].Module ) ) then begin
7706                            if (BoardGroups[i].BoardPlugIn <> nil) and (Assigned(Pointer(BoardGroups[i].BoardPlugIn.Module))) then begin
7707                                    case BoardGroups[i].BoardPlugIn.AcceptURL( inURL ) of
7708                                  atThread:                                  atThread:
7709                                          begin                                          begin
7710                                                  tmpThread               := TThreadItem.Create( BoardPlugIns[ i ], inURL );                                                  boardURL        := BoardGroups[i].BoardPlugIn.ExtractBoardURL( inURL );
7711                                                  boardURL                := tmpThread.BoardPlugIn.GetBoardURL( DWORD( tmpThread ) );                                                  Board           := BBSsFindBoardFromURL( boardURL );
7712                                                  Board                           := BBSsFindBoardFromURL( boardURL );  
7713    
7714                                                  if Board = nil then begin                                                  if Board = nil then begin
7715                              //break;                                                          //break;
7716                                                          // ※作っても追加するところが無いので激しく保留                                                          // ※作っても追加するところが無いので激しく保留
7717                                                          //GikoSys.OpenBrowser(inURL, gbtUserApp);                                                          //GikoSys.OpenBrowser(inURL, gbtUserApp);
7718                                                          //Exit;                                                          //Exit;
# Line 7623  begin Line 7722  begin
7722                                                                  ShowBBSTree( BBSs[ 1 ] );                                                                  ShowBBSTree( BBSs[ 1 ] );
7723                                                          }                                                          }
7724                                                  end else begin                                                  end else begin
7725                                                            tmpThread               := TThreadItem.Create( BoardGroups[i].BoardPlugIn, Board, inURL );
7726                                                          if not Board.IsThreadDatRead then begin                                                          if not Board.IsThreadDatRead then begin
7727                                                                  GikoSys.ReadSubjectFile( Board );                                                                  GikoSys.ReadSubjectFile( Board );
7728                                                                    tmpThread.Free;
7729                                                                  Exit;                                                                  Exit;
7730                                                          end;                                                          end;
7731                                                          ThreadItem := Board.FindThreadFromFileName( tmpThread.FileName );                                                          ThreadItem := Board.FindThreadFromFileName( tmpThread.FileName );
7732                                                            tmpThread.Free;
7733                                                          if ThreadItem = nil then begin                                                          if ThreadItem = nil then begin
7734                                                                  ThreadItem := tmpThread;                                                                  ThreadItem := tmpThread;
7735                                                                  Board.Insert( 0, ThreadItem );                                                                  Board.Insert( 0, ThreadItem );
# Line 7642  begin Line 7744  begin
7744                                                                  DownloadContent( ThreadItem );                                                                  DownloadContent( ThreadItem );
7745                                                                  Exit;                                                                  Exit;
7746                                                          end else begin                                                          end else begin
                                                                 tmpThread.Free;  
7747                                                                  GikoSys.GetPopupResNumber( inURL, stRes, edRes );                                                                  GikoSys.GetPopupResNumber( inURL, stRes, edRes );
7748                                                                  browserRec := InsertBrowserTab( ThreadItem );                                                                  browserRec := InsertBrowserTab( ThreadItem );
7749                                                                  if ThreadItem.IsLogFile then begin                                                                  if ThreadItem.IsLogFile then begin
# Line 7660  begin Line 7761  begin
7761    
7762                                  atBoard:                                  atBoard:
7763                                          begin                                          begin
7764                                                  tmpBoard := TBoard.Create(BoardPlugIns[ i ], inURL);                                                  Board := BBSsFindBoardFromURL(
7765                                                  Board := BBSsFindBoardFromURL( tmpBoard.URL );                                                                          BoardGroups[i].BoardPlugIn.ExtractBoardURL( inURL )
7766                                                  tmpBoard.Free;                                                                          );
7767                                                  if Board <> nil then begin                                                  if Board <> nil then begin
7768                                                          if FActiveBBS <> Board.ParentCategory.ParenTBBS then                                                          if FActiveBBS <> Board.ParentCategory.ParenTBBS then
7769                                                                  ShowBBSTree( Board.ParentCategory.ParenTBBS );                                                                  ShowBBSTree( Board.ParentCategory.ParenTBBS );
# Line 7681  begin Line 7782  begin
7782          if (Length( Trim(BBSKey) ) > 0) and (Length( Trim(BBSID) ) > 0) then begin          if (Length( Trim(BBSKey) ) > 0) and (Length( Trim(BBSID) ) > 0) then begin
7783                  boardURL := GikoSys.Get2chThreadURL2BoardURL( inURL );                  boardURL := GikoSys.Get2chThreadURL2BoardURL( inURL );
7784                  Board := BBSsFindBoardFromURL( boardURL );                  Board := BBSsFindBoardFromURL( boardURL );
7785                  if Board = nil then                  //if Board = nil then
7786                          Board := BBSsFindBoardFromBBSID( BBSID );                  //      Board := BBSsFindBoardFromBBSID( BBSID );
7787    
7788                  if Board = nil then begin                  if Board = nil then begin
7789                          // ※作っても追加するところが無いので激しく保留                          // ※作っても追加するところが無いので激しく保留
# Line 7724  begin Line 7825  begin
7825                                  GikoSys.OpenBrowser(URL1, gbtIE)                                  GikoSys.OpenBrowser(URL1, gbtIE)
7826                          else begin                          else begin
7827                          }                          }
7828                          ThreadItem := TThreadItem.Create( nil, URL );                          ThreadItem := TThreadItem.Create( nil, Board, URL );
7829                          ThreadItem.FileName := ChangeFileExt(BBSKey, '.dat');                          ThreadItem.FileName := ChangeFileExt(BBSKey, '.dat');
7830                          if AnsiPos(Host, Board.URL) = 0 then                          if AnsiPos(Host, Board.URL) = 0 then
7831                                  ThreadItem.DownloadHost := Host                                  ThreadItem.DownloadHost := Host
# Line 8135  begin Line 8236  begin
8236                                          FHint.Title := ThreadItem.Title;                                          FHint.Title := ThreadItem.Title;
8237    
8238          if ThreadItem <> nil then begin          if ThreadItem <> nil then begin
8239              if ThreadItem.IsBoardPlugInAvailable then begin              //if ThreadItem.IsBoardPlugInAvailable then begin
8240                if ThreadItem.ParentBoard.IsBoardPlugInAvailable then begin
8241                  //===== プラグインによる表示                  //===== プラグインによる表示
8242                  boardPlugIn             := ThreadItem.BoardPlugIn;                  //boardPlugIn           := ThreadItem.BoardPlugIn;
8243                    boardPlugIn             := ThreadItem.ParentBoard.BoardPlugIn;
8244    
8245                  // フォントやサイズの設定                  // フォントやサイズの設定
8246                  // 文字コードはプラグインに任せる                  // 文字コードはプラグインに任せる
# Line 10305  begin Line 10408  begin
10408          ThreadItem := GetActiveContent;          ThreadItem := GetActiveContent;
10409    
10410          if ThreadItem <> nil then begin          if ThreadItem <> nil then begin
10411                  if ThreadItem.IsBoardPlugInAvailable then begin                  //if ThreadItem.IsBoardPlugInAvailable then begin
10412            if ThreadItem.ParentBoard.IsBoardPlugInAvailable then begin
10413                          //===== プラグインによる表示                          //===== プラグインによる表示
10414                          boardPlugIn             := ThreadItem.BoardPlugIn;                          //boardPlugIn           := ThreadItem.BoardPlugIn;
10415                boardPlugIn         := ThreadItem.ParentBoard.BoardPlugIn;
10416    
10417                          // フォントやサイズの設定                          // フォントやサイズの設定
10418                          // 文字コードはプラグインに任せる                          // 文字コードはプラグインに任せる
# Line 10325  begin Line 10430  begin
10430                                  Header := CustomStringReplace(Header, '</b>', '',true);                                  Header := CustomStringReplace(Header, '</b>', '',true);
10431                                  Header := CustomStringReplace(Header, '<b>', '',true);                                  Header := CustomStringReplace(Header, '<b>', '',true);
10432                          end;                          end;
10433                          if ThreadItem.IsBoardPlugInAvailable then begin                          //if ThreadItem.IsBoardPlugInAvailable then begin
10434                if ThreadItem.ParentBoard.IsBoardPlugInAvailable then begin
10435                                  Body := CustomStringReplace(Res.FBody, '<br>', #13#10,true);                                  Body := CustomStringReplace(Res.FBody, '<br>', #13#10,true);
10436                                  Body := CustomStringReplace(Body, '<br>', #13#10,true);                                  Body := CustomStringReplace(Body, '<br>', #13#10,true);
10437                          end else begin                          end else begin
# Line 11982  var Line 12088  var
12088          msg : String;          msg : String;
12089          ReadList                : TStringList;          ReadList                : TStringList;
12090          wordCount               : TWordCount;          wordCount               : TWordCount;
12091          i : Integer;          {i : Integer;}
12092  begin  begin
12093          IndividualForm := TIndividualAbonForm.Create(Self);          IndividualForm := TIndividualAbonForm.Create(Self);
12094          try          try

Legend:
Removed from v.1.511  
changed lines
  Added in v.1.511.2.10

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