# eric7.Plugins.VcsPlugins.vcsGit.GitWorktreeAddDialog

Module implementing a dialog to enter the data for a 'git worktree add' operation.

### Global Attributes

None

### Classes

GitWorktreeAddDialog | Class implementing a dialog to enter the data for a 'git worktree add' operation.

### Functions

None

## GitWorktreeAddDialog

Class implementing a dialog to enter the data for a 'git worktree add' operation.

### Derived from

QDialog, Ui_GitWorktreeAddDialog

### Class Attributes

None

### Class Methods

None

### Methods

GitWorktreeAddDialog | Constructor
__updateOK | Private method to set the enabled state of the OK button.
getParameters | Public method to get the entered parameters for the 'git worktree add' operation.
on_branchButton_toggled | Private slot to handle changes of the Branch select button.
on_branchCombo_editTextChanged | Private slot to handle changes of the Branch combo.
on_revButton_toggled | Private slot to handle changes of the rev select button.
on_revEdit_textChanged | Private slot to handle changes of the rev edit.
on_tagButton_toggled | Private slot to handle changes of the Tag select button.
on_tagCombo_editTextChanged | Private slot to handle changes of the Tag combo.
on_worktreePathPicker_textChanged | Private slot handling a change of the worktree path.

### Static Methods

None

#### GitWorktreeAddDialog (Constructor)

GitWorktreeAddDialog(parentDirectory, tagsList, branchesList, parent=None)

Constructor

parentDirectory (str)
  path of the worktrees parent directory
tagsList (list of str)
  list of tags
branchesList (list of str)
  list of branches
parent (QWidget (optional))
  reference to the parent widget (defaults to None)

#### GitWorktreeAddDialog.__updateOK

__updateOK()

Private method to set the enabled state of the OK button.

#### GitWorktreeAddDialog.getParameters

getParameters()

Public method to get the entered parameters for the 'git worktree add' operation.

Return:
  dictionary containing the entered data. This dictionary has these keys.
  - path: path for the new worktree
  - branch: name for the worktree branch
  - force_branch: enforce creating the branch
  - lock: flag indicating to lock the worktree
  - lock_reason: optional reason string for the lock
  - detach: flag indicating to detach the HEAD in the new worktree
  - commit: commit to check out in the new worktree (branch, tag, commit ID or empty for HEAD)
  - force: flag indicating to enforce the worktree creation

Return Type:
  dict

#### GitWorktreeAddDialog.on_branchButton_toggled

on_branchButton_toggled(_checked)

Private slot to handle changes of the Branch select button.

_checked (bool)
  state of the button (unused)

#### GitWorktreeAddDialog.on_branchCombo_editTextChanged

on_branchCombo_editTextChanged(_txt)

Private slot to handle changes of the Branch combo.

_txt (str)
  text of the combo (unused)

#### GitWorktreeAddDialog.on_revButton_toggled

on_revButton_toggled(_checked)

Private slot to handle changes of the rev select button.

_checked (bool)
  state of the button (unused)

#### GitWorktreeAddDialog.on_revEdit_textChanged

on_revEdit_textChanged(_txt)

Private slot to handle changes of the rev edit.

_txt (str)
  text of the edit (unused)

#### GitWorktreeAddDialog.on_tagButton_toggled

on_tagButton_toggled(_checked)

Private slot to handle changes of the Tag select button.

_checked (bool)
  state of the button (unused)

#### GitWorktreeAddDialog.on_tagCombo_editTextChanged

on_tagCombo_editTextChanged(_txt)

Private slot to handle changes of the Tag combo.

_txt (str)
  text of the combo (unused)

#### GitWorktreeAddDialog.on_worktreePathPicker_textChanged

on_worktreePathPicker_textChanged(_worktree)

Private slot handling a change of the worktree path.

_worktree (str)
  entered worktree path (unused)

Up