<div dir="ltr">Hi Yann,<div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sat, May 17, 2014 at 11:46 PM, Yann Chemin <span dir="ltr"><<a href="mailto:ychemin@gmail.com" target="_blank">ychemin@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Hi Anna,<br>
<br>
Patch works great ! Needs RunMenuCmd and all goes to perfection. Any<br>
chance to have it included in the SVN tree?<br>
<br></blockquote><div> </div><div>I committed the patch in trunk, if you agree, I won't backport it now. I don't understand what do you mean with RunMenuCmd, is there still some problem and what is it exactly?</div>

<div><br></div><div>Anna </div><div><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">


Thank you<br>
<span class=""><font color="#888888">Yann<br>
</font></span><div><div class="h5"><br>
On 18/05/2014, Anna Petrášová <<a href="mailto:kratochanna@gmail.com">kratochanna@gmail.com</a>> wrote:<br>
> Hi Yann,<br>
><br>
> it's grayed out because it tests if it's a working grass command (for<br>
> example r.in.lidar is grayed when you don't compile grass with liblas). You<br>
> can try to apply this patch which tests if the command looks like grass<br>
> command (regular expression) and if it is not, it doesn't disable it in<br>
> menu.<br>
><br>
> Index: gui_core/menu.py<br>
> ===================================================================<br>
> --- gui_core/menu.py (revision 60284)<br>
> +++ gui_core/menu.py (working copy)<br>
> @@ -18,7 +18,7 @@<br>
>  @author Robert Szczepanek (menu customization)<br>
>  @author Vaclav Petras <wenzeslaus <a href="http://gmail.com" target="_blank">gmail.com</a>> (menu customization)<br>
>  """<br>
> -<br>
> +import re<br>
>  import wx<br>
><br>
>  from core              import globalvar<br>
> @@ -91,7 +91,8 @@<br>
>                  cmd = utils.split(str(command))<br>
>              except UnicodeError:<br>
>                  cmd = utils.split(EncodeString((command)))<br>
> -            if cmd and cmd[0] not in globalvar.grassCmd:<br>
> +            if cmd and cmd[0] not in globalvar.grassCmd and \<br>
> +               re.match('[rvdipmgt][3bs]?\.([a-z0-9\.])+', cmd[0]):<br>
>                  menuItem.Enable(False)<br>
><br>
>          rhandler = eval('self.parent.' + handler)<br>
><br>
><br>
><br>
> On Fri, May 16, 2014 at 12:30 AM, Yann Chemin <<a href="mailto:ychemin@gmail.com">ychemin@gmail.com</a>> wrote:<br>
><br>
>> in svn/gui/wxpython/lmgr/frame.py<br>
>> line 758<br>
>> by adding:<br>
>><br>
>>     def RunCmd(self, event = None, cmd = []):<br>
>>         """!Run command to system from menu"""<br>
>>         if event:<br>
>>             cmd = self.GetMenuCmd(event)<br>
>>         os.system(cmd)<br>
>><br>
>><br>
> I am not sure if this is needed. I would say it might work without this<br>
> change but you have to try it out.<br>
><br>
><br>
> Best,<br>
><br>
> Anna<br>
><br>
><br>
>> it should handle it, however, it seems that a flag is needed to enable<br>
>> the possibility to click the command from the created menu. It is<br>
>> still grey/shadowed.<br>
>><br>
>><br>
>><br>
>> On 16/05/2014, Yann Chemin <<a href="mailto:ychemin@gmail.com">ychemin@gmail.com</a>> wrote:<br>
>> > To be precise, the non-GRASS programs have their own GUI already, and<br>
>> > the calls need only one word.<br>
>> ><br>
>> > On 16/05/2014, Yann Chemin <<a href="mailto:ychemin@gmail.com">ychemin@gmail.com</a>> wrote:<br>
>> >> Hi,<br>
>> >><br>
>> >> I would like to make a customized toolbox to call some non-GRASS CLI<br>
>> >> programs.<br>
>> >><br>
>> >> Handlers OnMenuCmd and RunMenuCmd seem not to work. The menu items are<br>
>> >> grey/shadowed so that no mouse click is allowed on them.<br>
>> >><br>
>> >> thanks<br>
>> >> Yann<br>
>> >> --<br>
>> >> ----<br>
>> >><br>
>> ><br>
>> ><br>
>> > --<br>
>> > ----<br>
>> ><br>
>><br>
>><br>
>> --<br>
>> ----<br>
>> _______________________________________________<br>
>> grass-dev mailing list<br>
>> <a href="mailto:grass-dev@lists.osgeo.org">grass-dev@lists.osgeo.org</a><br>
>> <a href="http://lists.osgeo.org/mailman/listinfo/grass-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/grass-dev</a><br>
>><br>
><br>
<br>
<br>
</div></div>--<br>
----<br>
</blockquote></div><br></div></div></div>