Extending Qt Creator Manual | VcsBaseSubmitEditor

Extending Qt Creator Manual 4.5.2

# VcsBaseSubmitEditor Class

(VcsBase::VcsBaseSubmitEditor)

The VcsBaseSubmitEditor class is the base class for a submit editor based on the SubmitEditorWidget. More...

Header: | #include <VcsBaseSubmitEditor>
Inherits: | Core::IEditor

- List of all members, including inherited members

## Public Types

enum | PromptSubmitResult { SubmitConfirmed, SubmitCanceled, SubmitDiscarded }

## Properties

- checkScriptWorkingDirectory : QString
- emptyFileListEnabled : bool
- fileListSelectionMode : QAbstractItemView::SelectionMode

- lineWrap : bool
- lineWrapWidth : int

## Public Functions

| ~VcsBaseSubmitEditor() override
QString | checkScriptWorkingDirectory() const
QStringList | checkedFiles() const
QAbstractItemView::SelectionMode | fileListSelectionMode() const
SubmitFileModel * | fileModel() const
bool | isEmptyFileListEnabled() const
bool | lineWrap() const
int | lineWrapWidth() const
PromptSubmitResult | promptSubmit(const QString &title, const QString &question, const QString &checkFailureQuestion, bool *promptSetting, bool forcePrompt = false, bool canCommitOnFailure = true)
void | registerActions(QAction *editorUndoAction, QAction *editorRedoAction, QAction *submitAction = 0, QAction *diffAction = 0)
QStringList | rowsToFiles(const QList<int> &rows) const
void | setCheckScriptWorkingDirectory(const QString &)
void | setEmptyFileListEnabled(bool e)
void | setFileListSelectionMode(QAbstractItemView::SelectionMode sm)
void | setFileModel(SubmitFileModel *m)
void | setLineWrap(bool)
void | setLineWrapWidth(int)
void | unregisterActions(QAction *editorUndoAction, QAction *editorRedoAction, QAction *submitAction = 0, QAction *diffAction = 0)
virtual void | updateFileModel()

## Reimplemented Public Functions

virtual Core::IDocument * | document() override
virtual QWidget * | toolBar() override

- 11 public functions inherited from Core::IEditor
- 6 public functions inherited from Core::IContext

## Signals

void | diffSelectedFiles(const QStringList &files)
void | diffSelectedRows(const QList<int> &rows)
void | fileContentsChanged()

## Static Public Members

QIcon | diffIcon()
void | filterUntrackedFilesOfProject(const QString &repositoryDirectory, QStringList *untrackedFiles)
QIcon | submitIcon()

## Protected Functions

| VcsBaseSubmitEditor(const VcsBaseSubmitEditorParameters *parameters, SubmitEditorWidget *editorWidget)
QString | description() const
virtual QByteArray | fileContents() const
bool | isDescriptionMandatory() const
void | setDescription(const QString &text)
void | setDescriptionMandatory(bool v)
virtual bool | setFileContents(const QByteArray &contents)

## Detailed Description

The VcsBaseSubmitEditor class is the base class for a submit editor based on the SubmitEditorWidget.

Presents the commit message in a text editor and an checkable list of modified files in a list window. The user can delete files from the list by pressing unchecking them or diff the selection by doubleclicking.

The action matching the ids (unless 0) of the parameter struct will be registered with the EditorWidget and submit/diff actions will be added to a toolbar.

For the given context, there must be only one instance of the editor active. To start a submit, set the submit template on the editor and the output of the VCS status command listing the modified files as fileList and open it.

The submit process is started by listening on the editor close signal and then asking the IDocument interface of the editor to save the file within a DocumentManager::blockFileChange() section and to launch the submit process. In addition, the action registered for submit should be connected to a slot triggering the close of the current editor in the editor manager.

## Member Type Documentation

### enum VcsBaseSubmitEditor::PromptSubmitResult

## Property Documentation

### checkScriptWorkingDirectory : QString

Access functions:

QString | checkScriptWorkingDirectory() const
void | setCheckScriptWorkingDirectory(const QString &)

### emptyFileListEnabled : bool

Access functions:

bool | isEmptyFileListEnabled() const
void | setEmptyFileListEnabled(bool e)

### fileListSelectionMode : QAbstractItemView::SelectionMode

Access functions:

QAbstractItemView::SelectionMode | fileListSelectionMode() const
void | setFileListSelectionMode(QAbstractItemView::SelectionMode sm)

### lineWrap : bool

Access functions:

bool | lineWrap() const
void | setLineWrap(bool)

### lineWrapWidth : int

Access functions:

int | lineWrapWidth() const
void | setLineWrapWidth(int)

## Member Function Documentation

### `[protected]` VcsBaseSubmitEditor::VcsBaseSubmitEditor(const VcsBaseSubmitEditorParameters *parameters, SubmitEditorWidget *editorWidget)

Default constructs an instance of VcsBaseSubmitEditor.

### VcsBaseSubmitEditor::~VcsBaseSubmitEditor()

Destroys the instance of VcsBaseSubmitEditor.

### QStringList VcsBaseSubmitEditor::checkedFiles() const

### `[protected]` QString VcsBaseSubmitEditor::description() const

See also setDescription().

### `[static]` QIcon VcsBaseSubmitEditor::diffIcon()

### `[signal]` void VcsBaseSubmitEditor::diffSelectedFiles(const QStringList &files)

### `[signal]` void VcsBaseSubmitEditor::diffSelectedRows(const QList<int> &rows)

### `[override virtual]` Core::IDocument *VcsBaseSubmitEditor::document()

### `[virtual protected]` QByteArray VcsBaseSubmitEditor::fileContents() const

See also setFileContents().

### `[signal]` void VcsBaseSubmitEditor::fileContentsChanged()

### SubmitFileModel *VcsBaseSubmitEditor::fileModel() const

See also setFileModel().

### `[static]` void VcsBaseSubmitEditor::filterUntrackedFilesOfProject(const QString &repositoryDirectory, QStringList *untrackedFiles)

### `[protected]` bool VcsBaseSubmitEditor::isDescriptionMandatory() const

### PromptSubmitResult VcsBaseSubmitEditor::promptSubmit(const QString &title, const QString &question, const QString &checkFailureQuestion, bool *promptSetting, bool forcePrompt = false, bool canCommitOnFailure = true)

### void VcsBaseSubmitEditor::registerActions(QAction *editorUndoAction, QAction *editorRedoAction, QAction *submitAction = 0, QAction *diffAction = 0)

### QStringList VcsBaseSubmitEditor::rowsToFiles(const QList<int> &rows) const

### `[protected]` void VcsBaseSubmitEditor::setDescription(const QString &text)

See also description().

### `[protected]` void VcsBaseSubmitEditor::setDescriptionMandatory(bool v)

See also isDescriptionMandatory().

### `[virtual protected]` bool VcsBaseSubmitEditor::setFileContents(const QByteArray &contents)

See also fileContents().

### void VcsBaseSubmitEditor::setFileModel(SubmitFileModel *m)

See also fileModel().

### `[static]` QIcon VcsBaseSubmitEditor::submitIcon()

### `[override virtual]` QWidget *VcsBaseSubmitEditor::toolBar()

### void VcsBaseSubmitEditor::unregisterActions(QAction *editorUndoAction, QAction *editorRedoAction, QAction *submitAction = 0, QAction *diffAction = 0)

### `[virtual]` void VcsBaseSubmitEditor::updateFileModel()