Applied patch [ 892608 ] wxLogDialog + wxLogFrame: minor improvement for file saving

Christian Sturmlechner


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@25619 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2004-02-08 12:43:41 +00:00
parent dba6b4f880
commit 73ff84ff71

View File

@@ -171,7 +171,7 @@ END_EVENT_TABLE()
// filename and try to open it, returns TRUE on success (file was opened), // filename and try to open it, returns TRUE on success (file was opened),
// FALSE if file couldn't be opened/created and -1 if the file selection // FALSE if file couldn't be opened/created and -1 if the file selection
// dialog was cancelled // dialog was cancelled
static int OpenLogFile(wxFile& file, wxString *filename = NULL); static int OpenLogFile(wxFile& file, wxString *filename = NULL, wxWindow *parent = NULL);
#endif // wxUSE_FILE #endif // wxUSE_FILE
@@ -542,7 +542,7 @@ void wxLogFrame::OnSave(wxCommandEvent& WXUNUSED(event))
#if wxUSE_FILEDLG #if wxUSE_FILEDLG
wxString filename; wxString filename;
wxFile file; wxFile file;
int rc = OpenLogFile(file, &filename); int rc = OpenLogFile(file, &filename, this);
if ( rc == -1 ) if ( rc == -1 )
{ {
// cancelled // cancelled
@@ -963,7 +963,7 @@ void wxLogDialog::OnSave(wxCommandEvent& WXUNUSED(event))
{ {
#if wxUSE_FILEDLG #if wxUSE_FILEDLG
wxFile file; wxFile file;
int rc = OpenLogFile(file); int rc = OpenLogFile(file, NULL, this);
if ( rc == -1 ) if ( rc == -1 )
{ {
// cancelled // cancelled
@@ -1103,11 +1103,11 @@ wxLogDialog::~wxLogDialog()
// filename and try to open it, returns TRUE on success (file was opened), // filename and try to open it, returns TRUE on success (file was opened),
// FALSE if file couldn't be opened/created and -1 if the file selection // FALSE if file couldn't be opened/created and -1 if the file selection
// dialog was cancelled // dialog was cancelled
static int OpenLogFile(wxFile& file, wxString *pFilename) static int OpenLogFile(wxFile& file, wxString *pFilename, wxWindow *parent)
{ {
// get the file name // get the file name
// ----------------- // -----------------
wxString filename = wxSaveFileSelector(wxT("log"), wxT("txt"), wxT("log.txt")); wxString filename = wxSaveFileSelector(wxT("log"), wxT("txt"), wxT("log.txt"), parent);
if ( !filename ) { if ( !filename ) {
// cancelled // cancelled
return -1; return -1;