Skip to content
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

Merged
merged 1 commit into from
Nov 26, 2016
Merged

Fix for #615 #616

merged 1 commit into from
Nov 26, 2016

Conversation

ra3xdh
Copy link
Contributor

@ra3xdh ra3xdh commented Nov 24, 2016

This PR is fix for #615. Added a dialog when image file to export already exists. It will preserve image file form automatic overwriting.

@ra3xdh ra3xdh mentioned this pull request Nov 24, 2016
@@ -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."
Copy link
Member

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

Copy link
Contributor Author

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;
Copy link
Contributor

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?

@ra3xdh
Copy link
Contributor Author

ra3xdh commented Nov 26, 2016

should the lastExportFilename be updated only if actually used successfully

Yes, lastExportFilename should be updated only if file was actually exported. I have changed this code.

@guitorri guitorri merged commit fd0ced0 into Qucs:release-0.0.19 Nov 26, 2016
@ra3xdh ra3xdh deleted the 615_fix branch November 27, 2016 08:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants