Project

General

Profile

Bug #11781

orientation combobox does not update when enter print view

Added by Dan Torop almost 2 years ago. Updated almost 2 years ago.

Status:
Fixed
Priority:
Low
Assignee:
-
Category:
Printing
Target version:
Start date:
10/24/2017
Due date:
% Done:

100%

Estimated time:
Affected Version:
git master branch
System:
Debian
bitness:
64-bit
hardware architecture:
amd64/x86

Description

When entering the print view, the page orientation shown in the right panel combobox may not match the current image orientation.

STEPS TO REPRODUCE

METHOD 1

  1. enter print view
  2. ensure the the orientation combobox in the right panel says "portrait" (change it if necessary)
  3. enter lighttable view
  4. select an image with landscape orientation
  5. enter print view

METHOD 2

  1. enter print view
  2. ensure the the orientation combobox in the right panel says "landscape" (change it if necessary)
  3. enter lighttable view
  4. select an image with portrait orientation
  5. enter print view

EXPECTED BEHAVIOR

The orientation combobox on the right panel should correctly show the orientation of the image, and correspond to the orientation show in the center view layout display.

ACTUAL BEHAVIOR

The orientation combobox on the right panel will not update to the orientation of the second image opened, and will not match the center view. The layout view in the center panel will show the correct orientation.

PRELIMINARY ANALYSIS

The right panel figures out the image orientation via _set_orientation() in libs/print_settings.c. The _set_orientation() code is called when the filmstrip is clicked, or upon gui_init() or gui_reset(). But it does not get called when entering the print view, and hence the combobox does not update to the orientation of the selected image. Instead it retains its most recent value.

Note that if you choose an image in darkroom view via the filmstrip then enter print view, the orientation combobox will display correctly, as the selection will have sent DT_SIGNAL_VIEWMANAGER_FILMSTRIP_ACTIVATE, which will update the combobox. Of course if you then crop the image in darkroom to change its aspect ratio, the print combobox will be inaccurate again.

Note also that there are two _set_orientation() routines, one in libs/print_settings.c and one in views/print.c. Both use the same algorithm to detect orientation.

Perhaps the print view needs a way to signal the print settings when the user enters the print view or changes the image in print view? This could remove duplicated code if determining orientation was entirely the responsibility of the print view. Alternately, print settings could listen for DT_SIGNAL_MOUSE_OVER_IMAGE_CHANGE and DT_SIGNAL_DEVELOP_IMAGE_CHANGED, though that is an awkward fix.

No patch proposed, as I'm unsure of the best route to fix this.

Associated revisions

Revision 935276a4 (diff)
Added by Dan Torop almost 2 years ago

print: print settings panel figures out orientation

Update orientation when view is changed to print or when a new mipmap
of the current image is generated. Also when view is changed to print,
get the image id of the current image. Pass orientation changes on to
the print view.

Remove orientation detection from print view. The orientation
detection in print_settings now does this work and passes the results
on via dt_view_print_settings().

Also eliminate unused iwidth and iheight values from print view.

Note that when mipmap is generated we don't set current image id or
zero out dimensions as these only change when entering print view or
when a new image is selected from the filmstrip.

Fixes #11781.

History

#1 Updated by Dan Torop almost 2 years ago

It looks like it is possible to catch DT_SIGNAL_VIEWMANAGER_FILMSTRIP_ACTIVATE in print_settings.c to detect when the user enters print view, and then populate orientation of the image accordingly. In addition, catching DT_SIGNAL_DEVELOP_MIPMAP_UPDATED in print_settings.c will handle cases when the user enters from darkroom mode and the image orientation cannot be determined until a mipmap is generated.

If _set_orientation() in print_settings.c finishes up by calling dt_view_print_settings(), it will pass the new orientation on to the print view. Then all orientation detection code from the print view (print.c) can be removed.

Still testing this out. I could well be missing something...

#2 Updated by Dan Torop almost 2 years ago

PR 1546 should solve this as well as #11780.

#3 Updated by Dan Torop almost 2 years ago

  • % Done changed from 0 to 100
  • Status changed from New to Fixed

#4 Updated by Roman Lebedev almost 2 years ago

  • Target version set to 2.4.0

Also available in: Atom PDF

Go to top