- 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.
This commit is contained in:
Roy Qu 2022-06-08 16:18:06 +08:00
parent 5182e200fb
commit 67e686652d
3 changed files with 9 additions and 0 deletions

View File

@ -1,5 +1,7 @@
Red Panda C++ Version 1.1.0 Red Panda C++ Version 1.1.0
- enhancement: when ctrl+mouse cursor hovered an identifier or header name, use underline to highlight it - 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 Red Panda C++ Version 1.0.10
- fix: modify watch doesn't work - fix: modify watch doesn't work

View File

@ -4151,8 +4151,12 @@ void MainWindow::updateProjectView()
void MainWindow::onFileChanged(const QString &path) void MainWindow::onFileChanged(const QString &path)
{ {
if (mFilesChangedNotifying.contains(path))
return;
mFilesChangedNotifying.insert(path);
Editor *e = mEditorList->getOpenedEditorByFilename(path); Editor *e = mEditorList->getOpenedEditorByFilename(path);
if (e) { if (e) {
e->setModified(true);
if (fileExists(path)) { if (fileExists(path)) {
e->activate(); e->activate();
if (QMessageBox::question(this,tr("File Changed"), if (QMessageBox::question(this,tr("File Changed"),
@ -4178,6 +4182,7 @@ void MainWindow::onFileChanged(const QString &path)
} }
} }
} }
mFilesChangedNotifying.remove(path);
} }
void MainWindow::onFilesViewPathChanged() void MainWindow::onFilesViewPathChanged()

View File

@ -740,6 +740,8 @@ private:
QTcpServer mTcpServer; QTcpServer mTcpServer;
QColor mErrorColor; QColor mErrorColor;
QSet<QString> mFilesChangedNotifying;
//actions for compile issue table //actions for compile issue table
QAction * mTableIssuesCopyAction; QAction * mTableIssuesCopyAction;
QAction * mTableIssuesCopyAllAction; QAction * mTableIssuesCopyAllAction;