dbustray: add NewMenu signal and emit it when menu changed
This is a signal that is not actually supported by the StatusNotificationIcon standard, but it comes to be important for the Qt implementation of it, in fact qt apps might not have a menu, when exporting the Menu path as /NO_DBUSMENU or they could add this later in the execution. So, currently there's no way for the StatusNotificationWatcher to know when a menu has been added (or changed). Adding a NewMenu signal won't cause any troubles, but will allow watchers to be notified properly on menu addition. Change-Id: I9a8b00213f5023950811af1d62cd91bc51744b78 Reviewed-by: Dmitry Shachnev <mitya57@gmail.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
This commit is contained in:
parent
2dc578a8f2
commit
ff169e8859
@ -85,6 +85,9 @@
|
|||||||
<signal name="NewOverlayIcon">
|
<signal name="NewOverlayIcon">
|
||||||
</signal>
|
</signal>
|
||||||
|
|
||||||
|
<signal name="NewMenu">
|
||||||
|
</signal>
|
||||||
|
|
||||||
<signal name="NewToolTip">
|
<signal name="NewToolTip">
|
||||||
</signal>
|
</signal>
|
||||||
|
|
||||||
|
@ -126,6 +126,7 @@ QDBusTrayIcon::QDBusTrayIcon()
|
|||||||
connect(this, SIGNAL(tooltipChanged()), m_adaptor, SIGNAL(NewToolTip()));
|
connect(this, SIGNAL(tooltipChanged()), m_adaptor, SIGNAL(NewToolTip()));
|
||||||
connect(this, SIGNAL(iconChanged()), m_adaptor, SIGNAL(NewIcon()));
|
connect(this, SIGNAL(iconChanged()), m_adaptor, SIGNAL(NewIcon()));
|
||||||
connect(this, SIGNAL(attention()), m_adaptor, SIGNAL(NewAttentionIcon()));
|
connect(this, SIGNAL(attention()), m_adaptor, SIGNAL(NewAttentionIcon()));
|
||||||
|
connect(this, SIGNAL(menuChanged()), m_adaptor, SIGNAL(NewMenu()));
|
||||||
connect(this, SIGNAL(attention()), m_adaptor, SIGNAL(NewTitle()));
|
connect(this, SIGNAL(attention()), m_adaptor, SIGNAL(NewTitle()));
|
||||||
connect(&m_attentionTimer, SIGNAL(timeout()), this, SLOT(attentionTimerExpired()));
|
connect(&m_attentionTimer, SIGNAL(timeout()), this, SLOT(attentionTimerExpired()));
|
||||||
m_attentionTimer.setSingleShot(true);
|
m_attentionTimer.setSingleShot(true);
|
||||||
@ -268,6 +269,7 @@ void QDBusTrayIcon::updateMenu(QPlatformMenu * menu)
|
|||||||
connect(m_menu, SIGNAL(updated(uint,int)),
|
connect(m_menu, SIGNAL(updated(uint,int)),
|
||||||
m_menuAdaptor, SIGNAL(LayoutUpdated(uint,int)));
|
m_menuAdaptor, SIGNAL(LayoutUpdated(uint,int)));
|
||||||
dBusConnection()->registerTrayIconMenu(this);
|
dBusConnection()->registerTrayIconMenu(this);
|
||||||
|
emit menuChanged();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -129,6 +129,7 @@ class QStatusNotifierItemAdaptor: public QDBusAbstractAdaptor
|
|||||||
" <signal name=\"NewIcon\"/>\n"
|
" <signal name=\"NewIcon\"/>\n"
|
||||||
" <signal name=\"NewAttentionIcon\"/>\n"
|
" <signal name=\"NewAttentionIcon\"/>\n"
|
||||||
" <signal name=\"NewOverlayIcon\"/>\n"
|
" <signal name=\"NewOverlayIcon\"/>\n"
|
||||||
|
" <signal name=\"NewMenu\"/>\n"
|
||||||
" <signal name=\"NewToolTip\"/>\n"
|
" <signal name=\"NewToolTip\"/>\n"
|
||||||
" <signal name=\"NewStatus\">\n"
|
" <signal name=\"NewStatus\">\n"
|
||||||
" <arg type=\"s\" name=\"status\"/>\n"
|
" <arg type=\"s\" name=\"status\"/>\n"
|
||||||
@ -191,6 +192,7 @@ Q_SIGNALS: // SIGNALS
|
|||||||
void NewAttentionIcon();
|
void NewAttentionIcon();
|
||||||
void NewIcon();
|
void NewIcon();
|
||||||
void NewOverlayIcon();
|
void NewOverlayIcon();
|
||||||
|
void NewMenu();
|
||||||
void NewStatus(const QString &status);
|
void NewStatus(const QString &status);
|
||||||
void NewTitle();
|
void NewTitle();
|
||||||
void NewToolTip();
|
void NewToolTip();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user