Addon: add dynamic tooltip on submit button when no job type is selected #104326

Merged
Sybren A. Stüvel merged 4 commits from abelli/flamenco:addon-tooltip into main 2024-09-05 14:46:16 +02:00
Contributor

Overview

This patch adds a dynamic text to the tooltip presented in the flamenco submit button. If there are no job types selected, it will append the text "A job type must the selected first" to show the user why the button is disabled.

Fix: #104325

Demo

Captura de tela de 2024-07-20 13-02-27.png

References

## Overview This patch adds a dynamic text to the tooltip presented in the flamenco submit button. If there are no job types selected, it will append the text "A job type must the selected first" to show the user why the button is disabled. Fix: #104325 ## Demo ![Captura de tela de 2024-07-20 13-02-27.png](/attachments/f07d855f-ad4b-47cc-bc9b-9ef9519a3916) ## References - https://docs.blender.org/api/current/bpy.types.Operator.html#bpy.types.Operator.description - https://blender.stackexchange.com/a/180607
Mateus Abelli added 1 commit 2024-07-20 18:26:26 +02:00
Sybren A. Stüvel requested changes 2024-07-22 11:33:46 +02:00
Sybren A. Stüvel left a comment
Owner

There's a built-in method that's specifically there for these cases: you can call cls.poll_message_set("reason") from the poll() function.

There's a built-in method that's specifically there for these cases: you can call `cls.poll_message_set("reason")` from the `poll()` function.
Mateus Abelli added 1 commit 2024-07-23 00:40:01 +02:00
Author
Contributor

There's a built-in method that's specifically there for these cases: you can call cls.poll_message_set("reason") from the poll() function.

Oh I didn't see that method earlier, I can't believe it was there at the same Operator documentation page and I missed it.

I implemented and that single line nailed exactly what I was trying to achieve but much better, here is a demo of how it looks now:

Captura de tela de 2024-07-22 19-36-27.png

> There's a built-in method that's specifically there for these cases: you can call `cls.poll_message_set("reason")` from the `poll()` function. Oh I didn't see that method earlier, I can't believe it was there at the same [Operator documentation](https://docs.blender.org/api/current/bpy.types.Operator.html#bpy.types.Operator.poll_message_set) page and I missed it. I implemented and that single line nailed exactly what I was trying to achieve but much better, here is a demo of how it looks now: ![Captura de tela de 2024-07-22 19-36-27.png](/attachments/c8d960b0-310c-43e7-af09-d39724d39f99)

Better!

I think the text can be simplified a little, to make it a little bit less formal: "No job type selected".

Better! I think the text can be simplified a little, to make it a little bit less formal: "No job type selected".
Mateus Abelli added 2 commits 2024-07-24 00:46:25 +02:00
Sybren A. Stüvel added this to the v3.6 milestone 2024-08-26 18:25:48 +02:00
Sybren A. Stüvel merged commit 6eb4b12840 into main 2024-09-05 14:46:16 +02:00
Sybren A. Stüvel deleted branch addon-tooltip 2024-09-05 14:46:18 +02:00

Thanks!

Thanks!
Sign in to join this conversation.
No description provided.