| 10512 |
newBoardName: string; |
newBoardName: string; |
| 10513 |
TabList: TStringList; |
TabList: TStringList; |
| 10514 |
begin |
begin |
| 10515 |
|
|
| 10516 |
|
if oldURLs.Count <> newURLs.Count then begin |
| 10517 |
|
Exit; |
| 10518 |
|
end; |
| 10519 |
|
if FileExists(GikoSys.GetAppDir + 'tab.sav') then begin |
| 10520 |
TabList := TStringList.Create; |
TabList := TStringList.Create; |
| 10521 |
if oldURLs.Count <> newURLs.Count then begin |
try |
| 10522 |
TabList.Free; |
TabList.LoadFromFile(GikoSys.GetAppDir + 'tab.sav'); |
| 10523 |
Exit; |
|
| 10524 |
end; |
//ここから、ThreadのURLの変更 |
| 10525 |
//ここから、BoardのURLの変更 |
//面倒だけどthreadはそれぞれURLをチャックしながらやってかなきゃいけない。 |
| 10526 |
{ for j :=0 to oldURLs.Count - 1 do begin |
for i := 0 to oldURLs.Count - 1 do begin |
| 10527 |
for i :=0 to TabList.Count - 1 do begin |
tmpURL := Copy(oldURLs[i], 1, Length(oldURLs[i]) -1); |
| 10528 |
if TabList.Text = oldURLs[j] then |
oldHost := Copy(tmpURL, 1, LastDelimiter('/', tmpURL) ); |
| 10529 |
TabList.Text := newURLs[j]; |
oldBoardName := Copy(tmpURL, LastDelimiter('/', tmpURL), Length(tmpURL) ) + '/'; |
| 10530 |
end; |
tmpURL := Copy(newURLs[i], 1, Length(newURLs[i]) -1); |
| 10531 |
end; } |
newHost := Copy(tmpURL, 1, LastDelimiter('/', tmpURL) ); |
| 10532 |
//ここまで、BoardのURLの変更 |
newBoardName := Copy(tmpURL, LastDelimiter('/', tmpURL), Length(tmpURL) ) + '/'; |
| 10533 |
|
|
| 10534 |
//ここから、ThreadのURLの変更 |
for j := 0 to TabList.Count - 1 do begin |
| 10535 |
//面倒だけどthreadはそれぞれURLをチャックしながらやってかなきゃいけない。 |
tempString := TabList[j]; |
| 10536 |
for i := 0 to oldURLs.Count - 1 do begin |
if ( AnsiPos(oldBoardName, tempString) <> 0 ) and ( AnsiPos(oldHost, tempString ) <> 0 ) then begin |
| 10537 |
tmpURL := Copy(oldURLs[i], 1, Length(oldURLs[i]) -1); |
tempString := StringReplace(tempString, oldHost, newHost,[]); |
|
oldHost := Copy(tmpURL, 1, LastDelimiter('/', tmpURL) ); |
|
|
oldBoardName := Copy(tmpURL, LastDelimiter('/', tmpURL), Length(tmpURL) ) + '/'; |
|
|
tmpURL := Copy(newURLs[i], 1, Length(newURLs[i]) -1); |
|
|
newHost := Copy(tmpURL, 1, LastDelimiter('/', tmpURL) ); |
|
|
newBoardName := Copy(tmpURL, LastDelimiter('/', tmpURL), Length(tmpURL) ) + '/'; |
|
|
|
|
|
for j := 0 to TabList.Count - 1 do begin |
|
|
tempString := TabList[j]; |
|
|
if ( AnsiPos(oldBoardName, tempString) <> 0 ) and ( AnsiPos(oldHost, tempString ) <> 0 ) then begin |
|
|
tempString := StringReplace(tempString, oldHost, newHost,[]); |
|
| 10538 |
TabList[j] := tempString; |
TabList[j] := tempString; |
| 10539 |
end; |
end; |
| 10540 |
end; |
end; |
| 10541 |
end; |
end; |
| 10542 |
//ここまで、ThreadのURLの変更 |
//ここまで、ThreadのURLの変更 |
| 10543 |
|
finally |
| 10544 |
|
TabList.Free; |
| 10545 |
|
end; |
| 10546 |
|
end; |
| 10547 |
|
|
| 10548 |
end; |
end; |
| 10549 |
|
|
| 10683 |
end; |
end; |
| 10684 |
end; |
end; |
| 10685 |
|
|
|
// ブラウザのキーダウンイベント //なんか使わなくても動いてる気がする byもじゅ |
|
|
// イベントを取り扱った場合は True を返す |
|
|
{ |
|
|
function TGikoForm.BrowserKeydown(var Msg: TMsg; Key: Word; State:TShiftState) : Boolean; |
|
|
var |
|
|
iOIPAO : IOleInPlaceActiveObject; |
|
|
Dispatch : IDispatch; |
|
|
begin |
|
|
Result := False; |
|
|
if Key = VK_BACK then begin |
|
|
UpBoardAction.Execute; |
|
|
Result := True; |
|
|
//end else if Key in [VK_ESCAPE..VK_HELP] then begin |
|
|
// // 十字、Page Up、Page Down 等は Browser が勝手に受け取るのでイベントをカット |
|
|
// Result := True; |
|
|
// |
|
|
end else if(Key in [VK_SPACE..VK_HELP]) and |
|
|
not(ssCtrl in State) and not(ssAlt in State) and not (ssShift in State) then begin |
|
|
Result := True; |
|
|
end else begin |
|
|
// それ以外のイベントは Browser に流す |
|
|
if(FActiveContent <> nil) and (FActiveContent.Browser <> nil) then begin |
|
|
Dispatch := FActiveContent.Browser.Application; |
|
|
if Dispatch <> nil then begin |
|
|
Dispatch.QueryInterface( IOleInPlaceActiveObject, iOIPAO ); |
|
|
if iOIPAO <> nil then |
|
|
iOIPAO.TranslateAccelerator( Msg ); |
|
|
end; |
|
|
end; |
|
|
// ギコナビで使うショートカットは受け取りたいのでイベントはカットしない |
|
|
//Result := False; |
|
|
end; |
|
|
|
|
|
end;} |
|
| 10686 |
|
|
| 10687 |
// ギコナビのメッセージループを横取りします |
// ギコナビのメッセージループを横取りします |
| 10688 |
procedure TGikoForm.HandleAppMessage(var Msg: TMsg; var Handled: Boolean); |
procedure TGikoForm.HandleAppMessage(var Msg: TMsg; var Handled: Boolean); |
| 11199 |
end; |
end; |
| 11200 |
|
|
| 11201 |
function TGikoForm.SaveTabURLs : Boolean; |
function TGikoForm.SaveTabURLs : Boolean; |
| 11202 |
|
const |
| 11203 |
|
Filename = 'tab.sav'; |
| 11204 |
|
bFilename = '~tab.sav'; |
| 11205 |
var |
var |
| 11206 |
SaveStringList, BackStrList: TStringList; |
SaveStringList: TStringList; |
| 11207 |
begin |
begin |
| 11208 |
SaveStringList := TStringList.Create; |
if FileExists( GikoSys.GetAppDir + Filename) then begin |
| 11209 |
BackStrList := TStringList.Create; |
if FileExists( GikoSys.GetAppDir + bFilename) then |
| 11210 |
|
DeleteFile(GikoSys.GetAppDir + bFilename); |
| 11211 |
|
|
| 11212 |
|
//バックアップを作る。 |
| 11213 |
|
RenameFile(GikoSys.GetAppDir + Filename, GikoSys.GetAppDir + bFilename); |
| 11214 |
|
end; |
| 11215 |
|
|
| 11216 |
if FileExists(ExtractFilePath(Application.ExeName) + 'tab.sav') then begin |
SaveStringList := TStringList.Create; |
|
//バックアップを作る。 |
|
|
BackStrList.LoadFromFile(ExtractFilePath(Application.ExeName) + 'tab.sav'); |
|
|
BackStrList.SaveToFile(ExtractFilePath(Application.ExeName) + '~tab.sav'); |
|
|
BackStrList.Free; |
|
|
end; |
|
|
|
|
| 11217 |
try |
try |
| 11218 |
Result := GetTabURLs(SaveStringList); |
if GetTabURLs(SaveStringList) then begin |
| 11219 |
if not Result then begin |
SaveStringList.SaveToFile(GikoSys.GetAppDir + Filename); |
| 11220 |
Exit; //逃げ |
end; |
|
end; |
|
|
SaveStringList.SaveToFile(ExtractFilePath(Application.ExeName) + 'tab.sav'); |
|
| 11221 |
finally |
finally |
| 11222 |
SaveStringList.Free; |
SaveStringList.Free; |
| 11223 |
end; |
end; |
| 11789 |
|
|
| 11790 |
procedure TGikoForm.FormActivate(Sender: TObject); |
procedure TGikoForm.FormActivate(Sender: TObject); |
| 11791 |
begin |
begin |
| 11792 |
MouseGesture.UnHook; |
if GikoSys.Setting.GestureEnabled then begin |
| 11793 |
MouseGesture.OnGestureStart := OnGestureStart; |
MouseGesture.UnHook; |
| 11794 |
MouseGesture.OnGestureMove := OnGestureMove; |
MouseGesture.OnGestureStart := OnGestureStart; |
| 11795 |
MouseGesture.OnGestureEnd := OnGestureEnd; |
MouseGesture.OnGestureMove := OnGestureMove; |
| 11796 |
MouseGesture.SetHook(Handle); |
MouseGesture.OnGestureEnd := OnGestureEnd; |
| 11797 |
|
MouseGesture.SetHook(Handle); |
| 11798 |
|
end; |
| 11799 |
end; |
end; |
| 11800 |
|
|
| 11801 |
procedure TGikoForm.MainCoolBarChange(Sender: TObject); |
procedure TGikoForm.MainCoolBarChange(Sender: TObject); |