cleidigh / printing-tools-ng

PrintingTools NG Thunderbird Extension - Printing Utilities
Other
35 stars 17 forks source link

PrintingToolsNG v2.1.4 do not work with TB 102.2.0 when "print.prefer_system_dialog" is set to "true" #134

Closed ffesl closed 2 years ago

ffesl commented 2 years ago

PrintingToolsNG v2.1.4 do not work with TB 102.2.0 when "print.prefer_system_dialog" is set to "true". When we reset "print.prefer_system_dialog" to "false", they work.

We have tried this on several different win-10 computers with TB 102.2.0, and this error occurs on 3 of 4 machines. We cannot find any difference in TB-config settings between the 1 machine on which PrintingToolsNG work with the old printing system dialog, and the other 3 on which they do not.

Please help - 1) we want to have the "old" windows system printing dialog to use keyboard shortcuts (which is not possible in the new dialog) , and 2) we rely on PrintingToolsNG to have the attachments listed in the header on the 1st page when we print only the 1st page of long emails (without PrintingToolsNG the attachments are listed on the last page of a long email)

It does not seem that we can have both 1) and 2) at the same time - in 3 or 4 machines we now can get either 1) or 2), but not both

cleidigh commented 2 years ago

@ffesl I just reproduced what you observed with 102. It's a new pref I honestly did not know about. Ptng needed a lot of work for the new print engine and I am concerned about what this case might mean. Before we go down any path let's clarify :

If point one is true then it stands to reason we should get this working through configuration before I go down a rathole. @cleidigh

ffesl commented 2 years ago

Thanks for replying so fast. To clarify: PrintingToolsNG is really really very very useful for us!

Yes, point 1 is correct. We compared all "printingtoolsng" settings in TB config between the 4 machines, and all TB "print." settings (as far as modified), trying to get the three working, and could not find any (significant) difference between the 1 working machine and the 3 non-working machines (but we are not that wizzards...so we might not be of great help in digging down the problem).

Actually, we need (and use in the old system printing dialog) only one or two shortcuts:

cleidigh commented 2 years ago

@ffesl Did some other experiments and got freaked out when nothing seemed to work, but was fooled by a case where ptng is not invoked if msg not displayed. My TB just updated to 102.2

So now I was able to ptng print with the system dialog to pdf. I have win10 and lots of test profiles.

Two things :

That said do you agree we try to find the required config? Oh and thanks for your enthusiasm about ptng! @cleidigh

cleidigh commented 2 years ago

@ffesl Given we have a decent time diff let me suggest the following first steps:

@cleidigh

ffesl commented 2 years ago

ok, we'll try that. May take a couple of days ..

cleidigh commented 2 years ago

@ffesl Whatever timing works for you

@cleidigh

kiki-ja commented 2 years ago

@cleidigh @ffesl

I will reproduce this problem.. Thunderbird 102.2.0 64bit Windows 10 Pro 21H2 64bit

Information related to printing via system dialogs. (about:config: print.prefer_system_dialog = true) I hope this is helpful.

[Information] Thunderbird — Release Notes (102.0) — Thunderbird https://www.thunderbird.net/en-US/thunderbird/102.0/releasenotes/

-NEW- Printing using the system dialog without preview now supported; Set print.prefer_system_dialog to true

[Related Bugs] 1667950 - Create keyboard shortcuts to directly open the system print dialog https://bugzilla.mozilla.org/show_bug.cgi?id=1667950

1712104 - Add a preference 'print.prefer_system_dialog' to allow printing directly via the system print dialog https://bugzilla.mozilla.org/show_bug.cgi?id=1712104

1748846 - Make the code for switching BrowsingContext for selection-only print much clearer https://bugzilla.mozilla.org/show_bug.cgi?id=1748846

1768936 - Port bug 1712104: Enable print.prefer_system_dialog for Thunderbird https://bugzilla.mozilla.org/show_bug.cgi?id=1768936

1770862 - tabs.printPreview() should override print.prefer_system_dialog = true https://bugzilla.mozilla.org/show_bug.cgi?id=1770862


[Other Method] -firefox/distribution/policies.json

policy-templates/README.md at v4.1 · mozilla/policy-templates · GitHub https://github.com/mozilla/policy-templates/blob/v4.1/README.md

UseSystemPrintDialog / mozilla/policy-templates: Policy Templates for Firefox https://github.com/mozilla/policy-templates#usesystemprintdialog

@kiki-ja

ffesl commented 2 years ago

Dear Chris,

we had now time to try your testing routing. Surprisingly, when starting to swap profiles, we noticed that the answer is actually quite simple: The one machine (A) which we reported to work properly with ptng v2.1.4 and old printing system dialog actually stands on Thunderbird version 91.13.0, not 102.2.0

That's quite a surprise as we had thought to have updated also this machine to TB 102.2.0, as we actually encountered the new printing dialog there - When we then changed the print.prefer_system_dialog to "true", ptng still worked. For some miraculous reason, as we understand now, the TB seems to have "downgraded" itself (lost its update) back to TB 91.13.0 so that pntg with old printing system dialog worked.

I know this sounds somewhat strange (a self-downgrade or lost TB update...sounds like an urban legend) but if it's not so, than we simply messed up the TB upgrade on that machine.

Anyway, the error now stands as it is: >every< machine with TB 102.2.0 and pntg v2.1.4 does not invoke pntg when print.prefer_system_dialog is set to true..

best regards, Andreas

kiki-ja commented 2 years ago

@ffesl @cleidigh

'print.prefer_system_dialog' is invalid and does not work in version 91.0 series. The reason is that it was added in version 102.0 series. Please read Related Bugs I introduced.

・to quickly chose the page(s) to print ・to quickly chose the number of copies to print 99% we only print the 1st page one-fold, so a shortcut to print only the 1st page of an email (with attachment list) would actually suffice.

The above request is organized as follows. Is this correct?

In short, this is [Feature Request] and you want PTNG to have the ability to achieve the above which is not available in Thunderbird's print function?

@kiki-ja

ffesl commented 2 years ago

@kiki-ja: 1) "print.prefer_system_dialog' does not work in version 91.0 series": I do not speak of TB 91. As I summarized in the header , printingToolsNG v2.1.4 do not work with TB 102.2.0 when "print.prefer_system_dialog" is set to "true".

2) your summary "The above request is organized as follows...." is not correct.

cleidigh commented 2 years ago

@ffesl @kiki-ja I have 102.2 with the prefer_system_dialo set to true working correctly with ptng output. This means code wise it works and we just have to find the configuration issues. @kiki-ja are you able to reproduce a working setup? @ffesl are you able to create a new profile for 102 with only ptng and try that? @cleidigh

kiki-ja commented 2 years ago

@cleidigh @ffesl

@kiki-ja are you able to reproduce a working setup?

I installed and tested only PrintingTools NG in a new profile. See screenshot for results. PrintingTools NG 2.1.4 Thunderbird 102.2.0 64bit Windows 10 Pro 21H2 64bit

difference - print prefer_system_dialog

Do you need anything else?

@kiki-ja

kiki-ja commented 2 years ago

@cleidigh @ffesl

I'm confused because I'm having trouble engaging in the exchange.

[1] First, let's talk about print.prefer_system_dialog. This is a setting that determines whether or not the print system dialog is opened directly. true = skip print preview and open print system dialog directly. false = open print preview (Default). from here the print system dialog can also be opened. So PTNG is irrelevant and seems to be the correct behavior of Thunderbird. @cleidigh Is this understanding correct?

[2] Next, I would like to discuss the difference between a keyboard operation and a keyboard shortcut. I understand keyboard shortcuts to be a type of command. So I understand that they are not exactly the same thing as keyboard operations. @cleidigh, @ffesl Is my understanding correct?

[3] Third, a simple question why 'print.prefer_system_dialog' should be 'true'. @ffesl Why should it be 'true'?

[4] Fourth. I feel that we should separate the shortcut issue from setting 'print.prefer_system_dialog' to 'true'. The reason for this is that @ffesl request is to add shortcuts to make keyboard operation more convenient. I don't think the issue of 'print.prefer_system_dialog = true' is directly relevant. @cleidigh, @ffesl what do you think of my suggestion?

@kiki-ja

ffesl commented 2 years ago

Chris, "are you able to create a new profile for 102 with only ptng and try that?"

cleidigh commented 2 years ago

@ffesl @kiki-ja Ok so here is the recap:

Now the only thing I have not checked is a locale issue, will check that. After that I may have to add debug @cleidigh

cleidigh commented 2 years ago

@kiki-ja Responding to your 4 points :

1- re print.prefer_system_dialog This is separate from ptng, however, it is not yet clear how that effects the full print path. The fact that I can print correctly, but you both cannot tells me there is something else that is affecting the process.

2 - Keyboard shortcuts are really the same as keyboard commands, just some definition of a key sequence that has a command or operation associated with it. Custom shortcuts can be defined using an extension such as tbkeys. @ffesl is using something to this effect.

3 - why use the system dialog @ffesl commented above that they can control the system dialog to set options that they cannot with the new TB preview. @RRoenen asked for something similar.

4 - shortcuts Yes this is a separate issue, but they allow the print process to be as easy as possible. I believe we should not have to implement anything unless as a last resort.

@cleidigh

cleidigh commented 2 years ago

@ffesl @kiki-ja Today my system decided to change behavior and NOT work as before. I am baffled. I guess i need to try and trace. @cleidigh

kiki-ja commented 2 years ago

@cleidigh

@cleidigh comment

Thank you very much. [1] is currently unclear, but other than that I see that my understanding is correct.

@kiki-ja

cleidigh commented 2 years ago

@ffesl @kiki-ja Ok i am not crazy, today I am seeing ptng output, now I see it is inconsistent. Trying to find a pattern I think I have consistency. Can both of you try the following :

On my system this seems to print correctly. I can't yet figure the difference. @cleidigh

kiki-ja commented 2 years ago

@cleidigh

  • select an email
  • double click to open the email in a tab
  • click the ptng button dropdown and select print

I did not reproduce the above procedure. It was the same as before. However, i can open the PTNG option.

@kiki-ja

cleidigh commented 2 years ago

@kiki-ja Well that confuses me... No idea why @cleidigh

ffesl commented 2 years ago

I just upgraded to TB 102.2.1 - still does not work, quite reproducably:

print.prefer_system_dialog = true bypasses ptng (although the ptng button is in the menu of the opened email), not even pntg print preview works.

print.prefer_system_dialog = false and all is good, ptng works (but with new printing dialogue, lacking those keyboard shortcuts).

All also with a "fresh" TB profile.

Sorry, Chris, bug stays put .. ;)

cleidigh commented 2 years ago

@ffesl Yes it appears so... The fact that it works on my system puts it in a different category than a bug. When it does not print through ptng it is using a different buffer. That choice is outside of ptng. I will be trying to find that divergence. One other test: What if you preview normally (sys dialog off) then choose print with the system dialog. Again this works on my system. @cleidigh

ffesl commented 2 years ago

I am not sure what you mean with "preview normally": With print.prefer_system_dialog = false, when I open a message and click "print preview" (of the ptng print dialog), I am already in the ptng thread; if I change print.prefer_system_dialog = true in the background, the ptng preview is still open, and I cannot "chose print with the system dialog" any more. Please clarify what you propose as test

cleidigh commented 2 years ago

@ffesl More clearly...

ffesl commented 2 years ago

got it :) surprisingly, then it works, I get ptng output! (with print.prefer_system_dialog = true: not) While this was a good test, unfortunately, I have still to use the mouse...

cleidigh commented 2 years ago

@ffesl This is important because we now have a method which works consistently for both of us. Also it gives you a perfectly useful solution with just one extra mouse click. This allows me to look at possible solutions knowing you are not dead in the water. @cleidigh

kiki-ja commented 2 years ago

@ffesl

  1. When 'print.prefer_system_dialog = false(default)', you can operate both preview dialog and system dialogs using only the keyboard, without using the mouse. See screenshot.

Keyboard select-4

  1. The reason why keyboard shortcuts are not available in the preview dialog and system dialog is because they are not implemented on the Thunderbird side. Therefore, it has nothing to do with 'print.prefer_system_dialog = true or false'.

  2. If you want keyboard shortcuts, please register your requests in Bugzilla.

@kiki-ja

cleidigh commented 2 years ago

@ffesl I think @kiki-ja is correct about the shortcuts and I doubt that we would have luck getting them added. However... I believe I have found a way that correctly gets the buffer while using the system dialog.

@ffesl @kiki-ja I have on ly some paths working so here is the test for t1:

if this fails please post console output @cleidigh

printing-tools-ng-2.1.5-t1-tb.zip

kiki-ja commented 2 years ago

@cleidigh

I have tested PrintingTools NG 2.1.5 t1. Thunderbird 102.2.2 64bit Windows 10 Pro 21H2 64bit

I have on ly some paths working so here is the test for t1:

  • set print.prefer_system_dialog = false
  • select message and open in tab
  • print with button
  • dialog should open

A system dialog opens and printing starts automatically without any further instructions.

  • print after using your shortcuts

What is the shortcut? I do not know that shortcut. I do not use addons to customize shortcuts.

@kiki-ja

cleidigh commented 2 years ago

@kiki-ja So was the output correct? Don't worry about the shortcuts, @ffesl has that setup. As long as we get the dialog and the output is ptng output is correct we should have a solution. @cleidigh

kiki-ja commented 2 years ago

@cleidigh

Sorry, i forgot to write the printout results.

@kiki-ja

cleidigh commented 2 years ago

@kiki-ja Thanks. Good catch on the cancel. Rushing and never canceled, duh. Fixed the wrong err code. Will wait for report from @ffesl . Your output looks good. @cleidigh

ffesl commented 2 years ago

@kiki-ja: actually, 3x + 3x does the trick, I can select pages via keyboard, without having to use the mouse, this tip was very useful, thank you

@cleidigh: Sorry for the delay. With switch set to "false", pntg works all fine as intended by you. I now understand that it is beyond the ptng plugin to provide keyboard shortcuts therein, this would have to be done by Thunderbird, and that the switch set to "true" even seems to bypass your ptng pipeline entirely. I can live with the 3xtab+3xdown workaround. Thank you very much for all your support and time @ffesl

ffesl commented 2 years ago

@kiki-ja: correction: 3x"tab" + 3x"down"

cleidigh commented 2 years ago

@ffesl Ok this is good. I have to add the other paths and do a bunch of cleanup. Right now it should require the same shortcuts you use with nothing additional, yes? So your work flow is now the same as before.

There are clearly good reasons to add some pre configuration of print properties. Ironically just now I have a request for a print page 1 option, basically for the same reasons as your goals.

So i will create an issue for this and your input on implementation would be helpful. @cleidigh

cleidigh commented 2 years ago

@ffesl I want to understand some comments above. Are you planning on using the new preview and the tabs as your new work flow? If so I will concentrate on the real solution which is having print setup within ptng. The other method will still be a bunch of work. @cleidigh

kiki-ja commented 2 years ago

@cleidigh @ffesl

I will take a different approach and make new requests and suggestions. I prepare to write a new issue.

@kiki-ja