WindowMenu::WindowMenu(QWidget *parent) : QMenu(QString::fromUtf8("&Window"), parent) { pMinimize_ = addAction(QString::fromUtf8("Minimize")); pMinimize_->setShortcut(QKeySequence(QString::fromAscii("Meta+M"))); connect(pMinimize_, SIGNAL(triggered()), this, SLOT(onMinimize())); pZoom_ = addAction(QString::fromUtf8("Zoom")); connect(pZoom_, SIGNAL(triggered()), this, SLOT(onZoom())); addSeparator(); pWindowPlaceholder_ = addAction(QString::fromAscii("__PLACEHOLDER__")); pWindowPlaceholder_->setVisible(false); addSeparator(); pBringAllToFront_ = addAction(QString::fromUtf8("Bring All to Front")); connect(pBringAllToFront_, SIGNAL(triggered()), this, SLOT(onBringAllToFront())); connect(this, SIGNAL(aboutToShow()), this, SLOT(onAboutToShow())); connect(this, SIGNAL(aboutToHide()), this, SLOT(onAboutToHide())); }
Menu::Menu(QWidget *AParent) : QMenu(AParent) { menuAboutToShow = false; FIconStorage = NULL; FMenuAction = new Action(this); FMenuAction->setMenu(this); border = NULL;//CustomBorderStorage::staticStorage(RSR_STORAGE_CUSTOMBORDER)->addBorder(this, CBS_MENU); if (border) { setWindowFlags(Qt::Widget); border->setShowInTaskBar(false); border->setResizable(false); border->setMovable(false); border->setMinimizeButtonVisible(false); border->setMaximizeButtonVisible(false); border->setCloseButtonVisible(false); border->setCloseOnDeactivate(true); border->setStaysOnTop(true); if (AParent) connect(AParent,SIGNAL(destroyed()),SLOT(deleteLater())); connect(this, SIGNAL(aboutToShow()), SLOT(onAboutToShow())); connect(this, SIGNAL(aboutToHide()), SLOT(onAboutToHide())); connect(this, SIGNAL(triggered(QAction*)), SLOT(hide())); } setSeparatorsCollapsible(true); }
UserContextMenu::UserContextMenu(IMultiUserChatWindow *AMUCWindow, IChatWindow *AChatWindow) : Menu(AChatWindow->menuBarWidget()->menuBarChanger()->menuBar()) { FChatWindow = AChatWindow; FMUCWindow = AMUCWindow; setTitle(FChatWindow->contactJid().resource()); connect(this,SIGNAL(aboutToShow()),SLOT(onAboutToShow())); connect(this,SIGNAL(aboutToHide()),SLOT(onAboutToHide())); connect(FMUCWindow->multiUserChat()->instance(),SIGNAL(userPresence(IMultiUser *, int, const QString &)), SLOT(onMultiUserPresence(IMultiUser *, int, const QString &))); connect(FChatWindow->instance(),SIGNAL(contactJidChanged(const Jid &)),SLOT(onChatWindowContactJidChanged(const Jid &))); }