SVN: Clarify "Current Project" menu and locator entry

As already done for the Git plugin in commit
b13a2804f0

Change-Id: I4117f362bf712f1f9ed80a3e7fd4488f7d845a46
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
Andre Hartmann
2024-09-08 20:34:42 +02:00
committed by André Hartmann
parent 3eb7364857
commit f4a4c3f0e9

View File

@@ -187,20 +187,20 @@ protected:
private: private:
void addCurrentFile(); void addCurrentFile();
void revertCurrentFile(); void revertCurrentFile();
void diffProject(); void diffProjectDirectory();
void diffCurrentFile(); void diffCurrentFile();
void cleanCommitMessageFile(); void cleanCommitMessageFile();
void startCommitAll(); void startCommitAll();
void startCommitProject(); void startCommitProjectDirectory();
void startCommitCurrentFile(); void startCommitCurrentFile();
void revertAll(); void revertAll();
void filelogCurrentFile(); void filelogCurrentFile();
void annotateCurrentFile(); void annotateCurrentFile();
void projectStatus(); void projectDirectoryStatus();
void slotDescribe(); void slotDescribe();
void updateProject(); void updateProjectDirectory();
void diffCommitFiles(const QStringList &); void diffCommitFiles(const QStringList &);
void logProject(); void logProjectDirectory();
void logRepository(); void logRepository();
void diffRepository(); void diffRepository();
void statusRepository(); void statusRepository();
@@ -228,9 +228,9 @@ private:
Utils::Action *m_addAction = nullptr; Utils::Action *m_addAction = nullptr;
Utils::Action *m_deleteAction = nullptr; Utils::Action *m_deleteAction = nullptr;
Utils::Action *m_revertAction = nullptr; Utils::Action *m_revertAction = nullptr;
Utils::Action *m_diffProjectAction = nullptr; Utils::Action *m_diffProjectDirectoryAction = nullptr;
Utils::Action *m_diffCurrentAction = nullptr; Utils::Action *m_diffCurrentAction = nullptr;
Utils::Action *m_logProjectAction = nullptr; Utils::Action *m_logProjectDirectoryAction = nullptr;
QAction *m_logRepositoryAction = nullptr; QAction *m_logRepositoryAction = nullptr;
QAction *m_commitAllAction = nullptr; QAction *m_commitAllAction = nullptr;
QAction *m_revertRepositoryAction = nullptr; QAction *m_revertRepositoryAction = nullptr;
@@ -240,9 +240,9 @@ private:
Utils::Action *m_commitCurrentAction = nullptr; Utils::Action *m_commitCurrentAction = nullptr;
Utils::Action *m_filelogCurrentAction = nullptr; Utils::Action *m_filelogCurrentAction = nullptr;
Utils::Action *m_annotateCurrentAction = nullptr; Utils::Action *m_annotateCurrentAction = nullptr;
Utils::Action *m_statusProjectAction = nullptr; Utils::Action *m_statusProjectDirectoryAction = nullptr;
Utils::Action *m_updateProjectAction = nullptr; Utils::Action *m_updateProjectDirectoryAction = nullptr;
Utils::Action *m_commitProjectAction = nullptr; Utils::Action *m_commitProjectDirectoryAction = nullptr;
QAction *m_describeAction = nullptr; QAction *m_describeAction = nullptr;
QAction *m_menuAction = nullptr; QAction *m_menuAction = nullptr;
@@ -384,39 +384,55 @@ SubversionPluginPrivate::SubversionPluginPrivate()
subversionMenu->addSeparator(context); subversionMenu->addSeparator(context);
m_diffProjectAction = new Action(Tr::tr("Diff Project"), Tr::tr("Diff Project \"%1\""), Action::EnabledWithParameter, this); m_diffProjectDirectoryAction = new Action(Tr::tr("Diff Project Directory"),
command = ActionManager::registerAction(m_diffProjectAction, CMD_ID_DIFF_PROJECT, Tr::tr("Diff Directory of Project \"%1\""),
Action::EnabledWithParameter, this);
command = ActionManager::registerAction(m_diffProjectDirectoryAction, CMD_ID_DIFF_PROJECT,
context); context);
command->setAttribute(Command::CA_UpdateText); command->setAttribute(Command::CA_UpdateText);
connect(m_diffProjectAction, &QAction::triggered, this, &SubversionPluginPrivate::diffProject); connect(m_diffProjectDirectoryAction, &QAction::triggered,
this, &SubversionPluginPrivate::diffProjectDirectory);
subversionMenu->addAction(command); subversionMenu->addAction(command);
m_commandLocator->appendCommand(command); m_commandLocator->appendCommand(command);
m_statusProjectAction = new Action(Tr::tr("Project Status"), Tr::tr("Status of Project \"%1\""), Action::EnabledWithParameter, this); m_statusProjectDirectoryAction = new Action(Tr::tr("Project Directory Status"),
command = ActionManager::registerAction(m_statusProjectAction, CMD_ID_STATUS, Tr::tr("Status of Directory of Project \"%1\""),
Action::EnabledWithParameter, this);
command = ActionManager::registerAction(m_statusProjectDirectoryAction, CMD_ID_STATUS,
context); context);
command->setAttribute(Command::CA_UpdateText); command->setAttribute(Command::CA_UpdateText);
connect(m_statusProjectAction, &QAction::triggered, this, &SubversionPluginPrivate::projectStatus); connect(m_statusProjectDirectoryAction, &QAction::triggered,
this, &SubversionPluginPrivate::projectDirectoryStatus);
subversionMenu->addAction(command); subversionMenu->addAction(command);
m_commandLocator->appendCommand(command); m_commandLocator->appendCommand(command);
m_logProjectAction = new Action(Tr::tr("Log Project"), Tr::tr("Log Project \"%1\""), Action::EnabledWithParameter, this); m_logProjectDirectoryAction = new Action(Tr::tr("Log Project Directory"),
command = ActionManager::registerAction(m_logProjectAction, CMD_ID_PROJECTLOG, context); Tr::tr("Log Directory of Project \"%1\""),
Action::EnabledWithParameter, this);
command = ActionManager::registerAction(m_logProjectDirectoryAction, CMD_ID_PROJECTLOG, context);
command->setAttribute(Command::CA_UpdateText); command->setAttribute(Command::CA_UpdateText);
connect(m_logProjectAction, &QAction::triggered, this, &SubversionPluginPrivate::logProject); connect(m_logProjectDirectoryAction, &QAction::triggered,
this, &SubversionPluginPrivate::logProjectDirectory);
subversionMenu->addAction(command); subversionMenu->addAction(command);
m_commandLocator->appendCommand(command); m_commandLocator->appendCommand(command);
m_updateProjectAction = new Action(Tr::tr("Update Project"), Tr::tr("Update Project \"%1\""), Action::EnabledWithParameter, this); m_updateProjectDirectoryAction = new Action(Tr::tr("Update Project Directory"),
command = ActionManager::registerAction(m_updateProjectAction, CMD_ID_UPDATE, context); Tr::tr("Update Directory of Project \"%1\""),
connect(m_updateProjectAction, &QAction::triggered, this, &SubversionPluginPrivate::updateProject); Action::EnabledWithParameter, this);
command = ActionManager::registerAction(m_updateProjectDirectoryAction, CMD_ID_UPDATE, context);
connect(m_updateProjectDirectoryAction, &QAction::triggered,
this, &SubversionPluginPrivate::updateProjectDirectory);
command->setAttribute(Command::CA_UpdateText); command->setAttribute(Command::CA_UpdateText);
subversionMenu->addAction(command); subversionMenu->addAction(command);
m_commandLocator->appendCommand(command); m_commandLocator->appendCommand(command);
m_commitProjectAction = new Action(Tr::tr("Commit Project"), Tr::tr("Commit Project \"%1\""), Action::EnabledWithParameter, this); m_commitProjectDirectoryAction = new Action(Tr::tr("Commit Project Directory"),
command = ActionManager::registerAction(m_commitProjectAction, CMD_ID_COMMIT_PROJECT, context); Tr::tr("Commit Directory of Project \"%1\""),
connect(m_commitProjectAction, &QAction::triggered, this, &SubversionPluginPrivate::startCommitProject); Action::EnabledWithParameter, this);
command = ActionManager::registerAction(m_commitProjectDirectoryAction, CMD_ID_COMMIT_PROJECT,
context);
connect(m_commitProjectDirectoryAction, &QAction::triggered,
this, &SubversionPluginPrivate::startCommitProjectDirectory);
command->setAttribute(Command::CA_UpdateText); command->setAttribute(Command::CA_UpdateText);
subversionMenu->addAction(command); subversionMenu->addAction(command);
m_commandLocator->appendCommand(command); m_commandLocator->appendCommand(command);
@@ -543,11 +559,11 @@ void SubversionPluginPrivate::updateActions(VersionControlBase::ActionState as)
m_logRepositoryAction->setEnabled(hasTopLevel); m_logRepositoryAction->setEnabled(hasTopLevel);
const QString projectName = currentState().currentProjectName(); const QString projectName = currentState().currentProjectName();
m_diffProjectAction->setParameter(projectName); m_diffProjectDirectoryAction->setParameter(projectName);
m_statusProjectAction->setParameter(projectName); m_statusProjectDirectoryAction->setParameter(projectName);
m_updateProjectAction->setParameter(projectName); m_updateProjectDirectoryAction->setParameter(projectName);
m_logProjectAction->setParameter(projectName); m_logProjectDirectoryAction->setParameter(projectName);
m_commitProjectAction->setParameter(projectName); m_commitProjectDirectoryAction->setParameter(projectName);
const bool repoEnabled = currentState().hasTopLevel(); const bool repoEnabled = currentState().hasTopLevel();
m_commitAllAction->setEnabled(repoEnabled); m_commitAllAction->setEnabled(repoEnabled);
@@ -629,7 +645,7 @@ void SubversionPluginPrivate::revertCurrentFile()
emit filesChanged(QStringList(state.currentFile().toString())); emit filesChanged(QStringList(state.currentFile().toString()));
} }
void SubversionPluginPrivate::diffProject() void SubversionPluginPrivate::diffProjectDirectory()
{ {
const VcsBasePluginState state = currentState(); const VcsBasePluginState state = currentState();
QTC_ASSERT(state.hasProject(), return); QTC_ASSERT(state.hasProject(), return);
@@ -660,7 +676,7 @@ void SubversionPluginPrivate::startCommitAll()
startCommit(state.topLevel()); startCommit(state.topLevel());
} }
void SubversionPluginPrivate::startCommitProject() void SubversionPluginPrivate::startCommitProjectDirectory()
{ {
const VcsBasePluginState state = currentState(); const VcsBasePluginState state = currentState();
QTC_ASSERT(state.hasProject(), return); QTC_ASSERT(state.hasProject(), return);
@@ -722,7 +738,7 @@ void SubversionPluginPrivate::filelogCurrentFile()
filelog(state.currentFileTopLevel(), state.relativeCurrentFile(), true); filelog(state.currentFileTopLevel(), state.relativeCurrentFile(), true);
} }
void SubversionPluginPrivate::logProject() void SubversionPluginPrivate::logProjectDirectory()
{ {
const VcsBasePluginState state = currentState(); const VcsBasePluginState state = currentState();
QTC_ASSERT(state.hasProject(), return); QTC_ASSERT(state.hasProject(), return);
@@ -776,7 +792,7 @@ void SubversionPluginPrivate::filelog(const FilePath &workingDir,
[](CommandLine &command) { command << SubversionClient::AddAuthOptions(); }); [](CommandLine &command) { command << SubversionClient::AddAuthOptions(); });
} }
void SubversionPluginPrivate::updateProject() void SubversionPluginPrivate::updateProjectDirectory()
{ {
const VcsBasePluginState state = currentState(); const VcsBasePluginState state = currentState();
QTC_ASSERT(state.hasProject(), return); QTC_ASSERT(state.hasProject(), return);
@@ -842,7 +858,7 @@ void SubversionPluginPrivate::vcsAnnotateHelper(const FilePath &workingDir, cons
} }
} }
void SubversionPluginPrivate::projectStatus() void SubversionPluginPrivate::projectDirectoryStatus()
{ {
const VcsBasePluginState state = currentState(); const VcsBasePluginState state = currentState();
QTC_ASSERT(state.hasProject(), return); QTC_ASSERT(state.hasProject(), return);