Re: [PATCH] Add {un,re}do actions to edit menu

Oliver Kellogg <[email protected]>
Newsgroups gmane.linux.umbrello.devel
Message-ID <CANZbxGm=UDf2SmtZpDVoy_r1WwdkmGGgT8m5-NLPJ9U+xbcRgQ@mail.gmail.com>
Hello Guillermo,

Many thanks for your patches.
I applied them on the git master <https://invent.kde.org/sdk/umbrello/>.

Regards,

Oliver

On Mon, Apr 25, 2022 at 6:01 PM Guillermo E. Martinez <
[email protected]> wrote:

> Hello Umbrello team,
>
> This patch encourage to use standard location and shortcuts
> for {un,re}do actions.
>
> Please, if you have comments don't hesitate to let me know :-)
>
> Kind Rgerads,
> Guillermo
>
>
> This patch add support to use of standard location and shortcuts
> for {un,re}do actions.
>
>         * umbrello/uml.cpp (UMLApp::initActions): Use `KStandardAction::
>         {un,re}do' to create {un,re}do actions, adding a tooltip to
>         describe them.
> ---
>  umbrello/uml.cpp | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/umbrello/uml.cpp b/umbrello/uml.cpp
> index c3d5b4fda..850e208c4 100644
> --- a/umbrello/uml.cpp
> +++ b/umbrello/uml.cpp
> @@ -316,8 +316,9 @@ void UMLApp::initActions()
>  #endif
>      QAction* fileQuit = KStandardAction::quit(this, SLOT(slotFileQuit()),
> actionCollection());
>
> -    editUndo = m_pUndoStack->createUndoAction(actionCollection());
> -    editRedo = m_pUndoStack->createRedoAction(actionCollection());
> +    editUndo = KStandardAction::undo(this, SLOT(slotEditUndo()),
> actionCollection());
> +    editRedo = KStandardAction::redo(this, SLOT(slotEditRedo()),
> actionCollection());
> +
>  #if QT_VERSION >= 0x040600
>      editUndo->setPriority(QAction::LowPriority);   // icon only
>      editRedo->setPriority(QAction::LowPriority);   // icon only
> @@ -431,6 +432,9 @@ void UMLApp::initActions()
>      editCut->setToolTip(i18n("Cuts the selected section and puts it to
> the clipboard"));
>      editCopy->setToolTip(i18n("Copies the selected section to the
> clipboard"));
>      editPaste->setToolTip(i18n("Pastes the contents of the clipboard"));
> +    editUndo->setToolTip(i18n("Undo last action"));
> +    editRedo->setToolTip(i18n("Redo last undone action"));
> +
>      preferences->setToolTip(i18n("Set the default program preferences"));
>
>      deleteSelectedWidget =
> actionCollection()->addAction(QLatin1String("delete_selected"));
> --
> 2.35.1
>
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.