diff --git a/NEWS.md b/NEWS.md index be87ea26..422bae9c 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,7 @@ Red Panda C++ Version 1.1.0 - enhancement: when ctrl+mouse cursor hovered an identifier or header name, use underline to highlight it + - enhancement: mark editor as modified, if the editing file is changed by other applications. + - enhancement: When the editing files is changed by other applications, only show one notification dialog for each file. Red Panda C++ Version 1.0.10 - fix: modify watch doesn't work diff --git a/RedPandaIDE/mainwindow.cpp b/RedPandaIDE/mainwindow.cpp index fac394d2..e3faf21b 100644 --- a/RedPandaIDE/mainwindow.cpp +++ b/RedPandaIDE/mainwindow.cpp @@ -4151,8 +4151,12 @@ void MainWindow::updateProjectView() void MainWindow::onFileChanged(const QString &path) { + if (mFilesChangedNotifying.contains(path)) + return; + mFilesChangedNotifying.insert(path); Editor *e = mEditorList->getOpenedEditorByFilename(path); if (e) { + e->setModified(true); if (fileExists(path)) { e->activate(); if (QMessageBox::question(this,tr("File Changed"), @@ -4178,6 +4182,7 @@ void MainWindow::onFileChanged(const QString &path) } } } + mFilesChangedNotifying.remove(path); } void MainWindow::onFilesViewPathChanged() diff --git a/RedPandaIDE/mainwindow.h b/RedPandaIDE/mainwindow.h index 7815c84f..95bdd01b 100644 --- a/RedPandaIDE/mainwindow.h +++ b/RedPandaIDE/mainwindow.h @@ -740,6 +740,8 @@ private: QTcpServer mTcpServer; QColor mErrorColor; + QSet mFilesChangedNotifying; + //actions for compile issue table QAction * mTableIssuesCopyAction; QAction * mTableIssuesCopyAllAction;