Fix bug (typo?) in gestfich.cpp.
Minor enhancement in treeproject_item.cpp
This commit is contained in:
parent
0eee21e450
commit
767d7f2009
|
@ -428,7 +428,7 @@ bool DeleteDirectory( const wxString& aDirName, bool aRecurse, bool aIncludeHidd
|
|||
mainDir.Close();
|
||||
return false;
|
||||
}
|
||||
valid = mainDir.GetNext( &dir );
|
||||
valid = mainDir.GetNext( &file );
|
||||
}
|
||||
|
||||
mainDir.Close();
|
||||
|
|
|
@ -126,14 +126,17 @@ bool TREEPROJECT_ITEM::Rename( const wxString& name, bool check )
|
|||
|
||||
void TREEPROJECT_ITEM::Delete()
|
||||
{
|
||||
bool isDirectory = wxDirExists( GetFileName() );
|
||||
|
||||
wxString msg = wxString::Format( _( "Are you sure you want to delete '%s'?" ), GetFileName() );
|
||||
wxMessageDialog dialog( m_parent, msg, _( "Delete File" ), wxYES_NO | wxICON_QUESTION );
|
||||
wxMessageDialog dialog( m_parent, msg, isDirectory ? _( "Delete Directory" ) : _( "Delete File" ),
|
||||
wxYES_NO | wxICON_QUESTION );
|
||||
|
||||
if( dialog.ShowModal() == wxID_YES )
|
||||
{
|
||||
bool success;
|
||||
|
||||
if( !wxDirExists( GetFileName() ) )
|
||||
if( !isDirectory )
|
||||
success = wxRemoveFile( GetFileName() );
|
||||
else
|
||||
success = DeleteDirectory( GetFileName() );
|
||||
|
|
Loading…
Reference in New Issue