Block welcome dialog open button when project list is not visible

This commit is contained in:
Veronica Berglyd Olsen
2024-02-20 12:48:14 +01:00
parent 8b701f8651
commit eab8bb2351
2 changed files with 18 additions and 3 deletions
+8 -1
View File
@@ -108,7 +108,7 @@ class GuiWelcome(QDialog):
# =======
self.btnBox = QDialogButtonBox(QDialogButtonBox.Open | QDialogButtonBox.Cancel, self)
self.btnBox.accepted.connect(self.tabOpen.openSelectedItem)
self.btnBox.accepted.connect(self._openSelectedItem)
self.btnBox.rejected.connect(self.close)
self.newButton = self.btnBox.addButton(self.tr("New Project"), QDialogButtonBox.ActionRole)
@@ -195,6 +195,13 @@ class GuiWelcome(QDialog):
self._openProjectPath(path)
return
@pyqtSlot()
def _openSelectedItem(self) -> None:
"""Open the currently selected project item."""
if self.mainStack.currentWidget() == self.tabOpen:
self.tabOpen.openSelectedItem()
return
@pyqtSlot(Path)
def _openProjectPath(self, path: Path) -> None:
"""Emit a project open signal."""