MCPcopy Create free account
hub / github.com/SpartanJ/eepp / newFolder

Method newFolder

src/tools/ecode/ecode.cpp:3662–3688  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3660}
3661
3662void App::newFolder( const FileInfo& file ) {
3663 UIMessageBox* msgBox =
3664 newInputMsgBox( i18n( "create_new_folder", "Create new folder" ),
3665 i18n( "enter_new_folder_name", "Enter new folder name:" ) );
3666 msgBox->on( Event::OnConfirm, [this, file, msgBox]( const Event* ) {
3667 auto newFolderPath( getNewFilePath( file, msgBox ) );
3668 if ( !FileSystem::fileExists( newFolderPath ) ) {
3669 if ( !FileSystem::makeDir( newFolderPath ) ) {
3670 errorMsgBox( i18n( "couldnt_create_directory", "Couldn't create directory." ) );
3671 } else if ( mProjectTreeView ) {
3672 // We wait 100 ms to get the notification from the file system
3673 mUISceneNode->runOnMainThread(
3674 [this, newFolderPath] {
3675 if ( !mFileSystemModel || !mProjectTreeView )
3676 return;
3677 std::string nfp( newFolderPath );
3678 FileSystem::filePathRemoveBasePath( mFileSystemModel->getRootPath(), nfp );
3679 mProjectTreeView->openRowWithPath( nfp );
3680 },
3681 Milliseconds( 100 ) );
3682 }
3683 msgBox->closeWindow();
3684 } else {
3685 fileAlreadyExistsMsgBox();
3686 }
3687 } );
3688}
3689
3690void App::createAndShowRecentFolderPopUpMenu( Node* recentFolderBut ) {
3691 UIPopUpMenu* menu = UIPopUpMenu::New();

Callers 1

createProjectTreeMenuMethod · 0.80

Calls 5

MillisecondsFunction · 0.85
runOnMainThreadMethod · 0.80
openRowWithPathMethod · 0.80
closeWindowMethod · 0.80
onMethod · 0.45

Tested by

no test coverage detected