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-1077: Fix update encoding logic on id3 version change #712

Merged
merged 1 commit into from
May 1, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 5 additions & 3 deletions picard/ui/options/tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

from functools import partial
from PyQt5 import QtCore, QtWidgets
from picard import config
from picard.ui.options import OptionsPage, register_options_page
Expand Down Expand Up @@ -51,7 +52,7 @@ def __init__(self, parent=None):
self.ui = Ui_TagsOptionsPage()
self.ui.setupUi(self)
self.ui.write_id3v23.clicked.connect(self.update_encodings)
self.ui.write_id3v24.clicked.connect(self.update_encodings)
self.ui.write_id3v24.clicked.connect(partial(self.update_encodings, force_utf8=True))
self.completer = QtWidgets.QCompleter(sorted(TAG_NAMES.keys()), self)
self.completer.setCaseSensitivity(QtCore.Qt.CaseInsensitive)
self.completer.setWidget(self.ui.preserved_tags)
Expand Down Expand Up @@ -100,7 +101,7 @@ def save(self):
config.setting["preserved_tags"] = self.ui.preserved_tags.text()
self.tagger.window.enable_tag_saving_action.setChecked(not config.setting["dont_write_tags"])

def update_encodings(self):
def update_encodings(self, force_utf8=False):
if self.ui.write_id3v23.isChecked():
if self.ui.enc_utf8.isChecked():
self.ui.enc_utf16.setChecked(True)
Expand All @@ -109,7 +110,8 @@ def update_encodings(self):
self.ui.id3v23_join_with.setEnabled(True)
else:
self.ui.enc_utf8.setEnabled(True)
self.ui.enc_utf8.setChecked(True)
if force_utf8:
self.ui.enc_utf8.setChecked(True)
self.ui.label_id3v23_join_with.setEnabled(False)
self.ui.id3v23_join_with.setEnabled(False)

Expand Down