Corrected template names shown in the dialog when creating a new file
This commit is contained in:
parent
9b385e7caa
commit
e39638ea3b
|
@ -2856,12 +2856,12 @@ void MyFrame::OnNew ( wxCommandEvent& WXUNUSED ( event ) )
|
||||||
if ( wxFileName::DirExists ( templateDir ) )
|
if ( wxFileName::DirExists ( templateDir ) )
|
||||||
{
|
{
|
||||||
wxString templateMask, name, extension, entry;
|
wxString templateMask, name, extension, entry;
|
||||||
|
wxFileName fn;
|
||||||
templateMask = templateDir + wxFileName::GetPathSeparator() + _T ( "*.*" );
|
templateMask = templateDir + wxFileName::GetPathSeparator() + _T ( "*.*" );
|
||||||
templateFile = wxFindFirstFile ( templateMask, wxFILE );
|
templateFile = wxFindFirstFile ( templateMask, wxFILE );
|
||||||
wxFileName fn;
|
while ( !templateFile.empty() )
|
||||||
|
|
||||||
if ( !templateFile.empty() )
|
|
||||||
{
|
{
|
||||||
|
templateFile.Replace ( _T("_"), _T(" ") );
|
||||||
fn.Assign ( templateFile );
|
fn.Assign ( templateFile );
|
||||||
name = fn.GetName();
|
name = fn.GetName();
|
||||||
extension = fn.GetExt();
|
extension = fn.GetExt();
|
||||||
|
@ -2869,19 +2869,7 @@ void MyFrame::OnNew ( wxCommandEvent& WXUNUSED ( event ) )
|
||||||
entry.Printf ( _T ( "%s (*.%s)" ), name.c_str(), extension.c_str() );
|
entry.Printf ( _T ( "%s (*.%s)" ), name.c_str(), extension.c_str() );
|
||||||
templateArray.Add ( entry );
|
templateArray.Add ( entry );
|
||||||
|
|
||||||
for ( ;; )
|
templateFile = wxFindNextFile();
|
||||||
{
|
|
||||||
templateFile = wxFindNextFile();
|
|
||||||
if ( templateFile.empty() )
|
|
||||||
break;
|
|
||||||
templateFile.Replace ( _T("_"), _T(" ") );
|
|
||||||
fn.Assign ( templateFile );
|
|
||||||
name = fn.GetName();
|
|
||||||
extension = fn.GetExt();
|
|
||||||
|
|
||||||
entry.Printf ( _T ( "%s (*.%s)" ), name.c_str(), extension.c_str() );
|
|
||||||
templateArray.Add ( entry );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
templateArray.Sort();
|
templateArray.Sort();
|
||||||
templateArray.Insert ( defaultSelection, 0 );
|
templateArray.Insert ( defaultSelection, 0 );
|
||||||
|
|
Loading…
Reference in New Issue