On Thu, Oct 2, 2008 at 11:13 PM, Emanuel Rumpf <[EMAIL PROTECTED]> wrote:
> QActions can be grouped in QActionGroups or QMenus
>
> Both, QActionGroups and QMenus have
> the properties setVisible(bool) and setEnabled(bool)
>
> I'm not sure if that's enough.
No, it isn't. QActionGroups are for exclusive actions (radio buttons,
basically -- anywhere where we were using KRadioAction). QMenus are
obviously for menus. We have many, many actions that need to be
enabled or disabled en masse when a general condition changes, such as
a file being loaded or a selection made.
> void conditionChanged( cond_name, menu_or_action ){
>
> if( cond_name == "playing" ){
> cond_true = seq.isPlaying();
> menu_or_action.setEnabled( cond_true );
Yes, that kind of thing. That's what we don't have code for, and
while it's straightforward, there are lots of actions. I'm not keen
to increase the quantity of boilerplate still further, which is what
that implies.
(For what it's worth, I think the simplest way to do this is to
connect a signal that describes the state entry or exit, such as
selectionMade(bool), to the setEnabled slot on each action that
depends on that state. Then when a selection is made, just emit
selectionMade(true), and when it is cleared, emit
selectionMade(false). Still boilerplate, of course. In this scheme,
if an action requires more than one state to be active, then you have
to create a new state for the union of the two.)
Chris
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Rosegarden-devel mailing list
[email protected] - use the link below to unsubscribe
https://lists.sourceforge.net/lists/listinfo/rosegarden-devel