- 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
- 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) {
APP_VERSION = 2.9
APP_VERSION = 2.10
}
macos: {

View File

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

View File

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

View File

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