From 959ac422266d32c2cf293d0810c8d889c1313bf8 Mon Sep 17 00:00:00 2001 From: royqh1979 Date: Sat, 4 Sep 2021 21:54:58 +0800 Subject: [PATCH] work save --- RedPandaIDE/mainwindow.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/RedPandaIDE/mainwindow.cpp b/RedPandaIDE/mainwindow.cpp index 65f53582..7067d8dd 100644 --- a/RedPandaIDE/mainwindow.cpp +++ b/RedPandaIDE/mainwindow.cpp @@ -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);