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.2.3 by h677, Sun May 15 02:15:31 2005 UTC revision 1.511.2.4 by h677, Sun May 15 14:47:13 2005 UTC
# Line 601  type Line 601  type
601      SortNextColumnAction: TAction;      SortNextColumnAction: TAction;
602      SortPrevColumnAction: TAction;      SortPrevColumnAction: TAction;
603      BeLogInOutAction: TAction;      BeLogInOutAction: TAction;
     N74: TMenuItem;  
     ChangeEUC: TMenuItem;  
     LogConvertToEUCAction: TAction;  
604                                  procedure FormCreate(Sender: TObject);                                  procedure FormCreate(Sender: TObject);
605                  procedure FormDestroy(Sender: TObject);                  procedure FormDestroy(Sender: TObject);
606                  procedure CabinetPanelHide(Sender: TObject);                  procedure CabinetPanelHide(Sender: TObject);
# Line 962  type Line 959  type
959        Stage: TCustomDrawStage; var DefaultDraw: Boolean);        Stage: TCustomDrawStage; var DefaultDraw: Boolean);
960      procedure BeLogInOutActionExecute(Sender: TObject);      procedure BeLogInOutActionExecute(Sender: TObject);
961      procedure BeLogInOutActionUpdate(Sender: TObject);      procedure BeLogInOutActionUpdate(Sender: TObject);
     procedure LogConvertToEUCActionExecute(Sender: TObject);  
962          private          private
963                  { Private 宣言 }                  { Private 宣言 }
964          //RoundList : TRoundList;          //RoundList : TRoundList;
# Line 2530  begin Line 2526  begin
2526                  ListView.Items.Clear;                  ListView.Items.Clear;
2527                  ListView.Items.Count := Category.Count;                  ListView.Items.Count := Category.Count;
2528    
2529                    for i := Category.Count - 1 downto 0 do begin
2530                            if( Category.Items[i].ParentCategory <> Category ) then begin
2531                                    Category.Items[i].ParentCategory        := Category;
2532                                    Category.Items[i].No                            := i + 1;
2533                            end;
2534                    end;
2535  //              UpFolderAction.Enabled := True;  //              UpFolderAction.Enabled := True;
2536  //              AllItemAction.Enabled := False;  //              AllItemAction.Enabled := False;
2537  //              LogItemAction.Enabled := False;  //              LogItemAction.Enabled := False;
# Line 2601  begin Line 2603  begin
2603    
2604                  ListView.Items.Count := 0;                  ListView.Items.Count := 0;
2605                  ListView.Items.Clear;                  ListView.Items.Clear;
2606                    {
2607                  case GikoForm.ViewType of                  case GikoForm.ViewType of
2608                          gvtAll: ListView.Items.Count := Board.Count;                          gvtAll: ListView.Items.Count := Board.Count;
2609                          gvtLog: ListView.Items.Count := Board.GetLogThreadCount;                          gvtLog: ListView.Items.Count := Board.GetLogThreadCount;
2610                          gvtNew: ListView.Items.Count := Board.GetNewThreadCount;                          gvtNew: ListView.Items.Count := Board.GetNewThreadCount;
2611                          gvtUser: ListView.Items.Count := Board.GetUserThreadCount;                          gvtUser: ListView.Items.Count := Board.GetUserThreadCount;
2612                  end;                  end;
2613                    }
2614                    case GikoForm.ViewType of
2615                            gvtAll: ListView.Items.Count := Board.Count;
2616                            gvtLog: ListView.Items.Count := Board.LogThreadCount;
2617                            gvtNew: ListView.Items.Count := Board.NewThreadCount;
2618                            gvtUser: ListView.Items.Count := Board.UserThreadCount;
2619                    end;
2620                  ListNameLabel.Caption := Board.Title;                  ListNameLabel.Caption := Board.Title;
2621                  FolderImage.Picture := nil;                  FolderImage.Picture := nil;
2622                  ItemIcon16.GetBitmap(5, FolderImage.Picture.Bitmap);                  ItemIcon16.GetBitmap(5, FolderImage.Picture.Bitmap);
# Line 2691  begin Line 2699  begin
2699    
2700                  if ListNumberVisibleAction.Checked then                  if ListNumberVisibleAction.Checked then
2701                          Item.Caption := IntToStr(Board.No) + ': ' + Board.Title                          Item.Caption := IntToStr(Board.No) + ': ' + Board.Title
2702                            //Item.Caption := IntToStr(Item.Index + 1) + ': ' + Board.Title
2703                  else                  else
2704                          Item.Caption := Board.Title;                          Item.Caption := Board.Title;
2705    
# Line 2738  begin Line 2747  begin
2747                          ListView.StateImages := StateIconImageList                          ListView.StateImages := StateIconImageList
2748                  else                  else
2749                          ListView.StateImages := nil;                          ListView.StateImages := nil;
   
2750                  case GikoForm.ViewType of                  case GikoForm.ViewType of
2751                          gvtAll: BoardCnt := Board.Count;                          gvtAll: BoardCnt := Board.Count;
2752                          gvtLog: BoardCnt := Board.GetLogThreadCount;                          gvtLog: BoardCnt := Board.LogThreadCount;
2753                          gvtNew: BoardCnt := Board.GetNewThreadCount;                          gvtNew: BoardCnt := Board.NewThreadCount;
2754                          gvtUser: BoardCnt := Board.GetUserThreadCount;                          gvtUser: BoardCnt := Board.UserThreadCount;
2755                          else                          else
2756                                  BoardCnt := 0;                                  BoardCnt := 0;
2757                  end;                  end;
   
2758  //              if Board = nil then Exit;  //              if Board = nil then Exit;
2759                  if (BoardCnt <= 0) or (Item = nil) or (Item.Index > BoardCnt)                  if (BoardCnt <= 0) or (Item = nil) or (Item.Index > BoardCnt)
2760                          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;  
2761    
2762                  ThreadItem := nil;                  ThreadItem := nil;
2763                  case GikoForm.ViewType of                  case GikoForm.ViewType of
# Line 2768  begin Line 2770  begin
2770    
2771                  if ThreadItem = nil then Exit;                  if ThreadItem = nil then Exit;
2772    
 //              if ListNumberVisibleAction.Checked then  
 //                      RepStr := IntToStr(ThreadItem.No) + ': ' + ThreadItem.Title  
 //              else  
                 //RepStr := ThreadItem.Title;  
2773                  RepStr := CustomStringReplace(ThreadItem.Title, '&lt;', '<' );                  RepStr := CustomStringReplace(ThreadItem.Title, '&lt;', '<' );
2774                  RepStr := CustomStringReplace(RepStr, '&gt;', '>' );                  RepStr := CustomStringReplace(RepStr, '&gt;', '>' );
2775                  RepStr := CustomStringReplace(RepStr, '&quot;', '"' );                  RepStr := CustomStringReplace(RepStr, '&quot;', '"' );
2776                  RepStr := CustomStringReplace(RepStr, '&amp;', '&' );                  RepStr := CustomStringReplace(RepStr, '&amp;', '&' );
2777                  //RepStr := StringReplace(RepStr, '@`', ',', [rfReplaceAll]);                  //RepStr := StringReplace(RepStr, '@`', ',', [rfReplaceAll]);
   
2778                  if Item.SubItems.Count <> ListView.Columns.Count then begin                  if Item.SubItems.Count <> ListView.Columns.Count then begin
2779                          Item.SubItems.Clear;                          Item.SubItems.Clear;
2780                          Item.SubItems.Capacity := GikoSys.Setting.BoardColumnOrder.Count;                          Item.SubItems.Capacity := GikoSys.Setting.BoardColumnOrder.Count;
# Line 2854  begin Line 2851  begin
2851                                  end;                                  end;
2852                                  Inc( idx );                                  Inc( idx );
2853                          end;                          end;
2854    
2855                          if ThreadItem.NewArrival then                          if ThreadItem.NewArrival then
2856                                  Item.ImageIndex := ITEM_ICON_THREADNEW1                                  Item.ImageIndex := ITEM_ICON_THREADNEW1
2857                          else                          else
# Line 2894  begin Line 2892  begin
2892                          else                          else
2893                                  Item.ImageIndex := ITEM_ICON_THREAD1;                                  Item.ImageIndex := ITEM_ICON_THREAD1;
2894                  end;                  end;
2895    
2896                  Item.Data := ThreadItem;                  Item.Data := ThreadItem;
2897    
2898          end;          end;
# Line 3020  begin Line 3019  begin
3019                          end;                          end;
3020                  end else begin                  end else begin
3021                          threadItem := GetActiveContent;                          threadItem := GetActiveContent;
3022              URL := GetRespopupURL(Text, threadItem.URL);                          URL := GetRespopupURL(Text, threadItem.URL);
3023                          PathRec := Gikosys.Parse2chURL2(URL);                          PathRec := Gikosys.Parse2chURL2(URL);
3024                          if (PathRec.FNoParam) then begin                          if (PathRec.FNoParam) then begin
3025                                  PathRec.FSt := 1;                                  PathRec.FSt := 1;
# Line 3420  begin Line 3419  begin
3419                  end else if TObject(TreeView.Items[i].Data) is TBoard then begin                  end else if TObject(TreeView.Items[i].Data) is TBoard then begin
3420                          IsBoardNode := True;                          IsBoardNode := True;
3421                          Board := TBoard(TreeView.Items[i].Data);                          Board := TBoard(TreeView.Items[i].Data);
3422    
3423                          Cnt := Board.UnRead;                          Cnt := Board.UnRead;
3424                          if Cnt <= 0 then                          if Cnt <= 0 then
3425                                  continue;                                  continue;
# Line 3602  begin Line 3602  begin
3602    
3603                                  if Item.State = gdsComplete then begin                                  if Item.State = gdsComplete then begin
3604                                          PlaySound('New');                                          PlaySound('New');
3605                                          AddMessageList(ATitle + ' ' + GikoSys.Setting.GetMessage(Ord(gmSureSyutoku)), nil, gmiOK);                                                                                  AddMessageList(ATitle + ' ' + GikoSys.Setting.GetMessage(Ord(gmSureSyutoku)), nil, gmiOK);
3606                                          //Add by Genyakun                                          //Add by Genyakun
3607                                          DiffComp := True;                                          DiffComp := True;
3608                                  end else begin                                  end else begin
# Line 4092  begin Line 4092  begin
4092          ViewType := AViewType;          ViewType := AViewType;
4093          if ActiveList is TBoard then begin          if ActiveList is TBoard then begin
4094                  Board := TBoard(ActiveList);                  Board := TBoard(ActiveList);
4095                    case ViewType of
4096                            //gvtAll: ListView.Items.Count := Board.Count;
4097                            gvtLog: Board.LogThreadCount := Board.GetLogThreadCount;
4098                            gvtNew: Board.NewThreadCount := Board.GetNewThreadCount;
4099                            gvtUser: Board.UserThreadCount:= Board.GetUserThreadCount;
4100                    end;
4101                  SetActiveList(Board);                  SetActiveList(Board);
4102                    //
4103                  //SetThreadListItem(Board); //SetActiveList内で呼ばれるから2重に呼び出す必要なし                  //SetThreadListItem(Board); //SetActiveList内で呼ばれるから2重に呼び出す必要なし
4104          end;          end;
4105  end;  end;
# Line 5311  begin Line 5318  begin
5318  ////            if FTreeType = gtt2ch then  ////            if FTreeType = gtt2ch then
5319  //                      SelectTreeNode(TBoard(GetActiveList).ParentCategory, True);  //                      SelectTreeNode(TBoard(GetActiveList).ParentCategory, True);
5320  //              //SetActiveList(TBoard(GetActiveList).ParentCategory);  //              //SetActiveList(TBoard(GetActiveList).ParentCategory);
5321                  if TreeView.Selected <> nil then begin                  //if TreeView.Selected <> nil then begin
5322                          if TObject(TreeView.Selected.Parent.Data) is TCategory then                  //      if TObject(TreeView.Selected.Parent.Data) is TCategory then
5323                                  SelectTreeNode(TCategory(TreeView.Selected.Parent.Data), True);                  //              SelectTreeNode(TCategory(TreeView.Selected.Parent.Data), True);
5324                  end;                  //end;
5325                    if TBoard(GetActiveList).ParentCategory <> nil then
5326                            SelectTreeNode(TBoard(GetActiveList).ParentCategory, True);
5327          end else if GetActiveList is TCategory then begin          end else if GetActiveList is TCategory then begin
5328  //              if FTreeType = gtt2ch then  //              if FTreeType = gtt2ch then
5329                          SelectTreeNode(TCategory(GetActiveList).ParenTBBS, True);                          SelectTreeNode(TCategory(GetActiveList).ParenTBBS, True);
# Line 7637  begin Line 7646  begin
7646                                  atThread:                                  atThread:
7647                                          begin                                          begin
7648                                                  boardURL        := BoardGroups[i].BoardPlugIn.ExtractBoardURL( inURL );                                                  boardURL        := BoardGroups[i].BoardPlugIn.ExtractBoardURL( inURL );
7649                          Board           := BBSsFindBoardFromURL( boardURL );                                                  Board           := BBSsFindBoardFromURL( boardURL );
7650                                                  tmpThread               := TThreadItem.Create( BoardGroups[i].BoardPlugIn, Board, inURL );  
7651    
7652                                                  if Board = nil then begin                                                  if Board = nil then begin
7653                              //break;                                                          //break;
7654                                                          // ※作っても追加するところが無いので激しく保留                                                          // ※作っても追加するところが無いので激しく保留
7655                                                          //GikoSys.OpenBrowser(inURL, gbtUserApp);                                                          //GikoSys.OpenBrowser(inURL, gbtUserApp);
7656                                                          //Exit;                                                          //Exit;
# Line 7651  begin Line 7660  begin
7660                                                                  ShowBBSTree( BBSs[ 1 ] );                                                                  ShowBBSTree( BBSs[ 1 ] );
7661                                                          }                                                          }
7662                                                  end else begin                                                  end else begin
7663                                                            tmpThread               := TThreadItem.Create( BoardGroups[i].BoardPlugIn, Board, inURL );
7664                                                          if not Board.IsThreadDatRead then begin                                                          if not Board.IsThreadDatRead then begin
7665                                                                  GikoSys.ReadSubjectFile( Board );                                                                  GikoSys.ReadSubjectFile( Board );
7666                                                                    tmpThread.Free;
7667                                                                  Exit;                                                                  Exit;
7668                                                          end;                                                          end;
7669                                                          ThreadItem := Board.FindThreadFromFileName( tmpThread.FileName );                                                          ThreadItem := Board.FindThreadFromFileName( tmpThread.FileName );
7670                                                            tmpThread.Free;
7671                                                          if ThreadItem = nil then begin                                                          if ThreadItem = nil then begin
7672                                                                  ThreadItem := tmpThread;                                                                  ThreadItem := tmpThread;
7673                                                                  Board.Insert( 0, ThreadItem );                                                                  Board.Insert( 0, ThreadItem );
# Line 7688  begin Line 7700  begin
7700    
7701                                  atBoard:                                  atBoard:
7702                                          begin                                          begin
7703                                                  tmpBoard := TBoard.Create(BoardGroups[i].BoardPlugIn, inURL);                                                  Board := BBSsFindBoardFromURL(
7704                                                  Board := BBSsFindBoardFromURL( tmpBoard.URL );                                                                          BoardGroups[i].BoardPlugIn.ExtractBoardURL( inURL )
7705                                                  tmpBoard.Free;                                                                          );
7706                                                  if Board <> nil then begin                                                  if Board <> nil then begin
7707                                                          if FActiveBBS <> Board.ParentCategory.ParenTBBS then                                                          if FActiveBBS <> Board.ParentCategory.ParenTBBS then
7708                                                                  ShowBBSTree( Board.ParentCategory.ParenTBBS );                                                                  ShowBBSTree( Board.ParentCategory.ParenTBBS );
# Line 12263  end; Line 12275  end;
12275    
12276    
12277    
 procedure TGikoForm.LogConvertToEUCActionExecute(Sender: TObject);  
 var  
         ThreadItem: TThreadItem;  
     LogFilename: String;  
     fileStrings: TStringList;  
 begin  
         ThreadItem := GetActiveContent;  
     if ThreadItem <> nil then begin  
         LogFilename := ThreadItem.FilePath;  
         Writeln(LogFilename);  
         if FileExists(LogFilename) then begin  
             fileStrings := TStringList.Create();  
             try  
                 fileStrings.LoadFromFile(LogFilename);  
                 fileStrings.Text := EUCtoSJIS(fileStrings.Text);  
                 fileStrings.SaveToFile(LogFilename);  
             finally  
                 fileStrings.free  
             end;  
         end;  
     end;  
 end;  
   
12278  initialization  initialization
12279                                  OleInitialize(nil);                                  OleInitialize(nil);
12280  finalization  finalization

Legend:
Removed from v.1.511.2.3  
changed lines
  Added in v.1.511.2.4

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