Home GnuPG
Diffusion GpgOL 15412b7cc74c

Change the GpgOL encryption icon according to its state

Description

Change the GpgOL encryption icon according to its state

* News:Update.
* src/ribbon-callbacks.cpp (get_action_icon)
added new function
* src/ribbon-callbacks.h
declare new get_action_icon function
* src/gpgoladdin.cpp (GpgolRibbonExtender::Invoke)
in switch(dispid) for case IDI_SIGN_ENCRYPT_40PNG call the new
get_action_icon function instead of getIcon
* src/dialogs.h
declare new constances for the 3 new icons and the offset
* src/dialogs.rc
add definition for the 3 new icons
* Addded SVG and PNG version of the 3 icons
* src/icons/enc-only-40.png
* src/icons/enc-only.svg
* src/icons/no-sign-enc-40.png
* src/icons/no-sign-enc.svg
* src/icons/sign-only-40.png
* src/icons/sign-only.svg

The new function tries to gets the context from the ribbon control,
then it tries to get the OOM "CurrentItem" from the context as mailitem
and fromit the message via get_oom_base_message. It then uses the
get_gpol_draft_info_flags function on the message to see what action
should be performed on send and calculates the id of the icon to display
based on the returned flags and calls and returns getIcon with the id.

Event Timeline

This works suprisingly well, without explicit invalidations i would not have expected that get icon is called automatically after the button or a subbutton is clicked. But I think that this then would require at least a test on the oldest supported version from us, too. Do we even have an old GpgOL test system?

You know that I am absolutely not a fan of this though. Since now we have the "Open Lock" and the "Closed Lock" and both have the same caption "secure". This is just not how toggle buttons work. Because you would have to change the text then, too. And then it will say the opposite of what the user gets when the button is clicked. A toggle button shows a state and that state can be activated. And users are now used to this behavior anyway. Any change will be rather irritating. As a user I would not like either. Added to that are the tecnical risks. It is also illogical, e.g. now if you don't sign but encrypt the lock is closed but not toggled. Or if you only sign the lock is open with a ribbon but not toggled.
As written in the task, if we really wanted to make it clear what happens we should take page out of KMails book and add "This message will be signed / encrypted" somewhere above the text input field. I don't think otherwise it is helped in any way that people accidentally send out unecrypted mails, since the icon can be in the reduced menuband and much smaller or even moved out of the default ribbon bar into a scroll area.

A full bug is that In the message list if you use inline reply it does not work. There the icon is not updated

at all You can remove sign / encrypt and so on. I can make a video if I log into an X11 session, but I think it should be easy to reproduce.

The minature icon

would need to be adapted, too since users can move it using customize menuband and then you need to open and close the lock.