Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show color usage and warn on spot color deletion #2235

Closed

Conversation

dl3sdo
Copy link
Member

@dl3sdo dl3sdo commented Apr 24, 2024

When a user wants to delete a color, the warning message was ambiguous by mixing up symbols and objects (see #2127).
This PR merges #2127, #2222, #2209.
It shows one warning dialog if

  • the color is used by symbols
  • the color is used as a spot color by other colors.

In addition the warning messages specifies the number of symbols, objects and other map colors that will be affected by the color removal.
A more detailed warning is available when removing spot colors.

dg0yt and others added 5 commits April 20, 2024 13:22
... deleting the last spot color.

When overprinting simulation is enabled while deleting the last spot color,
the map editor will become empty, and the overprinting action becomes
disabled. However, the program didn't actually activate the overprinting
simulation mode, so the user was locked out from re-enabling the normal
rendering of the map. We must explicitly trigger the action.

(Reactions are bound to trigger() to avoid hard-to-debug activation loops
from normal state changes.)

Co-authored-by: Libor Pechacek <lpechacek@gmx.com>
A color entry may serve as a spot color without direct use in symbols.
So far Mapper allowed silent removal of these color entries. This patch
adds a warning which is shown when the user tries to remove such a spot
color.

Co-authored-by: Matthias Kuehlewein <github@kuehlewein.de>
Co-authored-by: Kai Pastor <dg0yt@darc.de>
Add function to return a list of map colors that use a specific spot
color.
Remove function that just counts these map colors.
Merging the functionality of issuing a warning about spot color removal
with the functionality of counting the usage in symbols and objects.
As a result just a single warning is showed. Use 'setDetailedText'
function to show more details with respect to spot color removal.
@dl3sdo dl3sdo marked this pull request as draft April 24, 2024 15:49
@dl3sdo
Copy link
Member Author

dl3sdo commented Apr 24, 2024

Screenshot1

@dl3sdo
Copy link
Member Author

dl3sdo commented May 2, 2024

Kai, Libor: What do you think? Does this PR meet your functional expectations?

@dg0yt
Copy link
Member

dg0yt commented May 3, 2024

I couldn't look at it in detail.

  • There is a lot of extra code in a single GUI class method which might be better separated into non-GUI functions with clear interfaces.
  • The translatable strings must form whole sentences or paragraphs. My suggestion:
    • General message:
      tr("Color \"%1\" is used by other elements. Removing the color will change the appearance of these elements. Do you really want to remove it?").arg(color_to_be_removed->getName());
    • Details:
      if (<used_by_colors>)
      {
          tr("This color is used as a spot color by the following map colors:")
          <list>
      }
      if (<used_by_symbols>)
      {
          tr("This color is used by the following symbols:")
          <list of symbol_name: n objects>
      }

@dl3sdo
Copy link
Member Author

dl3sdo commented May 5, 2024

@dg0yt: Following your suggestions:
Screenshot2

@dg0yt dg0yt self-assigned this May 29, 2024
@dg0yt
Copy link
Member

dg0yt commented Jun 13, 2024

Integrated and merged with #2222. Tnx!

@dg0yt dg0yt closed this Jun 13, 2024
@dl3sdo dl3sdo deleted the warn-on-spot-color-deletion branch June 13, 2024 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants