D22715: Save and load page margins

2019-07-27 Thread Dominik Haumann
dhaumann added a comment.


  I think adding the printer name makes sense. We could go the full road, see: 
https://stackoverflow.com/a/14979437/2224190

REPOSITORY
  R39 KTextEditor

REVISION DETAIL
  https://phabricator.kde.org/D22715

To: hoffmannrobert, cullmann
Cc: ltoscano, aacid, dhaumann, cullmann, kwrite-devel, kde-frameworks-devel, 
univerz, LeGast00n, sbergeron, domson, michaelh, ngraham, bruns, demsking, sars


D22715: Save and load page margins

2019-07-27 Thread Albert Astals Cid
aacid added a comment.


  > It seems the QPrinter/QPrintDialog still do not correctly read info from 
CUPS
  
  E_NEEDS_MORE_INFO
  
  > neither does it correctly remember print settings
  
  This is by design AFAIK, but maybe a patch would be accepted if people would 
submit one. I'm still not convinced that it makes sense to be honest, the fact 
that 3 months ago i printed and A5 page in b has nothing to do with todays 
printing session.

REPOSITORY
  R39 KTextEditor

REVISION DETAIL
  https://phabricator.kde.org/D22715

To: hoffmannrobert, cullmann
Cc: ltoscano, aacid, dhaumann, cullmann, kwrite-devel, kde-frameworks-devel, 
univerz, LeGast00n, sbergeron, domson, michaelh, ngraham, bruns, demsking, sars


D22715: Save and load page margins

2019-07-27 Thread Luigi Toscano
ltoscano added subscribers: aacid, ltoscano.
ltoscano added a comment.


  I think @aacid recently (well, some time ago) worked on the Qt printing code 
and he may at least have an idea of the status of this.

REPOSITORY
  R39 KTextEditor

REVISION DETAIL
  https://phabricator.kde.org/D22715

To: hoffmannrobert, cullmann
Cc: ltoscano, aacid, dhaumann, cullmann, kwrite-devel, kde-frameworks-devel, 
univerz, LeGast00n, sbergeron, domson, michaelh, ngraham, bruns, demsking, sars


D22715: Save and load page margins

2019-07-26 Thread Christoph Cullmann
cullmann added a comment.


  Should we add the printer name to the settings keys?

REPOSITORY
  R39 KTextEditor

REVISION DETAIL
  https://phabricator.kde.org/D22715

To: hoffmannrobert, cullmann
Cc: dhaumann, cullmann, kwrite-devel, kde-frameworks-devel, univerz, LeGast00n, 
sbergeron, domson, michaelh, ngraham, bruns, demsking, sars


D22715: Save and load page margins

2019-07-26 Thread Dominik Haumann
dhaumann added a comment.


  Btw, I recently wrote a mail to John Layt with the following content. The 
linked bug may be closed with this change:
  
  Hi John,
  
  quick question to the QPrinter: We still have issues in Kate (and other KDE 
apps I assume), that the margins of the QPrintDialog are not displayed / 
remembered correctly.
  
  I once committed a workaround in the KDE 4 times [1], but removed this 
workaround again for KF5 / Qt5 thinking that this was fixed. But it seems it 
isn't:
  
  - https://bugs.kde.org/show_bug.cgi?id=383697
  - https://bugs.kde.org/show_bug.cgi?id=406627
  
  Do you have any quick pointers to this? It seems the QPrinter/QPrintDialog 
still do not correctly read info from CUPS, neither does it correctly remember 
print settings, is that correct?
  
  Do you happen to have a good solution to this?
  On stackoverflow [2] I can find that others also have this issue - and a 
solution is to load/save each property of QPrinter. But I am not sure this 
works well if you have multiple printers.
  
  Any pointers welcome [3].
  
  Best regards
  
  [1] 
https://cgit.kde.org/kate.git/commit/?id=1aa12bace62fffbcad357623842a0fc01607b3c0
  [2] https://stackoverflow.com/a/14979437/2224190
  [3] https://xkcd.com/138/

REPOSITORY
  R39 KTextEditor

REVISION DETAIL
  https://phabricator.kde.org/D22715

To: hoffmannrobert, cullmann
Cc: dhaumann, cullmann, kwrite-devel, kde-frameworks-devel, univerz, LeGast00n, 
sbergeron, domson, michaelh, ngraham, bruns, demsking, sars


D22715: Save and load page margins

2019-07-26 Thread Dominik Haumann
dhaumann added a comment.


  Since the former patch was originally from me: I agree to accept it, but it 
has it's drawbacks: if you have multiple printers, having different margins is 
not possible, since this is not saved per printer.

REPOSITORY
  R39 KTextEditor

REVISION DETAIL
  https://phabricator.kde.org/D22715

To: hoffmannrobert, cullmann
Cc: dhaumann, cullmann, kwrite-devel, kde-frameworks-devel, univerz, LeGast00n, 
sbergeron, domson, michaelh, ngraham, bruns, demsking, sars


D22715: Save and load page margins

2019-07-24 Thread Christoph Cullmann
This revision was automatically updated to reflect the committed changes.
Closed by commit R39:2d02e5c684e3: Save and load page margins (authored by 
hoffmannrobert, committed by cullmann).

REPOSITORY
  R39 KTextEditor

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D22715?vs=62475=62476

REVISION DETAIL
  https://phabricator.kde.org/D22715

AFFECTED FILES
  src/printing/kateprinter.cpp

To: hoffmannrobert, cullmann
Cc: cullmann, kwrite-devel, kde-frameworks-devel, LeGast00n, sbergeron, domson, 
michaelh, ngraham, bruns, demsking, sars, dhaumann


D22715: Save and load page margins

2019-07-24 Thread Christoph Cullmann
cullmann accepted this revision.
cullmann added a comment.
This revision is now accepted and ready to land.


  Thanks!

REPOSITORY
  R39 KTextEditor

BRANCH
  save_and_load_page_margins

REVISION DETAIL
  https://phabricator.kde.org/D22715

To: hoffmannrobert, cullmann
Cc: cullmann, kwrite-devel, kde-frameworks-devel, LeGast00n, sbergeron, domson, 
michaelh, ngraham, bruns, demsking, sars, dhaumann


D22715: Save and load page margins

2019-07-24 Thread Robert Hoffmann
hoffmannrobert updated this revision to Diff 62475.
hoffmannrobert added a comment.


  - Use KTextEditor::EditorPrivate::config()

REPOSITORY
  R39 KTextEditor

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D22715?vs=62470=62475

BRANCH
  save_and_load_page_margins

REVISION DETAIL
  https://phabricator.kde.org/D22715

AFFECTED FILES
  src/printing/kateprinter.cpp

To: hoffmannrobert, cullmann
Cc: cullmann, kwrite-devel, kde-frameworks-devel, LeGast00n, sbergeron, domson, 
michaelh, ngraham, bruns, demsking, sars, dhaumann


D22715: Save and load page margins

2019-07-24 Thread Christoph Cullmann
cullmann requested changes to this revision.
cullmann added a comment.
This revision now requires changes to proceed.


  I think this is a good idea.
  
  Instead of
  
  KSharedConfig::openConfig()
  
  one should use
  
  KTextEditor::EditorPrivate::config()
  
  otherwise this is fine for me.

REPOSITORY
  R39 KTextEditor

REVISION DETAIL
  https://phabricator.kde.org/D22715

To: hoffmannrobert, cullmann
Cc: cullmann, kwrite-devel, kde-frameworks-devel, LeGast00n, sbergeron, domson, 
michaelh, ngraham, bruns, demsking, sars, dhaumann


D22715: Save and load page margins

2019-07-24 Thread Robert Hoffmann
hoffmannrobert created this revision.
Herald added projects: Kate, Frameworks.
Herald added subscribers: kde-frameworks-devel, kwrite-devel.
hoffmannrobert requested review of this revision.

REVISION SUMMARY
  Adapt and reapply former fix from
  
https://cgit.kde.org/kate.git/commit/?id=1aa12bace62fffbcad357623842a0fc01607b3c0
  which was removed when migrating to Qt5.

TEST PLAN
  Modify page margins in Printer Settings. Click OK and Print.
  Without the patch, the changes disappear, with the patch applied the changed
  margins are remembered in ~/.config/katerc and survive the restart of kate.

REPOSITORY
  R39 KTextEditor

BRANCH
  save_and_load_page_margins

REVISION DETAIL
  https://phabricator.kde.org/D22715

AFFECTED FILES
  src/printing/kateprinter.cpp

To: hoffmannrobert
Cc: kwrite-devel, kde-frameworks-devel, LeGast00n, sbergeron, domson, michaelh, 
ngraham, bruns, demsking, cullmann, sars, dhaumann