OSDN Git Service

誤記修正
[gikonavigoeson/gikonavi.git] / Giko.pas
index e02f57e..0c0374c 100644 (file)
--- a/Giko.pas
+++ b/Giko.pas
@@ -408,6 +408,7 @@ type
     N75: TMenuItem;
     DAT3: TMenuItem;
     N76: TMenuItem;
+    FavoriteTreeItemNameCopyPopupMenu: TMenuItem;
                                procedure FormCreate(Sender: TObject);
                procedure FormDestroy(Sender: TObject);
                procedure BrowserStatusTextChange(Sender: TObject;
@@ -1823,7 +1824,11 @@ begin
        GikoDM.TabsOpenAction.Execute;
 end;
 
-
+{!
+\todo \89½\8cÌ IE 7 \82Å\82Í about:.. \82É\82È\82é\82Ì\82©
+      (IE 7 \82ª about:.. \82ð\92Ç\89Á\82µ\82Ä\82¢\82é\82Ì\82©\81A\83M\83R\83i\83r\82ª\92Ç\89Á\82µ\82Ä\82¢\82é\82Ì\82©)
+      \92²\8d¸\82·\82é\82±\82Æ
+}
 procedure TGikoForm.BrowserStatusTextChange(Sender: TObject; const Text: WideString);
 var
        p: TPoint;
@@ -1843,7 +1848,14 @@ var
        e: IHTMLElement;
        Ext: string;
        PathRec: TPathRec;
-begin
+  Text2: string;
+begin
+       // \83M\83R\83i\83r\82Í\83\8c\83X\83A\83\93\83J\81[\82ª about:blank.. \82Å\8en\82Ü\82é\82±\82Æ\82ð\8aú\91Ò\82µ\82Ä\82¢\82é\82ª
+  // IE 7 \82Å\82Í about:blank.. \82Å\82Í\82È\82­ about:.. \82É\82È\82é\82Ì\82Å\81A\92u\8a·\82·\82é(\93\8a\82°\82â\82è)
+       if Pos('about:..', Text) = 1 then
+       Text2 := 'about:blank..' + Copy( Text, Length('about:..')+1, Length(Text) )
+  else
+       Text2 := Text;
        if not( TObject(Sender) is TWebBrowser )then
                Exit;
        try
@@ -1870,7 +1882,7 @@ begin
                Exit;
        end;
 
-       StatusBar.Panels[1].Text := Text;
+       StatusBar.Panels[1].Text := Text2;
 
        if FHint <> nil then begin
                FHint.ReleaseHandle;
@@ -1887,8 +1899,8 @@ begin
 //file:///C:/Borland/Projects/gikoNavi/test/read.cgi/qa/990576336/10-15
 
        s := '';
-       Ext := AnsiLowerCase(ExtractFileExt(Text));
-       if (Pos('http://', Text) = 1) and (GikoSys.Setting.PreviewVisible) and
+       Ext := AnsiLowerCase(ExtractFileExt(Text2));
+       if (Pos('http://', Text2) = 1) and (GikoSys.Setting.PreviewVisible) and
                        ((Ext = '.jpg') or (Ext = '.jpeg') or (Ext = '.gif') or (Ext = '.png')) then begin
                if FPreviewBrowser = nil then begin
                        FPreviewBrowser := TPreviewBrowser.Create(Self);
@@ -1896,12 +1908,12 @@ begin
                        TOleControl(FPreviewBrowser).Parent := nil;
                end;
                FPreviewBrowser.Navigate(BLANK_HTML);//\91O\89ñ\82Ì\83v\83\8c\83r\83\85\81[\89æ\91\9c\8fÁ\8b\8e\97p
-               FPreviewURL := Text;
+               FPreviewURL := Text2;
                PreviewTimer.Interval := GikoSys.Setting.PreviewWait;
                PreviewTimer.Enabled := True;
-       end else if (Pos('about:blank', Text) = 1) or (Pos('http://', Text) = 1) or (Pos('mailto:', Text) = 1) then begin
-               if Pos('mailto:', Text) = 1 then begin
-                       s := StringReplace(Text, 'mailto:', '', [rfIgnoreCase]);
+       end else if (Pos('about:blank', Text2) = 1) or (Pos('http://', Text2) = 1) or (Pos('mailto:', Text2) = 1) then begin
+               if Pos('mailto:', Text2) = 1 then begin
+                       s := StringReplace(Text2, 'mailto:', '', [rfIgnoreCase]);
                        //\83M\83R\83i\83r\83X\83\8c \83p\81[\83g3\82Ì466\8e\81\82É\8a´\8eÓ
                        GetCursorPos(p);
                        p.x := p.x - TWebBrowser(Sender).ClientOrigin.x;
@@ -1911,8 +1923,8 @@ begin
                                tmp2 := ZenToHan(e.Get_outerText);
                                if (GikoSys.IsNumeric(tmp2)) then begin
                                        //\82\93\82Í\83\8c\83X\94Ô\8d\86\82Á\82Û\82¢\82Á\82·\81B
-                                       wkIntSt := StrToInt(tmp2);
-                                       wkIntTo := StrToInt(tmp2);
+                                       wkIntSt := StrToInt64(tmp2);
+                                       wkIntTo := StrToInt64(tmp2);
                                                //s := GetThreadText(wkBBS, wkKey, wkIntSt, wkIntTo, False, False);
                                        FHint.PopupType := gptThread;
                                        HTMLCreater.SetResPopupText(FHint, GetActiveContent, wkIntSt, wkIntTo, False, False);
@@ -1923,7 +1935,7 @@ begin
                        end;
                end else begin
                        threadItem := GetActiveContent;
-                       URL := THTMLCreate.GetRespopupURL(Text, threadItem.URL);
+                       URL := THTMLCreate.GetRespopupURL(Text2, threadItem.URL);
                        PathRec := Gikosys.Parse2chURL2(URL);
                        if (PathRec.FNoParam) then begin
                                PathRec.FSt := 1;
@@ -3070,12 +3082,27 @@ end;
 procedure TGikoForm.DeleteHistory( threadItem: TThreadItem );
 var
        i: Integer;
-begin
+       node: TTreeNode;
+begin
+       // \83L\83\83\83r\83l\83b\83g\82É\97\9a\97ð\82ª\95\\8e¦\82³\82ê\82Ä\82¢\82½\82ç\81A
+       // \83L\83\83\83r\83l\83b\83g\93à\82Ì\83A\83C\83e\83\80\82à\8dí\8f\9c\82·\82é\81B
+       if (FTreeType = gttHistory) then begin
+               node := TreeView.Items.GetFirstNode;
+               while (node <> nil) do begin
+                       if ( TFavoriteThreadItem(node.Data).Item  = threadItem ) then begin
+                               TreeView.Items.Delete(node);
+                               TreeView.Refresh;
+                               node := nil;
+                       end else begin
+                               node := node.GetNext;
+                       end;
+               end;
+       end;
        for i := 0 to FHistoryList.Count - 1 do begin
-               if threadItem.URL = TFavoriteThreadItem( FHistoryList.Items[i] ).URL then begin
+               if threadItem = TFavoriteThreadItem( FHistoryList.Items[i] ).Item then begin
                        TFavoriteThreadItem( FHistoryList.Items[ i ] ).Free;
                        FHistoryList.Delete(i);
-            FHistoryList.Capacity := FHistoryList.Count;
+                       FHistoryList.Capacity := FHistoryList.Count;
                        Break;
                end;
        end;
@@ -4480,6 +4507,9 @@ begin
 end;
 
 procedure TGikoForm.ShowFavoriteAddDialog( Item : TObject );
+const
+       MsgAdd : String = '\8aù\82É\82¨\8bC\82É\93ü\82è\82É\93o\98^\82³\82ê\82Ä\82¢\82Ü\82·\81B\82»\82ê\82Å\82à\92Ç\89Á\82µ\82Ü\82·\82©\81H';
+       TitleAdd: String =  '\82¨\8bC\82É\93ü\82è\82Ì\92Ç\89Á';
 var
        Dlg                     : TFavoriteAddDialog;
        ItemURL : string;
@@ -4499,7 +4529,7 @@ begin
                        Data := Node.Data;
                        if TObject( Data ) is TFavoriteBoardItem then begin
                                if ItemURL = TFavoriteBoardItem( Data ).URL then begin
-                                       if Application.MessageBox( '\8aù\82É\82¨\8bC\82É\93ü\82è\82É\93o\98^\82³\82ê\82Ä\82¢\82Ü\82·\81B\82»\82ê\82Å\82à\92Ç\89Á\82µ\82Ü\82·\82©\81H', '\82¨\8bC\82É\93ü\82è\82Ì\92Ç\89Á', MB_YESNO ) = IDNO then
+                                       if Application.MessageBox(PChar(MsgAdd) , PChar(TitleAdd), MB_YESNO ) = IDNO then
                                                Exit;
                                        Break;
                                end;
@@ -4519,7 +4549,7 @@ begin
                        Data := Node.Data;
                        if TObject( Data ) is TFavoriteThreadItem then begin
                                if ItemURL = TFavoriteThreadItem( Data ).URL then begin
-                                       if Application.MessageBox( '\8aù\82É\82¨\8bC\82É\93ü\82è\82É\93o\98^\82³\82ê\82Ä\82¢\82Ü\82·\81B\82»\82ê\82Å\82à\92Ç\89Á\82µ\82Ü\82·\82©\81H', '\82¨\8bC\82É\93ü\82è\82Ì\92Ç\89Á', MB_YESNO ) = IDNO then
+                                       if Application.MessageBox( PChar(MsgAdd), PChar(TitleAdd), MB_YESNO ) = IDNO then
                                                Exit;
                                        Break;
                                end;
@@ -4622,7 +4652,7 @@ begin
                threadNumber := ChangeFileExt(Thread.FileName, '');
                GikoSys.GetPopupResNumber( URL, stRes, edRes );
                // \83X\83\8c\82Ì\94Ô\8d\86\82ð\83\8c\83X\94Ô\82Æ\8cë\82Á\82Ä\94F\8e¯\82µ\82Ä\82¢\82é\82Ì\82ð\83N\83\8a\83A
-               if (StrToInt(threadNumber) = stRes) then begin
+               if (StrToInt64(threadNumber) = stRes) then begin
                        if not (AnsiEndsText(threadNumber + '/' + threadNumber, URL))
                                and (Pos('&st=' + threadNumber , URL) = 0) then begin
                                stRes := 0;
@@ -4780,8 +4810,8 @@ begin
                                                ListView.Items.Count := ListView.Items.Count + 1;
                                end;
                        end;
-                       // 2\82¿\82á\82ñ\82Ë\82é\82Å\82È\82­\83\8d\83O\82È\82µ\83X\83\8c\83b\83h\82Ì\82Æ\82«\82Í\81A\83z\83X\83g\96¼\82Ì\83`\83F\83b\83N\82ð\82·\82é
-                       if (not Board.Is2ch) and  (not ThreadItem.IsLogFile) then begin
+                       // \83\8d\83O\82È\82µ\83X\83\8c\83b\83h\82Ì\82Æ\82«\82Í\81A\83z\83X\83g\96¼\82Ì\83`\83F\83b\83N\82ð\82·\82é
+                       if (not ThreadItem.IsLogFile) then begin
                                if AnsiPos(Host, Board.URL) = 0 then
                                        ThreadItem.DownloadHost := Host
                                else
@@ -5098,7 +5128,7 @@ begin
 
                        ThreadItem := GetActiveContent;
                        if ThreadItem <> nil then begin
-                               Num := StrToInt(s);
+                               Num := StrToInt64(s);
                                FHint.PopupType := gptThread;
                                HTMLCreater.SetResPopupText(FHint, ThreadItem, Num, Num, False, False);
                                if FHint.ResCount <> 0 then
@@ -6237,26 +6267,29 @@ begin
                FavoriteTreeNameURLCopyPopupMenu.Visible := False;
                FavoriteTreeReloadPopupMenu.Visible := False;
                FavoriteTreeLogDeletePopupMenu.Visible := False;
+               FavoriteTreeItemNameCopyPopupMenu.Visible := False;
        end else if FClickNode.IsFirstNode then begin
                FavoriteTreeBrowseFolderPopupMenu.Visible := True;
                FavoriteTreeDeletePopupMenu.Visible := False;
                FavoriteTreeRenamePopupMenu.Visible := False;
                FavoriteTreeNewFolderPopupMenu.Visible := True;
                FavoriteTreeURLCopyPopupMenu.Visible := False;
-               FavoriteTreeNameCopyPopupMenu.Visible := True;
+               FavoriteTreeNameCopyPopupMenu.Visible := False;
                FavoriteTreeNameURLCopyPopupMenu.Visible := False;
                FavoriteTreeReloadPopupMenu.Visible := False;
                FavoriteTreeLogDeletePopupMenu.Visible := False;
+               FavoriteTreeItemNameCopyPopupMenu.Visible := True;
        end else if FClickNode.Text = Favorite.FAVORITE_LINK_NAME then begin
                FavoriteTreeBrowseFolderPopupMenu.Visible := True;
                FavoriteTreeDeletePopupMenu.Visible := True;
                FavoriteTreeRenamePopupMenu.Visible := False;
                FavoriteTreeNewFolderPopupMenu.Visible := True;
                FavoriteTreeURLCopyPopupMenu.Visible := False;
-               FavoriteTreeNameCopyPopupMenu.Visible := True;
+               FavoriteTreeNameCopyPopupMenu.Visible := False;
                FavoriteTreeNameURLCopyPopupMenu.Visible := False;
                FavoriteTreeReloadPopupMenu.Visible := False;
                FavoriteTreeLogDeletePopupMenu.Visible := False;
+               FavoriteTreeItemNameCopyPopupMenu.Visible := True;
        end else if TObject(FClickNode.Data) is TFavoriteFolder then begin
                FavoriteTreeBrowseFolderPopupMenu.Visible := True;
                FavoriteTreeDeletePopupMenu.Visible := True;
@@ -6267,6 +6300,7 @@ begin
                FavoriteTreeNameURLCopyPopupMenu.Visible := False;
                FavoriteTreeReloadPopupMenu.Visible := False;
                FavoriteTreeLogDeletePopupMenu.Visible := False;
+               FavoriteTreeItemNameCopyPopupMenu.Visible := True;
        end else if TObject(FClickNode.Data) is TFavoriteThreadItem then begin
                FavoriteTreeBrowseFolderPopupMenu.Visible := False;
                FavoriteTreeDeletePopupMenu.Visible := True;
@@ -6277,6 +6311,7 @@ begin
                FavoriteTreeNameURLCopyPopupMenu.Visible := True;
                FavoriteTreeReloadPopupMenu.Visible := True;
                FavoriteTreeLogDeletePopupMenu.Visible := True;
+               FavoriteTreeItemNameCopyPopupMenu.Visible := True;
        end else if TObject(FClickNode.Data) is TFavoriteBoardItem then begin
                FavoriteTreeBrowseFolderPopupMenu.Visible := False;
                FavoriteTreeDeletePopupMenu.Visible := True;
@@ -6287,6 +6322,7 @@ begin
                FavoriteTreeNameURLCopyPopupMenu.Visible := True;
                FavoriteTreeReloadPopupMenu.Visible := True;
                FavoriteTreeLogDeletePopupMenu.Visible := False;
+               FavoriteTreeItemNameCopyPopupMenu.Visible := True;
        end else begin
                FavoriteTreeBrowseFolderPopupMenu.Visible := False;
                FavoriteTreeDeletePopupMenu.Visible := False;
@@ -6297,6 +6333,7 @@ begin
                FavoriteTreeNameURLCopyPopupMenu.Visible := False;
                FavoriteTreeReloadPopupMenu.Visible := False;
                FavoriteTreeLogDeletePopupMenu.Visible := False;
+               FavoriteTreeItemNameCopyPopupMenu.Visible := False;
        end;
 
 end;