[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: KStatusNotifierItem's "secondaryActivateRequested" signal not being emitted
From:       Eduard Huguet <eduardhc () gmail ! com>
Date:       2013-06-26 8:39:13
Message-ID: CALG9nuXyNhoyX-uAsO21nVFseZB-4ekLBbjd9bTdNpMsdTZkXw () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Hi,
This is also what I discovered later. It seems a bit weird to me, as I
think it would be more logical to provide a signal when the user right
clicks on the icon (as it's a fairly common action - who middle-clicks on a
tray icon, ever, ...?), but well, this is the way it works.

Anyway, I finally found a way to do what I wanted by connecting to the
"aboutToShow" signal of the QMenu returned by contextMenu() call of the
KStatusNotifierItem's associated "KMenu" object: by doing so, I can update
the menu safely right before it's displayed.

As a sidenote, trying the same thing directly over KStatusNotifierItem's
KMenu object didn't work, and leaded to strange dbus-related errors
appearing on the console...

Kind regards,
  Eduard Huguet










2013/6/25 Albert Astals Cid <aacid@kde.org>

> El Dimarts, 25 de juny de 2013, a les 10:42:42, Eduard Huguet va escriure=
:
> > Hi,
> > I'm trying to add tray icon support for a small application of my own,
> and
> > I'd like to be able to regenerate the context menu right before this is
> > displayed.
> >
> > To do so, I try to connect KStatusNotifierItem's
> > "secondaryActivateRequested" signal to an slot in my dialog, assuming
> that
> > it would get emitted when right-clicking on the tray icon (according to
> > doc), but apparently it never gets fired. =BFIs this really implemented=
, or
> > I'm simply misunderstanding the purpose of this signal?
>
> Reading the code it seems to me it's middle-clicking thaat fires it and n=
ot
> right-clicking.
>
> Cheers,
>   Albert
>
> >
> > Anyway, if anyone have any other idea about how I could implement this
> > (updating context menu contents right before it gets displayed), I'd be
> > glad to know it :-)
> >
> > Kind regards,
> >   Eduard Huguet
>
>

[Attachment #5 (text/html)]

<div dir="ltr">Hi, <div style>This is also what I discovered later. It seems a bit \
weird to me, as I think it would be more logical to provide a signal when the user \
right clicks on the icon (as it&#39;s a fairly common action - who middle-clicks on a \
tray icon, ever, ...?), but well, this is the way it works.</div> <div \
style><br></div><div style>Anyway, I finally found a way to do what I wanted by \
connecting to the &quot;aboutToShow&quot; signal of the QMenu returned by \
contextMenu() call of the KStatusNotifierItem&#39;s associated &quot;KMenu&quot; \
object: by doing so, I can update the menu safely right before it&#39;s \
displayed.</div> <div style><br></div><div style>As a sidenote, trying the same thing \
directly over KStatusNotifierItem&#39;s KMenu object didn&#39;t work, and leaded to \
strange dbus-related errors appearing on the console...</div><div style> \
<br></div><div style>Kind regards, </div><div style>  Eduard Huguet</div><div \
style><br></div><div style><br></div><div style><br></div><div style><br></div><div \
style><br></div><div style><br></div><div style><br></div><div style> \
<br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/6/25 \
Albert Astals Cid <span dir="ltr">&lt;<a href="mailto:aacid@kde.org" \
target="_blank">aacid@kde.org</a>&gt;</span><br><blockquote class="gmail_quote" \
style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> El Dimarts, 25 \
de juny de 2013, a les 10:42:42, Eduard Huguet va escriure:<br> <div class="im">&gt; \
Hi,<br> &gt; I&#39;m trying to add tray icon support for a small application of my \
own, and<br> &gt; I&#39;d like to be able to regenerate the context menu right before \
this is<br> &gt; displayed.<br>
&gt;<br>
&gt; To do so, I try to connect KStatusNotifierItem&#39;s<br>
&gt; &quot;secondaryActivateRequested&quot; signal to an slot in my dialog, assuming \
that<br> &gt; it would get emitted when right-clicking on the tray icon (according \
to<br> &gt; doc), but apparently it never gets fired. żIs this really implemented, \
or<br> &gt; I&#39;m simply misunderstanding the purpose of this signal?<br>
<br>
</div>Reading the code it seems to me it&#39;s middle-clicking thaat fires it and \
not<br> right-clicking.<br>
<br>
Cheers,<br>
  Albert<br>
<div class="HOEnZb"><div class="h5"><br>
&gt;<br>
&gt; Anyway, if anyone have any other idea about how I could implement this<br>
&gt; (updating context menu contents right before it gets displayed), I&#39;d be<br>
&gt; glad to know it :-)<br>
&gt;<br>
&gt; Kind regards,<br>
&gt;   Eduard Huguet<br>
<br>
</div></div></blockquote></div><br></div>



>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic