forked from qt-creator/qt-creator
VCS[vcs,p4,svn,hg]: Use VCManager for delete operations.
...and its dialog prompt consistently. Rename method and introduce overload taking IVersionControl. Add convenience slot to VCSBasePlugin.
This commit is contained in:
@@ -46,6 +46,7 @@
|
||||
#include <QtCore/QSharedData>
|
||||
|
||||
#include <QtGui/QAction>
|
||||
#include <QtGui/QMessageBox>
|
||||
|
||||
enum { debug = 0 };
|
||||
|
||||
@@ -446,6 +447,15 @@ bool VCSBasePlugin::enableMenuAction(ActionState as, QAction *menuAction)
|
||||
return true;
|
||||
}
|
||||
|
||||
void VCSBasePlugin::promptToDeleteCurrentFile()
|
||||
{
|
||||
const VCSBasePluginState state = currentState();
|
||||
QTC_ASSERT(state.hasFile(), return)
|
||||
const bool rc = Core::ICore::instance()->vcsManager()->promptToDelete(versionControl(), state.currentFile());
|
||||
if (!rc)
|
||||
QMessageBox::warning(0, tr("Version Control"), tr("The file '%1' could not be deleted.").arg(state.currentFile()), QMessageBox::Ok);
|
||||
}
|
||||
|
||||
} // namespace VCSBase
|
||||
|
||||
#include "vcsbaseplugin.moc"
|
||||
|
||||
Reference in New Issue
Block a user