Bug 231870 - Approved option doesn't work in the Edit menu
Summary: Approved option doesn't work in the Edit menu
Status: RESOLVED FIXED
Alias: None
Product: lokalize
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Nick Shaforostoff
URL:
Keywords:
Depends on:
Blocks:
 
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:


Attachments

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 ));
     action->setCheckable(true);
     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
and
BUG: 233173



 M  +16 -0     editortab.cpp  


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