Focus project name field when entering new project form on welcome dialog (#1967)
This commit is contained in:
@@ -208,6 +208,7 @@ class GuiWelcome(NDialog):
|
|||||||
"""Show the create new project page."""
|
"""Show the create new project page."""
|
||||||
self.mainStack.setCurrentWidget(self.tabNew)
|
self.mainStack.setCurrentWidget(self.tabNew)
|
||||||
self._setButtonVisibility()
|
self._setButtonVisibility()
|
||||||
|
self.tabNew.enterForm()
|
||||||
return
|
return
|
||||||
|
|
||||||
@pyqtSlot()
|
@pyqtSlot()
|
||||||
@@ -503,6 +504,8 @@ class _NewProjectPage(QWidget):
|
|||||||
self.scrollArea.setHorizontalScrollBarPolicy(Qt.ScrollBarPolicy.ScrollBarAsNeeded)
|
self.scrollArea.setHorizontalScrollBarPolicy(Qt.ScrollBarPolicy.ScrollBarAsNeeded)
|
||||||
self.scrollArea.setVerticalScrollBarPolicy(Qt.ScrollBarPolicy.ScrollBarAsNeeded)
|
self.scrollArea.setVerticalScrollBarPolicy(Qt.ScrollBarPolicy.ScrollBarAsNeeded)
|
||||||
|
|
||||||
|
self.enterForm = self.projectForm.enterForm
|
||||||
|
|
||||||
# Assemble
|
# Assemble
|
||||||
# ========
|
# ========
|
||||||
|
|
||||||
@@ -696,6 +699,12 @@ class _NewProjectForm(QWidget):
|
|||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
|
def enterForm(self) -> None:
|
||||||
|
"""Focus the project name field when entering the form."""
|
||||||
|
self.projName.setFocus()
|
||||||
|
self.projName.selectAll()
|
||||||
|
return
|
||||||
|
|
||||||
def getProjectData(self) -> dict:
|
def getProjectData(self) -> dict:
|
||||||
"""Collect form data and return it as a dictionary."""
|
"""Collect form data and return it as a dictionary."""
|
||||||
roots = []
|
roots = []
|
||||||
|
|||||||
Reference in New Issue
Block a user