'Pop-up and give focus to the label editor.
position MUST be in global coordinates.'

def newShape(self):

    if ((not self.useDefaultLabelCheckbox.isChecked()) or (not self.defaultLabelTextLine.text())):
        if (len(self.labelHist) > 0):
            self.labelDialog = LabelDialog(parent=self, listItem=self.labelHist)
        if (self.singleClassMode.isChecked() and self.lastLabel):
            text = self.lastLabel
        else:
            text = self.labelDialog.popUp(text=self.prevLabelText)
            self.lastLabel = text
    else:
        text = self.defaultLabelTextLine.text()
    self.diffcButton.setChecked(False)
    if (text is not None):
        self.prevLabelText = text
        self.addLabel(self.canvas.setLastLabel(text))
        if self.beginner():
            self.canvas.setEditing(True)
            self.actions.create.setEnabled(True)
        else:
            self.actions.editMode.setEnabled(True)
        self.setDirty()
        if (text not in self.labelHist):
            self.labelHist.append(text)
    else:
        self.canvas.resetAllLines()
