X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=Giko.pas;h=401b11d8017b8b785f85414d76627f845c4777f0;hb=159afa4db4fd7fa31c345f208c52b4b3c5729f15;hp=901e58595c5477a4610828c6a57430c0d7c63c05;hpb=a228bb03061d178b33179e840038b52e53fac4be;p=gikonavigoeson%2Fgikonavi.git diff --git a/Giko.pas b/Giko.pas index 901e585..401b11d 100644 --- a/Giko.pas +++ b/Giko.pas @@ -24,8 +24,7 @@ uses const NGWORDNAME_PANEL = 3; THREADSIZE_PANEL = 2; - USER_RESPOPUPCLEAR = WM_USER + 2005; ///< wParam : TWebBrowser - + USER_POPUPCLEAR = WM_USER + 2005; ///< wParam : TWebBrowser type TToolBarSettingSenderType = (tssNone, tssMain, tssList, tssBrowser); @@ -85,6 +84,7 @@ type ToolMenu: TMenuItem; Find1: TMenuItem; RoundMenu: TMenuItem; + Search1: TMenuItem; MMSep04: TMenuItem; OptionMenu: TMenuItem; HelpMenu: TMenuItem; @@ -422,6 +422,14 @@ type N83: TMenuItem; UpdateGikonaviAction1: TMenuItem; N84: TMenuItem; + N85: TMenuItem; + URL2: TMenuItem; + URLPATHINFO1: TMenuItem; + URLQUERYSTRING1: TMenuItem; + N86: TMenuItem; + K4: TMenuItem; + WikiFAQ1: TMenuItem; + ThrNGEdit: TMenuItem; procedure FormCreate(Sender: TObject); procedure FormDestroy(Sender: TObject); procedure SaveSettingAll(); @@ -609,6 +617,10 @@ type FPreviewBrowserRect: TRect; ///< ƒvƒŒƒrƒ…[‚Ì•\Ž¦ˆÊ’u‚ð‹L‰¯‚·‚é FActionListGroupIndexes: array of Integer; /// '') then begin if ( FActiveContent <> nil) and (FActiveContent.Browser <> nil) then begin - PostMessage( Handle, USER_DOCUMENTCOMPLETE, Integer( FActiveContent.Browser ), 0 ); - end; - if ( FActiveContent <> nil) and (FActiveContent.Browser <> nil) then begin while (FActiveContent.Browser.ReadyState <> READYSTATE_COMPLETE) and (FActiveContent.Browser.ReadyState <> READYSTATE_INTERACTIVE) do begin - Application.ProcessMessages; + // ƒƒbƒZ[ƒW‚ðŽó‚¯Žæ‚ç‚È‚¢‚悤‚ɃXƒŠ[ƒv‚ɕύX + Sleep(1); end; end; item := BBSsFindThreadFromURL( GikoSys.Setting.LastCloseTabURL ); + GikoSys.Setting.LastCloseTabURL := ''; if (item <> nil) and (item.IsLogFile) then begin OpenThreadItem(item, item.URL); end; - GikoSys.Setting.LastCloseTabURL := ''; + //ShowWindow(Self.Handle, SW_SHOW); end; end; - //ActionList‚ÌGroupIndex‚ðŒ³‚É–ß‚· - SetGroupIndex(GikoDM.GikoFormActionList); +//===== ƒ}ƒ‹ƒ`ƒ‚ƒjƒ^ŠÂ‹«‚ÅFormCreate‚ł̓tƒH[ƒ€ˆÊ’u‚ª³‚µ‚­”½‰f‚³‚ê‚È‚¢ê‡ +//===== ‚ª‚ ‚邽‚ßFormShow‰‰ñ‚ōÀ•WÝ’è‚ðs‚¤ + Top := GikoSys.Setting.WindowTop; + Left := GikoSys.Setting.WindowLeft; + Height := GikoSys.Setting.WindowHeight; + Width := GikoSys.Setting.WindowWidth; + + //ƒEƒBƒ“ƒhƒE‚ª‰æ–ÊŠO‚È‚ç‰æ–Ê“à‚Ɉړ®‚·‚é + Right := Left + Width; + Bottom := Top + Height; + MonOk := False; + MonCnt := 0; + while (MonCnt < Screen.MonitorCount) do begin + MonR := Screen.Monitors[MonCnt].Left + Screen.Monitors[MonCnt].Width; + MonB := Screen.Monitors[MonCnt].Top + Screen.Monitors[MonCnt].Height; + + if ((Left >= Screen.Monitors[MonCnt].Left) and (Left < MonR) and + (Top >= Screen.Monitors[MonCnt].Top) and (Top < MonB) and + (Right > Screen.Monitors[MonCnt].Left) and (Right <= MonR) and + (Bottom > Screen.Monitors[MonCnt].Top) and (Bottom <= MonB)) then begin + MonOk := True; + Break; + end; - FStartUp := false; + MonCnt := MonCnt + 1; + end; + + if (MonOk = False) then begin + Left := 0; + Top := 0; + end; + + if GikoSys.Setting.WindowMax then + WindowState := wsMaximized; +//========================================================================== end; end; @@ -1528,6 +1615,8 @@ begin Exit; end; + g_AppTerminated := True; + GikoSys.Setting.LastCloseTabURL := ''; if GikoSys.Setting.TabAutoLoadSave then begin GikoDM.TabsSaveAction.Execute; @@ -1553,11 +1642,12 @@ begin Application.UnhookMainWindow(Hook); //ƒAƒvƒŠƒP[ƒVƒ‡ƒ“I—¹‚Ì‘O‚Ƀ_ƒEƒ“ƒ[ƒhƒXƒŒƒbƒh‚ɐ³íI—¹‚𑣂· + FControlThread.DownloadAbort; FControlThread.Terminate; //OnDestory‚¾‚ƍċN“®‚ð‚©‚¯‚½‚Æ‚«‚È‚Ç‚É•Û‘¶‚³‚ê‚È‚¢‚Ì‚ÅOnCloseQuery‚Őݒè•Û‘¶ SaveSettingAll(); - + Application.Terminate; end; @@ -1567,6 +1657,11 @@ var WindowPlacement: TWindowPlacement; begin try + GikoDM.SaveThreadSearchSetting; + except + end; + + try ActiveListColumnSave; except end; @@ -1603,24 +1698,13 @@ begin GikoSys.Setting.ResRange := FResRangeMenuSelect; except end; - - //ˆêŽž“I‚ɒʏíƒXƒ^ƒCƒ‹‚É–ß‚µ‚ÄCoolBar‚̈ʒuAƒEƒBƒ“ƒhƒE‚̈ʒu‚ð•Û‘¶ - //¦’ˆÓFOnDestroyAOnCloseQuery‚ÅŽg‚¤‚±‚Æ‚µ‚©l—¶‚³‚ê‚Ä‚¢‚È‚¢ - if WindowState <> wsNormal then begin - WindowState := wsNormal; - end; - - try - SaveCoolBarSettings; - except - end; - - try - GikoSys.Setting.WriteWindowSettingFile; - GikoSys.Setting.WriteNameMailSettingFile; - except - end; - + //¡‚Ìwinodw‚̃Xƒ^ƒCƒ‹‚ÅCoolBar‚̈ʒuAƒEƒBƒ“ƒhƒE‚̈ʒu‚ð•Û‘¶ + SaveCoolBarSettings; + GikoSys.Setting.WriteWindowSettingFile; + // –¼‘O‚ƃ[ƒ‹‚Ì•Û‘¶‚Ȃ̂ŃGƒfƒBƒ^‚ª•Â‚¶‚½Œã‚È‚ç‚¢‚Â‚Å‚à‚¢‚¢ + GikoSys.Setting.WriteNameMailSettingFile; + // –`Œ¯‚̏‘‚Ì•Û‘¶ + GikoSys.Setting.WriteBoukenSettingFile; //“ü—̓AƒVƒXƒg‹@\‚̐ݒè‚Ì•Û‘¶ InputAssistDM.SaveToFile(GikoSys.GetInputAssistFileName); @@ -1652,6 +1736,12 @@ begin RoundList.SaveRoundFile; except end; + + // ƒ^ƒXƒNƒgƒŒƒC‚̃AƒCƒRƒ“íœ + if (FIconData.uID <> 0) then begin + Shell_NotifyIcon(NIM_DELETE, @FIconData); + end; + end; procedure TGikoForm.FormDestroy(Sender: TObject); @@ -1659,9 +1749,16 @@ var i : Integer; tmpBool : Boolean; begin - // ƒ^ƒXƒNƒgƒŒƒC‚̃AƒCƒRƒ“íœ - if (FIconData.uID <> 0) then begin - Shell_NotifyIcon(NIM_DELETE, @FIconData); + //ˆêŽž“I‚ɒʏíƒXƒ^ƒCƒ‹‚É–ß‚µ‚ÄCoolBar‚̈ʒuAƒEƒBƒ“ƒhƒE‚̈ʒu‚ð•Û‘¶ + //¦’ˆÓFOnDestroy‚ÅŽg‚¤‚±‚Æ‚µ‚©l—¶‚³‚ê‚Ä‚¢‚È‚¢ + // ‘¼‚Å‚â‚é‚ƍĕ`‰æ‚ª”­¶‚·‚é + if WindowState <> wsNormal then begin + WindowState := wsNormal; + try + SaveCoolBarSettings; + GikoSys.Setting.WriteWindowSettingFile; + except + end; end; // ƒ}ƒEƒXƒWƒFƒXƒ`ƒƒ[ŠJ•ú @@ -1746,7 +1843,7 @@ begin try try - FControlThread.DownloadAbort; + //FControlThread.DownloadAbort; FControlThread.Terminate; FControlThread.WaitFor; except @@ -1779,6 +1876,8 @@ begin except end; + ThreadNgList.Free; + try if FEvent <> nil then FEvent.Free; @@ -1798,6 +1897,14 @@ begin end; except end; + + // Update‚ª‚¢‚ê‚ÎŽÀs‚·‚é + if FileExists(FUpdateExePath) then begin + // ƒAƒbƒvƒf[ƒgŽÀs + GikoSys.CreateProcess(FUpdateExePath, FUpdateExeArgs); + end; + // ƒ[ƒŠ„—áŠO‚ðŒ³‚É–ß‚· + Set8087CW(FCwSave); end; // ŠeŠ‚É‚ ‚éƒLƒƒƒrƒlƒbƒgE BBS ƒƒjƒ…[‚ðƒZƒbƒg^XV @@ -2029,7 +2136,7 @@ begin if FResPopupBrowser <> nil then begin if not(Sender is TResPopupBrowser) then begin - if (FResPopupBrowser.Visible) then begin + if ((doc <> nil) and (FResPopupBrowser.Visible)) then begin if ResPopupClearTimer.Interval > 0 then begin ResPopupClearTimer.Enabled := True; ResPopupClearTimer.Tag := 0; @@ -2063,8 +2170,10 @@ begin end; s := ''; 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 (Pos('http://', Text2) = 1) and (GikoSys.Setting.PreviewVisible) and + if ((Pos('http://', Text2) = 1) or (Pos('https://', Text2) = 1)) and (GikoSys.Setting.PreviewVisible) and + ((Ext = '.jpg') or (Ext = '.jpeg') or (Ext = '.gif') or (Ext = '.png')) or + (Pos('http://www.nicovideo.jp/watch/', Text2) = 1) then begin if FPreviewBrowser = nil then begin FPreviewBrowser := TPreviewBrowser.Create(Self); ShowWindow(FPreviewBrowser.Handle, SW_HIDE); @@ -2351,9 +2460,10 @@ begin {$IFDEF DEBUG} Writeln(URL); {$ENDIF} + FKokoPopupThreadItem := nil; if Pos(kMenuName, URL) <> 0 then begin sNo := Copy( URL, Pos( kMenuName, URL ) + Length( kMenuName ), Length( URL ) ); - + if not GikoSys.IsNumeric(sNo) then Exit; Cancel := True; @@ -2361,6 +2471,17 @@ begin KokoPopupMenu.PopupComponent := nil; if (Sender is TComponent) then KokoPopupMenu.PopupComponent := TComponent(Sender); + // Œë”š‘΍ô ƒNƒŠƒbƒN‚µ‚½ƒuƒ‰ƒEƒU‚ƈقȂé‚Æ‚«‚ɏÁ‚·ˆ—‚ð’ljÁ + if not (Sender is TResPopupBrowser) then begin + if (FResPopupBrowser <> nil) and (FResPopupBrowser.CurrentBrowser.Visible = True) then begin + FResPopupBrowser.Clear; + end; + end else begin + if (Sender <> FResPopupBrowser.CurrentBrowser) then begin + TResPopupBrowser(Sender).ChildClear; + end; + end; + FKokoPopupThreadItem := GetActiveContent(true); KokoPopupMenu.Tag := StrToInt(sNo); KokoPopupMenu.Popup(p.x, p.y); end else if Pos('mailto', LowerCase(URL)) <> 0 then begin @@ -2951,7 +3072,7 @@ begin if (Thread <> nil) and (ThreadItem <>nil) then begin BrowserBoardNameLabel.Caption := ThreadPTitle; ItemIcon16.GetBitmap(4, ItemBoardImage.Picture.Bitmap); - BrowserNameLabel.Caption := ThreadTitle; + BrowserNameLabel.Caption := GetThreadTitle(ThreadTitle); ItemImage.Picture := nil; if ThreadIsLog then if ThreadNewArraical then @@ -2984,7 +3105,7 @@ begin end; end else begin - Self.Caption := GikoDataModule.CAPTION_NAME + ' - [' + ThreadTitle + ']'; + Self.Caption := GikoDataModule.CAPTION_NAME + ' - [' + GetThreadTitle(ThreadTitle) + ']'; //ƒXƒe[ƒ^ƒXƒo[‚É•\Ž¦‚µ‚Ä‚¢‚éƒXƒŒ‚Ì—e—Ê‚ð•\Ž¦ StatusBar.Panels[THREADSIZE_PANEL].Text := Format('%6.2f kB', [ThreadItem.Size / 1024]); StatusBar.Panels[THREADSIZE_PANEL].Width := @@ -3047,7 +3168,7 @@ begin if (FActiveContent <> nil) and (FActiveContent.Thread <> nil) and (FActiveContent.Thread.IsLogFile) then begin try - Self.Caption := GikoDataModule.CAPTION_NAME + ' - [' + FActiveContent.Thread.Title + ']' + Self.Caption := GikoDataModule.CAPTION_NAME + ' - [' + GetThreadTitle(FActiveContent.Thread.Title) + ']' except on E: Exception do begin //ƒXƒŒˆê——DLŒã‚È‚Ç‚ÉFActiveContent‚ÌŽ‚ÂThread‚ª @@ -3823,6 +3944,7 @@ begin TreeSelectFavoriteAddPupupMenu.Visible := False; TreeSelectLogDeleteSeparator.Visible := False; TreeSelectLogDeletePopupMenu.Visible := False; + SearchBoardName.Visible := False; end else if TObject(FClickNode.Data) is TBoard then begin TreeSelectThreadPupupMenu.Visible := False; TreeSelectBoardPupupMenu.Visible := True; @@ -3833,6 +3955,7 @@ begin TreeSelectFavoriteAddPupupMenu.Visible := True; TreeSelectLogDeleteSeparator.Visible := False; TreeSelectLogDeletePopupMenu.Visible := False; + SearchBoardName.Visible := True; end else if TObject(FClickNode.Data) is TFavoriteBoardItem then begin TreeSelectThreadPupupMenu.Visible := False; TreeSelectBoardPupupMenu.Visible := True; @@ -3843,6 +3966,7 @@ begin TreeSelectFavoriteAddPupupMenu.Visible := True; TreeSelectLogDeleteSeparator.Visible := False; TreeSelectLogDeletePopupMenu.Visible := False; + SearchBoardName.Visible := False; end else if (TObject(FClickNode.Data) is TThreadItem) then begin TreeSelectThreadPupupMenu.Visible := True; TreeSelectBoardPupupMenu.Visible := False; @@ -3853,6 +3977,7 @@ begin TreeSelectFavoriteAddPupupMenu.Visible := True; TreeSelectLogDeleteSeparator.Visible := True; TreeSelectLogDeletePopupMenu.Visible := True; + SearchBoardName.Visible := False; end else if (TObject(FClickNode.Data) is TFavoriteThreadItem) then begin TreeSelectThreadPupupMenu.Visible := True; TreeSelectBoardPupupMenu.Visible := False; @@ -3863,6 +3988,7 @@ begin TreeSelectFavoriteAddPupupMenu.Visible := True; TreeSelectLogDeleteSeparator.Visible := True; TreeSelectLogDeletePopupMenu.Visible := True; + SearchBoardName.Visible := False; end else if (TObject(FClickNode.Data) is TCategory) then begin TreeSelectThreadPupupMenu.Visible := False; TreeSelectBoardPupupMenu.Visible := False; @@ -3873,6 +3999,7 @@ begin TreeSelectFavoriteAddPupupMenu.Visible := False; TreeSelectLogDeleteSeparator.Visible := False; TreeSelectLogDeletePopupMenu.Visible := False; + SearchBoardName.Visible := True; end else if FClickNode.IsFirstNode then begin TreeSelectThreadPupupMenu.Visible := False; TreeSelectBoardPupupMenu.Visible := False; @@ -3883,6 +4010,7 @@ begin TreeSelectFavoriteAddPupupMenu.Visible := False; TreeSelectLogDeleteSeparator.Visible := False; TreeSelectLogDeletePopupMenu.Visible := False; + SearchBoardName.Visible := True; end else begin TreeSelectThreadPupupMenu.Visible := False; TreeSelectBoardPupupMenu.Visible := False; @@ -3893,6 +4021,7 @@ begin TreeSelectFavoriteAddPupupMenu.Visible := False; TreeSelectLogDeleteSeparator.Visible := False; TreeSelectLogDeletePopupMenu.Visible := False; + SearchBoardName.Visible := False; end; end; @@ -4348,7 +4477,7 @@ procedure TGikoForm.SetSelectItemRound(RoundFlag: Boolean; RoundName: string; Pa var threadItem : TThreadItem; begin - if ParentName <> 'dummy1' then begin + if ParentName <> 'RoundItem' then begin SetSelectItemRound(RoundFlag, RoundName); end else begin threadItem := GetActiveContent; @@ -4665,7 +4794,7 @@ begin end; end; -procedure TGikoForm.MoveToURL(const inURL: string); +procedure TGikoForm.MoveToURL(const inURL: string; KeyMask: Boolean = False); var protocol, host, path, document, port, bookmark : string; URL, protocol2, host2, path2, document2, port2, bookmark2 : string; @@ -4682,17 +4811,18 @@ begin GikoSys.ParseURI( inURL, protocol, host, path, document, port, bookmark ); GikoSys.Parse2chURL( inURL, path, document, BBSID, BBSKey ); - - - shiftDown := GetAsyncKeyState(VK_SHIFT) = Smallint($8001); - ctrlDown := GetAsyncKeyState(VK_CONTROL) = Smallint($8001); - if shiftDown then begin - GikoSys.OpenBrowser(inURL, gbtUserApp); - Exit; - end else if ctrlDown then begin - GikoSys.OpenBrowser(inURL, gbtIE); - Exit; - end; + // ƒAƒNƒVƒ‡ƒ“‚©‚çŒÄ‚΂ê‚é‚Æshift/ctrl‚Í‚¨‚µ‚Á‚ς̏ꍇ‚ª‚Ù‚Æ‚ñ‚ǂȂ̂Ń}ƒXƒN‚·‚é + if not KeyMask then begin + shiftDown := GetAsyncKeyState(VK_SHIFT) = Smallint($8001); + ctrlDown := GetAsyncKeyState(VK_CONTROL) = Smallint($8001); + if shiftDown then begin + GikoSys.OpenBrowser(inURL, gbtUserApp); + Exit; + end else if ctrlDown then begin + GikoSys.OpenBrowser(inURL, gbtIE); + Exit; + end; + end; //===== ƒvƒ‰ƒOƒCƒ“ try @@ -4891,12 +5021,16 @@ begin senderBrowser := TWebBrowser( Message.WParam ); BrowserDocumentComplete( senderBrowser, senderBrowser.Parent, url ); end; - USER_RESPOPUPCLEAR: + USER_POPUPCLEAR: if (TObject(Message.WParam) is TResPopupBrowser) then begin try TResPopupBrowser( Message.WParam ).Clear; except end; + end else if (TObject(Message.WParam) is TPreviewBrowser) then begin + if FPreviewBrowser <> nil then begin + ShowWindow(FPreviewBrowser.Handle, SW_HIDE); + end; end; end; @@ -5223,8 +5357,7 @@ begin SenderNode.Selected := False; FavoriteDragDrop( SenderNode, Source ); - SetLinkBar; - + PostMessage( Handle, USER_SETLINKBAR, 0, 0 ); end; procedure TGikoForm.LinkToolButtonOnMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); @@ -6449,17 +6582,24 @@ end; procedure TGikoForm.BrowserTabPopupMenuPopup(Sender: TObject); +var + i:Integer; begin - AddRoundNameMenu(dummy1); - AddMenuSameBoardThread; + for i := 0 to BrowserTabPopupMenu.Items.Count - 1 do begin + if (BrowserTabPopupMenu.Items[i].Name='RoundItem') then begin + AddRoundNameMenu(BrowserTabPopupMenu.Items[i]); + end else if (BrowserTabPopupMenu.Items[i].Name='BoardThreadItem') then begin + AddMenuSameBoardThread(BrowserTabPopupMenu.Items[i]) + end; + end; end; //! ƒAƒNƒeƒBƒu‚ȃ^ƒu‚Æ“¯‚¶”‚̊J‚¢‚Ä‚¢‚éƒXƒŒƒbƒh‚ðƒƒjƒ…[ƒAƒCƒeƒ€‚ɒljÁ -procedure TGikoForm.AddMenuSameBoardThread; +procedure TGikoForm.AddMenuSameBoardThread(MenuItem: TMenuItem); var i: Integer; Item: TMenuItem; begin - SameBoardThreadItem.Clear; + MenuItem.Clear; for i := 0 to BrowserTab.Tabs.Count - 1 do begin // “¯‚¶”‚©‚Ç‚¤‚© if (FActiveContent.Thread.ParentBoard = @@ -6469,23 +6609,23 @@ begin TBrowserRecord(BrowserTab.Tabs.Objects[i]).Thread then begin Item := TMenuItem.Create(Self); Item.Caption := TBrowserRecord(BrowserTab.Tabs.Objects[i]).Thread.Title; + Item.Hint := TBrowserRecord(BrowserTab.Tabs.Objects[i]).Thread.URL; Item.OnClick := SameBoardThreadSubItemOnClick; - SameBoardThreadItem.Add(Item); + MenuItem.Add(Item); end; end; end; // ‰½‚à–³‚¢‚È‚çŽg—p‚Å‚«‚È‚¢‚悤‚É‚·‚é - SameBoardThreadItem.Enabled := SameBoardThreadItem.Count > 0; + MenuItem.Enabled := MenuItem.Count > 0; end; //! ƒAƒNƒeƒBƒu‚ȃ^ƒu‚Æ“¯‚¶”‚̊J‚¢‚Ä‚¢‚éƒXƒŒƒbƒhƒNƒŠƒbƒNƒCƒxƒ“ƒg procedure TGikoForm.SameBoardThreadSubItemOnClick(Sender: TObject); var - i, j: Integer; + i: Integer; MenuItem: TMenuItem; begin if Sender is TMenuItem then begin try - j := 0; MenuItem := TMenuItem(Sender); for i := 0 to BrowserTab.Tabs.Count - 1 do begin // “¯‚¶”‚©‚Ç‚¤‚© @@ -6493,12 +6633,11 @@ begin TBrowserRecord(BrowserTab.Tabs.Objects[i]).Thread.ParentBoard) then begin if FActiveContent.Thread <> TBrowserRecord(BrowserTab.Tabs.Objects[i]).Thread then begin - if (SameBoardThreadItem.Items[j] = MenuItem) then begin - MoveToURL( TBrowserRecord(BrowserTab.Tabs.Objects[i]) - .Thread.URL); + if (MenuItem.Hint = TBrowserRecord(BrowserTab.Tabs.Objects[i]) + .Thread.URL) then begin + MoveToURL( MenuItem.Hint); Exit; end; - Inc(j); end; end; end; @@ -7307,7 +7446,7 @@ var begin No := KokoPopupMenu.Tag; if No = 0 then Exit; - ThreadItem := GetActiveContent(True); + ThreadItem := GikoForm.KokoPopupThreadItem; if ThreadItem = nil then Exit; id := GikoSys.GetResID(No, ThreadItem); @@ -7366,7 +7505,7 @@ var begin No := KokoPopupMenu.Tag; if No = 0 then Exit; - ThreadItem := GetActiveContent(True); + ThreadItem := GikoForm.KokoPopupThreadItem; if ThreadItem = nil then Exit; body := TStringList.Create; try @@ -8030,6 +8169,59 @@ begin end; end; +//! ƒXƒŒƒ^ƒC•\Ž¦XV +procedure TGikoForm.UpdateThreadTitle; +var + i: Integer; + DspTitle: String; +begin + BrowserTab.Tabs.BeginUpdate; + for i := 0 to BrowserTab.Tabs.Count - 1 do begin + BrowserTab.Tabs.Strings[i] := + GikoSys.GetShortName(TBrowserRecord(BrowserTab.Tabs.Objects[i]).Thread.Title, 20); + end; + BrowserTab.Tabs.EndUpdate; + + if (FActiveContent <> nil) and (FActiveContent.Thread <> nil) then begin + DspTitle := GetThreadTitle(FActiveContent.Thread.Title); + BrowserNameLabel.Caption := DspTitle; + Self.Caption := GikoDataModule.CAPTION_NAME + ' - [' + DspTitle + ']'; + end; +end; + +//! ƒXƒŒƒ^ƒCŽæ“¾ +function TGikoForm.GetThreadTitle(OrgTitle: String): String; +var + Idx: Integer; + ResTitle: String; +begin + if (GikoSys.Setting.ThreadTitleTrim = False) then begin + Result := OrgTitle; + end else begin + ResTitle := OrgTitle; + while (True) do begin + Idx := Pos('[“]Ú‹ÖŽ~]', ResTitle); + if (Idx < 1) then + Break; + Delete(ResTitle, Idx, 10); + end; + while (True) do begin + Idx := Pos('©2ch.net', ResTitle); + if (Idx < 1) then + Break; + Delete(ResTitle, Idx, 13); + end; + Result := Trim(ResTitle); + end; +end; + +//! ƒ|ƒbƒvƒAƒbƒvƒƒjƒ…[“ǂݍž‚Ý +procedure TGikoForm.LoadPopupMenu(); +begin + + +end; + initialization OleInitialize(nil); finalization