Opened 2 years ago

Closed 2 years ago

Last modified 18 months ago

#14786 closed defect (fixed)

wxFileDialog::GetDirectory doesn't return the user-selected path

Reported by: obfuscated Owned by:
Priority: normal Milestone: 2.8.13
Component: wxGTK Version: oldstable-latest
Keywords: Cc:
Blocked By: Blocking:
Patch: no

Description

This bug is similar to ticket #14525 and the problem seems the same.

The problem happens in both 2.9 and 2.8 svn heads.

Attachments (2)

wx.file.open.patch download (6.5 KB) - added by obfuscated 2 years ago.
wx28.filedlg.patch download (1.1 KB) - added by obfuscated 2 years ago.
patch for wx2.8

Download all attachments as: .zip

Change History (13)

comment:1 Changed 2 years ago by obfuscated

  • Summary changed from wxFileDialog::GetFolder doesn't return the user-selected path to wxFileDialog::GetDirectory doesn't return the user-selected path

comment:2 Changed 2 years ago by vadz

It should be then fixed in the similar way, i.e. by remembering the directory in the dialog itself before it's dismissed. If you can do it and submit a patch with your changes, it would be great.

Changed 2 years ago by obfuscated

comment:3 Changed 2 years ago by obfuscated

Something like this (see the attached patch)?

comment:4 Changed 2 years ago by vadz

Looks fine for me, if it works for you then it must be correct, thanks!

comment:5 Changed 2 years ago by VZ

  • Resolution set to fixed
  • Status changed from new to closed

(In [72979]) Fix path returned from wxGTK wxFileDialog too.

This is similar to the fixes to wxDirDialog in r72779.

Closes #14786.

Changed 2 years ago by obfuscated

patch for wx2.8

comment:6 Changed 2 years ago by obfuscated

  • Resolution fixed deleted
  • Status changed from closed to reopened
  • Version changed from 2.9-svn to 2.8-svn

Just added a patch for wx2.8. Seems a little simpler, maybe the m_dir should be reused in 2.9, too.

comment:7 Changed 2 years ago by vadz

  • Milestone set to 2.8.13

Should be OK to apply for 2.8.13 if anybody decides to make it.

I think the code in the trunk is clear enough so I don't see any particular need to change it...

comment:8 Changed 2 years ago by obfuscated

I suppose these two bugs will require new release of 2.8, because they are extremely annoying, when using recent distros and also not all packages have migrated to 2.9

comment:9 Changed 2 years ago by PC

  • Resolution set to fixed
  • Status changed from reopened to closed

(In [73089]) Fix path returned from wxFileDialog, closes #14786

comment:10 Changed 18 months ago by vadz

I'm going to replace the patch applied in r72979 with the simpler patch for 2.8 applied in r73089 because it turns out that we must generate the fake wxEVT_BUTTON_CLICKED event in wxFileDialog code as the native GTK+ wxFilePickerCtrl relies on it and the change in the trunk broke it, see #15218.

Please retest your code with the new fix and reopen the bug if it doesn't work. TIA!

comment:11 Changed 18 months ago by VZ

(In [74043]) Fix regression in wxGTK wxFilePickerCtrl due to wxFileDialog changes.

Revert the changes of r72979 and fix wxFileDialog::GetDirectory() return
value bug (see #14786) differently to avoid breaking wxFilePickerCtrl which
relies on getting wxEVT_BUTTON event when the associated dialog is dismissed.

Closes #15218.

Note: See TracTickets for help on using tickets.