-
Notifications
You must be signed in to change notification settings - Fork 215
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix for #615 #616
Fix for #615 #616
Conversation
@@ -156,6 +156,16 @@ int ImageWriter::print(QWidget *doc) | |||
if (dlg->exec()) { | |||
QString filename = dlg->FileToSave(); | |||
lastExportFilename = filename; | |||
if (QFile::exists(filename)) { | |||
int r = QMessageBox::question(0,QObject::tr("Export as image"), | |||
QObject::tr("File already exists." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need a space or line break here.
Perhaps reuse the already translated strings from
https://github.com/Qucs/qucs/blob/release-0.0.19/qucs/qucs/qucs_actions.cpp#L923
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I replaced messages by already translated from the qucs_actions
.
@@ -156,6 +156,16 @@ int ImageWriter::print(QWidget *doc) | |||
if (dlg->exec()) { | |||
QString filename = dlg->FileToSave(); | |||
lastExportFilename = filename; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit-picking/question: should the lastExportFilename
be updated only if actually used successfully, i.e. move the assignment after the if (r == QMessageBox::No)
check?
Yes, |
This PR is fix for #615. Added a dialog when image file to export already exists. It will preserve image file form automatic overwriting.