default browse dialog to project directory
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -126,16 +126,9 @@ class _SetupDialog(wx.Dialog):
|
|||||||
self.ioc_path = self._history[idx]
|
self.ioc_path = self._history[idx]
|
||||||
|
|
||||||
def _on_browse(self, _evt):
|
def _on_browse(self, _evt):
|
||||||
start = self._project_dir
|
|
||||||
for _ in range(4):
|
|
||||||
up = os.path.dirname(start)
|
|
||||||
if up == start:
|
|
||||||
break
|
|
||||||
start = up
|
|
||||||
|
|
||||||
dlg = wx.FileDialog(
|
dlg = wx.FileDialog(
|
||||||
self, "Select STM32CubeMX .ioc file",
|
self, "Select STM32CubeMX .ioc file",
|
||||||
defaultDir=start,
|
defaultDir=self._project_dir,
|
||||||
wildcard="IOC files (*.ioc)|*.ioc|All files (*.*)|*.*",
|
wildcard="IOC files (*.ioc)|*.ioc|All files (*.*)|*.*",
|
||||||
style=wx.FD_OPEN | wx.FD_FILE_MUST_EXIST,
|
style=wx.FD_OPEN | wx.FD_FILE_MUST_EXIST,
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user