[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Re: The future of KAction
From:       Alexander Dymo <adymo () mksat ! net>
Date:       2005-11-19 12:25:32
Message-ID: 200511191425.32854.adymo () mksat ! net
[Download RAW message or body]

On Saturday 19 November 2005 12:55, Simon Hausmann wrote:
> > bool MyWindow::actionFilter(KAction *action, const QString &menu,
> > 	const QString &group)
> > {
> > 	if (menu == "settings")
> > 		return false;
> > 	else if ((menu == "view") && (group == "navigation"))
> > 	{
> > 		if (action->objectName() == "go back")
> > 			return false;
> > 		return true;
> > 	}
> > 	return true;
> > }
>
> I think it would be a lot easier to just make addActionGroup on the
> plugin's side do nothing if the action group is not defined. The
> application can then decide whether to provide such a placeholder or not.

Yes, that would be easier to do but we already have smth similar with xml
files and that's not flexible enough.

Let's take a look at KDevelop + embedded Kate problem.

Kate defines 26 actions and separators for the "tools_operations" group
under the "tools" menu. There's nothing wrong with that but for KDevelop
we don't need several actions, say "set_filetype", "tools_uppercase", etc.
They are in the same group but we'd still want to remove them from the GUI.
That's why I propose we have an actionFilter(). Usually it will not be used,
group filtering will just work for most cases. But I can see some
applications like KDevelop and Quanta using action filters.
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic