diff --git a/picard/ui/options/cover.py b/picard/ui/options/cover.py index 7bc61a49e7..61881b28e6 100644 --- a/picard/ui/options/cover.py +++ b/picard/ui/options/cover.py @@ -56,6 +56,7 @@ def __init__(self, parent=None): self.ui = Ui_CoverOptionsPage() self.ui.setupUi(self) self.ui.save_images_to_files.clicked.connect(self.update_filename) + self.ui.save_images_to_tags.clicked.connect(self.update_save_images_to_tags) def load_cover_art_providers(self): """Load available providers, initialize provider-specific options, restore state of each @@ -82,8 +83,8 @@ def load(self): self.ui.save_images_to_files.setChecked(config.setting["save_images_to_files"]) self.ui.cover_image_filename.setText(config.setting["cover_image_filename"]) self.ui.save_images_overwrite.setChecked(config.setting["save_images_overwrite"]) - self.update_filename() self.load_cover_art_providers() + self.update_all() def save(self): config.setting["save_images_to_tags"] = self.ui.save_images_to_tags.isChecked() @@ -92,10 +93,17 @@ def save(self): config.setting["cover_image_filename"] = unicode(self.ui.cover_image_filename.text()) config.setting["save_images_overwrite"] = self.ui.save_images_overwrite.isChecked() + def update_all(self): + self.update_filename() + self.update_save_images_to_tags() + def update_filename(self): enabled = self.ui.save_images_to_files.isChecked() self.ui.cover_image_filename.setEnabled(enabled) self.ui.save_images_overwrite.setEnabled(enabled) + def update_save_images_to_tags(self): + enabled = self.ui.save_images_to_tags.isChecked() + self.ui.cb_embed_front_only.setEnabled(enabled) register_options_page(CoverOptionsPage) diff --git a/picard/ui/ui_options_cover.py b/picard/ui/ui_options_cover.py index 49c0d75aef..5e7f7deba0 100644 --- a/picard/ui/ui_options_cover.py +++ b/picard/ui/ui_options_cover.py @@ -25,31 +25,31 @@ def setupUi(self, CoverOptionsPage): CoverOptionsPage.resize(632, 560) self.verticalLayout = QtGui.QVBoxLayout(CoverOptionsPage) self.verticalLayout.setObjectName(_fromUtf8("verticalLayout")) - self.rename_files = QtGui.QGroupBox(CoverOptionsPage) - self.rename_files.setObjectName(_fromUtf8("rename_files")) - self.vboxlayout = QtGui.QVBoxLayout(self.rename_files) + self.location = QtGui.QGroupBox(CoverOptionsPage) + self.location.setObjectName(_fromUtf8("location")) + self.vboxlayout = QtGui.QVBoxLayout(self.location) self.vboxlayout.setSpacing(2) self.vboxlayout.setMargin(9) self.vboxlayout.setObjectName(_fromUtf8("vboxlayout")) - self.save_images_to_tags = QtGui.QCheckBox(self.rename_files) + self.save_images_to_tags = QtGui.QCheckBox(self.location) self.save_images_to_tags.setObjectName(_fromUtf8("save_images_to_tags")) self.vboxlayout.addWidget(self.save_images_to_tags) - self.cb_embed_front_only = QtGui.QCheckBox(self.rename_files) + self.cb_embed_front_only = QtGui.QCheckBox(self.location) self.cb_embed_front_only.setObjectName(_fromUtf8("cb_embed_front_only")) self.vboxlayout.addWidget(self.cb_embed_front_only) - self.save_images_to_files = QtGui.QCheckBox(self.rename_files) + self.save_images_to_files = QtGui.QCheckBox(self.location) self.save_images_to_files.setObjectName(_fromUtf8("save_images_to_files")) self.vboxlayout.addWidget(self.save_images_to_files) - self.label_3 = QtGui.QLabel(self.rename_files) - self.label_3.setObjectName(_fromUtf8("label_3")) - self.vboxlayout.addWidget(self.label_3) - self.cover_image_filename = QtGui.QLineEdit(self.rename_files) + self.label_use_filename = QtGui.QLabel(self.location) + self.label_use_filename.setObjectName(_fromUtf8("label_use_filename")) + self.vboxlayout.addWidget(self.label_use_filename) + self.cover_image_filename = QtGui.QLineEdit(self.location) self.cover_image_filename.setObjectName(_fromUtf8("cover_image_filename")) self.vboxlayout.addWidget(self.cover_image_filename) - self.save_images_overwrite = QtGui.QCheckBox(self.rename_files) + self.save_images_overwrite = QtGui.QCheckBox(self.location) self.save_images_overwrite.setObjectName(_fromUtf8("save_images_overwrite")) self.vboxlayout.addWidget(self.save_images_overwrite) - self.verticalLayout.addWidget(self.rename_files) + self.verticalLayout.addWidget(self.location) self.ca_providers_groupbox = QtGui.QGroupBox(CoverOptionsPage) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) @@ -69,7 +69,6 @@ def setupUi(self, CoverOptionsPage): self.verticalLayout.addItem(spacerItem1) self.retranslateUi(CoverOptionsPage) - QtCore.QObject.connect(self.save_images_to_tags, QtCore.SIGNAL(_fromUtf8("clicked(bool)")), self.cb_embed_front_only.setEnabled) QtCore.QMetaObject.connectSlotsByName(CoverOptionsPage) CoverOptionsPage.setTabOrder(self.save_images_to_tags, self.cb_embed_front_only) CoverOptionsPage.setTabOrder(self.cb_embed_front_only, self.save_images_to_files) @@ -77,11 +76,11 @@ def setupUi(self, CoverOptionsPage): CoverOptionsPage.setTabOrder(self.cover_image_filename, self.save_images_overwrite) def retranslateUi(self, CoverOptionsPage): - self.rename_files.setTitle(_("Location")) + self.location.setTitle(_("Location")) self.save_images_to_tags.setText(_("Embed cover images into tags")) self.cb_embed_front_only.setText(_("Only embed a front image")) self.save_images_to_files.setText(_("Save cover images as separate files")) - self.label_3.setText(_("Use the following file name for images:")) + self.label_use_filename.setText(_("Use the following file name for images:")) self.save_images_overwrite.setText(_("Overwrite the file if it already exists")) self.ca_providers_groupbox.setTitle(_("Cover Art Providers")) diff --git a/ui/options_cover.ui b/ui/options_cover.ui index ae47546147..2c7c94f2c4 100644 --- a/ui/options_cover.ui +++ b/ui/options_cover.ui @@ -12,7 +12,7 @@ - + Location @@ -45,7 +45,7 @@ - + Use the following file name for images: @@ -119,22 +119,5 @@ save_images_overwrite - - - save_images_to_tags - clicked(bool) - cb_embed_front_only - setEnabled(bool) - - - 266 - 44 - - - 266 - 67 - - - - +