Changeset View
Changeset View
Standalone View
Standalone View
plugins/cvs/cvsplugin.cpp
Show First 20 Lines • Show All 166 Lines • ▼ Show 20 Line(s) | 160 | { | |||
---|---|---|---|---|---|
167 | if (job) { | 167 | if (job) { | ||
168 | CvsGenericOutputView* view = new CvsGenericOutputView(job); | 168 | CvsGenericOutputView* view = new CvsGenericOutputView(job); | ||
169 | emit addNewTabToMainView(view, i18n("Status")); | 169 | emit addNewTabToMainView(view, i18n("Status")); | ||
170 | KDevelop::ICore::self()->runController()->registerJob(job); | 170 | KDevelop::ICore::self()->runController()->registerJob(job); | ||
171 | } | 171 | } | ||
172 | } | 172 | } | ||
173 | 173 | | |||
174 | 174 | | |||
175 | KDevelop::ContextMenuExtension CvsPlugin::contextMenuExtension(KDevelop::Context* context) | 175 | KDevelop::ContextMenuExtension CvsPlugin::contextMenuExtension(KDevelop::Context* context, QWidget* parent) | ||
176 | { | 176 | { | ||
177 | d->m_common->setupFromContext(context); | 177 | d->m_common->setupFromContext(context); | ||
178 | QList<QUrl> const & ctxUrlList = d->m_common->contextUrlList(); | 178 | QList<QUrl> const & ctxUrlList = d->m_common->contextUrlList(); | ||
179 | 179 | | |||
180 | bool hasVersionControlledEntries = false; | 180 | bool hasVersionControlledEntries = false; | ||
181 | foreach(const QUrl &url, ctxUrlList) { | 181 | foreach(const QUrl &url, ctxUrlList) { | ||
182 | if (d->m_proxy->isValidDirectory(url)) { | 182 | if (d->m_proxy->isValidDirectory(url)) { | ||
183 | hasVersionControlledEntries = true; | 183 | hasVersionControlledEntries = true; | ||
184 | break; | 184 | break; | ||
185 | } | 185 | } | ||
186 | } | 186 | } | ||
187 | 187 | | |||
188 | qCDebug(PLUGIN_CVS) << "version controlled?" << hasVersionControlledEntries; | 188 | qCDebug(PLUGIN_CVS) << "version controlled?" << hasVersionControlledEntries; | ||
189 | 189 | | |||
190 | if (!hasVersionControlledEntries) | 190 | if (!hasVersionControlledEntries) | ||
191 | return IPlugin::contextMenuExtension(context); | 191 | return IPlugin::contextMenuExtension(context, parent); | ||
192 | 192 | | |||
193 | QMenu* menu = d->m_common->commonActions(); | 193 | QMenu* menu = d->m_common->commonActions(parent); | ||
194 | menu->addSeparator(); | 194 | menu->addSeparator(); | ||
195 | 195 | | |||
196 | QAction *action; | 196 | QAction *action; | ||
197 | // Just add actions which are not covered by the cvscommon plugin | 197 | // Just add actions which are not covered by the cvscommon plugin | ||
198 | action = new QAction(i18n("Edit"), this); | 198 | action = new QAction(i18n("Edit"), menu); | ||
199 | connect(action, &QAction::triggered, this, &CvsPlugin::ctxEdit); | 199 | connect(action, &QAction::triggered, this, &CvsPlugin::ctxEdit); | ||
200 | menu->addAction(action); | 200 | menu->addAction(action); | ||
201 | 201 | | |||
202 | action = new QAction(i18n("Unedit"), this); | 202 | action = new QAction(i18n("Unedit"), menu); | ||
203 | connect(action, &QAction::triggered, this, &CvsPlugin::ctxUnEdit); | 203 | connect(action, &QAction::triggered, this, &CvsPlugin::ctxUnEdit); | ||
204 | menu->addAction(action); | 204 | menu->addAction(action); | ||
205 | 205 | | |||
206 | action = new QAction(i18n("Show Editors"), this); | 206 | action = new QAction(i18n("Show Editors"), menu); | ||
207 | connect(action, &QAction::triggered, this, &CvsPlugin::ctxEditors); | 207 | connect(action, &QAction::triggered, this, &CvsPlugin::ctxEditors); | ||
208 | menu->addAction(action); | 208 | menu->addAction(action); | ||
209 | 209 | | |||
210 | KDevelop::ContextMenuExtension menuExt; | 210 | KDevelop::ContextMenuExtension menuExt; | ||
211 | menuExt.addAction(KDevelop::ContextMenuExtension::VcsGroup, menu->menuAction()); | 211 | menuExt.addAction(KDevelop::ContextMenuExtension::VcsGroup, menu->menuAction()); | ||
212 | 212 | | |||
213 | return menuExt; | 213 | return menuExt; | ||
214 | } | 214 | } | ||
▲ Show 20 Lines • Show All 278 Lines • Show Last 20 Lines |