From kde-core-devel Mon Sep 20 22:32:29 2010 From: =?utf-8?b?QXVyw6lsaWVuIEfDonRlYXU=?= Date: Mon, 20 Sep 2010 22:32:29 +0000 To: kde-core-devel Subject: Review Request: New action class proposal: KDualAction Message-Id: <20100920223229.6933.31849 () vidsolbach ! de> X-MARC-Message: https://marc.info/?l=kde-core-devel&m=128502201126709 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--===============6759060367979307944==" --===============6759060367979307944== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: http://svn.reviewboard.kde.org/r/5396/ ----------------------------------------------------------- Review request for kdelibs. Summary ------- This review-request introduces a new class named KDualAction. The goal of t= his class is to make it easy to create a dual-state action: an action which= represents two actions, switching from one to the other whenever it is tri= ggered. KDualAction can be used to implement actions such as the Play/Pause= action of a media player or the Reload/Stop action of a web browser. Right now some applications mis-use KToggleAction to implement such dual-st= ate actions: They set the first action as the unchecked state and provide a= n alternative KGuiItem for the checked state with KToggleAction::setChecked= State(). This is wrong because when the user clicks a button representing t= he action in a toolbar, the button stays down. The appropriate use cases f= or toggle buttons (and thus KToggleAction) are documented in a recent addit= ion to the HIG: http://techbase.kde.org/Projects/Usability/HIG/Toggle_Buttons Potential users for this class: - Dragon, Juk, Amarok to implement their Play/Pause action. - Rekonq to implement its Reload/Stop action. Konqueror could also use this= but it does not feature a dual reload/stop action as far as I know. - Dolphin could maybe use it to implement its Split/Close action (although = it's a bit more involved in this case because the close action changes depe= nding on which panel it is going to close) - Any application which incorrectly uses KToggleAction + setCheckedState() = to show/hide a UI element (a search on lxr.kde.org shows quite a lot of mis= use: http://lxr.kde.org/ident?i=3DsetCheckedState ) Diffs ----- trunk/KDE/kdelibs/kdeui/CMakeLists.txt 1171068 = trunk/KDE/kdelibs/kdeui/actions/kdualaction.h PRE-CREATION = trunk/KDE/kdelibs/kdeui/actions/kdualaction.cpp PRE-CREATION = trunk/KDE/kdelibs/kdeui/actions/kdualaction_p.h PRE-CREATION = trunk/KDE/kdelibs/kdeui/tests/CMakeLists.txt 1171068 = trunk/KDE/kdelibs/kdeui/tests/kdualactiontest.cpp PRE-CREATION = Diff: http://svn.reviewboard.kde.org/r/5396/diff Testing ------- The class comes with unit-tests. I tested the API made sense by porting Dra= gon, Konqueror and creating a showHideMenubar action in KStandardAction (re= view requests to come if the class is accepted). Thanks, Aur=C3=A9lien --===============6759060367979307944== Content-Type: text/html; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable
This is an automatically generated e-mail. To reply, visit: http://svn.reviewb= oard.kde.org/r/5396/

Review request for kdelibs.
By Aur=C3=A9lien G=C3=A2teau.

Descripti= on

This review-request introduces a new class named KDualAction=
. The goal of this class is to make it easy to create a dual-state action: =
an action which represents two actions, switching from one to the other whe=
never it is triggered. KDualAction can be used to implement actions such as=
 the Play/Pause action of a media player or the Reload/Stop action of a web=
 browser.

Right now some applications mis-use KToggleAction to implement such dual-st=
ate actions: They set the first action as the unchecked state and provide a=
n alternative KGuiItem for the checked state with KToggleAction::setChecked=
State(). This is wrong because when the user clicks a button representing t=
he action in a toolbar, the button stays down.  The appropriate use cases f=
or toggle buttons (and thus KToggleAction) are documented in a recent addit=
ion to the HIG:
http://techbase.kde.org/Projects/Usability/HIG/Toggle_Buttons

Potential users for this class:

- Dragon, Juk, Amarok to implement their Play/Pause action.

- Rekonq to implement its Reload/Stop action. Konqueror could also use this=
 but it does not feature a dual reload/stop action as far as I know.

- Dolphin could maybe use it to implement its Split/Close action (although =
it's a bit more involved in this case because the close action changes =
depending on which panel it is going to close)

- Any application which incorrectly uses KToggleAction + setCheckedState() =
to show/hide a UI element (a search on lxr.kde.org shows quite a lot of mis=
use: http://lxr.kde.org/ident?i=3DsetCheckedState )

Testing <= /h1>
The class comes with unit-tests. I tested the API made sense=
 by porting Dragon, Konqueror and creating a showHideMenubar action in KSta=
ndardAction (review requests to come if the class is accepted).

Diffs=

  • trunk/KDE/kdelibs/kdeui/CMakeLists.txt (11= 71068)
  • trunk/KDE/kdelibs/kdeui/actions/kdualaction.h (PRE-CREATION)
  • trunk/KDE/kdelibs/kdeui/actions/kdualaction.cpp (PRE-CREATION)
  • trunk/KDE/kdelibs/kdeui/actions/kdualaction_p.h (PRE-CREATION)
  • trunk/KDE/kdelibs/kdeui/tests/CMakeLists.txt (1171068)
  • trunk/KDE/kdelibs/kdeui/tests/kdualactiontest.cpp (PRE-CREATION)

View Diff

--===============6759060367979307944==--