Commit Graph

1204 Commits

Author SHA1 Message Date
Filippo Gentile cc0770501d CMake: Bump project version to 6.1.0 2022-01-27 19:07:02 +01:00
gfgit d407eb98f0
Merge pull request #46 from gfgit/feature/paged_printing
Feature paged printing

- Port shift graph and line graph to common IGraphScene interface
- Create a proxy scene to draw page margins on top of source scene
- Refactor print system, so it can print generic IGraphScene
2022-01-27 18:57:41 +01:00
Filippo Gentile bdd6be0886 Translations: update Italian translation 2022-01-27 18:56:35 +01:00
Filippo Gentile 2d3336a14f PrintWorker: lock task when accessing members
This is not fully correct because QPainter also keeps a reference to
QPrinter object so it might be better to copy QPrinter or transfer
ownership to task
2022-01-27 18:31:32 +01:00
Filippo Gentile 147b532395 IQuittableTask: add lockTask() and unlockTask() methods
Add Doxygen documentation to class
2022-01-27 18:19:59 +01:00
Filippo Gentile f5279788ce PrintWorker: move to helper/model subdirectory
Move also PrintWorkerHandler and printdefs.h
2022-01-27 17:44:40 +01:00
Filippo Gentile 539f07472f ShiftGraphEditor: use new print dialog 2022-01-27 17:32:52 +01:00
Filippo Gentile ea67bc93a8 ShiftGraphPrintDlg: new dialog to print shift graph
ShiftGraphSceneCollection: new collection to send shif graph in printing
2022-01-27 17:32:52 +01:00
Filippo Gentile 04c0b5cdfd PrintWorker: abort when print paged returns false 2022-01-27 17:32:52 +01:00
Filippo Gentile 53421d4507 PrintWizard: rename QPrinter member to m_printer 2022-01-26 16:20:08 +01:00
Filippo Gentile a2a487fad3 ScenePrintPreviewDlg, PrintPreviewSceneProxy: adapt to namespace changes 2022-01-26 16:14:07 +01:00
Filippo Gentile ed06754520 PrintWizard: use PrintWorkerHandler
- Move user interaction code to printdefs.h
2022-01-26 16:12:37 +01:00
Filippo Gentile 34b277e6f4 PrintWorker: adapt to namespace change, delete scenes
PrinterOptionsWidget: adapt to namespace change
2022-01-26 16:11:19 +01:00
Filippo Gentile fe23e91071 IGraphSceneCollection: remove takeOwnershipOfLastScene()
Document code, ownership is always passed to the caller now.
SceneSelectionModel: adapt code
2022-01-26 16:10:02 +01:00
Filippo Gentile aceaf41475 PrintWorkerHandler: new class to handle PrintWorker
- PrintHelper: move classes in Print namespace so they can be forward
declared
2022-01-26 16:03:16 +01:00
Filippo Gentile 69318af831 PrintHelper: remove unused include 2022-01-26 12:28:21 +01:00
Filippo Gentile c02c523433 PrintWizard: adapt to IGraphSceneCollection
- PrintWorker: do not depend on LineGraphScene
- PrintSelectionPage: adapt to IGraphSceneCollection
- printdefs.h: do not depend on LineGraphScene type
2022-01-26 12:28:05 +01:00
Filippo Gentile ce1d6329d3 SceneSelectionModel: port to IGraphSceneCollection 2022-01-26 12:24:27 +01:00
Filippo Gentile b36e260ab4 IGraphSceneCollection: new class for printing multiple scenes
This allows to remove dependency of PrintWorker on LineGraphScene
2022-01-26 12:23:56 +01:00
Filippo Gentile 163dd176bc PrintWorke: fix print layout for PDF
It was checking wrong flag
2022-01-26 00:39:15 +01:00
Filippo Gentile 1c26d4f771 PrintWizard: tell user when done printing, disable Cancel button
- Also do not prompt user when closing dialog if printing already
finished
2022-01-25 23:52:45 +01:00
Filippo Gentile 98eec5abeb PrintPreviewSceneProxy: allocate memory in advance
This is a small optimization
2022-01-25 23:40:29 +01:00
Filippo Gentile 85da6c49f2 PrintWorker: better progress reporting, better PDF handling
- Split each scene in 10 steps so user sees progress on almost each page
- Allow to print multiple paged scenes on signle PDF
- Reset painter after each scene so transformations do not accumulate.
- Fix paged printing was adding pages on wrong device
- PDF: set creator and document title
2022-01-25 23:40:00 +01:00
Filippo Gentile d85cfe3d62 PrintHelper: better progress reporting, removed isFirstPage flag 2022-01-25 23:36:36 +01:00
Filippo Gentile c4e24b954c PrintWizard: apply layout on construction 2022-01-25 22:34:19 +01:00
Filippo Gentile d095abacd5 PrinterOptionsWidget: save last inserted directory
- ScenePrintPreviewDlg: change margin width units

- ScenePrintPreviewDlg and PrinterOptionsWidget: apply layout
2022-01-25 22:34:00 +01:00
Filippo Gentile a3eb525e84 PrintPreviewSceneProxy: fix painting 2022-01-25 22:32:36 +01:00
Filippo Gentile d1df52524a PrintHelper: rename members and fix printing 2022-01-25 22:32:05 +01:00
Filippo Gentile 967a7aefd4 PrintBasicOptions: change defaults 2022-01-25 22:31:16 +01:00
Filippo Gentile 2688c075c7 PrintOptionsPage: set and update scene page layout 2022-01-24 15:40:18 +01:00
Filippo Gentile bb4983f9eb ScenePrintPreviewDlg, PrintWizard: reset page margins 2022-01-24 15:39:49 +01:00
Filippo Gentile 1f89e8e0e6 ScenePrintPreviewDlg: fix page setup not applied correctly 2022-01-24 14:52:45 +01:00
Filippo Gentile 5d7975a71e PrintHelper: set default DPI to Qt default 72 2022-01-24 14:52:17 +01:00
Filippo Gentile a6af65e93e PrintOptionsPage: fix crash m_scene member not initialized
- Setup page outside of initializePage() function
- Use first selected scene from wizard
2022-01-24 13:58:41 +01:00
Filippo Gentile add51736d4 PrintWizard: custom page validation to work around QWizard
- New getFirstScene() function to get first selected scene
2022-01-24 13:54:26 +01:00
Filippo Gentile 0d3e07050b PrintPreviewSceneProxy: adapt to printer resolution
- ScenePrintPreviewDlg: fix printer resolution
- PrintWizard: do not force resolution on printer
2022-01-24 13:27:54 +01:00
Filippo Gentile 04f7123cf2 PrintHelper: to accomodate printer resolution use new scale factor
We need a premultiplied scale factor to compensate effects of printer
resolutions.
2022-01-24 13:27:54 +01:00
Filippo Gentile adeca33348 MainWindow: fix Print::OutputType enum class 2022-01-24 13:27:54 +01:00
Filippo Gentile 0ebc219cf7 PrintOptionsPage: use new PrinterOptionsWidget 2022-01-24 13:27:54 +01:00
Filippo Gentile 682bb816d9 PrintWorker: use new PrintBasicOptions structure 2022-01-24 13:27:54 +01:00
Filippo Gentile 2a8922c34b PrintWizard: use new PrintBasicOptions structure 2022-01-24 13:27:54 +01:00
Filippo Gentile 2358f4296a PrinterOptionsWidget: new common widget to set options
printdefs.h add PrintBasicOptions structure
2022-01-24 13:27:54 +01:00
Filippo Gentile 1e1478ebd0 PrintWorker: adapt to PrintHelper changes 2022-01-23 22:50:04 +01:00
Filippo Gentile 13ae3f5450 PrintHelper: lower default printer resolution 2022-01-23 22:49:13 +01:00
Filippo Gentile 5869fa3f3f ScenePrintPreviewDlg: show page count, adapt to changes 2022-01-23 22:48:58 +01:00
Filippo Gentile 613088b68d PrintPreviewSceneProxy: adapt to PrintHelper changes 2022-01-23 22:45:00 +01:00
Filippo Gentile 6b15cd6402 PrintHelper: split render parameters, remove useless class
- Split PageLayoutOpt and PageLayoutScaled
- Remove IRenderScene, use IGraphScene directly
- Move calculatePageCount() to PrintHelper
- Move fixPageSize() to PrintHelper
- Render scene headers
- Define default PrinterResolution
2022-01-23 22:43:37 +01:00
Filippo Gentile 3a9451a55c PrintPreviewSceneProxy: remove comments, rename members
- New calculatePageCount() function to do central calculation of page
count.
- Emit pageCountChanged() when updating layout.
2022-01-23 21:52:16 +01:00
Filippo Gentile 2f58a64f2a PrintPreviewSceneProxy: change color groups to 3
3 color groups are enough to avoid 2 adjacent pages of same color.
Make color wash out a bit less transparent so page borders get more
contrast.

Fix extra page rects appearing outside of scene.
2022-01-23 21:40:03 +01:00
Filippo Gentile 851520ef86 PrintPreviewSceneProxy: fix glitch, borders disappearing on scrolling 2022-01-23 21:09:36 +01:00