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

PICARD-1192: set QTextDocumentWriter format to plaintext, and allow any filename #840

Merged
merged 2 commits into from Feb 14, 2018

Conversation

zas
Copy link
Collaborator

@zas zas commented Feb 13, 2018

Summary

  • This is a…
    • Bug fix
    • Feature addition
    • Refactoring
    • Minor / simple change (like a typo)
    • Other
  • Describe this change in 1-2 sentences:

Problem

Saving log file with anything but .txt extension doesn't work

Solution

  • plaintext format was set from filename, which doesn't work if the file isn't a .txt
  • filter prevents selecting other filename, one may want to save to picard.log
  • an error message will be displayed if something prevented the file to be written

Action

Test & review

@zas zas requested a review from samj1912 February 13, 2018 15:59
@zas
Copy link
Collaborator Author

zas commented Feb 13, 2018

Replace #837

@vishichoudhary
Copy link
Contributor

@zas . We can still go with filters, to hide other extension file from user. Also we can show message if the file has been created successfully. Something like "logs have been saved in ----- file ."

@zas
Copy link
Collaborator Author

zas commented Feb 13, 2018

@zas . We can still go with filters, to hide other extension file from user. Also we can show message if the file has been created successfully. Something like "logs have been saved in ----- file ."

About filters, if we decide the user can choose whatever extensions he wants (including none), there's no need of filters, that would mislead the user in thinking only those extensions can be used. Note that meaning of extensions is mostly a windows thing.

Since this PR displays a message if something is wrong, there's no point to show a message in case of success (that would add one more action to close the message).
http://www.faqs.org/docs/artu/ch01s06.html#id2878450

@@ -271,7 +276,7 @@ def _clear_log_do(self):
reply = QtWidgets.QMessageBox.question(
self,
_("Clear Log"),
_("Are you sure you want to clear the log?"),
("Are you sure you want to clear the log?"),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why remove i18n?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why remove i18n?

Is "because i suck" an acceptable answer ? ;)
Fixed and rebased, thanks for spotting this typo.

…ny filename

- plaintext format was set from filename, which doesn't work if the file isn't a .txt
- filter prevents selecting other filename, one may want to save to picard.log
- an error message will be displayed if something prevented the file to be written
@zas zas merged commit c35cdd0 into metabrainz:master Feb 14, 2018
@zas zas deleted the fix_log_saveas branch February 14, 2018 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants