OSDN Git Service

リンク移動履歴の保持数を設定できるように修正
authorh677 <h677>
Sun, 6 Aug 2006 03:17:02 +0000 (03:17 +0000)
committerh677 <h677>
Sun, 6 Aug 2006 03:17:02 +0000 (03:17 +0000)
KuroutSetting.dfm
KuroutSetting.pas
MoveHistoryItem.pas
Setting.pas

index af703b7..f46be37 100644 (file)
@@ -395,6 +395,35 @@ object KuroutOption: TKuroutOption
           TabOrder = 0
         end
       end
+      object GroupBox3: TGroupBox
+        Left = 16
+        Top = 126
+        Width = 473
+        Height = 51
+        Caption = #12522#12531#12463#31227#21205#23653#27508
+        TabOrder = 1
+        object Label10: TLabel
+          Left = 8
+          Top = 20
+          Width = 84
+          Height = 12
+          Caption = #23653#27508#26368#22823#20445#25345#25968
+        end
+        object Label11: TLabel
+          Left = 227
+          Top = 20
+          Width = 158
+          Height = 12
+          Caption = #65288#12487#12501#12457#12523#12488'=20 '#20877#36215#21205#24460#26377#21177#65289
+        end
+        object MoveHistoryMaxEdit: TEdit
+          Left = 112
+          Top = 16
+          Width = 105
+          Height = 20
+          TabOrder = 0
+        end
+      end
     end
   end
   object OkBotton: TButton
index bc2d32a..156cf66 100644 (file)
@@ -61,6 +61,10 @@ type
     Label8: TLabel;
     FixedCookieEdit: TEdit;
     Label9: TLabel;
+    GroupBox3: TGroupBox;
+    Label10: TLabel;
+    MoveHistoryMaxEdit: TEdit;
+    Label11: TLabel;
        procedure OkBottonClick(Sender: TObject);
        procedure FormCreate(Sender: TObject);
        procedure CDeleteButtonClick(Sender: TObject);
@@ -123,6 +127,8 @@ begin
        RemoteTrapAtt.Checked := GikoSys.Setting.RemoteTrapAtt;
        // Cookie
     FixedCookieEdit.Text := GikoSys.Setting.FixedCookie;
+    // \83\8a\83\93\83N\88Ú\93®\97\9a\97ð
+    MoveHistoryMaxEdit.Text := IntToStr( GikoSys.Setting.MoveHistorySize );
 end;
 
 procedure TKuroutOption.SaveSetting;
@@ -150,6 +156,9 @@ begin
        // Cookie
        GikoSys.Setting.FixedCookie := FixedCookieEdit.Text;
 
+    // \83\8a\83\93\83N\88Ú\93®\97\9a\97ð
+    GikoSys.Setting.MoveHistorySize :=
+        StrToIntDef( MoveHistoryMaxEdit.Text, 20 );
 
        GikoSys.Setting.KuroutSettingTabIndex := PageControl1.ActivePageIndex;
 end;
index 7682c5c..bbfa6c0 100644 (file)
@@ -27,6 +27,16 @@ type
     private
         FHistoryMax : Integer;
         FIndex : Integer;
+        {
+        \brief \83\8a\83\93\83N\88Ú\93®\97\9a\97ð\8dÅ\91å\95Û\8e\9d\90\94\82ð\90Ý\92è\82·\82é\81B
+        \param  AVal \95Û\8e\9d\90\94
+        }
+        procedure SetHistoryMax(AVal: Integer);
+        {
+        \brief \83\8a\83\93\83N\88Ú\93®\97\9a\97ð\8dÅ\91å\95Û\8e\9d\90\94\82ð\8eæ\93¾\82·\82é\81B
+        \return \95Û\8e\9d\90\94( > 0 )
+        }
+        function GetHistoryMax: Integer;
     public
         constructor Create( max : Integer ); overload;
         function pushItem( item: TMoveHistoryItem): Integer; overload;
@@ -34,7 +44,7 @@ type
         function getPrevItem( item: TBrowserRecord): TMoveHistoryItem;
         function getNextItem: TMoveHistoryItem;
         procedure clear; override;
-        property HistoryMax : Integer read FHistoryMax write FHistoryMax;
+        property HistoryMax : Integer read GetHistoryMax write SetHistoryMax;
         property HisotryIndex: Integer read FIndex;
     end;
 
@@ -43,16 +53,18 @@ var
 
 implementation
 
+uses
+    GikoSystem;
+
+
 //! \83R\83\93\83X\83g\83\89\83N\83^
 constructor TMoveHistory.Create( max : Integer );
 begin
     inherited Create;
 
     FIndex := 0;
-    FHistoryMax := max;
-    if (FHistoryMax < 0) then begin
-        FHistoryMax := 20;
-    end;
+    
+    SetHistoryMax( GikoSys.Setting.MoveHistorySize );
 end;
 //! \88Ú\93®\97\9a\97ð\82Ì\83A\83C\83e\83\80\92Ç\89Á
 function TMoveHistory.pushItem( item: TMoveHistoryItem): Integer;
@@ -130,7 +142,7 @@ procedure TMoveHistory.clear;
 var
     i : Integer;
 begin
-    // FIndex\82æ\82è\8cã\82ë\82Ì\83A\83C\83e\83\80\82ð\8dí\8f\9c\82·\82é
+    // \83A\83C\83e\83\80\82ð\8dí\8f\9c\82·\82é
     for i := Self.Count - 1 downto 0 do begin
         if (Self.Items [i] <> nil) then begin
             TMoveHistoryItem( Self.Items[i] ).Free;
@@ -138,10 +150,26 @@ begin
         Self.Delete(i);
     end;
     Self.Capacity := 0;
-
+    FIndex := 0;
     inherited;
 end;
 
+procedure TMoveHistory.SetHistoryMax(AVal: Integer);
+begin
+    // \97\9a\97ð\82Ì\83T\83C\83Y\82Í0\82æ\82è\91å\82«\82­\82È\82¢\82Æ\82¢\82¯\82È\82¢
+    if ( AVal > 0 ) then begin
+        if ((AVal + 1) <> FHistoryMax) then begin
+            Self.clear;
+            // \88Ú\93®\82µ\82½\8dÛ\82É\81A\96ß\82é\83\8a\83\93\83N\82ð1\82Â\91«\82·\82Ì\82Å
+            FHistoryMax := AVal + 1;
+        end;
+    end;
+end;
+function TMoveHistory.GetHistoryMax: Integer;
+begin
+    // \88Ú\93®\82µ\82½\8dÛ\82É\81A\96ß\82é\83\8a\83\93\83N\82ð1\82Â\91«\82·\82Ì\82Å
+    Result := FHistoryMax - 1;
+end;
 initialization
        MoveHisotryManager := TMoveHistory.Create( 20 );
 
index fa1a9d9..c657607 100644 (file)
@@ -430,8 +430,10 @@ type
                FInputAssistFormWidth: Integer;
                FInputAssistFormHeight: Integer;
 
-               // Cookie\82É\95t\89Á\82·\82é\8cÅ\92è\83R\81[\83h
+               //! Cookie\82É\95t\89Á\82·\82é\8cÅ\92è\83R\81[\83h
                FFixedCookie: String;
+        //! \83\8a\83\93\83N\88Ú\93®\97\9a\97ð\82Ì\95Û\8e\9d\90\94
+        FMoveHistorySize : Integer;
 
                function GetMainCoolSet(Index: Integer): TCoolSet;
                function GetBoardCoolSet(Index: Integer): TCoolSet;
@@ -503,6 +505,11 @@ type
                function GetEditorKeyFileName: String;
                procedure WriteLogFolder(AVal : String);
                function GetInputAssistFileName : String;
+        {
+        \brief  \83\8a\83\93\83N\97\9a\97ð\82Ì\95Û\8e\9d\83T\83C\83Y\82Ìsetter
+        \param  AVal    \90Ý\92è\82·\82é\83T\83C\83Y( >0) 
+        }
+        procedure SetMoveHistorySize(AVal : Integer);
                //\8eó\90M\83o\83b\83t\83@\83T\83C\83Y
                property RecvBufferSize: Integer read FRecvBufferSize write FRecvBufferSize;
                //HTTP1.1\8eg\97p
@@ -758,6 +765,8 @@ type
                property InputAssistFormHeight: Integer read FInputAssistFormHeight write FInputAssistFormHeight;
                //! Cookie\82É\95t\89Á\82·\82é\8cÅ\92è\83R\81[\83h
                property FixedCookie: String read FFixedCookie write FFixedCookie;
+        // \83\8a\83\93\83N\88Ú\93®\97\9a\97ð\82Ì\95Û\8e\9d\90\94
+        property MoveHistorySize : Integer read FMoveHistorySize write SetMoveHistorySize;
 
 end;
 
@@ -1381,6 +1390,9 @@ begin
                // Cookie\82É\95t\89Á\82·\82é\8cÅ\92è\83R\81[\83h
                FFixedCookie := ini.ReadString('Cookie', 'fixedString', FIXED_COOKIE);
 
+        // \83\8a\83\93\83N\88Ú\93®\97\9a\97ð\82Ì\8dÅ\91å\95Û\8e\9d\90\94
+        FMoveHistorySize := ini.ReadInteger('MoveHisotry', 'Max', 20);
+
                ini.UpdateFile;
        finally
                ini.Free;
@@ -1752,6 +1764,9 @@ begin
                // \8cÅ\92è\82ÌCookie\95\8e\9a\97ñ
         ini.WriteString('Cookie', 'fixedString', FFixedCookie);
 
+        // \83\8a\83\93\83N\88Ú\93®\97\9a\97ð\82Ì\8dÅ\91å\95Û\8e\9d\90\94
+        ini.WriteInteger('MoveHisotry', 'Max', FMoveHistorySize);
+
                ini.UpdateFile;
        finally
                ini.Free;
@@ -2225,7 +2240,12 @@ function TSetting.GetInputAssistFileName : String;
 begin
        Result := GetConfigDir + INPUTASSIST_FILE_NAME;
 end;
-
+procedure TSetting.SetMoveHistorySize(AVal : Integer);
+begin
+    if (AVal > 0) then begin
+        FMoveHistorySize := AVal;
+    end;
+end;
 end.