From: Václav Slavík Date: Sun, 28 Nov 2004 09:41:36 +0000 (+0000) Subject: reverted, the problem is deeper than that X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/c01920998145b5248372a124fdcd53f0ba1582d5?ds=inline reverted, the problem is deeper than that git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30805 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/gtk/filedlg.cpp b/src/gtk/filedlg.cpp index 929c0ccd68..f7eb5eeffb 100644 --- a/src/gtk/filedlg.cpp +++ b/src/gtk/filedlg.cpp @@ -237,9 +237,23 @@ void wxFileDialog::SetPath(const wxString& path) wxFileName fn(path); m_path = fn.GetFullPath(); + m_dir = fn.GetPath(); + m_fileName = fn.GetFullName(); - SetDirectory(fn.GetPath()); - SetFilename(fn.GetFullName()); + gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(m_widget), + wxGTK_CONV(m_dir)); + + gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(m_widget), + wxGTK_CONV(m_path)); + + // pre-fill the filename when saving, too (there's no text entry + // control when opening a file, so it doesn't make sense to + // do this in when opening files): + if (GetWindowStyle() & wxSAVE) + { + gtk_file_chooser_set_current_name(GTK_FILE_CHOOSER(m_widget), + wxGTK_CONV(m_fileName)); + } } void wxFileDialog::SetDirectory(const wxString& dir) diff --git a/src/gtk1/filedlg.cpp b/src/gtk1/filedlg.cpp index 929c0ccd68..f7eb5eeffb 100644 --- a/src/gtk1/filedlg.cpp +++ b/src/gtk1/filedlg.cpp @@ -237,9 +237,23 @@ void wxFileDialog::SetPath(const wxString& path) wxFileName fn(path); m_path = fn.GetFullPath(); + m_dir = fn.GetPath(); + m_fileName = fn.GetFullName(); - SetDirectory(fn.GetPath()); - SetFilename(fn.GetFullName()); + gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(m_widget), + wxGTK_CONV(m_dir)); + + gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(m_widget), + wxGTK_CONV(m_path)); + + // pre-fill the filename when saving, too (there's no text entry + // control when opening a file, so it doesn't make sense to + // do this in when opening files): + if (GetWindowStyle() & wxSAVE) + { + gtk_file_chooser_set_current_name(GTK_FILE_CHOOSER(m_widget), + wxGTK_CONV(m_fileName)); + } } void wxFileDialog::SetDirectory(const wxString& dir)