| 2349 | } |
| 2350 | |
| 2351 | void App::closeFolder() { |
| 2352 | if ( mCurrentProject.empty() ) |
| 2353 | return; |
| 2354 | |
| 2355 | saveSidePanelTabsOrder(); |
| 2356 | |
| 2357 | saveProject( true ); |
| 2358 | |
| 2359 | if ( mProjectBuildManager ) |
| 2360 | mProjectBuildManager.reset(); |
| 2361 | |
| 2362 | if ( mSplitter->isAnyEditorDirty() && !mConfig.workspace.sessionSnapshot ) { |
| 2363 | UIMessageBox* msgBox = UIMessageBox::New( |
| 2364 | UIMessageBox::OK_CANCEL, |
| 2365 | i18n( "confirm_close_folder", |
| 2366 | "Do you really want to close the folder?\nSome files haven't been saved." ) ); |
| 2367 | msgBox->on( Event::OnConfirm, [this]( const Event* ) { closeEditors(); } ); |
| 2368 | msgBox->setTitle( i18n( "close_folder_question", "Close Folder?" ) ); |
| 2369 | msgBox->center(); |
| 2370 | msgBox->showWhenReady(); |
| 2371 | } else { |
| 2372 | closeEditors(); |
| 2373 | } |
| 2374 | |
| 2375 | mProjectViewEmptyCont->setVisible( true ); |
| 2376 | mFileSystemModel->setRootPath( "" ); |
| 2377 | mPluginManager->setWorkspaceFolder( "" ); |
| 2378 | updateOpenRecentFolderBtn(); |
| 2379 | |
| 2380 | SyntaxDefinitionManager::instance()->resetFileAssociations(); |
| 2381 | |
| 2382 | if ( mUniversalLocator ) |
| 2383 | mUniversalLocator->updateFilesTable(); |
| 2384 | if ( getConfig().ui.welcomeScreen ) { |
| 2385 | createWelcomeTab(); |
| 2386 | mStatusBar->setVisible( false ); |
| 2387 | } |
| 2388 | } |
| 2389 | |
| 2390 | void App::createWelcomeTab() { |
| 2391 | UIWelcomeScreen::createWelcomeScreen( this ); |
nothing calls this directly
no test coverage detected