Ouch! Adding this debug message:
 void ToolbarDefaults::add(string const & func)
 {
        int const tf = lyxaction.LookupFunc(func);
+       lyxerr << "ToolbarDefaults::add " << func << ' ' << tf << '\n'
+              << lyxaction.getActionName(tf) << "\n\n";

        if (tf == -1) {
                lyxerr << "Toolbar::add: no LyX command called `"
                       << func << "' exists!" << endl;
        } else {
                add(tf);
        }
 }

gives this:
Action: dialog-show-new-inset
Arg   : graphics
Pseudoaction exists[252|graphics] = 457
Found the pseudoaction: [252|graphics]
ToolbarDefaults::add dialog-show-new-inset graphics 457
dialog-show-next-inset graphics

Note that that is 'next' not 'new'.

        /**
         * Returns an pseudoaction from a string
         * If you include arguments in func_name, a new pseudoaction
         * will be created if needed.
         */
        int LookupFunc(string const & func_name);

        /** Return the name (and argument) associated with the 
         *  given (pseudo) action
         */
        string const getActionName(int action) const;


-- 
Angus

Reply via email to