Bug 231870 - Approved option doesn't work in the Edit menu
Summary: Approved option doesn't work in the Edit menu
Alias: None
Product: lokalize
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Platform: Archlinux Packages Linux
: NOR normal (vote)
Target Milestone: ---
Assignee: Nick Shaforostoff
Depends on:
Reported: 2010-03-23 07:33 UTC by Laszlo Papp
Modified: 2011-04-14 19:35 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Note You need to log in before you can comment on or make changes to this bug.
Description Laszlo Papp 2010-03-23 07:33:10 UTC
Version:            (using KDE 4.4.1)
OS:                Linux
Installed from:    Archlinux Packages

When I try to click for Edit/Approved in case a relevant expression, nothing happens, but if I use ctrl-u, then it works properly, so just it's not ok from the menu, I will try to provide later a patch for it, but confirm me, if the problem exists by you as well, thanks.
Comment 1 Shankar Prasad 2010-03-23 08:01:46 UTC
Even I too tested the lokalize and found the same issue.
I used kdesdk-4.3.4
Comment 2 Laszlo Papp 2010-03-24 07:07:33 UTC
Hello Nick,

You can see my patch below for it, but I'd have a question to you:

I'm not sure, but the problem seems to be one in KToolBarPopupAction. The docs say "this action is a simple menuitem when plugged into a menu, and has a popup only in a toolbar.", while in lokalize it also has the submenu when used in the menubar, its not a regular KAction but a KToolBarPopupAction. (it is expected to have a submenu, but also react on click). Would you be so kind as to tell me what the submenu is supposed to show ? (there is a slot called showStatesMenu)
The code looks like there is some intention for it having a popup. May I commit this patch or would you do another approach then ?

svn diff ../lokalize/src/editortab.cpp
Index: ../lokalize/src/editortab.cpp
--- ../lokalize/src/editortab.cpp	(revision 1106451)
+++ ../lokalize/src/editortab.cpp	(working copy)
@@ -75,6 +75,7 @@
 #include <kurl.h>
 #include <kmenu.h>
 #include <kactioncategory.h>
+#include <ktoggleaction.h>
 #include <kinputdialog.h>
@@ -472,7 +473,7 @@
-    action = actionCategory->addAction("edit_approve", new KToolBarPopupAction(KIcon("approved"),i18nc("@option:check whether message is marked as translated/reviewed/approved (depending on your role)","Approved"),this));
+    action = actionCategory->addAction("edit_approve", new KToggleAction(KIcon("approved"),i18nc("@option:check whether message is marked as translated/reviewed/approved (depending on your role)","Approved"),this));
     action->setShortcut(QKeySequence( Qt::CTRL+Qt::Key_U ));
     connect(action, SIGNAL(triggered()), m_view,SLOT(toggleApprovement()));
Comment 3 Nick Shaforostoff 2010-03-24 22:17:15 UTC
the popup menu is showm when editing XLIFF files (they support alot of states). The proper way to correct this is to call toggleApprovement() in case showStatesMenu() is going to show an empty menu. (so toggleApprovement() instead of showing empty menu)
Comment 4 Nick Shaforostoff 2011-04-14 18:43:14 UTC
SVN commit 1227937 by shaforo:

create states menu even for gettext files (with 'needs review' and 'ready' options).
i think this soultion will satisfy both
BUG: 231870
BUG: 233173

 M  +16 -0     editortab.cpp  

WebSVN link: http://websvn.kde.org/?view=rev&revision=1227937