Browse Source

Merged revisions 8796,8903,8975 via svnmerge from
svn+ssh://[email protected]/FPC/svn/fpc/trunk

........
r8796 | florian | 2007-10-14 16:52:38 +0200 (Sun, 14 Oct 2007) | 2 lines

* support of Ctrl-F4 and Ctrl-F5 for modal dialogs, solves #6747

........
r8903 | jonas | 2007-10-21 22:09:11 +0200 (Sun, 21 Oct 2007) | 4 lines

* always do a SaveAs when trying to save new editors, also if there
aren't any modifications yet, since as the editor has no name yet
a plain save won't do anything (mantis #9477)

........
r8975 | florian | 2007-10-28 19:50:10 +0100 (Sun, 28 Oct 2007) | 2 lines

* open html properly on read only file systems, resolves #10015

........

git-svn-id: branches/fixes_2_2@9454 -

Jonas Maebe 18 years ago
parent
commit
8acaee3e9f
4 changed files with 18 additions and 4 deletions
  1. 11 1
      fv/dialogs.pas
  2. 1 1
      ide/fpviews.pas
  3. 4 0
      ide/whtml.pas
  4. 2 2
      ide/whtmlhlp.pas

+ 11 - 1
fv/dialogs.pas

@@ -1136,13 +1136,23 @@ BEGIN
      evNothing: Exit;                                 { Speed up exit }
      evKeyDown:                                       { Key down event }
        Case Event.KeyCode Of
-         kbEsc: Begin                                 { Escape key press }
+         kbEsc, kbCtrlF4: Begin                       { Escape key press }
              Event.What := evCommand;                 { Command event }
              Event.Command := cmCancel;               { cancel command }
              Event.InfoPtr := Nil;                    { Clear info ptr }
              PutEvent(Event);                         { Put event on queue }
              ClearEvent(Event);                       { Clear the event }
            End;
+         kbCtrlF5: Begin                              { movement of modal dialogs }
+             If (State AND sfModal <> 0) Then
+               begin
+                 Event.What := evCommand;
+                 Event.Command := cmResize;
+                 Event.InfoPtr := Nil;
+                 PutEvent(Event);
+                 ClearEvent(Event);
+               end;
+           End;
          kbEnter: Begin                               { Enter key press }
              Event.What := evBroadcast;               { Broadcast event }
              Event.Command := cmDefault;              { Default command }

+ 1 - 1
ide/fpviews.pas

@@ -2275,7 +2275,7 @@ begin
             Hide;
           cmSave :
             if Editor^.IsClipboard=false then
-             if (Editor^.FileName='') and Editor^.GetModified then
+             if (Editor^.FileName='') then
               Editor^.SaveAs
              else
               Editor^.Save;

+ 4 - 0
ide/whtml.pas

@@ -200,12 +200,16 @@ constructor TDOSTextFile.Init(AFileName: string);
 var f: file;
     linecomplete,hasCR: boolean;
     S: string;
+    OldFMode : Integer;
 begin
   inherited Init;
   if AFileName='' then Fail;
 {$I-}
   Assign(f,AFileName);
+  OldFMode:= FileMode;
+  FileMode:= 0;
   Reset(f,1);
+  FileMode:= OldFMode;
   if IOResult<>0 then Fail;
   DosFileName:=AFileName;
   Dispose(Lines,Done);

+ 2 - 2
ide/whtmlhlp.pas

@@ -867,7 +867,7 @@ begin
             exists PM }
           src:=DirAndNameOf(src)+'.ans';
 {$ifdef DEBUG}
-  DebugMessage(GetFileName,' Trying "'+Src+'"',Line,1);
+          DebugMessage(GetFileName,' Trying "'+Src+'"',Line,1);
 {$endif DEBUG}
           if not ExistsFile(src) then
             begin
@@ -1443,7 +1443,7 @@ begin
       if Name<>'' then
         HTMLFile:=New(PDOSTextFile, Init(Name));
 
-      if (HTMLFile=nil)and (CurFileName<>'') then
+      if (HTMLFile=nil) and (CurFileName<>'') then
         begin
           Name:=CurFileName;
           HTMLFile:=New(PDOSTextFile, Init(Name));