Review Request: Window runner to switch windows and desktops
Ryan Bitanga
ryan.bitanga at gmail.com
Sun Jul 26 17:44:40 CEST 2009
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://reviewboard.kde.org/r/1114/#review1788
-----------------------------------------------------------
trunk/KDE/kdebase/workspace/plasma/runners/windows/windowsrunner.cpp
<http://reviewboard.kde.org/r/1114/#comment1162>
One of the reasons I worked on multiple action support for KRunner in 4.2 was so that we could avoid this exact use case of having multiple subkeywords and instead make it easier for the user by providing a standard set of actions to choose from. I know this is isn't exposed in the default interface but I think the solution should be to expose it in the interface rather than have a more complex language in a runner.
I also suggested you use libtaskmanager to avoid a long chain of if clauses like the one here. Using libtaskmanager also provides a more consistent feel than directly calling methods from KWindowSystem because it the user will be prompted with the same actions in the window menu and the task bar. It also simplifies the run method to a simple call to action->trigger().
trunk/KDE/kdebase/workspace/plasma/runners/windows/windowsrunner.cpp
<http://reviewboard.kde.org/r/1114/#comment1163>
ditto as above. I'm not a huge fan of writing code that does something another library already simplifies.
Why don't you take a look at playground/base/plasma/runners/windows for an idea of how to do this? :) The one in playground was a proof of concept runner to show: 1) how to execute code in the GUI thread from within the match method and 2) how to provide possible actions once a user chooses a match.
- Ryan
On 2009-07-26 12:34:22, Martin Gräßlin wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://reviewboard.kde.org/r/1114/
> -----------------------------------------------------------
>
> (Updated 2009-07-26 12:34:22)
>
>
> Review request for Plasma.
>
>
> Summary
> -------
>
> This runner lists the windows and virtual desktops. It allows to activate a selected window or switch to a selected desktop. The runner works in the following way:
> * input is matched on window name, class or role; matching windows are listed
> * input is matched on desktop name. Matching desktops are shown for switching to, all windows on matching desktops are listed.
> * keyword "desktop": lists all desktops (except current) if additional number is inserted the list is reduced to that desktop
> * keyword "window": lists all windows. Additional text will be used to restrict like in first case. Following sub queries to restrict search are possible:
> * name=: restrict on name
> * class=: restrict on window class
> * role=: restrict on window role
> * desktop=: restrict on desktop
> those subqueries can be combined in any order. Each input not containing a '=' will be interpreted as a name restriction if there is no explicit name restriction. In that case it's ignored. Example query: "window desktop=2 class=kmail role=composer" will list all open KMail composer windows on desktop 2.
>
>
> Diffs
> -----
>
> trunk/KDE/kdebase/workspace/plasma/runners/CMakeLists.txt 1000707
> trunk/KDE/kdebase/workspace/plasma/runners/windows/CMakeLists.txt PRE-CREATION
> trunk/KDE/kdebase/workspace/plasma/runners/windows/plasma-runner-windows.desktop PRE-CREATION
> trunk/KDE/kdebase/workspace/plasma/runners/windows/windowsrunner.h PRE-CREATION
> trunk/KDE/kdebase/workspace/plasma/runners/windows/windowsrunner.cpp PRE-CREATION
>
> Diff: http://reviewboard.kde.org/r/1114/diff
>
>
> Testing
> -------
>
>
> Thanks,
>
> Martin
>
>
More information about the Plasma-devel
mailing list