[Sofaswitch-svn] [commit] r262 - sofaswitch/trunk/callflow/src
Author: derek Date: Tue May 22 00:30:07 2007 New Revision: 262 Modified: sofaswitch/trunk/callflow/src/callflow.cpp Log: Make sure that it selects the correct extension when loading & saving image files, and when compiling to python. Modified: sofaswitch/trunk/callflow/src/callflow.cpp ============================================================================== --- sofaswitch/trunk/callflow/src/callflow.cpp (original) +++ sofaswitch/trunk/callflow/src/callflow.cpp Tue May 22 00:30:07 2007 @@ -229,7 +229,7 @@ void MyFrame::OnFileOpen (wxCommandEvent & WXUNUSED(event)) { - wxFileDialog filedlg(this, _T("Select a file to read data from")); + wxFileDialog filedlg(this, _T("Select a file to read data from"), _T(""), _T(""), _T("*.src")); if ( filedlg.ShowModal() != wxID_OK ) return; @@ -284,7 +284,7 @@ void MyFrame::OnFileSave__As (wxCommandEvent & WXUNUSED(event)) { - wxFileDialog filedlg(this, _T("Select a file to save this data to")); + wxFileDialog filedlg(this, _T("Select a file to contain this image"), _T(""), _T(""), _T("*.src")); if (filedlg.ShowModal() != wxID_OK) return; @@ -604,24 +604,24 @@ void MyFrame::OnCompile (wxCommandEvent & WXUNUSED(event)) { - wxFileDialog filedlg(this, _T("Select a file to place code in")); - if (filedlg.ShowModal() != wxID_OK) - return; - - wxTextFile file(filedlg.GetPath()); - - if (!file.Exists()) - file.Create(); - file.Open(); - if (!file.IsOpened()) { - wxMessageBox(wxString::Format("Unable to open the file %s to write data to", filedlg.GetFilename().c_str())); - return; - } - - if (canvas->Compile(file)) - SetStatusText(wxString::Format("wrote compiled code to %s", filedlg.GetFilename().c_str())); - else - wxMessageBox(wxString::Format("failed - could not compile code to %s", filedlg.GetFilename().c_str())); - - file.Close(); + wxFileDialog filedlg(this, _T("Select a file to contain the python code"), _T(""), _T(""), _T("*.py")); + if (filedlg.ShowModal() != wxID_OK) + return; + + wxTextFile file(filedlg.GetPath()); + + if (!file.Exists()) + file.Create(); + file.Open(); + if (!file.IsOpened()) { + wxMessageBox(wxString::Format("Unable to open the file %s to write data to", filedlg.GetFilename().c_str())); + return; + } + + if (canvas->Compile(file)) + SetStatusText(wxString::Format("wrote compiled code to %s", filedlg.GetFilename().c_str())); + else + wxMessageBox(wxString::Format("failed - could not compile code to %s", filedlg.GetFilename().c_str())); + + file.Close(); }
participants (1)
-
SofaSWITCH SVN