| 3660 | } |
| 3661 | |
| 3662 | void 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 | |
| 3690 | void App::createAndShowRecentFolderPopUpMenu( Node* recentFolderBut ) { |
| 3691 | UIPopUpMenu* menu = UIPopUpMenu::New(); |
no test coverage detected