Exemplo n.º 1
0
 def is_valid_branch_name(self, name):
     """
         This allows us to check if the name is valid before setting it.
     """
     try:
         validate_branch_name(name)
     except Exception, err:
         return False, err
Exemplo n.º 2
0
 def is_valid_branch_name(self, name):
     """
         This allows us to check if the name is valid before setting it.
     """
     try:
         validate_branch_name(name)
     except Exception, err:
         return False, err
Exemplo n.º 3
0
    def set_new_branch_name(self, name, ignore_history=False):
        """
            Set the new name of the branch.
        """
        name = name.strip()

        if not ignore_history:
            action = SetBranchNameAction(self._new_branch_name, name)
            self._history[self._last_history_event].append(action)

        if name == self._old_branch_name:
            self._new_branch_name = ""
        elif ignore_history and name == "":
            self._new_branch_name = ""
        else:
            validate_branch_name(name)
            self._new_branch_name = name

        return self._new_branch_name
Exemplo n.º 4
0
    def set_new_branch_name(self, name, ignore_history=False):
        """
            Set the new name of the branch.
        """
        name = name.strip()

        if not ignore_history:
            action = SetBranchNameAction(self._new_branch_name, name)
            self._history[self._last_history_event].append(action)

        if name == self._old_branch_name:
            self._new_branch_name = ""
        elif ignore_history and name == "":
            self._new_branch_name = ""
        else:
            validate_branch_name(name)
            self._new_branch_name = name

        return self._new_branch_name
Exemplo n.º 5
0
 def accept(self):
     try:
         validate_branch_name(self._ui.nameLineEdit.text())
         QDialog.accept(self)
     except ValueError:
         pass
Exemplo n.º 6
0
 def check_name(self, potential_name):
     try:
         validate_branch_name(potential_name)
         self._ui.nameLineEdit.setStyleSheet(WHITE)
     except ValueError:
         self._ui.nameLineEdit.setStyleSheet(RED)