void skypetab::SkypeTab::onSetContextMenu(QMenu *menu) { stage2Init(); if(_instance->_trayMenu!=0) return; _instance->_trayMenu=menu; connect(menu, SIGNAL(aboutToShow()),_instance, SLOT(onMenuShow())); _instance->onMenuShow(); }
void SkypeTab::onTrayMenuActivated(QSystemTrayIcon::ActivationReason reason) { stage2Init(); if(reason!=QSystemTrayIcon::Context) { onTrayIcon(); } else { raiseTrayMenuActivated(reason); if(_trayMenu==0) { if (_trayIcon==0) _trayIcon=qobject_cast<QSystemTrayIcon*>(sender()); _trayMenu=_trayIcon->contextMenu(); connect(_trayMenu, SIGNAL(aboutToShow()),this, SLOT(onMenuShow())); onMenuShow(); } } }