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.
This commit is contained in:
Wieland Hoffmann
2011-12-13 10:21:43 +01:00
parent 0b9fad8afc
commit e96bed2154
7 changed files with 265 additions and 350 deletions

View File

@@ -34,7 +34,6 @@ from picard.ui.options import (
matching,
metadata,
releases,
moving,
renaming,
plugins,
proxy,

View File

@@ -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)

View File

@@ -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("")

View File

@@ -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:"))

View File

@@ -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", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
"<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n"
"p, li { white-space: pre-wrap; }\n"
"</style></head><body style=\" font-family:\'Monospace\'; font-size:9pt; font-weight:400; font-style:normal;\">\n"
"<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>", 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", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
"<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n"
"p, li { white-space: pre-wrap; }\n"
"</style></head><body style=\" font-family:\'Monospace\'; font-size:10pt; font-weight:400; font-style:normal;\">\n"
"<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>", 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

View File

@@ -1,80 +0,0 @@
<ui version="4.0" >
<class>MovingOptionsPage</class>
<widget class="QWidget" name="MovingOptionsPage" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>504</width>
<height>563</height>
</rect>
</property>
<layout class="QGridLayout" >
<item row="8" column="0" >
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0" >
<size>
<width>378</width>
<height>16</height>
</size>
</property>
</spacer>
</item>
<item row="5" column="0" >
<widget class="QLineEdit" name="move_additional_files_pattern" />
</item>
<item row="4" column="0" >
<widget class="QCheckBox" name="move_additional_files" >
<property name="text" >
<string>Move additional files:</string>
</property>
</widget>
</item>
<item row="2" column="0" >
<layout class="QHBoxLayout" >
<property name="spacing" >
<number>2</number>
</property>
<property name="margin" >
<number>0</number>
</property>
<item>
<widget class="QLineEdit" name="move_files_to" />
</item>
<item>
<widget class="QPushButton" name="move_files_to_browse" >
<property name="text" >
<string>Browse...</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="3" column="0" >
<widget class="QCheckBox" name="delete_empty_dirs" >
<property name="text" >
<string>Delete empty directories</string>
</property>
</widget>
</item>
<item row="1" column="0" >
<widget class="QCheckBox" name="move_files" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text" >
<string>Move files to this directory when saving:</string>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>

View File

@@ -1,7 +1,11 @@
<ui version="4.0" >
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>RenamingOptionsPage</class>
<widget class="QWidget" name="RenamingOptionsPage" >
<property name="geometry" >
<widget class="QWidget" name="RenamingOptionsPage">
<property name="enabled">
<bool>true</bool>
</property>
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
@@ -9,119 +13,174 @@
<height>693</height>
</rect>
</property>
<property name="sizePolicy" >
<sizepolicy vsizetype="Preferred" hsizetype="Expanding" >
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="windowTitle" >
<property name="windowTitle">
<string/>
</property>
<layout class="QVBoxLayout" >
<layout class="QVBoxLayout">
<item>
<widget class="QCheckBox" name="rename_files" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text" >
<string>Rename files when saving</string>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>When saving files</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="action_box">
<item>
<property name="text">
<string>Do nothing</string>
</property>
</item>
<item>
<property name="text">
<string>Rename files</string>
</property>
</item>
<item>
<property name="text">
<string>Move files</string>
</property>
</item>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="QLineEdit" name="move_files_to">
<property name="enabled">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="move_files_to_browse">
<property name="enabled">
<bool>true</bool>
</property>
<property name="text">
<string>Browse...</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QCheckBox" name="move_additional_files">
<property name="text">
<string>Move additional files:</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="ascii_filenames" >
<property name="text" >
<widget class="QLineEdit" name="move_additional_files_pattern"/>
</item>
<item>
<widget class="QCheckBox" name="delete_empty_dirs">
<property name="text">
<string>Delete empty directories</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="ascii_filenames">
<property name="text">
<string>Replace non-ASCII characters</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="windows_compatible_filenames" >
<property name="text" >
<widget class="QCheckBox" name="windows_compatible_filenames">
<property name="text">
<string>Replace Windows-incompatible characters</string>
</property>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox" >
<property name="title" >
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Name files like this</string>
</property>
<property name="flat" >
<property name="flat">
<bool>false</bool>
</property>
<layout class="QVBoxLayout" name="verticalLayout_4" >
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<widget class="QTextEdit" name="file_naming_format" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Expanding" hsizetype="Expanding" >
<widget class="QTextEdit" name="file_naming_format">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize" >
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="font" >
<property name="font">
<font>
<family>Monospace</family>
</font>
</property>
<property name="cursor" stdset="0" >
<property name="cursor" stdset="0">
<cursorShape>IBeamCursor</cursorShape>
</property>
<property name="lineWrapMode" >
<property name="lineWrapMode">
<enum>QTextEdit::NoWrap</enum>
</property>
<property name="html" >
<string>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;style type="text/css">
<property name="html">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style>&lt;/head>&lt;body style=" font-family:'Monospace'; font-size:10pt; font-weight:400; font-style:normal;">
&lt;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;">&lt;/p>&lt;/body>&lt;/html></string>
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Monospace'; font-size:9pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot;-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;&quot;&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="tabStopWidth" >
<property name="tabStopWidth">
<number>20</number>
</property>
<property name="acceptRichText" >
<property name="acceptRichText">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2" >
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="renaming_error" >
<property name="text" >
<widget class="QLabel" name="renaming_error">
<property name="text">
<string/>
</property>
<property name="alignment" >
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="file_naming_format_default" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
<widget class="QPushButton" name="file_naming_format_default">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize" >
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="text" >
<property name="text">
<string>Default</string>
</property>
</widget>
@@ -132,36 +191,36 @@ p, li { white-space: pre-wrap; }
</widget>
</item>
<item>
<widget class="QGroupBox" name="use_va_format" >
<property name="title" >
<widget class="QGroupBox" name="use_va_format">
<property name="title">
<string>Name multiple artist albums differently</string>
</property>
<property name="flat" >
<property name="flat">
<bool>false</bool>
</property>
<property name="checkable" >
<property name="checkable">
<bool>true</bool>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3" >
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<layout class="QHBoxLayout" >
<layout class="QHBoxLayout">
<item>
<widget class="QTextEdit" name="va_file_naming_format" >
<property name="font" >
<widget class="QTextEdit" name="va_file_naming_format">
<property name="font">
<font>
<family>Monospace</family>
</font>
</property>
<property name="cursor" stdset="0" >
<property name="cursor" stdset="0">
<cursorShape>IBeamCursor</cursorShape>
</property>
<property name="lineWrapMode" >
<property name="lineWrapMode">
<enum>QTextEdit::NoWrap</enum>
</property>
<property name="tabStopWidth" >
<property name="tabStopWidth">
<number>20</number>
</property>
<property name="acceptRichText" >
<property name="acceptRichText">
<bool>true</bool>
</property>
</widget>
@@ -169,51 +228,51 @@ p, li { white-space: pre-wrap; }
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3" >
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QLabel" name="renaming_va_error" >
<property name="text" >
<widget class="QLabel" name="renaming_va_error">
<property name="text">
<string/>
</property>
<property name="alignment" >
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="va_copy_from_above" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
<widget class="QPushButton" name="va_copy_from_above">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize" >
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="text" >
<property name="text">
<string>Copy from above</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="va_file_naming_format_default" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
<widget class="QPushButton" name="va_file_naming_format_default">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize" >
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="text" >
<property name="text">
<string>Default</string>
</property>
</widget>
@@ -224,42 +283,42 @@ p, li { white-space: pre-wrap; }
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_2" >
<property name="title" >
<widget class="QGroupBox" name="groupBox_2">
<property name="title">
<string>Examples</string>
</property>
<property name="flat" >
<property name="flat">
<bool>false</bool>
</property>
<layout class="QVBoxLayout" name="verticalLayout" >
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLabel" name="example_filename" >
<property name="font" >
<widget class="QLabel" name="example_filename">
<property name="font">
<font>
<weight>50</weight>
<italic>false</italic>
<bold>false</bold>
</font>
</property>
<property name="frameShape" >
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow" >
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
<property name="lineWidth" >
<property name="lineWidth">
<number>1</number>
</property>
<property name="text" >
<property name="text">
<string/>
</property>
<property name="textFormat" >
<property name="textFormat">
<enum>Qt::RichText</enum>
</property>
<property name="wordWrap" >
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="textInteractionFlags" >
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse</set>
</property>
</widget>