Ticket #438 (Fixed)Sat Apr 22 12:21:26 UTC 2017
!Printers feeds not working after selecting Default printer settings
Reported by: | Richard Coleman (3190) | Severity: | Normal |
Part: | RISC OS: Application | Release: | |
Milestone: | Status | Fixed |
Details by Richard Coleman (3190):
!Printers v1.85
Problem:
I have a PostScript printer which have a number of feeds to set duplex, etc.
Call up the configuration for the printer and I can select these as required, and it all works great, until I select the top menu entry “Default printer settings”, and click “OK”.
Once I do that whenever I go into the configuration, my feeds are listed and I can select them, but when I click “OK” the feed selected goes back to “Default printer settings”.
The only way to be able to select a feed is to quit !Printers and restart it.
I believe the bug is in the SupportPS file in PROCps_save_configuration(window%)
The 9th line down in that procedure is:
IF cnfg%!CONST_cnfg_ps_feed <> 0 THEN
The problem is that when “Default printer settings” is set then cnfg%!CONST_cnfg_ps_feed is set to 0 and so when this procedure is entered next time this is already set and so the feed menu option is never processed.
If the IF THEN statement is made to check whether the printer has a set of feeds (via CONST_ps_template_feeds) then this appears to fix the bug.
So test on 9th line should be:
ps_t$=FNprinter_read_string_entry(prdt%,CONST_ps_template_feeds):IFps_t$<>"" THEN
and the setting of ps_t$ which is 3 lines down is no longer needed.
This hasn’t been extensively tested, but it seems to work for me.
Appreciate if someone with a bit more knowledge on !Printers would check it and fix the code.
Thanks.
Changelog:
Modified by Richard Coleman (3190) Sat, April 22 2017 - 13:20:31 GMT
Update:
This had all been working fine with me previously using v1.76 of !Printers, so I have had a look at the code (squashed) for that and I can see that the ENDIF that corresponds with:
IF cnfg%!CONST_cnfg_ps_feed <> 0 THEN
has been moved in v1.85. In v1.76 it is just before the 11th line:
ps_i%=0
but by v1.85 it has moved to the 32nd line in that procedure.
If it was moved back to just after the 10th line then that should do the trick.
Tested it here okay.
Modified by Richard Darby (3196) Wed, April 26 2017 - 15:49:40 GMT
The file in question is !Printers.ps.Resources.Support
Confirmed with Richard Coleman earlier today.
Modified by Sprow (202) Thu, April 27 2017 - 22:20:55 GMT
The source file is here
https://www.riscosopen.org/viewer/view/castle/R…
I can’t follow what you’re saying with “line X moved to line Y”. Perhaps the simplest thing to do is make the change in that copy and email it to ROOL’s submission address, since you’ve done most of the leg work already!
Modified by Richard Coleman (3190) Fri, April 28 2017 - 08:30:16 GMT
Very much a newbie with all this, but email has been sent.
Thanks.
Modified by Evan Clark (3270) Mon, May 01 2017 - 17:27:05 GMT
I’ve tested both the fix suggested in the original report and the one in the update.
Fix suggested in the original bug report
-——————————————————-
This fix works without problems.
Fix suggested in the update
-————————————
Moving ENDIF as suggested in the update causes an issue if there is another postscript printer installed which doesn’t have any feeds defined. Clicking OK in it’s configuration window causes the following error:
==========
Warning from Printer Manager
Error from class ps: File name ‘.!Boot’
not recognised in “squished.SupportPS”
==========
The error arises because an invalid feed name is generated by the line:
$buff%=ps_t$“.”ps_s$ (line 902 in the source code)
ps_t$ should evaluate to the full pathname of the feeds directory, and ps_s$ to the feed name.
In the above error message ps_t$ has evaluated to an empty string and ps_s$ has somehow evaluated to ‘!Boot’.
The error can be avoided by preventing the code in the REPEAT UNTIL loop being executed.
That can be acheived by changing line 896 of the source:
- IFps_t$<>FNmsg_0(psup%!CONST_psup_msg,“ME1b”) THEN
+ IFps_t$<>FNmsg_0(psup%!CONST_psup_msg,“ME1b”) AND ps_t$<>""THEN
This is effectively the same as the original fix.
Modified by Richard Coleman (3190) Wed, May 03 2017 - 12:40:58 GMT
Thanks for spotting that.
If there is no feed then you just get Auto and Manual options which I’ve never changed from Auto.
The reason it’s evaluating to “!Boot” is that is the first file object in the current directory that OS_GBPB in line 899 is finding. If you change the current directory you’ll find it evaluates to whatever is first there.
Modified by Richard Coleman (3190) Sat, May 06 2017 - 12:16:56 GMT
I’ve included the AND ps_t$<>"", and emailed an updated file to ROOL.
Modified by Richard Coleman (3190) Fri, May 19 2017 - 11:57:41 GMT
- Status changed from Open to Fixed
Fixed in !Printers 1.86