mapper icon indicating copy to clipboard operation
mapper copied to clipboard

Show color usage and warn on spot color deletion

Open dl3sdo opened this issue 10 months ago • 3 comments

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.

dl3sdo avatar Apr 24 '24 15:04 dl3sdo

Screenshot1

dl3sdo avatar Apr 24 '24 15:04 dl3sdo

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

dl3sdo avatar May 02 '24 20:05 dl3sdo

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>
      }
      

dg0yt avatar May 03 '24 06:05 dg0yt

@dg0yt: Following your suggestions: Screenshot2

dl3sdo avatar May 05 '24 19:05 dl3sdo

Integrated and merged with #2222. Tnx!

dg0yt avatar Jun 13 '24 18:06 dg0yt