//void OutputText::contextMenuEvent(QContextMenuEvent* e) QPopupMenu* OutputText::createPopupMenu(const QPoint&) { KPopupMenu* popup = new KPopupMenu; int id = popup->insertItem(i18n("Show Internal Commands"), this, SLOT(toggleShowInternalCommands())); popup->setItemChecked(id, parent_->showInternalCommands_); popup->setWhatsThis( id, i18n( "Controls if commands issued internally by KDevelop " "will be shown or not.<br>" "This option will affect only future commands, it won't " "add or remove already issued commands from the view.")); popup->insertItem(i18n("Copy All"), this, SLOT(copyAll())); return popup; }
void PerforcePart::contextMenu(QPopupMenu *popup, const Context *context) { if (context->hasType( Context::FileContext )) { const FileContext *fcontext = static_cast<const FileContext*>(context); popupfile = fcontext->urls().first().path(); QFileInfo fi( popupfile ); popup->insertSeparator(); KPopupMenu *sub = new KPopupMenu(popup); QString name = fi.fileName(); sub->insertTitle( i18n("Actions for %1").arg(name) ); int id = sub->insertItem( i18n("Edit"), this, SLOT(slotEdit()) ); sub->setWhatsThis(id, i18n("<b>Edit</b><p>Opens file(s) in a client workspace for edit.")); id = sub->insertItem( i18n("Revert"), this, SLOT(slotRevert()) ); sub->setWhatsThis(id, i18n("<b>Revert</b><p>Discards changes made to open files.")); id = sub->insertItem( i18n("Submit"), this, SLOT(slotCommit()) ); sub->setWhatsThis(id, i18n("<b>Submit</b><p>Sends changes made to open files to the depot.")); id = sub->insertItem( i18n("Sync"), this, SLOT(slotUpdate()) ); sub->setWhatsThis(id, i18n("<b>Sync</b><p>Copies files from the depot into the workspace.")); sub->insertSeparator(); id = sub->insertItem( i18n("Diff Against Repository"), this, SLOT(slotDiff()) ); sub->setWhatsThis(id, i18n("<b>Diff against repository</b><p>Compares a client workspace file to a revision in the depot.")); id = sub->insertItem( i18n("Add to Repository"), this, SLOT(slotAdd()) ); sub->setWhatsThis(id, i18n("<b>Add to repository</b><p>Open file(s) in a client workspace for addition to the depot.")); id = sub->insertItem( i18n("Remove From Repository"), this, SLOT(slotRemove()) ); sub->setWhatsThis(id, i18n("<b>Remove from repository</b><p>Open file(s) in a client workspace for deletion from the depot.")); id = popup->insertItem(i18n("Perforce"), sub); } }
void subversionPart::contextMenu( QPopupMenu *popup, const Context *context ) { //no project, no subversion. Don't test on projectDirectory() here. If the user wants this project to have subversion support //give it to him. e.g. for out of root subprojects like with qmake if(!project()) return; kdDebug(9036) << "contextMenu()" << endl; if (context->hasType( Context::FileContext ) || context->hasType( Context::EditorContext )) { if (context->hasType( Context::FileContext )) { kdDebug(9036) << "Requested for a FileContext" << endl; const FileContext *fcontext = static_cast<const FileContext*>( context ); m_urls = fcontext->urls(); } else { kdDebug(9036) << "Requested for an EditorContext" << endl; const EditorContext *editorContext = static_cast<const EditorContext*>( context ); m_urls = editorContext->url(); } // THis stuff should end up into prepareOperation() URLUtil::dump( m_urls ); if (m_urls.count() <= 0) return; KPopupMenu *subMenu = new KPopupMenu( popup ); if (context->hasType( Context::FileContext )) popup->insertSeparator(); int id = subMenu->insertItem( actionCommit->text(), this, SLOT(slotCommit()) ); // CvsService let to do log and diff operations only on one file (or directory) at time /* if (m_urls.count() == 1) { subMenu->insertItem( actionDiff->text(), this, SLOT(slotDiff()) ); subMenu->insertItem( actionLog->text(), this, SLOT(slotLog()) ); }*/ subMenu->setWhatsThis(id, i18n("<b>Commit file(s)</b><p>Commits file to repository if modified.")); id = subMenu->insertItem( actionAdd->text(), this, SLOT(slotAdd()) ); subMenu->setWhatsThis(id, i18n("<b>Add file to repository</b><p>Adds file to repository.")); id = subMenu->insertItem( actionRemove->text(), this, SLOT(slotDel()) ); subMenu->setWhatsThis(id, i18n("<b>Remove from repository</b><p>Removes file(s) from repository.")); id = subMenu->insertItem( actionLog->text(), this, SLOT(slotLog()) ); subMenu->setWhatsThis(id, i18n("<b>Show logs..</b><p>View Logs")); id = subMenu->insertItem( actionBlame->text(), this, SLOT(slotBlame()) ); subMenu->setWhatsThis(id, i18n("<b>Blame 0:HEAD </b><p>Show Annotate")); subMenu->insertSeparator(); id = subMenu->insertItem( actionDiffLocal->text(), this, SLOT(slotDiffLocal()) ); subMenu->setWhatsThis(id, i18n("<b>Diff</b><p>Diff file to local disk.")); id = subMenu->insertItem( actionDiffHead->text(), this, SLOT(slotDiffHead()) ); subMenu->setWhatsThis(id, i18n("<b>Diff</b><p>Diff file to repository.")); id = subMenu->insertItem( actionUpdate->text(), this, SLOT(slotUpdate()) ); subMenu->setWhatsThis(id, i18n("<b>Update</b><p>Updates file(s) from repository.")); id = subMenu->insertItem( actionRevert->text(), this, SLOT(slotRevert()) ); subMenu->setWhatsThis(id, i18n("<b>Revert</b><p>Undo local changes.") ); id = subMenu->insertItem( actionResolve->text(), this, SLOT(slotResolve()) ); subMenu->setWhatsThis(id, i18n("<b>Resolve</b><p>Resolve conflicting state.") ); id = subMenu->insertItem( actionSwitch->text(), this, SLOT(slotSwitch()) ); subMenu->setWhatsThis(id, i18n("<b>Switch</b><p>Switch working tree.") ); id = subMenu->insertItem( actionCopy->text(), this, SLOT(slotCopy()) ); subMenu->setWhatsThis(id, i18n("<b>Copy</b><p>Copy from/between path/URLs") ); id = subMenu->insertItem( actionMerge->text(), this, SLOT(slotMerge()) ); subMenu->setWhatsThis(id, i18n("<b>Merge</b><p>Merge difference to working copy") ); /* subMenu->insertSeparator(); id = subMenu->insertItem( actionAddToIgnoreList->text(), this, SLOT(slotAddToIgnoreList()) ); subMenu->setWhatsThis(id, i18n("<b>Ignore in Subversion operations</b><p>Ignores file(s).")); id = subMenu->insertItem( actionRemoveFromIgnoreList->text(), this, SLOT(slotRemoveFromIgnoreList()) ); subMenu->setWhatsThis(id, i18n("<b>Do not ignore in Subversion operations</b><p>Do not ignore file(s).")); */ // Now insert in parent menu popup->insertItem( i18n("Subversion"), subMenu ); } }