Przeglądaj źródła

* fixed #6497:
- proper ioresult checking when opening the printer device
- disable/enable handling for print menu item

git-svn-id: trunk@6548 -

florian 18 lat temu
rodzic
commit
b8d56a1512
3 zmienionych plików z 5 dodań i 2 usunięć
  1. 1 0
      ide/fpide.pas
  2. 3 1
      ide/fpmfile.inc
  3. 1 1
      ide/fpviews.pas

+ 1 - 0
ide/fpide.pas

@@ -460,6 +460,7 @@ resourcestring  menu_local_gotosource = '~G~oto source';
                 msg_confirmsourcediradd = 'Directory %s is not in search path for source files. '+
                 msg_confirmsourcediradd = 'Directory %s is not in search path for source files. '+
                                          'Should we add it ?';
                                          'Should we add it ?';
                 msg_quitconfirm         = 'Do You really want to quit?';
                 msg_quitconfirm         = 'Do You really want to quit?';
+                msg_printernotopened = 'Can''t open printer,'#13#3'check device name in "print setup"';
                 msg_printerror = 'Error while printing';
                 msg_printerror = 'Error while printing';
                 msg_impossibletoreachcursor = 'Impossible to reach current cursor';
                 msg_impossibletoreachcursor = 'Impossible to reach current cursor';
                 msg_impossibletosetbreakpoint = 'Impossible to set breakpoints here';
                 msg_impossibletosetbreakpoint = 'Impossible to set breakpoints here';

+ 3 - 1
ide/fpmfile.inc

@@ -266,10 +266,12 @@ procedure TIDEApp.Print;
     if assigned(P) then
     if assigned(P) then
       begin
       begin
         assign(f,d);
         assign(f,d);
+{$I-}
         rewrite(f);
         rewrite(f);
+{$I+}
         if ioresult<>0 then
         if ioresult<>0 then
           begin
           begin
-            MessageBox(#3+msg_PrintError,nil,mferror+mfokbutton);
+            MessageBox(#3+msg_printernotopened,nil,mferror+mfokbutton);
             exit;
             exit;
           end;
           end;
         for i:=0 to P^.Editor^.Core^.GetLineCount-1 do
         for i:=0 to P^.Editor^.Core^.GetLineCount-1 do

+ 1 - 1
ide/fpviews.pas

@@ -482,7 +482,7 @@ const
       SourceCmds  : TCommandSet =
       SourceCmds  : TCommandSet =
         ([cmSave,cmSaveAs,cmCompile,cmHide,cmDoReload]);
         ([cmSave,cmSaveAs,cmCompile,cmHide,cmDoReload]);
       EditorCmds  : TCommandSet =
       EditorCmds  : TCommandSet =
-        ([cmFind,cmReplace,cmSearchAgain,cmJumpLine,cmHelpTopicSearch,cmSelectAll,cmUnselect]);
+        ([cmPrint,cmFind,cmReplace,cmSearchAgain,cmJumpLine,cmHelpTopicSearch,cmSelectAll,cmUnselect]);
       CompileCmds : TCommandSet =
       CompileCmds : TCommandSet =
         ([cmMake,cmBuild,cmRun]);
         ([cmMake,cmBuild,cmRun]);