Review Request: TaskManager: TaskAction changes from IconTasks

Aaron J. Seigo aseigo at kde.org
Wed Nov 2 13:14:52 UTC 2011



> On Nov. 1, 2011, 2:05 p.m., Aaron J. Seigo wrote:
> > libs/taskmanager/taskactions.cpp, line 384
> > <http://git.reviewboard.kde.org/r/103004/diff/1/?file=39919#file39919line384>
> >
> >     we have a name, it should be used. it hardly matters what the eventual Launcher is called. shortening it with the removal of "It Is" is probably alright ("computer application english" :)
> 
> Craig Drummond wrote:
>     "Show A Launcher for Systemsettings When It is Not Running" is a *very* long menu item. What advantage does adding the name here give? The user already right-clicked on the taskbar entry - so they know what the item is. Placing its name here just adds extra noise. In fact I'd actually prefer just "Pin To Taskbar" and "Unpin From Taskbar"
> 
> Aaron J. Seigo wrote:
>     a) it tells the user what is (likely) to happen with the launcher; as it doesn't actually relate directly to the window itself, this is useful information .. particularly as many times you can't even see the name of the application in the task widget button, so have nothing to really reference visually.
>     
>     b) "pin" has got to be one of the worst bits of new jargon that has come with docks. in my testing with run-of-the-mill users not used to docks they tend to fail with complete reliability at explaining what it will do
>     
>     it could be shortened to just "Show a launcher for <name>" though?
> 
> Craig Drummond wrote:
>     I still disagree with adding the name. We dont have "Close <name>", "Minimise <name>". So why is "Show A Launcher" any different?

because close, minimize, etc. all operate on the window, while the launcher operates on something that isn't necessarily the window.

but since we're going back and forth on this point, i'll compromise on this point: let's try it your way without a name :)


> On Nov. 1, 2011, 2:05 p.m., Aaron J. Seigo wrote:
> > libs/taskmanager/taskactions.cpp, lines 508-510
> > <http://git.reviewboard.kde.org/r/103004/diff/1/?file=39919#file39919line508>
> >
> >     there's a line between "simplifiying" and "making it useless in too many cases" that this crosses imho. this would have me reaching for the window titlebar in too many cases.
> >     
> >     i would be in favour of renaming "Advanced" (a word we are trying to get away from) with something like "More actions"
> 
> Craig Drummond wrote:
>     hehe! knew this would get some reactions. Its only an option anyway. Perhaps it would be better if the user could supply a mask of items they did *not* want in the basic menu? Then it's up to the taskbar applet to decide what to show?
> 
> Aaron J. Seigo wrote:
>     sounds like a great recipe for inconsistency, poor choices and the creation of new user-facing options. i'd really like to avoid it. coming to a good compromise situation that works well enough for everyone should be possible.
> 
> Craig Drummond wrote:
>     In the next diff I've removed the 'simple' option. It needs more thought. Plus, it might be better to just re-think the context menu so that there is no need for a 'simple' mode.

i agree completely about re-thinking the context menu. let's get this patch in, and then after that we can work on making the menu Not Suck(tm)


> On Nov. 1, 2011, 2:05 p.m., Aaron J. Seigo wrote:
> > libs/taskmanager/taskactions.cpp, line 600
> > <http://git.reviewboard.kde.org/r/103004/diff/1/?file=39919#file39919line600>
> >
> >     this is a misuse of QAction. you can add QActions to a QAction and that parent QAction becomes the submenu. no need for such custom property setting/reading and menu creation.
> 
> Craig Drummond wrote:
>     This was for dock-manager plugin support - just to make things easier on my side - then there's a 1:1 mapping between the dockmanager item and the QAction. No biggie, I can always remove this.
> 
> Aaron J. Seigo wrote:
>     hm... can't you add all the dockmanager items to a common QAction? should be no harder than calling setProperty on them? or are these properties already set by the dockmanager API? (in which case i'd suggest the dock manager API could use improving :)
> 
> Craig Drummond wrote:
>     Hmm... How do I add a QAction to a QAction? I cant see this anywhere in the documentation. I've tried QActionGroup, creating QActions with the QAction as a parent. All failed :-(

QMenu *menu = new QMenu(parent);
QAction *action = menu->menuAction();

you can then add actions to the menu, and return the menuAction() as the action for the menu. it's not the most intuitive thing (almost backwards imho :) but it works nicely. we use it in several places in plasma to achieve exactly this effect :)


> On Nov. 1, 2011, 2:05 p.m., Aaron J. Seigo wrote:
> > libs/taskmanager/taskactions.cpp, line 135
> > <http://git.reviewboard.kde.org/r/103004/diff/1/?file=39919#file39919line135>
> >
> >     why a property for this? why not simply:
> >     
> >     if (!act->toolTip().isEmpty()) {
> 
> Craig Drummond wrote:
>     Using "if (!act->toolTip().isEmpty())" results in the menuitem's text being shown as the tooltip - which is pretty silly.
>     
>     I've also tried "if(!act->toolTip().isEmpty() && act->toolTip()!=act->text())" but this again fails if the menuitem has an underscore shortcut.

well, this is ugly ugly but it works and doesn't require any special settings in the QActions that get fed to ToolTipMenu.. it's borrowed from qaction.cpp in Qt:


static QString qt_strippedText(QString s)
{
    s.remove( QString::fromLatin1("...") );
    int i = 0;
    while (i < s.size()) { 
        ++i;                
        if (s.at(i-1) != QLatin1Char('&')) {
            continue;                               
        }   

        if (i < s.size() && s.at(i) == QLatin1Char('&')) {
            ++i;
        }   
        s.remove(i-1,1);
    }   
    return s.trimmed();
}   

with that function in hand:  qt_strippedText(action->text()) == action->toolTip();

it's not pretty, but it works and renders it an internal ugliness instead of something exposed in every QAction that is passed to libtaskmanager.


- Aaron J.


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/103004/#review7794
-----------------------------------------------------------


On Oct. 31, 2011, 8:40 p.m., Craig Drummond wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/103004/
> -----------------------------------------------------------
> 
> (Updated Oct. 31, 2011, 8:40 p.m.)
> 
> 
> Review request for Plasma.
> 
> 
> Description
> -------
> 
> 1. Add NewInstance action to launch a new instance of an application.
> 2. Move toggle launcher action out of advanced menu.
> 3. Don't show application name in 'Show A Launcher' action, as might not know the real name at this time (e.g. no desktop file read).
> 4. Add application actions, to be shown at the top of the right-click menu. IconTasks uses this to show recent docuents, dock manager menu items, and unity items.
> 5. A ToolTipMenu class is created, so that tooltips may be give for menu items. This is so that IconTasks can display the full path of a documents in the recent documents menu.
> 6. Add option to have only basic window controls in menu.
> 
> 
> Diffs
> -----
> 
>   libs/taskmanager/taskactions.h 2b5a641 
>   libs/taskmanager/taskactions.cpp 0e6ba8e 
>   libs/taskmanager/taskactions_p.h 913966c 
> 
> Diff: http://git.reviewboard.kde.org/r/103004/diff/diff
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Craig Drummond
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20111102/989edb6a/attachment-0001.html>


More information about the Plasma-devel mailing list