@ -118,17 +118,17 @@ const wxString GerberFileExtensionWildCard( ".((gbr|gbrjob|(gb|gt)[alops])|pho)"
BEGIN_EVENT_TABLE ( PROJECT_TREE_PANE , wxSashLayoutWindow )
EVT_TREE_ITEM_ACTIVATED ( ID_PROJECT_TREE , PROJECT_TREE_PANE : : O nSelect )
EVT_TREE_ITEM_EXPANDED ( ID_PROJECT_TREE , PROJECT_TREE_PANE : : O nExpand )
EVT_TREE_ITEM_RIGHT_CLICK ( ID_PROJECT_TREE , PROJECT_TREE_PANE : : O nRight )
EVT_MENU ( ID_PROJECT_TXTEDIT , PROJECT_TREE_PANE : : O nOpenSelectedFileWithTextEditor )
EVT_MENU ( ID_PROJECT_SWITCH_TO_OTHER , PROJECT_TREE_PANE : : O nSwitchToSelectedProject )
EVT_MENU ( ID_PROJECT_NEWDIR , PROJECT_TREE_PANE : : O nCreateNewDirectory )
EVT_MENU ( ID_PROJECT_OPEN_DIR , PROJECT_TREE_PANE : : O nOpenDirectory )
EVT_MENU ( ID_PROJECT_DELETE , PROJECT_TREE_PANE : : O nDeleteFile )
EVT_MENU ( ID_PROJECT_PRINT , PROJECT_TREE_PANE : : O nPrintFile )
EVT_MENU ( ID_PROJECT_RENAME , PROJECT_TREE_PANE : : O nRenameFile )
EVT_IDLE ( PROJECT_TREE_PANE : : O nIdle )
EVT_TREE_ITEM_ACTIVATED ( ID_PROJECT_TREE , PROJECT_TREE_PANE : : o nSelect )
EVT_TREE_ITEM_EXPANDED ( ID_PROJECT_TREE , PROJECT_TREE_PANE : : o nExpand )
EVT_TREE_ITEM_RIGHT_CLICK ( ID_PROJECT_TREE , PROJECT_TREE_PANE : : o nRight )
EVT_MENU ( ID_PROJECT_TXTEDIT , PROJECT_TREE_PANE : : o nOpenSelectedFileWithTextEditor )
EVT_MENU ( ID_PROJECT_SWITCH_TO_OTHER , PROJECT_TREE_PANE : : o nSwitchToSelectedProject )
EVT_MENU ( ID_PROJECT_NEWDIR , PROJECT_TREE_PANE : : o nCreateNewDirectory )
EVT_MENU ( ID_PROJECT_OPEN_DIR , PROJECT_TREE_PANE : : o nOpenDirectory )
EVT_MENU ( ID_PROJECT_DELETE , PROJECT_TREE_PANE : : o nDeleteFile )
EVT_MENU ( ID_PROJECT_PRINT , PROJECT_TREE_PANE : : o nPrintFile )
EVT_MENU ( ID_PROJECT_RENAME , PROJECT_TREE_PANE : : o nRenameFile )
EVT_IDLE ( PROJECT_TREE_PANE : : o nIdle )
END_EVENT_TABLE ( )
@ -143,7 +143,7 @@ PROJECT_TREE_PANE::PROJECT_TREE_PANE( KICAD_MANAGER_FRAME* parent ) :
m_watcher = NULL ;
Connect ( wxEVT_FSWATCHER ,
wxFileSystemWatcherEventHandler ( PROJECT_TREE_PANE : : O nFileSystemEvent ) ) ;
wxFileSystemWatcherEventHandler ( PROJECT_TREE_PANE : : o nFileSystemEvent ) ) ;
/*
* Filtering is now inverted : the filters are actually used to _enable_ support
@ -169,7 +169,7 @@ PROJECT_TREE_PANE::~PROJECT_TREE_PANE()
}
void PROJECT_TREE_PANE : : O nSwitchToSelectedProject( wxCommandEvent & event )
void PROJECT_TREE_PANE : : o nSwitchToSelectedProject( wxCommandEvent & event )
{
std : : vector < PROJECT_TREE_ITEM * > tree_data = GetSelectedData ( ) ;
@ -182,7 +182,7 @@ void PROJECT_TREE_PANE::OnSwitchToSelectedProject( wxCommandEvent& event )
}
void PROJECT_TREE_PANE : : O nOpenDirectory( wxCommandEvent & event )
void PROJECT_TREE_PANE : : o nOpenDirectory( wxCommandEvent & event )
{
// Get the root directory name:
std : : vector < PROJECT_TREE_ITEM * > tree_data = GetSelectedData ( ) ;
@ -222,7 +222,7 @@ void PROJECT_TREE_PANE::OnOpenDirectory( wxCommandEvent& event )
}
void PROJECT_TREE_PANE : : O nCreateNewDirectory( wxCommandEvent & event )
void PROJECT_TREE_PANE : : o nCreateNewDirectory( wxCommandEvent & event )
{
// Get the root directory name:
std : : vector < PROJECT_TREE_ITEM * > tree_data = GetSelectedData ( ) ;
@ -234,29 +234,18 @@ void PROJECT_TREE_PANE::OnCreateNewDirectory( wxCommandEvent& event )
// Ask for the new sub directory name
wxString curr_dir = item_data - > GetDir ( ) ;
if ( ! curr_dir . IsEmpty ( ) ) // A subdir is selected
{
// Make this subdir name relative to the current path.
// It will be more easy to read by the user, in the next dialog
wxFileName fn ;
fn . AssignDir ( curr_dir ) ;
fn . MakeRelativeTo ( prj_dir ) ;
curr_dir = fn . GetPath ( ) ;
if ( ! curr_dir . IsEmpty ( ) )
curr_dir + = wxFileName : : GetPathSeparator ( ) ;
}
if ( curr_dir . IsEmpty ( ) )
curr_dir = prj_dir ;
wxString msg = wxString : : Format ( _ ( " Current project directory: \n %s " ) , prj_dir ) ;
wxString subdir = wxGetTextFromUser ( msg , _ ( " Create New Directory " ) , curr_dir ) ;
wxString new_dir = wxGetTextFromUser ( _ ( " Directory name: " ) , _ ( " Create New Directory " ) ) ;
if ( sub dir. IsEmpty ( ) )
if ( new_dir . IsEmpty ( ) )
return ;
wxString full_dirname = prj _dir + wxFileName : : GetPathSeparator ( ) + sub dir;
wxString full_dirname = curr_dir + wxFileName : : GetPathSeparator ( ) + new_dir ;
// Make the new item and let the file watcher add it to the tree
wxMkdir ( full_dirname ) ;
wxMkdir ( full_dirname ) ;
addItemToProjectTree ( full_dirname , item_data - > GetId ( ) ) ;
}
}
@ -293,7 +282,8 @@ wxString PROJECT_TREE_PANE::GetFileExt( TREE_FILE_TYPE type )
}
wxTreeItemId PROJECT_TREE_PANE : : AddItemToProjectTree ( const wxString & aName , wxTreeItemId & aRoot ,
wxTreeItemId PROJECT_TREE_PANE : : addItemToProjectTree ( const wxString & aName ,
const wxTreeItemId & aRoot ,
bool aCanResetFileWatcher , bool aRecurse )
{
wxTreeItemId newItemId ;
@ -448,7 +438,7 @@ wxTreeItemId PROJECT_TREE_PANE::AddItemToProjectTree( const wxString& aName, wxT
do // Add name in tree, but do not recurse
{
wxString path = aName + wxFileName : : GetPathSeparator ( ) + dir_filename ;
A ddItemToProjectTree( path , newItemId , false , false ) ;
a ddItemToProjectTree( path , newItemId , false , false ) ;
} while ( dir . GetNext ( & dir_filename ) ) ;
}
}
@ -528,7 +518,7 @@ void PROJECT_TREE_PANE::ReCreateTreePrj()
if ( filename ! = fn . GetFullName ( ) )
{
wxString name = dir . GetName ( ) + wxFileName : : GetPathSeparator ( ) + filename ;
A ddItemToProjectTree( name , m_root , false ) ;
a ddItemToProjectTree( name , m_root , false ) ;
}
cont = dir . GetNext ( & filename ) ;
@ -547,7 +537,7 @@ void PROJECT_TREE_PANE::ReCreateTreePrj()
}
void PROJECT_TREE_PANE : : O nRight( wxTreeEvent & Event )
void PROJECT_TREE_PANE : : o nRight( wxTreeEvent & Event )
{
wxTreeItemId curr_item = Event . GetItem ( ) ;
@ -739,7 +729,7 @@ void PROJECT_TREE_PANE::OnRight( wxTreeEvent& Event )
}
void PROJECT_TREE_PANE : : O nOpenSelectedFileWithTextEditor( wxCommandEvent & event )
void PROJECT_TREE_PANE : : o nOpenSelectedFileWithTextEditor( wxCommandEvent & event )
{
wxString editorname = Pgm ( ) . GetEditorName ( ) ;
@ -765,7 +755,7 @@ void PROJECT_TREE_PANE::OnOpenSelectedFileWithTextEditor( wxCommandEvent& event
}
void PROJECT_TREE_PANE : : O nDeleteFile( wxCommandEvent & )
void PROJECT_TREE_PANE : : o nDeleteFile( wxCommandEvent & event )
{
std : : vector < PROJECT_TREE_ITEM * > tree_data = GetSelectedData ( ) ;
wxString msg , caption ;
@ -794,7 +784,7 @@ void PROJECT_TREE_PANE::OnDeleteFile( wxCommandEvent& )
}
void PROJECT_TREE_PANE : : O nPrintFile( wxCommandEvent & )
void PROJECT_TREE_PANE : : o nPrintFile( wxCommandEvent & event )
{
std : : vector < PROJECT_TREE_ITEM * > tree_data = GetSelectedData ( ) ;
@ -803,7 +793,7 @@ void PROJECT_TREE_PANE::OnPrintFile( wxCommandEvent& )
}
void PROJECT_TREE_PANE : : O nRenameFile( wxCommandEvent & )
void PROJECT_TREE_PANE : : o nRenameFile( wxCommandEvent & event )
{
wxTreeItemId curr_item = m_TreeProject - > GetFocusedItem ( ) ;
std : : vector < PROJECT_TREE_ITEM * > tree_data = GetSelectedData ( ) ;
@ -832,7 +822,7 @@ void PROJECT_TREE_PANE::OnRenameFile( wxCommandEvent& )
}
void PROJECT_TREE_PANE : : O nSelect( wxTreeEvent & Event )
void PROJECT_TREE_PANE : : o nSelect( wxTreeEvent & Event )
{
std : : vector < PROJECT_TREE_ITEM * > tree_data = GetSelectedData ( ) ;
@ -846,7 +836,7 @@ void PROJECT_TREE_PANE::OnSelect( wxTreeEvent& Event )
}
void PROJECT_TREE_PANE : : O nIdle( wxIdleEvent & aEvent )
void PROJECT_TREE_PANE : : o nIdle( wxIdleEvent & aEvent )
{
// Idle executes once all other events finished processing
// This makes it ideal to launch a new window without starting Focus wars.
@ -862,7 +852,7 @@ void PROJECT_TREE_PANE::OnIdle( wxIdleEvent& aEvent )
}
void PROJECT_TREE_PANE : : O nExpand( wxTreeEvent & Event )
void PROJECT_TREE_PANE : : o nExpand( wxTreeEvent & Event )
{
wxTreeItemId itemId = Event . GetItem ( ) ;
PROJECT_TREE_ITEM * tree_data = GetItemIdData ( itemId ) ;
@ -903,7 +893,7 @@ void PROJECT_TREE_PANE::OnExpand( wxTreeEvent& Event )
do // Add name to tree item, but do not recurse in subdirs:
{
wxString name = fileName + wxFileName : : GetPathSeparator ( ) + dir_filename ;
A ddItemToProjectTree( name , kid , false ) ;
a ddItemToProjectTree( name , kid , false ) ;
} while ( dir . GetNext ( & dir_filename ) ) ;
}
@ -1002,7 +992,7 @@ wxTreeItemId PROJECT_TREE_PANE::findSubdirTreeItem( const wxString& aSubDir )
}
void PROJECT_TREE_PANE : : O nFileSystemEvent( wxFileSystemWatcherEvent & event )
void PROJECT_TREE_PANE : : o nFileSystemEvent( wxFileSystemWatcherEvent & event )
{
const wxFileName & pathModified = event . GetPath ( ) ;
wxString subdir = pathModified . GetPath ( ) ;
@ -1033,7 +1023,7 @@ void PROJECT_TREE_PANE::OnFileSystemEvent( wxFileSystemWatcherEvent& event )
{
case wxFSW_EVENT_CREATE :
{
wxTreeItemId newitem = A ddItemToProjectTree( pathModified . GetFullPath ( ) , root_id ) ;
wxTreeItemId newitem = a ddItemToProjectTree( pathModified . GetFullPath ( ) , root_id ) ;
// If we are in the process of renaming a file, select the new one
// This is needed for MSW and OSX, since we don't get RENAME events from them, just a
@ -1091,7 +1081,7 @@ void PROJECT_TREE_PANE::OnFileSystemEvent( wxFileSystemWatcherEvent& event )
if ( newpath . Exists ( ) & & ( newfn ! = rootData - > GetFileName ( ) ) )
{
wxTreeItemId newroot_id = findSubdirTreeItem ( newdir ) ;
wxTreeItemId newitem = A ddItemToProjectTree( newfn , newroot_id ) ;
wxTreeItemId newitem = a ddItemToProjectTree( newfn , newroot_id ) ;
// If the item exists, select it
if ( newitem . IsOk ( ) )