Block welcome dialog open button when project list is not visible
This commit is contained in:
@@ -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."""
|
||||
|
||||
Reference in New Issue
Block a user