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:
Friedemann Kleint
2010-01-11 15:22:17 +01:00
parent 661314742e
commit 95da419067
16 changed files with 79 additions and 57 deletions

View File

@@ -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"