diff --git a/NEWS.md b/NEWS.md index e92ed694..f27be844 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,6 @@ Version 0.7.0 - fix: Backspace still works in readonly mode + - fix: save as file dialog's operation mode is not correct Version 0.6.8 - enhancement: add link to cppreference in the help menu diff --git a/RedPandaIDE/editor.cpp b/RedPandaIDE/editor.cpp index cdc7001f..d99ba82e 100644 --- a/RedPandaIDE/editor.cpp +++ b/RedPandaIDE/editor.cpp @@ -245,16 +245,21 @@ bool Editor::saveAs(const QString &name, bool fromProject){ QString newName = name; if (name.isEmpty()) { QString selectedFileFilter; - if (pSettings->editor().defaultFileCpp()) + QString defaultExt; + if (pSettings->editor().defaultFileCpp()) { selectedFileFilter = pSystemConsts->defaultCPPFileFilter(); - else + defaultExt = "cpp"; + } else { selectedFileFilter = pSystemConsts->defaultCFileFilter(); + defaultExt = "c"; + } QFileDialog dialog(this,tr("Save As"),extractFilePath(mFilename), pSystemConsts->defaultFileFilters().join(";;")); dialog.selectNameFilter(selectedFileFilter); + dialog.setDefaultSuffix(defaultExt); dialog.selectFile(mFilename); dialog.setFileMode(QFileDialog::AnyFile); - dialog.setOption(QFileDialog::DontConfirmOverwrite,false); + dialog.setAcceptMode(QFileDialog::AcceptSave); connect(&dialog, &QFileDialog::filterSelected, [&dialog](const QString &filter){ int pos = filter.indexOf("*."); diff --git a/RedPandaIDE/mainwindow.cpp b/RedPandaIDE/mainwindow.cpp index c8ef1260..3d09fa8e 100644 --- a/RedPandaIDE/mainwindow.cpp +++ b/RedPandaIDE/mainwindow.cpp @@ -3910,7 +3910,7 @@ void MainWindow::on_actionAdd_to_project_triggered() mProject->directory(), pSystemConsts->defaultFileFilters().join(";;")); dialog.setFileMode(QFileDialog::ExistingFiles); - dialog.setOption(QFileDialog::DontConfirmOverwrite,true); + dialog.setAcceptMode(QFileDialog::AcceptOpen); if (dialog.exec()) { QModelIndex current = ui->projectView->currentIndex(); FolderNode * node = nullptr; diff --git a/RedPandaIDE/qsynedit/SynEdit.cpp b/RedPandaIDE/qsynedit/SynEdit.cpp index 3deeb68e..9a772402 100644 --- a/RedPandaIDE/qsynedit/SynEdit.cpp +++ b/RedPandaIDE/qsynedit/SynEdit.cpp @@ -2202,7 +2202,7 @@ void SynEdit::computeScroll(int X, int Y) mScrollDeltaY = (Y - iScrollBounds.top()) / mTextHeight - 1; else if (Y >= iScrollBounds.bottom()) mScrollDeltaY = (Y - iScrollBounds.bottom()) / mTextHeight + 1; - else + else mScrollDeltaY = 0; if (mScrollDeltaX!=0 || mScrollDeltaY!=0)