Merge lp://staging/~ahayzen/ubuntu-printing-app/page-range-validate-and-count into lp://staging/ubuntu-printing-app

Proposed by Andrew Hayzen
Status: Approved
Approved by: Michael Sheldon
Approved revision: 73
Proposed branch: lp://staging/~ahayzen/ubuntu-printing-app/page-range-validate-and-count
Merge into: lp://staging/ubuntu-printing-app
Diff against target: 918 lines (+666/-36)
11 files modified
po/ubuntu-printing-app.pot (+25/-9)
ubuntu-printing-app/backend/CMakeLists.txt (+2/-1)
ubuntu-printing-app/backend/UbuntuPrintingApp/backend.cpp (+2/-0)
ubuntu-printing-app/backend/UbuntuPrintingApp/pagerangevalidator.cpp (+192/-0)
ubuntu-printing-app/backend/UbuntuPrintingApp/pagerangevalidator.h (+75/-0)
ubuntu-printing-app/components/LabelRow.qml (+2/-0)
ubuntu-printing-app/pages/PrintPage.qml (+53/-21)
ubuntu-printing-app/tests/qmltests/tst_LabelRow.qml (+8/-0)
ubuntu-printing-app/tests/qmltests/tst_PrintPage.qml (+152/-5)
ubuntu-printing-app/tests/unittests/backend/CMakeLists.txt (+4/-0)
ubuntu-printing-app/tests/unittests/backend/tst_pagerangevalidator.cpp (+151/-0)
To merge this branch: bzr merge lp://staging/~ahayzen/ubuntu-printing-app/page-range-validate-and-count
Reviewer Review Type Date Requested Status
Michael Sheldon (community) Approve
Review via email: mp+321547@code.staging.launchpad.net

Commit message

* Add validation to copies and page range fields with tests

Description of the change

* Add validation to copies and page range fields with tests

To post a comment you must log in.
Revision history for this message
Michael Sheldon (michael-sheldon) wrote :

Page ranges shouldn't be sorted, as the user may have a valid reason for wanting to specify their pages in a different order (e.g. "1, 5, 3" should print in that order), this is the current behaviour for existing print dialogs.

Also it'd be nice to support reversed ranges, so "5-1" would print 5, 4, 3, 2, 1 in that order. Or a more complicated example could be "3-1, 5, 4" should print 3, 2, 1, 5, 4.

review: Needs Fixing
Revision history for this message
Andrew Hayzen (ahayzen) wrote :

As discussed, cups doesn't seem to support overlapping ranges or descending [0]. So for now we are going to do de-duplication and ascending order. It seems that other apps such as documentviewer (gtk), must rendering an intermediate PDF which has the page order how they want.

0 - https://www.cups.org/doc/options.html#PAGERANGES

Revision history for this message
Andrew Hayzen (ahayzen) wrote :

Reported bug 1680048 for advanced page ranges. And now setting Qt.ImhPreferNumbers for the page range field.

Revision history for this message
Michael Sheldon (michael-sheldon) wrote :

Looks good :)

review: Approve

Unmerged revisions

73. By Andrew Hayzen

* Set Qt.ImhPreferNumbers for page-ranges text field

72. By Andrew Hayzen

* Remove unneeded TODO

71. By Andrew Hayzen

* Ensure NoError state is always set
* Update naming of error for 5-3

70. By Andrew Hayzen

* Rebase onto lp:ubuntu-printing-app

69. By Andrew Hayzen

* Add validation to copies field with tests

68. By Andrew Hayzen

* Add page range validation and counting with tests

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches

to all changes: