void MainWindow::msgContextActionModify(const MumbleProto::ContextActionModify &msg) { if (msg.has_operation() && msg.operation() == MumbleProto::ContextActionModify_Operation_Remove) { removeContextAction(msg); return; } if (msg.has_operation() && msg.operation() != MumbleProto::ContextActionModify_Operation_Add) return; QAction *a = new QAction(u8(msg.text()), g.mw); a->setData(u8(msg.action())); connect(a, SIGNAL(triggered()), this, SLOT(context_triggered())); unsigned int ctx = msg.context(); if (ctx & MumbleProto::ContextActionModify_Context_Server) qlServerActions.append(a); if (ctx & MumbleProto::ContextActionModify_Context_User) qlUserActions.append(a); if (ctx & MumbleProto::ContextActionModify_Context_Channel) qlChannelActions.append(a); }
void squareToolDock::processToolChange(toolChangeDirection direction, const toolChangeData& data) { if (direction == T_ACTIVATE) { data.toolButton()->setDown(true); if (data.contextAction()) { emit addContextAction(data.contextAction()); } } else { data.toolButton()->setDown(false); if (data.contextAction()) { emit removeContextAction(data.contextAction()); } } if (data.enableToolLabel() != triNoop) { const bool b = (data.enableToolLabel() == triTrue) ? true : false; toolColorLabel_->setEnabled(b); } if (data.showDetailDock() != triNoop) { const bool b = (data.showDetailDock() == triTrue) ? true : false; showDetailDock(b); } }