From e96bed2154694c62546d91bd006dff7469772dc4 Mon Sep 17 00:00:00 2001 From: Wieland Hoffmann Date: Tue, 13 Dec 2011 10:21:43 +0100 Subject: [PATCH] Merge the renaming and moving options pages This removes the dependency of the examples on the renaming page on the moving option on another page, that wasn't handled at all before. --- picard/ui/options/dialog.py | 1 - picard/ui/options/moving.py | 84 ----------- picard/ui/options/renaming.py | 69 +++++++-- picard/ui/ui_options_moving.py | 62 --------- picard/ui/ui_options_renaming.py | 88 ++++++++---- ui/options_moving.ui | 80 ----------- ui/options_renaming.ui | 231 +++++++++++++++++++------------ 7 files changed, 265 insertions(+), 350 deletions(-) delete mode 100644 picard/ui/options/moving.py delete mode 100644 picard/ui/ui_options_moving.py delete mode 100644 ui/options_moving.ui diff --git a/picard/ui/options/dialog.py b/picard/ui/options/dialog.py index f490d9c8e..9b40616b7 100644 --- a/picard/ui/options/dialog.py +++ b/picard/ui/options/dialog.py @@ -34,7 +34,6 @@ from picard.ui.options import ( matching, metadata, releases, - moving, renaming, plugins, proxy, diff --git a/picard/ui/options/moving.py b/picard/ui/options/moving.py deleted file mode 100644 index a12510fcb..000000000 --- a/picard/ui/options/moving.py +++ /dev/null @@ -1,84 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Picard, the next-generation MusicBrainz tagger -# Copyright (C) 2006 Lukáš Lalinský -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - -import os.path -import sys -from PyQt4 import QtCore, QtGui -from picard.config import BoolOption, TextOption -from picard.file import File -from picard.script import ScriptParser -from picard.ui.options import OptionsPage, OptionsCheckError, register_options_page -from picard.ui.ui_options_moving import Ui_MovingOptionsPage -from picard.util import decode_filename - -class MovingOptionsPage(OptionsPage): - - NAME = "filemoving" - TITLE = N_("Moving files") - PARENT = None - SORT_ORDER = 40 - ACTIVE = True - - options = [ - BoolOption("setting", "move_files", False), - TextOption("setting", "move_files_to", ""), - BoolOption("setting", "move_additional_files", False), - TextOption("setting", "move_additional_files_pattern", "*.jpg *.png"), - BoolOption("setting", "delete_empty_dirs", True), - ] - - def __init__(self, parent=None): - super(MovingOptionsPage, self).__init__(parent) - self.ui = Ui_MovingOptionsPage() - self.ui.setupUi(self) - self.connect(self.ui.move_files_to_browse, QtCore.SIGNAL("clicked()"), self.move_files_to_browse) - self.connect(self.ui.move_additional_files, QtCore.SIGNAL("clicked()"), self.update_move_additional_files) - - def load(self): - self.ui.move_files.setChecked(self.config.setting["move_files"]) - self.ui.move_files_to.setText(self.config.setting["move_files_to"]) - self.ui.move_files_to.setCursorPosition(0) - self.ui.move_additional_files.setChecked(self.config.setting["move_additional_files"]) - self.ui.move_additional_files_pattern.setText(self.config.setting["move_additional_files_pattern"]) - self.update_move_additional_files() - self.ui.delete_empty_dirs.setChecked(self.config.setting["delete_empty_dirs"]) - - - def check(self): - if self.ui.move_files.isChecked() and not unicode(self.ui.move_files_to.text()).strip(): - raise OptionsCheckError(_("Error"), _("The location to move files to must not be empty.")) - - def save(self): - self.config.setting["move_files"] = self.ui.move_files.isChecked() - self.config.setting["move_files_to"] = os.path.normpath(unicode(self.ui.move_files_to.text())) - self.config.setting["move_additional_files"] = self.ui.move_additional_files.isChecked() - self.config.setting["move_additional_files_pattern"] = unicode(self.ui.move_additional_files_pattern.text()) - self.config.setting["delete_empty_dirs"] = self.ui.delete_empty_dirs.isChecked() - self.tagger.window.enable_moving_action.setChecked(self.config.setting["move_files"]) - - def move_files_to_browse(self): - path = QtGui.QFileDialog.getExistingDirectory(self, "", self.ui.move_files_to.text()) - if path: - path = os.path.normpath(unicode(path)) - self.ui.move_files_to.setText(path) - - def update_move_additional_files(self): - self.ui.move_additional_files_pattern.setEnabled(self.ui.move_additional_files.isChecked()) - -register_options_page(MovingOptionsPage) diff --git a/picard/ui/options/renaming.py b/picard/ui/options/renaming.py index 2134b28f8..d6d7c2685 100644 --- a/picard/ui/options/renaming.py +++ b/picard/ui/options/renaming.py @@ -26,7 +26,6 @@ from picard.file import File from picard.script import ScriptParser, SyntaxError, UnknownFunction from picard.ui.options import OptionsPage, OptionsCheckError, register_options_page from picard.ui.ui_options_renaming import Ui_RenamingOptionsPage -from picard.util import decode_filename from picard.ui.options.scripting import TaggerScriptSyntaxHighlighter class RenamingOptionsPage(OptionsPage): @@ -43,7 +42,12 @@ class RenamingOptionsPage(OptionsPage): BoolOption("setting", "rename_files", False), TextOption("setting", "file_naming_format", "$if2(%albumartist%,%artist%)/%album%/$if($gt(%totaldiscs%,1),%discnumber%-,)$num(%tracknumber%,2) %title%"), TextOption("setting", "va_file_naming_format", "$if2(%albumartist%,%artist%)/%album%/$if($gt(%totaldiscs%,1),%discnumber%-,)$num(%tracknumber%,2) %artist% - %title%"), - BoolOption("setting", "use_va_format", False) + BoolOption("setting", "use_va_format", False), + BoolOption("setting", "move_files", False), + TextOption("setting", "move_files_to", ""), + BoolOption("setting", "move_additional_files", False), + TextOption("setting", "move_additional_files_pattern", "*.jpg *.png"), + BoolOption("setting", "delete_empty_dirs", True), ] def __init__(self, parent=None): @@ -55,7 +59,11 @@ class RenamingOptionsPage(OptionsPage): self.connect(self.ui.ascii_filenames, QtCore.SIGNAL("clicked()"), self.update_examples) self.connect(self.ui.windows_compatible_filenames, QtCore.SIGNAL("clicked()"), self.update_examples) self.connect(self.ui.use_va_format, QtCore.SIGNAL("clicked()"), self.update_examples) - self.connect(self.ui.rename_files, QtCore.SIGNAL("clicked()"), self.update_examples) + self.connect(self.ui.action_box, + QtCore.SIGNAL("currentIndexChanged(int)"), self.update_examples) + self.connect(self.ui.action_box, + QtCore.SIGNAL("currentIndexChanged(int)"), + self.update_enabling) self.connect(self.ui.file_naming_format, QtCore.SIGNAL("textChanged()"), self.check_formats) self.connect(self.ui.va_file_naming_format, QtCore.SIGNAL("textChanged()"), self.check_formats) @@ -63,6 +71,8 @@ class RenamingOptionsPage(OptionsPage): self.connect(self.ui.va_file_naming_format_default, QtCore.SIGNAL("clicked()"), self.set_va_file_naming_format_default) self.connect(self.ui.va_copy_from_above, QtCore.SIGNAL("clicked()"), self.copy_format_to_va) self.highlighter = TaggerScriptSyntaxHighlighter(self.ui.file_naming_format.document()) + self.connect(self.ui.move_files_to_browse, QtCore.SIGNAL("clicked()"), self.move_files_to_browse) + self.connect(self.ui.move_additional_files, QtCore.SIGNAL("clicked()"), self.update_move_additional_files) self.highlighter_va = TaggerScriptSyntaxHighlighter(self.ui.va_file_naming_format.document()) def check_formats(self): @@ -70,12 +80,26 @@ class RenamingOptionsPage(OptionsPage): self.va_test() self.update_examples() + def update_enabling(self, index): + self.ui.ascii_filenames.setEnabled(index > 0) + self.ui.delete_empty_dirs.setEnabled(index == 2) + self.ui.move_files_to.setEnabled(index == 2) + self.ui.move_files_to_browse.setEnabled(index == 2) + self.ui.move_additional_files.setEnabled(index == 2) + self.ui.move_additional_files_pattern.setEnabled(index == 2) + self.ui.file_naming_format.setEnabled(index > 0) + self.ui.file_naming_format_default.setEnabled(index > 0) + self.ui.use_va_format.setEnabled(index > 0) + self.ui.va_file_naming_format.setEnabled(index > 0) + self.ui.va_file_naming_format_default.setEnabled(index > 0) + self.ui.windows_compatible_filenames.setEnabled(index > 0) + def _example_to_filename(self, file): settings = { 'windows_compatible_filenames': self.ui.windows_compatible_filenames.isChecked(), 'ascii_filenames': self.ui.ascii_filenames.isChecked(), - 'rename_files': self.ui.rename_files.isChecked(), - 'move_files': self.config.setting["move_files"], + 'rename_files': self.ui.action_box.currentIndex() > 0, + 'move_files': self.ui.action_box.currentIndex() == 2, 'use_va_format': self.ui.use_va_format.isChecked(), 'file_naming_format': unicode(self.ui.file_naming_format.toPlainText()), 'va_file_naming_format': unicode(self.ui.va_file_naming_format.toPlainText()), @@ -107,13 +131,25 @@ class RenamingOptionsPage(OptionsPage): self.ui.windows_compatible_filenames.setChecked(self.config.setting["windows_compatible_filenames"]) self.ui.use_va_format.setChecked(self.config.setting["use_va_format"]) self.ui.ascii_filenames.setChecked(self.config.setting["ascii_filenames"]) - self.ui.rename_files.setChecked(self.config.setting["rename_files"]) self.ui.file_naming_format.setPlainText(self.config.setting["file_naming_format"]) self.ui.va_file_naming_format.setPlainText(self.config.setting["va_file_naming_format"]) + self.update_enabling(0) + if self.config.setting["rename_files"]: + self.ui.action_box.setCurrentIndex(1) + if self.config.setting["move_files"]: + self.ui.action_box.setCurrentIndex(2) + self.ui.move_files_to.setText(self.config.setting["move_files_to"]) + self.ui.move_files_to.setCursorPosition(0) + self.ui.move_additional_files.setChecked(self.config.setting["move_additional_files"]) + self.ui.move_additional_files_pattern.setText(self.config.setting["move_additional_files_pattern"]) + self.update_move_additional_files() + self.ui.delete_empty_dirs.setChecked(self.config.setting["delete_empty_dirs"]) def check(self): self.check_format() self.check_va_format() + if self.ui.action_box.currentIndex() == 2 and not unicode(self.ui.move_files_to.text()).strip(): + raise OptionsCheckError(_("Error"), _("The location to move files to must not be empty.")) def check_format(self): parser = ScriptParser() @@ -121,7 +157,7 @@ class RenamingOptionsPage(OptionsPage): parser.eval(unicode(self.ui.file_naming_format.toPlainText())) except Exception, e: raise OptionsCheckError("", str(e)) - if self.ui.rename_files.isChecked(): + if self.ui.action_box.currentIndex() > 0: if not unicode(self.ui.file_naming_format.toPlainText()).strip(): raise OptionsCheckError("", _("The file naming format must not be empty.")) @@ -131,7 +167,7 @@ class RenamingOptionsPage(OptionsPage): parser.eval(unicode(self.ui.va_file_naming_format.toPlainText())) except Exception, e: raise OptionsCheckError("", str(e)) - if self.ui.rename_files.isChecked(): + if self.ui.action_box.currentIndex() > 0: if self.ui.use_va_format.isChecked() and not unicode(self.ui.va_file_naming_format.toPlainText()).strip(): raise OptionsCheckError("", _("The multiple artist file naming format must not be empty.")) @@ -139,10 +175,16 @@ class RenamingOptionsPage(OptionsPage): self.config.setting["use_va_format"] = self.ui.use_va_format.isChecked() self.config.setting["windows_compatible_filenames"] = self.ui.windows_compatible_filenames.isChecked() self.config.setting["ascii_filenames"] = self.ui.ascii_filenames.isChecked() - self.config.setting["rename_files"] = self.ui.rename_files.isChecked() + self.config.setting["rename_files"] = self.ui.action_box.currentIndex() == 1 self.config.setting["file_naming_format"] = unicode(self.ui.file_naming_format.toPlainText()) self.config.setting["va_file_naming_format"] = unicode(self.ui.va_file_naming_format.toPlainText()) self.tagger.window.enable_renaming_action.setChecked(self.config.setting["rename_files"]) + self.config.setting["move_files"] = self.ui.action_box.currentIndex() == 2 + self.config.setting["move_files_to"] = os.path.normpath(unicode(self.ui.move_files_to.text())) + self.config.setting["move_additional_files"] = self.ui.move_additional_files.isChecked() + self.config.setting["move_additional_files_pattern"] = unicode(self.ui.move_additional_files_pattern.text()) + self.config.setting["delete_empty_dirs"] = self.ui.delete_empty_dirs.isChecked() + self.tagger.window.enable_moving_action.setChecked(self.config.setting["move_files"]) def display_error(self, error): pass @@ -209,6 +251,12 @@ class RenamingOptionsPage(OptionsPage): STYLESHEET_ERROR = "QWidget { background-color: #f55; color: white; font-weight:bold }" + def move_files_to_browse(self): + path = QtGui.QFileDialog.getExistingDirectory(self, "", self.ui.move_files_to.text()) + if path: + path = os.path.normpath(unicode(path)) + self.ui.move_files_to.setText(path) + def test(self): self.ui.renaming_error.setStyleSheet(""); self.ui.renaming_error.setText("") @@ -219,6 +267,9 @@ class RenamingOptionsPage(OptionsPage): self.ui.renaming_error.setText(e.info) return + def update_move_additional_files(self): + self.ui.move_additional_files_pattern.setEnabled(self.ui.move_additional_files.isChecked()) + def va_test(self): self.ui.renaming_va_error.setStyleSheet(""); self.ui.renaming_va_error.setText("") diff --git a/picard/ui/ui_options_moving.py b/picard/ui/ui_options_moving.py deleted file mode 100644 index cc23abfb3..000000000 --- a/picard/ui/ui_options_moving.py +++ /dev/null @@ -1,62 +0,0 @@ -# -*- coding: utf-8 -*- - -# Form implementation generated from reading ui file 'ui/options_moving.ui' -# -# Created: Thu Sep 15 13:39:10 2011 -# by: PyQt4 UI code generator 4.8.3 -# -# WARNING! All changes made in this file will be lost! - -from PyQt4 import QtCore, QtGui - -try: - _fromUtf8 = QtCore.QString.fromUtf8 -except AttributeError: - _fromUtf8 = lambda s: s - -class Ui_MovingOptionsPage(object): - def setupUi(self, MovingOptionsPage): - MovingOptionsPage.setObjectName(_fromUtf8("MovingOptionsPage")) - MovingOptionsPage.resize(504, 563) - self.gridlayout = QtGui.QGridLayout(MovingOptionsPage) - self.gridlayout.setObjectName(_fromUtf8("gridlayout")) - spacerItem = QtGui.QSpacerItem(378, 16, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) - self.gridlayout.addItem(spacerItem, 8, 0, 1, 1) - self.move_additional_files_pattern = QtGui.QLineEdit(MovingOptionsPage) - self.move_additional_files_pattern.setObjectName(_fromUtf8("move_additional_files_pattern")) - self.gridlayout.addWidget(self.move_additional_files_pattern, 5, 0, 1, 1) - self.move_additional_files = QtGui.QCheckBox(MovingOptionsPage) - self.move_additional_files.setObjectName(_fromUtf8("move_additional_files")) - self.gridlayout.addWidget(self.move_additional_files, 4, 0, 1, 1) - self.hboxlayout = QtGui.QHBoxLayout() - self.hboxlayout.setSpacing(2) - self.hboxlayout.setMargin(0) - self.hboxlayout.setObjectName(_fromUtf8("hboxlayout")) - self.move_files_to = QtGui.QLineEdit(MovingOptionsPage) - self.move_files_to.setObjectName(_fromUtf8("move_files_to")) - self.hboxlayout.addWidget(self.move_files_to) - self.move_files_to_browse = QtGui.QPushButton(MovingOptionsPage) - self.move_files_to_browse.setObjectName(_fromUtf8("move_files_to_browse")) - self.hboxlayout.addWidget(self.move_files_to_browse) - self.gridlayout.addLayout(self.hboxlayout, 2, 0, 1, 1) - self.delete_empty_dirs = QtGui.QCheckBox(MovingOptionsPage) - self.delete_empty_dirs.setObjectName(_fromUtf8("delete_empty_dirs")) - self.gridlayout.addWidget(self.delete_empty_dirs, 3, 0, 1, 1) - self.move_files = QtGui.QCheckBox(MovingOptionsPage) - sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed) - sizePolicy.setHorizontalStretch(0) - sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.move_files.sizePolicy().hasHeightForWidth()) - self.move_files.setSizePolicy(sizePolicy) - self.move_files.setObjectName(_fromUtf8("move_files")) - self.gridlayout.addWidget(self.move_files, 1, 0, 1, 1) - - self.retranslateUi(MovingOptionsPage) - QtCore.QMetaObject.connectSlotsByName(MovingOptionsPage) - - def retranslateUi(self, MovingOptionsPage): - self.move_additional_files.setText(_("Move additional files:")) - self.move_files_to_browse.setText(_("Browse...")) - self.delete_empty_dirs.setText(_("Delete empty directories")) - self.move_files.setText(_("Move files to this directory when saving:")) - diff --git a/picard/ui/ui_options_renaming.py b/picard/ui/ui_options_renaming.py index 38f4a440a..9ba5594f1 100644 --- a/picard/ui/ui_options_renaming.py +++ b/picard/ui/ui_options_renaming.py @@ -2,8 +2,8 @@ # Form implementation generated from reading ui file 'ui/options_renaming.ui' # -# Created: Thu Sep 15 13:39:09 2011 -# by: PyQt4 UI code generator 4.8.3 +# Created: Tue Dec 13 10:11:55 2011 +# by: PyQt4 UI code generator 4.8.6 # # WARNING! All changes made in this file will be lost! @@ -17,6 +17,7 @@ except AttributeError: class Ui_RenamingOptionsPage(object): def setupUi(self, RenamingOptionsPage): RenamingOptionsPage.setObjectName(_fromUtf8("RenamingOptionsPage")) + RenamingOptionsPage.setEnabled(True) RenamingOptionsPage.resize(892, 693) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) @@ -26,21 +27,55 @@ class Ui_RenamingOptionsPage(object): RenamingOptionsPage.setWindowTitle(_fromUtf8("")) self.vboxlayout = QtGui.QVBoxLayout(RenamingOptionsPage) self.vboxlayout.setObjectName(_fromUtf8("vboxlayout")) - self.rename_files = QtGui.QCheckBox(RenamingOptionsPage) - sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed) - sizePolicy.setHorizontalStretch(0) - sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.rename_files.sizePolicy().hasHeightForWidth()) - self.rename_files.setSizePolicy(sizePolicy) - self.rename_files.setObjectName(_fromUtf8("rename_files")) - self.vboxlayout.addWidget(self.rename_files) + self.horizontalLayout = QtGui.QHBoxLayout() + self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout")) + self.label = QtGui.QLabel(RenamingOptionsPage) + self.label.setText(QtGui.QApplication.translate("RenamingOptionsPage", "When saving files", None, QtGui.QApplication.UnicodeUTF8)) + self.label.setObjectName(_fromUtf8("label")) + self.horizontalLayout.addWidget(self.label) + self.action_box = QtGui.QComboBox(RenamingOptionsPage) + self.action_box.setObjectName(_fromUtf8("action_box")) + self.action_box.addItem(_fromUtf8("")) + self.action_box.setItemText(0, QtGui.QApplication.translate("RenamingOptionsPage", "Do nothing", None, QtGui.QApplication.UnicodeUTF8)) + self.action_box.addItem(_fromUtf8("")) + self.action_box.setItemText(1, QtGui.QApplication.translate("RenamingOptionsPage", "Rename files", None, QtGui.QApplication.UnicodeUTF8)) + self.action_box.addItem(_fromUtf8("")) + self.action_box.setItemText(2, QtGui.QApplication.translate("RenamingOptionsPage", "Move files", None, QtGui.QApplication.UnicodeUTF8)) + self.horizontalLayout.addWidget(self.action_box) + self.vboxlayout.addLayout(self.horizontalLayout) + self.horizontalLayout_4 = QtGui.QHBoxLayout() + self.horizontalLayout_4.setObjectName(_fromUtf8("horizontalLayout_4")) + self.move_files_to = QtGui.QLineEdit(RenamingOptionsPage) + self.move_files_to.setEnabled(True) + self.move_files_to.setObjectName(_fromUtf8("move_files_to")) + self.horizontalLayout_4.addWidget(self.move_files_to) + self.move_files_to_browse = QtGui.QPushButton(RenamingOptionsPage) + self.move_files_to_browse.setEnabled(True) + self.move_files_to_browse.setText(QtGui.QApplication.translate("RenamingOptionsPage", "Browse...", None, QtGui.QApplication.UnicodeUTF8)) + self.move_files_to_browse.setObjectName(_fromUtf8("move_files_to_browse")) + self.horizontalLayout_4.addWidget(self.move_files_to_browse) + self.vboxlayout.addLayout(self.horizontalLayout_4) + self.move_additional_files = QtGui.QCheckBox(RenamingOptionsPage) + self.move_additional_files.setText(QtGui.QApplication.translate("RenamingOptionsPage", "Move additional files:", None, QtGui.QApplication.UnicodeUTF8)) + self.move_additional_files.setObjectName(_fromUtf8("move_additional_files")) + self.vboxlayout.addWidget(self.move_additional_files) + self.move_additional_files_pattern = QtGui.QLineEdit(RenamingOptionsPage) + self.move_additional_files_pattern.setObjectName(_fromUtf8("move_additional_files_pattern")) + self.vboxlayout.addWidget(self.move_additional_files_pattern) + self.delete_empty_dirs = QtGui.QCheckBox(RenamingOptionsPage) + self.delete_empty_dirs.setText(QtGui.QApplication.translate("RenamingOptionsPage", "Delete empty directories", None, QtGui.QApplication.UnicodeUTF8)) + self.delete_empty_dirs.setObjectName(_fromUtf8("delete_empty_dirs")) + self.vboxlayout.addWidget(self.delete_empty_dirs) self.ascii_filenames = QtGui.QCheckBox(RenamingOptionsPage) + self.ascii_filenames.setText(QtGui.QApplication.translate("RenamingOptionsPage", "Replace non-ASCII characters", None, QtGui.QApplication.UnicodeUTF8)) self.ascii_filenames.setObjectName(_fromUtf8("ascii_filenames")) self.vboxlayout.addWidget(self.ascii_filenames) self.windows_compatible_filenames = QtGui.QCheckBox(RenamingOptionsPage) + self.windows_compatible_filenames.setText(QtGui.QApplication.translate("RenamingOptionsPage", "Replace Windows-incompatible characters", None, QtGui.QApplication.UnicodeUTF8)) self.windows_compatible_filenames.setObjectName(_fromUtf8("windows_compatible_filenames")) self.vboxlayout.addWidget(self.windows_compatible_filenames) self.groupBox = QtGui.QGroupBox(RenamingOptionsPage) + self.groupBox.setTitle(QtGui.QApplication.translate("RenamingOptionsPage", "Name files like this", None, QtGui.QApplication.UnicodeUTF8)) self.groupBox.setFlat(False) self.groupBox.setObjectName(_fromUtf8("groupBox")) self.verticalLayout_4 = QtGui.QVBoxLayout(self.groupBox) @@ -55,8 +90,13 @@ class Ui_RenamingOptionsPage(object): font = QtGui.QFont() font.setFamily(_fromUtf8("Monospace")) self.file_naming_format.setFont(font) - self.file_naming_format.setProperty(_fromUtf8("cursor"), QtCore.Qt.IBeamCursor) + self.file_naming_format.viewport().setProperty("cursor", QtGui.QCursor(QtCore.Qt.IBeamCursor)) self.file_naming_format.setLineWrapMode(QtGui.QTextEdit.NoWrap) + self.file_naming_format.setHtml(QtGui.QApplication.translate("RenamingOptionsPage", "\n" +"\n" +"

", None, QtGui.QApplication.UnicodeUTF8)) self.file_naming_format.setTabStopWidth(20) self.file_naming_format.setAcceptRichText(True) self.file_naming_format.setObjectName(_fromUtf8("file_naming_format")) @@ -75,11 +115,13 @@ class Ui_RenamingOptionsPage(object): sizePolicy.setHeightForWidth(self.file_naming_format_default.sizePolicy().hasHeightForWidth()) self.file_naming_format_default.setSizePolicy(sizePolicy) self.file_naming_format_default.setMinimumSize(QtCore.QSize(0, 0)) + self.file_naming_format_default.setText(QtGui.QApplication.translate("RenamingOptionsPage", "Default", None, QtGui.QApplication.UnicodeUTF8)) self.file_naming_format_default.setObjectName(_fromUtf8("file_naming_format_default")) self.horizontalLayout_2.addWidget(self.file_naming_format_default) self.verticalLayout_4.addLayout(self.horizontalLayout_2) self.vboxlayout.addWidget(self.groupBox) self.use_va_format = QtGui.QGroupBox(RenamingOptionsPage) + self.use_va_format.setTitle(QtGui.QApplication.translate("RenamingOptionsPage", "Name multiple artist albums differently", None, QtGui.QApplication.UnicodeUTF8)) self.use_va_format.setFlat(False) self.use_va_format.setCheckable(True) self.use_va_format.setObjectName(_fromUtf8("use_va_format")) @@ -91,7 +133,7 @@ class Ui_RenamingOptionsPage(object): font = QtGui.QFont() font.setFamily(_fromUtf8("Monospace")) self.va_file_naming_format.setFont(font) - self.va_file_naming_format.setProperty(_fromUtf8("cursor"), QtCore.Qt.IBeamCursor) + self.va_file_naming_format.viewport().setProperty("cursor", QtGui.QCursor(QtCore.Qt.IBeamCursor)) self.va_file_naming_format.setLineWrapMode(QtGui.QTextEdit.NoWrap) self.va_file_naming_format.setTabStopWidth(20) self.va_file_naming_format.setAcceptRichText(True) @@ -112,6 +154,7 @@ class Ui_RenamingOptionsPage(object): sizePolicy.setHeightForWidth(self.va_copy_from_above.sizePolicy().hasHeightForWidth()) self.va_copy_from_above.setSizePolicy(sizePolicy) self.va_copy_from_above.setMinimumSize(QtCore.QSize(0, 0)) + self.va_copy_from_above.setText(QtGui.QApplication.translate("RenamingOptionsPage", "Copy from above", None, QtGui.QApplication.UnicodeUTF8)) self.va_copy_from_above.setObjectName(_fromUtf8("va_copy_from_above")) self.horizontalLayout_3.addWidget(self.va_copy_from_above) self.va_file_naming_format_default = QtGui.QPushButton(self.use_va_format) @@ -121,20 +164,22 @@ class Ui_RenamingOptionsPage(object): sizePolicy.setHeightForWidth(self.va_file_naming_format_default.sizePolicy().hasHeightForWidth()) self.va_file_naming_format_default.setSizePolicy(sizePolicy) self.va_file_naming_format_default.setMinimumSize(QtCore.QSize(0, 0)) + self.va_file_naming_format_default.setText(QtGui.QApplication.translate("RenamingOptionsPage", "Default", None, QtGui.QApplication.UnicodeUTF8)) self.va_file_naming_format_default.setObjectName(_fromUtf8("va_file_naming_format_default")) self.horizontalLayout_3.addWidget(self.va_file_naming_format_default) self.verticalLayout_3.addLayout(self.horizontalLayout_3) self.vboxlayout.addWidget(self.use_va_format) self.groupBox_2 = QtGui.QGroupBox(RenamingOptionsPage) + self.groupBox_2.setTitle(QtGui.QApplication.translate("RenamingOptionsPage", "Examples", None, QtGui.QApplication.UnicodeUTF8)) self.groupBox_2.setFlat(False) self.groupBox_2.setObjectName(_fromUtf8("groupBox_2")) self.verticalLayout = QtGui.QVBoxLayout(self.groupBox_2) self.verticalLayout.setObjectName(_fromUtf8("verticalLayout")) self.example_filename = QtGui.QLabel(self.groupBox_2) font = QtGui.QFont() - font.setWeight(50) - font.setItalic(False) font.setBold(False) + font.setItalic(False) + font.setWeight(50) self.example_filename.setFont(font) self.example_filename.setFrameShape(QtGui.QFrame.NoFrame) self.example_filename.setFrameShadow(QtGui.QFrame.Plain) @@ -151,18 +196,5 @@ class Ui_RenamingOptionsPage(object): QtCore.QMetaObject.connectSlotsByName(RenamingOptionsPage) def retranslateUi(self, RenamingOptionsPage): - self.rename_files.setText(_("Rename files when saving")) - self.ascii_filenames.setText(_("Replace non-ASCII characters")) - self.windows_compatible_filenames.setText(_("Replace Windows-incompatible characters")) - self.groupBox.setTitle(_("Name files like this")) - self.file_naming_format.setHtml(QtGui.QApplication.translate("RenamingOptionsPage", "\n" -"\n" -"

", None, QtGui.QApplication.UnicodeUTF8)) - self.file_naming_format_default.setText(_("Default")) - self.use_va_format.setTitle(_("Name multiple artist albums differently")) - self.va_copy_from_above.setText(_("Copy from above")) - self.va_file_naming_format_default.setText(_("Default")) - self.groupBox_2.setTitle(_("Examples")) + pass diff --git a/ui/options_moving.ui b/ui/options_moving.ui deleted file mode 100644 index 304542a0f..000000000 --- a/ui/options_moving.ui +++ /dev/null @@ -1,80 +0,0 @@ - - MovingOptionsPage - - - - 0 - 0 - 504 - 563 - - - - - - - Qt::Vertical - - - - 378 - 16 - - - - - - - - - - - Move additional files: - - - - - - - 2 - - - 0 - - - - - - - - Browse... - - - - - - - - - Delete empty directories - - - - - - - - 0 - 0 - - - - Move files to this directory when saving: - - - - - - - - diff --git a/ui/options_renaming.ui b/ui/options_renaming.ui index f99c3d25f..9936e4d1f 100644 --- a/ui/options_renaming.ui +++ b/ui/options_renaming.ui @@ -1,7 +1,11 @@ - + + RenamingOptionsPage - - + + + true + + 0 0 @@ -9,119 +13,174 @@ 693 - - + + 0 0 - + - + - - - - 0 - 0 - - - - Rename files when saving + + + + + When saving files + + + + + + + + Do nothing + + + + + Rename files + + + + + Move files + + + + + + + + + + + + true + + + + + + + true + + + Browse... + + + + + + + + + Move additional files: - - + + + + + + Delete empty directories + + + + + + Replace non-ASCII characters - - + + Replace Windows-incompatible characters - - + + Name files like this - + false - + - - - + + + 0 0 - + 0 0 - + Monospace - + IBeamCursor - + QTextEdit::NoWrap - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'Monospace'; font-size:10pt; font-weight:400; font-style:normal;"> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p></body></html> +</style></head><body style=" font-family:'Monospace'; font-size:9pt; font-weight:400; font-style:normal;"> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:10pt;"></p></body></html> - + 20 - + true - + - - + + - + Qt::AlignCenter - - - + + + 0 0 - + 0 0 - + Default @@ -132,36 +191,36 @@ p, li { white-space: pre-wrap; } - - + + Name multiple artist albums differently - + false - + true - + - + - - + + Monospace - + IBeamCursor - + QTextEdit::NoWrap - + 20 - + true @@ -169,51 +228,51 @@ p, li { white-space: pre-wrap; } - + - - + + - + Qt::AlignCenter - - - + + + 0 0 - + 0 0 - + Copy from above - - - + + + 0 0 - + 0 0 - + Default @@ -224,42 +283,42 @@ p, li { white-space: pre-wrap; } - - + + Examples - + false - + - - + + 50 false false - + QFrame::NoFrame - + QFrame::Plain - + 1 - + - + Qt::RichText - + true - + Qt::LinksAccessibleByMouse