From: genyakun Date: Tue, 17 Aug 2004 14:14:30 +0000 (+0000) Subject: ローカルルール表示に対応 X-Git-Tag: v1_64_1_820~961 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=b6c6138c42b52e97214435a44fec7b6c9de42411;p=gikonavigoeson%2Fgikonavi.git ローカルルール表示に対応 --- diff --git a/Editor.dfm b/Editor.dfm index f76e64c..1af2c01 100644 --- a/Editor.dfm +++ b/Editor.dfm @@ -1,6 +1,6 @@ object EditorForm: TEditorForm - Left = 310 - Top = 169 + Left = 411 + Top = 214 Width = 640 Height = 400 HorzScrollBar.Visible = False @@ -36,7 +36,7 @@ object EditorForm: TEditorForm TextHeight = 12 object StatusBar: TStatusBar Left = 0 - Top = 335 + Top = 327 Width = 632 Height = 19 Panels = < @@ -56,11 +56,11 @@ object EditorForm: TEditorForm Left = 0 Top = 30 Width = 632 - Height = 305 - ActivePage = BoardtopTab + Height = 297 + ActivePage = LocalRuleTab Align = alClient MultiLine = True - TabIndex = 3 + TabIndex = 4 TabOrder = 0 OnChange = EditorPageChange object EditorTab: TTabSheet @@ -69,7 +69,7 @@ object EditorForm: TEditorForm Left = 0 Top = 60 Width = 624 - Height = 218 + Height = 210 Align = alClient ScrollBars = ssBoth TabOrder = 0 @@ -168,12 +168,12 @@ object EditorForm: TEditorForm Left = 0 Top = 0 Width = 624 - Height = 278 + Height = 270 Align = alClient TabOrder = 0 OnStatusTextChange = BrowserStatusTextChange ControlData = { - 4C0000007E400000BB1C00000000000000000000000000000000000000000000 + 4C0000007E400000E81B00000000000000000000000000000000000000000000 000000004C000000000000000000000001000000E0D057007335CF11AE690800 2B2E126208000000000000004C0000000114020000000000C000000000000046 8000000000000000000000000000000000000000000000000000000000000000 @@ -187,7 +187,7 @@ object EditorForm: TEditorForm Left = 0 Top = 0 Width = 624 - Height = 278 + Height = 270 Align = alClient ReadOnly = True ScrollBars = ssVertical @@ -201,11 +201,29 @@ object EditorForm: TEditorForm Left = 0 Top = 0 Width = 624 - Height = 278 + Height = 270 Align = alClient TabOrder = 0 ControlData = { - 4C0000007E400000BB1C00000000000000000000000000000000000000000000 + 4C0000007E400000E81B00000000000000000000000000000000000000000000 + 000000004C000000000000000000000001000000E0D057007335CF11AE690800 + 2B2E126208000000000000004C0000000114020000000000C000000000000046 + 8000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000100000000000000000000000000000000000000} + end + end + object LocalRuleTab: TTabSheet + Caption = 'LocalRuleTab' + ImageIndex = 4 + object LocalRule: TWebBrowser + Left = 0 + Top = 0 + Width = 624 + Height = 270 + Align = alClient + TabOrder = 0 + ControlData = { + 4C0000007E400000E81B00000000000000000000000000000000000000000000 000000004C000000000000000000000001000000E0D057007335CF11AE690800 2B2E126208000000000000004C0000000114020000000000C000000000000046 8000000000000000000000000000000000000000000000000000000000000000 @@ -358,6 +376,11 @@ object EditorForm: TEditorForm GroupIndex = 1 OnClick = BoardTopClick end + object BoardRule: TMenuItem + Caption = #12525#12540#12459#12523#12523#12540#12523 + GroupIndex = 1 + OnClick = BoardRuleClick + end object N1: TMenuItem Caption = '-' GroupIndex = 1 @@ -386,6 +409,9 @@ object EditorForm: TEditorForm object OP1: TMenuItem Action = GetTitlePictureAction end + object HEADTXT1: TMenuItem + Action = GetRocalRule + end end end object ToolBarImageList: TImageList @@ -1614,6 +1640,11 @@ object EditorForm: TEditorForm Hint = 'SETTING.TXT'#21462#24471 OnExecute = GetSETTINGTXTActionExecute end + object GetRocalRule: TAction + Category = #26495#24773#22577 + Caption = 'GetRocalRule' + OnExecute = GetRocalRuleExecute + end object GetTitlePictureAction: TAction Category = #26495#24773#22577 Caption = #26495'TOP'#30011#20687#21462#24471 diff --git a/Editor.pas b/Editor.pas index c77cf71..4ea4618 100644 --- a/Editor.pas +++ b/Editor.pas @@ -107,6 +107,11 @@ type SETTINGTXT2: TMenuItem; GetTitlePictureAction: TAction; OP1: TMenuItem; + BoardRule: TMenuItem; + HEADTXT1: TMenuItem; + LocalRuleTab: TTabSheet; + LocalRule: TWebBrowser; + GetRocalRule: TAction; procedure EditorPageChange(Sender: TObject); procedure FormCreate(Sender: TObject); @@ -151,6 +156,8 @@ type procedure GetSETTINGTXTActionExecute(Sender: TObject); procedure GetTitlePictureActionUpdate(Sender: TObject); procedure GetTitlePictureActionExecute(Sender: TObject); + procedure GetRocalRuleExecute(Sender: TObject); + procedure BoardRuleClick(Sender: TObject); private FThreadItem: TThreadItem; FBoard: TBoard; @@ -1702,4 +1709,61 @@ begin end; end; +procedure TEditorForm.GetRocalRuleExecute(Sender: TObject); +var + URL, RefURL: string; + RocalRuleBody: TStringList; + tmpBoard: TBoard; +begin + InitIdHTTP(Indy); + if FThreadItem = nil then + tmpBoard := FBoard + else + tmpBoard := FThreadItem.ParentBoard; + + if tmpBoard = nil then Exit; + + RefURL := tmpBoard.URL; + if RefURL[Length(RefURL)] <> '/' then + URL := RefURL + '/' + 'head .txt' + else + URL := RefURL + 'head.txt'; + LocalRule.Navigate(URL); + + + { Indy.Request.LastModified := tmpBoard.SETTINGTXTTime; + Indy.Request.Referer := RefURL; + Screen.Cursor := crHourGlass; + settingBody := TStringList.Cre]ate; + try + StatusBar.Panels[0].Text := 'SETTING.TXTƒ_ƒEƒ“ƒ[ƒh’†'; + settingBody.Text := Indy.Get(URL); + if( Indy.ResponseCode = 200 ) then begin + settingBody.SaveToFile(tmpBoard.GetSETTINGTXTFileName); + end; + if( Indy.ResponseCode = 304 ) then begin + StatusBar.Panels[0].Text := 'SETTING.TXTXV–³‚µ(' + IntToStr(Indy.ResponseCode) + ')'; + Exit; + end; + finally + StatusBar.Panels[0].Text := 'SETTING.TXT (' + IntToStr(Indy.ResponseCode) + ')'; + settingBody.Free; + Screen.Cursor := crDefault; + end; + ShowBoardInformation(tmpBoard, BoardInformationMemo); } +end; + +procedure TEditorForm.BoardRuleClick(Sender: TObject); +var + ini: TIniFile; +begin + ini := TIniFile.Create(GikoSys.Setting.GetFileName); + try + LocalRuleTab.TabVisible := BoardRule.Checked; + ini.WriteBool('EditorForm', 'GetLocalRule', LocalRuleTab.TabVisible); + finally + ini.Free; + end; +end; + end.