OSDN Git Service

タブに表示されているスレッドの一覧をスレッド一覧に表示する機能を作成
authorh677 <h677>
Sun, 6 Jul 2008 04:14:54 +0000 (04:14 +0000)
committerh677 <h677>
Sun, 6 Jul 2008 04:14:54 +0000 (04:14 +0000)
それようにSpecialBBSなどを追加

BoardGroup.pas
Giko.pas
GikoDataModule.dfm
GikoDataModule.pas
GikoSystem.pas
gikoNavi.res

index f189df0..0412d9b 100644 (file)
@@ -334,6 +334,12 @@ type
         property       BoardPlugIn     : TBoardPlugIn  read FBoardPlugIn write FBoardPlugIn;
     end;
 
+    // \93Á\8eê\97p\93r\97pTBoard
+    TSpecialBoard = class(TBoard)
+    public
+        function Add(item: TThreadItem): integer; overload;
+        procedure Clear; overload;
+    end;
 
        function        BBSsFindBoardFromBBSID( inBBSID : string ) : TBoard;
        function        BBSsFindBoardFromURL( inURL : string ) : TBoard;
@@ -341,10 +347,13 @@ type
        function        BBSsFindThreadFromURL(const inURL : string ) : TThreadItem;
        function        ConvertDateTimeString( inDateTimeString : string) : TDateTime;
 
+    procedure    DestorySpecialBBS( inBBS : TBBS );
+
 var
        BBSs            : array of TBBS;
     BoardGroups : array of TBoardGroup;
-
+    SpecialBBS  : TBBS;
+    
 implementation
 
 uses
@@ -529,6 +538,28 @@ begin
        end;
 
 end;
+{!
+\brief \93Á\8eê\97p\93rBBS\8dí\8f\9c
+\param bbs \8dí\8f\9c\82·\82é\93Á\8eê\97p\93rBBS
+}
+procedure DestorySpecialBBS( inBBS : TBBS );
+var
+    sCategory : TCategory;
+    sBoard    : TSpecialBoard;
+begin
+    if inBBS <> nil then begin
+        sCategory := inBBS.Items[0];
+        if sCategory <> nil then begin
+            sBoard := TSpecialBoard(sCategory.Items[0]);
+            if sBoard <> nil then begin
+                sBoard.Modified := False;
+                sBoard.Clear;
+                FreeAndNil(sBoard);
+            end;
+        end;
+        FreeAndNil(inBBS);
+    end;
+end;
 
 (*************************************************************************
  *\8b@\94\\96¼\81FTBBS\83R\83\93\83X\83g\83\89\83N\83^
@@ -1830,6 +1861,19 @@ begin
 
 end;
 
+function TSpecialBoard.Add(item: TThreadItem): integer;
+begin
+    Result := inherited AddObject(Item.URL, Item);
+end;
+
+procedure TSpecialBoard.Clear;
+var
+       i: integer;
+begin
+    for i := Count - 1 downto 0 do
+               DeleteList(i);
+    Capacity := 0;
+end;
 
 end.
 
index dcb1a01..ab1627d 100644 (file)
--- a/Giko.pas
+++ b/Giko.pas
@@ -1739,6 +1739,7 @@ begin
                                BBSs[ i ].Free;
                        BBSs[ i ] := nil;
                end;
+        DestorySpecialBBS(BoardGroup.SpecialBBS);
        except
        end;
 
@@ -3084,6 +3085,9 @@ begin
                BBSs[i].SelectText := SelectText;
                BBSs[i].KubetsuChk := KubetsuChk;
        end;
+    BoardGroup.SpecialBBS.SelectText := SelectText;
+    BoardGroup.SpecialBBS.KubetsuChk := KubetsuChk;
+    
        ViewType := AViewType;
        if ActiveList is TBoard then begin
                Board := TBoard(ActiveList);
index 860184d..c38f7d1 100644 (file)
@@ -1,8 +1,8 @@
 object GikoDM: TGikoDM
   OldCreateOrder = False
   OnCreate = DataModuleCreate
-  Left = 516
-  Top = 172
+  Left = 518
+  Top = 174
   Height = 336
   Width = 286
   object GikoFormActionList: TActionList
@@ -538,7 +538,7 @@ object GikoDM: TGikoDM
       Hint = #29694#22312#34920#31034#12375#12390#12356#12427#26495#12434#12502#12521#12454#12470#12391#34920#31034#12377#12427
       ImageIndex = 27
       OnExecute = BoardIEActionExecute
-      OnUpdate = DependActiveListTBoardActionUpdate
+      OnUpdate = BoardIEActionUpdate
     end
     object SelectItemURLCopyAction: TAction
       Category = #26495
@@ -1363,6 +1363,12 @@ object GikoDM: TGikoDM
       OnExecute = ExtractSameIDActionExecute
       OnUpdate = DependActiveCntentLogActionUpdate
     end
+    object ShowTabListAction: TAction
+      Category = #34920#31034
+      Caption = #12479#12502#19968#35239#34920#31034
+      Hint = #12479#12502#19968#35239#34920#31034
+      OnExecute = ShowTabListActionExecute
+    end
   end
   object ToobarImageList: TImageList
     Left = 44
index 98df852..ce50fa2 100644 (file)
@@ -240,6 +240,7 @@ type
     AddIDtoNGWord0Action: TAction;
     AddIDtoNGWord1Action: TAction;
     ExtractSameIDAction: TAction;
+    ShowTabListAction: TAction;
        procedure EditNGActionExecute(Sender: TObject);
        procedure ReloadActionExecute(Sender: TObject);
        procedure GoFowardActionExecute(Sender: TObject);
@@ -450,6 +451,8 @@ type
     procedure AddIDtoNGWord0ActionExecute(Sender: TObject);
     procedure AddIDtoNGWord1ActionExecute(Sender: TObject);
     procedure ExtractSameIDActionExecute(Sender: TObject);
+    procedure ShowTabListActionExecute(Sender: TObject);
+    procedure BoardIEActionUpdate(Sender: TObject);
   private
        { Private \90é\8c¾ }
        procedure ClearResFilter;
@@ -2637,7 +2640,8 @@ end;
 // *************************************************************************
 procedure TGikoDM.UpFolderActionUpdate(Sender: TObject);
 begin
-       UpFolderAction.Enabled := not (GikoForm.GetActiveList is TBBS);
+       UpFolderAction.Enabled := not (GikoForm.GetActiveList is TBBS) and
+        (GikoForm.GetActiveList <> BoardGroup.SpecialBBS.Items[0].Items[0]);
 end;
 // *************************************************************************
 //! \95\\8e¦\81@\95\\8e¦\83\8a\83X\83g\82Ì\83\82\81[\83h\95Ï\8dX
@@ -3000,9 +3004,10 @@ procedure TGikoDM.SelectListReloadActionUpdate(Sender: TObject);
 begin
        if (GikoForm.GetActiveList is TCategory) and (GikoForm.ListView.SelCount > 0) then
                TAction(Sender).Enabled := True
-       else if GikoForm.GetActiveList is TBoard then
-               TAction(Sender).Enabled := True
-       else
+       else if GikoForm.GetActiveList is TBoard then begin
+               TAction(Sender).Enabled :=
+            (GikoForm.GetActiveList <> BoardGroup.SpecialBBS.Items[0].Items[0]);
+       end else
                TAction(Sender).Enabled := False;
 end;
 // *************************************************************************
@@ -4463,6 +4468,27 @@ begin
         end;
     end;
 end;
+//! \83^\83u\82Ì\83X\83\8c\83b\83h\88ê\97\97\82ð\95\\8e¦\82·\82é
+procedure TGikoDM.ShowTabListActionExecute(Sender: TObject);
+var
+    i, j : Integer;
+    sBoard : TSpecialBoard;
+begin
+    sBoard := TSpecialBoard(SpecialBBS.Items[0].Items[0]);
+    sBoard.Clear;
+       for i := GikoForm.BrowserTab.Tabs.Count - 1 downto 0 do begin
+        sBoard.Add(
+               TBrowserRecord(GikoForm.BrowserTab.Tabs.Objects[i]).Thread);
+       end;
+    GikoForm.SelectTreeNode(sBoard , True );
+end;
+//! TBoard\82©\82Â\93Á\8eê\97p\93r\94Â\82Å\82È\82¢
+procedure TGikoDM.BoardIEActionUpdate(Sender: TObject);
+begin
+    TAction(Sender).Enabled :=
+        (GikoForm.GetActiveList is TBoard) and
+        (GikoForm.GetActiveList <> BoardGroup.SpecialBBS.Items[0].Items[0]);
+end;
 
 end.
 
index 5e8b832..a1a644a 100644 (file)
@@ -2509,6 +2509,8 @@ procedure TGikoSys.ListBoardFile;
 var
        boardFileList   : TStringList;
        i, l                    : Integer;
+    sCategory       : TCategory;
+    sBoard          : TBoard;
 begin
        // BBS \82Ì\8aJ\95ú
        try
@@ -2551,6 +2553,19 @@ begin
                BoardFileList.Free;
          end;
        end;
+
+    // \93Á\8eê\97p\93rBBS\90\90¬
+    // \8aù\82É\91\8dÝ\82·\82é\8fê\8d\87\82Í\8dí\8f\9c\82·\82é
+    DestorySpecialBBS(BoardGroup.SpecialBBS);
+    SpecialBBS := TBBS.Create('');
+    SpecialBBS.Title := '\93Á\8eê\97p\93r(\94ñ\95\\8e¦)';
+    sCategory := TCategory.Create;
+    sCategory.No := 1;
+    sCategory.Title := '\93Á\8eê\97p\93r(\94ñ\95\\8e¦)';
+    SpecialBBS.Add(sCategory);
+    sBoard := TSpecialBoard.Create(nil, 'http://localhost/gikonavi/special/index.html');
+    sBoard.IsThreadDatRead := True;
+    sCategory.Add(sBoard);
 end;
 
 {!
index 9f4d38b..85003b5 100644 (file)
Binary files a/gikoNavi.res and b/gikoNavi.res differ