[There are children talking to me on all sides so I'll keep this short, or at least confusing and ill-thought-out -- I can write again later if this doesn't help]
On Sun, Mar 29, 2009 at 2:22 AM, Julie S <[email protected]> wrote: > If so, how do I code the createAction() for these since I do not see a slot > to call, or do I just use SLOT(slotInvokeCommand()) which is from > CommandRegististry() class. This is the crux of the question -- there would be no slot to call, without the CommandRegistry. The whole setup with the CommandRegistry was designed (before our new createAction stuff) as an attempt to localise everything about the command within the command class itself, so as to remove all of its code from NotationView. That meant the command's name, shortcut etc., but most of all it meant the code that was called from the action callback -- no slot needed. Every command constructed this way has the same slot -- slotInvokeCommand in ActionCommandRegistry (set up using our new createAction at ActionCommandRegistry.cpp:51). This turned out not to be a terribly effective way to deal with most of the commands, because many of them are too specific in their requirements to be run from a single slot (e.g. any that need to get arguments from the user). Also, it was quite a lot of work to convert commands to the CommandRegistry method (even if it was largely cut and paste, there was quite a lot of it). So that was a bit of a dead end, but it does have the nice property of removing the slots from NotationView for actions that have already been converted. Anyway, so this means that any code to work out action texts, shortcuts etc in the individual command classes is likely to be redundant now (though benignly so -- probably never called since I converted the command registry classes themselves to use createAction). But the command registry itself is worth hanging on to, because it cuts out a lot of boilerplate code from NotationView in the form of slotDoSomethingOrOther functions that do nothing except query the current selection and run a command on it. NB this means we do _not_ need any calls to createAction for these classes in the notation view -- they are all registered by CommandRegistry. They still need complete entries in the rc file though. Sorry if confusing, I can add "clean up these command classes & remove redundant bits" to my todo list if you'd like. Chris ------------------------------------------------------------------------------ _______________________________________________ Rosegarden-devel mailing list [email protected] - use the link below to unsubscribe https://lists.sourceforge.net/lists/listinfo/rosegarden-devel
