- fix: save as file dialog's operation mode is not correct
This commit is contained in:
parent
cd91df6fb8
commit
d188d8897f
1
NEWS.md
1
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
|
||||
|
|
|
@ -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("*.");
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue