De-selection an Action Group

Posted on
Wed Feb 15, 2023 11:13 am
anyone offline
User avatar
Posts: 125
Joined: Apr 03, 2011
Location: Norfolk, VA

De-selection an Action Group

Is there a keyboard shortcut to un-select an Action Group in the UI after selecting one, and clicking 'Save'?

The only option I see now to do that, is delete the Action and recreate it, without selecting one.

A dynamic list is what I am migrating to instead of including more checkboxes that, hide the Action Group and perform logic to ignore it.

However as I pick at this, I thought I'd just ask is there another way to de-select?

I share my code in the event there is something else I could have done.

Code: Select all
       
    def actionsWithAnExit(self, filter="", valuesDict=None, typeId="", targetId=0):

        action_group_list = [(ag.id,
                              ag.name.lower()) for ag in indigo.actionGroups]

        sorted_list = sorted(action_group_list, key=lambda x: x[1])
        sorted_list.append((0, '-=( Do Not Execute )=-'))
       
        return sorted_list if sorted_list else [("Default", "")]

Posted on
Wed Feb 15, 2023 12:05 pm
jay (support) offline
Site Admin
User avatar
Posts: 18220
Joined: Mar 19, 2008
Location: Austin, Texas

Re: De-selection an Action Group

Ok, so I've read your post many times, and I'm really not clear on what your question is.

Are you talking about the popup menu control on a plugin dialog? If so, it's a standard Mac popup which means something must be selected. If you need a menu item that fundamentally means "nothing is selected" then your idea of adding an extra one is right (though you might consider naming is something else "- select an action group -" or something - you can always add a label under it that describes what happens if you don't select one or if there's some default that happens).

If that's not what your question was, then can you describe your question more (maybe screenshots would help)?

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Wed Feb 15, 2023 12:11 pm
DaveL17 offline
User avatar
Posts: 6756
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: De-selection an Action Group

If I understand, what I've done in the past is to include a "None" option that users can select as an element of the list. When using a list comprehension, I add it after the list is built.

Code: Select all
[("None", "").]

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Wed Feb 15, 2023 12:48 pm
anyone offline
User avatar
Posts: 125
Joined: Apr 03, 2011
Location: Norfolk, VA

Re: De-selection an Action Group

I apologize for the confusion in my previous post and the lack of a screenshot.

Based on your responses, creating an Action Group menu, and adding an extra item that represents "nothing is selected" is the correct approach. I appreciate the suggestions on how to name it, as well as to include a label, which more clearly than my post :lol: , explains how to change the selection, after clicking save.

For a moment, it felt like I was overcomplicating it by creating my own menu, sorting, etc., just to add one item.

Thank you.

Posted on
Wed Feb 15, 2023 3:08 pm
jay (support) offline
Site Admin
User avatar
Posts: 18220
Joined: Mar 19, 2008
Location: Austin, Texas

Re: De-selection an Action Group

I think the thing that threw us off is "Action Group". It really has nothing to do with Action Groups per se: it's actually about constructing popup lists in a Plugin dialog and how to handle the "i don't have a selection" case. :wink:

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 12 guests