- fix: When restored from minimization, info on statusbar not correctly restored.

- enhancement: Changes of "auto backup editing contents" is applied immediately.
  - enhancement: Don't create temp backup for readonly files.
This commit is contained in:
Roy Qu 2023-01-16 11:35:55 +08:00
parent e1e60d2f64
commit 73d527318c
5 changed files with 24 additions and 3 deletions

View File

@ -1,3 +1,10 @@
Red Panda C++ Version 2.10
- fix: When restored from minimization, info on statusbar not correctly restored.
- enhancement: Changes of "auto backup editing contents" is applied immediately.
- enhancement: Don't create temp backup for readonly files.
Red Panda C++ Version 2.9 Red Panda C++ Version 2.9
- enhancement: set caret to the corresponding line in the editor after "run"/"generate assembly" - enhancement: set caret to the corresponding line in the editor after "run"/"generate assembly"

View File

@ -10,7 +10,7 @@ isEmpty(APP_NAME) {
} }
isEmpty(APP_VERSION) { isEmpty(APP_VERSION) {
APP_VERSION = 2.9 APP_VERSION = 2.10
} }
macos: { macos: {

View File

@ -1459,6 +1459,10 @@ void Editor::showEvent(QShowEvent */*event*/)
pMainWindow->debugger()->setIsForProject(inProject()); pMainWindow->debugger()->setIsForProject(inProject());
pMainWindow->bookmarkModel()->setIsForProject(inProject()); pMainWindow->bookmarkModel()->setIsForProject(inProject());
pMainWindow->todoModel()->setIsForProject(inProject()); pMainWindow->todoModel()->setIsForProject(inProject());
pMainWindow->updateForEncodingInfo(true);
pMainWindow->updateStatusbarForLineCol(true);
pMainWindow->updateForStatusbarModeInfo(true);
} }
if (!pMainWindow->isClosingAll() if (!pMainWindow->isClosingAll()
@ -1832,7 +1836,7 @@ void Editor::onStatusChanged(QSynedit::StatusChanges changes)
invalidate(); invalidate();
mOldHighlightedWord = mCurrentHighlightedWord; mOldHighlightedWord = mCurrentHighlightedWord;
} }
pMainWindow->updateStatusbarForLineCol(); pMainWindow->updateStatusbarForLineCol(this);
// Update the function tip // Update the function tip
if (pSettings->editor().showFunctionTips()) { if (pSettings->editor().showFunctionTips()) {
@ -1852,6 +1856,11 @@ void Editor::onStatusChanged(QSynedit::StatusChanges changes)
pMainWindow->caretList().addCaret(this,caretY(),caretX()); pMainWindow->caretList().addCaret(this,caretY(),caretX());
pMainWindow->updateCaretActions(); pMainWindow->updateCaretActions();
} }
if (changes.testFlag(QSynedit::StatusChange::scReadOnly)) {
if (!readOnly())
initAutoBackup();
}
} }
void Editor::onGutterClicked(Qt::MouseButton button, int , int , int line) void Editor::onGutterClicked(Qt::MouseButton button, int , int , int line)
@ -3326,6 +3335,8 @@ void Editor::initAutoBackup()
cleanAutoBackup(); cleanAutoBackup();
if (!pSettings->editor().enableEditTempBackup()) if (!pSettings->editor().enableEditTempBackup())
return; return;
if (readOnly())
return;
QFileInfo fileInfo(mFilename); QFileInfo fileInfo(mFilename);
if (fileInfo.isAbsolute()) { if (fileInfo.isAbsolute()) {
mBackupFile=new QFile(extractFileDir(mFilename) mBackupFile=new QFile(extractFileDir(mFilename)

View File

@ -75,6 +75,7 @@ void EditorAutoSaveWidget::doLoad()
void EditorAutoSaveWidget::doSave() void EditorAutoSaveWidget::doSave()
{ {
bool shouldApplyEditorSettings=(ui->chkAutoBackupEditContents->isChecked()!=pSettings->editor().enableEditTempBackup());
pSettings->editor().setEnableEditTempBackup(ui->chkAutoBackupEditContents->isChecked()); pSettings->editor().setEnableEditTempBackup(ui->chkAutoBackupEditContents->isChecked());
pSettings->editor().setEnableAutoSave(ui->grpEnableAutoSave->isChecked()); pSettings->editor().setEnableAutoSave(ui->grpEnableAutoSave->isChecked());
pSettings->editor().setAutoSaveInterval(ui->spinInterval->value()); pSettings->editor().setAutoSaveInterval(ui->spinInterval->value());
@ -91,6 +92,8 @@ void EditorAutoSaveWidget::doSave()
else else
pSettings->editor().setAutoSaveStrategy(assAppendFormatedTimeStamp); pSettings->editor().setAutoSaveStrategy(assAppendFormatedTimeStamp);
pSettings->editor().save(); pSettings->editor().save();
if (shouldApplyEditorSettings)
pMainWindow->updateEditorSettings();
pMainWindow->resetAutoSaveTimer(); pMainWindow->resetAutoSaveTimer();
} }

View File

@ -33,7 +33,7 @@ RedPandaIDE.depends += redpanda-git-askpass
APP_NAME = RedPandaCPP APP_NAME = RedPandaCPP
APP_VERSION = 2.9 APP_VERSION = 2.10
linux: { linux: {
isEmpty(PREFIX) { isEmpty(PREFIX) {