Fixes: Random enabling of submit/diff buttons when switching contexts (viewing diffs) from the submit editor

Details: Register actions directly
This commit is contained in:
Friedemann Kleint
2009-01-13 14:06:42 +01:00
parent 1263660507
commit dd235e2b48
5 changed files with 31 additions and 54 deletions

View File

@@ -179,11 +179,7 @@ PerforcePlugin::PerforcePlugin() :
static const VCSBase::VCSBaseSubmitEditorParameters submitParameters = {
Perforce::Constants::SUBMIT_MIMETYPE,
Perforce::Constants::PERFORCESUBMITEDITOR_KIND,
Perforce::Constants::C_PERFORCESUBMITEDITOR,
Core::Constants::UNDO,
Core::Constants::REDO,
Perforce::Constants::SUBMIT_CURRENT,
Perforce::Constants::DIFF_SELECTED
Perforce::Constants::C_PERFORCESUBMITEDITOR
};
bool PerforcePlugin::initialize(const QStringList & /*arguments*/, QString *errorMessage)
@@ -558,12 +554,8 @@ Core::IEditor *PerforcePlugin::openPerforceSubmitEditor(const QString &fileName,
PerforceSubmitEditor *submitEditor = dynamic_cast<PerforceSubmitEditor*>(editor);
QTC_ASSERT(submitEditor, return 0);
submitEditor->restrictToProjectFiles(depotFileNames);
submitEditor->registerActions(m_undoAction, m_redoAction, m_submitCurrentLogAction, m_diffSelectedFiles);
connect(submitEditor, SIGNAL(diffSelectedFiles(QStringList)), this, SLOT(slotDiff(QStringList)));
// The actions are for some reason enabled by the context switching
// mechanism. Disable them correctly.
m_diffSelectedFiles->setEnabled(false);
m_undoAction->setEnabled(false);
m_redoAction->setEnabled(false);
return editor;
}