VCS: Consolidate submit editor actions setup

Change-Id: I36754779b6a9aa35de705b368daf8c2a1de058c6
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
Orgad Shaneh
2018-08-28 00:03:59 +03:00
committed by Orgad Shaneh
parent f1f506b479
commit 767137157e
21 changed files with 59 additions and 203 deletions

View File

@@ -104,9 +104,6 @@ const char COMMIT[] = "Bazaar.Action.Commit";
const char UNCOMMIT[] = "Bazaar.Action.UnCommit";
const char CREATE_REPOSITORY[] = "Bazaar.Action.CreateRepository";
// Submit editor actions
const char DIFFEDITOR[] = "Bazaar.Action.Editor.Diff";
const VcsBaseEditorParameters editorParameters[] = {
{ LogOutput, // type
Constants::FILELOG_ID, // id
@@ -175,8 +172,6 @@ bool BazaarPlugin::initialize(const QStringList &arguments, QString *errorMessag
createMenu(context);
createSubmitEditorActions();
return true;
}
@@ -486,26 +481,6 @@ void BazaarPlugin::update()
m_client->update(state.topLevel(), revertUi.revisionLineEdit->text());
}
void BazaarPlugin::createSubmitEditorActions()
{
Context context(COMMIT_ID);
Command *command;
m_editorCommit = new QAction(VcsBaseSubmitEditor::submitIcon(), tr("Commit"), this);
command = ActionManager::registerAction(m_editorCommit, COMMIT, context);
command->setAttribute(Command::CA_UpdateText);
connect(m_editorCommit, &QAction::triggered, this, &BazaarPlugin::commitFromEditor);
m_editorDiff = new QAction(VcsBaseSubmitEditor::diffIcon(), tr("Diff &Selected Files"), this);
ActionManager::registerAction(m_editorDiff, DIFFEDITOR, context);
m_editorUndo = new QAction(tr("&Undo"), this);
ActionManager::registerAction(m_editorUndo, Core::Constants::UNDO, context);
m_editorRedo = new QAction(tr("&Redo"), this);
ActionManager::registerAction(m_editorRedo, Core::Constants::REDO, context);
}
void BazaarPlugin::commit()
{
if (!promptBeforeCommit())
@@ -559,7 +534,6 @@ void BazaarPlugin::showCommitWidget(const QList<VcsBaseClient::StatusItem> &stat
}
setSubmitEditor(commitEditor);
commitEditor->registerActions(m_editorUndo, m_editorRedo, m_editorCommit, m_editorDiff);
connect(commitEditor, &VcsBaseSubmitEditor::diffSelectedFiles,
this, &BazaarPlugin::diffFromEditorSelected);
commitEditor->setCheckScriptWorkingDirectory(m_submitRepository);