Commit b4969672 authored by Friedemann Kleint's avatar Friedemann Kleint

VCS[Perforce/SVN/CVS]: Add "Annotate" to single file logs.

...over change numbers. Add missing "Log project/repository"
actions and log count limits.
Task-number: QTCREATORBUG-503
parent aadc0b9b
......@@ -54,6 +54,7 @@ CVSEditor::CVSEditor(const VCSBase::VCSBaseEditorParameters *type,
{
QTC_ASSERT(m_revisionAnnotationPattern.isValid(), return);
QTC_ASSERT(m_revisionLogPattern.isValid(), return);
setAnnotateRevisionTextFormat(tr("Annotate revision \"%1\""));
}
QSet<QString> CVSEditor::annotationChanges() const
......@@ -149,11 +150,10 @@ QString CVSEditor::fileNameFromDiffSpecification(const QTextBlock &inBlock) cons
return QString();
}
QStringList CVSEditor::annotationPreviousVersions(const QString &revision, QString *actionTextFormat) const
QStringList CVSEditor::annotationPreviousVersions(const QString &revision) const
{
if (isFirstRevision(revision))
return QStringList();
*actionTextFormat = tr("Annotate revision \"%1\"");
return QStringList(previousRevision(revision));
}
......
......@@ -51,7 +51,7 @@ private:
virtual VCSBase::DiffHighlighter *createDiffHighlighter() const;
virtual VCSBase::BaseAnnotationHighlighter *createAnnotationHighlighter(const QSet<QString> &changes) const;
virtual QString fileNameFromDiffSpecification(const QTextBlock &diffFileName) const;
virtual QStringList annotationPreviousVersions(const QString &revision, QString *actionTextFormat) const;
virtual QStringList annotationPreviousVersions(const QString &revision) const;
const QRegExp m_revisionAnnotationPattern;
const QRegExp m_revisionLogPattern;
......
......@@ -95,6 +95,9 @@ static const char * const CMD_ID_ANNOTATE_CURRENT = "CVS.AnnotateCurrent";
static const char * const CMD_ID_SEPARATOR3 = "CVS.Separator3";
static const char * const CMD_ID_STATUS = "CVS.Status";
static const char * const CMD_ID_UPDATE = "CVS.Update";
static const char * const CMD_ID_PROJECTLOG = "CVS.ProjectLog";
static const char * const CMD_ID_REPOSITORYLOG = "CVS.RepositoryLog";
static const char * const CMD_ID_SEPARATOR4 = "CVS.Separator4";
static const VCSBase::VCSBaseEditorParameters editorParameters[] = {
{
......@@ -149,6 +152,8 @@ CVSPlugin::CVSPlugin() :
m_revertAction(0),
m_diffProjectAction(0),
m_diffCurrentAction(0),
m_logProjectAction(0),
m_logRepositoryAction(0),
m_commitAllAction(0),
m_commitCurrentAction(0),
m_filelogCurrentAction(0),
......@@ -325,12 +330,24 @@ bool CVSPlugin::initialize(const QStringList & /*arguments */, QString *errorMes
connect(m_statusProjectAction, SIGNAL(triggered()), this, SLOT(projectStatus()));
cvsMenu->addAction(command);
m_logProjectAction = new Utils::ParameterAction(tr("Log Project"), tr("Log Project \"%1\""), Utils::ParameterAction::EnabledWithParameter, this);
command = ami->registerAction(m_logProjectAction, CMD_ID_PROJECTLOG, globalcontext);
command->setAttribute(Core::Command::CA_UpdateText);
connect(m_logProjectAction, SIGNAL(triggered()), this, SLOT(logProject()));
cvsMenu->addAction(command);
m_updateProjectAction = new Utils::ParameterAction(tr("Update Project"), tr("Update Project \"%1\""), Utils::ParameterAction::EnabledWithParameter, this);
command = ami->registerAction(m_updateProjectAction, CMD_ID_UPDATE, globalcontext);
command->setAttribute(Core::Command::CA_UpdateText);
connect(m_updateProjectAction, SIGNAL(triggered()), this, SLOT(updateProject()));
cvsMenu->addAction(command);
cvsMenu->addAction(createSeparator(this, ami, CMD_ID_SEPARATOR4, globalcontext));
m_logRepositoryAction = new QAction(tr("Repository Log"), this);
command = ami->registerAction(m_logRepositoryAction, CMD_ID_REPOSITORYLOG, globalcontext);
connect(m_logRepositoryAction, SIGNAL(triggered()), this, SLOT(logRepository()));
cvsMenu->addAction(command);
// Actions of the submit editor
QList<int> cvscommitcontext;
cvscommitcontext << Core::UniqueIDManager::instance()->uniqueIdentifier(Constants::CVSCOMMITEDITOR);
......@@ -475,6 +492,8 @@ void CVSPlugin::updateActions(VCSBase::VCSBasePlugin::ActionState as)
if (!VCSBase::VCSBasePlugin::enableMenuAction(as, m_menuAction))
return;
m_logRepositoryAction->setEnabled(currentState().hasTopLevel());
const QString currentFileName = currentState().currentFileName();
m_addAction->setParameter(currentFileName);
m_deleteAction->setParameter(currentFileName);
......@@ -488,6 +507,7 @@ void CVSPlugin::updateActions(VCSBase::VCSBasePlugin::ActionState as)
m_diffProjectAction->setParameter(currentProjectName);
m_statusProjectAction->setParameter(currentProjectName);
m_updateProjectAction->setParameter(currentProjectName);
m_logProjectAction->setParameter(currentProjectName);
m_commitAllAction->setEnabled(currentState().hasTopLevel());
}
......@@ -641,10 +661,26 @@ void CVSPlugin::filelogCurrentFile()
{
const VCSBase::VCSBasePluginState state = currentState();
QTC_ASSERT(state.hasFile(), return)
filelog(state.currentFileTopLevel(), QStringList(state.relativeCurrentFile()));
filelog(state.currentFileTopLevel(), QStringList(state.relativeCurrentFile()), true);
}
void CVSPlugin::filelog(const QString &workingDir, const QStringList &files)
void CVSPlugin::logProject()
{
const VCSBase::VCSBasePluginState state = currentState();
QTC_ASSERT(state.hasProject(), return)
filelog(state.currentProjectTopLevel(), state.relativeCurrentProject());
}
void CVSPlugin::logRepository()
{
const VCSBase::VCSBasePluginState state = currentState();
QTC_ASSERT(state.hasTopLevel(), return)
filelog(state.topLevel());
}
void CVSPlugin::filelog(const QString &workingDir,
const QStringList &files,
bool enableAnnotationContextMenu)
{
QTextCodec *codec = VCSBase::VCSBaseEditor::getCodec(workingDir, files);
// no need for temp file
......@@ -659,7 +695,6 @@ void CVSPlugin::filelog(const QString &workingDir, const QStringList &files)
// Re-use an existing view if possible to support
// the common usage pattern of continuously changing and diffing a file
if (Core::IEditor *editor = locateEditor("logFileName", id)) {
editor->createNew(response.stdOut);
Core::EditorManager::instance()->activateEditor(editor);
......@@ -667,6 +702,8 @@ void CVSPlugin::filelog(const QString &workingDir, const QStringList &files)
const QString title = QString::fromLatin1("cvs log %1").arg(id);
Core::IEditor *newEditor = showOutputInEditor(title, response.stdOut, VCSBase::LogOutput, source, codec);
newEditor->setProperty("logFileName", id);
if (enableAnnotationContextMenu)
VCSBase::VCSBaseEditor::getVcsBaseEditor(newEditor)->setFileLogAnnotateEnabled(true);
}
}
......@@ -726,8 +763,6 @@ void CVSPlugin::annotate(const QString &workingDir, const QString &file,
const QString title = QString::fromLatin1("cvs annotate %1").arg(id);
Core::IEditor *newEditor = showOutputInEditor(title, response.stdOut, VCSBase::AnnotateOutput, source, codec);
newEditor->setProperty("annotateFileName", id);
connect(newEditor, SIGNAL(annotatePreviousRequested(QString,QString,int)),
this, SLOT(annotateVersion(QString,QString,int)));
VCSBase::VCSBaseEditor::gotoLineOfEditor(newEditor, lineNumber);
}
}
......@@ -992,6 +1027,8 @@ Core::IEditor * CVSPlugin::showOutputInEditor(const QString& title, const QStrin
qDebug() << "CVSPlugin::showOutputInEditor" << title << kind << "source=" << source << "Size= " << output.size() << " Type=" << editorType << debugCodec(codec);
QString s = title;
Core::IEditor *editor = Core::EditorManager::instance()->openEditorWithContents(kind, &s, output.toLocal8Bit());
connect(editor, SIGNAL(annotateRevisionRequested(QString,QString,int)),
this, SLOT(annotateVersion(QString,QString,int)));
CVSEditor *e = qobject_cast<CVSEditor*>(editor->widget());
if (!e)
return 0;
......
......@@ -113,6 +113,8 @@ private slots:
void updateProject();
void submitCurrentLog();
void diffCommitFiles(const QStringList &);
void logProject();
void logRepository();
protected:
virtual void updateActions(VCSBase::VCSBasePlugin::ActionState);
......@@ -135,7 +137,9 @@ private:
bool describe(const QString &source, const QString &changeNr, QString *errorMessage);
bool describe(const QString &toplevel, const QString &source, const QString &changeNr, QString *errorMessage);
bool describe(const QString &repository, QList<CVS_LogEntry> entries, QString *errorMessage);
void filelog(const QString &workingDir, const QStringList &files = QStringList());
void filelog(const QString &workingDir,
const QStringList &files = QStringList(),
bool enableAnnotationContextMenu = false);
bool managesDirectory(const QDir &directory) const;
QString findTopLevelForDirectoryI(const QString &directory) const;
void startCommit(const QString &workingDir, const QStringList &files = QStringList());
......@@ -152,6 +156,8 @@ private:
Utils::ParameterAction *m_revertAction;
Utils::ParameterAction *m_diffProjectAction;
Utils::ParameterAction *m_diffCurrentAction;
Utils::ParameterAction *m_logProjectAction;
QAction *m_logRepositoryAction;
QAction *m_commitAllAction;
Utils::ParameterAction *m_commitCurrentAction;
Utils::ParameterAction *m_filelogCurrentAction;
......
......@@ -62,6 +62,7 @@ PerforceEditor::PerforceEditor(const VCSBase::VCSBaseEditorParameters *type,
m_plugin(PerforcePlugin::perforcePluginInstance())
{
QTC_ASSERT(m_changeNumberPattern.isValid(), /**/);
setAnnotateRevisionTextFormat(tr("Annotate change list \"%1\""));
if (Perforce::Constants::debug)
qDebug() << "PerforceEditor::PerforceEditor" << type->type << type->kind;
}
......@@ -154,13 +155,12 @@ QString PerforceEditor::fileNameFromDiffSpecification(const QTextBlock &inBlock)
return QString();
}
QStringList PerforceEditor::annotationPreviousVersions(const QString &v, QString *actionTextFormat) const
QStringList PerforceEditor::annotationPreviousVersions(const QString &v) const
{
bool ok;
const int changeList = v.toInt(&ok);
if (!ok || changeList < 2)
return QStringList();
*actionTextFormat = tr("Annotate change list \"%1\"");
return QStringList(QString::number(changeList - 1));
}
......
......@@ -53,7 +53,7 @@ private:
virtual VCSBase::DiffHighlighter *createDiffHighlighter() const;
virtual VCSBase::BaseAnnotationHighlighter *createAnnotationHighlighter(const QSet<QString> &changes) const;
virtual QString fileNameFromDiffSpecification(const QTextBlock &diffFileName) const;
virtual QStringList annotationPreviousVersions(const QString &v, QString *actionTextFormat) const;
virtual QStringList annotationPreviousVersions(const QString &v) const;
const QRegExp m_changeNumberPattern;
PerforcePlugin *m_plugin;
......
......@@ -133,6 +133,8 @@ static const char * const CMD_ID_EDIT = "Perforce.Edit";
static const char * const CMD_ID_ADD = "Perforce.Add";
static const char * const CMD_ID_DELETE_FILE = "Perforce.Delete";
static const char * const CMD_ID_OPENED = "Perforce.Opened";
static const char * const CMD_ID_PROJECTLOG = "Perforce.ProjectLog";
static const char * const CMD_ID_REPOSITORYLOG = "Perforce.RepositoryLog";
static const char * const CMD_ID_REVERT = "Perforce.Revert";
static const char * const CMD_ID_DIFF_CURRENT = "Perforce.DiffCurrent";
static const char * const CMD_ID_DIFF_PROJECT = "Perforce.DiffProject";
......@@ -152,6 +154,7 @@ static const char * const CMD_ID_UPDATEALL = "Perforce.UpdateAll";
static const char * const CMD_ID_SEPARATOR1 = "Perforce.Separator1";
static const char * const CMD_ID_SEPARATOR2 = "Perforce.Separator2";
static const char * const CMD_ID_SEPARATOR3 = "Perforce.Separator3";
static const char * const CMD_ID_SEPARATOR4 = "Perforce.Separator4";
////
// PerforcePlugin
......@@ -188,6 +191,8 @@ PerforcePlugin::PerforcePlugin() :
m_annotateAction(0),
m_filelogCurrentAction(0),
m_filelogAction(0),
m_logProjectAction(0),
m_logRepositoryAction(0),
m_submitCurrentLogAction(0),
m_updateAllAction(0),
m_submitActionTriggered(false),
......@@ -318,6 +323,12 @@ bool PerforcePlugin::initialize(const QStringList & /* arguments */, QString * e
connect(m_openedAction, SIGNAL(triggered()), this, SLOT(printOpenedFileList()));
mperforce->addAction(command);
m_logProjectAction = new Utils::ParameterAction(tr("Log Project Log"), tr("Log Project \"%1\""), Utils::ParameterAction::EnabledWithParameter, this);
command = am->registerAction(m_logProjectAction, CMD_ID_PROJECTLOG, globalcontext);
command->setAttribute(Core::Command::CA_UpdateText);
connect(m_logProjectAction, SIGNAL(triggered()), this, SLOT(logProject()));
mperforce->addAction(command);
m_submitProjectAction = new Utils::ParameterAction(tr("Submit Project"), tr("Submit Project \"%1\""), Utils::ParameterAction::EnabledWithParameter, this);
command = am->registerAction(m_submitProjectAction, CMD_ID_SUBMIT, globalcontext);
command->setAttribute(Core::Command::CA_UpdateText);
......@@ -385,6 +396,16 @@ bool PerforcePlugin::initialize(const QStringList & /* arguments */, QString * e
connect(m_filelogAction, SIGNAL(triggered()), this, SLOT(filelog()));
mperforce->addAction(command);
tmpaction = new QAction(this);
tmpaction->setSeparator(true);
command = am->registerAction(tmpaction, QLatin1String(CMD_ID_SEPARATOR4), globalcontext);
mperforce->addAction(command);
m_logRepositoryAction = new QAction(tr("Repository Log"), this);
command = am->registerAction(m_logRepositoryAction, CMD_ID_REPOSITORYLOG, globalcontext);
connect(m_logRepositoryAction, SIGNAL(triggered()), this, SLOT(logRepository()));
mperforce->addAction(command);
m_updateAllAction = new QAction(tr("Update All"), this);
command = am->registerAction(m_updateAllAction, CMD_ID_UPDATEALL, globalcontext);
connect(m_updateAllAction, SIGNAL(triggered()), this, SLOT(updateAll()));
......@@ -715,8 +736,6 @@ void PerforcePlugin::annotate(const QString &workingDir,
Core::IEditor *ed = showOutputInEditor(tr("p4 annotate %1").arg(id),
result.stdOut, VCSBase::AnnotateOutput,
source, codec);
connect(ed, SIGNAL(annotatePreviousRequested(QString,QString,int)),
this, SLOT(annotateVersion(QString,QString,int)));
VCSBase::VCSBaseEditor::gotoLineOfEditor(ed, lineNumber);
}
}
......@@ -725,7 +744,7 @@ void PerforcePlugin::filelogCurrentFile()
{
const VCSBase::VCSBasePluginState state = currentState();
QTC_ASSERT(state.hasFile(), return)
filelog(state.currentFileTopLevel(), QStringList(state.relativeCurrentFile()));
filelog(state.currentFileTopLevel(), QStringList(state.relativeCurrentFile()), true);
}
void PerforcePlugin::filelog()
......@@ -737,21 +756,40 @@ void PerforcePlugin::filelog()
}
}
void PerforcePlugin::filelog(const QString &workingDir, const QStringList &fileNames)
void PerforcePlugin::logProject()
{
const VCSBase::VCSBasePluginState state = currentState();
QTC_ASSERT(state.hasProject(), return)
filelog(state.currentProjectTopLevel(), perforceRelativeFileArguments(state.relativeCurrentProject()));
}
void PerforcePlugin::logRepository()
{
const VCSBase::VCSBasePluginState state = currentState();
QTC_ASSERT(state.hasTopLevel(), return)
filelog(state.topLevel(), perforceRelativeFileArguments(QStringList()));
}
void PerforcePlugin::filelog(const QString &workingDir, const QStringList &fileNames,
bool enableAnnotationContextMenu)
{
const QString id = VCSBase::VCSBaseEditor::getTitleId(workingDir, fileNames);
QTextCodec *codec = VCSBase::VCSBaseEditor::getCodec(workingDir, fileNames);
QStringList args;
args << QLatin1String("filelog") << QLatin1String("-li");
if (m_settings.logCount() > 0)
args << QLatin1String("-m") << QString::number(m_settings.logCount());
args.append(fileNames);
const PerforceResponse result = runP4Cmd(workingDir, args,
CommandToWindow|StdErrToWindow|ErrorToWindow,
QStringList(), QByteArray(), codec);
if (!result.error)
showOutputInEditor(tr("p4 filelog %1").arg(id), result.stdOut,
VCSBase::LogOutput,
VCSBase::VCSBaseEditor::getSource(workingDir, fileNames),
codec);
if (!result.error) {
const QString source = VCSBase::VCSBaseEditor::getSource(workingDir, fileNames);
Core::IEditor *editor = showOutputInEditor(tr("p4 filelog %1").arg(id), result.stdOut,
VCSBase::LogOutput, source, codec);
if (enableAnnotationContextMenu)
VCSBase::VCSBaseEditor::getVcsBaseEditor(editor)->setFileLogAnnotateEnabled(true);
}
}
void PerforcePlugin::updateActions(VCSBase::VCSBasePlugin::ActionState as)
......@@ -759,6 +797,8 @@ void PerforcePlugin::updateActions(VCSBase::VCSBasePlugin::ActionState as)
if (!VCSBase::VCSBasePlugin::enableMenuAction(as, m_menuAction))
return;
m_logRepositoryAction->setEnabled(currentState().hasTopLevel());
const QString fileName = currentState().currentFileName();
m_editAction->setParameter(fileName);
m_addAction->setParameter(fileName);
......@@ -769,6 +809,7 @@ void PerforcePlugin::updateActions(VCSBase::VCSBasePlugin::ActionState as)
m_filelogCurrentAction->setParameter(fileName);
const QString projectName = currentState().currentProjectName();
m_logProjectAction->setParameter(projectName);
m_updateProjectAction->setParameter(projectName);
m_diffProjectAction->setParameter(projectName);
m_submitProjectAction->setParameter(projectName);
......@@ -1110,6 +1151,8 @@ Core::IEditor * PerforcePlugin::showOutputInEditor(const QString& title, const Q
qDebug() << "PerforcePlugin::showOutputInEditor" << title << kind << "Size= " << output.size() << " Type=" << editorType << debugCodec(codec);
QString s = title;
Core::IEditor *editor = Core::EditorManager::instance()->openEditorWithContents(kind, &s, output);
connect(editor, SIGNAL(annotateRevisionRequested(QString,QString,int)),
this, SLOT(annotateVersion(QString,QString,int)));
PerforceEditor *e = qobject_cast<PerforceEditor*>(editor->widget());
if (!e)
return 0;
......
......@@ -123,6 +123,8 @@ private slots:
void annotateVersion(const QString &file, const QString &revision, int lineNumber);
void filelogCurrentFile();
void filelog();
void logProject();
void logRepository();
void submitCurrentLog();
void printPendingChanges();
......@@ -177,7 +179,8 @@ private:
QString clientFilePath(const QString &serverFilePath);
void annotate(const QString &workingDir, const QString &fileName,
const QString &changeList = QString(), int lineNumber = -1);
void filelog(const QString &workingDir, const QStringList &fileNames);
void filelog(const QString &workingDir, const QStringList &fileNames = QStringList(),
bool enableAnnotationContextMenu = false);
void cleanCommitMessageFile();
bool isCommitEditorOpen() const;
QSharedPointer<QTemporaryFile> createTemporaryArgumentFile(const QStringList &extraArgs) const;
......@@ -208,6 +211,8 @@ private:
QAction *m_annotateAction;
Utils::ParameterAction *m_filelogCurrentAction;
QAction *m_filelogAction;
Utils::ParameterAction *m_logProjectAction;
QAction *m_logRepositoryAction;
QAction *m_submitCurrentLogAction;
QAction *m_updateAllAction;
bool m_submitActionTriggered;
......
......@@ -47,8 +47,9 @@ static const char *clientKeyC = "Client";
static const char *userKeyC = "User";
static const char *promptToSubmitKeyC = "PromptForSubmit";
static const char *timeOutKeyC = "TimeOut";
static const char *logCountKeyC = "LogCount";
enum { defaultTimeOutS = 30 };
enum { defaultTimeOutS = 30, defaultLogCount = 1000 };
static QString defaultCommand()
{
......@@ -64,6 +65,7 @@ namespace Perforce {
namespace Internal {
Settings::Settings() :
logCount(defaultLogCount),
defaultEnv(true),
timeOutS(defaultTimeOutS),
promptToSubmit(true)
......@@ -73,6 +75,7 @@ Settings::Settings() :
bool Settings::equals(const Settings &rhs) const
{
return defaultEnv == rhs.defaultEnv
&& logCount == rhs.logCount
&& p4Command == rhs.p4Command && p4Port == rhs.p4Port
&& p4Client == rhs.p4Client && p4User == rhs.p4User
&& timeOutS == rhs.timeOutS && promptToSubmit == rhs.promptToSubmit;
......@@ -111,6 +114,7 @@ void PerforceSettings::fromSettings(QSettings *settings)
m_settings.p4User = settings->value(QLatin1String(userKeyC), QString()).toString();
m_settings.timeOutS = settings->value(QLatin1String(timeOutKeyC), defaultTimeOutS).toInt();
m_settings.promptToSubmit = settings->value(QLatin1String(promptToSubmitKeyC), true).toBool();
m_settings.logCount = settings->value(QLatin1String(logCountKeyC), int(defaultLogCount)).toInt();
settings->endGroup();
}
......@@ -124,6 +128,7 @@ void PerforceSettings::toSettings(QSettings *settings) const
settings->setValue(QLatin1String(userKeyC), m_settings.p4User);
settings->setValue(QLatin1String(timeOutKeyC), m_settings.timeOutS);
settings->setValue(QLatin1String(promptToSubmitKeyC), m_settings.promptToSubmit);
settings->setValue(QLatin1String(logCountKeyC), m_settings.logCount);
settings->endGroup();
}
......
......@@ -57,6 +57,7 @@ struct Settings {
QString p4Client;
QString p4User;
QString errorString;
int logCount;
bool defaultEnv;
int timeOutS;
bool promptToSubmit;
......@@ -97,6 +98,8 @@ public:
inline int timeOutMS() const { return m_settings.timeOutS * 1000; }
inline int longTimeOutMS() const { return m_settings.timeOutS * 10000; }
inline int logCount() const { return m_settings.logCount; }
QString topLevel() const;
QString topLevelSymLinkTarget() const;
......
......@@ -82,6 +82,7 @@ Settings SettingsPageWidget::settings() const
settings.p4User = m_ui.userLineEdit->text();
settings.p4Client= m_ui.clientLineEdit->text();
settings.timeOutS = m_ui.timeOutSpinBox->value();
settings.logCount = m_ui.logCountSpinBox->value();
settings.promptToSubmit = m_ui.promptToSubmitCheckBox->isChecked();
return settings;
}
......@@ -93,6 +94,7 @@ void SettingsPageWidget::setSettings(const PerforceSettings &s)
m_ui.portLineEdit->setText(s.p4Port());
m_ui.clientLineEdit->setText(s.p4Client());
m_ui.userLineEdit->setText(s.p4User());
m_ui.logCountSpinBox->setValue(s.logCount());
m_ui.timeOutSpinBox->setValue(s.timeOutS());
m_ui.promptToSubmitCheckBox->setChecked(s.promptToSubmit());
}
......
......@@ -90,21 +90,17 @@
<string>Miscellaneous</string>
</property>
<layout class="QFormLayout" name="formLayout_2">
<item row="1" column="0" colspan="2">
<widget class="QCheckBox" name="promptToSubmitCheckBox">
<property name="text">
<string>Prompt on submit</string>
</property>
</widget>
</item>
<item row="0" column="0">
<property name="fieldGrowthPolicy">
<enum>QFormLayout::ExpandingFieldsGrow</enum>
</property>
<item row="1" column="0">
<widget class="QLabel" name="timeOutLabel">
<property name="text">
<string>Timeout:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<item row="1" column="1">
<widget class="QSpinBox" name="timeOutSpinBox">
<property name="suffix">
<string>s</string>
......@@ -117,6 +113,27 @@
</property>
</widget>
</item>
<item row="2" column="0" colspan="2">
<widget class="QCheckBox" name="promptToSubmitCheckBox">
<property name="text">
<string>Prompt on submit</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="logCountLabel">
<property name="text">
<string>Log count:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QSpinBox" name="logCountSpinBox">
<property name="maximum">
<number>10000</number>
</property>
</widget>
</item>
</layout>
</widget>
</item>
......
......@@ -63,6 +63,7 @@ SubversionSettings SettingsPageWidget::settings() const
rc.useAuthentication = false;
rc.promptToSubmit = m_ui.promptToSubmitCheckBox->isChecked();
rc.spaceIgnorantAnnotation = m_ui.spaceIgnorantAnnotationCheckBox->isChecked();
rc.logCount = m_ui.logCountSpinBox->value();
return rc;
}
......@@ -75,6 +76,7 @@ void SettingsPageWidget::setSettings(const SubversionSettings &s)
m_ui.timeOutSpinBox->setValue(s.timeOutS);
m_ui.promptToSubmitCheckBox->setChecked(s.promptToSubmit);
m_ui.spaceIgnorantAnnotationCheckBox->setChecked(s.spaceIgnorantAnnotation);
m_ui.logCountSpinBox->setValue(s.logCount);
}
QString SettingsPageWidget::searchKeywords() const
......
......@@ -2,14 +2,6 @@
<ui version="4.0">
<class>Subversion::Internal::SettingsPage</class>
<widget class="QWidget" name="Subversion::Internal::SettingsPage">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>496</width>
<height>295</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QGroupBox" name="generalGroupBox">
......@@ -72,21 +64,17 @@
<string>Miscellaneous</string>
</property>
<layout class="QFormLayout" name="formLayout_2">
<item row="1" column="0" colspan="2">
<widget class="QCheckBox" name="promptToSubmitCheckBox">
<property name="text">
<string>Prompt on submit</string>
</property>
</widget>
</item>
<item row="0" column="0">
<property name="fieldGrowthPolicy">
<enum>QFormLayout::ExpandingFieldsGrow</enum>
</property>
<item row="1" column="0">
<widget class="QLabel" name="timeOutLabel">
<property name="text">
<string>Timeout:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<item row="1" column="1">
<widget class="QSpinBox" name="timeOutSpinBox">
<property name="suffix">
<string>s</string>
......@@ -100,12 +88,33 @@
</widget>
</item>
<item row="2" column="0" colspan="2">
<widget class="QCheckBox" name="promptToSubmitCheckBox">
<property name="text">
<string>Prompt on submit</string>
</property>
</widget>
</item>
<item row="3" column="0" colspan="2">
<widget class="QCheckBox" name="spaceIgnorantAnnotationCheckBox">
<property name="text">
<string>Ignore whitespace changes in annotation</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="logCountLabel">
<property name="text">
<string>Log count:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QSpinBox" name="logCountSpinBox">
<property name="maximum">
<number>10000</number>
</property>
</widget>
</item>
</layout>
</widget>
</item>
......
......@@ -51,6 +51,7 @@ SubversionEditor::SubversionEditor(const VCSBase::VCSBaseEditorParameters *type,
{
QTC_ASSERT(m_changeNumberPattern.isValid(), return);
QTC_ASSERT(m_revisionNumberPattern.isValid(), return);
setAnnotateRevisionTextFormat(tr("Annotate revision \"%1\""));
}
QSet<QString> SubversionEditor::annotationChanges() const
......@@ -138,12 +139,11 @@ QString SubversionEditor::fileNameFromDiffSpecification(const QTextBlock &inBloc
return QString();
}
QStringList SubversionEditor::annotationPreviousVersions(const QString &v, QString *actionTextFormat) const
QStringList SubversionEditor::annotationPreviousVersions(const QString &v) const