work save

This commit is contained in:
royqh1979 2021-09-04 21:54:58 +08:00
parent 721f01f6cb
commit 959ac42226
1 changed files with 7 additions and 1 deletions

View File

@ -262,7 +262,13 @@ void MainWindow::updateEditorActions()
void MainWindow::updateCompileActions()
{
if (mCompilerManager->compiling() || mCompilerManager->running() || mDebugger->executing()) {
Editor * e = mEditorList->getEditor();
if (!e)
return;
FileType fileType = getFileType(e->filename());
if (mCompilerManager->compiling() || mCompilerManager->running() || mDebugger->executing()
|| (fileType!= FileType::CSource
&& fileType != FileType::CppSource) ) {
ui->actionCompile->setEnabled(false);
ui->actionCompile_Run->setEnabled(false);
ui->actionRun->setEnabled(false);